/* style.css — 信源化验证档位（纯静态，无构建变异、无类名混淆）
   设计语言：账本纸面 · 编辑级排版（v2）
   - 底：暖纸 + 账本横向行线（36px）+ 顶部柔光，拒绝纯灰平底与科技网格
   - 字：正文无衬线、标题宋体、金额等宽对齐；层级靠字号与留白，不靠阴影堆叠
   - 线：1px 发丝线承重，墨色深卡只留给结果；金色仅做刻度与标记
   - 色：墨蓝为骨、账本金为饰、到手绿为果，全部收敛为 token，零裸色值
   可访问性：正文对比度 ≥ 4.5:1；焦点环 2px 金色外描边；可点区域 ≥ 44×44px。 */

:root {
  /* 骨架色 */
  --tp-night: #14202E;
  --tp-night-deep: #0C1622;
  --tp-primary: #14202E;
  --tp-primary-hover: #0C1622;
  --tp-primary-soft: #E8E3D6;

  /* 结果与强调 */
  --tp-accent: #1F6F54;
  --tp-accent-hover: #175844;
  --tp-accent-bg: #EDF4F0;
  --tp-gold: #8A6A21;
  --tp-gold-line: #B08A3E;
  --tp-gold-soft: #D9B45B;

  /* 告警 */
  --tp-warn: #A8261F;
  --tp-warn-bg: #FBF0EE;
  --tp-warn-line: #F3D9D6;

  /* 纸面与文字 */
  --tp-text: #1B1F24;
  --tp-muted: #6E6A5E;
  --tp-bg: #F5F1E7;
  --tp-bg-deep: #EBE5D7;
  --tp-card: #FCFAF5;
  --tp-border: #E1DACB;
  --tp-border-strong: #CDC4B0;

  /* 深卡 / 深底内文字 */
  --tp-on-night: #F3EFE5;
  --tp-on-night-muted: #A9B4C2;

  /* 辅助色（收敛为 token，禁止裸写色值） */
  --tp-white: #FFFFFF;
  --tp-body-text: #33383E;
  --tp-paper-hi: #FFFDF7;
  --tp-input-hover: #B9AF99;
  --tp-disabled-bg: #8A8B87;
  --tp-disabled-text: #F4F2EC;
  --tp-gold-bg: #F7EFDC;
  --tp-gold-border: #E4D5B0;

  /* 线条、阴影、节奏 */
  --tp-focus-ring: #B08A3E;
  --tp-focus-glow: rgba(176, 138, 62, 0.18);
  --tp-gold-glow: rgba(176, 138, 62, 0.16);
  --tp-seal-line: rgba(217, 180, 91, 0.35);
  --tp-ink-wash: rgba(20, 32, 46, 0.04);
  --tp-ink-wash-soft: rgba(20, 32, 46, 0.025);
  --tp-paper-clear: rgba(255, 253, 247, 0);
  --tp-grid-line: rgba(20, 32, 46, 0.032);
  --tp-ledger-gap: 36px;
  --tp-night-line: rgba(243, 239, 229, 0.14);
  --tp-overlay: rgba(12, 22, 34, 0.56);
  --tp-radius-sm: 2px;
  --tp-radius: 4px;
  --tp-radius-lg: 7px;
  --tp-shadow: 0 1px 2px rgba(20, 32, 46, 0.05);
  --tp-shadow-md: 0 16px 40px -24px rgba(20, 32, 46, 0.42);
  --tp-shadow-up: 0 -10px 30px -22px rgba(20, 32, 46, 0.55);
  --tp-header-bg: rgba(245, 241, 231, 0.93);
  --tp-duration: 180ms;

  --tp-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --tp-font-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC",
    STSong, SimSun, Georgia, serif;
}

