/* ============================================================
   古风小生记词 · 宣纸浅色水墨主题
   基调：宣纸米白底 + 墨色文字 + 朱砂/赭金点缀
   ============================================================ */

:root {
  /* 色板 */
  --paper: #f2ead8;            /* 宣纸底 */
  --paper-2: #ede3cc;          /* 深一号纸色（分隔/阴影） */
  --sheet: #f8f3e6;            /* 书页纸（正文页/卡片） */
  --pop-paper: #fdf8ec;        /* 词笺纸（弹窗） */
  --ink: #2f2a22;              /* 主墨字 */
  --ink-dim: #6d6353;          /* 次级墨字 */
  --ink-faint: #a29784;        /* 弱化字 */
  --cinnabar: #ab3a2a;         /* 朱砂（印章/批注/强调） */
  --cinnabar-deep: #8f2f22;    /* 朱砂深 */
  --gold: #9a7a3f;             /* 赭金（分隔线/点缀） */
  --gold-deep: #7c6132;        /* 赭金深（链接） */
  --wash: rgba(96, 86, 66, .12);   /* 淡墨晕染 */

  --line: rgba(140, 110, 60, .32);      /* 金线 */
  --line-soft: rgba(140, 110, 60, .16); /* 弱金线 */

  /* 字体 */
  --font-title: "KaiTi", "STKaiti", "Kaiti SC", "AR PL UKai CN", "Noto Serif SC", serif;
  --font-body: "SimSun", "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif;
  --font-en: "Georgia", "Times New Roman", serif;

  --reading-width: 42rem;
  --radius: 6px;
  --shadow-page: 0 12px 34px rgba(90, 70, 40, .16);
  --shadow-pop: 0 18px 48px rgba(60, 45, 20, .28);
}

/* ---------- 基础 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--paper);
  /* 宣纸纹理：噪点 + 隐约纸纤维 */
  background-image:
    radial-gradient(ellipse at 18% -8%, rgba(255, 252, 240, .9), transparent 55%),
    radial-gradient(ellipse at 92% 4%, rgba(255, 250, 232, .6), transparent 40%),
    repeating-linear-gradient(0deg, rgba(120, 100, 60, .022) 0 1px, transparent 1px 4px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.3 0 0 0 0 0.22 0 0 0 0.035 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.9;
  letter-spacing: .03em;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* 边缘淡墨晕染（整站） */
body::after {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 40% at 12% 88%, rgba(96, 86, 66, .10), transparent 70%),
    radial-gradient(ellipse 45% 32% at 88% 14%, rgba(96, 86, 66, .07), transparent 70%);
}

a { color: var(--gold-deep); text-decoration: none; transition: color .25s; }
a:hover { color: var(--cinnabar); }

::selection { background: rgba(171, 58, 42, .16); }

/* ---------- 页首导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(242, 234, 216, .94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line-soft);
}

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: .6rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand { display: flex; align-items: center; gap: .65rem; }

.brand .seal {
  width: 2.15rem;
  height: 2.15rem;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cinnabar);
  color: #faf3e2;
  font-family: var(--font-title);
  font-size: 1.02rem;
  line-height: 1;
  border-radius: 4px;
  transform: rotate(-3deg);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .18), 0 2px 5px rgba(120, 40, 25, .25);
}

.brand .name {
  font-family: var(--font-title);
  font-size: 1.12rem;
  letter-spacing: .12em;
  color: var(--ink);
}

.nav-links { display: flex; gap: 1.35rem; align-items: center; }

.nav-links a {
  color: var(--ink-dim);
  font-size: .95rem;
  letter-spacing: .08em;
  position: relative;
  padding: .2rem 0;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--cinnabar); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: var(--cinnabar);
  opacity: .7;
}

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 4.5rem;
  border-top: 1px solid var(--line-soft);
  padding: 2rem 1.5rem 2.6rem;
  text-align: center;
}

.site-footer .foot-line {
  width: 3rem;
  height: 1px;
  background: var(--gold);
  opacity: .55;
  margin: 0 auto 1.1rem;
}

.site-footer .foot-text { color: var(--ink-faint); font-size: .9rem; letter-spacing: .06em; }
.site-footer .foot-text a { color: var(--ink-dim); }
.site-footer .foot-text a:hover { color: var(--cinnabar); }

/* ---------- 通用容器与标题 ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }

.page-title {
  font-family: var(--font-title);
  font-size: 1.9rem;
  letter-spacing: .2em;
  text-align: center;
  margin: 2.4rem 0 .4rem;
  color: var(--ink);
}

.page-subtitle {
  text-align: center;
  color: var(--ink-dim);
  font-size: .95rem;
  letter-spacing: .1em;
  margin-bottom: 2rem;
}

.ornament {
  text-align: center;
  color: var(--gold);
  font-size: 1rem;
  letter-spacing: .6em;
  margin: .3rem 0 1.2rem;
  user-select: none;
}
.ornament img { height: 32px; opacity: .85; display: inline-block; }

/* 页首导航下的回纹装饰线 */
.site-header::after {
  content: "";
  display: block;
  height: 7px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 8'%3E%3Cpath d='M2 6 L2 2 L26 2 L26 6' fill='none' stroke='%237c6132' stroke-width='1'/%3E%3Cpath d='M8 6 L8 4' stroke='%237c6132' stroke-width='1'/%3E%3Cpath d='M14 2 L14 6' stroke='%237c6132' stroke-width='1'/%3E%3Cpath d='M20 6 L20 4 L23 4' fill='none' stroke='%237c6132' stroke-width='1'/%3E%3C/svg%3E") repeat-x center / auto 7px;
  opacity: .28;
}

