/* ==========================================================================
   个人劳务报酬计算器 — 设计系统
   语言参考：Apple Account 的克制排版、大留白、单一强调色
   ========================================================================== */

/* ---------- 设计令牌 ---------- */
:root {
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --inset: #f5f5f7;
  --inset-strong: #ebebed;

  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #8e8e93;

  --hair: rgba(0, 0, 0, 0.08);
  --hair-strong: rgba(0, 0, 0, 0.14);

  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-weak: rgba(0, 113, 227, 0.1);
  --key-tint: rgba(0, 113, 227, 0.055);

  --c-net: #0071e3;
  --c-vat: #ff9500;
  --c-surtax: #ffd60a;
  --c-pit: #af52de;

  --chip: rgba(120, 120, 128, 0.12);
  --chip-hover: rgba(120, 120, 128, 0.2);
  --row-hover: rgba(120, 120, 128, 0.085);

  --radius-card: 26px;
  --radius-pane: 20px;
  --radius-field: 12px;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 18px 48px -20px rgba(0, 0, 0, 0.22);
  --shadow-thumb: 0 1px 4px rgba(0, 0, 0, 0.14), 0 0 0 0.5px rgba(0, 0, 0, 0.04);

  --nav-bg: rgba(245, 245, 247, 0.72);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);

  --maxw: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --bg-elevated: #1c1c1e;
    --surface: #161617;
    --inset: #0d0d0f;
    --inset-strong: #242426;

    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #86868b;

    --hair: rgba(255, 255, 255, 0.1);
    --hair-strong: rgba(255, 255, 255, 0.18);

    --accent: #0a84ff;
    --accent-hover: #409cff;
    --accent-weak: rgba(10, 132, 255, 0.16);
    --key-tint: rgba(10, 132, 255, 0.13);

    --c-net: #0a84ff;
    --c-vat: #ff9f0a;
    --c-surtax: #ffd60a;
    --c-pit: #bf5af2;

    --chip: rgba(120, 120, 128, 0.24);
    --chip-hover: rgba(120, 120, 128, 0.36);
    --row-hover: rgba(255, 255, 255, 0.05);

    --shadow-card: 0 1px 1px rgba(0, 0, 0, 0.3), 0 24px 60px -28px rgba(0, 0, 0, 0.9);
    --shadow-thumb: 0 1px 4px rgba(0, 0, 0, 0.6), 0 0 0 0.5px rgba(255, 255, 255, 0.08);

    --nav-bg: rgba(0, 0, 0, 0.68);
  }
}

:root[data-theme="dark"] {
  --bg: #000000;
  --bg-elevated: #1c1c1e;
  --surface: #161617;
  --inset: #0d0d0f;
  --inset-strong: #242426;

  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #86868b;

  --hair: rgba(255, 255, 255, 0.1);
  --hair-strong: rgba(255, 255, 255, 0.18);

  --accent: #0a84ff;
  --accent-hover: #409cff;
  --accent-weak: rgba(10, 132, 255, 0.16);
    --key-tint: rgba(10, 132, 255, 0.13);

  --c-net: #0a84ff;
  --c-vat: #ff9f0a;
  --c-surtax: #ffd60a;
  --c-pit: #bf5af2;

  --chip: rgba(120, 120, 128, 0.24);
  --chip-hover: rgba(120, 120, 128, 0.36);
  --row-hover: rgba(255, 255, 255, 0.05);

  --shadow-card: 0 1px 1px rgba(0, 0, 0, 0.3), 0 24px 60px -28px rgba(0, 0, 0, 0.9);
  --shadow-thumb: 0 1px 4px rgba(0, 0, 0, 0.6), 0 0 0 0.5px rgba(255, 255, 255, 0.08);

  --nav-bg: rgba(0, 0, 0, 0.68);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

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

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hair);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 52px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.brand:hover { text-decoration: none; }