/* ---------- 基础重置 ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
img, svg, table { max-width: 100%; }

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

body {
  margin: 0;
  font-family: var(--tp-font-sans);
  font-size: 15.5px;
  color: var(--tp-text);
  background-color: var(--tp-bg);
  background-image:
    radial-gradient(130% 52% at 50% -8%, var(--tp-paper-hi) 0%, var(--tp-paper-clear) 62%),
    repeating-linear-gradient(
      0deg,
      var(--tp-grid-line) 0 1px,
      transparent 1px var(--tp-ledger-gap)
    );
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 0 18px; }

/* ---------- 排版 ---------- */
h1, h2 {
  font-family: var(--tp-font-serif);
  font-weight: 700;
  color: var(--tp-text);
  letter-spacing: 0.012em;
}

h1 {
  position: relative;
  font-size: 2rem;
  line-height: 1.32;
  margin: 40px 0 14px;
  padding-top: 20px;
  border-top: 1px solid var(--tp-border-strong);
}
h1::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  margin-top: 14px;
  background: var(--tp-gold-line);
}

h2 {
  font-size: 1.22rem;
  line-height: 1.5;
  margin: 40px 0 14px;
  padding-top: 14px;
  border-top: 1px solid var(--tp-border);
}
h2::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 10px;
  vertical-align: 3px;
  background: var(--tp-gold-line);
}

h3 {
  font-size: 0.98rem;
  font-weight: 700;
  margin: 24px 0 8px;
  letter-spacing: 0.02em;
}

p { margin: 10px 0; }

main > h1 + p {
  color: var(--tp-muted);
  font-size: 1rem;
  margin: 0 0 10px;
  max-width: 46em;
}

a {
  color: var(--tp-accent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--tp-duration);
}
a:hover { color: var(--tp-accent-hover); }

strong { font-weight: 700; }
ul, ol { padding-left: 1.3em; }

/* ---------- 顶栏：纸面 + 发丝线，导航用刻度线而非药丸 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--tp-header-bg);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--tp-border-strong);
}
.site-header::after {
  content: "";
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--tp-gold-line) 0 88px, transparent 88px);
  opacity: 0.55;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 10px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-family: var(--tp-font-serif);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--tp-night);
  text-decoration: none;
  transition: color var(--tp-duration);
}
.brand:hover { color: var(--tp-accent); }
.brand::before {
  content: "¥";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  flex: none;
  background: var(--tp-night);
  color: var(--tp-gold-soft);
  font-family: var(--tp-font-serif);
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--tp-radius-sm);
  box-shadow: inset 0 0 0 1px var(--tp-seal-line);
}

.site-nav { display: flex; align-items: center; gap: 2px; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 11px;
  color: var(--tp-muted);
  font-size: 0.9rem;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color var(--tp-duration), border-color var(--tp-duration);
}
.site-nav a:hover {
  color: var(--tp-night);
  border-bottom-color: var(--tp-border-strong);
}
.site-nav a[aria-current="page"] {
  color: var(--tp-night);
  font-weight: 600;
  border-bottom-color: var(--tp-gold-line);
}

/* ---------- 表单面板：账本页签，顶部墨线收边 ---------- */
.card {
  position: relative;
  margin: 24px 0;
  padding: 26px 26px 22px;
  background: var(--tp-card);
  border: 1px solid var(--tp-border-strong);
  border-top: 2px solid var(--tp-night);
  border-radius: var(--tp-radius-lg);
  box-shadow: var(--tp-shadow);
}
.card h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  font-size: 1.05rem;
  letter-spacing: 0.045em;
}
/* 同一表单内的第二个及以后的分组标题：发丝线分隔，避免两块内容粘连 */
.card > h2:not(:first-child) {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px dashed var(--tp-border-strong);
}
.card h2 + .field,
.card h2 + div { margin-top: 14px; }

.field { margin-bottom: 20px; }
.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--tp-text);
  letter-spacing: 0.01em;
}
.field .hint {
  margin-top: 5px;
  color: var(--tp-muted);
  font-size: 0.79rem;
  line-height: 1.6;
}