/* 页脚水墨远山 */
.foot-ink { max-width: 720px; margin: 0 auto .1rem; }
.foot-ink svg { width: 100%; height: auto; display: block; }

/* ---------- 首页 ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 4.6rem 1.5rem 5.2rem;
  text-align: center;
}

/* 水墨山峦（墨色，落于纸底） */
.hero .mountains {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 56%;
  pointer-events: none;
  opacity: .9;
}
.hero .mountains svg { width: 100%; height: 100%; display: block; }

/* 山水小品：月、飞鸟、孤舟、墨竹 */
.hero .moon {
  position: absolute;
  top: 2.4rem;
  left: 12%;
  width: 5.4rem;
  opacity: .55;
  pointer-events: none;
}
.hero .geese {
  position: absolute;
  top: 2.2rem;
  right: 15%;
  width: 7.5rem;
  opacity: .8;
  pointer-events: none;
}
.hero .boat {
  position: absolute;
  bottom: 4%;
  right: 23%;
  width: 7.5rem;
  opacity: .75;
  pointer-events: none;
}
.hero .bamboo {
  position: absolute;
  bottom: 1rem;
  left: max(.5rem, calc(50% - 30rem));
  width: 7rem;
  opacity: .8;
  pointer-events: none;
  transform: rotate(-4deg);
}

/* 云雾（缓慢漂移，克制） */
.hero .mist {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 46% 20% at 30% 64%, rgba(255, 252, 240, .75), transparent 70%);
  animation: mist-drift 28s ease-in-out infinite alternate;
}
@keyframes mist-drift {
  from { transform: translateX(-2%); }
  to   { transform: translateX(2%); }
}

/* 墨梅斜枝点缀 */
.hero .plum {
  position: absolute;
  top: 2.2rem;
  right: max(1rem, calc(50% - 26rem));
  width: 9rem;
  pointer-events: none;
  opacity: .9;
  transform: rotate(12deg);
}

.hero .big-seal {
  width: 4.2rem;
  height: 4.2rem;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cinnabar);
  color: #faf3e2;
  font-family: var(--font-title);
  font-size: 1.85rem;
  border-radius: 8px;
  transform: rotate(-4deg);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .2), 0 6px 16px rgba(120, 40, 25, .3);
}

.hero h1 {
  font-family: var(--font-title);
  font-size: clamp(2.3rem, 6vw, 3.4rem);
  letter-spacing: .18em;
  font-weight: 400;
  margin-bottom: .85rem;
  color: var(--ink);
}

.hero .slogan {
  color: var(--gold-deep);
  font-family: var(--font-title);
  font-size: 1.02rem;
  letter-spacing: .5em;
  margin-bottom: 1.9rem;
}

.hero .intro {
  max-width: 34rem;
  margin: 0 auto 2.4rem;
  color: var(--ink-dim);
  font-size: 1rem;
}

.btn {
  display: inline-block;
  padding: .72rem 2.9rem;
  font-family: var(--font-title);
  font-size: 1.06rem;
  letter-spacing: .25em;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .3s;
  user-select: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cinnabar), var(--cinnabar-deep));
  color: #faf3e2;
  box-shadow: 0 4px 14px rgba(171, 58, 42, .28);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(171, 58, 42, .38); color: #fff; }

.btn-ghost {
  border: 1px solid var(--gold);
  color: var(--gold-deep);
  background: transparent;
}
.btn-ghost:hover { background: rgba(154, 122, 63, .08); color: var(--cinnabar); }

.hero .btn-group { display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; }

/* 特色三点 */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 3.8rem auto 1rem;
}

.feature-card {
  background: linear-gradient(180deg, var(--sheet), rgba(248, 243, 230, .5));
  border: 1px solid var(--line-soft);
  border-top: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem 1.5rem;
  text-align: center;
  box-shadow: 0 6px 18px rgba(90, 70, 40, .07);
}

.feature-card .f-icon {
  font-family: var(--font-title);
  font-size: 1.45rem;
  color: var(--cinnabar);
  margin-bottom: .6rem;
}