.brand__mark {
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 7px;
  background: var(--text);
  color: var(--bg);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

.nav__links {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 13px;
}
.nav__links a { color: var(--text-2); }
.nav__links a:hover { color: var(--text); text-decoration: none; }

@media (max-width: 720px) {
  .nav__links { display: none; }
  .hero { padding: 34px 0 22px; }
  .hero__lead { font-size: 15px; }
  .hero__meta { margin-top: 16px; gap: 6px; }
  .tag { font-size: 11.5px; padding: 5px 10px; }
  .section { padding-top: 48px; }
}

@media (max-width: 480px) {
  .chips {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .chip { padding: 7px 2px; text-align: center; font-size: 12px; }
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.2s;
}
.icon-btn:hover { background: var(--chip); color: var(--text); }
.icon-btn svg { display: block; }
.icon-btn .moon { display: none; }
:root[data-theme="dark"] .icon-btn .moon { display: block; }
:root[data-theme="dark"] .icon-btn .sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .moon { display: block; }
  :root:not([data-theme="light"]) .icon-btn .sun { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 76px 0 34px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -50% 0 auto 0;
  height: 620px;
  background: radial-gradient(58% 58% at 50% 30%, var(--accent-weak) 0%, transparent 68%);
  pointer-events: none;
}

.eyebrow {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px 5px 9px;
  margin-bottom: 22px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--hair);
  font-size: 12.5px;
  color: var(--text-2);
  letter-spacing: 0.01em;
}

.eyebrow .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}

.hero h1 {
  position: relative;
  font-size: clamp(34px, 5.6vw, 58px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.06;
  margin-bottom: 20px;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(92deg, var(--accent) 0%, #7b5cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  position: relative;
  max-width: 620px;
  margin: 0 auto;
  font-size: clamp(15px, 1.7vw, 17.5px);
  line-height: 1.65;
  color: var(--text-2);
  text-wrap: pretty;
}

.hero__meta {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 26px;
}

.tag {
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--hair);
  font-size: 12.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

/* ---------- 计算器 ---------- */
.calc-shell { padding: 26px 0 10px; }

.calc {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--hair);
  padding: 10px;
  margin: 0 auto;
}

.calc__bar {
  display: flex;
  justify-content: center;
  padding: 14px 10px 12px;
}

.calc__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr);
  gap: 10px;
  align-items: stretch;
}

.calc__input {
  padding: 20px 26px 24px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.calc__result {
  position: relative;
  display: flex;
  flex-direction: column;
  align-self: start;          /* 贴合内容高度，展开明细时不在面板内留大片空白 */
  background: var(--inset);
  border-radius: var(--radius-pane);
  padding: 24px 26px;
  min-width: 0;
  overflow: hidden;
}

.result__note {
  margin: auto 0 0;
  padding-top: 18px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 860px) {
  .calc__body { grid-template-columns: minmax(0, 1fr); }
  .calc__input { padding: 14px 18px 18px; }
  .calc__result { padding: 20px 18px; }
  .calc { border-radius: 22px; padding: 8px; }
}

/* 分段控件 */
.segmented {
  position: relative;
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--chip);
}

.segmented__thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  bottom: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-thumb);
  transition: transform 0.34s var(--ease);
}

.segmented[data-index="1"] .segmented__thumb { transform: translateX(100%); }

.segmented button {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-width: 116px;
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s;
}
.segmented button[aria-selected="true"] { color: var(--text); font-weight: 600; }
.segmented button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.segmented--sm button { min-width: 0; padding: 6px 14px; font-size: 12.5px; }
.segmented--sm .segmented__thumb { width: calc(100% / var(--count, 3) - 8px / var(--count, 3)); }
.segmented--sm[data-index="0"] .segmented__thumb { transform: translateX(0); }

/* 输入区 */
.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-2);
  margin-bottom: 6px;
}

.money-field {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--hair-strong);
  transition: border-color 0.22s;
}
.money-field:focus-within { border-color: var(--accent); }

.money-field__cur {
  font-size: 26px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: -0.02em;
}

.money-field input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: 0;
  padding: 0;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: clamp(34px, 4.4vw, 46px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  outline: none;
}
.money-field input::placeholder { color: var(--text-3); opacity: 0.5; }