fieldset.field {
  border: 0;
  padding: 0;
  margin: 0 0 20px;
  min-width: 0;
}
fieldset.field legend {
  margin-bottom: 4px;
  padding: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--tp-text);
}

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .suffix {
  position: absolute;
  right: 14px;
  color: var(--tp-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

input[type="number"],
input[type="text"],
select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  font-size: 16px; /* 移动端防自动缩放 */
  font-family: inherit;
  color: var(--tp-text);
  background: var(--tp-white);
  border: 1px solid var(--tp-border-strong);
  border-radius: var(--tp-radius);
  transition: border-color var(--tp-duration), box-shadow var(--tp-duration),
    background-color var(--tp-duration);
  appearance: none;
}

select {
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--tp-muted) 50%),
    linear-gradient(135deg, var(--tp-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 19px) calc(50% - 2px),
    calc(100% - 14px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

input[type="number"] { font-variant-numeric: tabular-nums; }
.input-wrap input { padding-right: 42px; }

input:hover, select:hover { border-color: var(--tp-input-hover); }
input:focus, select:focus {
  outline: none;
  border-color: var(--tp-gold-line);
  box-shadow: 0 0 0 3px var(--tp-focus-glow);
}
input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--tp-focus-ring);
  outline-offset: 2px;
}
input[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--tp-warn);
  background: var(--tp-warn-bg);
}
input:disabled,
select:disabled {
  background: var(--tp-bg-deep);
  color: var(--tp-muted);
  cursor: not-allowed;
}

.form-error {
  margin: 14px 0;
  padding: 11px 14px;
  background: var(--tp-warn-bg);
  border: 1px solid var(--tp-warn);
  border-left-width: 3px;
  border-radius: var(--tp-radius);
  color: var(--tp-warn);
  font-size: 0.88rem;
  font-weight: 600;
}

/* ---------- 按钮：方硬、无光晕，按下 1px 下压 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  min-width: 44px;
  padding: 11px 22px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--tp-radius);
  cursor: pointer;
  transition: background-color var(--tp-duration), color var(--tp-duration),
    border-color var(--tp-duration), opacity var(--tp-duration),
    transform var(--tp-duration);
}

.btn-primary { background: var(--tp-night); color: var(--tp-on-night); }
.btn-primary:hover { background: var(--tp-night-deep); }
.btn-primary:disabled {
  background: var(--tp-disabled-bg);
  color: var(--tp-disabled-text);
  cursor: not-allowed;
}
.btn-primary[data-loading="1"] { cursor: wait; opacity: 0.85; }

.btn-accent { background: var(--tp-accent); color: var(--tp-white); }
.btn-accent:hover { background: var(--tp-accent-hover); }
.btn-accent:disabled { background: var(--tp-disabled-bg); cursor: not-allowed; }

.btn-outline {
  background: transparent;
  color: var(--tp-night);
  border-color: var(--tp-night);
}
.btn-outline:hover { background: var(--tp-night); color: var(--tp-on-night); }
.btn-outline:disabled {
  color: var(--tp-muted);
  border-color: var(--tp-border-strong);
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--tp-text);
  border-color: var(--tp-border-strong);
}
.btn-ghost:hover {
  border-color: var(--tp-night);
  background: var(--tp-ink-wash);
}
.btn-ghost:disabled { color: var(--tp-muted); cursor: not-allowed; opacity: 0.6; }

.btn-sm { min-height: 44px; padding: 7px 13px; font-size: 0.82rem; font-weight: 500; }
.btn-block { width: 100%; margin-top: 6px; }
.btn-error { background: var(--tp-warn); color: var(--tp-white); }
.btn:active:not(:disabled) { transform: translateY(1px); }

/* ---------- 结果区：入场只做透明度与位移 ---------- */
.result-region { margin-top: 32px; }
.result-region:not([hidden]) { animation: tp-rise 220ms ease-out both; }

@keyframes tp-rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.mock-banner {
  margin-bottom: 14px;
  padding: 11px 14px;
  background: var(--tp-warn-bg);
  border: 1px solid var(--tp-warn);
  border-left-width: 3px;
  border-radius: var(--tp-radius);
  color: var(--tp-warn);
  font-size: 0.87rem;
  font-weight: 600;
}

