:root {
  color-scheme: light;
  --paper: #f3efe6;
  --paper-deep: #e9e2d5;
  --card: #fbf8f1;
  --card-bright: #fffdf8;
  --ink: #1f4335;
  --ink-deep: #17372b;
  --ink-soft: #2e5847;
  --muted: #756f63;
  --muted-soft: #999182;
  --line: #d9d0c1;
  --line-dark: #b9ad9a;
  --orange: #c66a35;
  --orange-deep: #9f4d21;
  --orange-soft: #f3dfd1;
  --error-bg: #f6e2d4;
  --focus: #c66a35;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC",
    "SimSun", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  --radius: 16px;
  --shadow: 0 24px 65px rgba(50, 47, 37, 0.075);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  min-width: 300px;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(1100px 680px at 88% -8%, rgba(198, 106, 53, 0.085), transparent 62%),
    radial-gradient(800px 500px at -8% 40%, rgba(31, 67, 53, 0.045), transparent 70%),
    linear-gradient(rgba(31, 67, 53, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 67, 53, 0.025) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  color: var(--card-bright);
  background: var(--orange);
}

button,
input {
  font: inherit;
}

button,
summary,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--orange-deep);
}

strong {
  font-weight: 650;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  color: var(--card-bright);
  background: var(--ink);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.shell {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 56px) 46px;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0 18px;
  border-bottom: 1px solid var(--line-dark);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-cn {
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.brand-slash {
  color: var(--orange);
  font-weight: 600;
}

.brand-en {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.header-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.header-tools {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 20px;
}

.header-reference {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 5px;
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-bottom: 1px solid rgba(198, 106, 53, 0.42);
  white-space: nowrap;
}

.header-reference::after {
  color: var(--orange);
  font-size: 0.72rem;
  content: "↓";
  transition: transform 160ms ease;
}

.header-reference:hover {
  color: var(--orange-deep);
}

.header-reference:hover::after {
  transform: translateY(2px);
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: clamp(28px, 5vw, 76px);
  align-items: end;
  padding: clamp(46px, 7vw, 90px) 0 clamp(38px, 5vw, 62px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 34px;
  height: 1px;
  background: var(--orange);
  content: "";
}

.hero h1 {
  max-width: 8em;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3rem, 7vw, 6.75rem);
  font-weight: 500;
  line-height: 1.03;
  letter-spacing: -0.055em;
}

.hero h1 span {
  position: relative;
  display: block;
  color: var(--orange-deep);
  white-space: nowrap;
}

.hero h1 span::after {
  position: absolute;
  right: 0.08em;
  bottom: 0.04em;
  left: 0.04em;
  height: 1px;
  background: currentColor;
  opacity: 0.35;
  content: "";
}

.hero-side {
  padding: 0 0 7px clamp(18px, 2.5vw, 34px);
  border-left: 1px solid var(--line-dark);
}

.hero-copy {
  max-width: 34em;
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.94rem, 1.15vw, 1.05rem);
  line-height: 1.9;
}

.hero-copy strong {
  color: var(--ink);
  font-weight: 650;
  white-space: nowrap;
}

.hero-boundary {
  display: flex;
  gap: 8px;
  margin: 20px 0 0;
  color: var(--orange-deep);
  font-size: 0.75rem;
  line-height: 1.7;
}

.hero-boundary span {
  flex: none;
  font-weight: 700;
}

/* Main workspace */
.workspace {
  display: grid;
  grid-template-columns: minmax(330px, 430px) minmax(0, 1fr);
  gap: clamp(20px, 2.7vw, 40px);
  align-items: start;
}

.control-panel {
  position: relative;
  padding: clamp(20px, 2.4vw, 29px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 248, 241, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.control-panel::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ink) 0 64%, var(--orange) 64% 100%);
  content: "";
}

.panel-heading,
.result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.section-index {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  line-height: 1.3;
}

.section-index--light {
  color: rgba(247, 242, 232, 0.55);
}

.panel-heading h2,
.result-heading h2,
.notes-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 2.2vw, 2.1rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.panel-live {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  white-space: nowrap;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(198, 106, 53, 0.1);
}

#fitForm {
  margin-top: 25px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px 13px;
}

.field-row--three {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.field--single {
  max-width: 100%;
  margin-top: 17px;
}

.field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.35;
}

