/* ============================================================
   习琴记 — 共享样式
   清新雅致 · 音乐感 | 纸白 + 墨绿松石 + 暖铜金 | 五线谱母题
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant:ital,wght@0,500;0,600;1,500&family=Noto+Sans+SC:wght@300;400;500;700&family=Noto+Serif+SC:wght@400;500;700&display=swap');

:root {
  /* 色板 */
  --ink:        #22323b;  /* 主文字：深墨青 */
  --ink-soft:   #50656c;  /* 次要文字 */
  --ink-faint:  #8499a0;  /* 弱化文字 */
  --paper:      #f4f8f6;  /* 页面底色：清冷纸白 */
  --mist:       #e6efea;  /* 面板/分区底 */
  --card:       #ffffff;  /* 卡片 */
  --jade:       #34897a;  /* 主强调：墨绿松石 */
  --jade-deep:  #245f53;  /* 深松石 */
  --jade-tint:  #d7e7e1;  /* 浅松石 */
  --gold:       #c0843a;  /* 暖铜金：克制点缀 */
  --gold-tint:  #f0e2cd;
  --line:       #c4d5ce;  /* 谱线 */

  /* 字体 */
  --serif: "Noto Serif SC", "Songti SC", serif;
  --sans:  "Noto Sans SC", -apple-system, "PingFang SC", sans-serif;
  --display: "Cormorant", "Noto Serif SC", serif;

  /* 尺度 */
  --maxw: 1080px;
  --gap: clamp(1rem, 3vw, 2rem);
  --radius: 14px;
  --shadow: 0 18px 40px -24px rgba(34, 50, 59, .35);
  --shadow-soft: 0 8px 24px -16px rgba(34, 50, 59, .3);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--jade-deep); text-decoration: none; }

::selection { background: var(--jade-tint); color: var(--ink); }

.wrap { width: min(100% - 2.4rem, var(--maxw)); margin-inline: auto; }

/* ---------- 五线谱母题 ---------- */
/* 五条谱线作为分隔/装饰 */
.staff {
  height: 46px;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0, transparent 10px,
    var(--line) 10px, var(--line) 11px
  );
  background-position: 0 1px;
  position: relative;
  opacity: .7;
}

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244, 248, 246, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--mist);
}
.nav-inner {
  width: min(100% - 2.4rem, var(--maxw));
  margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 66px;
}
.brand {
  display: flex; align-items: center; gap: .6rem;
  font-family: var(--serif); font-weight: 700; font-size: 1.3rem;
  color: var(--ink); letter-spacing: .06em;
}
.brand .logo {
  width: 30px; height: 30px; flex: none;
}
.nav-links { display: flex; gap: .3rem; list-style: none; }
.nav-links a {
  display: block; padding: .45rem .85rem;
  color: var(--ink-soft); font-size: .95rem; font-weight: 500;
  border-radius: 8px; transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--jade-deep); background: var(--mist); }
.nav-links a.active { color: var(--jade-deep); }
.nav-links a.active::after {
  content: "♪"; margin-left: .3rem; color: var(--gold); font-size: .8em;
}

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  font-size: 1.6rem; color: var(--ink); line-height: 1;
}