/* 结果主卡：墨色承重，金线收边 */
.summary-card {
  position: relative;
  margin-bottom: 18px;
  padding: 28px 26px 22px;
  background:
    radial-gradient(120% 90% at 100% 0%, var(--tp-gold-glow) 0%, transparent 55%),
    var(--tp-night);
  color: var(--tp-on-night);
  border-radius: var(--tp-radius-lg);
  box-shadow: var(--tp-shadow-md);
  overflow: hidden;
}
.summary-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--tp-gold-line);
}
.summary-card .sum-headline {
  margin: 0;
  color: var(--tp-on-night-muted);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.summary-card .sum-net {
  margin: 8px 0 4px;
  font-family: var(--tp-font-serif);
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--tp-gold-soft);
  font-variant-numeric: tabular-nums lining-nums;
}
.summary-card .sum-note {
  margin: 12px 0 0;
  color: var(--tp-on-night-muted);
  font-size: 0.78rem;
  line-height: 1.6;
}
.summary-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 16px;
  margin: 20px 0 0;
  padding-top: 6px;
  border-top: 1px solid var(--tp-night-line);
  font-size: 0.88rem;
}
.summary-card dt,
.summary-card dd {
  margin: 0;
  padding: 8px 0;
  border-bottom: 1px dashed var(--tp-night-line);
}
.summary-card dt { color: var(--tp-on-night-muted); }
.summary-card dd {
  text-align: right;
  font-weight: 600;
  color: var(--tp-on-night);
  font-variant-numeric: tabular-nums;
}
.summary-card dl > dt:nth-last-of-type(1),
.summary-card dl > dd:nth-last-of-type(1) {
  padding-bottom: 0;
  border-bottom: none;
}

.result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }

