/* ==========================================================================
   汽车出口成本与税费测算 · 界面样式
   目标：业务员在仓库/办公室用笔记本或手机都能快速录入、核对、打印。
   不做花哨动效，重点是可读性：金额右对齐、等宽数字、层级清楚。
   ========================================================================== */

:root {
  --ink: #10262c;
  --ink-soft: #3c5158;
  --muted: #6b7c81;
  --line: #dbe2e0;
  --line-strong: #c4cfcc;
  --paper: #f4f6f4;
  --card: #ffffff;
  --primary: #0d5c63;
  --primary-dark: #08454b;
  --primary-tint: #e6f2f1;
  --accent: #e8a838;
  --accent-tint: #fdf3df;
  --ok: #067647;
  --ok-tint: #e8f5ee;
  --warn: #b54708;
  --warn-tint: #fdf1e6;
  --bad: #b42318;
  --bad-tint: #fdecea;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 38, 44, .04), 0 10px 30px -18px rgba(16, 38, 44, .28);
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 12% -8%, rgba(13, 92, 99, .07), transparent 60%),
    radial-gradient(700px 360px at 100% 0%, rgba(232, 168, 56, .08), transparent 55%),
    var(--paper);
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; line-height: 1.3; letter-spacing: -.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding-left: 1.25em; }
strong { font-weight: 650; }
code, .mono { font-family: var(--mono); font-size: .88em; }
small { font-size: .82em; }

.wrap { width: min(1240px, 100% - 40px); margin-inline: auto; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--primary); color: #fff; padding: 10px 16px; z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(244, 246, 244, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  min-height: 62px;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark, .sheet-mark {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  color: #fff; font-weight: 700; font-size: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15.5px; letter-spacing: .02em; }
.brand-text small { color: var(--muted); font-size: 11.5px; }