.field-hint {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.5;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.chip {
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--chip);
  color: var(--text-2);
  font-family: inherit;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, transform 0.18s var(--ease);
}
.chip:hover { background: var(--chip-hover); color: var(--text); }
.chip:active { transform: scale(0.96); }
.chip.is-active { background: var(--accent); color: #fff; }

/* 预扣档位指示 */
.bracket {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--hair);
}

.bracket__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.bracket__title {
  font-size: 12.5px;
  color: var(--text-2);
  letter-spacing: 0.02em;
}

.bracket__tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.bracket__track {
  display: flex;
  gap: 3px;
  height: 5px;
}

.bracket__seg {
  flex: 1 1 0;
  border-radius: 3px;
  background: var(--hair-strong);
  transition: background 0.3s var(--ease);
}

.bracket__seg.is-on { background: var(--accent); }
.bracket__seg.is-low { background: var(--accent); opacity: 0.25; }

.bracket__scale {
  display: flex;
  gap: 3px;
  margin-top: 7px;
  font-size: 10.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.bracket__scale span { flex: 1 1 0; text-align: center; }
.bracket__scale span:first-child { text-align: left; }
.bracket__scale span:last-child { text-align: right; }

.bracket__hint {
  margin-top: 9px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* 高级设置 */
.adv {
  margin-top: 6px;
  padding-top: 8px;
}

.adv > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  list-style: none;
  padding: 4px 0;
  transition: color 0.2s;
}
.adv > summary::-webkit-details-marker { display: none; }
.adv > summary:hover { color: var(--text); }
.adv > summary::after {
  content: "";
  width: 6px; height: 6px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.24s var(--ease);
}
.adv[open] > summary::after { transform: rotate(-135deg); margin-top: 3px; }

.adv__panel {
  margin-top: 10px;
  padding: 4px 0;
  border-top: 1px solid var(--hair);
}

.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--hair);
}
.setting:last-child { border-bottom: 0; }

.setting__text { min-width: 0; }
.setting__label { font-size: 13.5px; color: var(--text); }
.setting__hint { font-size: 11.5px; color: var(--text-3); margin-top: 2px; line-height: 1.4; }

.select-wrap { position: relative; flex: 0 0 auto; }

.select-wrap::after {
  content: "";
  position: absolute;
  right: 11px;
  top: 50%;
  width: 6px; height: 6px;
  border-right: 1.4px solid var(--text-3);
  border-bottom: 1.4px solid var(--text-3);
  transform: translateY(-72%) rotate(45deg);
  pointer-events: none;
}

select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 10px;
  background: var(--chip);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  padding: 7px 28px 7px 11px;
  cursor: pointer;
  outline: none;
}
select:focus-visible { box-shadow: 0 0 0 2px var(--accent); }

/* 结果区 */
.result__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-2);
}

