/* 柴米官网 · 共用样式
   结构沿用开发启动器 / 大师拷贝 / Firn 官网（同一套组件与版式），配色取自柴米应用：
   浅色是奶油底 #fbf6ee、深褐字、琥珀与陶橙作强调；暗色是应用的夜色玻璃底，琥珀更亮。
   「可选支出」用紫色、「被覆盖」用翠绿，含义与应用一致。
   首屏标志是一只米缸：每层是一个项目的年化自付额，缸上那条虚线就是年度基线，也就是“最低水位线”。
   字体全部用系统字体，标题用系统宋体，国内访问不依赖字体 CDN。
   默认浅色（应用图标是奶油底），不跟随系统；只有 html[data-theme="dark"]（右上角按钮切换，记在本机）才换暗色。 */

:root {
  color-scheme: light;
  --bg: #fbf6ee;
  --bg-band: #f6eee2;
  --surface: #fffdf9;
  --raised: #f8f1e6;
  --ink: #2a1d0d;
  --ink-2: #5c4829;
  --ink-3: #7a6544;
  --line: #ecdfcc;
  --line-2: #dfcbb0;
  --accent: #a34b08;
  --btn: #b45309;
  --btn-ink: #ffffff;
  --code-bg: #f7efe3;
  --shadow: 0 1px 2px rgb(120 53 15 / 0.06), 0 22px 46px -24px rgb(180 83 9 / 0.32);
  --ring: linear-gradient(140deg, #7c2d12 0%, #c2410c 42%, #f59e0b 100%);
  --glow-a: rgb(251 191 36 / 0.16);
  --glow-b: rgb(234 88 12 / 0.10);
  --grain-c: #ffffff;

  /* 章节色与语义色（浅底加深版） */
  --amber: #b45309;
  --violet: #6d4bc4;
  --green: #2f7a45;
  --cyan: #0e7490;
  --sky: #1d6fa5;
  --rose: #be3455;
  --optional: #7e22ce;
  --covered: #047857;
  --warn: #a16207;

  --show-dark: none;
  --show-light: block;

  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-display: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, "JetBrains Mono", Consolas, "PingFang SC", monospace;

  --radius: 12px;
  --radius-lg: 20px;
  --wrap: 1200px;
  --gutter: 24px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0c11;
  --bg-band: #0f1218;
  --surface: #13171f;
  --raised: #191e28;
  --ink: #f1ead7;
  --ink-2: #cbb892;
  --ink-3: #9e8f73;
  --line: #222632;
  --line-2: #2f3442;
  --accent: #f5a524;
  --btn: #f59e0b;
  --btn-ink: #1d1404;
  --code-bg: #10141b;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.45), 0 26px 56px -28px rgb(0 0 0 / 0.9);
  --ring: linear-gradient(140deg, #fde68a 0%, #f59e0b 45%, #ea580c 100%);
  --glow-a: rgb(234 88 12 / 0.13);
  --glow-b: rgb(180 83 9 / 0.10);
  --grain-c: #ffffff;
  --amber: #f5b14b;
  --violet: #b9a2f5;
  --green: #7fcf98;
  --cyan: #67cfe0;
  --sky: #7cc0ec;
  --rose: #f08aa3;
  --optional: #d8b4fe;
  --covered: #6ee7b7;
  --warn: #e9be62;
  --show-dark: block;
  --show-light: none;
}

/* 章节色 */
.tone-amber { --tone: var(--amber); }
.tone-violet { --tone: var(--violet); }
.tone-green { --tone: var(--green); }
.tone-cyan { --tone: var(--cyan); }
.tone-sky { --tone: var(--sky); }
.tone-neutral { --tone: var(--ink-3); }

/* ---------- 基础 ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "tnum" 1;
  /* 和应用一样的两团暖光：左上琥珀，右下陶橙 */
  background:
    radial-gradient(60% 40% at 12% 0%, var(--glow-a), transparent 70%),
    radial-gradient(50% 40% at 100% 100%, var(--glow-b), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

::selection { background: color-mix(in srgb, var(--amber) 28%, transparent); }

h1, h2, h3, h4 { line-height: 1.3; text-wrap: balance; margin: 0; color: var(--ink); }

p { margin: 0; }

code, kbd, pre, .mono { font-family: var(--font-mono); }

code {
  font-size: 0.86em;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.08em 0.38em;
  overflow-wrap: anywhere;
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  font-size: 0.78em;
  line-height: 1.5;
  text-align: center;
  padding: 0 0.42em;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  vertical-align: 0.08em;
  white-space: nowrap;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.only-dark { display: var(--show-dark) !important; }
.only-light { display: var(--show-light) !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.icon { width: 1em; height: 1em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.eyebrow {
  font-size: 12.5px;
  letter-spacing: 0.24em;
  color: var(--ink-3);
}
.eyebrow b { font-weight: 500; color: var(--accent); letter-spacing: 0.3em; margin-left: 0.4em; font-size: 10.5px; }

.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- 站点头部 ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: 56px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; font-size: 16px; letter-spacing: 0.18em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 26px; height: 26px; border-radius: 7px; }
.brand .brand-sub { font-weight: 400; font-size: 11px; letter-spacing: 0.24em; color: var(--ink-3); }

.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav a {
  color: var(--ink-2);
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 6px;
}
.nav a:hover { color: var(--ink); background: var(--raised); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }

.header-tools { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  font-size: 16px;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font: 600 14px/1 var(--font-sans);
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover { text-decoration: none; border-color: var(--ink-3); }
.btn-primary { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--btn) 80%, transparent); }
.btn-primary:hover { border-color: var(--btn); filter: brightness(1.06); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn .icon { font-size: 16px; }

.menu-toggle { display: none; }

@media (max-width: 900px) {
  .menu-toggle { display: inline-grid; }
  .nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 56px;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px max(var(--gutter), env(safe-area-inset-right, 0px)) 16px max(var(--gutter), env(safe-area-inset-left, 0px));
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .nav a { padding: 10px 4px; font-size: 15px; }
  .site-header[data-open] .nav { display: flex; }
  .header-tools .btn-label { display: none; }
  .brand .brand-sub { display: none; }
}

/* ---------- 截图框：柴米是网页应用，画一条浏览器地址栏 ---------- */
.window {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-2);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-width: 100%;
}
.window img { width: 100%; }
.window .bar {
  display: flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 14px;
  background: var(--raised);
  border-bottom: 1px solid var(--line);
}
.window .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); flex: none; }
.window .bar span {
  margin-inline: auto;
  transform: translateX(-20px);
  min-width: 0; max-width: 60%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 2px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font: 500 11.5px/1.5 var(--font-mono);
  color: var(--ink-3);
}
@media (max-width: 560px) { .window .bar { height: 26px; padding: 0 10px; gap: 5px; } .window .bar i { width: 7px; height: 7px; } .window .bar span { font-size: 10px; padding: 0 10px; } }

figure { margin: 0; }
figcaption {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-3);
}
figcaption b { color: var(--ink-2); font-weight: 600; }

.crop {
  border-radius: 18px;
  border: 1px solid var(--line-2);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.crop.narrow { max-width: 560px; }
.crop.dialog { max-width: 400px; border-radius: 24px; }
/* 列表很长的截图在底部淡出，表示后面还有 */
.crop.fade img { -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent); }
.phone { max-width: 300px; border-radius: 34px; border: 1px solid var(--line-2); overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }

/* ---------- 首页 · 首屏 ---------- */
.hero { position: relative; overflow: hidden; padding-block: 72px 40px; }
.hero .wrap { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px 56px; align-items: center; }
.hero-text { display: grid; gap: 26px; min-width: 0; }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(84px, 14vw, 168px);
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 0.95;
  background: var(--ring);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  justify-self: start;
  padding: 0.04em 0.02em 0.06em 0;
}
/* 词条：像词典一样交代名字的来处 */
.entry { display: grid; gap: 4px; max-width: 40em; padding-left: 14px; border-left: 2px solid color-mix(in srgb, var(--amber) 55%, transparent); }
.entry .head { font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.entry .head b { font-family: var(--font-display); font-size: 15px; color: var(--ink); font-weight: 700; letter-spacing: 0.08em; }
.entry .head i { font-family: var(--font-mono); font-style: normal; color: var(--ink-3); margin: 0 4px; }
.entry p { font-size: 14.5px; color: var(--ink-3); line-height: 1.7; }

.hero-lede { max-width: 38em; font-size: clamp(17px, 1.9vw, 20px); color: var(--ink-2); line-height: 1.75; }
.hero-lede strong { color: var(--ink); font-weight: 650; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-3); }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--covered); }
.hero-shot { margin-top: 60px; }