.field-label > span:first-child {
  min-width: 0;
}

.range-hint {
  flex: none;
  color: var(--muted-soft);
  font-size: 0.61rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.input-wrap {
  position: relative;
  display: block;
}

.input-wrap input {
  width: 100%;
  height: 49px;
  padding: 0 43px 0 13px;
  border: 1px solid var(--line-dark);
  border-radius: 9px;
  color: var(--ink);
  background: var(--card-bright);
  font-size: 1.1rem;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease;
  appearance: textfield;
}

.input-wrap input::-webkit-outer-spin-button,
.input-wrap input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.input-wrap input::placeholder {
  color: var(--muted-soft);
  font-size: 0.77rem;
  font-weight: 400;
}

.input-wrap input:hover {
  border-color: var(--ink-soft);
}

.input-wrap input:focus {
  border-color: var(--orange);
  background: #fffefb;
  box-shadow: 0 0 0 3px rgba(198, 106, 53, 0.12);
  outline: none;
}

.input-wrap input[aria-invalid="true"] {
  border-color: var(--orange-deep);
  background: #fff7f2;
}

.input-suffix {
  position: absolute;
  top: 50%;
  right: 12px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  pointer-events: none;
  transform: translateY(-50%);
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.55;
}

/* Collapsible optional settings */
.optional-block {
  margin-top: 21px;
  border-top: 1px solid var(--line);
}

.optional-block summary {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  cursor: pointer;
  list-style: none;
}

.optional-block summary::-webkit-details-marker {
  display: none;
}

.optional-block summary:hover .summary-kicker {
  color: var(--orange-deep);
}

.summary-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.summary-kicker {
  color: var(--ink);
  font-size: 0.79rem;
  font-weight: 650;
  transition: color 150ms ease;
}

.summary-value {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.64rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-toggle {
  position: relative;
  width: 22px;
  height: 22px;
  flex: none;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
}

.summary-toggle::before,
.summary-toggle::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 1px;
  background: var(--ink);
  content: "";
  transform: translate(-50%, -50%);
  transition: transform 160ms ease;
}

.summary-toggle::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

details[open] .summary-toggle {
  border-color: var(--orange);
}

details[open] .summary-toggle::before,
details[open] .summary-toggle::after {
  background: var(--orange-deep);
}

details[open] .summary-toggle::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

.details-body {
  padding: 3px 0 14px;
}

.details-intro {
  margin: 0 0 15px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.7;
}

.micro-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.6;
}

.form-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  margin-top: 24px;
}

