:root {
  color-scheme: light;
  --navy-950: #0b2630;
  --navy-900: #10343e;
  --teal-700: #0f766e;
  --teal-600: #0d9488;
  --teal-100: #ccfbf1;
  --teal-50: #f0fdfa;
  --gold-500: #d9a441;
  --gold-100: #f8e8bd;
  --ink: #15343b;
  --muted: #60767a;
  --line: #d8e4e3;
  --paper: #ffffff;
  --surface: #f4f8f7;
  --danger: #b42318;
  --shadow: 0 18px 48px rgba(13, 57, 63, .1);
  font-family: Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 4%, rgba(204, 251, 241, .85), transparent 30rem),
    linear-gradient(180deg, #fbfdfc 0%, #f4f8f7 55%, #eef5f3 100%);
  color: var(--ink);
  line-height: 1.65;
}

button, input { font: inherit; }

a { color: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  transform: translateY(-160%);
  border-radius: 8px;
  background: var(--navy-950);
  color: #fff;
  padding: 9px 14px;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px clamp(18px, 4vw, 56px);
}

.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: 14px;
  background: var(--navy-900);
  color: var(--gold-100);
  font-family: Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.brand strong, .brand small { display: block; }
.brand strong { color: var(--navy-950); line-height: 1.2; }
.brand small { margin-top: 2px; color: var(--muted); font-size: .72rem; letter-spacing: .08em; }

.back-link {
  border-bottom: 1px solid currentColor;
  color: var(--teal-700);
  font-size: .9rem;
  font-weight: 800;
  text-decoration: none;
}

main {
  width: min(1220px, calc(100% - 36px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .7fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: end;
  padding: clamp(52px, 8vw, 100px) 0 clamp(48px, 7vw, 84px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal-700);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 820px;
  margin-bottom: 22px;
  color: var(--navy-950);
  font-family: Georgia, "Noto Serif TC", serif;
  font-size: clamp(2.65rem, 6.3vw, 5.75rem);
  font-weight: 650;
  letter-spacing: -.05em;
  line-height: .98;
}

.hero-lead {
  max-width: 720px;
  margin-bottom: 28px;
  color: #456167;
  font-size: clamp(1rem, 1.5vw, 1.16rem);
}

.hero-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.hero-tags span, .live-badge {
  border: 1px solid rgba(15, 118, 110, .2);
  border-radius: 999px;
  background: rgba(255, 255, 255, .74);
  color: var(--teal-700);
  padding: 6px 11px;
  font-size: .78rem;
  font-weight: 850;
}

.hero-note {
  display: flex;
  gap: 18px;
  border-top: 1px solid var(--teal-700);
  padding-top: 22px;
}

.hero-note .note-number {
  color: var(--gold-500);
  font-family: Georgia, serif;
  font-size: 2.2rem;
  line-height: 1;
}

.hero-note strong { color: var(--navy-950); font-size: 1.02rem; }
.hero-note p { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr);
  gap: 28px;
  align-items: start;
  padding-bottom: 78px;
}

.question-panel, .result-panel {
  border: 1px solid rgba(16, 52, 62, .1);
  border-radius: 28px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
}

.question-panel { padding: clamp(22px, 3vw, 38px); }
.section-heading h2, .result-header h2, .source-section h2 {
  margin-bottom: 6px;
  color: var(--navy-950);
  font-family: Georgia, "Noto Serif TC", serif;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.15;
}
.section-heading > p:last-child { margin-bottom: 0; color: var(--muted); }

.question-card {
  margin: 24px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 24px 0 0;
}

.question-card legend {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 0 0 17px;
  color: var(--navy-950);
  font-size: 1.04rem;
  font-weight: 850;
}

.question-card legend span {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--teal-700);
  color: #fff;
  font-size: .84rem;
}

.paired-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.question-card label { display: grid; gap: 7px; color: #416069; font-size: .86rem; font-weight: 750; }

.input-with-unit {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #c8d9d6;
  border-radius: 13px;
  background: #fbfdfd;
  padding: 2px 12px;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.input-with-unit:focus-within {
  border-color: var(--teal-600);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, .12);
}

.input-with-unit input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--navy-950);
  padding: 10px 0;
  font-size: 1.08rem;
  font-weight: 850;
}