/* ---------- 米缸：每层一个项目的年化自付额，缸口虚线是年度基线 ---------- */
.jar { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 0 14px; align-self: center; }
.jar-labels, .jar-body { display: grid; grid-template-rows: var(--rows); }
.jar-labels span { display: flex; align-items: center; justify-content: flex-end; gap: 6px; font-size: 12px; line-height: 1; color: var(--ink-3); white-space: nowrap; }
.jar-labels span b { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.jar-labels .over { color: var(--optional); }
.jar-labels .over b { color: var(--optional); }
/* 水位线那一行高度是 0，标签文字整个落在线的上方（底边贴线），再用一截虚线引到缸上 */
.jar-labels .line { align-items: flex-end; color: var(--accent); font-weight: 600; font-size: 12.5px; overflow: visible; padding-bottom: 0; }
.jar-labels .over { align-items: flex-start; padding-top: 16px; }
.jar-labels .line b { color: var(--ink); font-size: 14px; font-weight: 700; }
.jar-labels .line::after { content: ""; width: 16px; margin-right: -14px; border-top: 2px dashed var(--accent); }
.jar-body {
  position: relative;
  border-radius: 14px 14px 46px 46px / 14px 14px 34px 34px;
  overflow: hidden;
  border: 1.5px solid color-mix(in srgb, var(--amber) 38%, var(--line-2));
  border-top-color: transparent;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--surface) 55%, transparent), 0 30px 60px -36px color-mix(in srgb, var(--amber) 70%, transparent);
}
/* 缸口：一圈稍宽的沿 */
.jar-body::before {
  content: ""; position: absolute; left: -1px; right: -1px; top: 0; height: 10px; z-index: 2;
  border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, var(--amber) 45%, var(--line-2));
  background: color-mix(in srgb, var(--raised) 80%, transparent);
}
.jar-body > div { position: relative; }
.jar-body .layer {
  border-top: 1px solid color-mix(in srgb, var(--surface) 70%, transparent);
  /* 米粒一样的细点，三组互质间距叠在一起，避免看出规整的网格 */
  background:
    radial-gradient(ellipse 1.6px 0.9px, color-mix(in srgb, var(--grain-c) 42%, transparent) 0 100%, transparent 101%) 0 0 / 9px 7px,
    radial-gradient(ellipse 1.2px 0.8px, color-mix(in srgb, var(--grain-c) 30%, transparent) 0 100%, transparent 101%) 4px 3px / 13px 11px,
    color-mix(in srgb, var(--c) 64%, var(--surface));
}
:root[data-theme="dark"] .jar-body .layer { background-color: color-mix(in srgb, var(--c) 52%, var(--surface)); }
.jar-body .over {
  margin: 14px 10px 8px;
  border: 1.5px dashed color-mix(in srgb, var(--optional) 70%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--optional) 9%, transparent);
}
/* 水位线：一行高度为 0 的格子，画在最上一层的顶边上 */
.jar-body .line::after {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 0; z-index: 3;
  border-top: 2px dashed var(--accent);
}
.jar-body::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(90deg, rgb(255 255 255 / 0.22), transparent 28%, transparent 72%, rgb(0 0 0 / 0.08));
}
.jar-note { grid-column: 1 / -1; margin-top: 16px; text-align: right; font-size: 12px; line-height: 1.7; color: var(--ink-3); }
.jar-note b { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; }
  .jar { display: none; }
}