.button {
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.015em;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button--primary {
  color: var(--card-bright);
  background: var(--ink);
}

.button--primary:hover {
  background: var(--ink-soft);
}

.button--ghost {
  color: var(--ink);
  border-color: var(--line-dark);
  background: transparent;
}

.button--ghost:hover {
  border-color: var(--ink);
  background: rgba(255, 253, 248, 0.7);
}

.button:disabled,
.button:disabled:hover {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.storage-note {
  margin: 11px 0 0;
  color: var(--muted-soft);
  font-size: 0.62rem;
  line-height: 1.5;
  text-align: center;
}

/* Results */
.result-area {
  min-width: 0;
}

.error-panel {
  padding: 20px 22px;
  border: 1px solid #cf8455;
  border-radius: 12px;
  color: #733716;
  background: var(--error-bg);
}

.error-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.error-list {
  display: grid;
  gap: 3px;
  margin: 9px 0 0;
  padding-left: 1.15em;
  font-size: 0.77rem;
  line-height: 1.65;
}

.noscript-message {
  padding: 18px;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  background: var(--card);
}

.result-heading {
  align-items: end;
  margin-bottom: 18px;
}

.mode-badge {
  margin: 0 0 4px;
  padding: 6px 10px;
  border: 1px solid rgba(31, 67, 53, 0.25);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(251, 248, 241, 0.65);
  font-size: 0.63rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.mode-badge.is-calibrated {
  color: var(--orange-deep);
  border-color: rgba(198, 106, 53, 0.38);
  background: var(--orange-soft);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.metric {
  display: flex;
  min-width: 0;
  min-height: 198px;
  flex-direction: column;
  padding: 17px 17px 16px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--card);
  transition:
    border-color 180ms ease,
    background-color 180ms ease;
}

.metric--chair {
  border-top-color: var(--ink);
}

.metric--footrest {
  border-top-color: var(--ink-soft);
}

.metric--screen {
  border-top-color: var(--orange);
  background: linear-gradient(155deg, #fdf7ee, var(--card) 68%);
}

.metric--warning {
  border-color: #cf8455;
  border-top-color: var(--orange);
  background: var(--error-bg);
}

.metric-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.metric-kicker {
  order: 2;
  margin: 0;
  color: var(--muted-soft);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.metric h3 {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.4;
}

.metric-number {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: auto 0 11px;
  padding-top: 19px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.metric-number strong {
  font-family: var(--serif);
  font-size: clamp(2.45rem, 3.8vw, 3.55rem);
  font-weight: 500;
  letter-spacing: -0.055em;
}

.metric-unit {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 600;
}

.metric-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.55;
}

.metric-note strong {
  color: var(--orange-deep);
}

.alert-stack {
  display: grid;
  gap: 9px;
  margin-top: 13px;
}

.alert {
  position: relative;
  padding: 14px 16px 14px 43px;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  color: var(--ink);
  background: rgba(251, 248, 241, 0.82);
  font-size: 0.74rem;
  line-height: 1.7;
}

.alert::before {
  position: absolute;
  top: 14px;
  left: 15px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1;
  content: "!";
}

.alert strong {
  display: block;
  margin-bottom: 2px;
  font-weight: 700;
}

.alert--danger {
  border-color: #cf8455;
  background: var(--error-bg);
  color: #733716;
}

.adjust-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px 24px;
  align-items: center;
  margin-top: 13px;
  padding: 18px 19px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.adjust-panel[data-direction="raise"],
.adjust-panel[data-direction="lower"] {
  border-color: rgba(198, 106, 53, 0.5);
  background: linear-gradient(120deg, #fdf5ed, var(--card) 72%);
}

.adjust-panel[data-direction="within"] {
  border-color: rgba(31, 67, 53, 0.35);
  background: #edf0e7;
}

.adjust-kicker {
  margin: 0 0 4px;
  color: var(--orange-deep);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.adjust-copy h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.04rem, 1.4vw, 1.3rem);
  font-weight: 600;
  line-height: 1.35;
}

.adjust-copy > p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.55;
}

.adjust-value {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2.3vw, 2.15rem);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-align: right;
  white-space: nowrap;
}

.adjust-value small {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.59rem;
  font-weight: 500;
  letter-spacing: 0;
}

/* Diagram */
.diagram-card {
  margin: 18px 0 0;
  padding: 17px 18px 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
}

.diagram-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 13px;
}

.diagram-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.02rem, 1.35vw, 1.25rem);
  font-weight: 600;
  line-height: 1.3;
}

.diagram-legend {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 7px;
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.61rem;
  white-space: nowrap;
}

.legend-line {
  width: 25px;
  border-top: 2px dashed var(--orange);
}

.diagram-canvas {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(rgba(31, 67, 53, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 67, 53, 0.035) 1px, transparent 1px),
    #f7f3ea;
  background-size: 24px 24px;
}

.diagram-canvas svg {
  display: block;
  width: 100%;
  height: auto;
}

.diagram-foot {
  margin: 10px 0 0;
  color: var(--muted-soft);
  font-size: 0.61rem;
  line-height: 1.55;
}

/* Steps */
.steps-card {
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(30px, 5vw, 76px);
  margin-top: clamp(38px, 5vw, 66px);
  padding: clamp(26px, 4vw, 48px);
  overflow: hidden;
  border-radius: 18px;
  color: #f7f2e8;
  background-color: var(--ink);
  background-image:
    radial-gradient(500px 280px at 100% 0, rgba(198, 106, 53, 0.18), transparent 70%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: auto, 56px 56px;
  box-shadow: 0 24px 55px rgba(31, 67, 53, 0.14);
}

.steps-intro h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.15rem, 3.7vw, 3.6rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.steps-intro > p:last-child {
  max-width: 26em;
  margin: 20px 0 0;
  color: rgba(247, 242, 232, 0.64);
  font-size: 0.77rem;
  line-height: 1.75;
}

.step-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 17px 0;
  border-top: 1px solid rgba(247, 242, 232, 0.16);
}

.step-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.step-item:last-child {
  padding-bottom: 0;
}