.input-with-unit em { color: var(--muted); font-size: .82rem; font-style: normal; font-weight: 750; white-space: nowrap; }
.input-wide { max-width: 360px; }
.input-with-unit:has(input[aria-invalid="true"]) { border-color: var(--danger); }

.field-help { margin: 8px 0 0; color: var(--muted); font-size: .8rem; }
.quick-values { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.quick-values button {
  border: 1px solid #c5d9d5;
  border-radius: 999px;
  background: #fff;
  color: var(--teal-700);
  padding: 6px 12px;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 800;
}
.quick-values button[aria-pressed="true"] { border-color: var(--teal-700); background: var(--teal-50); }

.form-error {
  margin: 18px 0 0;
  border-left: 4px solid var(--danger);
  background: #fff3f1;
  color: var(--danger);
  padding: 10px 12px;
  font-size: .88rem;
  font-weight: 750;
}

.reset-button {
  margin-top: 22px;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--muted);
  padding: 2px 0;
  cursor: pointer;
  font-size: .84rem;
  font-weight: 750;
}

.result-panel {
  position: sticky;
  top: 18px;
  overflow: hidden;
  background: var(--navy-950);
  color: #ecf7f5;
  padding: clamp(24px, 3vw, 36px);
  box-shadow: 0 24px 58px rgba(9, 40, 48, .22);
}