/* ---------- 首屏截图上的编号标注（坐标按截图本身算，地址栏不计入） ---------- */
.anatomy .shot { position: relative; }
.anatomy .marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  font: 700 13px/1 var(--font-mono);
  color: #fff;
  background: #c2410c;
  box-shadow: 0 0 0 3px rgb(255 255 255 / 0.7), 0 0 0 8px rgb(194 65 12 / 0.28);
}
.anatomy-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 28px 0 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.anatomy-list li { list-style: none; padding: 18px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.anatomy-list .n { font: 700 12px/1 var(--font-mono); color: var(--accent); }
.anatomy-list h3 { font-size: 16px; margin: 8px 0 6px; }
.anatomy-list p { font-size: 14px; color: var(--ink-2); line-height: 1.65; }

/* ---------- 通用分节 ---------- */
.section { padding-block: 92px; }
.section + .section { border-top: 1px solid var(--line); }
.band { background: color-mix(in srgb, var(--bg-band) 78%, transparent); border-block: 1px solid var(--line); }
.section-head { display: grid; gap: 14px; max-width: 46em; margin-bottom: 44px; }
.section-head h2, .split h2 { font-family: var(--font-display); font-weight: 800; letter-spacing: 0.01em; }
.section-head h2 { font-size: clamp(30px, 3.8vw, 44px); }
.section-head p { color: var(--ink-2); font-size: 17px; }
.more { margin-top: 22px; }

/* ---------- 章节目录卡 ---------- */
.chapters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.chapter-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  color: inherit;
  min-width: 0;
}
.chapter-card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--tone) 45%, var(--line)); }
.chapter-card:hover .chapter-more { color: var(--tone); }
.chapter-card .chapter-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px;
  background: color-mix(in srgb, var(--tone) 11%, var(--surface));
  border-bottom: 1px solid color-mix(in srgb, var(--tone) 22%, var(--line));
  color: var(--tone);
  font-weight: 650; font-size: 14px;
}
.chapter-card .chapter-body { padding: 18px 18px 20px; display: grid; gap: 12px; flex: 1; align-content: start; }
.chapter-card h3 { font-size: 18px; }
.chapter-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.chapter-card li { position: relative; padding-left: 16px; font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.chapter-card li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 5px; height: 5px; border-radius: 50%; background: color-mix(in srgb, var(--tone) 75%, transparent); }
.chapter-more { margin-top: auto; padding-top: 6px; font-size: 13px; font-weight: 600; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; }