/* ---------- 区块通用 ---------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section.alt { background: var(--mist); }

.eyebrow {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--gold);
  letter-spacing: .04em;
  margin-bottom: .4rem;
}
.section-title {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: .04em; line-height: 1.3;
  color: var(--ink);
}
.section-lead {
  max-width: 46ch; color: var(--ink-soft);
  margin-top: .8rem; font-size: 1.02rem;
}

/* ---------- 首页 Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(3.5rem, 9vw, 7rem) 0 0;
}
.hero-inner { width: min(100% - 2.4rem, var(--maxw)); margin-inline: auto; }
.hero-eyebrow {
  font-family: var(--display); font-style: italic;
  color: var(--gold); font-size: 1.3rem; letter-spacing: .05em;
}
.hero h1 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  line-height: 1.18; letter-spacing: .04em;
  margin: .5rem 0 1rem;
}
.hero h1 .accent { color: var(--jade); }
.hero-sub {
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  color: var(--ink-soft); max-width: 42ch;
}
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 1.4rem;
  margin: 1.8rem 0 2.4rem;
}
.hero-meta .chip {
  display: flex; align-items: baseline; gap: .5rem;
}
.hero-meta .num {
  font-family: var(--display); font-weight: 600;
  font-size: 2rem; color: var(--jade-deep); line-height: 1;
}
.hero-meta .lbl { color: var(--ink-soft); font-size: .92rem; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.6rem; border-radius: 999px;
  font-weight: 500; font-size: 1rem;
  transition: transform .18s, box-shadow .2s, background .2s;
}
.btn-primary {
  background: var(--jade); color: #fff;
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover { background: var(--jade-deep); transform: translateY(-2px); }
.btn-ghost { color: var(--jade-deep); }
.btn-ghost:hover { color: var(--ink); }
.hero-cta { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }

/* CSS 键盘条 */
.keyboard {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  display: flex; position: relative;
  height: clamp(120px, 22vw, 190px);
  border-radius: var(--radius) var(--radius) 6px 6px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--ink);
  padding-top: 8px;
}
.keyboard .white {
  flex: 1; background: linear-gradient(#fff, #f1f4f2);
  border-right: 1px solid #dfe6e2;
  position: relative;
  border-radius: 0 0 5px 5px;
}
.keyboard .white:last-child { border-right: 0; }
.keyboard .black {
  position: absolute; top: 8px;
  width: 5.2%; height: 60%;
  background: linear-gradient(#3a4a50, #1b262b);
  border-radius: 0 0 4px 4px; z-index: 2;
  box-shadow: 0 3px 6px rgba(0,0,0,.4);
}

/* ---------- 模块卡片 ---------- */
.cards {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 2.6rem;
}
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  padding: 1.8rem 1.6rem;
  box-shadow: var(--shadow-soft);
  transition: transform .22s, box-shadow .22s, border-color .22s;
  display: flex; flex-direction: column;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--jade-tint);
}
.card .note {
  font-family: var(--display); font-weight: 600;
  font-size: 1.05rem; color: var(--gold);
  display: flex; align-items: center; gap: .5rem;
  margin-bottom: .9rem;
}
.card .note::before {
  content: ""; width: 11px; height: 11px; border-radius: 50%;
  background: var(--jade); display: inline-block;
}
.card h3 {
  font-family: var(--serif); font-weight: 700;
  font-size: 1.28rem; letter-spacing: .03em; margin-bottom: .5rem;
}
.card p { color: var(--ink-soft); font-size: .96rem; flex: 1; }
.card .more {
  margin-top: 1.1rem; font-weight: 500; color: var(--jade-deep);
  display: inline-flex; align-items: center; gap: .35rem;
}
.card .more .arrow { transition: transform .2s; }
.card:hover .more .arrow { transform: translateX(4px); }
.card.soon { opacity: .92; }
.card.soon .tag {
  position: absolute; top: 1.2rem; right: 1.2rem;
  font-size: .72rem; color: var(--ink-faint);
  border: 1px solid var(--line); border-radius: 999px;
  padding: .12rem .6rem;
}

/* ---------- 内容排版（模块页用） ---------- */
.prose { max-width: 64ch; }
.prose h2 {
  font-family: var(--serif); font-weight: 700;
  font-size: 1.5rem; margin: 2.4rem 0 .8rem; letter-spacing: .03em;
}
.prose h3 { font-family: var(--serif); font-weight: 500; font-size: 1.2rem; margin: 1.6rem 0 .5rem; }
.prose p, .prose li { color: var(--ink-soft); }
.prose ul, .prose ol { margin: .6rem 0 1rem 1.3rem; }
.prose li { margin: .3rem 0; }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--mist);
  padding: 2.4rem 0; margin-top: 2rem;
  color: var(--ink-faint); font-size: .9rem;
}
.footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer .brand-mini { font-family: var(--serif); color: var(--ink-soft); letter-spacing: .08em; }

/* ---------- 滚动揭示动画 ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in-view { opacity: 1; transform: none; }

/* ============================================================
   知识模块专用组件
   ============================================================ */
.section[id] { scroll-margin-top: 84px; }

/* 页内目录 */
.toc { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.6rem; }
.toc a {
  font-size: .85rem; padding: .38rem .85rem;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-soft); transition: all .2s;
}
.toc a:hover { border-color: var(--jade); color: var(--jade-deep); background: var(--card); }

