:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #eeede7;
  --ink: #24231f;
  --ink-2: #56544c;
  --muted: #6b685d;
  --line: #e7e5dc;
  --line-strong: #d9d6ca;
  --accent: #5f7c61;
  --accent-deep: #42584a;
  --accent-soft: #e6ece1;
  --ok: #4f9d6b;
  --danger: #b0594b;
  --shadow-sm: 0 1px 2px rgba(36, 35, 31, 0.05), 0 4px 12px rgba(36, 35, 31, 0.05);
  --font-display: 'Space Grotesk', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-body: 'Inter', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
}

* { box-sizing: border-box; }

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

a {
  color: inherit;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand__mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.brand__mark svg {
  width: 36px;
  height: 36px;
  display: block;
}

.brand__word {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand__word strong {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}

.brand__word small {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.topbar__meta {
  display: flex;
  align-items: center;
  gap: 22px;
}

.back {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}

.back:hover {
  color: var(--accent-deep);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
}

.status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(79, 157, 107, 0.14);
}

.main {
  flex: 1;
  width: min(960px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0 60px;
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 22px;
  align-items: start;
}

.hero {
  grid-column: 1 / -1;
  max-width: 760px;
  margin-bottom: 14px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}

.eyebrow__rule {
  width: 34px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.hero__title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(25px, 5vw, 40px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.05;
}

.hero__dot {
  color: var(--accent);
}

.hero__lead {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-2);
  max-width: 640px;
}

@media (max-width: 720px) {
  .main { grid-template-columns: 1fr; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel__title {
  margin: 0;
  padding: 14px 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  text-transform: uppercase;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.panel__body {
  padding: 20px;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field__label {
  display: block;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 6px;
}

.field__control {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
}

.field__control:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(95, 124, 97, 0.14);
}

.field__control input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  padding: 11px 14px;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--ink);
  outline: none;
}

.field__unit {
  padding: 0 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  border-left: 1px solid var(--line);
}

.hint {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  border-left: 3px solid var(--line-strong);
  padding-left: 10px;
  margin: 12px 0 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}

.metric__label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.metric__value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric__value--positive {
  color: var(--ok);
}

.metric__value--negative {
  color: var(--danger);
}

.chart {
  width: 100%;
  height: 360px;
}

.footer {
  padding: 16px 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

/* ---- 专项附加扣除速查 ---- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table caption { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: var(--ink-2); padding: 0 0 10px; text-transform: uppercase; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.6; }
.table thead th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; background: var(--surface-2); }
.table thead tr:first-child th:first-child { border-radius: 8px 0 0 0; }
.table thead tr:first-child th:last-child { border-radius: 0 8px 0 0; }
.table tbody td:first-child { font-weight: 600; color: var(--ink); white-space: nowrap; }
.table tbody td.mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--accent-deep); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: none; }

/* ---- 速查折叠面板与分段切换 ---- */
.panel--fold { grid-column: 1 / -1; margin: 0; }
.panel__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  text-transform: uppercase;
  background: var(--surface-2);
  border-bottom: 1px solid transparent;
  user-select: none;
}
.panel__summary::-webkit-details-marker { display: none; }
.panel__summary:hover { color: var(--accent-deep); }
.panel__chevron { width: 16px; height: 16px; flex: none; color: var(--muted); transition: transform 0.2s ease; }
details[open] .panel__summary { border-bottom-color: var(--line); }
details[open] .panel__chevron { transform: rotate(180deg); }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: var(--surface-2); margin-bottom: 18px; }
.segmented button { padding: 9px 18px; font-size: 13px; color: var(--ink-2); }
.segmented button.is-active { background: var(--accent); color: #fff; }
.segmented button:not(.is-active):hover { color: var(--accent-deep); }
#tab-rate, #tab-deduct { margin: 0; }
@media (max-width: 860px) {
  .segmented { display: flex; width: 100%; }
  .segmented button { flex: 1; padding: 9px 8px; }
}