/* ---------- 双栏图文 ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 56px; align-items: center; }
.split.reverse { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.split.reverse > :first-child { order: 2; }
.split > * { min-width: 0; }
@media (max-width: 900px) {
  .split, .split.reverse { grid-template-columns: 1fr; gap: 28px; }
  .split.reverse > :first-child { order: 0; }
}
.split h2 { font-size: clamp(27px, 3.1vw, 38px); margin-bottom: 14px; }
.split p { color: var(--ink-2); }
.split p + p { margin-top: 12px; }
.split .eyebrow { margin-bottom: 12px; }
.points { margin: 20px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.points li { padding-left: 22px; position: relative; color: var(--ink-2); font-size: 15px; line-height: 1.65; }
.points li::before { content: ""; position: absolute; left: 4px; top: 0.6em; width: 7px; height: 7px; border-radius: 50%; border: 2px solid var(--amber); }

/* ---------- 三种计费方式：左边三张单选卡，右边对应的截图 ---------- */
.modes { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 22px 40px; align-items: start; }
.mode-list { display: grid; gap: 12px; }
.mode-tab {
  display: grid; gap: 6px;
  padding: 18px 20px 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, background-color 0.15s;
}
.mode-tab:hover { border-color: var(--line-2); }
.mode-name { font-size: 19px; font-weight: 700; color: var(--ink); display: flex; align-items: baseline; gap: 10px; }
.mode-name small { font-size: 12.5px; font-weight: 500; color: var(--ink-3); }
.mode-text { font-size: 14.5px; color: var(--ink-2); line-height: 1.7; }
.mode-shot { display: none; }
#mode-fixed:checked ~ .mode-shots [data-mode="fixed"],
#mode-bills:checked ~ .mode-shots [data-mode="bills"],
#mode-daily:checked ~ .mode-shots [data-mode="daily"] { display: block; }
#mode-fixed:checked ~ .mode-list [for="mode-fixed"],
#mode-bills:checked ~ .mode-list [for="mode-bills"],
#mode-daily:checked ~ .mode-list [for="mode-daily"] {
  border-color: color-mix(in srgb, var(--amber) 45%, var(--line));
  background: color-mix(in srgb, var(--amber) 9%, var(--surface));
  box-shadow: inset 3px 0 0 var(--amber);
}
#mode-fixed:focus-visible ~ .mode-list [for="mode-fixed"],
#mode-bills:focus-visible ~ .mode-list [for="mode-bills"],
#mode-daily:focus-visible ~ .mode-list [for="mode-daily"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.mode-shots .crop.fade img { max-height: 760px; object-fit: cover; object-position: top; }
@media (max-width: 900px) { .modes { grid-template-columns: 1fr; } }