/* 内容卡 */
.panel {
  background: var(--card); border: 1px solid var(--mist);
  border-radius: var(--radius); padding: clamp(1.3rem, 3vw, 2rem);
  box-shadow: var(--shadow-soft); margin-top: 1.6rem;
}
.panel > p { color: var(--ink-soft); }
.panel > p + p { margin-top: .8rem; }

/* 提示框 */
.callout {
  border-left: 3px solid var(--gold);
  background: var(--gold-tint);
  border-radius: 0 10px 10px 0;
  padding: 1rem 1.2rem; margin: 1.3rem 0 .2rem;
  color: var(--ink); font-size: .95rem;
}
.callout b { color: var(--gold); }

/* 演示用键盘（2 个八度，带音名） */
.kb-demo {
  position: relative; display: flex;
  height: clamp(140px, 26vw, 190px);
  background: var(--ink); padding-top: 8px;
  border-radius: 10px; box-shadow: var(--shadow);
  margin-top: 2.4rem;
}
.kb-demo .wk {
  flex: 1; background: linear-gradient(#fff, #f1f4f2);
  border-right: 1px solid #dfe6e2;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: .5rem; font-size: .8rem; color: var(--ink-faint);
  position: relative; border-radius: 0 0 5px 5px;
}
.kb-demo .wk:last-child { border-right: 0; }
.kb-demo .wk b { display: block; font-weight: 500; }
.kb-demo .wk .solfa { font-family: var(--display); font-style: italic; color: var(--gold); }
.kb-demo .wk.mid { background: linear-gradient(#d3ece4, #bfe0d6); color: var(--jade-deep); }
.kb-demo .wk.mid::after {
  content: "中央 C"; position: absolute; top: -28px; left: 50%;
  transform: translateX(-50%); white-space: nowrap;
  font-size: .74rem; color: var(--gold); font-weight: 500;
}
.kb-demo .bk {
  position: absolute; top: 8px; width: 5.2%; height: 60%;
  background: linear-gradient(#3a4a50, #1b262b);
  border-radius: 0 0 4px 4px; z-index: 2;
  box-shadow: 0 3px 6px rgba(0,0,0,.4);
}

/* 时值对比条 */
.values { display: flex; flex-direction: column; gap: .65rem; margin-top: 1.2rem; }
.val { display: grid; grid-template-columns: 7.5rem 1fr auto; align-items: center; gap: .8rem; }
.val .name { font-weight: 500; font-size: .92rem; }
.val .bar {
  height: 30px; background: var(--jade); border-radius: 6px;
  display: flex; align-items: center; padding-left: .6rem;
  color: #fff; font-family: var(--display); font-size: .95rem;
  min-width: 2.2rem;
}
.val .bar.half { background: var(--jade-deep); }
.val .bar.q { background: #4a9c8c; }
.val .bar.e { background: #6fb3a4; }
.val .bar.s { background: #97c9bd; color: var(--ink); }
.val .beats { color: var(--ink-faint); font-size: .82rem; white-space: nowrap; }

/* 简谱示例 */
.jianpu {
  font-family: var(--display); font-size: 1.6rem; letter-spacing: .25em;
  color: var(--ink); background: var(--mist);
  border-radius: 10px; padding: 1rem 1.2rem; margin-top: 1rem;
  overflow-x: auto;
}
.jianpu small { display: block; font-family: var(--sans); font-size: .8rem; letter-spacing: normal; color: var(--ink-faint); margin-top: .4rem; }

/* 和弦图 */
.chord-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-top: 1.6rem;
}
.chord {
  background: var(--card); border: 1px solid var(--mist);
  border-radius: var(--radius); padding: 1.2rem;
  box-shadow: var(--shadow-soft);
}
.chord h4 {
  font-family: var(--serif); font-size: 1.15rem;
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: .15rem;
}
.chord h4 .sym { font-family: var(--display); color: var(--gold); font-size: 1.5rem; font-weight: 600; }
.chord .notes { font-size: .82rem; color: var(--ink-soft); margin-bottom: .8rem; }

/* 单八度迷你键盘（和弦演示） */
.mini-kb {
  position: relative; display: flex; height: 92px;
  background: var(--ink); padding-top: 6px;
  border-radius: 8px; box-shadow: var(--shadow-soft);
}
.mini-kb .wk {
  flex: 1; background: linear-gradient(#fff, #f1f4f2);
  border-right: 1px solid #dfe6e2; border-radius: 0 0 4px 4px;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: .3rem; font-size: .7rem; color: var(--ink-faint);
}
.mini-kb .wk:last-child { border-right: 0; }
.mini-kb .wk.on {
  background: linear-gradient(#cdeae1, #a4d4c6);
  color: var(--jade-deep); font-weight: 700;
}
.mini-kb .bk {
  position: absolute; top: 6px; width: 9%; height: 58%;
  background: linear-gradient(#3a4a50, #1b262b);
  border-radius: 0 0 3px 3px; z-index: 2;
}

/* 踏板示意 */
.pedal-row { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; margin-top: 1rem; }
.pedal-ic {
  flex: none; width: 64px; height: 64px; border-radius: 14px;
  background: var(--mist); display: grid; place-items: center;
  font-size: 1.8rem; color: var(--jade-deep);
}

/* ============================================================
   知识库（数据驱动：侧边栏筛选 / 搜索 / 难度 / 收藏 / 进度）
   ============================================================ */

/* 整体双栏布局 */
.kb-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  align-items: start;
  padding: 2rem 0 4rem;
}

/* 左侧边栏 */
.kb-sidebar {
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 1.4rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}
.kb-sidebar::-webkit-scrollbar { width: 4px; }
.kb-sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

.sb-section h3 {
  font-family: var(--sans);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-faint);
  margin-bottom: .65rem;
}

/* 搜索框 */
.kb-search { position: relative; }
.kb-search input {
  width: 100%; font: inherit; font-size: .9rem; color: var(--ink);
  padding: .6rem .9rem .6rem 2.2rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--mist);
  transition: border-color .2s, background .2s;
}
.kb-search input::placeholder { color: var(--ink-faint); font-size: .88rem; }
.kb-search input:focus {
  outline: 2px solid var(--jade); outline-offset: 1px;
  border-color: transparent; background: var(--card);
}
.kb-search .ico {
  position: absolute; left: .75rem; top: 50%;
  transform: translateY(-50%); color: var(--ink-faint);
  pointer-events: none; font-size: .9rem;
}

/* 纵向筛选列表 */
.filter-list { list-style: none; display: flex; flex-direction: column; gap: .15rem; }
.filter-list button {
  font: inherit; font-size: .9rem; width: 100%; text-align: left;
  padding: .48rem .75rem; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-soft);
  cursor: pointer; transition: background .15s, color .15s;
  display: flex; justify-content: space-between; align-items: center;
}
.filter-list button:hover { background: var(--mist); color: var(--ink); }
.filter-list button.on { background: var(--jade-tint); color: var(--jade-deep); font-weight: 500; }
.filter-list button.lvl.on { background: var(--gold-tint); color: #9a6120; }

.filter-count {
  font-size: .7rem; color: var(--ink-faint);
  background: var(--mist); border-radius: 999px;
  padding: .05rem .45rem; min-width: 1.4rem; text-align: center;
}
.filter-list button.on .filter-count { background: rgba(52, 137, 122, .15); color: var(--jade); }
.filter-list button.lvl.on .filter-count { background: rgba(192, 132, 58, .15); color: var(--gold); }

/* 收藏按钮 */
.fav-btn {
  font: inherit; font-size: .9rem; width: 100%; text-align: left;
  padding: .48rem .75rem;
  border: 1px dashed var(--line); border-radius: 8px;
  background: transparent; color: var(--ink-soft);
  cursor: pointer; transition: all .18s;
}
.fav-btn:hover { border-color: var(--gold); color: #9a6120; background: var(--gold-tint); }
.fav-btn.on { background: var(--gold-tint); border-color: var(--gold); color: #9a6120; font-weight: 500; }

/* 侧边栏进度 */
.sb-progress { display: flex; flex-direction: column; gap: .55rem; }
.sb-progress .track {
  width: 100%; height: 6px;
  background: var(--mist); border-radius: 999px; overflow: hidden;
}
.sb-progress .fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--jade), var(--jade-deep));
  transition: width .45s ease;
}
.sb-progress .meta {
  display: flex; justify-content: space-between; align-items: center;
}
.sb-progress #progress-label { font-size: .78rem; color: var(--ink-soft); }
.sb-progress .reset {
  background: none; border: 0; padding: 0;
  color: var(--ink-faint); cursor: pointer;
  font: inherit; font-size: .75rem; text-decoration: underline;
}
.sb-progress .reset:hover { color: var(--jade-deep); }

/* 词条网格 */
.kb-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); align-items: start; }
.entry {
  background: var(--card); border: 1px solid var(--mist);
  border-radius: var(--radius); box-shadow: var(--shadow-soft);
  overflow: hidden; transition: border-color .2s, box-shadow .2s;
}
.entry.open { border-color: var(--jade-tint); box-shadow: var(--shadow); grid-column: 1 / -1; }
.entry-head { padding: 1.3rem 1.4rem; cursor: pointer; display: flex; flex-direction: column; gap: .55rem; }
.entry-tags { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.tag-cat { font-size: .72rem; padding: .14rem .62rem; border-radius: 999px; background: var(--jade-tint); color: var(--jade-deep); font-weight: 500; }
.tag-lvl { font-size: .72rem; padding: .14rem .58rem; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-soft); }
.tag-lvl.l2 { color: var(--gold); border-color: var(--gold-tint); background: var(--gold-tint); }
.tag-lvl.l3 { color: #a8542a; border-color: #e8c4a8; background: #f6e6da; }
.read-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--jade); margin-left: auto; opacity: 0; }
.entry.read .read-dot { opacity: 1; }
.entry h3 { font-family: var(--serif); font-size: 1.24rem; letter-spacing: .02em; display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.star { background: none; border: 0; cursor: pointer; font-size: 1.15rem; line-height: 1; color: var(--ink-faint); flex: none; transition: transform .15s, color .15s; }
.star:hover { transform: scale(1.2); }
.star.on { color: var(--gold); }
.entry .summary { color: var(--ink-soft); font-size: .92rem; }
.entry-foot { display: flex; align-items: center; gap: .4rem; color: var(--jade-deep); font-size: .85rem; font-weight: 500; }
.entry-foot .caret { transition: transform .25s; }
.entry.open .entry-foot .caret { transform: rotate(90deg); }

.entry-body { display: none; padding: 0 1.4rem 1.6rem; border-top: 1px solid var(--mist); }
.entry.open .entry-body { display: block; animation: kbfade .35s ease; }
.entry-body > *:first-child { margin-top: 1.3rem; }
.entry-body h4 { font-family: var(--serif); font-weight: 500; font-size: 1.08rem; margin: 1.4rem 0 .4rem; color: var(--ink); }
.entry-body p, .entry-body li { color: var(--ink-soft); }
.entry-body p + p { margin-top: .7rem; }
.entry-body ul, .entry-body ol { margin: .5rem 0 .6rem 1.3rem; }
.entry-body li { margin: .25rem 0; }
.entry-body .callout { margin: 1.2rem 0 .2rem; }
@keyframes kbfade { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.kb-empty { text-align: center; padding: 3rem 1rem; color: var(--ink-faint); grid-column: 1 / -1; }

/* 术语词典 */
.glossary { columns: 2; column-gap: var(--gap); margin-top: 1.6rem; }
.term { break-inside: avoid; margin-bottom: .9rem; padding: .9rem 1.1rem; background: var(--card); border: 1px solid var(--mist); border-radius: 10px; }
.term dt { font-family: var(--display); font-size: 1.18rem; font-weight: 600; color: var(--jade-deep); }
.term dt .cn { font-family: var(--sans); font-size: .82rem; color: var(--ink); margin-left: .45rem; }
.term dd { margin: .15rem 0 0; font-size: .87rem; color: var(--ink-soft); }
@media (max-width: 640px) { .glossary { columns: 1; } }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--mist);
    padding: .5rem 1.2rem 1rem;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .7rem .4rem; }
}

@media (max-width: 900px) {
  .kb-layout {
    grid-template-columns: 1fr;
    padding: 1.2rem 0 3rem;
  }
  .kb-sidebar {
    position: static;
    max-height: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.6rem;
  }
  .sb-section:first-child { grid-column: 1 / -1; } /* search full width */
  .filter-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: .3rem;
  }
  .filter-list button {
    width: auto;
    font-size: .82rem;
    padding: .3rem .7rem;
  }
  .filter-count { display: none; }
}

