/* ============================================================
   字源集 · 古风设计系统
   宣纸为底，墨字为骨，朱砂为印，鎏金为饰
   动效纪律：只动 transform/opacity；150/200ms；强 ease-out
   ============================================================ */

:root {
  --paper: #f6f1e6;
  --paper-2: #efe8d8;
  --card: #fbf8f0;
  --ink: #26231d;
  --ink-2: #57534a;
  --ink-3: #6f6a5e;
  --cinnabar: #9e2f26;
  --cinnabar-deep: #7e241d;
  --gold: #a07d2c;
  --line: #d9d0ba;
  --line-soft: #e6ddc8;

  --motion-fast: 150ms;
  --motion-base: 200ms;
  --motion-exit: 140ms;
  --ease-standard: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-entrance: cubic-bezier(0.16, 1, 0.3, 1);

  --font-kai: "Kaiti SC", "STKaiti", "KaiTi", "DFKai-SB", "TW-Kai", "Noto Serif CJK SC", serif;
  --font-song: "Songti SC", "STSong", "NSimSun", "SimSun", "Noto Serif CJK SC", "Noto Serif SC", serif;

  --wrap: 1080px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-song);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

/* 宣纸纹理（feTurbulence，纯 data-URI，零外部请求） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.42 0 0 0 0 0.37 0 0 0 0 0.28 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23p)'/%3E%3C/svg%3E");
}

body > * { position: relative; z-index: 1; }

img, svg { display: block; max-width: 100%; }
a { color: var(--cinnabar); text-decoration: none; transition: color var(--motion-fast) var(--ease-standard); }
a:hover { color: var(--cinnabar-deep); }
h1, h2, h3, h4 { font-family: var(--font-kai); font-weight: 600; line-height: 1.3; }
b { font-weight: 600; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

::selection { background: rgba(158, 47, 38, 0.16); }

:focus-visible { outline: 2px dashed var(--cinnabar); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 99;
  background: var(--ink); color: var(--paper); padding: 8px 16px; border-radius: 4px;
}
.skip:focus { left: 8px; }

/* ---------- 印章（横排，家规） ---------- */
.seal {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-kai);
  background: var(--cinnabar); color: #f8f2e4;
  padding: 3px 8px 4px; border-radius: 3px;
  font-size: 15px; letter-spacing: 3px; text-indent: 3px; /* 抵消最后字距，视觉居中 */
  line-height: 1.2;
  box-shadow: inset 0 0 0 1px rgba(248, 242, 228, 0.28), inset 0 0 8px rgba(0, 0, 0, 0.14);
  transform: rotate(-1.2deg);
}
.seal-brand { font-size: 17px; }
.seal-big { font-size: 30px; padding: 8px 18px 10px; letter-spacing: 8px; text-indent: 8px; margin-bottom: 20px; }

/* ---------- 页头 ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 241, 230, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.head-row { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: flex; align-items: baseline; gap: 10px; color: var(--ink); min-width: 0; }
.brand:hover { color: var(--ink); }
.brand-name { font-family: var(--font-kai); font-size: 22px; font-weight: 700; letter-spacing: 2px; }
.brand-tag { font-size: 12px; color: var(--ink-3); letter-spacing: 1px; white-space: nowrap; }
.site-nav { display: flex; gap: 4px; flex-shrink: 0; }
.head-right { display: flex; align-items: center; gap: 8px; }
.nav-link {
  font-family: var(--font-kai); font-size: 16px; color: var(--ink-2);
  padding: 6px 12px; position: relative; letter-spacing: 2px;
}
.nav-link::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px;
  background: var(--cinnabar); transform: scaleX(0); transform-origin: left;
  transition: transform var(--motion-base) var(--ease-standard);
}
.nav-link:hover { color: var(--ink); }
.nav-link.is-active { color: var(--ink); }
.nav-link.is-active::after, .nav-link:hover::after { transform: scaleX(1); }

/* ---------- 检索 ---------- */
.search-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 10px; color: var(--ink-2);
  transition: border-color var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard), background var(--motion-fast) var(--ease-standard);
}
html:not(.js) .search-btn { display: none; }
.search-btn:hover { border-color: var(--cinnabar); color: var(--cinnabar); background: rgba(158, 47, 38, 0.05); }
.search-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.search-key { font-size: 11px; border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; line-height: 1.5; }
.search-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(38, 35, 29, 0.42);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh 20px 20px;
}
.search-mask[hidden] { display: none; }
.search-modal {
  width: min(600px, 100%); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 24px 64px rgba(38, 35, 29, 0.3);
  overflow: hidden;
  animation: modalIn 220ms var(--ease-entrance);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.search-bar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.search-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: var(--font-song); font-size: 16px; color: var(--ink);
}
.search-input::placeholder { color: var(--ink-3); }
.search-close {
  cursor: pointer; font-size: 11px; letter-spacing: 1px; color: var(--ink-3);
  border: 1px solid var(--line); border-radius: 4px; background: transparent; padding: 2px 8px;
  text-transform: uppercase;
}
.search-close:hover { color: var(--cinnabar); border-color: var(--cinnabar); }
.search-hint { padding: 8px 16px; font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--line-soft); }
.search-results { list-style: none; max-height: 52vh; overflow-y: auto; padding: 6px; }
.search-results li a {
  display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; gap: 12px;
  padding: 8px 10px; border-radius: 6px; color: var(--ink);
}
.search-results li a:hover, .search-results li a:focus-visible { background: var(--paper-2); }
.sr-char { font-family: var(--font-kai); font-size: 24px; min-width: 30px; text-align: center; }
.sr-fam { font-size: 11px; color: var(--cinnabar); border: 1px solid currentColor; border-radius: 999px; padding: 0 8px; white-space: nowrap; }
.sr-gloss { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-empty { padding: 26px 16px; text-align: center; color: var(--ink-3); font-size: 13.5px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-kai); font-size: 16px; letter-spacing: 2px;
  padding: 10px 26px; border-radius: 4px; border: 1px solid transparent;
  cursor: pointer; transition: transform var(--motion-fast) var(--ease-standard), box-shadow var(--motion-fast) var(--ease-standard), background var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--cinnabar); color: #f8f2e4; }