.result__value {
  margin-top: 2px;
  font-size: clamp(36px, 4.6vw, 48px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s;
}

.result__value small {
  font-size: 0.42em;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0;
  margin-left: 6px;
}

.result__sub {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* 大数字下方的组成算式：个税后金额 →（减附加税费）→ 到手 */
.result__chain {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.result__chain b {
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.result__sub strong { color: var(--text-2); font-weight: 600; }

/* 堆叠比例条 */
.stacked {
  display: flex;
  gap: 2px;
  height: 9px;
  margin: 20px 0 14px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--hair);
}
.stacked__seg {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s var(--ease);
  min-width: 0;
}
.stacked__seg:first-child { border-radius: 999px 0 0 999px; }
.stacked__seg:last-child { border-radius: 0 999px 999px 0; }
.stacked__seg:only-child { border-radius: 999px; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 16px;
  font-size: 11.5px;
  color: var(--text-3);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i {
  width: 7px; height: 7px;
  border-radius: 2px;
  display: inline-block;
}

/* 瀑布明细 */
.wf {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--hair-strong);
}

.wf li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 13.5px;
}

/* 阶段小计：扣完一道税之后还剩多少，是整条链路的路标 */
.wf li.wf--sum {
  padding: 10px 0;
  border-bottom: 1px solid var(--hair-strong);
  font-size: 14px;
  font-weight: 600;
}

.wf li.wf--sum .wf__k { color: var(--text); }
.wf li.wf--sum .wf__k em { font-weight: 400; }
.wf li.wf--sum .wf__v { color: var(--text); font-weight: 600; }

/* 重点里程碑：个税后金额 —— 多数计算器的「个税后金额」就是它 */
.wf li.wf--key {
  margin: 0 -12px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--key-tint);
  font-size: 15px;
}

/* 最终到手 */
.wf li.wf--total {
  border-bottom: 0;
  padding-top: 15px;
  font-size: 18px;
  font-weight: 600;
}
.wf li.wf--total .wf__k { color: var(--text); }

.wf__k { color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.wf__k i { width: 7px; height: 7px; border-radius: 2px; flex: 0 0 auto; }
.wf__k em { font-style: normal; font-size: 11px; color: var(--text-3); }
.wf__v { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 计算中间量：不是扣款项，用左侧细轨表示「由上一行推算而来」 */
.wf li.wf--calc {
  margin-left: 1px;
  padding: 6px 0 6px 13px;
  border-bottom: 0;
  border-left: 2px solid var(--hair-strong);
  font-size: 12.5px;
}

.wf li.wf--calc .wf__k { color: var(--text-3); }
.wf li.wf--calc .wf__k em { font-size: 10.5px; }
.wf li.wf--calc .wf__v { color: var(--text-2); }

.wf__note {
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
}

/* ---------- 单项复制 ---------- */
.wf li[data-copy] {
  cursor: pointer;
  transition: background 0.16s var(--ease);
}
.wf li[data-copy]:hover { background: var(--row-hover); }
.wf li.wf--key[data-copy]:hover { background: var(--accent-weak); }
.wf li[data-copy]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 6px;
}

/* 复制图标常驻占位，保证各行金额右边缘始终对齐；悬停或复制成功时才显形 */
.wf__copy {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  color: var(--text-3);
  opacity: 0;
  transition: opacity 0.16s var(--ease), color 0.16s var(--ease);
}
.wf__copy svg { width: 11px; height: 11px; display: block; }
.wf li.wf--key .wf__copy svg,
.wf li.wf--total .wf__copy svg { width: 12px; height: 12px; }
.wf li:not([data-copy]) .wf__copy { visibility: hidden; }
.wf li[data-copy]:hover .wf__copy,
.wf li[data-copy]:focus-visible .wf__copy { opacity: 0.7; }
.wf li.is-copied .wf__copy { opacity: 1; color: var(--accent); }

.wf__hint {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--text-3);
  text-align: right;
}
.wf:empty + .wf__hint { display: none; }

/* 主结果同样可点：图标只在悬停时淡入，不打断大数字 */
.result__copy {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  color: var(--text-3);
  opacity: 0;
  vertical-align: 0.3em;
  transition: opacity 0.18s var(--ease), color 0.18s var(--ease);
}
.result__copy svg { width: 17px; height: 17px; display: block; }
.result__value[role="button"] { cursor: pointer; }
.result__value[role="button"]:hover .result__copy { opacity: 0.55; }
.result__value:focus-visible { outline: none; }
.result__value:focus-visible .result__copy { opacity: 0.9; }
.result__value.is-copied .result__copy { opacity: 1; color: var(--accent); }

.wf__copy .ic-check,
.result__copy .ic-check { display: none; }
.is-copied .ic-copy { display: none; }
.is-copied .ic-check { display: block; }

/* 触屏没有 hover，图标常显但压暗，作为可点的暗示 */
@media (hover: none) {
  .wf__copy { opacity: 0.38; }
  .result__copy { opacity: 0.45; }
}

/* 提示条 */
.notice {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--inset-strong);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-2);
}
.notice__icon { flex: 0 0 auto; color: var(--accent); margin-top: 1px; }
.notice b { color: var(--text); font-weight: 600; }

