/* ============================================================
   Caspenda · styles.css — 设计系统 + 组件
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Private-banking 色板：off-white 底、深墨文字、深 teal 唯一强调、低饱和数据色 */
  --bg: #ffffff;
  --bg-soft: #f7f8f6;
  --bg-brand: #f0f4f1;
  --ink: #0b1220;
  --ink-soft: #3f4a5a;
  --muted: #667085;
  --brand: #0e5f59;
  --brand-dark: #0a4a45;
  --brand-soft: #eaf1ee;
  --growth: #2f7d6d;
  --contrib: #5b7a9d;
  --border: #d8dee5;
  --border-strong: #b6c0ca;
  --danger: #c0392b;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(11, 18, 32, .05);
  --shadow-md: 0 4px 16px rgba(11, 18, 32, .06);
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, monospace;
  --container: 1100px;
}

/* ---------- Reset / base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.02em; }
h1 { font-size: clamp(1.8rem, 3.6vw, 2.4rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
small { color: var(--muted); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  border-bottom: 1px solid rgba(15,23,42,.06);
}
.site-header { box-shadow: 0 1px 0 rgba(15,23,42,.04), 0 10px 30px -18px rgba(15,23,42,.25); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.12rem; color: var(--ink); letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo-img { height: 32px; width: auto; display: block; }
.nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav a {
  position: relative; text-decoration: none;
  color: var(--ink-soft); font-weight: 500; font-size: .9rem;
  padding: 9px 12px; transition: color .15s ease;
}
/* 精密下划线：品牌色细线从中心展开，hover 不靠背景填充 */
.nav a::after, .nav-link::after {
  content: ''; position: absolute; left: 50%; bottom: 4px;
  width: 100%; height: 2px; border-radius: 2px;
  background: var(--brand);
  transform: translateX(-50%) scaleX(0); transform-origin: center;
  transition: transform .18s ease;
}
.nav a:hover, .nav-link:hover, .nav a.active, .nav-link[aria-expanded="true"] {
  color: var(--ink); text-decoration: none;
}
.nav a:hover::after, .nav-link:hover::after,
.nav a.active::after, .nav-link[aria-expanded="true"]::after { transform: translateX(-50%) scaleX(1); }
.nav a.active { color: var(--brand); font-weight: 600; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 1rem; color: var(--ink); }

/* ---------- Dropdown nav (Calculators / Learn) ---------- */
.nav-item { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px; position: relative;
  color: var(--ink-soft); font-weight: 500; font-size: .9rem;
  padding: 9px 12px;
  background: none; border: none; font-family: inherit; cursor: pointer;
  transition: color .15s ease;
}
.nav-link:hover, .nav-link[aria-expanded="true"] { color: var(--ink); }
.caret { font-size: .8em; opacity: .75; transition: transform .22s ease; display: inline-block; }
.nav-item:hover .caret, .nav-item.open .caret { opacity: 1; }
/* 展开时三角号旋转 180°：给出明确的折叠/展开反馈 */
.nav-item.open .caret { transform: rotate(180deg); }
.dropdown {
  display: none; position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 284px; background: #FAFAF8;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 2px 4px rgba(15,23,42,.04), 0 16px 40px -24px rgba(15,23,42,.28); padding: 6px; z-index: 60;
}
/* 透明桥：填住按钮与下拉之间的 6px 空隙，鼠标从按钮滑向菜单时 hover 不断链 */
.dropdown::before {
  content: ''; position: absolute; top: -6px; left: 0; right: 0; height: 6px;
}
.nav-item:hover .dropdown, .nav-item.open .dropdown { display: block; }
.dropdown-item { display: block; padding: 8px 10px; border-radius: 8px; }
.dropdown-item .di-label { display: block; font-weight: 600; font-size: .9rem; color: var(--ink); }
.dropdown-item .di-desc { display: block; font-size: .78rem; color: var(--muted); margin-top: 1px; line-height: 1.35; }
.dropdown-item:hover { background: var(--bg-soft); text-decoration: none; }
.dropdown-item:hover .di-label { color: var(--brand); }
.dropdown-all { border-top: 1px solid var(--border); margin-top: 5px; padding-top: 9px; }
.dropdown-all .di-label { color: var(--brand); }

/* 全局焦点：细、浅的品牌色高亮，替代浏览器默认描边 */
:focus-visible { outline: 1px solid rgba(14,95,89,.4); outline-offset: 2px; border-radius: 6px; }
.nav-toggle:focus-visible, .nav-link:focus-visible, .dropdown-item:focus-visible { outline: 1px solid rgba(14,95,89,.4); outline-offset: 1px; background: var(--brand-soft); }

/* ---------- Mega menu（桌面三列分组浮层） ---------- */
.dropdown.mega { width: 580px; min-width: 0; padding: 14px 12px 10px; left: auto; right: 0;
                 border-color: rgba(15,23,42,.06);
                 box-shadow: 0 16px 40px -16px rgba(15,23,42,.16), 0 2px 10px rgba(15,23,42,.05); }