@media (max-width: 560px) {
  .kb-sidebar { grid-template-columns: 1fr; }
  .kb-demo .wk { font-size: .62rem; padding-bottom: .3rem; }
  .val { grid-template-columns: 5rem 1fr; }
  .val .beats { grid-column: 2; }
}

/* ============================================================
   词条详情页 (entries/entry.html)
   ============================================================ */
.breadcrumb {
  display: flex; align-items: center; gap: .45rem;
  font-size: .84rem; color: var(--ink-faint); margin-bottom: 1.8rem;
}
.breadcrumb a { color: var(--jade-deep); }
.breadcrumb .sep { color: var(--line); }

.entry-hero {
  border-left: 4px solid var(--jade);
  background: var(--card);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.8rem 2rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-soft);
}
.entry-hero .e-tags { display: flex; gap: .5rem; margin-bottom: .8rem; }
.entry-hero h1 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: .04em;
}
.entry-hero .e-lead {
  color: var(--ink-soft); margin-top: .6rem;
  font-size: 1.05rem; max-width: 60ch; line-height: 1.7;
}

.toc-box {
  background: var(--mist); border-radius: var(--radius);
  padding: 1.1rem 1.4rem; margin-bottom: 2.5rem;
}
.toc-box .toc-label {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--ink-faint); font-weight: 700; margin-bottom: .65rem;
}
.toc-box ol {
  margin: 0 0 0 1.1rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .15rem .8rem;
}
.toc-box li a { font-size: .9rem; color: var(--jade-deep); }
.toc-box li a:hover { text-decoration: underline; }

