/* ============================================
   云逸书院 · 四号矩阵 简约网站
   视觉：米白宣纸 + 水墨 · 移动端优先
   ============================================ */

:root {
  --paper:      #f6f5f0;
  --paper-2:    #fbf9f2;
  --ink:        #2b2b2b;
  --ink-2:      #4a5b63;
  --ink-3:      #7a8a92;
  --line:       #ddd9cf;
  --line-2:     #e8e5dc;

  /* 四号主题色（原有） */
  --yunyi:      #3d5a66;   /* 云逸书院 · 黛青 */
  --xpln:       #8c4a3c;   /* 昍朤书法 · 朱砂 */
  --ketang:     #8c4a3c;   /* 书法云课堂 · 朱砂 */
  --zitie:      #476653;   /* 字帖精选 · 竹青 */

  /* 四号主题色（新增） */
  --yzjt:       #3a3a3a;   /* 云昍集团 · 墨黑 */
  --kskt:       #9c6b3f;   /* 艺术疗愈笔记 · 赭石 */
  --yysm:       #3f5f8a;   /* 云逸墨赏 · 靛蓝 */
  --ybxx:       #5a7d6a;   /* 硬笔学习 · 藤青 */

  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --kai:   "Kaiti SC", "KaiTi", "STKaiti", "Noto Serif SC", serif;

  --r: 6px;
  --shadow: 0 1px 3px rgba(43,43,43,.06), 0 6px 20px rgba(43,43,43,.05);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: .3px;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 18px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(246,245,240,.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line-2);
}
.topbar-in {
  max-width: 720px; margin: 0 auto; padding: 11px 18px;
  display: flex; align-items: center; gap: 10px;
}
.topbar .brand { font-size: 17px; font-weight: 700; letter-spacing: 2px; color: var(--ink); }
.topbar .brand small { font-size: 11px; font-weight: 400; color: var(--ink-3); letter-spacing: 1px; margin-left: 6px; }
.back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 14px; color: var(--ink-2); padding: 4px 2px;
}
.back-btn::before { content: "‹"; font-size: 20px; line-height: 1; }

/* ---------- 头图 ---------- */
.hero { text-align: center; padding: 40px 18px 26px; }
.hero .seal {
  width: 54px; height: 54px; margin: 0 auto 16px;
  border: 1.5px solid var(--yunyi); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--kai); font-size: 24px; color: var(--yunyi);
  letter-spacing: 0; line-height: 1;
}
.hero h1 {
  margin: 0 0 10px; font-size: 25px; font-weight: 700;
  letter-spacing: 5px; color: var(--ink);
}
.hero .sub {
  margin: 0; font-size: 13px; color: var(--ink-3); letter-spacing: 2px;
}
.hero .rule {
  width: 42px; height: 1px; background: var(--line); margin: 18px auto 0;
  position: relative;
}
.hero .rule::before, .hero .rule::after {
  content: "❖"; position: absolute; top: -10px; font-size: 9px; color: #c8c3b6;
}
.hero .rule::before { left: -22px; }
.hero .rule::after  { right: -22px; }

/* ---------- 四栏目宫格 ---------- */
.grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding: 6px 0 34px;
}
.card {
  position: relative; overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px 16px 18px;
  min-height: 132px;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .16s ease, box-shadow .16s ease;
}
.card:active { transform: scale(.978); }
.card::after {
  content: ""; position: absolute; left: 0; top: 0; width: 3px; height: 100%;
  background: var(--c, var(--yunyi));
  opacity: .85;
}
.card .cname {
  font-size: 18px; font-weight: 700; letter-spacing: 2px; color: var(--ink);
  margin-bottom: 6px;
}
.card .cdesc { font-size: 12px; color: var(--ink-3); line-height: 1.7; letter-spacing: .5px; }
.card .cmeta {
  margin-top: 14px; font-size: 11px; color: var(--c, var(--yunyi));
  letter-spacing: 1px; display: flex; align-items: center; gap: 6px;
}
.card .cmeta .dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .6; }

/* 待上线卡片 */
.card.soon { opacity: .72; }
.card.soon .cmeta { color: var(--ink-3); }
.card .badge-soon {
  position: absolute; right: 10px; top: 10px;
  font-size: 10px; letter-spacing: 1px; color: var(--c, var(--yunyi));
  border: 1px dashed currentColor; border-radius: 3px;
  padding: 1px 5px; opacity: .8;
}
.card.soon::after { opacity: .4; }

/* 分组标题（老四号 / 新四号） */
.group-hd {
  display: flex; align-items: center; gap: 12px;
  margin: 26px 0 12px;
}
.group-hd .gt {
  font-size: 13px; letter-spacing: 3px; color: var(--ink-2);
  font-family: var(--kai); white-space: nowrap;
}
.group-hd .gl { flex: 1; height: 1px; background: var(--line-2); }
.group-hd:first-child { margin-top: 8px; }

/* ---------- 分区标题 ---------- */
.sec-title {
  display: flex; align-items: baseline; gap: 10px;
  margin: 30px 0 14px; padding-left: 10px;
  border-left: 3px solid var(--c, var(--yunyi));
}
.sec-title h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: 2px; }
.sec-title span { font-size: 12px; color: var(--ink-3); letter-spacing: 1px; }