.mega-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mega-col { min-width: 0; }
.mega-label {
  font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); padding: 2px 10px 7px;
}
.dropdown.mega .dropdown-item { padding: 8px 10px; }
.dropdown.mega .dropdown-item .di-label { font-size: .87rem; }
/* 桌面：安静精确——每项只留标题一行，解释默认隐藏（保留在 DOM 供 SEO/读屏） */
.dropdown.mega .dropdown-item .di-desc { display: none; }
.dropdown.mega .dropdown-all {
  border-top: 1px solid var(--border); margin-top: 8px; padding: 11px 10px 3px;
  display: block; color: var(--brand); font-weight: 600; font-size: .88rem;
}
.dropdown.mega .dropdown-all:hover { color: var(--brand-dark); text-decoration: none; }
/* Learn 分组：与 Tools 同级的一级下拉（文章分类导航） */
.nav-learn-label { display: none; }
.nav-learn { display: block; }
.dropdown.learn-drop {
  width: 640px; min-width: 0; left: auto; right: 0; padding: 14px 12px 10px;
  border-color: rgba(15,23,42,.06);
  box-shadow: 0 16px 40px -16px rgba(15,23,42,.16), 0 2px 10px rgba(15,23,42,.05);
}
.learn-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dropdown.learn-drop .dropdown-item { padding: 7px 10px; }
.dropdown.learn-drop .dropdown-item .di-label { font-size: .85rem; }
.dropdown.learn-drop .dropdown-all {
  border-top: 1px solid var(--border); margin-top: 8px; padding: 11px 10px 3px;
  display: block; color: var(--brand); font-weight: 600; font-size: .88rem;
}
.dropdown.learn-drop .dropdown-all:hover { color: var(--brand-dark); text-decoration: none; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 64px; background: var(--bg-soft); }
.site-footer .container { padding-top: 36px; padding-bottom: 36px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
.footer-grid h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: var(--ink-soft); font-size: .92rem; }
.footer-note { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); font-size: .82rem; color: var(--muted); }
.foot-src { margin-top: 4px; font-size: .76rem; color: var(--muted); }
.foot-src a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Hero ---------- */
.hero { padding: 44px 0 28px; text-align: center; }
/* 工具页 / 文章页 Hero：含面包屑(breadcrumb)或博文链(crumb)，比首页主视觉更紧凑，节省首屏纵向空间 */
.hero:has(.breadcrumb, .crumb) { padding: 14px 0 10px; }
.hero:has(.breadcrumb, .crumb) h1 { font-size: 1.65rem; margin-bottom: 4px; }
.hero:has(.breadcrumb, .crumb) .sub { font-size: .92rem; margin-bottom: 2px; max-width: 560px; }
.hero .sub { max-width: 620px; margin: 0 auto 8px; color: var(--ink-soft); font-size: 1.08rem; }
/* Answer-first 直接答案段：AI 可摘取的内容胶囊（120-150 词） */
.hero .quick-answer {
  max-width: 680px; margin: 14px auto 0; padding: 14px 18px;
  font-size: 1rem; line-height: 1.7; color: var(--ink-soft);
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-sm); text-align: left;
}
.hero .quick-answer strong { color: var(--ink); font-weight: 600; }
.hero .badge {
  display: inline-block; font-size: .78rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--brand-dark);
  background: var(--brand-soft); border: 1px solid var(--border);
  padding: 4px 12px; border-radius: 6px; margin-bottom: 16px;
}

/* ---------- Calculator ---------- */
.calc-shell {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); overflow: hidden; margin: 28px 0;
}
.calc-grid { display: grid; grid-template-columns: 1fr 1.15fr; }
.calc-panel { padding: 18px; }
.calc-panel.inputs { border-right: 1px solid var(--border); background: var(--bg-soft); }
.calc-panel h2 { font-size: 1rem; margin-bottom: 10px; letter-spacing: 0; }

.field { margin-bottom: 10px; }
.field label { display: block; font-size: .84rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; letter-spacing: .01em; }
.field-hint { margin-top: 4px; font-size: .76rem; line-height: 1.4; color: var(--muted); }
.input-row { display: flex; gap: 8px; align-items: stretch; }
.input-affix {
  display: flex; align-items: center; gap: 6px; width: 100%;
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 0 12px; height: 42px; transition: border-color .15s, box-shadow .15s;
}
.input-affix:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,95,89,.14); }
.input-affix .prefix { color: var(--muted); font-weight: 600; }
.input-affix input {
  border: none; outline: none; background: transparent; width: 100%; height: 100%;
  font-size: 1.02rem; font-weight: 600; color: var(--ink); font-family: inherit;
}
.input-affix .suffix { color: var(--muted); font-weight: 600; font-size: .85rem; white-space: nowrap; }

select.input {
  width: 100%; height: 42px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 0 12px; font-size: .98rem; font-weight: 500; color: var(--ink); background: var(--bg);
  font-family: inherit; cursor: pointer;
}