/* 正文排版 */
.entry-content section { margin-bottom: 3rem; scroll-margin-top: 90px; }
.entry-content h2 {
  font-family: var(--serif); font-weight: 700; font-size: 1.48rem;
  letter-spacing: .03em; color: var(--ink);
  margin-bottom: .9rem; padding-bottom: .5rem;
  border-bottom: 1px solid var(--mist);
}
.entry-content h3 {
  font-family: var(--serif); font-weight: 500; font-size: 1.15rem;
  color: var(--ink); margin: 1.6rem 0 .55rem;
}
.entry-content p { color: var(--ink-soft); line-height: 1.85; margin-bottom: .85rem; }
.entry-content ul, .entry-content ol { margin: .5rem 0 1rem 1.3rem; color: var(--ink-soft); }
.entry-content li { margin: .4rem 0; line-height: 1.78; }
.entry-content b, .entry-content strong { color: var(--ink); }
.entry-content .callout { margin: 1.4rem 0; }

/* 表格 */
.et { width: 100%; border-collapse: collapse; margin: 1.3rem 0; font-size: .91rem; }
.et th {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .1em;
  font-weight: 700; color: var(--ink-faint);
  padding: .55rem .9rem; background: var(--mist);
  text-align: left; border: 1px solid var(--line);
}
.et td { padding: .55rem .9rem; border: 1px solid var(--line); color: var(--ink-soft); vertical-align: top; }
.et tr:nth-child(even) td { background: rgba(230,239,234,.3); }
.et td:first-child { color: var(--ink); font-weight: 500; }
.et .hl td { background: var(--jade-tint) !important; color: var(--jade-deep); }
.et .gold td { background: var(--gold-tint) !important; }

