:root {
  --ink: #14282d;
  --muted: #526a70;
  --teal-950: #082f36;
  --teal-900: #0c3d46;
  --teal-800: #12515a;
  --teal-700: #176873;
  --teal-100: #dcecef;
  --teal-50: #eff7f7;
  --sand: #f3ead9;
  --sand-strong: #d8b775;
  --blue: #2e6391;
  --paper: #fffefb;
  --surface: #f5f7f5;
  --line: #d8e0dd;
  --warning: #8a4f10;
  --warning-bg: #fff5df;
  --danger: #a0382e;
  --danger-bg: #fff0ed;
  --shadow: 0 20px 50px rgba(8, 47, 54, 0.09);
  --radius-lg: 28px;
  --radius-md: 18px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(216, 183, 117, 0.13), transparent 24rem),
    var(--paper);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  line-height: 1.68;
}
a { color: inherit; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 16px;
  color: #fff;
  background: var(--teal-900);
  border-radius: 8px;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  width: min(calc(100% - 40px), var(--max));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 1px solid rgba(20, 40, 45, 0.12);
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--teal-900);
  font-weight: 800;
  letter-spacing: -0.04em;
}
.brand strong, .brand small { display: block; line-height: 1.25; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; letter-spacing: 0.03em; }
.site-header nav { display: flex; gap: 24px; }
.site-header nav a { color: var(--muted); font-size: 14px; text-decoration: none; }
.site-header nav a:hover, .site-header nav a:focus-visible { color: var(--teal-800); }