/* ---------- 账本式表格 ---------- */
.result-table-wrap {
  overflow-x: auto;
  background: var(--tp-card);
  border: 1px solid var(--tp-border-strong);
  border-radius: var(--tp-radius-lg);
}
table.result-table {
  width: 100%;
  min-width: 440px;
  border-collapse: collapse;
  font-size: 0.89rem;
}
.result-table caption {
  padding: 16px 16px 6px;
  font-family: var(--tp-font-serif);
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
  color: var(--tp-text);
}
.result-table th,
.result-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--tp-border);
  text-align: left;
  vertical-align: middle;
}
.result-table thead th {
  background: var(--tp-bg-deep);
  border-bottom: 1px solid var(--tp-border-strong);
  color: var(--tp-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  white-space: nowrap;
}
.result-table tbody tr { transition: background-color var(--tp-duration); }
.result-table tbody tr:last-child td { border-bottom: none; }
.result-table td.num {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.result-table th.num { text-align: right; }

@media (hover: hover) {
  .result-table tbody tr:hover { background: var(--tp-ink-wash-soft); }
}

.item-label { display: block; }
.item-flag {
  display: inline-block;
  margin-top: 3px;
  padding: 1px 6px;
  background: var(--tp-gold-bg);
  border: 1px solid var(--tp-gold-border);
  border-radius: var(--tp-radius-sm);
  color: var(--tp-gold);
  font-size: 0.72rem;
  font-weight: 600;
}
.row-actions { text-align: right; white-space: nowrap; }
.row-actions .btn { margin-left: 6px; }
.row-done { color: var(--tp-accent); font-size: 0.83rem; font-weight: 600; }

.fn-entry { margin: 16px 0; font-size: 0.88rem; }
.fn-entry a {
  color: var(--tp-muted);
  text-decoration: underline;
  text-decoration-color: var(--tp-border-strong);
}
.fn-entry a:hover { color: var(--tp-gold); }

/* ---------- 深度建议：编号账目 ---------- */
.deep-block {
  margin: 28px 0;
  padding: 24px 24px 20px;
  background: var(--tp-card);
  border: 1px solid var(--tp-border-strong);
  border-top: 3px solid var(--tp-gold-line);
  border-radius: var(--tp-radius-lg);
}
.deep-block h3 {
  margin-top: 0;
  font-family: var(--tp-font-serif);
  font-size: 1.05rem;
}
.deep-list { margin: 0; padding: 0; list-style: none; counter-reset: deep; }
.deep-item {
  position: relative;
  counter-increment: deep;
  padding: 11px 0 11px 40px;
  border-bottom: 1px dashed var(--tp-border);
  font-size: 0.9rem;
}
.deep-item:last-child { border-bottom: none; }
.deep-item::before {
  content: counter(deep, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 12px;
  font-family: var(--tp-font-serif);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--tp-gold);
}
.deep-blurred { filter: blur(4px); user-select: none; }
.deep-cta { margin-top: 18px; text-align: center; }
.deep-cta p { color: var(--tp-muted); font-size: 0.83rem; }

/* ---------- 弹层 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--tp-overlay);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.modal-card {
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 26px;
  background: var(--tp-card);
  border: 1px solid var(--tp-border-strong);
  border-top: 2px solid var(--tp-night);
  border-radius: var(--tp-radius-lg);
  box-shadow: var(--tp-shadow-md);
}
.modal-card h3 {
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--tp-border);
  font-family: var(--tp-font-serif);
  font-size: 1.15rem;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--tp-border);
}
.radio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 8px;
  border-radius: var(--tp-radius);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color var(--tp-duration);
}
.radio-row:hover { background: var(--tp-ink-wash); }
.radio-row input {
  width: 17px;
  height: 17px;
  flex: none;
  accent-color: var(--tp-night);
}

/* ---------- 同意横幅（≤40% 视口） ---------- */
.consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  max-height: 40vh;
  overflow-y: auto;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  background: var(--tp-card);
  border-top: 3px solid var(--tp-gold-line);
  box-shadow: var(--tp-shadow-up);
}
.consent-inner { max-width: 720px; margin: 0 auto; }
.consent-inner p { margin: 0 0 12px; font-size: 0.88rem; }
.consent-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 70;
  max-width: 90vw;
  padding: 11px 18px;
  background: var(--tp-night);
  border-left: 3px solid var(--tp-gold-line);
  border-radius: var(--tp-radius);
  color: var(--tp-on-night);
  font-size: 0.87rem;
  box-shadow: var(--tp-shadow-md);
  transform: translateX(-50%);
  animation: tp-toast-in 180ms ease-out both;
}
.toast[data-kind="error"] {
  background: var(--tp-warn);
  border-left-color: var(--tp-warn-line);
  color: var(--tp-white);
}