.presets { display: flex; gap: 6px; margin: 2px 0 8px; flex-wrap: wrap; align-items: center; }
.preset {
  flex: 0 0 auto; padding: 4px 11px; border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--bg); cursor: pointer; font-family: inherit; font-size: .8rem; font-weight: 600;
  color: var(--ink-soft); text-align: center; transition: all .12s;
}
.preset:hover { border-color: var(--brand); color: var(--brand); }
.preset.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.preset small { display: inline; font-weight: 500; font-size: .78rem; margin-left: 3px; }
.preset-note { margin: -4px 0 8px; font-size: .74rem; color: var(--ink-faint, #94a3b8); line-height: 1.4; }

/* Inflation toggle */
.toggle-label { display: flex; align-items: center; gap: 8px; cursor: pointer; margin-bottom: 8px; }
.toggle-label .toggle { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; margin: 0; }
.infl-row { margin-top: 10px; }
.infl-row label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }

.range-wrap { display: flex; align-items: center; gap: 12px; }
input[type="range"] { flex: 1; accent-color: var(--brand); height: 30px; cursor: pointer; }
.range-val { min-width: 44px; text-align: right; font-weight: 700; font-size: 1rem; color: var(--brand-dark); }

/* Results */
.result-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.result-head .label { font-size: .85rem; color: var(--ink-soft); font-weight: 500; }
.fv {
  font-size: clamp(2.2rem, 6vw, 3.1rem); font-weight: 800; letter-spacing: -.03em;
  color: var(--ink); line-height: 1.05; margin: 4px 0 14px;
}
.split { display: grid; gap: 7px; margin-bottom: 12px; }
.split-row { display: flex; align-items: center; gap: 8px; font-size: .92rem; color: var(--ink-soft); }
.split-row .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.dot.contrib { background: var(--contrib); }
.dot.growth { background: var(--growth); }
.dot.fees { background: var(--danger); }
.split-row b { margin-left: auto; color: var(--ink); font-weight: 700; }

/* Real-terms (inflation-adjusted) block */
.real-split {
  border: 1px solid #fde68a; background: #fffbeb; border-radius: var(--radius-sm);
  padding: 12px 14px; margin: 0 0 18px;
}
.real-note { font-size: .82rem; color: #92400e; font-weight: 600; margin-bottom: 8px; }
.infl-note { font-size: .82rem; color: var(--ink-soft); font-weight: 500; margin-bottom: 10px; }
.pp-note { font-size: .82rem; color: var(--ink-soft); margin-top: 4px; }
.real-split .split-row { font-size: .88rem; }
.growth-share {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 4px;
  font-size: .86rem; font-weight: 600; color: var(--brand-dark);
  background: var(--brand-soft); border: 1px solid var(--border); padding: 4px 10px; border-radius: 6px;
}
.growth-share.negative { color: var(--danger); background: #fef2f2; border-color: #fecaca; }

.chart-box { margin: 12px 0 4px; }
.chart-box canvas { width: 100%; height: 168px; display: block; }
.chart-legend { display: flex; gap: 16px; font-size: .82rem; color: var(--ink-soft); margin-top: 8px; flex-wrap: wrap; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--ink); font-family: inherit; font-size: .9rem; font-weight: 600;
  cursor: pointer; transition: all .12s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); color: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn .ic { font-size: 1rem; line-height: 1; }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(10px);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: .9rem;
  opacity: 0; pointer-events: none; transition: all .2s; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Compare (DCA vs Lump) */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.compare-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; background: var(--bg); }
.compare-card h3 { font-size: .95rem; margin-bottom: 4px; }
.compare-card .tag { font-size: .78rem; color: var(--muted); margin-bottom: 8px; }
.compare-card .big { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.compare-card.dca { border-color: rgba(59,130,246,.35); }
.compare-card.lump { border-color: rgba(47,125,109,.3); }
.vs-banner {
  grid-column: 1 / -1; text-align: center;
  background: var(--brand-soft); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 16px; font-weight: 700; font-size: 1.02rem; color: var(--brand-dark);
}
.vs-banner.win-lump { background: #eef4f0; border-color: #c9ddd2; color: #0a4a45; }
.vs-banner.win-dca { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* ---------- Sections ---------- */
.section { padding: 28px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 24px; }
.section-head p { color: var(--ink-soft); }

.tool-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tool-card {
  display: block; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px;
  background: var(--bg); transition: all .15s; box-shadow: var(--shadow-sm);
}
.tool-card:hover { border-color: var(--brand); box-shadow: var(--shadow-md); text-decoration: none; transform: translateY(-2px); }
.tool-card .icon {
  width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-bottom: 12px;
}
.tool-card h3 { margin-bottom: 4px; }
.tool-card p { color: var(--ink-soft); font-size: .92rem; margin-bottom: 12px; }
.tool-card .go { font-size: .86rem; font-weight: 600; color: var(--brand); }

.trust-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.trust-item { background: var(--bg-soft); border-radius: var(--radius); padding: 18px; }
.trust-item .t-ic { font-size: 1.3rem; margin-bottom: 6px; }
.trust-item h4 { font-size: .95rem; margin-bottom: 2px; }
.trust-item p { font-size: .85rem; color: var(--ink-soft); margin: 0; }

.article-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.article-link {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px;
  color: var(--ink); transition: all .12s; background: var(--bg);
}
.article-link:hover { border-color: var(--brand); text-decoration: none; }
.article-link .t { font-weight: 600; font-size: .95rem; }
.article-link .s { color: var(--muted); font-size: .82rem; }

/* ---------- Methodology / FAQ / text ---------- */
.method-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; background: var(--bg); }
.method-card h3 { margin-bottom: 8px; }
.formula-box {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: .92rem; overflow-x: auto; margin: 10px 0;
}
.assumptions { list-style: none; padding: 0; margin: 8px 0 0; }
.assumptions li { padding: 6px 0; border-top: 1px dashed var(--border); font-size: .92rem; color: var(--ink-soft); }
.assumptions li::before { content: "· "; color: var(--brand); font-weight: 700; }

.faq { max-width: 760px; margin: 0 auto; }
.faq details { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; background: var(--bg); }
.faq summary {
  cursor: pointer; padding: 14px 18px; font-weight: 600; font-size: .98rem;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.2rem; color: var(--muted); transition: transform .15s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details .faq-body { padding: 0 18px 14px; color: var(--ink-soft); font-size: .94rem; }

/* ---------- Table ---------- */
.table-wrap { margin: 8px 0 4px; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table-wrap th, .table-wrap td { text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table-wrap th:first-child, .table-wrap td:first-child { text-align: left; }
.table-wrap th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.table-wrap tbody tr:hover { background: var(--bg-soft); }
.table-scroll { max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }

details.collapse { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
details.collapse > summary {
  cursor: pointer; padding: 12px 16px; font-weight: 600; font-size: .9rem;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
details.collapse > summary::-webkit-details-marker { display: none; }
details.collapse > summary::after { content: "↓"; color: var(--muted); transition: transform .15s; }
details.collapse[open] > summary::after { transform: rotate(180deg); }
details.collapse .table-wrap { padding: 0 8px 8px; }

/* ---------- Rule of 72 ---------- */
.r72-note { font-size: .92rem; color: var(--ink-soft); background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 16px; }
.r72-hero-sub { font-size: .95rem; color: var(--ink-soft); margin: -12px 0 14px; }
.r72-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.r72-table th, .r72-table td { text-align: center; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.r72-table th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.r72-table tbody tr:hover { background: var(--bg-soft); }

/* ---------- Prose pages ---------- */
.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { margin-top: 32px; }
.prose ul, .prose ol { color: var(--ink-soft); }
.prose li { margin-bottom: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .calc-grid { grid-template-columns: 1fr; }
  .calc-panel.inputs { border-right: none; border-bottom: 1px solid var(--border); }
  .tool-cards { grid-template-columns: 1fr; }
  .trust-strip { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .site-header .container { height: auto; min-height: 68px; flex-wrap: wrap; align-content: flex-start; align-items: center; }
  .nav { display: none; position: absolute; top: 72px; left: 0; right: 0; background: #fff;
         border-bottom: 1px solid var(--border); padding: 10px 20px 18px; flex-direction: column; align-items: stretch; box-shadow: var(--shadow-md); }
  /* 菜单展开时占位（独占第二行），内容被推下而非被覆盖，hero 不被压 */
  /* 卡片式菜单：加边框/圆角，两侧收窄成浮起面板，更有层次 */
  .nav.open { display: flex; position: static; flex-basis: 100%;
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 4px 14px 14px; padding: 8px 14px 10px;
    box-shadow: 0 12px 32px -22px rgba(15,23,42,.28); }
  .nav a { padding: 9px 12px; }
  /* 汉堡/关闭按钮固定在 header 顶部右侧，header 增高时也不移位 */
  .nav-toggle { display: inline-flex; position: absolute; top: 17px; right: 16px; }
  /* 主题按钮与汉堡并排：绝对定位在汉堡左侧，避免与 logo 流内重叠 */
  .theme-btn { position: absolute; top: 17px; right: 70px; margin-left: 0; }
  /* logo 垂直居中：汉堡按钮为绝对定位不占布局，用 auto 垂直 margin 让 logo 与按钮对齐 */
  .site-header .container .logo { margin-top: 18px; margin-bottom: 18px; }
  /* 移动端年度明细表格：紧凑化，4 列一屏放下，避免 BALANCE 被横向裁切 */
  details.collapse .table-wrap { padding: 0 0 8px; }
  .table-wrap th, .table-wrap td { padding: 5px 6px; font-size: .8rem; }
  .table-wrap th { font-size: .66rem; }
  /* 移动端下拉：点击展开，不做 hover */
  .nav-item, .nav-link { width: 100%; }
  .nav-link { justify-content: space-between; padding: 10px 12px; border-radius: 10px; }
  .nav-item:hover .dropdown { display: none; }
  .dropdown { position: static; display: none; box-shadow: none; border: none;
              border-left: 2px solid var(--border); margin: 0 0 4px 10px;
              padding: 2px 0 2px 10px; background: transparent; }
  .nav-item.open .dropdown { display: block; }
  /* 移动端 mega：短菜单，只显示 4 个主工具 + All，去掉分组标签与解释，一屏内完成 */
  .dropdown.mega { width: 100%; padding: 2px 0 4px; border-left: none; margin-left: 0; }
  .nav.open .dropdown.mega, .nav-item.open .dropdown.mega { display: block; }
  .mega-grid { grid-template-columns: 1fr; gap: 0; }
  .mega-col { border-left: none; padding-left: 0; margin: 0; }
  .mega-label { display: none; }
  .dropdown.mega .dropdown-item { display: none; padding: 7px 6px; }
  .dropdown.mega .dropdown-item.m-show { display: block; }
  .dropdown.mega .dropdown-all { border-top: none; margin: 0; padding: 6px 6px 0; font-size: .9rem; }
  /* 移动端 Learn 下拉：全宽，显示分类标签 + 精选文章（每类 2 篇 + 底部两个入口） */
  .dropdown.learn-drop { width: 100%; padding: 2px 0 4px; border-left: none; margin-left: 0; }
  .nav.open .dropdown.learn-drop, .nav-item.open .dropdown.learn-drop { display: block; }
  .learn-grid { grid-template-columns: 1fr; gap: 0; }
  /* 移动端隐藏 Learn 分类标签，只留精选文章 + 底部入口，菜单更短 */
  .dropdown.learn-drop .mega-label { display: none; }
  .dropdown.learn-drop .dropdown-item { display: none; padding: 7px 6px; }
  .dropdown.learn-drop .dropdown-item.l-show { display: block; }
  .dropdown.learn-drop .dropdown-item .di-label { font-size: .95rem; font-weight: 500; }
  .dropdown.learn-drop .dropdown-all { border-top: none; margin: 0; padding: 6px 6px 0; font-size: .95rem; font-weight: 600; }
  /* Learn 分组标题（移动端显示，作为一级目录：品牌色 + 常显下划线） */
  .nav-learn-label { display: flex; width: 100%; align-items: center; justify-content: space-between;
                     font-size: 1.06rem; font-weight: 700; text-transform: none;
                     letter-spacing: 0; color: var(--brand); padding: 14px 12px 4px; position: relative; }
  .nav-learn-label:hover .caret { opacity: 1; }
  .nav-learn-label::after {
    content: ''; position: absolute; left: 12px; right: 12px; bottom: 4px;
    height: 2px; border-radius: 2px; background: var(--brand);
  }
  /* 移动端导航层级：一级（Tools / Learn）品牌色 + 下划线常显，二级统一灰 */
  .nav .nav-item > .nav-link, .nav .nav-item > .nav-link[aria-expanded="true"] { font-size: 1.06rem; font-weight: 700; color: var(--brand); }
  .nav-item > .nav-link::after { transform: scaleX(1); }
  .dropdown.mega .dropdown-item .di-label { font-size: .95rem; font-weight: 500; }
  .dropdown.mega .dropdown-all { font-size: .95rem; font-weight: 600; }
  .article-list { grid-template-columns: 1fr; }
  .trust-strip { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .calc-panel { padding: 18px; }
  .actions .btn { flex: 1; }
}
/* 输入区隐私提示：计算本地运行，不存数据 */
.privacy-hint { font-size: .76rem; color: var(--muted); margin: -4px 0 12px; line-height: 1.4; }
/* 结果区 View formula 入口 */
.formula-link { font-size: .88rem; font-weight: 600; color: var(--brand); text-decoration: none; }
.formula-link:hover { text-decoration: underline; }

/* 结果区自动结论句 */
.result-insight {
  margin: 10px 0 0; font-size: .84rem; line-height: 1.5;
  color: var(--ink-soft); background: var(--bg-soft);
  border-left: 3px solid var(--brand);
  padding: 6px 12px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* 移动端 sticky 结果摘要条：核心结果固定在顶部，首屏即可见 */
.m-sticky {
  position: sticky; top: 72px; z-index: 40;
  display: none;
  background: #0f172a; color: #fff;
  padding: 9px 20px; font-size: .86rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 2px 10px rgba(15,23,42,.18);
}
.m-sticky.show { display: none; }
@media (max-width: 640px) {
  .m-sticky.show { display: block; }
}
.m-sticky .ms-label { color: #94a3b8; margin-right: 6px; }
.m-sticky strong { color: #34d399; font-size: .95rem; }
.m-sticky .ms-extra { color: #94a3b8; margin-left: 4px; }

/* ============================================================
   Blog / articles
   ============================================================ */
.crumb { font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.crumb a { color: var(--brand); font-weight: 600; }
.post-meta { font-size: .85rem; color: var(--muted); margin-top: 6px; }
.post-tags { margin: 10px 0 0; }
.post-tags span {
  display: inline-block; margin: 0 6px 6px 0; padding: 3px 10px;
  font-size: .76rem; font-weight: 600; color: var(--brand-dark);
  background: var(--brand-soft); border: 1px solid #99f6e4; border-radius: 999px;
}

/* --- article body --- */
.article { font-size: 1.04rem; line-height: 1.75; color: var(--ink); }
.article h2 { margin-top: 2em; padding-top: .4em; border-top: 1px solid var(--border); }
.article h3 { margin-top: 1.6em; }
.article p { margin: 0 0 1.1em; }
.article strong { font-weight: 700; }
.article ul, .article ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.article li { margin: .35em 0; }
.article a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.article a:hover { color: var(--brand-dark); }
.article blockquote {
  margin: 1.4em 0; padding: 4px 18px; border-left: 3px solid var(--brand);
  background: var(--bg-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-soft);
}
.article blockquote p { margin: .4em 0; }
.article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em; background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 5px;
}
.article pre {
  background: #0f172a; color: #e2e8f0; border-radius: var(--radius-sm);
  padding: 16px 18px; overflow-x: auto; margin: 0 0 1.2em; line-height: 1.55;
}
.article pre code { background: transparent; border: 0; padding: 0; color: inherit; font-size: .86rem; }
.article table {
  width: 100%; border-collapse: collapse; margin: 0 0 1.3em; font-size: .94rem;
}
.article th, .article td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.article th { background: var(--bg-soft); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.article tbody tr:hover { background: var(--bg-soft); }
.article img { border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-sm); margin: 1.2em 0; }

/* --- article list (blog.html) --- */
.post-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.post-card {
  display: block; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; transition: all .15s ease;
  box-shadow: var(--shadow-sm);
}
.post-card:hover { border-color: var(--brand); box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.post-card-date { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.post-card h3 { margin-bottom: 8px; color: var(--ink); }
.post-card p { font-size: .92rem; color: var(--ink-soft); margin-bottom: 14px; }
.post-card .go { font-weight: 600; color: var(--brand); }

/* --- article footer CTA --- */
.post-cta {
  margin: 2.5em 0 1.5em; padding: 22px 24px; border-radius: var(--radius);
  background: var(--bg-brand); border: 1px solid #99f6e4;
}
.post-cta h3 { margin-bottom: 6px; }
.post-cta p { color: var(--ink-soft); margin-bottom: 14px; }
.cta-links { display: flex; flex-wrap: wrap; gap: 10px; }
.cta-links a {
  padding: 8px 14px; background: var(--brand); color: #fff; border-radius: 999px;
  font-size: .85rem; font-weight: 600;
}
.cta-links a:hover { background: var(--brand-dark); text-decoration: none; }
.back-link { margin-top: 2em; font-weight: 600; }

/* ============================================================
   Home visual polish (克制增强，保持 teal 品牌调性)
   ============================================================ */
/* --- hero 柔和渐变光晕背景 --- */
.hero--home { position: relative; overflow: hidden; }
.hero--home::before,
.hero--home::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none; z-index: 0;
}
.hero--home::before,
.hero--home::after { display: none; }
.hero--home .container { position: relative; z-index: 1; }

/* --- 标题局部渐变强调 --- */
.hero h1 .accent { color: var(--brand); }

/* --- hero 入场轻微上浮动画 --- */
.hero--home .badge,
.hero--home h1,
.hero--home .sub {
  animation: heroRise .55s cubic-bezier(.22,.8,.36,1) both;
}
.hero--home h1 { animation-delay: .06s; }
.hero--home .sub { animation-delay: .12s; }
@keyframes heroRise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- 工具卡：统一成 4 列 + 图标容器细化 + 箭头 hover 滑动 --- */
.tool-cards { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.tool-card { position: relative; }
.tool-card .icon {
  transition: transform .18s ease, background-color .18s ease;
}
.tool-card:hover .icon { transform: translateY(-2px); background: var(--bg-brand); }
.tool-card .go { display: inline-flex; align-items: center; gap: 4px; transition: gap .18s ease; }
.tool-card:hover .go { gap: 8px; }
.tool-card:hover .go::after { content: "→"; }

/* --- 信任区：升级为带边框阴影的卡片，SVG 图标方块 --- */
.trust-item {
  border: 1px solid var(--border); background: var(--bg);
  box-shadow: var(--shadow-sm); transition: all .15s;
}
.trust-item:hover { border-color: var(--brand); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.trust-item .t-ic {
  width: 40px; height: 40px; border-radius: 10px; margin-bottom: 10px;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
}

/* --- 文章卡：hover 上浮 + 箭头位移 --- */
.article-link { position: relative; transition: all .15s ease; box-shadow: var(--shadow-sm); }
.article-link:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.article-link .go { transition: transform .15s ease; }
.article-link:hover .go { transform: translateX(4px); }

/* --- 计算器外壳顶部品牌色实线强调 --- */
.calc-shell { position: relative; }
.calc-shell::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--brand);
  border-radius: var(--radius) var(--radius) 0 0;
}
@media (max-width: 900px) {
  .tool-cards { grid-template-columns: 1fr; }
  /* 移动端工具卡：图标与标题同行顶部对齐，说明/链接缩进对齐，更紧凑精致 */
  .tool-card { display: flex; flex-wrap: wrap; align-items: flex-start; column-gap: 12px; padding: 16px; }
  .tool-card .icon { margin-bottom: 0; flex: 0 0 40px; }
  .tool-card h3 { margin-bottom: 0; margin-top: -2px; flex: 1 1 auto; min-width: 0; }
  .tool-card p { flex-basis: 100%; margin-bottom: 10px; padding-left: 52px; }
  .tool-card .go { padding-left: 52px; }
  /* 首页信任卡：与工具卡一致，图标与标题同行顶部对齐 */
  .trust-item { display: flex; flex-wrap: wrap; align-items: flex-start; column-gap: 12px; padding: 14px 16px; }
  .trust-item .t-ic { margin-bottom: 0; flex: 0 0 40px; }
  .trust-item h4 { margin-bottom: 0; margin-top: -2px; flex: 1 1 auto; min-width: 0; }
  .trust-item p { flex-basis: 100%; padding-left: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero--home .badge, .hero--home h1, .hero--home .sub { animation: none; }
}

/* ============================================================
   Polish pass 2 (P1/P2: favicon-ready, hero texture, gradient figures,
   chart hover, micro-interactions, logo mark, article/reading polish)
   ============================================================ */

/* --- hero 首屏：off-white 面板 + 细金融网格，与下方白色内容形成层次 --- */
.hero--home {
  background-color: var(--bg-soft);
  background-image:
    linear-gradient(rgba(14,95,89,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14,95,89,.035) 1px, transparent 1px);
  background-size: 32px 32px;
  border-bottom: 1px solid var(--border);
}

/* --- 结果大数字：品牌渐变文字 + 等宽数字（输入时不跳动） --- */
.fv { font-variant-numeric: tabular-nums; color: var(--ink); }

/* --- 图表 hover 提示 --- */
.chart-tip {
  position: fixed; z-index: 60; display: none;
  background: rgba(17,24,39,.92); color: #fff;
  font-size: .8rem; line-height: 1.4; padding: 6px 10px; border-radius: 8px;
  white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.18); pointer-events: none;
}

/* --- 交互微反馈：按压缩放 + 阴影加深 --- */
.btn:active, .preset:active, .nav-toggle:active { transform: scale(.97) translateY(0); }
.btn.primary:active { transform: scale(.97); }
.tool-card:active, .post-card:active, .trust-card:active { transform: translateY(0) scale(.99); }
.nav-toggle { transition: transform .12s ease; }

/* --- logo 升级：圆形渐变徽标 + 悬停微动 --- */
.logo:hover { text-decoration: none; }

/* --- 博客卡片渐变封面条 --- */
.post-card { position: relative; overflow: hidden; }
.post-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #0e5f59, #2f7d6d 55%, #2f7d6d);
  opacity: .38; transition: opacity .15s ease;
}
.post-card:hover::before { opacity: 1; }

/* --- 文章阅读进度条 --- */
.reading-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 80; pointer-events: none;
}
.reading-progress span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #0e5f59, #2f7d6d);
  transition: width .08s linear;
}

/* --- 文章文末 CTA 强化：品牌深色渐变块 + 白按钮 --- */
.post-cta {
  background: linear-gradient(135deg, #0a4a45 0%, #0e5f59 55%, #2f7d6d 130%);
  border: none; color: #fff; position: relative; overflow: hidden;
}
.post-cta::after {
  content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%;
  right: -120px; top: -140px; background: radial-gradient(circle, rgba(255,255,255,.12) 0%, rgba(255,255,255,0) 70%); pointer-events: none;
}
.post-cta h3, .post-cta p { color: #fff; position: relative; }
.post-cta p { color: rgba(255,255,255,.85); }
.post-cta .cta-links a {
  background: #fff; color: #0a4a45; box-shadow: 0 2px 8px rgba(0,0,0,.16);
}
.post-cta .cta-links a:hover { background: #f0fdfa; color: #0a4a45; text-decoration: none; transform: translateY(-1px); }
.cta-links a { transition: transform .12s ease, box-shadow .12s ease; }

/* --- 全局页面淡入（尊重 reduced-motion） --- */
body { animation: pageFade .35s ease both; }
@keyframes pageFade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
  .reading-progress span { transition: none; }
}

/* --- 面包屑 Breadcrumb --- */
.breadcrumb { margin: 16px 0 2px; font-size: .86rem; color: var(--ink-soft); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding: 0; }
.breadcrumb li { display: flex; align-items: center; gap: 6px; }
.breadcrumb li + li::before { content: "›"; color: #94a3b8; }
.breadcrumb a { color: var(--brand); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--ink); font-weight: 600; }

/* --- 文章分享工具条 --- */
.article-share { display: flex; align-items: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.article-share .as-label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.article-share .btn { padding: 7px 16px; font-size: .9rem; }

/* ========== 高端金融风 · Header 精修 ========== */
.site-header { border-bottom-color: #eef2f7; }
.nav-link, .nav a { letter-spacing: .01em; }
.nav a.active, .nav-link[aria-expanded="true"] { color: var(--brand); }

/* ========== 高端金融风 · Footer 深色化 ========== */
.site-footer {
  background: #0f172a;
  border-top: none;
  position: relative;
  margin-top: 72px;
}
.site-footer::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #0e5f59 0%, #2f7d6d 45%, #2f7d6d 100%);
}
.site-footer .container { padding-top: 56px; padding-bottom: 44px; }
.site-footer .logo { color: #ffffff; }
.site-footer .logo .logo-mark { color: #2f7d6d; }
.site-footer .footer-grid h4 { color: #64748b; font-weight: 600; }
.site-footer .footer-grid a { color: #94a3b8; }
.site-footer .footer-grid a:hover { color: #ffffff; }
.site-footer p { color: #94a3b8 !important; }
.footer-note { border-top-color: #1e293b; color: #64748b; margin-top: 32px; padding-top: 22px; }
.site-footer .footer-grid { gap: 32px; }

/* ========== 高端金融风 · 导航按钮升级（去色块，品牌色下划线） ========== */
.nav { gap: 6px; }
.nav a, .nav-link {
  position: relative;
  padding: 9px 14px;
  border-radius: 0;
  background: none;
  color: var(--ink-soft);
  font-weight: 500;
}
.nav a::after, .nav-link::after {
  content: '';
  position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px;
  background: linear-gradient(90deg, var(--brand) 0%, #2f7d6d 100%);
  border-radius: 2px;
  transform: scaleX(0); transform-origin: left center;
  transition: transform .18s ease;
}
.nav a:hover, .nav-link:hover, .nav a.active, .nav-link[aria-expanded="true"] { background: none; }
.nav a:hover, .nav-link:hover, .nav-link[aria-expanded="true"] { color: var(--ink); }
.nav a.active { color: var(--brand); font-weight: 600; }
.nav a:hover::after, .nav-link:hover::after,
.nav a.active::after, .nav-link[aria-expanded="true"]::after,
.nav-item:hover .nav-link::after { transform: scaleX(1); }
/* 下拉按钮 hover 文字色 */
.nav-item:hover .nav-link { color: var(--ink); }
@media (max-width: 640px) {
  .nav a, .nav-link { padding: 11px 12px; }
  .nav a::after, .nav-link::after { left: 12px; right: 12px; bottom: 4px; }
}

/* Historical backtest (DCA vs Lump Sum) */
.hist-summary { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 10px; }
.hist-stat { display: flex; align-items: center; gap: 8px; font-size: .92rem; color: var(--ink-soft, #5b6472); }
.hist-stat b { margin-left: auto; font-size: 1.05rem; color: var(--ink, #14181f); font-variant-numeric: tabular-nums; }
.hist-note { font-size: .84rem; color: var(--ink-soft, #5b6472); margin-top: 12px; line-height: 1.5; }
.method-note { font-size: .92rem; color: var(--ink-soft, #5b6472); }
.method-note p { margin: 0 0 10px; line-height: 1.65; }

/* ================= Dark mode ================= */
[data-theme="dark"] {
  --bg: #0f141a;
  --bg-soft: #151c24;
  --bg-brand: #16221d;
  --ink: #e6ebf1;
  --ink-soft: #b3bfcb;
  --muted: #8a96a4;
  --brand: #3aa68c;
  --brand-dark: #2f8f78;
  --brand-soft: #1b2d27;
  --growth: #4aaf95;
  --contrib: #7d9cc6;
  --border: #283442;
  --border-strong: #3b4a5c;
  --danger: #e26d5c;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
  --shadow-md: 0 4px 16px rgba(0,0,0,.4);
}
[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
[data-theme="dark"] .site-header {
  background: rgba(15,20,26,.72);
  border-bottom-color: #22303e;
  box-shadow: 0 1px 0 rgba(0,0,0,.25), 0 10px 30px -18px rgba(0,0,0,.5);
}
[data-theme="dark"] .nav,
[data-theme="dark"] .nav.open { background: var(--bg); }
[data-theme="dark"] .dropdown,
[data-theme="dark"] .dropdown.mega,
[data-theme="dark"] .mega { background: var(--bg); border-color: var(--border); }
[data-theme="dark"] .dropdown.mega { border-color: var(--border); box-shadow: 0 16px 40px -16px rgba(0,0,0,.5), 0 2px 10px rgba(0,0,0,.3); }
[data-theme="dark"] .mega-label { color: var(--muted); }
[data-theme="dark"] .dropdown-item:hover { background: var(--brand-soft); }
[data-theme="dark"] .nav-link:hover, [data-theme="dark"] .nav a:hover { color: var(--brand); }
[data-theme="dark"] .nav-toggle { color: var(--ink); border-color: var(--border-strong); }
[data-theme="dark"] .preset.active { color: #061410; }
[data-theme="dark"] .btn.primary { color: #061410; }
[data-theme="dark"] .btn.primary:hover { color: #061410; }
[data-theme="dark"] .btn.primary:focus-visible { color: #061410; }
[data-theme="dark"] .theme-btn { color: var(--ink); }
[data-theme="dark"] .theme-btn:hover { background: var(--brand-soft); }
[data-theme="dark"] .r72-note,
[data-theme="dark"] .alert-tip { background: #1c2420; border-color: #2c4a3e; color: var(--ink); }
[data-theme="dark"] .canvas-grid { background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px); }
[data-theme="dark"] .sticky-summary { background: rgba(10,15,20,.96); }
[data-theme="dark"] .post-card { background: var(--bg-soft); }
[data-theme="dark"] .calc-panel.inputs { border-color: var(--border); }
[data-theme="dark"] .site-footer { border-top-color: var(--border); }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea {
  background: var(--bg); color: var(--ink); border-color: var(--border-strong); }
[data-theme="dark"] input:focus, [data-theme="dark"] select:focus { border-color: var(--brand); }
[data-theme="dark"] .logo-img { filter: brightness(1.15); }
[data-theme="dark"] .table-scroll table th { color: var(--ink-soft); }
[data-theme="dark"] .table-scroll table td { color: var(--ink); }

/* theme toggle button */
.theme-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border); background: transparent;
  color: var(--ink); font-size: 1rem; cursor: pointer; margin-left: 10px;
  transition: background .2s, border-color .2s;
}
.theme-btn:hover { background: var(--brand-soft); border-color: var(--border-strong); }
.theme-btn svg { width: 17px; height: 17px; }

/* author signature (About) */
.author-signature {
  margin: 18px 0 0; font-weight: 700; color: var(--ink);
  letter-spacing: .01em; font-size: 1rem;
}

/* Smart validation：非阻断输入提示（只提示，不阻断计算） */
.calc-notes { margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.calc-notes[hidden] { display: none; }
.calc-note {
  font-size: .82rem; line-height: 1.5; color: #8a5b0b;
  background: rgba(217, 119, 6, .08);
  border-left: 3px solid #d97706;
  padding: 6px 12px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
[data-theme="dark"] .calc-note { color: #f0b429; background: rgba(217, 119, 6, .12); }