.hero {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
  padding: 88px 0 76px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.7fr);
  gap: 68px;
  align-items: center;
}
.eyebrow, .section-heading > span, .document-kicker {
  margin: 0 0 12px;
  color: var(--teal-700);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  max-width: 820px;
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
  font-size: clamp(40px, 5.3vw, 70px);
  line-height: 1.14;
  letter-spacing: -0.035em;
  font-weight: 700;
}
.hero-lead { max-width: 780px; margin: 28px 0 0; color: var(--muted); font-size: 17px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: 1px solid var(--teal-800);
  border-radius: 999px;
  color: var(--teal-900);
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(8, 47, 54, 0.12); }
.button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid rgba(46, 99, 145, 0.36);
  outline-offset: 3px;
}
.button-primary { color: #fff; background: var(--teal-900); }
.button-secondary { background: transparent; }
.button-quiet { color: var(--muted); border-color: var(--line); }
.privacy-line { margin: 17px 0 0; color: var(--muted); font-size: 13px; }
.privacy-line span { color: #2b8a72; }

.hero-proof {
  position: relative;
  padding: 30px;
  color: #eefafa;
  background: linear-gradient(145deg, var(--teal-950), var(--teal-800));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-proof::after {
  content: "N";
  position: absolute;
  right: -22px;
  top: -64px;
  color: rgba(255,255,255,0.04);
  font: 700 210px/1 Georgia, serif;
}
.proof-label { display: block; color: #acd0d3; font-size: 12px; font-weight: 800; letter-spacing: 0.12em; }
.hero-proof > strong { display: inline-block; margin-top: 12px; font: 700 60px/1 Georgia, serif; }
.hero-proof > em { margin-left: 8px; color: #c4dde0; font-style: normal; }
.hero-proof dl { margin: 24px 0 0; border-top: 1px solid rgba(255,255,255,0.17); }
.hero-proof dl div { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid rgba(255,255,255,0.12); }
.hero-proof dt { color: #c9dddf; font-size: 13px; }
.hero-proof dd { margin: 0; font-weight: 700; text-align: right; }
.hero-proof p { margin: 18px 0 0; color: #c9dddf; font-size: 13px; }

.section-shell { width: min(calc(100% - 40px), var(--max)); margin: 0 auto; padding: 78px 0; }
.section-heading { max-width: 850px; margin-bottom: 34px; }
.section-heading h2 { margin: 0; font: 700 clamp(29px, 3.5vw, 44px)/1.25 "Noto Serif SC", "Songti SC", SimSun, serif; letter-spacing: -0.02em; }
.section-heading > p { margin: 15px 0 0; color: var(--muted); }

.clarification { border-top: 1px solid var(--line); }
.clarification-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.clarification-grid article {
  padding: 26px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
}
.clarification-grid article:nth-child(2) { background: #f0f5f9; }
.clarification-grid article:nth-child(3) { background: var(--teal-50); }
.layer-tag { display: inline-block; padding: 3px 9px; color: #775620; background: var(--sand); border-radius: 999px; font-size: 11px; font-weight: 800; }
.layer-tag-science { color: #2e5d7c; background: #ddebf5; }
.layer-tag-tech { color: var(--teal-800); background: var(--teal-100); }
.clarification-grid h3 { margin: 18px 0 10px; font-size: 19px; line-height: 1.4; }
.clarification-grid p { margin: 0; color: var(--muted); font-size: 14px; }
.boundary-callout { display: grid; grid-template-columns: 150px 1fr; gap: 22px; margin-top: 20px; padding: 22px 26px; border: 1px solid #e4c88d; border-left: 5px solid var(--sand-strong); background: #fffaf0; border-radius: 12px; }
.boundary-callout strong { color: #775620; }
.boundary-callout p { margin: 0; color: #65563e; }

.method { border-top: 1px solid var(--line); }
.formula-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.formula-flow article { min-width: 0; padding: 25px; background: #fff; }
.formula-flow b { display: grid; width: 30px; height: 30px; place-items: center; color: #fff; background: var(--teal-800); border-radius: 50%; font-size: 13px; }
.formula-flow span { display: block; margin-top: 16px; font-weight: 800; }
.formula-flow code { display: block; min-height: 70px; margin: 13px -8px 0; padding: 13px 8px; color: var(--teal-900); background: var(--teal-50); border-radius: 8px; font: 600 14px/1.55 Consolas, "Microsoft YaHei", sans-serif; overflow-wrap: anywhere; }
.formula-flow p { margin: 12px 0 0; color: var(--muted); font-size: 12px; }

.calculator { width: 100%; max-width: none; padding: 84px max(20px, calc((100% - var(--max)) / 2)); background: #edf3f2; }
.calculator-heading { max-width: var(--max); display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; }
.local-badge { flex: 0 0 auto; margin-bottom: 8px; padding: 7px 12px; color: #256a59; background: #e1f2eb; border: 1px solid #bfdfd2; border-radius: 999px; font-size: 12px; font-weight: 800; }
.calculator-grid { width: min(100%, var(--max)); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr); gap: 22px; align-items: start; }
.input-panel, .result-panel { background: #fff; border: 1px solid #d5e0dd; border-radius: var(--radius-lg); box-shadow: 0 14px 30px rgba(8,47,54,0.06); }
.input-panel { padding: 30px; }
.basis-fieldset { margin: 0; padding: 0 0 26px; border: 0; border-bottom: 1px solid var(--line); }
.basis-fieldset legend { margin-bottom: 12px; font-weight: 800; }
.basis-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.basis-options label { position: relative; cursor: pointer; }
.basis-options input { position: absolute; opacity: 0; pointer-events: none; }
.basis-options span { display: block; padding: 15px 17px; border: 1px solid var(--line); border-radius: 12px; transition: 0.16s ease; }
.basis-options strong, .basis-options small { display: block; }
.basis-options small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.basis-options input:checked + span { border-color: var(--teal-700); background: var(--teal-50); box-shadow: inset 0 0 0 1px var(--teal-700); }
.basis-options input:focus-visible + span { outline: 3px solid rgba(46,99,145,0.32); outline-offset: 2px; }
.input-group { padding-top: 25px; }
.group-title { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.group-title span { font-weight: 800; }
.group-title small { color: var(--muted); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-span-2 { grid-column: span 2; }
.field > span:first-child { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; }
.field em { color: var(--danger); font-style: normal; }
.field small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.number-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border: 1px solid #bdccca; border-radius: 10px; background: #fff; overflow: hidden; }
.number-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,99,145,0.13); }
.number-input input { width: 100%; min-width: 0; height: 45px; padding: 8px 10px; border: 0; outline: 0; }
.number-input b { padding: 0 10px; color: var(--muted); font-size: 11px; white-space: nowrap; }
select { width: 100%; height: 47px; padding: 8px 36px 8px 10px; color: var(--ink); background: #fff; border: 1px solid #bdccca; border-radius: 10px; }
.form-errors { margin-top: 22px; padding: 12px 15px; color: var(--danger); background: var(--danger-bg); border: 1px solid #e9bbb5; border-radius: 10px; font-size: 13px; }
.form-errors ul, .result-warnings ul { margin: 0; padding-left: 20px; }
.form-actions { display: flex; gap: 10px; margin-top: 26px; }

.result-panel { position: sticky; top: 18px; min-height: 520px; overflow: hidden; }
.empty-result { display: grid; min-height: 520px; place-items: center; align-content: center; padding: 40px; text-align: center; }
.empty-result > span { display: grid; width: 72px; height: 72px; place-items: center; color: var(--teal-700); background: var(--teal-50); border-radius: 50%; font: 700 30px/1 Georgia, serif; }
.empty-result h3 { margin: 20px 0 6px; font-size: 24px; }
.empty-result p { max-width: 360px; margin: 0; color: var(--muted); }
#calculation-result { padding: 26px; }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.result-head span { color: #2c7865; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; }
.result-head h3 { margin: 2px 0 0; font-size: 26px; }
.copy-button { padding: 7px 11px; color: var(--teal-800); background: var(--teal-50); border: 1px solid var(--teal-100); border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 800; }
.result-metrics { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 22px; }
.result-metrics article { min-width: 0; padding: 14px; background: #f7f9f8; border: 1px solid #e4e9e7; border-radius: 12px; }
.result-metrics article span { display: block; min-height: 40px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.result-metrics article strong { display: inline-block; margin-top: 8px; font: 700 25px/1 Georgia, serif; overflow-wrap: anywhere; }
.result-metrics article small { margin-left: 4px; color: var(--muted); font-size: 10px; }
.result-metrics .metric-standard { background: #f5f7fa; border-color: #dfe6ed; }
.result-metrics .metric-corrected { background: var(--teal-50); border-color: #cfe3e3; }
.result-warnings { margin-top: 16px; padding: 13px 14px; color: var(--warning); background: var(--warning-bg); border: 1px solid #eed5a1; border-radius: 10px; font-size: 12px; }
.calculation-trace { margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.calculation-trace summary { cursor: pointer; font-weight: 800; }
.calculation-trace ol { margin: 13px 0 0; padding-left: 21px; color: var(--muted); font: 12px/1.65 Consolas, "Microsoft YaHei", sans-serif; }
.calculation-trace li + li { margin-top: 6px; }
.result-boundary { margin: 18px 0 0; padding: 12px; color: var(--muted); background: #f7f7f3; border-radius: 9px; font-size: 11px; }

.lab-data { border-bottom: 1px solid var(--line); }
.checklist-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 34px; }
.checklist-grid article { padding-top: 17px; border-top: 2px solid var(--teal-100); }
.checklist-grid b { color: var(--teal-700); font: 700 12px/1 Georgia, serif; }
.checklist-grid strong { display: block; margin-top: 7px; font-size: 17px; }
.checklist-grid p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }

.download { padding-top: 90px; padding-bottom: 90px; }
.download-card { display: grid; grid-template-columns: minmax(0,1fr) minmax(360px,520px); gap: 32px; align-items: center; padding: 48px; color: #eef8f8; background: linear-gradient(135deg, var(--teal-950), #174e55); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.download-card h2 { max-width: 720px; margin: 8px 0 15px; font: 700 clamp(28px,3.5vw,42px)/1.25 "Noto Serif SC", "Songti SC", SimSun, serif; }
.download-card p { margin: 0; color: #c9dcde; }
.download-card ul { margin: 18px 0 0; padding-left: 20px; color: #c9dcde; font-size: 13px; }
.document-kicker { color: #c9ae72; }
.document-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.document-action { display: grid; justify-items: center; gap: 12px; padding: 22px 16px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.14); border-radius: 18px; text-align: center; }
.doc-icon { display: grid; width: 56px; height: 68px; place-items: center; color: var(--teal-900); background: #fff; border-radius: 5px 14px 5px 5px; font: 800 25px/1 Georgia, serif; }
.doc-icon-pdf { font-size: 15px; letter-spacing: .04em; }
.document-action .button { width: 100%; color: var(--teal-900); background: #fff; border-color: #fff; }
.document-action small { color: #bcd1d3; }

.evidence { border-top: 1px solid var(--line); }
.evidence-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.evidence-grid article { padding: 25px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.evidence-grid article > span { color: var(--teal-700); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; }
.evidence-grid h3 { margin: 8px 0; font-size: 18px; }
.evidence-grid p { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.evidence-grid a { color: var(--teal-700); font-size: 12px; font-weight: 800; text-underline-offset: 3px; }
.link-row { display: flex; gap: 18px; }
.version-line { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 18px; color: var(--muted); font-size: 12px; }

.site-footer { width: min(calc(100% - 40px), var(--max)); margin: 0 auto; padding: 34px 0 42px; display: grid; grid-template-columns: 1fr auto; gap: 14px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.site-footer strong, .site-footer span { display: block; }
.site-footer strong { color: var(--ink); font-size: 14px; }
.footer-links, .filings { display: flex; flex-wrap: wrap; gap: 16px; justify-content: flex-end; }
.site-footer a { text-underline-offset: 3px; }
.filings { grid-column: 1 / -1; }

.toast { position: fixed; z-index: 90; left: 50%; bottom: 24px; max-width: min(90vw, 420px); padding: 10px 16px; color: #fff; background: var(--teal-950); border-radius: 999px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translate(-50%, 20px); transition: 0.2s ease; font-size: 13px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; gap: 38px; padding-top: 62px; }
  .hero-proof { max-width: 620px; }
  .formula-flow { grid-template-columns: repeat(2, 1fr); }
  .calculator-grid { grid-template-columns: 1fr; }
  .result-panel { position: static; min-height: 0; }
  .empty-result { min-height: 320px; }
  .checklist-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .site-header { width: min(calc(100% - 28px), var(--max)); min-height: 68px; }
  .site-header nav { display: none; }
  .brand-mark { width: 38px; height: 38px; }
  .hero, .section-shell { width: min(calc(100% - 28px), var(--max)); }
  .hero { padding: 50px 0 58px; }
  .hero h1 { font-size: clamp(35px, 10.6vw, 50px); }
  .hero-lead { font-size: 15px; }
  .hero-actions { display: grid; }
  .hero-actions .button { width: 100%; }
  .hero-proof { padding: 23px; }
  .hero-proof > strong { font-size: 48px; }
  .section-shell { padding: 58px 0; }
  .clarification-grid, .formula-flow, .checklist-grid, .evidence-grid { grid-template-columns: 1fr; }
  .boundary-callout { grid-template-columns: 1fr; gap: 5px; }
  .calculator { width: 100%; padding: 58px 14px; }
  .calculator-heading { display: block; }
  .local-badge { display: inline-block; margin-top: 14px; }
  .input-panel { padding: 19px; border-radius: 20px; }
  .basis-options, .field-grid, .field-grid-3 { grid-template-columns: 1fr; }
  .field-span-2 { grid-column: auto; }
  .group-title { display: block; }
  .group-title small { display: block; margin-top: 2px; }
  .form-actions { display: grid; }
  .result-panel { border-radius: 20px; }
  #calculation-result { padding: 19px; }
  .result-metrics { grid-template-columns: 1fr; }
  .result-metrics article span { min-height: 0; }
  .download-card { grid-template-columns: 1fr; gap: 25px; padding: 28px 22px; }
  .document-actions { grid-template-columns: 1fr; }
  .document-action { padding: 20px; }
  .evidence-grid { border-top: 0; }
  .site-footer { width: min(calc(100% - 28px), var(--max)); grid-template-columns: 1fr; }
  .footer-links, .filings { justify-content: flex-start; }
  .filings { grid-column: auto; }
}

@media print {
  .site-header, .hero-actions, .calculator, .download, .footer-links, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .hero, .section-shell { width: 100%; padding: 24px 0; }
  .hero { grid-template-columns: 1fr; }
  .hero-proof { color: #000; background: #fff; border: 1px solid #bbb; box-shadow: none; }
  .hero-proof dt, .hero-proof p { color: #333; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