.result__actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.18s var(--ease);
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:active { transform: scale(0.97); }

.btn--ghost {
  background: var(--chip);
  color: var(--text);
}
.btn--ghost:hover { background: var(--chip-hover); }

.btn--wide { width: 100%; padding: 12px 18px; font-size: 14px; }

/* 卡片底部：计算过程 + 操作 */
.calc__foot {
  position: relative;
  padding: 2px 12px 2px 22px;
}

.result__actions {
  position: absolute;
  right: 12px;
  top: 2px;
  display: flex;
  gap: 8px;
  margin-top: 0;
}

@media (max-width: 380px) {
  /* 三段控件在 320px 屏会顶出容器，收紧内边距 */
  .segmented--sm button { padding: 6px 9px; font-size: 12px; }
}

/* 320px 级窄屏：结果面板横向空间不够，收边距并压小辅助说明，避免标签被拆行 */
@media (max-width: 360px) {
  .calc__result { padding: 20px 17px; }
  .wf li { gap: 8px; font-size: 13px; }
  .wf__k em { font-size: 10px; }
  .wf__copy { margin-left: 4px; }
  .wf li.wf--sum { font-size: 13.5px; }
  .wf li.wf--total { font-size: 17px; }
  .result__value { font-size: 36px; }
  /* 推算行的说明文字也改为上下排列，避免标签从中间断开 */
  .wf li.wf--calc .wf__k {
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    line-height: 1.35;
  }
}

@media (max-width: 460px) {
  .calc__foot { padding: 2px 10px 4px 16px; }
  .result__actions {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
  }
  /* 触摸目标不低于 44px */
  .result__actions .btn { padding: 12px 10px; font-size: 13.5px; }
  .steps > summary { padding-right: 0 !important; }

  /* 窄屏放不下「标签 + 说明」并排，改为上下两行，避免标签被挤断 */
  .wf li.wf--key { align-items: center; }
  .wf li.wf--key .wf__k {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    line-height: 1.35;
  }
}

/* 计算过程 */
.steps {
  margin-top: 0;
}

.steps > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 200px 12px 0;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  list-style: none;
}
.steps > summary::-webkit-details-marker { display: none; }
.steps > summary:hover { color: var(--text); }
.steps > summary::after {
  content: "";
  width: 6px; height: 6px;
  margin-left: 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.24s var(--ease);
}
.steps[open] > summary::after { transform: rotate(-135deg); }

.steps__list {
  margin: 0;
  padding: 0 0 14px;
  list-style: none;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  max-width: 640px;
}
.steps__list li {
  display: flex;
  gap: 10px;
  padding: 3px 0;
}
.steps__list .idx {
  flex: 0 0 auto;
  width: 16px;
  color: var(--text-3);
  font-size: 11px;
  padding-top: 1px;
}
.steps__list code {
  font-family: inherit;
  color: var(--text);
}

/* ---------- 通用区块 ---------- */
.section {
  padding: 64px 0 0;
  scroll-margin-top: 72px;
}

.section__head { max-width: 680px; margin-bottom: 34px; }
.section__more { margin-top: 16px; }


.section__eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.section h2 {
  font-size: clamp(24px, 3.2vw, 34px);
  letter-spacing: -0.028em;
  margin-bottom: 12px;
}

.section__desc {
  font-size: 15.5px;
  color: var(--text-2);
  line-height: 1.65;
  text-wrap: pretty;
}

/* 卡片网格 */
.grid {
  display: grid;
  gap: 14px;
}
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 860px) {
  .grid--3, .grid--2 { grid-template-columns: minmax(0, 1fr); }
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--hair);
  border-radius: var(--radius-pane);
  padding: 22px 22px 20px;
}

.card__num {
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: var(--accent-weak);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.card h3 {
  font-size: 15.5px;
  margin-bottom: 8px;
  letter-spacing: -0.015em;
}

.card p {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-2);
}

.card code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  background: var(--chip);
  padding: 1px 5px;
  border-radius: 5px;
  color: var(--text);
}