/* 洞察框 */
.key-insight {
  background: linear-gradient(135deg, var(--jade-tint), rgba(255,255,255,0));
  border: 1px solid var(--jade-tint); border-left: 4px solid var(--jade);
  border-radius: 0 10px 10px 0; padding: 1.1rem 1.3rem; margin: 1.5rem 0;
}
.key-insight .ki-label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .13em;
  color: var(--jade-deep); font-weight: 700; margin-bottom: .45rem;
}
.key-insight p { color: var(--ink); margin: 0; }

/* 练习框 */
.practice-box {
  background: var(--gold-tint); border: 1px solid rgba(192,132,58,.2);
  border-left: 4px solid var(--gold); border-radius: 0 10px 10px 0;
  padding: 1.1rem 1.3rem; margin: 1.5rem 0;
}
.practice-box .pb-label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .13em;
  color: var(--gold); font-weight: 700; margin-bottom: .45rem;
}
.practice-box p, .practice-box ul, .practice-box li { color: var(--ink); }
.practice-box ul { margin-left: 1.2rem; }

/* 12 调网格 */
.key-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: 1.2rem 0;
}
.key-cell {
  background: var(--card); border: 1px solid var(--mist);
  border-radius: 8px; padding: .6rem .7rem; text-align: center;
}
.key-cell .kn { font-family: var(--display); font-size: 1.3rem; font-weight: 600; color: var(--jade-deep); }
.key-cell .ks { font-size: .78rem; color: var(--ink-faint); margin-top: .1rem; }
.key-cell .knt { font-size: .68rem; color: var(--ink-soft); margin-top: .2rem; line-height: 1.5; }