.feature-card h3 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  letter-spacing: .15em;
  margin-bottom: .5rem;
  color: var(--ink);
}

.feature-card p { color: var(--ink-dim); font-size: .93rem; line-height: 1.8; }

/* 数据带 */
.stats-band {
  display: flex;
  justify-content: center;
  gap: 3.5rem;
  flex-wrap: wrap;
  margin: 2.8rem auto;
  padding: 1.3rem 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.stat { text-align: center; }
.stat .num { font-family: var(--font-title); font-size: 1.65rem; color: var(--cinnabar); letter-spacing: .06em; }
.stat .label { color: var(--ink-faint); font-size: .85rem; letter-spacing: .15em; margin-top: .15rem; }

/* ---------- 章内子导航（正文 · 词汇 · 自测） ---------- */
.section-nav {
  max-width: var(--reading-width);
  margin: 1.1rem auto 0;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  flex-wrap: wrap;
}

.section-nav .sn-tabs {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--sheet);
}

.section-nav .sn-tabs a {
  padding: .32rem 1.25rem;
  font-family: var(--font-title);
  font-size: .95rem;
  letter-spacing: .12em;
  color: var(--ink-dim);
  transition: all .25s;
}
.section-nav .sn-tabs a:hover { color: var(--ink); }
.section-nav .sn-tabs a.active {
  background: var(--cinnabar);
  color: #faf3e2;
}

.section-nav .sn-ch a {
  font-size: .9rem;
  color: var(--gold-deep);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .28rem .95rem;
  transition: all .25s;
}
.section-nav .sn-ch a:hover { background: rgba(154, 122, 63, .1); color: var(--cinnabar); }
.section-nav .sn-ch a.disabled { opacity: .35; pointer-events: none; }

/* ---------- 章节目录 ---------- */
.catalog-list {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  max-width: var(--reading-width);
  margin: 0 auto;
}

.chapter-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.1rem 1.4rem;
  background: linear-gradient(180deg, var(--sheet), rgba(248, 243, 230, .4));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  transition: border-color .3s, transform .3s, box-shadow .3s;
  position: relative;
  box-shadow: 0 4px 12px rgba(90, 70, 40, .06);
}

.chapter-item.available:hover {
  border-color: var(--gold);
  transform: translateX(4px);
  box-shadow: 0 8px 20px rgba(90, 70, 40, .12);
}

.chapter-item .ch-no {
  flex: none;
  width: 2.9rem;
  height: 2.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-size: 1.05rem;
  border: none;
  border-radius: 7px;
  color: #faf3e2;
  background: var(--cinnabar);
  transform: rotate(-3deg);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .18), 0 2px 5px rgba(120, 40, 25, .25);
}

.chapter-item .ch-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  letter-spacing: .1em;
  color: var(--ink);
}

.chapter-item .ch-meta { margin-left: auto; font-size: .85rem; color: var(--ink-faint); letter-spacing: .06em; white-space: nowrap; }

.chapter-item.locked { opacity: .55; cursor: not-allowed; }

.chapter-item .tag-coming {
  font-size: .8rem;
  color: var(--ink-faint);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: .15rem .7rem;
  letter-spacing: .1em;
}

/* ---------- 沉浸式翻页阅读器 ---------- */
.reader-root {
  min-height: calc(100vh - 3.4rem);
  display: flex;
  flex-direction: column;
}

.book-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.4rem 1.5rem 1rem;
  position: relative;
  overflow: hidden;
}

/* 隐形测量容器：与书页同宽，用于精确分页计算 */
.rpage.measure {
  position: absolute;
  top: 0;
  left: 1.5rem;
  right: 1.5rem;
  margin: 0 auto;
  visibility: hidden;
  pointer-events: none;
  box-shadow: none;
  border-color: transparent;
}

/* 书页 */
.rpage {
  width: 100%;
  max-width: var(--reading-width);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 252, 240, .9), transparent 60%),
    var(--sheet);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  box-shadow: var(--shadow-page);
  padding: 2.4rem 3.1rem 2.2rem;
  position: relative;
}

/* 页眉细金线 */
.rpage::before {
  content: "";
  position: absolute;
  top: .9rem;
  left: 3.1rem;
  right: 3.1rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 30%, var(--line) 70%, transparent);
}

.rpage.anim-next { animation: pageFromRight .6s cubic-bezier(.18, .75, .3, 1) both; }
.rpage.anim-prev { animation: pageFromLeft .6s cubic-bezier(.18, .75, .3, 1) both; }

/* 翻页动画：明显但不失雅致的书页推入（位移 + 轻旋 + 投影扫过） */
@keyframes pageFromRight {
  0%   { opacity: 0; transform: translateX(68px) rotate(1.8deg); box-shadow: -26px 10px 40px rgba(90, 70, 40, .22); }
  100% { opacity: 1; transform: none; box-shadow: var(--shadow-page); }
}
@keyframes pageFromLeft {
  0%   { opacity: 0; transform: translateX(-68px) rotate(-1.8deg); box-shadow: 26px 10px 40px rgba(90, 70, 40, .22); }
  100% { opacity: 1; transform: none; box-shadow: var(--shadow-page); }
}

