/* ============================================================
   中华诗词名家百科 · UI Design System
   Designer: UI Designer (像素君)
   风格：水墨宣纸 · 古意今用 · 移动端优先 / 自适应
   ============================================================ */

/* ---------- 1. Design Tokens ---------- */
:root {
  /* —— 色彩：墨色系（中性） —— */
  --ink-900: #1c1a17;   /* 浓墨 */
  --ink-700: #3a352e;   /* 重墨 */
  --ink-500: #5b5347;   /* 中墨 */
  --ink-300: #8c8475;   /* 淡墨 */
  --ink-100: #c9c2b4;   /* 清墨 */

  /* —— 色彩：宣纸系（背景） —— */
  --paper-50:  #fdfbf6;
  --paper-100: #f7f2e7;
  --paper-200: #efe7d6;
  --paper-300: #e3d8c0;

  /* —— 色彩：主题强调 —— */
  --cinnabar: #9e2b25;      /* 朱砂（印章红·主强调） */
  --cinnabar-soft: #c0473f;
  --dai-qing: #2f5d62;      /* 黛青 */
  --bamboo: #6b8e5a;        /* 竹青 */
  --gold: #b8893b;          /* 描金 */
  --gold-soft: #d8b873;

  /* —— 语义色 —— */
  --color-success: #4f7a4a;
  --color-warning: #c08a2e;
  --color-error:   #b23b32;
  --color-info:    #2f5d62;

  /* —— 字体 —— */
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", "Source Han Serif SC", serif;
  --font-sans:  "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-kai:   "Kaiti SC", "STKaiti", "KaiTi", var(--font-serif);

  /* —— 字号阶梯（移动优先，桌面放大） —— */
  --fs-xs: 0.75rem;   /* 12 */
  --fs-sm: 0.875rem;  /* 14 */
  --fs-base: 1rem;    /* 16 */
  --fs-lg: 1.125rem;  /* 18 */
  --fs-xl: 1.375rem;  /* 22 */
  --fs-2xl: 1.75rem;  /* 28 */
  --fs-3xl: 2.25rem;  /* 36 */
  --fs-4xl: 3rem;     /* 48 */
  --fs-hero: clamp(2.4rem, 7vw, 4.5rem);

  /* —— 间距（4px 基准） —— */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px; --sp-20: 80px; --sp-24: 96px;

  /* —— 圆角 —— */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* —— 阴影（柔和、宣纸质感） —— */
  --shadow-sm: 0 1px 3px rgb(28 26 23 / 0.06), 0 1px 2px rgb(28 26 23 / 0.04);
  --shadow-md: 0 6px 16px rgb(28 26 23 / 0.08);
  --shadow-lg: 0 18px 40px rgb(28 26 23 / 0.12);
  --shadow-inset: inset 0 0 0 1px rgb(28 26 23 / 0.06);

  /* —— 动效 —— */
  --ease: cubic-bezier(.22,.61,.36,1);
  --t-fast: 140ms var(--ease);
  --t-norm: 260ms var(--ease);
  --t-slow: 420ms var(--ease);

  /* —— 布局 —— */
  --maxw: 1180px;
  --nav-h: 64px;

  /* 默认（浅色·宣纸） */
  --bg: var(--paper-100);
  --bg-elev: var(--paper-50);
  --bg-card: #fffdf8;
  --text: var(--ink-900);
  --text-sub: var(--ink-500);
  --text-faint: var(--ink-300);
  --border: var(--paper-300);
  --ring: rgb(158 43 37 / 0.35);
}