/* 表格 */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-pane);
  border: 1px solid var(--hair);
  background: var(--bg-elevated);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--hair);
  white-space: nowrap;
  background: transparent;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--hair);
  color: var(--text-2);
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: 0; }
tbody td:first-child { color: var(--text); }
tbody tr:hover td { background: var(--inset); }

.tnum { text-align: right; }

/* 移动端：表格改为卡片式，避免横向裁切
   每行变成一张小卡：首列作标题，其余列用 data-label 生成字段名 */
@media (max-width: 780px) {
  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    border-radius: 0;
  }

  .table-wrap table,
  .table-wrap tbody {
    display: block;
    width: 100%;
  }

  .table-wrap thead { display: none; }

  .table-wrap tbody tr {
    display: block;
    padding: 13px 15px 11px;
    margin-bottom: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--hair);
    border-radius: 12px;
  }
  .table-wrap tbody tr:last-child { margin-bottom: 0; }
  .table-wrap tbody tr:hover td { background: transparent; }

  .table-wrap tbody td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 4px 0;
    border: 0;
    white-space: normal;
    line-height: 1.5;
    font-size: 12.5px;
    color: var(--text-2);
  }

  .table-wrap tbody td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: 11.5px;
    letter-spacing: 0.01em;
    color: var(--text-3);
  }

  /* 首列 = 卡片标题 */
  .table-wrap[data-kind="name"] tbody td:first-child {
    display: block;
    padding: 0 0 8px;
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
  }
  .table-wrap[data-kind="name"] tbody td:first-child::before { content: none; }

  /* 级数表：首列只作序号眉标 */
  .table-wrap[data-kind="level"] tbody td:first-child {
    display: block;
    padding: 0 0 3px;
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--text-3);
  }
  .table-wrap[data-kind="level"] tbody td:first-child::before { content: "第 "; }
  .table-wrap[data-kind="level"] tbody td:first-child::after { content: " 级"; }

  /* 级数表的区间行文字较长，改为上下排列，避免左右挤压换行 */
  .table-wrap[data-kind="level"] tbody td:nth-child(2) {
    display: block;
    padding: 2px 0 8px;
    font-size: 13px;
    color: var(--text);
  }
  .table-wrap[data-kind="level"] tbody td:nth-child(2)::before {
    display: block;
    margin-bottom: 1px;
  }

  /* 说明列：整行脚注 */
  .table-wrap[data-kind="name"] tbody td:last-child {
    display: block;
    margin-top: 7px;
    padding-top: 8px;
    border-top: 1px solid var(--hair);
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--text-3);
  }
  .table-wrap[data-kind="name"] tbody td:last-child::before { content: none; }

  /* 数值列右对齐 */
  .table-wrap[data-kind="level"] tbody td:nth-child(3),
  .table-wrap[data-kind="level"] tbody td:nth-child(4) {
    font-variant-numeric: tabular-nums;
  }
}

/* 临界点卡片 */
.bp-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--hair);
  border-radius: var(--radius-pane);
  overflow: hidden;
  background: var(--bg-elevated);
}

.bp {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) 118px 92px;
  align-items: center;
  gap: 16px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--hair);
  font-size: 13.5px;
}
.bp:last-child { border-bottom: 0; }
.bp:hover { background: var(--inset); }