/* 古籍版框（双边线）+ 鱼尾 + 版心落款 */
.rpage .page-frame {
  position: relative;
  border: 1px solid rgba(140, 110, 60, .5);
  padding: 1.05rem 1.2rem .65rem;
  background: rgba(253, 248, 236, .35);
}
.rpage .page-frame::after {
  content: "";
  position: absolute;
  top: 4px; left: 4px; right: 4px; bottom: 4px;
  border: 1px solid rgba(140, 110, 60, .28);
  pointer-events: none;
}
.rpage .fy-top { text-align: center; margin-bottom: .85rem; }
.rpage .fy-bottom {
  text-align: center;
  margin-top: .95rem;
  color: var(--ink-faint);
  font-size: .78rem;
  letter-spacing: .35em;
}

/* 回目标题块（首页内） */
.rpage .ch-head { text-align: center; margin-bottom: 1.8rem; }
.rpage .ch-head .ch-label {
  color: var(--cinnabar);
  font-size: .88rem;
  letter-spacing: .35em;
  margin-bottom: .45rem;
}
.rpage .ch-head h1 {
  font-family: var(--font-title);
  font-size: 1.85rem;
  letter-spacing: .18em;
  color: var(--ink);
  font-weight: 400;
}
.rpage .ch-head .ch-epigraph {
  color: var(--ink-faint);
  font-size: .88rem;
  margin-top: .9rem;
  letter-spacing: .1em;
}

/* 正文 */
.rpage .paragraph {
  margin-bottom: 1.1rem;
  color: var(--ink);
  text-indent: 2em;
  text-align: justify;
}

.rpage .paragraph.dialog { text-indent: 0; }

/* 单词高亮（朱砂批注式） */
.word-hl {
  color: var(--cinnabar-deep);
  border-bottom: 1px dashed rgba(171, 58, 42, .5);
  cursor: pointer;
  font-family: var(--font-en);
  font-size: .94em;
  letter-spacing: .01em;
  padding: 0 .05em;
  transition: background .25s, color .25s;
  border-radius: 2px;
}
.word-hl:hover { background: rgba(171, 58, 42, .09); color: var(--cinnabar); }

/* 阅读器固定字号（中号） */
.reader-root { font-size: 17px; line-height: 2.02; }

/* 回末块 */
.ch-end-block { text-align: center; margin-top: 1.6rem; }
.ch-end-block .end-seal {
  width: 4.4rem;
  height: 4.4rem;
  margin: 0 auto 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cinnabar);
  color: #faf3e2;
  font-family: var(--font-title);
  font-size: 1.18rem;
  letter-spacing: .18em;
  border-radius: 8px;
  transform: rotate(-4deg);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .2), 0 5px 12px rgba(120, 40, 25, .3);
}
.ch-end-block .end-links { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

/* 底部控制栏 */
.rctl {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  flex-wrap: wrap;
  padding: .6rem 1rem 1.15rem;
}

.rctl .rc-btn {
  font-family: var(--font-title);
  font-size: .95rem;
  letter-spacing: .12em;
  color: var(--gold-deep);
  border: 1px solid var(--line);
  background: var(--sheet);
  border-radius: 999px;
  padding: .4rem 1.35rem;
  cursor: pointer;
  transition: all .25s;
  box-shadow: 0 2px 6px rgba(90, 70, 40, .08);
}
.rctl .rc-btn:hover:not(:disabled) { background: rgba(154, 122, 63, .12); color: var(--cinnabar); }
.rctl .rc-btn:disabled { opacity: .35; cursor: not-allowed; }

.rctl .rc-page { color: var(--ink-dim); font-size: .92rem; letter-spacing: .1em; min-width: 6.5rem; text-align: center; }

/* ---------- 词笺弹窗 ---------- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(52, 42, 28, .55);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
}

.modal-overlay.show { display: flex; }

.word-modal {
  width: min(30rem, 94vw);
  max-height: 86vh;
  overflow-y: auto;
  background:
    linear-gradient(180deg, #fdf8ec, #f3e9d2 8%, #fbf4e3 92%, #eee2c8),
    var(--pop-paper);
  color: var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow-pop);
  position: relative;
  border: 1px solid rgba(150, 115, 65, .4);
  animation: popIn .3s cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

/* 卷轴上下轴头 */
.word-modal::before,
.word-modal::after {
  content: "";
  display: block;
  height: .85rem;
  background: linear-gradient(90deg, #8a6f45, #c9ab77 30%, #8a6f45 70%, #6e5736);
  border-radius: 4px;
  margin: 0 auto;
  width: 60%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.word-modal::before { position: relative; top: .5rem; }
.word-modal::after { position: relative; bottom: .5rem; }

.word-modal .wm-body { padding: 1.15rem 1.65rem 1.4rem; }

.wm-word-row { text-align: center; margin-bottom: .15rem; }

.wm-word {
  font-family: var(--font-en);
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--ink);
}

.wm-phonetic { font-family: var(--font-en); color: var(--ink-dim); font-size: .98rem; margin-top: .12rem; }

.wm-seal {
  width: 2.5rem;
  height: 2.5rem;
  margin: .85rem auto .25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cinnabar);
  color: #faf3e2;
  font-family: var(--font-title);
  font-size: 1.1rem;
  border-radius: 5px;
  transform: rotate(-4deg);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .2);
}