/* ---------- 自付与覆盖：一条和应用同款的比例条 ---------- */
.ledger { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.ledger-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: baseline; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.ledger-row:last-child { border-bottom: 0; }
.ledger-row h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.ledger-row p { grid-column: 1 / -1; font-size: 13.5px; color: var(--ink-3); line-height: 1.6; }
.ledger-row .amt { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ledger-row .amt small { font-size: 12px; font-weight: 400; color: var(--ink-3); margin-left: 2px; }
.ledger-bar { padding: 18px 20px 16px; display: grid; gap: 8px; background: var(--raised); }
.ledger-bar .track { height: 10px; border-radius: 999px; overflow: hidden; display: flex; background: var(--line); }
.ledger-bar .track i { display: block; height: 100%; }
.ledger-bar .legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); }
.swatch { width: 9px; height: 9px; border-radius: 3px; flex: none; background: var(--s); }

/* ---------- 加权平均：一张权重衰减的柱图 ---------- */
.weights { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: 22px 22px 16px; }
.weights svg { display: block; width: 100%; height: auto; overflow: visible; }
.weights .bar { fill: color-mix(in srgb, var(--green) 70%, var(--surface)); }
.weights .bar.muted { fill: none; stroke: var(--line-2); stroke-dasharray: 2 2; }
.weights .axis { stroke: var(--line-2); stroke-width: 1; }
.weights .guide { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.7; }
.weights text { font: 11px var(--font-sans); fill: var(--ink-3); }
.weights text.strong { fill: var(--ink-2); font-weight: 600; }
.weights figcaption { margin-top: 8px; }