/* ---------- 系列分组 ---------- */
.series {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: 14px;
  overflow: hidden;
}
.series-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px dashed var(--line-2);
  cursor: pointer;
}
.series-hd h3 {
  margin: 0; font-size: 16px; font-weight: 700; letter-spacing: 1.5px; color: var(--ink);
}
.series-hd .cnt { font-size: 11px; color: var(--ink-3); letter-spacing: 1px; }
.series-hd .arrow { font-size: 12px; color: var(--ink-3); transition: transform .2s; }
.series.open .arrow { transform: rotate(90deg); }

.ep-list { display: none; }
.series.open .ep-list { display: block; }

.ep {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
  transition: background .15s;
}
.ep:last-child { border-bottom: none; }
.ep:active { background: #f2f0e9; }
.ep .num {
  flex: 0 0 auto; min-width: 24px; height: 22px; margin-top: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--c, var(--yunyi));
  border: 1px solid currentColor; border-radius: 3px; opacity: .75;
  font-family: var(--kai); letter-spacing: 0;
}
.ep .t { flex: 1; font-size: 14.5px; line-height: 1.65; color: var(--ink); }
.ep .d { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.6; }

/* ---------- 文章页 ---------- */
.art-head { padding: 26px 0 18px; border-bottom: 1px solid var(--line-2); margin-bottom: 8px; }
.art-head .tag {
  display: inline-block; font-size: 11px; letter-spacing: 2px;
  color: var(--c, var(--yunyi)); border: 1px solid currentColor;
  border-radius: 3px; padding: 1px 7px; margin-bottom: 14px; opacity: .8;
}
.art-head h1 {
  margin: 0 0 12px; font-size: 22px; font-weight: 700;
  line-height: 1.55; letter-spacing: 1px;
}
.art-head .meta { font-size: 12px; color: var(--ink-3); letter-spacing: 1px; display: flex; gap: 12px; flex-wrap: wrap; }

/* 文章正文（导入内容为内联样式，此处只做容器与兜底） */
.art-body { padding: 4px 0 30px; }
.art-body > section { margin: 0 !important; max-width: 100% !important; padding: 8px 0 !important; background: transparent !important; }
.art-body p { margin: 0 0 12px; }
.art-body img { border-radius: 4px; margin: 14px auto; }

/* 配图建议框在网站上不展示 */
.tips-hide, .art-body section[data-imgtips="1"] { display: none !important; }

/* 上下篇 */
.pager { display: flex; gap: 10px; margin: 8px 0 40px; }
.pager a {
  flex: 1; min-width: 0;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 13px 14px;
  display: block; transition: transform .15s;
}
.pager a:active { transform: scale(.98); }
.pager a.disabled { opacity: .35; pointer-events: none; }
.pager .pl { font-size: 11px; color: var(--ink-3); letter-spacing: 1px; margin-bottom: 4px; }
.pager .pt {
  font-size: 13.5px; line-height: 1.5; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pager .right { text-align: right; }

/* ---------- 搜索 ---------- */
.search-box { margin: 4px 0 20px; position: relative; }
.search-box input {
  width: 100%; padding: 12px 14px 12px 38px;
  font-family: var(--serif); font-size: 14px; color: var(--ink);
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r);
  outline: none; letter-spacing: .5px;
}
.search-box input:focus { border-color: var(--yunyi); }
.search-box::before {
  content: "⌕"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 17px; color: var(--ink-3); pointer-events: none;
}
.search-empty { text-align: center; color: var(--ink-3); font-size: 13px; padding: 40px 0; }

/* ---------- 页脚 ---------- */
.footer {
  text-align: center; padding: 30px 18px 44px;
  border-top: 1px solid var(--line-2); margin-top: 10px;
}
.footer .f1 { font-family: var(--kai); font-size: 13px; color: var(--ink-2); letter-spacing: 3px; }
.footer .f2 { font-size: 11px; color: var(--ink-3); letter-spacing: 1px; margin-top: 8px; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 46px 20px; color: var(--ink-3); font-size: 13px; line-height: 2; }

/* ---------- 手写作品画廊（手机相册图片） ---------- */
.gallery { margin: 4px 0 20px; }
.gallery figure {
  margin: 0 0 14px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px; box-shadow: var(--shadow);
}
.gallery img { width: 100%; border-radius: 3px; }
.gallery figcaption {
  font-family: var(--kai); font-size: 12.5px; color: var(--ink-3);
  text-align: center; margin-top: 9px; letter-spacing: .5px; line-height: 1.7;
}

/* ---------- 回到顶部 ---------- */
.totop {
  position: fixed; right: 16px; bottom: 20px; z-index: 30;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(251,249,242,.94); border: 1px solid var(--line);
  display: none; align-items: center; justify-content: center;
  font-size: 15px; color: var(--ink-2); box-shadow: var(--shadow);
}
.totop.show { display: flex; }

/* ---------- 窄屏微调 ---------- */
@media (max-width: 360px) {
  .hero h1 { font-size: 22px; letter-spacing: 3px; }
  .card { min-height: 118px; padding: 16px 14px; }
  .card .cname { font-size: 16px; }
}

/* ---------- 宽屏（平板/桌面也好看） ---------- */
@media (min-width: 760px) {
  .grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .hero { padding: 56px 18px 34px; }
  .hero h1 { font-size: 30px; }
  .art-head h1 { font-size: 26px; }
}