/* —— 夜间模式（夜读诗） —— */
[data-theme="dark"] {
  --bg: #16140f;
  --bg-elev: #1f1c16;
  --bg-card: #242019;
  --paper-50: #201d17;
  --paper-100: #18150f;
  --text: #ece4d4;
  --text-sub: #b3a892;
  --text-faint: #7d745f;
  --border: #383125;
  --cinnabar: #d4594f;
  --cinnabar-soft: #e07a70;
  --dai-qing: #6fb0b3;
  --gold: #d8b873;
  --shadow-sm: 0 1px 3px rgb(0 0 0 / 0.4);
  --shadow-md: 0 6px 16px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 18px 40px rgb(0 0 0 / 0.6);

  /* 墨色反转：正文/标题/署名/统计数字直接引用 --ink-*，暗色下统一改为浅色，
     否则会出现黑字黑底（如 poem.php 原文、名篇卡片诗文、诗人署名、首页统计）。 */
  --ink-900: #ece4d4;
  --ink:     #ece4d4;
  --ink-700: #d8cfbd;
  --ink-500: #b3a892;
  --ink-300: #8c8475;
  --ink-100: #5b5347;
  --paper-200: #383125;
  --paper-300: #4a4334;
}

/* 头像在暗色下保留深色背景（渐变里原用 --ink-700，已被反转为浅色会导致白字浅底看不清） */
[data-theme="dark"] .avatar {
  background: linear-gradient(140deg, #3a352e, var(--dai-qing));
}

/* ---------- 2. Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  transition: background var(--t-norm), color var(--t-norm);
  /* 宣纸纹理：极淡的双向渐变 + 噪点感 */
  background-image:
    radial-gradient(120% 80% at 0% 0%, rgb(158 43 37 / 0.04), transparent 55%),
    radial-gradient(120% 80% at 100% 100%, rgb(47 93 98 / 0.05), transparent 55%);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--cinnabar); color: #fff; }

/* 可访问性：聚焦环 */
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: var(--radius-sm); }

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- 3. Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--sp-5); }
.section { padding-block: var(--sp-16); }
.section--tight { padding-block: var(--sp-10); }

/* ---------- 4. 文字排版 ---------- */
.font-serif { font-family: var(--font-serif); }
.display {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--fs-hero);
  line-height: 1.15;
  letter-spacing: 0.02em;
}
.h1 { font-family: var(--font-serif); font-size: var(--fs-3xl); font-weight: 700; line-height: 1.25; }
.h2 { font-family: var(--font-serif); font-size: var(--fs-2xl); font-weight: 700; line-height: 1.3; }
.h3 { font-family: var(--font-serif); font-size: var(--fs-xl); font-weight: 600; }
.lead { font-size: var(--fs-lg); color: var(--text-sub); }
.muted { color: var(--text-sub); }
.faint { color: var(--text-faint); }
.center { text-align: center; }

/* 印章字（竖排小标题用） */
.seal-text { font-family: var(--font-kai); }

/* ---------- 5. 组件：按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border: 1px solid transparent; border-radius: var(--radius-pill);
  font-family: var(--font-sans); font-weight: 600; font-size: var(--fs-sm);
  cursor: pointer; user-select: none; white-space: nowrap;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn--primary { background: var(--cinnabar); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--cinnabar-soft); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--cinnabar); color: var(--cinnabar); }
.btn--lg { padding: var(--sp-4) var(--sp-8); font-size: var(--fs-base); }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center;
  border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--bg-elev);
  cursor: pointer; transition: var(--t-fast);
}
.icon-btn:hover { border-color: var(--cinnabar); color: var(--cinnabar); }

/* ---------- 6. 组件：搜索框 ---------- */
.search {
  display: flex; align-items: center; gap: var(--sp-2);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-5);
  box-shadow: var(--shadow-sm); transition: var(--t-fast);
  max-width: 520px; width: 100%;
}
.search:focus-within { border-color: var(--cinnabar); box-shadow: 0 0 0 4px var(--ring); }
.search input { flex: 1; border: none; background: transparent; outline: none; font-size: var(--fs-base); padding: var(--sp-2) 0; }
.search .btn { padding: var(--sp-3) var(--sp-5); }