/* 五度圈 CSS */
.cof-outer {
  position: relative; width: 300px; height: 300px; margin: 2rem auto;
  border-radius: 50%; background: conic-gradient(
    var(--jade-tint) 0deg 30deg, var(--mist) 30deg 60deg,
    var(--jade-tint) 60deg 90deg, var(--mist) 90deg 120deg,
    var(--jade-tint) 120deg 150deg, var(--mist) 150deg 180deg,
    var(--jade-tint) 180deg 210deg, var(--mist) 210deg 240deg,
    var(--jade-tint) 240deg 270deg, var(--mist) 270deg 300deg,
    var(--jade-tint) 300deg 330deg, var(--mist) 330deg 360deg
  );
}
.cof-inner {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 130px; height: 130px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--mist);
  display: grid; place-items: center;
}
.cof-inner span { font-family: var(--sans); font-size: .78rem; color: var(--ink-soft); text-align: center; }
.cof-note {
  position: absolute; width: 38px; height: 38px;
  border-radius: 50%; background: var(--card);
  border: 2px solid var(--jade-tint);
  display: grid; place-items: center;
  font-family: var(--display); font-size: 1rem; font-weight: 600; color: var(--jade-deep);
  box-shadow: var(--shadow-soft);
}

/* 相关词条 */
.related-section { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--mist); }
.related-section > h3 { font-family: var(--serif); font-size: 1.1rem; margin-bottom: 1rem; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px,1fr)); gap: .8rem; }
.related-card {
  display: block; background: var(--card); border: 1px solid var(--mist);
  border-radius: 10px; padding: .9rem 1rem; text-decoration: none;
  transition: border-color .18s, transform .18s;
}
.related-card:hover { border-color: var(--jade-tint); transform: translateY(-2px); }
.related-card .rc-tag { font-size: .7rem; color: var(--jade-deep); font-weight: 500; margin-bottom: .2rem; }
.related-card .rc-title { font-family: var(--serif); font-size: 1rem; color: var(--ink); }
.related-card .rc-sum { font-size: .8rem; color: var(--ink-soft); margin-top: .2rem; }

/* 上下翻页 */
.entry-pagination {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--mist);
}
.page-btn {
  display: flex; flex-direction: column; gap: .2rem;
  padding: .9rem 1.2rem; background: var(--card);
  border: 1px solid var(--mist); border-radius: var(--radius);
  text-decoration: none; transition: border-color .18s, transform .18s; max-width: 45%;
}
.page-btn:hover { border-color: var(--jade-tint); transform: translateY(-2px); }
.page-btn .pdir { font-size: .7rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .08em; }
.page-btn .ptitle { font-family: var(--serif); font-size: .95rem; color: var(--ink); }
.page-btn.pnext { text-align: right; margin-left: auto; }
.page-btn.pnext .pdir::before { content: ''; }

@media (max-width: 640px) {
  .key-grid { grid-template-columns: repeat(3, 1fr); }
  .toc-box ol { grid-template-columns: 1fr; }
  .entry-pagination { flex-direction: column; }
  .page-btn { max-width: 100%; }
  .page-btn.pnext { text-align: left; }
  .cof-outer { width: 240px; height: 240px; }
  .cof-inner { width: 100px; height: 100px; }
}

/* ---------- 无障碍 ---------- */
a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--jade-deep); outline-offset: 3px; border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card:hover, .btn-primary:hover { transform: none; }
}