.step-check {
  display: grid;
  width: 21px;
  height: 21px;
  flex: none;
  place-content: center;
  margin: 3px 0 0;
  border: 1px solid rgba(247, 242, 232, 0.5);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    border-color 150ms ease;
  appearance: none;
}

.step-check::after {
  width: 8px;
  height: 4px;
  border-bottom: 2px solid var(--ink-deep);
  border-left: 2px solid var(--ink-deep);
  content: "";
  transform: translateY(-1px) rotate(-45deg) scale(0);
  transition: transform 150ms ease;
}

.step-check:hover {
  border-color: var(--orange);
}

.step-check:checked {
  border-color: var(--orange);
  background: var(--orange);
}

.step-check:checked::after {
  transform: translateY(-1px) rotate(-45deg) scale(1);
}

.step-check:focus-visible {
  outline-color: #f2a978;
  outline-offset: 4px;
}

.step-label {
  display: grid;
  min-width: 0;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 4px 7px;
  cursor: pointer;
}

.step-index {
  color: var(--orange);
  font-family: var(--serif);
  font-size: 0.79rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.75;
}

.step-title {
  margin: 0;
  color: #fffaf1;
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.6;
  transition: color 150ms ease;
}

.step-body {
  margin: 2px 0 0;
  grid-column: 2;
  color: rgba(247, 242, 232, 0.66);
  font-size: 0.72rem;
  line-height: 1.72;
}

.step-body strong {
  color: #fff8ec;
  font-weight: 650;
}

.step-item.is-done .step-title,
.step-item.is-done .step-index {
  color: rgba(247, 242, 232, 0.48);
}

.step-item.is-done .step-body {
  color: rgba(247, 242, 232, 0.46);
}

/* Boundaries and references */
.notes-card {
  display: grid;
  grid-template-columns: minmax(230px, 0.55fr) minmax(0, 1.45fr);
  gap: clamp(28px, 5vw, 72px);
  margin-top: clamp(38px, 5vw, 62px);
  padding-top: clamp(26px, 4vw, 40px);
  border-top: 1px solid var(--line-dark);
}

.notes-heading h2 {
  font-size: clamp(1.7rem, 2.8vw, 2.5rem);
}

.notes-heading > p:last-child {
  max-width: 29em;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.75;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.note-item {
  min-width: 0;
}

.note-item h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 0.77rem;
  font-weight: 700;
}

.note-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.71rem;
  line-height: 1.78;
}

.note-item strong {
  color: var(--ink);
}

.references-section {
  scroll-margin-top: 24px;
  margin-top: clamp(38px, 5vw, 62px);
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(640px 320px at 100% 0, rgba(198, 106, 53, 0.06), transparent 72%),
    var(--card);
  box-shadow: var(--shadow);
}

.references-heading {
  max-width: 56rem;
}

.references-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.035em;
}

.references-lede {
  max-width: 48em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.8;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.method-card {
  min-width: 0;
  padding: clamp(18px, 2.4vw, 24px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.72);
}

.method-card--assumption {
  border-color: rgba(198, 106, 53, 0.4);
  background: linear-gradient(140deg, #fdf4eb, var(--card) 76%);
}

.method-kicker {
  margin: 0 0 7px;
  color: var(--orange-deep);
  font-size: 0.59rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.method-card h3 {
  margin: 0 0 13px;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.method-list {
  margin: 0;
  padding-left: 1.1em;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.8;
}

.method-list li + li {
  margin-top: 9px;
}

.method-warning {
  margin: 0 0 15px;
  padding: 12px 14px;
  border-left: 2px solid var(--orange);
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.75;
}

.method-warning strong {
  color: var(--ink);
}

.formula-list {
  display: grid;
  gap: 0;
  margin: 0 0 14px;
  border-top: 1px solid var(--line);
}

.formula-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.formula-list dt {
  color: var(--muted);
  font-size: 0.72rem;
}

.formula-list dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  text-align: right;
}

.formula-list dd span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 400;
}

.method-note {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.71rem;
  line-height: 1.72;
}

.method-note strong {
  color: var(--ink);
}

.method-details {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.55);
}

.method-details summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.method-details summary::-webkit-details-marker {
  display: none;
}

.method-details-body {
  padding: 0 16px 15px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.75;
}

.method-details-body p {
  margin: 0;
}

.method-details-body p + p {
  margin-top: 8px;
}

.reference-list-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 20px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.reference-list-heading h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
}