/* ---------- 7. 组件：朝代筛选 chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip {
  padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--bg-card);
  font-family: var(--font-serif); font-size: var(--fs-sm); color: var(--text-sub);
  cursor: pointer; transition: var(--t-fast);
}
.chip:hover { border-color: var(--cinnabar); color: var(--cinnabar); }
.chip.is-active { background: var(--cinnabar); color: #fff; border-color: var(--cinnabar); }
a.chip { text-decoration: none; }

/* ---------- 8. 组件：诗人卡片 ---------- */
.poet-grid { display: grid; gap: var(--sp-5); grid-template-columns: repeat(2, 1fr); }
.poet-card {
  position: relative; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--sp-5); overflow: hidden;
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform var(--t-norm), box-shadow var(--t-norm), border-color var(--t-norm);
}
.poet-card::after { /* 角落淡墨晕染 */
  content: ""; position: absolute; inset: auto -40px -40px auto; width: 140px; height: 140px;
  background: radial-gradient(circle, rgb(158 43 37 / 0.08), transparent 70%);
  transition: var(--t-norm);
}
.poet-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--gold-soft); }
.poet-card:hover::after { transform: scale(1.3); }
.poet-card__top { display: flex; gap: var(--sp-4); align-items: center; }
.avatar {
  flex: none; width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-kai);
  font-size: var(--fs-2xl); color: #fff; background: linear-gradient(140deg, var(--ink-700), var(--dai-qing));
  box-shadow: var(--shadow-sm); border: 2px solid var(--paper-200);
}
.poet-card__name { font-family: var(--font-serif); font-size: var(--fs-xl); font-weight: 700; }
.poet-card__meta { font-size: var(--fs-sm); color: var(--text-faint); }
.poet-card__line {
  margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px dashed var(--border);
  font-family: var(--font-kai); font-size: var(--fs-base); color: var(--ink-700);
  line-height: 1.8;
}
.poet-card__line .src { display: block; margin-top: var(--sp-2); font-family: var(--font-sans); font-size: var(--fs-xs); color: var(--text-faint); }

/* ---------- 9. 组件：诗词阅读卡（竖排可选） ---------- */
.poem-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--sp-8); box-shadow: var(--shadow-sm); position: relative;
}
.poem-card__title { font-family: var(--font-serif); font-size: var(--fs-2xl); font-weight: 700; }
.poem-card__author { color: var(--text-sub); font-size: var(--fs-sm); margin-top: var(--sp-2); }
.poem-body { font-family: var(--font-kai); font-size: var(--fs-xl); line-height: 2.1; margin-top: var(--sp-5); color: var(--ink-900); }
/* 竖排 */
.poem-body.is-vertical { writing-mode: vertical-rl; text-orientation: upright; max-height: 360px; margin-inline: auto; letter-spacing: 0.12em; }
.poem-card__foot { margin-top: var(--sp-6); display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.seal {
  width: 40px; height: 40px; flex: none; border-radius: 6px; background: var(--cinnabar);
  color: #fff; display: grid; place-items: center; font-family: var(--font-kai);
  font-size: 13px; line-height: 1.1; padding: 4px; text-align: center;
  box-shadow: var(--shadow-sm); transform: rotate(-2deg);
}

/* ---------- 10. 组件：顶部导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center; gap: var(--sp-4);
  background: color-mix(in srgb, var(--bg-elev) 86%, transparent);
  backdrop-filter: saturate(1.2) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav__brand { display: flex; align-items: center; gap: var(--sp-3); font-family: var(--font-serif); font-weight: 700; font-size: var(--fs-lg); }
.nav__logo {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: linear-gradient(140deg, var(--cinnabar), var(--gold));
  color: #fff; display: grid; place-items: center; font-family: var(--font-kai); font-size: 20px;
  box-shadow: var(--shadow-sm);
}
.nav__links { display: none; gap: var(--sp-2); margin-left: auto; }
.nav__links a { padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-pill); font-size: var(--fs-sm); color: var(--text-sub); transition: var(--t-fast); }
.nav__links a:hover, .nav__links a.is-active { color: var(--cinnabar); background: color-mix(in srgb, var(--cinnabar) 10%, transparent); }
.nav__actions { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; }
@media (min-width: 860px) {
  .nav__links { display: flex; }
  .nav__actions { margin-left: var(--sp-4); }
}

/* ---------- 10b. 移动端底部标签栏 ---------- */
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  display: flex; justify-content: space-around; align-items: stretch;
  height: calc(56px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(14px);
  border-top: 1px solid var(--border);
}
.bottom-bar a, .bottom-bar button {
  flex: 1 1 0; appearance: none; -webkit-appearance: none; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; line-height: 1.1; color: var(--text-faint); font-family: var(--font-sans);
  text-decoration: none; padding: 6px 2px; min-height: 44px; transition: var(--t-fast);
}
.bottom-bar svg { width: 22px; height: 22px; }
.bottom-bar .is-active { color: var(--cinnabar); }
.bottom-bar .is-active svg { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--cinnabar) 40%, transparent)); }
@media (max-width: 859px) {
  body { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
  html { scroll-behavior: smooth; }
  :where(#top, #featured, #poems, #dynasties) { scroll-margin-top: calc(var(--nav-h) + 12px); }
}
@media (min-width: 860px) { .bottom-bar { display: none; } }

/* ---------- 11. Hero ---------- */
.hero { position: relative; padding-block: var(--sp-20) var(--sp-12); overflow: hidden; }
.hero__seal-deco { position: absolute; top: 8%; right: 4%; font-family: var(--font-kai); color: var(--cinnabar); opacity: .14; font-size: clamp(80px, 18vw, 220px); line-height: 1; pointer-events: none; user-select: none; }
.hero__kicker { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--cinnabar); letter-spacing: .2em; font-weight: 600; }
.hero .display { margin-top: var(--sp-4); max-width: 14ch; }
.hero .lead { margin-top: var(--sp-5); max-width: 46ch; }
.hero__cta { margin-top: var(--sp-8); display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.hero__stats { margin-top: var(--sp-12); display: flex; gap: var(--sp-8); flex-wrap: wrap; }
.stat__num { font-family: var(--font-serif); font-size: var(--fs-3xl); font-weight: 700; color: var(--ink-900); }
.stat__label { font-size: var(--fs-sm); color: var(--text-sub); }

/* ---------- 12. 区块标题 ---------- */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-8); flex-wrap: wrap; }
.sec-head__title { font-family: var(--font-serif); font-size: var(--fs-2xl); font-weight: 700; }
.sec-head__title::before { content: "❖"; color: var(--cinnabar); margin-right: var(--sp-3); font-size: .8em; }
.sec-head__more { font-size: var(--fs-sm); color: var(--cinnabar); display: inline-flex; align-items: center; gap: var(--sp-1); }