.btn-primary:hover { background: var(--cinnabar-deep); color: #f8f2e4; box-shadow: 0 6px 18px rgba(158, 47, 38, 0.25); }
.btn-ghost { border-color: var(--ink-2); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); background: rgba(38, 35, 29, 0.04); }

/* ---------- 滚动显现（无 JS 时默认可见） ---------- */
html.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 480ms var(--ease-entrance), transform 480ms var(--ease-entrance); transition-delay: calc(var(--i, 0) * 60ms); }
html.js .reveal.in { opacity: 1; transform: none; }

/* ---------- 首页 Hero ---------- */
.hero {
  min-height: calc(100svh - 60px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 48px 20px 72px; position: relative; overflow: hidden;
}
.hero-chain {
  display: flex; align-items: baseline; gap: clamp(8px, 2.4vw, 26px);
  font-family: var(--font-kai); color: var(--ink-2); margin-bottom: clamp(24px, 5vh, 44px);
}
.hero-chain span { opacity: 0; animation: charIn 560ms var(--ease-entrance) forwards; animation-delay: calc(var(--i) * 130ms + 150ms); }
.hero-chain span:nth-child(1) { font-size: clamp(20px, 3.2vw, 30px); }
.hero-chain span:nth-child(2) { font-size: clamp(24px, 3.9vw, 37px); }
.hero-chain span:nth-child(3) { font-size: clamp(28px, 4.6vw, 44px); }
.hero-chain span:nth-child(4) { font-size: clamp(33px, 5.4vw, 52px); }
.hero-chain span:nth-child(5) { font-size: clamp(38px, 6.3vw, 61px); }
.hero-chain span:nth-child(6) { font-size: clamp(44px, 7.3vw, 71px); }
.hero-chain span:nth-child(7) { font-size: clamp(51px, 8.4vw, 82px); color: var(--cinnabar); }
@keyframes charIn {
  from { opacity: 0; transform: translateY(18px) scale(0.9); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
.hero-title { font-size: clamp(30px, 5.6vw, 54px); letter-spacing: 4px; }
.hero-title em { font-style: normal; color: var(--cinnabar); }
.hero-sub { margin-top: 18px; color: var(--ink-2); font-size: clamp(15px, 2vw, 18px); letter-spacing: 2px; }
.hero-cta { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.hero-vertical {
  position: absolute; right: clamp(12px, 4vw, 56px); top: 50%; transform: translateY(-50%);
  writing-mode: vertical-rl; font-family: var(--font-kai);
  color: var(--ink-3); font-size: 15px; letter-spacing: 10px;
  border-right: 1px solid var(--line); padding-right: 12px;
}

/* ---------- 通用区块 ---------- */
.sec { padding: clamp(48px, 9vh, 88px) 0; }
.sec-head { text-align: center; margin-bottom: clamp(28px, 5vh, 48px); }
.sec-head h2 { font-size: clamp(24px, 3.4vw, 34px); letter-spacing: 3px; }
.sec-head h2::after { content: ""; display: block; width: 46px; height: 3px; background: var(--cinnabar); margin: 12px auto 0; border-radius: 2px; opacity: 0.85; }
.sec-head p { margin-top: 12px; color: var(--ink-2); max-width: 640px; margin-left: auto; margin-right: auto; font-size: 15px; }

/* ---------- 六书 ---------- */
.books { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.book {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: 6px;
  padding: 22px 22px 18px; position: relative; overflow: hidden;
  transition: transform var(--motion-base) var(--ease-standard), box-shadow var(--motion-base) var(--ease-standard);
}
.book::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--cinnabar), transparent 70%); opacity: 0.7; }
.book:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(38, 35, 29, 0.09); }
.book-name { font-size: 24px; letter-spacing: 4px; }
.book-formula { margin-top: 6px; color: var(--gold); font-size: 13.5px; letter-spacing: 1px; }
.book-desc { margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.book-examples { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.book-examples span {
  font-family: var(--font-kai); font-size: 19px; width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper-2); border-radius: 4px; color: var(--ink);
}

/* ---------- 字族卡片 ---------- */
.fam-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.fam-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px;
  background: var(--card); border: 1px solid var(--line-soft); border-radius: 6px;
  padding: 20px 22px; color: var(--ink);
  transition: transform var(--motion-base) var(--ease-standard), box-shadow var(--motion-base) var(--ease-standard), border-color var(--motion-base) var(--ease-standard);
}
.fam-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(38, 35, 29, 0.1); color: var(--ink); border-color: var(--fam, var(--line)); }
.fam-glyph {
  font-family: var(--font-kai); font-size: 46px; line-height: 1;
  width: 76px; height: 76px; display: flex; align-items: center; justify-content: center;
  color: var(--fam, var(--ink)); background: var(--fam-tint, var(--paper-2)); border-radius: 6px;
}
.fam-name { font-family: var(--font-kai); font-size: 21px; letter-spacing: 2px; display: block; }
.fam-tag { display: block; color: var(--ink-2); font-size: 13.5px; margin-top: 2px; }
.fam-chains { display: block; color: var(--ink-3); font-size: 12px; margin-top: 6px; }
.fam-count {
  align-self: start; font-size: 12px; color: var(--fam-deep, var(--ink-2));
  border: 1px solid currentColor; border-radius: 999px; padding: 1px 10px; opacity: 0.85; white-space: nowrap;
}