.wm-divider { border: none; border-top: 1px solid rgba(140, 110, 60, .35); margin: .75rem 0; }

.wm-field { margin-bottom: .8rem; }

.wm-field .wf-label {
  display: inline-block;
  font-size: .8rem;
  letter-spacing: .18em;
  color: var(--cinnabar-deep);
  border: 1px solid rgba(171, 58, 42, .45);
  border-radius: 3px;
  padding: .04rem .55rem;
  margin-bottom: .32rem;
  background: rgba(171, 58, 42, .04);
}

.wm-field .wf-content { font-size: .96rem; line-height: 1.75; color: var(--ink); }
.wm-field .wf-content.colloc { font-family: var(--font-en); font-size: .92rem; }

.wm-close {
  position: absolute;
  top: 1.2rem;
  right: 1.05rem;
  width: 1.85rem;
  height: 1.85rem;
  border: 1px solid rgba(140, 110, 60, .5);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-dim);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .25s;
  z-index: 2;
}
.wm-close:hover { background: var(--cinnabar); border-color: var(--cinnabar); color: #faf3e2; }

/* ---------- 词汇汇总页 ---------- */
.words-page-wrap { max-width: var(--reading-width); margin: 1.2rem auto 0; padding: 0 1.5rem; }

.word-table-wrap {
  background: var(--sheet);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(90, 70, 40, .08);
}

.word-table-wrap .wt-toolbar {
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
  padding: .95rem 1.15rem;
  border-bottom: 1px solid var(--line-soft);
}

.btn-copy {
  font-family: var(--font-title);
  font-size: .9rem;
  letter-spacing: .12em;
  color: var(--gold-deep);
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 4px;
  padding: .4rem 1.05rem;
  cursor: pointer;
  transition: all .25s;
}
.btn-copy:hover { background: rgba(154, 122, 63, .1); color: var(--cinnabar); }
.btn-copy.copied { border-color: #4d7a5e; color: #4d7a5e; }

.word-table { width: 100%; border-collapse: collapse; font-size: .92rem; }

.word-table th {
  font-family: var(--font-title);
  font-weight: 400;
  letter-spacing: .1em;
  color: var(--gold-deep);
  padding: .7rem .9rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  background: rgba(154, 122, 63, .06);
  white-space: nowrap;
}

.word-table td {
  padding: .6rem .9rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  color: var(--ink-dim);
  line-height: 1.65;
}

.word-table tr:last-child td { border-bottom: none; }

.word-table td.w-en {
  font-family: var(--font-en);
  color: var(--cinnabar-deep);
  white-space: nowrap;
  cursor: pointer;
}
.word-table td.w-en:hover { color: var(--cinnabar); background: rgba(171, 58, 42, .05); }

.word-table td .phon { font-family: var(--font-en); color: var(--ink-faint); font-size: .82em; display: block; margin-top: .1rem; }

.table-scroll { overflow-x: auto; }
.word-table { min-width: 560px; }

/* ---------- 自测页 ---------- */
.quiz-page-wrap { max-width: var(--reading-width); margin: 1.2rem auto 0; padding: 0 1.5rem; }

/* 翻页子页（词汇/自测）的页头与工具条 */
.book-head { max-width: var(--reading-width); margin: 0 auto; padding: 0 1.5rem; }
.book-head .page-title { margin: .9rem 0 .15rem; font-size: 1.55rem; }
.book-head .page-subtitle { margin-bottom: 0; font-size: .88rem; }

.bar-flat {
  max-width: var(--reading-width);
  margin: .7rem auto 0;
  padding: 0 1.5rem;
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
}

/* 书页内的表格（词汇页） */
.rpage .word-table td { padding: .55rem .75rem; }
.rpage .word-table th { padding: .62rem .75rem; }

.exercise-wrap { display: flex; flex-direction: column; gap: .95rem; }

.ex-item {
  background: linear-gradient(180deg, var(--sheet), rgba(248, 243, 230, .5));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: .8rem 1.05rem;
  box-shadow: 0 3px 8px rgba(90, 70, 40, .06);
  margin-bottom: .65rem;
}

.ex-item .ex-no { font-family: var(--font-en); color: var(--cinnabar); font-size: .82rem; margin-bottom: .3rem; letter-spacing: .08em; }

.ex-item .ex-sentence { color: var(--ink); line-height: 1.75; }
.ex-item .ex-sentence .blank {
  display: inline-block;
  min-width: 5.5rem;
  border-bottom: 1.5px solid var(--cinnabar);
  color: transparent;
  user-select: none;
  margin: 0 .2em;
}

.ex-item .ex-answer-row { display: flex; align-items: center; gap: .7rem; margin-top: .55rem; flex-wrap: wrap; }

.ex-item .ex-input {
  background: rgba(47, 42, 34, .05);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  font-family: var(--font-en);
  font-size: .96rem;
  padding: .3rem .6rem;
  width: 8.5rem;
  outline: none;
  transition: border-color .25s;
}
.ex-item .ex-input:focus { border-color: var(--gold); }

.ex-item .ex-input.correct { border-color: #4d7a5e; color: #3d6a50; background: rgba(77, 122, 94, .08); }
.ex-item .ex-input.wrong { border-color: var(--cinnabar); color: var(--cinnabar); background: rgba(171, 58, 42, .06); }

.ex-item .ex-answer { font-family: var(--font-en); color: #4d7a5e; font-size: .95rem; display: none; }
.ex-item .ex-answer.show { display: inline; }

.ex-item .ex-result { font-size: .88rem; letter-spacing: .05em; }
.ex-item .ex-result.ok { color: #4d7a5e; }
.ex-item .ex-result.no { color: var(--cinnabar); }

.ex-item .ex-more { font-family: var(--font-title); color: var(--ink-dim); font-size: .9rem; margin-top: .4rem; }

.ex-pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin: 1.5rem 0 .5rem; flex-wrap: wrap; }

.ex-pager .pg-btn {
  font-family: var(--font-title);
  font-size: .92rem;
  letter-spacing: .1em;
  color: var(--gold-deep);
  border: 1px solid var(--line);
  background: var(--sheet);
  border-radius: 4px;
  padding: .38rem 1.25rem;
  cursor: pointer;
  transition: all .25s;
}
.ex-pager .pg-btn:hover:not(:disabled) { background: rgba(154, 122, 63, .12); }
.ex-pager .pg-btn:disabled { opacity: .35; cursor: not-allowed; }

.ex-pager .pg-info { color: var(--ink-dim); font-size: .9rem; letter-spacing: .08em; }

.ex-score { text-align: center; margin-top: .5rem; color: var(--cinnabar); font-family: var(--font-title); letter-spacing: .12em; font-size: .98rem; }

/* ---------- 人物图鉴（立绘翻卡） ---------- */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1.5rem;
  max-width: 1080px;
  margin: 0 auto;
}

/* 翻卡：标准 3D 双面翻卡——两面绝对重叠在同一位置，整体绕 Y 轴翻转 */
.flip-card {
  cursor: pointer;
  outline: none;
  perspective: 1200px;
  -webkit-perspective: 1200px;
}
.flip-card:focus-visible .flip-inner { box-shadow: 0 0 0 2px var(--gold); }

.flip-inner {
  position: relative;
  width: 100%;
  height: 28rem;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.3, .7, .3, 1);
}

.flip-card.flipped .flip-inner { transform: rotateY(180deg); }

/* 正反两面完全重叠（同一张卡的两面） */
.flip-front, .flip-back {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flip-front {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

.flip-back {
  transform: rotateY(180deg); /* 预翻转成背面 */
  overflow-y: auto;
}

/* 翻卡内的卡片禁用 hover 上浮（避免与翻转动画冲突） */
.flip-card .char-card:hover { transform: none; border-color: var(--line-soft); box-shadow: 0 6px 16px rgba(90, 70, 40, .08); }

/* 立绘（画卷） */
.c-portrait {
  width: 100%;
  height: 21rem;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(90, 70, 40, .16);
  margin-bottom: .9rem;
}

/* 翻卡提示 */
.c-hint {
  margin-top: auto;
  padding-top: .7rem;
  font-size: .78rem;
  letter-spacing: .2em;
  color: var(--ink-faint);
  transition: color .3s;
}
.flip-card:hover .c-hint { color: var(--cinnabar); }

@media (prefers-reduced-motion: reduce) {
  .flip-inner { transition: none; }
}

.char-card {
  position: relative;
  background: linear-gradient(180deg, var(--sheet), rgba(248, 243, 230, .5));
  border: 1px solid var(--line-soft);
  border-top: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.65rem 1.45rem 1.45rem;
  text-align: center;
  transition: transform .3s, border-color .3s, box-shadow .3s;
  box-shadow: 0 6px 16px rgba(90, 70, 40, .08);
}

/* 人物卡角花（墨梅小枝） */
.char-card::before {
  content: "";
  position: absolute;
  top: -7px;
  right: -7px;
  width: 54px;
  height: 54px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 52'%3E%3Cpath d='M4 48 C 16 34, 22 22, 26 10' fill='none' stroke='%237c6132' stroke-width='2.5' stroke-linecap='round'/%3E%3Cpath d='M26 10 C 30 6, 38 4, 44 6' fill='none' stroke='%237c6132' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M26 18 C 30 16, 36 17, 40 20' fill='none' stroke='%237c6132' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='26' cy='10' r='3.4' fill='%23ab3a2a'/%3E%3Ccircle cx='44' cy='6' r='3' fill='%23ab3a2a'/%3E%3Ccircle cx='40' cy='20' r='2.8' fill='%23ab3a2a'/%3E%3C/svg%3E") no-repeat center / contain;
  opacity: .5;
  pointer-events: none;
  transform: rotate(8deg);
}

.char-card:hover { transform: translateY(-4px); border-color: var(--gold); box-shadow: 0 12px 26px rgba(90, 70, 40, .14); }

.char-card .c-seal {
  width: 3.3rem;
  height: 3.3rem;
  margin: 0 auto .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cinnabar);
  color: #faf3e2;
  font-family: var(--font-title);
  font-size: 1.45rem;
  border-radius: 7px;
  transform: rotate(-4deg);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .2), 0 4px 9px rgba(120, 40, 25, .25);
}

.char-card .c-name { font-family: var(--font-title); font-size: 1.28rem; letter-spacing: .15em; color: var(--ink); }
.char-card .c-alias { color: var(--cinnabar); font-size: .85rem; letter-spacing: .1em; margin-top: .12rem; }
.char-card .c-role { color: var(--ink-dim); font-size: .88rem; letter-spacing: .12em; margin: .55rem 0 .75rem; }

.char-card .c-intro { color: var(--ink-dim); font-size: .92rem; line-height: 1.85; text-align: justify; }

.char-card .c-traits { display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap; margin-top: .85rem; }
.char-card .c-traits span {
  font-size: .8rem;
  color: var(--gold-deep);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .1rem .62rem;
  letter-spacing: .08em;
}

/* ---------- 预留页面（会员/资料包） ---------- */
.placeholder-card {
  max-width: var(--reading-width);
  margin: 0 auto;
  background: linear-gradient(180deg, var(--sheet), rgba(248, 243, 230, .5));
  border: 1px dashed var(--gold);
  border-radius: var(--radius);
  padding: 2.4rem 2rem;
  text-align: center;
}

.placeholder-card .p-seal {
  width: 2.9rem; height: 2.9rem;
  margin: 0 auto .95rem;
  display: flex; align-items: center; justify-content: center;
  background: rgba(154, 122, 63, .12);
  color: var(--gold-deep);
  font-family: var(--font-title);
  font-size: 1.25rem;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.placeholder-card h3 { font-family: var(--font-title); font-size: 1.22rem; letter-spacing: .15em; color: var(--ink); margin-bottom: .55rem; }
.placeholder-card p { color: var(--ink-dim); font-size: .95rem; margin-bottom: .45rem; }
.placeholder-card .coming-soon { color: var(--cinnabar); font-size: .9rem; letter-spacing: .3em; margin-top: .9rem; }

.plan-list { max-width: var(--reading-width); margin: 1.5rem auto 0; display: flex; flex-direction: column; gap: .75rem; }
.plan-item {
  display: flex; gap: .85rem; align-items: flex-start;
  background: var(--sheet);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.05rem 1.25rem;
  color: var(--ink-dim);
  font-size: .95rem;
  line-height: 1.8;
}
.plan-item .pi-mark { color: var(--cinnabar); flex: none; }

/* ---------- 页面进入过渡 ---------- */
.page-enter { animation: page-turn .5s ease-out both; }
@keyframes page-turn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  body { font-size: 16px; }
  .nav-inner { padding: .5rem 1rem; }
  .nav-links { gap: .85rem; }
  .nav-links a { font-size: .85rem; }
  .brand .name { font-size: 1rem; }
  .features { grid-template-columns: 1fr; }
  .hero { padding: 3.2rem 1rem 4rem; }
  .hero .plum { width: 6.5rem; top: 1rem; }
  .stats-band { gap: 2rem; }
  .chapter-item { padding: .95rem 1.05rem; gap: .85rem; }
  .chapter-item .ch-title { font-size: 1rem; }

  /* 阅读器移动端 */
  .book-stage { padding: .8rem .8rem .5rem; align-items: stretch; }
  .rpage { padding: 1.5rem 1.15rem 1.4rem; border-radius: 4px; }
  .rpage.measure { left: .8rem; right: .8rem; }
  .rpage::before { left: 1.15rem; right: 1.15rem; }
  .rpage .ch-head h1 { font-size: 1.5rem; }
  .rpage .page-frame { padding: .85rem .75rem .5rem; }
  .rctl { gap: .7rem; }
  .rctl .rc-btn { padding: .36rem 1rem; font-size: .9rem; }
  .section-nav { padding: 0 1rem; }
  .words-page-wrap, .quiz-page-wrap { padding: 0 1rem; }
  .word-modal .wm-body { padding: 1rem 1.15rem 1.25rem; }
  .hero .moon { top: 1.6rem; left: 6%; width: 3.6rem; }
  .hero .geese { top: 1.4rem; right: 8%; width: 5rem; }
  .hero .boat { bottom: 2.5%; right: 8%; width: 5.5rem; }
  .hero .bamboo { width: 5rem; bottom: .5rem; }
}


/* ============ 翻卡覆盖规则（文件末尾，最高优先级，保证正反两面精确重叠） ============ */
.flip-card .flip-front,
.flip-card .flip-back {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
}
.flip-card .flip-back { transform: rotateY(180deg) !important; }
.flip-card.flipped .flip-inner { transform: rotateY(180deg) !important; }

/* ============ 词笺收藏按钮（古风笺签/印章风格） ============ */
.wm-fav {
  display: block;
  margin: .45rem auto .1rem;
  padding: .22rem 1.2rem;
  font-family: var(--font-title);
  font-size: .9rem;
  letter-spacing: .25em;
  color: var(--gold-deep);
  background: rgba(253, 248, 236, .55);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  transition: all .3s;
  position: relative;
}
/* 笺签左右小点，如古书签 */
.wm-fav::before,
.wm-fav::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold);
  opacity: .7;
}
.wm-fav::before { left: .45rem; }
.wm-fav::after { right: .45rem; }