.result-panel .eyebrow { color: #6ee7d8; }
.result-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.result-header h2 { margin: 0; color: #fff; }
.live-badge { flex: 0 0 auto; border-color: rgba(110, 231, 216, .3); background: rgba(110, 231, 216, .08); color: #9ff3e8; }

.timeline { display: grid; grid-template-columns: auto 1fr auto 1fr auto; gap: 8px; align-items: center; margin-top: 34px; }
.timeline > div:not(.timeline-track) { display: grid; text-align: center; }
.timeline span { color: #fff; font-size: .82rem; font-weight: 850; }
.timeline small { color: #9fb6ba; font-size: .65rem; }
.timeline-track { height: 2px; background: rgba(110, 231, 216, .28); }
.timeline-track span { display: block; width: 65%; height: 2px; background: #6ee7d8; }
.timeline-track.is-retired span { width: 45%; background: var(--gold-500); }
.timeline-summary { margin: 10px 0 0; color: #9fb6ba; text-align: center; font-size: .76rem; }
.timeline-summary strong { color: #d9efec; }

.primary-result {
  margin: 28px 0 18px;
  border: 1px solid rgba(217, 164, 65, .38);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(217, 164, 65, .16), rgba(255, 255, 255, .03));
  padding: 22px;
}
.primary-result span, .primary-result small { display: block; color: #c0d0d2; }
.primary-result span { font-size: .83rem; font-weight: 750; }
.primary-result strong { display: block; margin: 7px 0 5px; color: #ffe8aa; font-family: Georgia, serif; font-size: clamp(2.05rem, 4.2vw, 3.25rem); line-height: 1; letter-spacing: -.03em; }
.primary-result small { font-size: .72rem; }

.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.result-grid article {
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 16px;
  background: rgba(255, 255, 255, .045);
  padding: 16px;
}
.result-grid .result-wide { grid-column: 1 / -1; }
.result-grid span, .result-grid small { display: block; color: #9fb6ba; }
.result-grid span { font-size: .76rem; }
.result-grid strong { display: block; margin: 5px 0 3px; color: #fff; font-size: clamp(1.08rem, 2vw, 1.42rem); }
.result-grid small { font-size: .68rem; }

.stress-test { margin-top: 18px; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 17px; }
.stress-test > span { color: #9ff3e8; font-size: .72rem; font-weight: 850; letter-spacing: .08em; }
.stress-test p { margin: 6px 0 5px; color: #b3c5c8; font-size: .8rem; }
.stress-test strong { color: #fff; font-size: 1.28rem; }
.assumption-summary { margin: 17px 0 0; color: #9fb6ba; font-size: .76rem; }

.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.result-actions button {
  min-height: 44px;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 850;
}
.primary-button { border: 1px solid var(--gold-500); background: var(--gold-500); color: var(--navy-950); }
.secondary-button { border: 1px solid rgba(255, 255, 255, .22); background: transparent; color: #fff; }
.copy-status { min-height: 1.4em; margin: 8px 0 0; color: #9ff3e8; font-size: .76rem; }

.method-section { padding: 72px 0; border-top: 1px solid var(--line); }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 26px; }
.method-grid article { border-top: 2px solid var(--teal-700); background: rgba(255, 255, 255, .58); padding: 22px; }
.method-grid article > span { color: var(--gold-500); font-family: Georgia, serif; font-size: 1.8rem; }
.method-grid h3 { margin: 12px 0 7px; color: var(--navy-950); font-size: 1rem; }
.method-grid p { margin: 0; color: var(--muted); font-size: .86rem; }

.source-section {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: 36px;
  border-radius: 26px;
  background: #fff;
  padding: clamp(26px, 4vw, 46px);
  box-shadow: 0 14px 36px rgba(13, 57, 63, .07);
}
.source-section p { margin-bottom: 0; color: var(--muted); }
.source-links { display: grid; gap: 10px; align-content: start; }
.source-links a { border-bottom: 1px solid var(--line); color: var(--teal-700); padding: 10px 0; font-size: .88rem; font-weight: 800; text-decoration: none; }
.source-links a::after { content: " ↗"; }

.disclaimer { margin: 22px 0 60px; border-left: 4px solid var(--gold-500); background: rgba(248, 232, 189, .36); padding: 18px 20px; }
.disclaimer strong { color: var(--navy-950); }
.disclaimer p { margin: 4px 0 0; color: #5d6c6d; font-size: .8rem; }

footer { border-top: 1px solid var(--line); color: var(--muted); padding: 24px; text-align: center; font-size: .78rem; }
footer p { margin: 0; }

button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid rgba(13, 148, 136, .4);
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero-note { max-width: 620px; }
  .tool-layout { grid-template-columns: 1fr; }
  .result-panel { position: static; }
  .source-section { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  main { width: min(100% - 24px, 1220px); }
  .topbar { padding: 14px 16px; }
  .back-link { font-size: .78rem; }
  .hero { padding: 42px 4px 48px; }
  h1 { font-size: clamp(2.5rem, 13vw, 4rem); }
  .question-panel, .result-panel { border-radius: 21px; }
  .paired-fields, .result-actions, .method-grid { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .result-grid .result-wide { grid-column: auto; }
  .timeline { gap: 5px; }
  .timeline span { font-size: .7rem; }
  .method-section { padding: 54px 0; }
}

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

@media print {
  @page { margin: 14mm; }
  body { background: #fff; color: #111; }
  .topbar, .question-panel, .result-actions, .copy-status, .source-section, .shield-related-cards, footer { display: none !important; }
  main { width: 100%; }
  .hero { display: block; padding: 0 0 12mm; }
  .hero-note, .hero-tags { display: none; }
  h1 { max-width: none; color: #111; font-size: 30pt; }
  .tool-layout { display: block; padding: 0; }
  .result-panel { position: static; overflow: visible; border: 1px solid #999; background: #fff; color: #111; box-shadow: none; break-inside: auto; }
  .hero, .result-header { break-after: avoid; }
  .timeline, .timeline-summary { break-after: avoid; }
  .primary-result, .result-grid article, .stress-test, .method-grid article, .disclaimer { break-inside: avoid; }
  .result-panel .eyebrow, .result-header h2, .primary-result strong, .result-grid strong, .stress-test strong { color: #111; }
  .live-badge, .timeline-summary, .timeline small, .timeline span, .primary-result span, .primary-result small, .result-grid span, .result-grid small, .stress-test p, .assumption-summary { color: #444; }
  .primary-result, .result-grid article { border-color: #bbb; background: #fff; }
  body.shield-design[data-shield-page="page-43"] :is(.result-panel, .primary-result) { background: #fff !important; color: #111; }
  body.shield-design[data-shield-page="page-43"] .result-panel :is(span, small, strong, p, h2) { color: #111; }
  .method-section { padding: 12mm 0 0; }
  .method-grid { grid-template-columns: repeat(3, 1fr); }
  .disclaimer { margin-bottom: 0; }
}