/* ---------- 预设项目 ---------- */
.presets { display: grid; gap: 18px; }
.preset-group { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: 18px 20px; }
.preset-group.optional { border-style: dashed; border-color: color-mix(in srgb, var(--optional) 40%, var(--line)); }
.preset-group h3 { font-size: 14px; letter-spacing: 0.12em; color: var(--ink-2); margin-bottom: 12px; display: flex; align-items: baseline; gap: 10px; }
.preset-group h3 small { font-size: 12px; letter-spacing: 0; font-weight: 400; color: var(--ink-3); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px 0 10px; border-radius: 999px; font-size: 13.5px; color: var(--ink-2); background: var(--raised); border: 1px solid var(--line); }
.chips li::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--c, var(--ink-3)); }
.chips li.on { color: var(--ink); border-color: color-mix(in srgb, var(--c) 40%, var(--line)); background: color-mix(in srgb, var(--c) 10%, var(--surface)); }
.chips li.on::after { content: "默认启用"; font-size: 10.5px; color: var(--ink-3); margin-left: 2px; }
.chips.compact li.on::after { content: none; }

/* ---------- 项目树 ---------- */
.tree {
  margin: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--code-bg);
  font: 13px/1.95 var(--font-mono);
  color: var(--ink-2);
  overflow-x: auto;
  white-space: pre;
}
.tree .p { color: var(--ink); font-weight: 650; }
.tree .s { color: var(--violet); font-weight: 600; }
.tree .i { color: var(--ink-2); }
.tree .a { color: var(--accent); }
.tree .t { color: var(--ink-3); }
.doc-main .tree { margin: 18px 0; }

/* ---------- 手机 ---------- */
.phones { display: flex; gap: 22px; justify-content: center; align-items: flex-start; }
.phones .phone { flex: 1 1 0; min-width: 0; }
.phones .phone:nth-child(2) { margin-top: 48px; }

/* ---------- 开始使用 ---------- */
.start { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.start > div { padding: 34px; min-width: 0; }
.start > div + div { border-left: 1px solid var(--line); background: var(--raised); }
.start h3 { font-family: var(--font-display); font-size: 26px; font-weight: 800; margin-bottom: 10px; }
.start p { color: var(--ink-2); }
.start .hero-actions { margin-top: 22px; }
.start dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 18px; font-size: 14px; }
.start dt { color: var(--ink-3); white-space: nowrap; }
.start dd { margin: 0; color: var(--ink); }
.start ol { margin: 20px 0 0; padding-left: 1.3em; display: grid; gap: 8px; color: var(--ink-2); font-size: 15px; }
@media (max-width: 820px) { .start { grid-template-columns: 1fr; } .start > div + div { border-left: 0; border-top: 1px solid var(--line); } .start > div { padding: 26px 20px; } }

/* ---------- 原则格：一组一框、细线分隔 ---------- */
.states { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.state { padding: 18px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; display: grid; gap: 6px; align-content: start; }
.state h3 { font-size: 15.5px; }
.state p { font-size: 14px; color: var(--ink-2); line-height: 1.65; }
.badge {
  justify-self: start;
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 9px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--b) 40%, transparent);
  color: var(--b);
  background: color-mix(in srgb, var(--b) 10%, transparent);
  --b: var(--ink-3);
}
.badge.amber { --b: var(--amber); }
.badge.optional { --b: var(--optional); }
.badge.covered { --b: var(--covered); }
.badge.warn { --b: var(--warn); }

/* ---------- 文档页 ---------- */
.doc { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 56px; padding-block: 40px 96px; }
.doc-nav { position: sticky; top: 80px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; display: grid; gap: 24px; font-size: 13.5px; padding-bottom: 20px; }
.doc-nav h4 { font-size: 11px; line-height: 1; letter-spacing: 0.24em; color: var(--ink-3); margin: 0 0 10px 12px; font-weight: 500; }
.doc-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.doc-nav a { display: flex; align-items: center; gap: 9px; padding: 5px 10px; border-radius: 6px; color: var(--ink-2); line-height: 1.45; }
.doc-nav a:hover { background: var(--raised); color: var(--ink); text-decoration: none; }