.wm-fav:hover { border-color: var(--cinnabar); color: var(--cinnabar); }
.wm-fav.fav {
  background: var(--cinnabar);
  border-color: var(--cinnabar);
  color: #faf3e2;
  transform: rotate(-2deg);
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .18), 0 3px 8px rgba(171, 58, 42, .25);
}
.wm-fav.fav::before,
.wm-fav.fav::after { background: #faf3e2; }

/* ============ 收藏夹页 ============ */
.fav-toolbar {
  max-width: var(--reading-width);
  margin: 0 auto 1.4rem;
  display: flex;
  gap: .8rem;
  justify-content: center;
  flex-wrap: wrap;
}

.fav-group { max-width: var(--reading-width); margin: 0 auto 1.6rem; }

.fav-letter {
  font-family: var(--font-title);
  font-size: 1.25rem;
  letter-spacing: .15em;
  color: var(--cinnabar);
  margin-bottom: .5rem;
  padding-left: .3rem;
}
.fav-letter span { font-size: .85rem; color: var(--ink-faint); letter-spacing: .05em; }

.fav-group .word-table { min-width: 620px; }

.td-fav { width: 2.4rem; text-align: center; }
.btn-unfav {
  border: 1px solid var(--line-soft);
  background: transparent;
  color: var(--ink-faint);
  width: 1.6rem; height: 1.6rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: .8rem;
  transition: all .25s;
}
.btn-unfav:hover { color: #faf3e2; background: var(--cinnabar); border-color: var(--cinnabar); }

.fav-empty {
  max-width: var(--reading-width);
  margin: 0 auto;
  text-align: center;
  padding: 2.5rem 1.5rem;
}
.fav-empty .p-seal {
  width: 3rem; height: 3rem;
  margin: 0 auto .9rem;
  display: flex; align-items: center; justify-content: center;
  background: rgba(154, 122, 63, .12);
  color: var(--gold-deep);
  font-size: 1.4rem;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.fav-empty h3 { font-family: var(--font-title); letter-spacing: .15em; color: var(--ink); margin-bottom: .5rem; }
.fav-empty p { color: var(--ink-dim); font-size: .95rem; line-height: 1.9; margin-bottom: 1.4rem; }

/* ============ 导出 PDF 打印样式 ============ */
@media print {
  .site-header, .site-footer, .ornament, .fav-toolbar, .page-subtitle,
  .td-fav, .btn-unfav, .wm-fav {
    display: none !important;
  }
  body { background: #fff !important; font-size: 11px; }
  body::after { display: none; }
  .page-title { margin: .5rem 0 1rem; font-size: 1.4rem; }
  .fav-group { max-width: 100%; margin-bottom: 1rem; page-break-inside: avoid; }
  .fav-letter { font-size: 1.1rem; margin-bottom: .3rem; }
  .word-table { min-width: 0 !important; font-size: 10px; }
  .word-table td, .word-table th { padding: .3rem .4rem !important; border: 1px solid #999 !important; }
  .word-table td.w-en { color: #000; }
}