/* ---------- 13. 生平时间线 ---------- */
.timeline { position: relative; padding-left: var(--sp-8); }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--cinnabar), var(--gold)); }
.tl-item { position: relative; padding-bottom: var(--sp-6); }
.tl-item::before { content: ""; position: absolute; left: calc(-1 * var(--sp-8) + 1px); top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg-card); border: 3px solid var(--cinnabar); }
.tl-item__year { font-family: var(--font-serif); font-weight: 700; color: var(--cinnabar); }
.tl-item__title { font-weight: 600; margin-top: 2px; }
.tl-item__desc { color: var(--text-sub); font-size: var(--fs-sm); }

/* ---------- 14. 详情页 Hero ---------- */
.poet-hero { display: flex; gap: var(--sp-6); align-items: center; flex-wrap: wrap; }
.poet-hero .avatar { width: 96px; height: 96px; font-size: var(--fs-4xl); }
.poet-hero__name { font-family: var(--font-serif); font-size: var(--fs-4xl); font-weight: 700; }
.poet-hero__zi { color: var(--text-sub); font-family: var(--font-kai); font-size: var(--fs-lg); }
.poet-hero__author-link { color: var(--cinnabar); text-decoration: none; border-bottom: 1px dashed var(--cinnabar); }
.poet-hero__author-link:hover { background: var(--cinnabar); color: #fff; border-bottom-color: transparent; }
.tag-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }
.tag { font-size: var(--fs-xs); padding: 3px var(--sp-3); border-radius: var(--radius-pill); background: color-mix(in srgb, var(--dai-qing) 14%, transparent); color: var(--dai-qing); border: 1px solid color-mix(in srgb, var(--dai-qing) 30%, transparent); }