.bp__amount {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.bp__label { color: var(--text-2); }
.bp__label small { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.bp__net { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.bp__net small { display: block; font-size: 11px; color: var(--text-3); }
.bp__burden {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  font-size: 12.5px;
}

@media (max-width: 780px) {
  .bp {
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    padding: 14px 16px;
  }
  .bp__amount { grid-column: 1; }
  .bp__net { grid-column: 2; grid-row: 1; }
  .bp__label { grid-column: 1 / -1; }
  .bp__burden { grid-column: 2; grid-row: 2; text-align: right; }
  .bp__label small { display: none; }
}

/* 场景示例 */
.case {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.case__title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
.case__meta { font-size: 12px; color: var(--text-3); margin-bottom: 14px; }
.case__row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-top: 1px solid var(--hair);
  font-size: 13px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.case__row:last-child {
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}

/* 年度汇算 */
.settle {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--hair);
  border-radius: var(--radius-card);
  padding: 10px;
}
@media (max-width: 860px) {
  .settle { grid-template-columns: minmax(0, 1fr); }
}

.settle__form { padding: 20px 22px; }

.settle__result {
  background: var(--inset);
  border-radius: var(--radius-pane);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--hair);
}
.field-row:last-child { border-bottom: 0; }
.field-row label { font-size: 13.5px; color: var(--text-2); }

.input-sm {
  width: 132px;
  flex: 0 0 auto;
  border: 1px solid var(--hair-strong);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  padding: 7px 10px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  outline: none;
}
.input-sm:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }

.settle__big {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  margin-top: 2px;
}
.settle__big.is-refund { color: #30a14e; }
.settle__big.is-due { color: #e0483c; }
.settle__big[data-copy] { cursor: pointer; }
.settle__big[data-copy]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }

/* FAQ */
.faq { border-top: 1px solid var(--hair); }

.faq__item {
  border-bottom: 1px solid var(--hair);
}

.faq__item > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 19px 2px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  transition: color 0.2s;
}
.faq__item > summary::-webkit-details-marker { display: none; }
.faq__item > summary:hover { color: var(--accent); }

.faq__item > summary::after {
  content: "+";
  flex: 0 0 auto;
  font-size: 19px;
  font-weight: 300;
  color: var(--text-3);
  transition: transform 0.28s var(--ease), color 0.2s;
  line-height: 1;
}
.faq__item[open] > summary::after { transform: rotate(45deg); color: var(--accent); }

.faq__body {
  padding: 0 2px 20px;
  max-width: 760px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-2);
  text-wrap: pretty;
}
.faq__body p + p { margin-top: 10px; }

/* 政策依据 */
.legal {
  margin-top: 64px;
  padding: 26px 26px 24px;
  border-radius: var(--radius-pane);
  background: var(--inset);
  border: 1px solid var(--hair);
}
.legal h3 {
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--text-2);
  margin-bottom: 12px;
}
.legal ol {
  margin: 0;
  padding-left: 20px;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--text-3);
}
.legal li { margin-bottom: 2px; }

/* 页脚 */
.footer {
  margin-top: 72px;
  padding: 30px 0 46px;
  border-top: 1px solid var(--hair);
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.8;
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: baseline;
  justify-content: space-between;
}
.footer__links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer a { color: var(--text-3); }
.footer a:hover { color: var(--text); }
.footer__disclaimer {
  margin-top: 16px;
  max-width: 760px;
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.7;
}

/* ---------- 免责声明（贴着结果，刻意醒目） ---------- */
.disclaimer {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 18px;
  padding: 12px 15px;
  border-radius: 14px;
  border: 1px solid rgba(255, 149, 0, 0.3);
  background: rgba(255, 149, 0, 0.09);
  color: var(--text);
  font-size: 13px;
  line-height: 1.62;
  text-align: left;
}

.disclaimer__icon {
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  color: #b25c00;
}

.disclaimer strong {
  font-weight: 600;
  color: #8a4700;
}

.disclaimer__text { min-width: 0; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .disclaimer {
    border-color: rgba(255, 159, 10, 0.34);
    background: rgba(255, 159, 10, 0.13);
  }
  :root:not([data-theme="light"]) .disclaimer__icon,
  :root:not([data-theme="light"]) .disclaimer strong {
    color: #ffb340;
  }
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 300;
  transform: translate(-50%, 14px);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s, transform 0.32s var(--ease);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* 更新闪光 */
@keyframes valueFlash {
  0% { opacity: 0.35; }
  100% { opacity: 1; }
}
.is-updating { animation: valueFlash 0.28s ease-out; }

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

/* 打印 */
@media print {
  .nav, .hero__meta, .chips, .result__actions, .adv, .footer__links { display: none; }
  .calc, .card, .settle { box-shadow: none; border-color: #ddd; }
  body { background: #fff; }
}