@keyframes tp-toast-in {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- 历史记录 ---------- */
.history-panel {
  margin: 28px 0;
  padding: 0 20px 16px;
  background: var(--tp-card);
  border: 1px solid var(--tp-border-strong);
  border-radius: var(--tp-radius-lg);
}
.history-panel summary {
  display: list-item;
  min-height: 52px;
  padding: 14px 0;
  color: var(--tp-text);
  font-family: var(--tp-font-serif);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  list-style-position: inside;
}
.history-panel summary::marker { color: var(--tp-gold); }
.history-list { list-style: none; margin: 4px 0 14px; padding: 0; }
.history-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 0;
  border-bottom: 1px solid var(--tp-border);
}
.history-item:last-child { border-bottom: none; }
.history-summary {
  font-size: 0.92rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.history-meta { color: var(--tp-muted); font-size: 0.78rem; }
.history-empty { padding: 10px 0; color: var(--tp-muted); font-size: 0.88rem; }

/* ---------- 可引用块（口径说明） ---------- */
.citable {
  position: relative;
  margin: 24px 0;
  padding: 20px 22px;
  overflow-x: auto;
  background: var(--tp-card);
  border: 1px solid var(--tp-border-strong);
  border-left: 3px solid var(--tp-gold-line);
  border-radius: 0 var(--tp-radius) var(--tp-radius) 0;
  color: var(--tp-body-text);
  font-size: 0.88rem;
}
.citable p { margin: 8px 0; }
.citable table {
  width: 100%;
  margin: 12px 0;
  background: var(--tp-white);
  border-collapse: collapse;
  font-size: 0.83rem;
}
.citable caption {
  padding-bottom: 8px;
  color: var(--tp-text);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: left;
}
.citable th,
.citable td {
  padding: 7px 9px;
  border: 1px solid var(--tp-border);
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.citable th {
  background: var(--tp-bg-deep);
  color: var(--tp-text);
  font-size: 0.79rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* ---------- FAQ ---------- */
details.faq {
  margin-bottom: 10px;
  padding: 0 18px;
  background: var(--tp-card);
  border: 1px solid var(--tp-border-strong);
  border-radius: var(--tp-radius);
  transition: border-color var(--tp-duration);
}
details.faq[open] { border-color: var(--tp-gold-border); }
details.faq summary {
  display: list-item;
  min-height: 52px;
  padding: 14px 0;
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
  list-style-position: inside;
}
details.faq summary::marker { color: var(--tp-gold); }
details.faq[open] summary { color: var(--tp-night); }
details.faq p {
  margin: 2px 0 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--tp-border);
  color: var(--tp-muted);
  font-size: 0.89rem;
}

.disclaimer {
  margin: 12px 0 0;
  color: var(--tp-muted);
  font-size: 0.78rem;
  line-height: 1.65;
}

/* ---------- 页脚：深墨书挡 ---------- */
.site-footer {
  margin-top: 64px;
  padding: 30px 0 48px;
  background: var(--tp-night);
  color: var(--tp-on-night-muted);
  font-size: 0.84rem;
}
.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-right: 20px;
  color: var(--tp-on-night-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--tp-duration), border-color var(--tp-duration);
}
.site-footer a:hover {
  color: var(--tp-on-night);
  border-bottom-color: var(--tp-gold-line);
}
.site-footer p { margin: 2px 0; }
.site-footer .disclaimer { color: var(--tp-on-night-muted); }

/* ---------- 404 ---------- */
.notfound { padding: 76px 16px 92px; text-align: center; }
.notfound h1 {
  margin: 0 0 10px;
  padding-top: 0;
  border-top: none;
  font-size: 2.2rem;
}
.notfound h1::after {
  width: 44px;
  margin: 16px auto 0;
}
.notfound p { color: var(--tp-muted); }
.notfound .btn { margin-top: 24px; }
.notfound .links { margin-top: 18px; font-size: 0.9rem; }

/* ---------- 响应式：375px 无横向滚动 ---------- */
@media (max-width: 560px) {
  body { font-size: 15px; }
  h1 { margin-top: 28px; font-size: 1.62rem; padding-top: 18px; }
  h2 { margin-top: 34px; font-size: 1.12rem; }
  .wrap { padding: 0 14px; }
  .card { padding: 20px 16px 16px; }
  .summary-card { padding: 22px 18px 18px; }
  .summary-card .sum-net { font-size: 2.05rem; }
  .row-actions { white-space: normal; }
  .row-actions .btn { margin: 4px 4px 0 0; }
  .site-header .wrap { min-height: 58px; }
  .site-nav a { padding: 0 7px; font-size: 0.82rem; }
  .modal-card { padding: 20px 18px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
  .result-table th,
  .result-table td { padding: 9px 8px; }
  table.result-table { min-width: 0; table-layout: fixed; }
  .result-table thead th { white-space: normal; letter-spacing: 0.03em; font-size: 0.68rem; }
  .result-table th.num,
  .result-table td.num { width: 78px; }
  .result-table th:last-child,
  .result-table td.row-actions { width: 98px; padding-left: 4px; }
  .row-actions .btn { display: block; width: 100%; margin: 4px 0 0; padding: 5px 4px; font-size: 0.76rem; }
  .row-actions .btn:first-child { margin-top: 0; }
  .site-footer { padding: 24px 0 40px; }
  .site-footer a { margin-right: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