/* ---------- 15. 空状态 / 提示 ---------- */
.empty { text-align: center; color: var(--text-faint); padding: var(--sp-16) var(--sp-4); font-family: var(--font-kai); }

/* 异步加载作品时的「正在加载代表作品」提示 */
.loading-hint {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--text-faint);
  font-family: var(--font-kai);
  padding: var(--sp-8) var(--sp-4);
}
.loading-hint::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid var(--text-faint);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 16. 页脚 ---------- */
.footer { border-top: 1px solid var(--border); padding-block: var(--sp-10); margin-top: var(--sp-16); color: var(--text-sub); }
.footer__grid { display: grid; gap: var(--sp-8); grid-template-columns: 1fr; }
.footer a:hover { color: var(--cinnabar); }
.footer__brand { font-family: var(--font-serif); font-size: var(--fs-lg); color: var(--text); }
@media (min-width: 720px) { .footer__grid { grid-template-columns: 2fr 1fr 1fr; } }
/* 桌面端：栏目分组右对齐（品牌在左、导航在右，更协调） */
.footer__nav .footer__nav-links { display: flex; flex-direction: column; gap: var(--sp-2); align-items: flex-start; }
@media (min-width: 720px) {
  .footer__nav { text-align: right; }
  .footer__nav .footer__nav-links { align-items: flex-end; }
}
.footer__legal a { color: inherit; text-decoration: none; }
.footer__legal a:hover { color: var(--cinnabar); }
.footer__sep { margin: 0 var(--sp-2); opacity: .6; }

/* ---------- 17. 桌面断点增强 ---------- */
@media (min-width: 640px) {
  .container { padding-inline: var(--sp-6); }
  .poet-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 980px) {
  .poet-grid { grid-template-columns: repeat(4, 1fr); }
  .section { padding-block: var(--sp-20); }
}

/* ---------- 18. 入场动画 ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--t-slow), transform var(--t-slow); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---------- 19. 工具类 ---------- */
.row { display: flex; align-items: center; gap: var(--sp-3); }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); } .gap-4 { gap: var(--sp-4); } .gap-6 { gap: var(--sp-6); }
.mt-2 { margin-top: var(--sp-2); } .mt-4 { margin-top: var(--sp-4); } .mt-6 { margin-top: var(--sp-6); } .mt-8 { margin-top: var(--sp-8); }
.mb-2 { margin-bottom: var(--sp-2); } .mb-4 { margin-bottom: var(--sp-4); } .mb-6 { margin-bottom: var(--sp-6); }
.hidden { display: none !important; }

/* ---------- 20. 列表页（名篇 / 朝代） ---------- */
.poem-list { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; }
@media (min-width: 860px) { .poem-list { grid-template-columns: repeat(2, 1fr); } }
.dynasty-block + .dynasty-block { margin-top: var(--sp-6); }
.page-hero { padding-block: var(--sp-16) var(--sp-10); }
.page-hero .display { font-size: clamp(34px, 7vw, 56px); }

/* ---------- 21. 申请加入页（join） ---------- */
.join-hero { padding-block: var(--sp-16) var(--sp-8); }
.join-doc { max-width: 940px; }

/* 费用说明 */
.fee-grid { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; margin-top: var(--sp-6); }
@media (min-width: 760px) { .fee-grid { grid-template-columns: repeat(3, 1fr); } }
.fee-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--sp-6); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: var(--sp-2); }
.fee-card--accent { border-color: color-mix(in srgb, var(--cinnabar) 45%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cinnabar) 10%, transparent), var(--shadow-sm); }
.fee-card--note { justify-content: center; }
.fee-card__no { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--cinnabar) 12%, transparent); color: var(--cinnabar); font-family: var(--font-serif); font-weight: 700; font-size: var(--fs-sm); }
.fee-card__title { font-family: var(--font-serif); font-weight: 600; font-size: var(--fs-lg); }
.fee-card__price { font-family: var(--font-serif); font-weight: 900; font-size: clamp(32px, 6vw, 44px); color: var(--cinnabar); line-height: 1; }
.fee-card__unit { font-size: var(--fs-lg); font-weight: 600; margin-left: 4px; }
.fee-card__note { font-size: var(--fs-sm); color: var(--text-sub); }
.fee-card__long { font-size: var(--fs-base); color: var(--text-sub); line-height: 1.8; }