/* ---------- 三层读字 ---------- */
.layers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.layer { background: var(--card); border: 1px solid var(--line-soft); border-radius: 6px; padding: 24px; text-align: center; }
.layer-num {
  font-family: var(--font-kai); font-size: 15px; color: var(--cinnabar);
  width: 34px; height: 34px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(158, 47, 38, 0.45); border-radius: 50%;
}
.layer h3 { font-size: 20px; letter-spacing: 3px; }
.layer p { margin-top: 10px; font-size: 14px; color: var(--ink-2); text-align: justify; }
.layers-note { text-align: center; color: var(--ink-3); font-size: 13px; margin-top: 20px; }

/* ---------- 量级轴预告 ---------- */
.teaser { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(24px, 5vw, 56px); align-items: center; }
.teaser-scene {
  background: linear-gradient(180deg, #eef4f5, #dfe9ea); border: 1px solid var(--line-soft);
  border-radius: 8px; padding: 28px 0 0; text-align: center; overflow: hidden;
}
.teaser-char { font-family: var(--font-kai); font-size: clamp(80px, 12vw, 128px); color: #2f5d6e; line-height: 1; display: block; }
.teaser-waves { width: 100%; height: 60px; margin-top: -12px; }
.teaser-body h2 { font-size: 30px; letter-spacing: 3px; }
.teaser-body p { margin: 14px 0 22px; color: var(--ink-2); font-size: 15px; }
.teaser .w { fill: rgba(47, 93, 110, 0.5); }
.teaser .w2 { fill: rgba(47, 93, 110, 0.75); }

/* ---------- 页头横幅（内页） ---------- */
.page-head { padding: clamp(44px, 8vh, 76px) 0 clamp(28px, 5vh, 44px); background: linear-gradient(180deg, var(--paper-2), var(--paper)); border-bottom: 1px solid var(--line-soft); }
.page-head h1 { font-size: clamp(28px, 4.4vw, 42px); letter-spacing: 4px; }
.page-head p { margin-top: 12px; color: var(--ink-2); max-width: 680px; }

.crumb { padding-top: 18px; font-size: 13px; color: var(--ink-3); display: flex; gap: 8px; align-items: center; }
.crumb a { color: var(--ink-3); }
.crumb a:hover { color: var(--cinnabar); }
.crumb b { color: var(--ink); font-weight: 600; }

.more-note { text-align: center; color: var(--ink-3); font-size: 13.5px; margin-top: 26px; }

/* ---------- 字族页 ---------- */
.fam-hero { background: linear-gradient(180deg, color-mix(in srgb, var(--fam-tint) 62%, var(--paper)), var(--paper)); border-bottom: 1px solid var(--line-soft); padding: clamp(36px, 6vh, 60px) 0; }
.fam-hero-row { display: grid; grid-template-columns: auto 1fr; gap: clamp(24px, 5vw, 60px); align-items: center; }
.fam-evo { display: flex; align-items: center; gap: 10px; }
.fam-evo figure { text-align: center; }
.fam-evo figcaption { font-size: 12px; color: var(--ink-3); margin-top: 8px; white-space: nowrap; }
.evo-glyph { width: clamp(64px, 9vw, 92px); height: clamp(64px, 9vw, 92px); color: var(--fam-deep, var(--ink)); }
.evo-glyph.evo-kai { font-family: var(--font-kai); font-size: clamp(48px, 7vw, 72px); display: flex; align-items: center; justify-content: center; color: var(--fam, var(--ink)); }
.evo-sep { color: var(--line); font-size: 20px; }
.fam-intro h1 { font-size: clamp(26px, 3.6vw, 36px); letter-spacing: 3px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.fam-radical { font-size: 13px; color: var(--fam-deep); border: 1px solid currentColor; border-radius: 999px; padding: 1px 12px; font-family: var(--font-song); font-weight: 400; letter-spacing: 1px; }
.fam-tagline { color: var(--fam); font-family: var(--font-kai); letter-spacing: 2px; margin-top: 8px; font-size: 17px; }
.fam-shuowen { margin-top: 14px; font-size: 14px; color: var(--ink-2); border-left: 3px solid var(--fam, var(--cinnabar)); padding-left: 12px; }
.fam-shuowen b { color: var(--fam-deep); margin-right: 8px; font-family: var(--font-kai); }
.fam-desc { margin-top: 14px; color: var(--ink-2); font-size: 15px; max-width: 620px; }

/* 三层卡在字族页按主题着色 */
.fam-page .layer-num { color: var(--fam); border-color: color-mix(in srgb, var(--fam) 45%, transparent); }
.fam-page .sec-head h2::after { background: var(--fam); }

/* ---------- 字族栏目（字族总览） ---------- */
.cat-sec { padding-top: 8px; scroll-margin-top: 76px; }
.cat-head { margin-bottom: 20px; }
.cat-head h2 { font-size: 22px; letter-spacing: 3px; display: flex; align-items: center; gap: 12px; }
.cat-head h2 i {
  font-style: normal; font-size: 13px; color: var(--cinnabar);
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(158, 47, 38, 0.45); border-radius: 50%;
}
.cat-count { font-size: 12px; color: var(--cinnabar); border: 1px solid currentColor; border-radius: 999px; padding: 1px 10px; font-family: var(--font-song); letter-spacing: 1px; font-weight: 400; }
.cat-head p { color: var(--ink-3); font-size: 13.5px; margin-top: 4px; }

.cat-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.cat-chip {
  display: inline-flex; align-items: baseline; gap: 8px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line-soft); border-radius: 999px;
  padding: 7px 16px; color: var(--ink-2);
  transition: border-color var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard);
}
.cat-chip b { font-family: var(--font-kai); font-size: 15px; letter-spacing: 2px; font-weight: 600; color: var(--ink); }
.cat-chip span { font-size: 11px; color: var(--cinnabar); }
.cat-chip:hover { border-color: var(--cinnabar); transform: translateY(-1px); }

/* ---------- 词语链 ---------- */
.words-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.word-chip {
  display: grid; gap: 6px; background: var(--card); border: 1px solid var(--line-soft);
  border-radius: 8px; padding: 20px 22px; color: var(--ink);
  transition: transform var(--motion-base) var(--ease-standard), box-shadow var(--motion-base) var(--ease-standard), border-color var(--motion-base) var(--ease-standard);
}
.word-chip:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(38, 35, 29, 0.1); color: var(--ink); border-color: var(--cinnabar); }
.word-chip b { font-family: var(--font-kai); font-size: 20px; letter-spacing: 2px; color: var(--cinnabar); }
.word-chip span { font-size: 13px; color: var(--ink-2); }