.reference-list-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.6;
}

.reference-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 15px 0 0;
  padding: 0;
  list-style: none;
}

.reference-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 9px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-bright);
  scroll-margin-top: 24px;
}

.ref-top {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.ref-number {
  flex: none;
  color: var(--orange-deep);
  font-family: var(--serif);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.5;
}

.ref-org {
  margin: 0;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.55;
}

.ref-title-en {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.4;
  word-break: break-word;
}

.ref-support {
  margin: 0;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.75;
}

.ref-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 12px;
  margin: 0;
  color: var(--muted-soft);
  font-size: 0.61rem;
  line-height: 1.55;
}

.ref-link {
  display: flex;
  min-height: 44px;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 7px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 650;
  overflow-wrap: anywhere;
  text-decoration: none;
  word-break: break-word;
}

.ref-link::after {
  color: var(--orange);
  font-size: 0.72rem;
  content: "↗";
}

.ref-link:hover {
  color: var(--orange-deep);
}

.ref-url {
  display: block;
  width: 100%;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.ref-link:hover .ref-url {
  color: var(--orange-deep);
}

.cite {
  display: inline-block;
  margin: 0 1px;
  padding: 0 2px;
  border-bottom: 1px solid rgba(198, 106, 53, 0.35);
  color: var(--orange-deep);
  font-size: 0.72em;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  vertical-align: baseline;
}

.cite:hover {
  background: var(--orange-soft);
}

.references-note {
  margin: 18px 0 0;
  color: var(--muted-soft);
  font-size: 0.62rem;
  line-height: 1.6;
}

.site-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-top: clamp(36px, 5vw, 58px);
  padding-top: 20px;
  border-top: 1px solid var(--line-dark);
  color: var(--muted-soft);
  font-size: 0.63rem;
  line-height: 1.6;
}

.site-footer p {
  margin: 0;
}

.footer-brand {
  color: var(--muted);
  font-weight: 650;
  letter-spacing: 0.04em;
}

/* Responsive */
@media (max-width: 1080px) {
  .hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  }

  .workspace {
    grid-template-columns: minmax(310px, 390px) minmax(0, 1fr);
  }

  .metric {
    min-height: 188px;
    padding: 15px 14px;
  }

  .metric-number strong {
    font-size: clamp(2.2rem, 3.3vw, 3rem);
  }

  .steps-card {
    gap: 36px;
  }
}

@media (max-width: 940px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding-top: 48px;
  }

  .hero h1 {
    max-width: none;
  }

  .hero-side {
    max-width: 560px;
    padding: 0 0 0 18px;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .control-panel {
    max-width: none;
  }

  #fitForm {
    margin-top: 22px;
  }

  .form-actions {
    max-width: 390px;
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .steps-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .steps-intro > p:last-child {
    max-width: 38em;
  }

  .notes-card {
    grid-template-columns: minmax(0, 1fr);
  }

}