/* 需提供材料 */
.mat-list { list-style: none; margin-top: var(--sp-6); display: grid; gap: var(--sp-4); }
.mat-item { display: flex; gap: var(--sp-4); padding: var(--sp-5); background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.mat-item__no { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--cinnabar); color: #fff; font-family: var(--font-serif); font-weight: 700; }
.mat-item__title { font-family: var(--font-serif); font-weight: 600; font-size: var(--fs-lg); }
.mat-item__desc { font-size: var(--fs-sm); color: var(--text-sub); margin-top: 4px; line-height: 1.7; }

/* 联系方式 */
.contact-grid { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; margin-top: var(--sp-6); }
@media (min-width: 620px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .contact-grid { grid-template-columns: repeat(3, 1fr); } }
.contact-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--sp-5); box-shadow: var(--shadow-sm); }
.contact-card__k { font-size: var(--fs-xs); letter-spacing: .12em; color: var(--text-faint); }
.contact-card__v { font-family: var(--font-serif); font-weight: 700; font-size: var(--fs-lg); margin-top: 6px; word-break: break-all; }
.contact-card__sub { font-size: var(--fs-sm); color: var(--text-sub); margin-top: 4px; }
.contact-card--qr { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--sp-5); flex-wrap: wrap; }
.qr-box { flex: none; width: 160px; height: 160px; padding: 10px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.qr-box img { display: block; width: 100%; height: 100%; }
.qr-cap { font-family: var(--font-serif); font-weight: 600; font-size: var(--fs-lg); line-height: 1.6; }

/* 版权说明 */
.legal-lead { font-size: var(--fs-base); color: var(--text-sub); line-height: 1.9; }
.legal-note { margin-top: var(--sp-6); padding: var(--sp-5) var(--sp-6); background: color-mix(in srgb, var(--cinnabar) 6%, var(--bg-card)); border: 1px solid color-mix(in srgb, var(--cinnabar) 22%, var(--border)); border-left: 4px solid var(--cinnabar); border-radius: var(--radius-md); font-size: var(--fs-sm); color: var(--text-sub); line-height: 1.85; }
.legal-note strong { color: var(--text); font-weight: 600; }
.legal-meta { margin-top: var(--sp-8); padding-top: var(--sp-5); border-top: 1px dashed var(--border); display: flex; flex-wrap: wrap; gap: var(--sp-6); font-size: var(--fs-sm); color: var(--text-faint); }
.legal-meta b { font-family: var(--font-serif); color: var(--text-sub); font-weight: 600; margin-right: var(--sp-2); }

/* ---------- 22. PHP 版补充（诗人卡片改为 <a> 链接） ---------- */
a.poet-card { display: block; color: inherit; text-decoration: none; }
a.poet-card:visited { color: inherit; }

/* ---------- 23. 历代名家文库（sinfo 桥接） ---------- */
.poet-card__bio {
  margin-top: var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--text-sub);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lib-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-6); }
.lib-count { color: var(--text-sub); font-size: var(--fs-sm); font-family: var(--font-serif); }
.lib-search { display: flex; gap: var(--sp-2); max-width: 440px; width: 100%; }
.lib-search input {
  flex: 1; min-width: 0; border: 1px solid var(--border); background: var(--bg-card);
  border-radius: var(--radius-pill); padding: var(--sp-3) var(--sp-5); outline: none;
  font-size: var(--fs-base);
}
.lib-search input:focus { border-color: var(--cinnabar); box-shadow: 0 0 0 4px var(--ring); }