/* ---------- 词语链（多字步进） ---------- */
.chain-char.is-word { font-size: clamp(48px, 9vw, 88px); letter-spacing: 3px; }
.chain-ticks.is-word-ticks li { font-size: clamp(10px, 1.4vw, 12.5px); }
.chain-stage--bare { min-height: 150px; display: flex; align-items: center; justify-content: center; }
.chain-stage--bare .chain-figure { position: static; padding: 18px 0 6px; }

/* ---------- 场景：山 / 金 / 土 / 居所 / 丝 ---------- */
.scene-mountain .mf { fill: color-mix(in srgb, var(--fam, #4a6d6c) 30%, transparent); stroke: none; }
.scene-mountain .mo { fill: none; stroke: var(--fam, #4a6d6c); stroke-width: 3.4; stroke-linejoin: round; }
.scene-mountain .mt { stroke: var(--fam, #4a6d6c); stroke-width: 2.6; stroke-linecap: round; }

.scene-metal path { fill: none; stroke: var(--fam, #5e6b5e); stroke-width: 3.2; stroke-linejoin: round; stroke-linecap: round; }
.scene-land .ld:first-child circle, .scene-land circle { fill: var(--fam, #7a5636); stroke: none; }
.scene-land .ld circle { fill: var(--fam, #7a5636); stroke: none; }
.scene-land .ld path { fill: none; stroke: var(--fam, #7a5636); stroke-width: 3; stroke-linecap: round; }

.scene-house .hs-line { fill: none; stroke: var(--fam, #96562e); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.scene-house .hs-fill { fill: color-mix(in srgb, var(--fam, #96562e) 16%, transparent); stroke: var(--fam, #96562e); stroke-width: 3.2; stroke-linejoin: round; }
.scene-house .hs-dot { fill: var(--fam, #96562e); stroke: none; }

.scene-silk .sk-line { fill: none; stroke: var(--fam, #8e4a5e); stroke-width: 2.6; stroke-linecap: round; }

.scene-jade .jd path, .scene-jade .jd circle { fill: none; stroke: var(--fam, #3f8a7d); stroke-width: 3; stroke-linejoin: round; }
.scene-jade .jdf { fill: color-mix(in srgb, var(--fam, #3f8a7d) 14%, transparent); }
.scene-jade .jdl { stroke-dasharray: 5 6; }

.scene-fish .fk path { fill: none; stroke: var(--fam, #2e7fa8); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.scene-fish .fk circle { fill: var(--fam, #2e7fa8); stroke: none; }

.scene-rain .rn-cloud { fill: color-mix(in srgb, var(--ink-2) 16%, transparent); stroke: none; }
.scene-rain .rn path { fill: none; stroke: var(--fam, #46647f); stroke-width: 2.4; stroke-linecap: round; }
.scene-rain .rn circle { fill: var(--fam, #46647f); stroke: none; }
.scene-rain .rn-sun { fill: var(--gold); stroke: none; }
.scene-rain .rn-bow { fill: none; stroke: var(--cinnabar); stroke-width: 2.6; opacity: 0.75; }

.scene-road .rd-line { fill: none; stroke: var(--fam, #6f8040); stroke-width: 3; stroke-linecap: round; }
.scene-road .rd path:not(.rd-line) { fill: none; stroke: var(--ink-3); stroke-width: 2.4; stroke-linecap: round; }

.scene-boat path { fill: none; stroke: var(--fam, #46647f); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.scene-boat .bt-wave { stroke: color-mix(in srgb, var(--fam, #46647f) 45%, transparent); stroke-width: 2.4; }
.scene-boat .bt-flag { stroke-width: 2.4; }

.scene-tree .tr, .scene-moon .ph, .scene-hand .hg,
.scene-mountain .ms, .scene-metal .mt, .scene-land .ld,
.scene-house .hs, .scene-silk .sk,
.scene-jade .jd, .scene-fish .fk, .scene-rain .rn, .scene-road .rd, .scene-boat .bt { opacity: 0; transition: opacity 360ms var(--ease-standard); }

/* ---------- 字形演变 ---------- */
.evo-row { display: flex; align-items: center; justify-content: center; gap: clamp(16px, 4vw, 44px); margin-bottom: 24px; }
.evo-row .evo-cell { text-align: center; }
.evo-row figcaption { font-size: 12.5px; color: var(--ink-3); margin-top: 8px; }
.evo-notes { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 900px; margin: 0 auto; }
.evo-notes li { background: var(--card); border: 1px solid var(--line-soft); border-radius: 6px; padding: 12px 14px; font-size: 13px; color: var(--ink-2); }
.evo-notes b { display: block; font-family: var(--font-kai); color: var(--fam, var(--ink)); font-size: 15px; margin-bottom: 4px; letter-spacing: 2px; }
.evo-tip { text-align: center; color: var(--ink-3); font-size: 12px; margin-top: 16px; }

/* ---------- 量级轴 ---------- */
.sec-chain { padding-top: 0; }
.chain {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: 10px;
  padding: clamp(20px, 4vw, 36px); max-width: 920px; margin: 0 auto;
  box-shadow: 0 4px 24px rgba(38, 35, 29, 0.05);
}
.chain-head { text-align: center; }
.chain-head h3 { font-size: 22px; letter-spacing: 3px; }
.chain-desc { color: var(--ink-2); font-size: 14px; margin-top: 8px; max-width: 560px; margin-left: auto; margin-right: auto; }
.chain-axis { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; color: var(--fam, var(--cinnabar)); letter-spacing: 1px; }
.axis-arrow { width: 34px; height: 2px; background: currentColor; display: inline-block; clip-path: polygon(0 40%, calc(100% - 7px) 40%, calc(100% - 7px) 15%, 100% 50%, calc(100% - 7px) 85%, calc(100% - 7px) 60%, 0 60%); }
.chain-stage { position: relative; margin: clamp(16px, 3vh, 26px) 0 8px; }
.scene { width: 100%; height: clamp(120px, 22vh, 170px); }
.chain-figure {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.chain-char {
  font-family: var(--font-kai); font-size: clamp(96px, 17vw, 168px); line-height: 1;
  color: var(--ink); text-shadow: 0 2px 24px rgba(246, 241, 230, 0.9);
}
.scene-water .sw-drop { fill: var(--fam, #2f5d6e); opacity: 1; transition: opacity var(--motion-base) var(--ease-standard); }
.scene-water .sw-waves { transform-origin: 100px 120px; opacity: 0.5; transition: transform 420ms var(--ease-entrance), opacity 420ms var(--ease-standard); }
.scene-water .w1 { fill: color-mix(in srgb, var(--fam, #2f5d6e) 34%, transparent); }
.scene-water .w2 { fill: color-mix(in srgb, var(--fam, #2f5d6e) 52%, transparent); }
.scene-water .w3 { fill: color-mix(in srgb, var(--fam, #2f5d6e) 72%, transparent); }

.scene .ground { stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; opacity: 0.6; }
.scene-tree .tr, .scene-moon .ph, .scene-hand .hg { opacity: 0; transition: opacity 360ms var(--ease-standard); }
.scene-tree path, .scene-hand path { fill: none; stroke: var(--fam, var(--ink-2)); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.scene-tree circle { fill: none; stroke: var(--fam, var(--ink-2)); stroke-width: 3.4; }
.scene-tree .tr2 circle { fill: color-mix(in srgb, var(--fam, #4c6b4a) 16%, transparent); }

.scene-fire .flames { transform-origin: 100px 110px; transition: transform 420ms var(--ease-entrance), opacity var(--motion-base) var(--ease-standard); }
.scene-fire .f { fill: color-mix(in srgb, var(--fam, #a83f2e) 78%, transparent); }
.scene-fire .f2, .scene-fire .f3 { opacity: 0.55; }
.scene-fire .ash { opacity: 0; transition: opacity var(--motion-base) var(--ease-standard); }
.scene-fire .ash path { fill: none; stroke: var(--ink-3); stroke-width: 3; stroke-linecap: round; }
.scene-fire .ash circle { fill: var(--ink-3); }

.scene-sun .sun-arc { fill: none; stroke: var(--line); stroke-width: 2; stroke-dasharray: 1 7; stroke-linecap: round; }
.scene-sun .sun-orb circle { fill: var(--fam, #a07d2c); transition: transform 380ms var(--ease-entrance); }

.scene-moon .mo { fill: none; stroke: var(--fam, #5b5b7e); stroke-width: 3; }
.scene-moon .mo.dash { stroke-dasharray: 4 6; opacity: 0.6; }
.scene-moon .mf { fill: var(--fam, #5b5b7e); }
.scene-moon .stars circle { fill: var(--gold); opacity: 0.7; }

.scene-hand path { fill: none; stroke: var(--fam, #8a5a33); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }

.chain-info { text-align: center; min-height: 118px; }
.chain-pinyin { font-size: 15px; color: var(--fam, var(--cinnabar)); letter-spacing: 2px; margin-top: 2px; }
.chain-gloss { font-family: var(--font-kai); font-size: clamp(17px, 2.6vw, 21px); margin-top: 4px; }
.chain-note { font-size: 14px; color: var(--ink-2); margin-top: 8px; max-width: 560px; margin-left: auto; margin-right: auto; }
.chain-info > * { transition: opacity var(--motion-fast) var(--ease-standard); }
.chain-info.swap > * { opacity: 0; }

.chain-control { margin-top: 6px; }
.chain-play {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--font-kai); font-size: 14px; letter-spacing: 2px; color: var(--fam-deep, var(--ink));
  background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px;
  transition: background var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard);
}
.chain-play:hover { border-color: var(--fam, var(--ink-2)); background: color-mix(in srgb, var(--fam, #9e2f26) 7%, transparent); }
.chain-play:active { transform: scale(0.97); }
.chain-play svg { width: 13px; height: 13px; fill: currentColor; }
.chain-play .ic-stop { display: none; }
.chain-play[aria-pressed="true"] .ic-play { display: none; }
.chain-play[aria-pressed="true"] .ic-stop { display: block; }

.chain-range {
  width: 100%; margin-top: 18px; appearance: none; -webkit-appearance: none;
  height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--fam, var(--cinnabar)) var(--fill, 0%), var(--line) var(--fill, 0%));
  outline-offset: 6px; cursor: pointer;
}
.chain-range::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--paper); border: 3px solid var(--fam, var(--cinnabar));
  box-shadow: 0 2px 8px rgba(38, 35, 29, 0.22); cursor: grab;
}
.chain-range::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--paper); border: 3px solid var(--fam, var(--cinnabar));
  box-shadow: 0 2px 8px rgba(38, 35, 29, 0.22); cursor: grab;
}
.chain-ticks { list-style: none; display: flex; justify-content: space-between; margin-top: 10px; font-family: var(--font-kai); font-size: clamp(11px, 1.6vw, 14px); color: var(--ink-3); }
.chain-ticks li { padding: 0 2px; transition: color var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard); }
.chain-ticks li.on { color: var(--fam-deep, var(--cinnabar)); transform: translateY(-2px); }
.chain-ticks li:first-child, .chain-ticks li:last-child { font-size: 1.25em; }

/* ---------- 拆字会意 ---------- */
.asm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.asm {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: 8px;
  padding: 22px; display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; position: relative;
}
.asm-stage {
  position: relative; width: 128px; height: 128px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.asm-part, .asm-whole {
  position: absolute; font-family: var(--font-kai); font-size: 76px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.asm-whole { color: var(--fam-deep, var(--ink)); }
.asm-part { color: var(--fam, var(--ink-2)); }
/* 无 JS：静态显示整字 */
.asm .asm-part { opacity: 0; }
.asm .asm-whole { opacity: 1; }
/* JS 接管：部件散开待命 */
html.js .asm.arm .asm-part { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(var(--froms, 1)); }
html.js .asm.arm .asm-whole { opacity: 0; transition: none; }
/* 播放：部件汇聚 → 整字浮现 */
html.js .asm.arm.played .asm-part {
  opacity: 0.85; transform: none;
  transition: transform 560ms var(--ease-entrance) calc(var(--i) * 220ms + 60ms), opacity 300ms var(--ease-standard) calc(var(--i) * 220ms + 60ms);
}
html.js .asm.arm.played .asm-whole { opacity: 1; transition: opacity 420ms var(--ease-standard) 780ms; }
.asm figcaption h4 { font-size: 20px; letter-spacing: 2px; }
.asm .py { font-size: 13px; color: var(--ink-3); font-family: var(--font-song); font-weight: 400; margin-left: 6px; }
.asm figcaption p { font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.asm figcaption b { color: var(--fam, var(--cinnabar)); font-family: var(--font-kai); margin-right: 8px; font-weight: 600; }
.asm-replay {
  position: absolute; top: 14px; right: 14px; cursor: pointer;
  font-size: 12px; color: var(--ink-3); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px;
  transition: color var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard);
}
.asm-replay:hover { color: var(--fam, var(--cinnabar)); border-color: currentColor; }

/* ---------- 字族枝叶 ---------- */
.groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.group { background: var(--card); border: 1px solid var(--line-soft); border-radius: 8px; padding: 20px 22px; }
.group h3 { font-size: 18px; letter-spacing: 2px; color: var(--fam-deep, var(--ink)); }
.group-desc { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.group-chars { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.group-chars li {
  position: relative; font-family: var(--font-kai); font-size: 22px; color: var(--ink);
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: var(--paper-2); border-radius: 4px; cursor: help;
  transition: background var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard);
}
.group-chars li:hover, .group-chars li:focus-visible { background: var(--fam, var(--cinnabar)); color: #f8f2e4; transform: translateY(-2px); }
.group-chars li::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(2px);
  background: var(--ink); color: var(--paper); font-family: var(--font-song); font-size: 12px; line-height: 1.4;
  padding: 5px 10px; border-radius: 4px; white-space: nowrap; max-width: 220px; width: max-content;
  opacity: 0; pointer-events: none; transition: opacity var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard);
  z-index: 10;
}
.group-chars li:hover::after, .group-chars li:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 引句 ---------- */
.quotes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; max-width: 860px; margin: 0 auto; }
.quotes blockquote {
  background: linear-gradient(180deg, var(--card), transparent);
  border: 1px solid var(--line-soft); border-radius: 8px; padding: 22px 24px 18px; text-align: center;
}
.quotes p { font-family: var(--font-kai); font-size: 17px; letter-spacing: 1px; }
.quotes cite { display: block; margin-top: 10px; font-size: 12.5px; color: var(--ink-3); font-style: normal; }

/* ---------- 字族切换 ---------- */
.fam-pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 8px; padding-bottom: clamp(40px, 8vh, 72px); }
.fam-pager a {
  color: var(--ink-2); font-family: var(--font-kai); font-size: 16px; letter-spacing: 1px;
  border: 1px solid var(--line-soft); border-radius: 6px; padding: 10px 18px; background: var(--card);
  transition: border-color var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard);
}
.fam-pager a:hover { border-color: var(--cinnabar); color: var(--cinnabar); }
.fam-pager small { display: block; font-size: 11px; color: var(--ink-3); font-family: var(--font-song); letter-spacing: 2px; }
.fam-pager a:nth-child(2) { border: none; background: none; font-size: 14px; color: var(--ink-3); }

/* ---------- 理念页 ---------- */
.prose { max-width: 720px; }
.prose h2 { font-size: 22px; margin: 28px 0 12px; letter-spacing: 2px; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 20px; color: var(--ink-2); font-size: 14.5px; }
.prose li { margin-top: 8px; }

/* ---------- 404 ---------- */
.notfound { min-height: calc(100svh - 260px); display: flex; align-items: center; text-align: center; padding: 60px 0; }
.notfound h1 { font-size: clamp(26px, 4vw, 38px); letter-spacing: 4px; }
.notfound p { margin-top: 14px; color: var(--ink-2); }
.notfound .btn { margin-top: 10px; }

/* ---------- 页脚 ---------- */
.site-foot { border-top: 1px solid var(--line-soft); background: linear-gradient(180deg, var(--paper), var(--paper-2)); margin-top: clamp(32px, 6vh, 64px); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 32px; padding-top: 40px; padding-bottom: 28px; }
.foot-logo { font-family: var(--font-kai); font-size: 19px; display: flex; align-items: center; gap: 10px; }
.foot-desc { margin-top: 12px; font-size: 13.5px; color: var(--ink-2); max-width: 320px; }
.foot-col h3 { font-size: 14px; letter-spacing: 3px; color: var(--ink-3); margin-bottom: 12px; font-weight: 400; }
.foot-col a { display: block; font-size: 13.5px; color: var(--ink-2); padding: 3px 0; }
.foot-col a:hover { color: var(--cinnabar); }
.foot-fams { display: flex; flex-wrap: wrap; gap: 4px 14px; max-width: 420px; }
.foot-fams a { display: inline; padding: 0; }
.foot-base {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-top: 1px solid var(--line-soft); padding-top: 16px; padding-bottom: 20px;
  font-size: 12px; color: var(--ink-3);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .books { grid-template-columns: repeat(2, 1fr); }
  .fam-grid { grid-template-columns: repeat(2, 1fr); }
  .layers, .evo-notes { grid-template-columns: repeat(2, 1fr); }
  .asm-grid { grid-template-columns: 1fr; }
  .groups { grid-template-columns: 1fr; }
  .quotes { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  body { font-size: 15px; }
  .brand-tag { display: none; }
  .hero-vertical { display: none; }
  .search-key { display: none; }
  .search-mask { padding-top: 8vh; }
  .fam-hero-row { grid-template-columns: 1fr; }
  .fam-evo { justify-content: center; }
  .fam-intro h1 { justify-content: center; text-align: center; }
  .fam-tagline, .fam-shuowen, .fam-desc { text-align: center; }
  .fam-shuowen { border-left: none; padding-left: 0; }
  .fam-desc { margin-left: auto; margin-right: auto; }
  .teaser { grid-template-columns: 1fr; }
  .evo-row { gap: 12px; }
  .asm { grid-template-columns: 1fr; justify-items: center; text-align: left; }
  .asm figcaption { width: 100%; }
  .foot-grid { grid-template-columns: 1fr; gap: 24px; }
  .foot-base { flex-direction: column; align-items: center; text-align: center; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  .books, .fam-grid, .layers, .evo-notes { grid-template-columns: 1fr; }
  .hero { padding: 36px 16px 56px; }
  .fam-card { grid-template-columns: auto 1fr; }
  .fam-count { display: none; }
  .chain { padding: 18px 16px; }
  .group-chars li { width: 40px; height: 40px; font-size: 20px; }
}

/* ---------- 减动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  .hero-chain span { animation: none; opacity: 1; }
  html.js .reveal { opacity: 1; transform: none; }
  html.js .asm.arm .asm-whole { opacity: 1; }
  html.js .asm.arm .asm-part { opacity: 0; transform: none; }
}