/* 章节切换：默认收起，只露出当前章节一行 */
.doc-nav .chapter-list summary {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
  -webkit-user-select: none;
}
.doc-nav .chapter-list summary::-webkit-details-marker { display: none; }
.doc-nav .chapter-list summary:hover { border-color: var(--line-2); }
.doc-nav .chapter-list summary .sw { width: 7px; height: 7px; border-radius: 50%; background: var(--tone); flex: none; }
.doc-nav .chapter-list summary .cur { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-nav .chapter-list summary .pos { margin-left: auto; font: 500 11.5px/1 var(--font-mono); color: var(--ink-3); }
.doc-nav .chapter-list summary .chev { font-size: 14px; color: var(--ink-3); transition: transform 0.15s; }
.doc-nav .chapter-list[open] summary .chev { transform: rotate(180deg); }
.doc-nav .chapter-list ul { margin-top: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.doc-nav .chapter-list a .sw { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); flex: none; }
.doc-nav .chapter-list a:hover .sw { background: var(--tone); }
.doc-nav .chapter-list a[aria-current="page"] { background: var(--raised); color: var(--ink); font-weight: 600; }
.doc-nav .chapter-list a[aria-current="page"] .sw { background: var(--tone); }

/* 本页目录 */
.doc-nav .toc a { padding: 4px 12px; border-left: 1px solid var(--line); border-radius: 0; color: var(--ink-3); font-size: 13px; }
.doc-nav .toc a:hover { background: none; color: var(--ink); }
.doc-nav .toc a[data-active] { color: var(--ink); border-left-color: var(--accent); }

@media (max-width: 1000px) {
  .doc { grid-template-columns: 1fr; gap: 24px; padding-top: 24px; }
  .doc-nav { position: static; max-height: none; }
  .doc-nav .toc { display: none; }
}

.doc-main { min-width: 0; max-width: 800px; }

.chapter-head { display: grid; gap: 16px; padding-bottom: 32px; margin-bottom: 36px; border-bottom: 1px solid var(--line); }
.chapter-label {
  display: inline-flex; align-items: center; gap: 9px;
  justify-self: start;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tone) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--tone) 28%, transparent);
  color: var(--tone);
  font-size: 13px; font-weight: 650;
}
.chapter-label .icon { font-size: 15px; }
.chapter-head h1 { font-family: var(--font-display); font-size: clamp(32px, 4.6vw, 50px); font-weight: 800; letter-spacing: 0.01em; }
.lede { font-size: 18px; color: var(--ink-2); line-height: 1.8; max-width: 42em; }

.doc-main > figure, .doc-main section > figure { margin-block: 28px 8px; }
.doc-main section { padding-top: 24px; margin-top: 32px; }
.doc-main section:first-of-type { margin-top: 0; }
.doc-main h2 { font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: 0.01em; margin-bottom: 14px; display: flex; align-items: baseline; gap: 12px; }
.doc-main h2::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--tone, var(--ink-3)); flex: none; transform: translateY(-0.16em); }
.doc-main h3 { font-size: 18.5px; font-weight: 680; margin: 30px 0 10px; }
.doc-main p + p { margin-top: 14px; }
.doc-main p, .doc-main li { color: var(--ink-2); }
.doc-main strong { color: var(--ink); font-weight: 650; }
.doc-main ul, .doc-main ol { padding-left: 1.25em; margin: 12px 0; display: grid; gap: 7px; }
.doc-main li::marker { color: var(--ink-3); }
.doc-main ul ul, .doc-main ol ul { margin: 6px 0 2px; }
.doc-main .chips { padding: 0; margin: 14px 0; display: flex; }