.pager { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: center; align-items: center; margin-top: var(--sp-10); }
.pager__btn, .pager__num {
  display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px;
  padding: 0 var(--sp-4); border-radius: var(--radius-pill); border: 1px solid var(--border);
  background: var(--bg-card); font-size: var(--fs-sm); color: var(--text-sub); transition: var(--t-fast);
}
.pager a.pager__btn:hover, .pager a.pager__num:hover { border-color: var(--cinnabar); color: var(--cinnabar); }
.pager__num.is-current { background: var(--cinnabar); color: #fff; border-color: var(--cinnabar); }
.pager__btn.is-disabled, .pager__ellipsis { color: var(--text-faint); opacity: .5; pointer-events: none; }
.pager__ellipsis { padding: 0 var(--sp-1); }

/* ---------- 23. 详细生平（sinfo_data_1.newstext 富文本） ---------- */
.detail-rich { font-size: var(--fs-md); line-height: 1.9; color: var(--text-sub); }
.detail-rich p { margin: 0 0 var(--sp-5); text-indent: 0; }
.detail-rich p:first-child { margin-top: 0; }
.detail-rich p:last-child { margin-bottom: 0; }
.detail-rich h2,
.detail-rich h3,
.detail-rich h4 { font-family: var(--font-serif); color: var(--ink); margin: var(--sp-8) 0 var(--sp-3); font-weight: 700; }
.detail-rich h2 { font-size: var(--fs-lg); border-left: 4px solid var(--cinnabar); padding-left: var(--sp-3); }
.detail-rich h3 { font-size: var(--fs-md); }
.detail-rich strong { color: var(--ink); font-weight: 700; }
.detail-rich blockquote { margin: var(--sp-4) 0; padding: var(--sp-3) var(--sp-5); border-left: 4px solid var(--border); color: var(--text-faint); background: var(--bg-card); }
.detail-rich ul, .detail-rich ol { margin: 0 0 var(--sp-4); padding-left: 2em; }
.detail-rich li { margin-bottom: var(--sp-2); }
.detail-rich a { color: var(--cinnabar); text-decoration: underline; }
.detail-rich img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }

/* 详细生平：折叠展开交互 */
.detail-wrap { position: relative; }
.detail-wrap.is-collapsed .detail-rich {
  max-height: 18em;
  overflow: hidden;
}
.detail-fade {
  display: none;
  position: relative;
  height: 4.5em;
  margin-top: -4.5em;
  background: linear-gradient(to bottom, rgba(0,0,0,0), var(--bg) 88%);
  pointer-events: none;
}
.detail-wrap.is-collapsed .detail-fade { display: block; }
.detail-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-6);
  font-size: var(--fs-sm);
  font-family: var(--font-serif);
  line-height: 1;
  color: var(--cinnabar);
  background: transparent;
  border: 1px solid var(--cinnabar);
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.detail-toggle::after {
  content: "▾";
  font-size: .9em;
  transition: transform .2s ease;
}
.detail-toggle.is-open::after { transform: rotate(180deg); }
.detail-toggle:hover { background: var(--cinnabar); color: #fff; }
.detail-rich table { width: 100%; border-collapse: collapse; margin: var(--sp-4) 0; }
.detail-rich th, .detail-rich td { border: 1px solid var(--border); padding: var(--sp-2) var(--sp-3); text-align: left; }
.detail-rich .gs-box, .detail-rich .gs-works-text { all: unset; display: block; }

/* ---------- 24. 名篇赏析（article 表桥接） ---------- */
/* 卡片诗文预览：缩小字号、限高两行 */
.poem-body--preview {
  font-family: var(--font-kai);
  font-size: var(--fs-md);
  line-height: 1.7;
  color: var(--text-sub);
  margin-top: var(--sp-3);
  max-height: 5.4em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent);
  mask-image: linear-gradient(to bottom, #000 72%, transparent);
}
/* 名篇详情页 */
.poem-detail__body {
  font-family: var(--font-kai);
  font-size: var(--fs-2xl);
  line-height: 2.2;
  color: var(--ink-900);
  text-align: center;
}
.poem-detail__body p { margin: 0 0 var(--sp-2); }
.poem-detail__prose {
  font-size: var(--fs-md);
  line-height: 1.9;
  color: var(--text-sub);
}
.poem-detail__prose p { margin: 0 0 var(--sp-5); text-indent: 0; }
.poem-detail__prose p:last-child { margin-bottom: 0; }
.poem-detail__prose strong { color: var(--ink); }