.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  padding: 7px 13px; border-radius: 999px; color: var(--ink-soft);
  font-size: 14px; font-weight: 550;
}
.nav a:hover { background: rgba(13, 92, 99, .07); text-decoration: none; }
.nav a.is-active { background: var(--primary); color: #fff; }

.main { padding: 26px 0 56px; }

/* ---------- 页头 ---------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 26px; margin: 6px 0 22px; flex-wrap: wrap;
}
.page-head.compact { margin-bottom: 18px; align-items: flex-start; }
.page-head > div:first-child { max-width: 74ch; }
.eyebrow {
  font-size: 12px; font-weight: 650; letter-spacing: .14em; text-transform: uppercase;
  color: var(--primary); margin-bottom: 8px;
}
.page-head h1 { font-size: clamp(23px, 2.5vw, 32px); }
.page-head h1 + .lede { margin-top: 10px; }
.lede { color: var(--ink-soft); font-size: 14.5px; line-height: 1.72; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.steps {
  display: flex; gap: 18px; list-style: none; padding: 0; margin: 0;
}
.steps li {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-soft); white-space: nowrap;
}
.steps li span {
  display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 50%; background: #fff; border: 1px solid var(--line-strong);
  font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--primary);
}
.steps li:first-child span { background: var(--accent); border-color: var(--accent); color: #3a2500; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card-head { margin-bottom: 14px; }
.card-head h2 { font-size: 17px; display: flex; align-items: center; gap: 9px; }
.card-head h2 .num {
  font-family: var(--mono); font-size: 13px; color: var(--accent);
  background: var(--accent-tint); border-radius: 6px; padding: 2px 6px;
}
.card-head p { color: var(--muted); font-size: 13px; margin-top: 5px; max-width: 90ch; }
.card-head h3 { font-size: 14.5px; }
.subhead { margin: 20px 0 12px; padding-top: 14px; border-top: 1px dashed var(--line); }
.subhead h3 { font-size: 14px; }
.subhead p { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.card > .callout { margin-top: 14px; }

.grid { display: grid; gap: 14px 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.field-hint { font-size: 11.5px; color: var(--muted); font-style: normal; line-height: 1.45; }

input[type="text"], input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #fbfcfb;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  min-height: 40px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input[type="number"] { font-family: var(--mono); font-variant-numeric: tabular-nums; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(13, 92, 99, .13);
}
input:disabled, input[readonly] { background: #f1f3f2; color: var(--muted); }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.segmented {
  display: flex; gap: 3px; padding: 3px;
  background: #eef2f1; border: 1px solid var(--line); border-radius: 10px;
}
.seg { flex: 1; position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span {
  display: block; text-align: center; padding: 6px 8px;
  border-radius: 7px; font-size: 13px; color: var(--ink-soft); white-space: nowrap;
}
.seg input:checked + span { background: var(--primary); color: #fff; font-weight: 600; }
.seg input:focus-visible + span { box-shadow: 0 0 0 2px var(--accent); }

.checks { display: flex; flex-direction: column; gap: 2px; }
.check {
  display: grid; grid-template-columns: 18px 1fr; gap: 2px 8px;
  align-items: start; padding: 7px 8px; border-radius: 8px; cursor: pointer;
}
.check:hover { background: #f6f8f7; }
.check input { width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--primary); }
.check span { font-size: 13.5px; font-weight: 550; }
.check em { grid-column: 2; font-size: 11.5px; color: var(--muted); font-style: normal; }

.calc-form .card { scroll-margin-top: 76px; }

.form-actions {
  position: sticky; bottom: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 0 6px;
  background: linear-gradient(to top, var(--paper) 62%, rgba(244, 246, 244, 0));
}
.form-note { color: var(--muted); font-size: 12.5px; margin-left: auto; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; min-height: 38px;
  border-radius: 9px; border: 1px solid transparent;
  font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--ink); background: #fff; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: transform .12s, box-shadow .15s, background .15s, border-color .15s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink-soft); background: #fff; }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-link { color: var(--primary); background: transparent; padding-inline: 8px; }
.btn-link:hover { background: var(--primary-tint); }
.btn-danger-ghost { border-color: #efc4bf; color: var(--bad); background: #fff; }
.btn-danger-ghost:hover { background: var(--bad-tint); }
.btn-lg { padding: 12px 22px; font-size: 15px; min-height: 46px; border-radius: 10px; }
.btn[disabled] { opacity: .6; cursor: progress; }

.inline-form { display: inline; margin: 0; }
.link-danger {
  border: 0; background: none; padding: 0; font: inherit; cursor: pointer;
  color: var(--bad); font-size: 13px;
}
.link-danger:hover { text-decoration: underline; }

/* ---------- 提示条 ---------- */
.alert {
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  background: var(--primary-tint);
  border-radius: 10px;
  padding: 12px 15px;
  font-size: 13.5px;
  margin-bottom: 16px;
}
.alert ul { margin: 6px 0 0; }
.alert-info { border-left-color: var(--primary); background: var(--primary-tint); }
.alert-warn { border-left-color: var(--warn); background: var(--warn-tint); }
.alert-error { border-left-color: var(--bad); background: var(--bad-tint); color: #6d1610; }
.alert summary { cursor: pointer; }
.warn-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.warn-list li { display: flex; gap: 8px; align-items: baseline; }
.warn-tag {
  flex: none; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  padding: 1px 6px; border-radius: 4px; background: rgba(255, 255, 255, .7);
  border: 1px solid rgba(0, 0, 0, .08);
}
.warn-warn .warn-tag { color: var(--warn); }
.warn-info .warn-tag { color: var(--primary); }
.callout {
  background: #f7f9f8; border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 15px;
  font-size: 13px; color: var(--ink-soft); line-height: 1.7;
}
.disclaimer { color: var(--muted); font-size: 12px; line-height: 1.7; margin-top: 18px; }

/* ---------- KPI ---------- */
.summary {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
  margin-bottom: 18px;
}
.summary .card { padding: 14px 16px; margin: 0; }
.kpi { border-top: 3px solid var(--line-strong); }
.kpi-label { display: block; font-size: 12px; color: var(--muted); font-weight: 550; }
.kpi-value {
  display: block; margin: 5px 0 3px;
  font-family: var(--mono); font-size: clamp(20px, 2.1vw, 26px);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.kpi em { font-style: normal; font-size: 11.5px; color: var(--muted); line-height: 1.45; display: block; }
.kpi-good { border-top-color: var(--ok); }
.kpi-good .kpi-value { color: var(--ok); }
.kpi-bad { border-top-color: var(--bad); }
.kpi-bad .kpi-value { color: var(--bad); }
.kpi-muted { border-top-color: var(--line-strong); }
.kpi-muted .kpi-value { color: var(--muted); }

.big-number {
  font-family: var(--mono); font-size: clamp(22px, 2.2vw, 28px);
  font-variant-numeric: tabular-nums; color: var(--primary); margin-bottom: 4px;
}

/* ---------- 标签页 ---------- */
.tabs { margin-top: 4px; }
.tab-nav {
  display: flex; gap: 2px; overflow-x: auto;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px; padding-bottom: 0;
  scrollbar-width: thin;
}
.tab-nav button {
  flex: none;
  font: inherit; font-size: 13.5px; font-weight: 550;
  color: var(--muted); background: none; border: 0;
  padding: 10px 14px; cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tab-nav button:hover { color: var(--primary); }
.tab-nav button.is-active { color: var(--primary); border-bottom-color: var(--accent); font-weight: 650; }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ---------- 表格 ---------- */
.table-scroll { overflow-x: auto; margin-inline: -4px; padding-inline: 4px; }
.table {
  width: 100%; border-collapse: collapse;
  font-size: 13.5px;
}
.table th, .table td {
  text-align: left; vertical-align: top;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}
.table thead th {
  font-size: 11.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); background: #f7f9f8;
  border-bottom: 1px solid var(--line-strong);
  padding-block: 8px;
  white-space: nowrap;
}
.table tbody th { font-weight: 550; color: var(--ink-soft); }
.table tbody tr:hover > td, .table tbody tr:hover > th { background: #fafbfa; }
.table .num, .table .table td.num { text-align: right; }
.num {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.table .strong { font-weight: 650; }
.table .neg { color: var(--bad); }
.table small { display: inline-block; line-height: 1.45; }
.table tbody tr.is-sub > th, .table tbody tr.is-sub > td {
  background: #f4f7f6; font-weight: 600;
}
.table tr.is-total > th, .table tr.is-total > td {
  background: var(--primary-tint);
  border-top: 1px solid var(--primary);
  border-bottom: 1px solid var(--primary);
  font-weight: 700; color: var(--primary-dark);
}
.table tfoot th, .table tfoot td {
  border-top: 2px solid var(--line-strong);
  font-weight: 650;
  background: #f7f9f8;
}
.table tr.is-deferred { opacity: .55; }
.table-compact th, .table-compact td { padding: 7px 8px; font-size: 13px; }
.table-groups .group-head > th {
  background: #eef4f3; color: var(--primary-dark);
  font-weight: 650; font-size: 12.5px;
  letter-spacing: .02em;
  border-top: 1px solid var(--line);
}
.indent { padding-left: 24px !important; }
.row-actions { display: flex; gap: 12px; align-items: center; }
.row-actions a { font-size: 13px; }

.table-tax td { font-size: 12.5px; }
.table-tax td.num { font-size: 12.5px; }

/* ---------- 徽标 / 标签 ---------- */
.badge {
  display: inline-block; font-size: 11px; font-weight: 650;
  padding: 2px 7px; border-radius: 999px; white-space: nowrap;
  border: 1px solid transparent;
}
.badge-ok { background: var(--ok-tint); color: var(--ok); border-color: #bfe3d1; }
.badge-mid { background: #eef2f7; color: #2c5282; border-color: #cfdae8; }
.badge-est { background: var(--accent-tint); color: #8a5600; border-color: #f0d9a8; }
.badge-pending { background: var(--warn-tint); color: var(--warn); border-color: #f3d3b6; }

.tag {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 1px 7px; border-radius: 5px; margin-left: 5px;
  background: #eef2f1; color: var(--ink-soft);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.tag-ok { background: var(--ok-tint); color: var(--ok); border-color: #bfe3d1; }
.tag-warn { background: var(--warn-tint); color: var(--warn); border-color: #f3d3b6; }
.muted { color: var(--muted); }

/* ---------- 明细 / 展开 ---------- */
.derive { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.derive details {
  border: 1px solid var(--line); border-radius: 9px; background: #fbfcfb;
  padding: 0 12px;
}
.derive details[open] { background: #fff; }
.derive summary {
  cursor: pointer; padding: 9px 0; font-size: 12.5px;
  color: var(--ink-soft); list-style-position: outside;
}
.derive summary::marker { color: var(--accent); }
.derive-body { padding: 2px 0 12px; font-size: 12.5px; color: var(--ink-soft); }
.derive-body p { margin-bottom: 5px; }
.derive-body .mono { word-break: break-word; }

.note-list { font-size: 13px; color: var(--ink-soft); display: flex; flex-direction: column; gap: 5px; }
.note-list .gap { color: var(--warn); }

.json {
  font-family: var(--mono); font-size: 11.5px; line-height: 1.55;
  background: #10262c; color: #d9e6e4;
  border-radius: 10px; padding: 14px 16px;
  overflow: auto; max-height: 340px;
  margin: 0;
}

/* ---------- 规则页 ---------- */
.rule-card { padding-bottom: 16px; }
.rule-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.rule-head h2 code {
  font-size: 12px; font-weight: 500; color: var(--muted);
  background: #f1f4f3; padding: 2px 6px; border-radius: 5px; margin-left: 4px;
}
.rule-meta { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.rule-meta .tag { margin-left: 0; }
.rule-foot {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px;
  margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line);
  font-size: 12.5px; color: var(--ink-soft);
}
.rule-foot h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 5px; }
.rule-warn { background: var(--warn-tint); border-radius: 9px; padding: 10px 13px; }
.rule-warn h3 { color: var(--warn); }
.rule-notes { margin-top: 12px; font-size: 12.5px; }
.rule-notes summary { cursor: pointer; color: var(--primary); font-weight: 600; padding: 4px 0; }
.band-detail summary { cursor: pointer; font-size: 12px; color: var(--primary); }
.band-list { margin: 6px 0 0; padding-left: 16px; font-size: 12px; color: var(--ink-soft); }
.band-list li { margin-bottom: 2px; }

/* ---------- 国家预览 ---------- */
.pack-preview {
  margin-top: 20px; padding: 15px 17px;
  background: linear-gradient(160deg, #f2f8f7, #fbfcfb);
  border: 1px solid var(--line); border-radius: 12px;
}
.pack-preview h3 { font-size: 14px; margin-bottom: 4px; }
.pack-preview .muted { font-size: 12px; }
.mini-tax { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 7px; }
.mini-tax li {
  display: inline-flex; align-items: baseline; gap: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 9px; font-size: 12px;
}
.mini-tax li span { color: var(--muted); font-family: var(--mono); font-size: 11px; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 48px 20px; }
.empty h2 { font-size: 19px; margin-bottom: 8px; }
.empty p { color: var(--muted); margin-bottom: 18px; }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--line); background: rgba(255, 255, 255, .55); }
.footer-inner { padding: 18px 0 26px; display: flex; flex-direction: column; gap: 4px; }
.footer-note { color: var(--muted); font-size: 11.5px; line-height: 1.65; }
.footer-meta { color: var(--muted); font-size: 11px; opacity: .85; }

/* ---------- 打印件（屏幕预览） ---------- */
.print-body {
  background: #e9edeb;
  padding: 0 0 40px;
}
.print-toolbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 20px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.print-toolbar .muted { font-size: 12px; margin-left: auto; }
.sheet {
  width: min(210mm, 100% - 24px);
  margin: 0 auto;
  background: #fff;
  padding: 15mm 14mm;
  border-radius: 4px;
  box-shadow: 0 3px 24px rgba(16, 38, 44, .16);
  font-size: 12px;
  color: #1a2b30;
}
.sheet-head {
  display: flex; justify-content: space-between; gap: 20px;
  border-bottom: 2px solid #10262c; padding-bottom: 12px; margin-bottom: 14px;
}
.sheet-brand { display: flex; gap: 10px; align-items: flex-start; }
.sheet-mark { width: 32px; height: 32px; font-size: 16px; border-radius: 8px; }
.sheet-brand strong { display: block; font-size: 14px; }
.sheet-brand small { color: #5d6f74; font-size: 10.5px; }
.sheet-no { text-align: right; }
.sheet-no h1 { font-size: 19px; letter-spacing: .04em; }
.sheet-no p { font-size: 10.5px; color: #5d6f74; margin-top: 2px; }
.sheet-section { margin-bottom: 14px; page-break-inside: avoid; }
.sheet-section h2 {
  font-size: 12px; letter-spacing: .06em; color: #0d5c63;
  border-left: 3px solid #e8a838; padding-left: 8px;
  margin-bottom: 7px;
}
.p-table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.p-table th, .p-table td { border: 1px solid #cdd7d4; padding: 5px 7px; text-align: left; vertical-align: top; }
.p-table thead th { background: #f0f5f4; font-weight: 650; font-size: 10px; }
.p-table tbody th { background: #fafbfa; font-weight: 600; width: 34%; }
.p-table .num { text-align: right; font-family: var(--mono); white-space: nowrap; }
.p-table tr.is-sub th, .p-table tr.is-sub td { background: #f0f5f4; font-weight: 650; }
.p-table tr.is-total th, .p-table tr.is-total td { background: #e6f2f1; font-weight: 700; border-top: 1.5px solid #0d5c63; }
.p-table .neg { color: #b42318; }
.p-kv th { width: 15%; white-space: nowrap; }
.p-tax { font-size: 10px; }
.p-note { font-size: 10px; color: #5d6f74; margin-top: 6px; line-height: 1.65; }
.p-terms { font-size: 10.5px; color: #33474d; display: flex; flex-direction: column; gap: 4px; padding-left: 16px; }
.p-warn { font-size: 10px; color: #8a3b00; margin-top: 6px; padding-left: 16px; }
.print-warn {
  font-size: 10.5px; color: #b42318; border: 1px solid #e7b6b1;
  background: #fdecea; border-radius: 4px; padding: 6px 9px; margin-bottom: 12px;
}
.print-block {
  font-size: 10.5px; color: #6d1610; border: 1px solid #e7b6b1;
  background: #fdecea; border-radius: 4px; padding: 8px 11px; margin-bottom: 12px;
}
.print-block ul { margin: 4px 0 0; }
.sign-row { display: flex; gap: 24px; margin-top: 22px; }
.sign-row > div { flex: 1; font-size: 10.5px; color: #5d6f74; }
.sign-row span { display: block; margin-bottom: 24px; }
.sign-row em { display: block; border-top: 1px solid #9aa9a6; }
.sheet-foot {
  display: flex; justify-content: space-between;
  border-top: 1px solid #cdd7d4; padding-top: 7px; margin-top: 18px;
  font-size: 9.5px; color: #74868a;
}

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rule-foot { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .wrap { width: calc(100% - 28px); }
  body { font-size: 14.5px; }
  .topbar-inner { min-height: 56px; }
  .brand-text small { display: none; }
  .nav { gap: 0; }
  .nav a { padding: 6px 9px; font-size: 13px; }
  .main { padding-top: 18px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 14px; }
  .steps { display: none; }
  .card { padding: 16px 15px; border-radius: 12px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary .card:last-child { grid-column: 1 / -1; }
  .form-actions { position: static; padding-top: 8px; }
  .form-note { margin-left: 0; width: 100%; }
  .btn { padding: 8px 12px; }
  .btn-lg { width: 100%; }
  .table { font-size: 12.5px; }
  .table th, .table td { padding: 7px 6px; }
  .tab-nav { margin-inline: -15px; padding-inline: 15px; }
  .sheet { padding: 10mm 8mm; }
}
@media (max-width: 460px) {
  .summary { grid-template-columns: 1fr; }
  .summary .card:last-child { grid-column: auto; }
  .brand-text strong { font-size: 14px; }
}

/* ---------- 打印 ---------- */
@media print {
  @page { size: A4 portrait; margin: 12mm; }
  html, body {
    background: #fff !important;
    font-size: 10.5pt;
    color: #000;
  }
  .topbar, .footer, .print-toolbar, .skip { display: none !important; }
  .sheet {
    width: auto; max-width: none; margin: 0; padding: 0;
    box-shadow: none; border-radius: 0; font-size: 9.8pt;
  }
  .sheet-section { break-inside: avoid; page-break-inside: avoid; margin-bottom: 10px; }
  .p-table { break-inside: auto; }
  .p-table tr { break-inside: avoid; page-break-inside: avoid; }
  .p-table thead { display: table-header-group; }
  .p-table th, .p-table td { border-color: #999 !important; }
  .p-table thead th, .p-table tbody th { background: #eef2f1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .p-table tr.is-total th, .p-table tr.is-total td { background: #e0eeec !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-warn, .print-block { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: #000; text-decoration: none; }
  .sheet-foot { margin-top: 10px; }
}