@media (max-width: 720px) {
  .shell {
    padding-bottom: 34px;
  }

  .site-header {
    padding-top: 18px;
  }

  .header-meta {
    display: none;
  }

  .header-tools {
    gap: 0;
  }

  .header-reference {
    font-size: 0.62rem;
  }

  .method-grid,
  .reference-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .reference-list-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-cn {
    font-size: 1.1rem;
  }

  .brand-en {
    font-size: 0.64rem;
  }

  .hero {
    padding: 38px 0 36px;
  }

  .eyebrow {
    margin-bottom: 16px;
  }

  .hero h1 {
    font-size: clamp(2.7rem, 12.6vw, 4.4rem);
    line-height: 1.05;
  }

  .hero-copy {
    font-size: 0.9rem;
    line-height: 1.82;
  }

  .metric-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .metric {
    min-height: 0;
  }

  .metric-number {
    margin: 14px 0 10px;
    padding-top: 0;
  }

  .metric-number strong {
    font-size: 3rem;
  }

  .diagram-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .diagram-legend {
    margin: 0;
  }

  .steps-card {
    border-radius: 14px;
  }

  .steps-intro h2 {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }

  .notes-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .note-item {
    padding-top: 15px;
    border-top: 1px solid var(--line);
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

@media (max-width: 560px) {
  .field-row,
  .field-row--three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px 10px;
  }

  .field-label {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 1px;
  }

  .range-hint {
    font-size: 0.57rem;
  }

  .input-wrap input {
    height: 48px;
    padding-left: 11px;
    padding-right: 36px;
    font-size: 16px;
  }

  .input-suffix {
    right: 9px;
    font-size: 0.58rem;
  }

  .field-hint {
    font-size: 0.62rem;
  }

  .form-actions {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .adjust-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .adjust-value {
    text-align: left;
  }

  .diagram-card {
    padding: 15px 10px 12px;
  }

  .step-item {
    gap: 11px;
  }

  .step-label {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 2px 4px;
  }

  .step-title {
    font-size: 0.83rem;
  }

  .step-body {
    font-size: 0.69rem;
  }

  .steps-card {
    padding: 23px 18px;
  }

  .references-section {
    padding: 22px 16px;
    border-radius: 14px;
  }

  .method-card,
  .reference-card {
    padding: 16px 14px;
  }

  .ref-title-en {
    font-size: 0.92rem;
  }

  .formula-list > div {
    gap: 10px;
  }

  .method-details summary,
  .method-details-body {
    padding-right: 13px;
    padding-left: 13px;
  }

  .references-note {
    font-size: 0.59rem;
  }
}

@media (max-width: 390px) {
  .shell {
    padding-right: 15px;
    padding-left: 15px;
  }

  .brand {
    gap: 7px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
    font-size: 0.65rem;
  }

  .brand-slash {
    display: none;
  }

  .hero h1 {
    font-size: clamp(2.45rem, 12.3vw, 3.1rem);
  }

  .hero h1 span {
    white-space: normal;
  }

  .hero-side {
    padding-left: 14px;
  }

  .control-panel {
    padding: 19px 15px;
  }

  .summary-value {
    max-width: 215px;
  }

  .metric {
    padding: 16px;
  }

  .button {
    padding-right: 13px;
    padding-left: 13px;
    font-size: 0.73rem;
  }

  .diagram-foot {
    font-size: 0.58rem;
  }
}

@media (max-width: 330px) {
  .field-row,
  .field-row--three {
    grid-template-columns: minmax(0, 1fr);
  }

  .brand-cn {
    font-size: 1rem;
  }

  .brand-en {
    font-size: 0.58rem;
  }

  .metric-number strong {
    font-size: 2.7rem;
  }
}

/* Print */
@media print {
  :root {
    --paper: #fff;
    --card: #fff;
    --card-bright: #fff;
    --line: #ccc;
    --line-dark: #999;
  }

  html {
    scroll-behavior: auto;
  }

  body {
    color: #111;
    background: #fff;
    font-size: 10pt;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .shell {
    max-width: none;
    padding: 0;
  }

  .skip-link,
  .no-print,
  .form-actions,
  .storage-note,
  .header-reference,
  .header-meta {
    display: none !important;
  }

  .site-header {
    padding: 0 0 8px;
  }

  .brand-mark {
    width: 27px;
    height: 27px;
  }

  .hero {
    display: block;
    padding: 16px 0 14px;
  }

  .hero h1 {
    max-width: none;
    font-size: 30pt;
    line-height: 1.1;
  }

  .hero h1 span {
    display: inline;
  }

  .hero h1 span::after {
    display: none;
  }

  .hero-side {
    padding: 9px 0 0;
    border-left: 0;
  }

  .hero-copy {
    max-width: none;
    font-size: 9pt;
    line-height: 1.6;
  }

  .hero-boundary {
    margin-top: 4px;
    font-size: 8pt;
  }

  .eyebrow,
  .panel-live,
  .section-index,
  .summary-toggle {
    display: none;
  }

  .workspace {
    display: block;
  }

  .control-panel {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    box-shadow: none;
    backdrop-filter: none;
  }

  .control-panel::before {
    display: none;
  }

  .panel-heading h2,
  .result-heading h2,
  .notes-heading h2,
  .references-heading h2 {
    font-size: 15pt;
  }

  #fitForm {
    margin-top: 10px;
  }

  .field-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .field-row--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .field-hint,
  .micro-note,
  .details-intro {
    display: none;
  }

  .input-wrap input {
    height: 30px;
    border: 1px solid #bbb;
    background: #fff;
    font-size: 10pt;
  }

  .optional-block {
    margin-top: 8px;
  }

  .optional-block summary {
    min-height: 0;
    padding: 6px 0;
  }

  .summary-kicker {
    font-size: 8pt;
  }

  .summary-value {
    font-size: 7.5pt;
  }

  .details-body {
    padding: 3px 0 5px;
  }

  .result-area {
    margin-top: 12px;
  }

  .result-heading {
    margin-bottom: 8px;
  }

  .mode-badge {
    padding: 2px 8px;
    font-size: 7.5pt;
  }

  .metric-grid {
    gap: 7px;
  }

  .metric {
    min-height: 0;
    padding: 9px;
    border: 1px solid #ccc;
    border-top: 2px solid #244737;
    border-radius: 5px;
    background: #fff;
  }

  .metric-number {
    margin: 7px 0 5px;
    padding-top: 0;
  }

  .metric-number strong {
    font-size: 22pt;
  }

  .metric-note,
  .alert,
  .adjust-copy > p:last-child,
  .diagram-foot {
    font-size: 7.5pt;
  }

  .alert {
    padding: 7px 9px 7px 28px;
    border-radius: 4px;
  }

  .alert::before {
    top: 7px;
    left: 9px;
    width: 13px;
    height: 13px;
    font-size: 7pt;
  }

  .adjust-panel {
    margin-top: 7px;
    padding: 8px 10px;
    border-radius: 5px;
  }

  .adjust-copy h3 {
    font-size: 10pt;
  }

  .adjust-value {
    font-size: 16pt;
  }

  .diagram-card {
    margin-top: 8px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    break-inside: avoid;
    background: #fff;
  }

  .diagram-head {
    padding-bottom: 5px;
  }

  .diagram-head h3 {
    font-size: 10pt;
  }

  .diagram-canvas {
    background: #fff;
  }

  .diagram-canvas svg {
    max-height: 260px;
  }

  .diagram-legend {
    font-size: 7pt;
  }

  .steps-card {
    margin-top: 15px;
    padding: 14px 16px;
    color: #111;
    border: 1px solid #bbb;
    border-radius: 6px;
    background: #fff;
    box-shadow: none;
    break-inside: avoid;
  }

  .steps-intro h2,
  .step-title,
  .step-body,
  .step-body strong,
  .step-index {
    color: #111;
  }

  .steps-intro > p:last-child,
  .step-body {
    font-size: 8pt;
  }

  .step-item {
    padding: 6px 0;
    border-top-color: #ddd;
  }

  .step-item.is-done .step-title,
  .step-item.is-done .step-body,
  .step-item.is-done .step-index {
    color: #555;
  }

  .step-check {
    border-color: #777;
  }

  .step-check:checked {
    border-color: #c66a35;
    background: #c66a35;
  }

  .notes-card {
    display: block;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #ccc;
    break-inside: avoid;
  }

  .notes-heading > p:last-child,
  .note-item p,
  .references-lede,
  .method-list,
  .method-warning,
  .method-note,
  .ref-org,
  .ref-support,
  .ref-meta,
  .ref-link,
  .references-note {
    font-size: 7.5pt;
  }

  .notes-grid {
    gap: 12px;
    margin-top: 8px;
  }

  .references-section {
    margin-top: 15px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    box-shadow: none;
  }

  .references-lede {
    margin-top: 5px;
  }

  .method-grid {
    gap: 8px;
    margin-top: 8px;
  }

  .method-card,
  .reference-card {
    padding: 8px;
    border: 1px solid #ccc;
    background: #fff;
    break-inside: avoid;
  }

  .method-card h3,
  .reference-list-heading h3 {
    font-size: 10pt;
  }

  .method-details {
    display: none;
  }

  .formula-list > div {
    padding: 4px 0;
  }

  .reference-list-heading {
    margin-top: 10px;
    padding-top: 8px;
  }

  .reference-list {
    gap: 8px;
    margin-top: 8px;
  }

  .ref-title-en {
    font-size: 9pt;
  }

  .ref-link {
    min-height: 0;
    padding-top: 4px;
  }

  .ref-url {
    font-size: 6.5pt;
  }

  .site-footer {
    margin-top: 14px;
    padding-top: 8px;
    border-top: 1px solid #ccc;
    font-size: 7pt;
  }
}