/* 规格表 */
.table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.spec { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.6; }
table.spec th, table.spec td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
table.spec tr:last-child td { border-bottom: 0; }
table.spec th { font-weight: 600; font-size: 12.5px; color: var(--ink-3); background: var(--raised); white-space: nowrap; }
table.spec td:first-child { color: var(--ink); font-weight: 600; white-space: nowrap; }
table.spec td { color: var(--ink-2); }
table.spec td.wrap-ok { white-space: normal; }
table.spec td.r, table.spec th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 细节提示 */
.note {
  margin: 20px 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--raised);
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.75;
}
.note-label { display: inline-block; margin-right: 8px; font-size: 12px; font-weight: 650; letter-spacing: 0.12em; color: var(--tone, var(--accent)); }
.note.warn .note-label { color: var(--warn); }

/* 要点清单：一组一个框、框内细线分层 */
.facts { list-style: none; padding: 0 !important; margin: 18px 0 !important; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); gap: 0 !important; overflow: hidden; }
.facts li { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.65; }
.facts li:last-child { border-bottom: 0; }
.facts li b { color: var(--ink); font-weight: 650; margin-right: 6px; }

/* 步骤（真实的先后顺序才用） */
.steps { counter-reset: step; list-style: none; padding: 0 !important; display: grid; gap: 0 !important; border-left: 1px solid var(--line-2); margin: 18px 0 18px 10px !important; }
.steps li { counter-increment: step; position: relative; padding: 0 0 16px 26px; min-width: 0; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before { content: counter(step); position: absolute; left: -11px; top: 1px; width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line-2); font: 600 11px/1 var(--font-mono); color: var(--ink-2); }

/* 公式 */
.formula { margin: 18px 0; padding: 16px 18px; border: 1px solid var(--line); border-left: 3px solid var(--tone, var(--accent)); border-radius: var(--radius); background: var(--code-bg); font: 14px/1.9 var(--font-sans); color: var(--ink); overflow-x: auto; }
.formula .c { display: block; color: var(--ink-3); font-size: 13px; }

/* 界面上的按钮 / 菜单名 */
.ui { font-weight: 600; color: var(--ink); }
.ui::before { content: "「"; color: var(--ink-3); font-weight: 400; }
.ui::after { content: "」"; color: var(--ink-3); font-weight: 400; }

/* 应用里的小胶囊标签 */
.pill { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; vertical-align: 0.1em; white-space: nowrap; color: var(--s); background: color-mix(in srgb, var(--s) 13%, transparent); --s: var(--amber); }
.pill.covered { --s: var(--covered); }
.pill.partial { --s: var(--warn); }
.pill.optional { --s: var(--optional); }
.pill.off { --s: var(--ink-3); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line); }
.pager a { display: grid; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font-weight: 600; }
.pager a:hover { text-decoration: none; border-color: var(--line-2); }
.pager a span { font-size: 12px; line-height: 1.4; font-weight: 400; color: var(--ink-3); }
.pager a.next { text-align: right; }
.pager a:only-child.next { grid-column: 2; }
@media (max-width: 600px) { .pager { grid-template-columns: 1fr; } .pager a:only-child.next { grid-column: 1; } }

.figure-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin: 24px 0; align-items: start; }
@media (max-width: 900px) { .anatomy-list, .states, .chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .anatomy-list, .states, .chapters { grid-template-columns: 1fr; } }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 40px 56px; font-size: 13.5px; color: var(--ink-3); }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.site-footer h4 { font-size: 11.5px; line-height: 1; letter-spacing: 0.24em; font-weight: 500; color: var(--ink-3); margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.site-footer a { color: var(--ink-2); }
.site-footer .fine { margin-top: 12px; line-height: 1.7; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr 1fr; } .site-footer .wrap > :first-child { grid-column: 1 / -1; } }

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .hero { padding-top: 44px; }
  .section { padding-block: 60px; }
  .anatomy .marker { width: 18px; height: 18px; font-size: 10px; box-shadow: 0 0 0 2px rgb(255 255 255 / 0.7); }
  .phones { gap: 14px; }
  .phones .phone { border-radius: 22px; }
  .phones .phone:nth-child(2) { margin-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .doc-nav .chapter-list summary .chev { transition: none; }
}
