:root {
  --paper: #f3eee6;
  --paper-raised: #fffaf3;
  --ink: #241c16;
  --muted: #4e453d;
  --line: #e3d5c4;
  --red: #c83c30;
  --red-soft: #fdeceb;
  --red-ink: #8c241c;
  --yellow: #e0ae3a;
  --yellow-soft: #fff4d8;
  --yellow-ink: #6f4e09;
  --green: #1c7d4e;
  --green-soft: #e5f6ed;
  --green-ink: #0d5a34;
  --green-btn: #0f6840;
  --header: rgba(243, 238, 230, 0.94);
  --shadow: 0 16px 40px rgba(36, 28, 22, 0.06);
  --radius: 20px;
  --font: "PingFang TC", "Hiragino Sans CNS", "Noto Sans TC", "Microsoft JhengHei", "Segoe UI", sans-serif;
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 0% -10%, rgba(200, 60, 48, 0.09), transparent 42%),
    radial-gradient(ellipse at 100% 0%, rgba(224, 174, 58, 0.18), transparent 36%),
    radial-gradient(ellipse at 80% 100%, rgba(28, 125, 78, 0.08), transparent 34%);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.75;
}

body::before {
  content: "";
  display: block;
  height: 6px;
  background: linear-gradient(90deg, var(--red) 0 33.33%, var(--yellow) 33.33% 66.66%, var(--green) 66.66%);
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--green-ink);
}

a:hover {
  color: var(--ink);
}

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

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 40;
  background: var(--ink);
  color: var(--paper-raised);
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
}

.skip:focus {
  top: 0.8rem;
}

.wrap {
  width: min(1080px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header.is-static {
  position: static;
}

.header-inner {
  width: min(1080px, calc(100% - 2rem));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 4.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.lamps {
  width: 1.35rem;
  display: grid;
  gap: 0.18rem;
  flex: none;
}

.lamps i {
  display: block;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  margin-inline: auto;
}

.lamps i:nth-child(1) { background: var(--red); }
.lamps i:nth-child(2) { background: var(--yellow); }
.lamps i:nth-child(3) { background: var(--green); }

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.brand-name {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-sub {
  color: var(--muted);
  font-size: 0.78rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-toggle,
.line-btn,
.btn,
.copy-btn,
.calc-button,
.seg input + span {
  font: inherit;
}

.nav-toggle {
  border: 1px solid var(--line);
  background: var(--paper-raised);
  color: var(--ink);
  border-radius: 999px;
  min-height: 2.75rem;
  padding: 0 0.95rem;
  cursor: pointer;
}

.site-nav {
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0 1rem 1rem;
}

.site-nav.is-open {
  display: flex;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.7rem 0.2rem;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

.site-nav a[aria-current="page"] {
  color: var(--green-ink);
}

.line-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: var(--green-btn);
  color: #fffaf3;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.site-nav .line-btn {
  border-bottom: 0;
  margin-top: 0.4rem;
  color: #fffaf3;
}

.line-btn:hover,
.btn-primary:hover {
  background: var(--green-ink);
  color: #fffaf3;
}

.hero {
  padding: 2.2rem 0 1rem;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.dots {
  display: inline-flex;
  gap: 0.28rem;
}

.dots i {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  display: block;
}

.dots i:nth-child(1) { background: var(--red); }
.dots i:nth-child(2) { background: var(--yellow); }
.dots i:nth-child(3) { background: var(--green); }

h1,
h2,
h3 {
  line-height: 1.3;
  font-weight: 750;
  letter-spacing: -0.02em;
}

h1 {
  margin: 0 0 0.8rem;
  font-size: clamp(2rem, 1.35rem + 2.6vw, 3.45rem);
}

h2 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.45rem, 1.2rem + 1vw, 2.05rem);
}

h3 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}

.lede {
  margin: 0 0 1.2rem;
  font-size: 1.12rem;
  max-width: 40rem;
}

.hero-actions,
.stack-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.1rem;
  min-height: 3rem;
  padding: 0.7rem 1.05rem;
  border-radius: 16px;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.3;
}

.btn-primary {
  background: var(--green-btn);
  color: #fffaf3;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}

.btn-ghost:hover {
  background: var(--ink);
  color: var(--paper-raised);
}

.btn-kicker {
  font-weight: 650;
  font-size: 0.92rem;
}

.micro,
.fine {
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-lamp {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.hero-lamp svg {
  width: min(180px, 48vw);
}

.section {
  padding: 1.4rem 0 0.6rem;
}

.section-head {
  max-width: 40rem;
  margin-bottom: 1rem;
}

.card-grid,
.topic-grid,
.split {
  display: grid;
  gap: 0.85rem;
}

.card,
.topic,
.panel,
.sheet,
.faq-item,
.calc {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card,
.topic,
.panel {
  padding: 1.05rem 1.05rem 1.1rem;
}

.card p,
.topic p,
.panel p,
.sheet p,
.prose p {
  margin: 0.35rem 0 0.7rem;
}

.lamp-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.lamp-label i {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  display: block;
}

.dot-red { background: var(--red); }
.dot-yellow { background: var(--yellow); }
.dot-green { background: var(--green); }

.tone-red { background: var(--red-soft); }
.tone-yellow { background: var(--yellow-soft); }
.tone-green { background: var(--green-soft); }
.ink-red { color: var(--red-ink); }
.ink-yellow { color: var(--yellow-ink); }
.ink-green { color: var(--green-ink); }

.steps {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.95rem 1rem 0.95rem 4.1rem;
  position: relative;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0.85rem;
  top: 0.9rem;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--ink);
  background: var(--yellow);
}

.steps li:nth-child(1)::before { background: var(--red); color: #fffaf3; }
.steps li:nth-child(3)::before { background: var(--green); color: #fffaf3; }

.topic h3 {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.opener {
  margin: 0.2rem 0 0.7rem;
  padding: 0.75rem 0.85rem;
  background: var(--paper);
  border-radius: 12px;
}

.copy-btn,
.calc-button {
  border: 0;
  cursor: pointer;
  background: var(--ink);
  color: var(--paper-raised);
  border-radius: 999px;
  min-height: 2.75rem;
  padding: 0.4rem 0.95rem;
  font-weight: 700;
}

.copy-btn:hover,
.calc-button:hover {
  background: var(--green-btn);
}

.link-row {
  display: grid;
  gap: 0.85rem;
}

.link-card {
  display: block;
  padding: 1.1rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  min-height: 100%;
}

.link-card:hover {
  border-color: var(--green);
}

.link-card strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}

.cta-band {
  margin: 2rem 0 0;
  padding: 2rem 0 2.4rem;
  background: var(--ink);
  color: var(--paper-raised);
}

.cta-band a {
  color: #fffaf3;
}

.cta-band .micro {
  color: #efe4d4;
}

.cta-band .btn-primary {
  background: var(--green);
  color: #fffaf3;
}

.site-footer {
  background: #1b1511;
  color: #f6f0e6;
  padding: 2rem 0 2.4rem;
}

.footer-grid {
  display: grid;
  gap: 1.2rem;
}

.site-footer a {
  color: #f6f0e6;
}

.site-footer nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.site-footer h2 {
  font-size: 1rem;
  margin: 0 0 0.4rem;
}

.disclaimer {
  border-top: 1px solid rgba(246, 240, 230, 0.2);
  padding-top: 0.9rem;
  margin: 0.4rem 0 0;
}

.prose-page {
  padding: 2rem 0 1rem;
}

.prose {
  max-width: 44rem;
}

.prose ul,
.prose ol,
.sheet ol {
  margin: 0.4rem 0 1rem;
  padding-left: 1.2rem;
}

.prose li + li,
.sheet li + li {
  margin-top: 0.35rem;
}

.sheet {
  padding: 0;
  overflow: hidden;
}

.sheet-bar {
  height: 8px;
  background: linear-gradient(90deg, var(--red), var(--yellow), var(--green));
}

.sheet-body {
  padding: 1.1rem 1.05rem 1.2rem;
}

.keyword {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin: 0.8rem 0;
  padding: 0.9rem;
  border-radius: 16px;
  background: var(--yellow-soft);
}

.keyword b {
  font-size: 1.6rem;
  letter-spacing: 0.08em;
}

.calc {
  padding: 1.05rem;
  margin: 1rem 0 1.4rem;
}

.calc h2 {
  scroll-margin-top: 5.5rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}

.field span,
.seg legend {
  font-weight: 700;
}

.help {
  color: var(--muted);
  font-weight: 450;
  font-size: 0.95rem;
}

.field label .help {
  display: block;
  margin-top: 0.2rem;
}

h4 {
  margin: 1.1rem 0 0.35rem;
  font-size: 1.05rem;
}

input[type="text"],
input[type="number"] {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid #cbbba6;
  border-radius: 12px;
  min-height: 3.1rem;
  padding: 0.4rem 0.75rem;
  width: 100%;
}

.seg {
  border: 0;
  margin: 0 0 0.9rem;
  padding: 0;
  position: relative;
}

.seg-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.seg label {
  flex: 1 1 5.5rem;
}

.seg input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.seg input + span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  border-radius: 12px;
  border: 1.5px solid #cbbba6;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

.seg input:checked + span {
  background: var(--ink);
  color: var(--paper-raised);
  border-color: var(--ink);
}

.seg input:focus-visible + span {
  outline: 3px solid var(--green-ink);
  outline-offset: 3px;
}

.error {
  color: var(--red-ink);
  font-weight: 700;
  min-height: 1.4em;
}

.result {
  margin-top: 0.8rem;
  padding: 0.95rem;
  border-radius: 16px;
  background: var(--paper);
}

.figure {
  font-size: clamp(1.8rem, 1.2rem + 2vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  margin: 0.2rem 0;
}

.result-dl {
  display: grid;
  gap: 0.45rem;
  margin: 0.6rem 0;
}

.result-dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}

.result-dl dt {
  color: var(--muted);
}

.result-dl dd {
  margin: 0;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.plan-list {
  margin: 0.4rem 0 0.8rem;
  padding-left: 1.15rem;
}

.signal {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-weight: 800;
}

.signal::before {
  content: "";
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: currentColor;
}

.signal-red { background: var(--red-soft); color: var(--red-ink); }
.signal-yellow { background: var(--yellow-soft); color: var(--yellow-ink); }
.signal-green { background: var(--green-soft); color: var(--green-ink); }

.notice,
.callout {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: var(--yellow-soft);
  color: var(--ink);
}

.callout {
  background: var(--red-soft);
}

.table-scroll {
  overflow-x: auto;
  margin: 0.6rem 0 1rem;
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 22rem;
  background: var(--paper-raised);
}

.sheet-table caption {
  text-align: left;
  font-weight: 800;
  padding: 0.2rem 0 0.55rem;
}

.sheet-table th,
.sheet-table td {
  text-align: left;
  padding: 0.65rem 0.55rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.sheet-table th {
  font-weight: 750;
}

.sheet-table tr.is-hit {
  background: var(--green-soft);
}

.hit-flag {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: var(--green-btn);
  color: #fffaf3;
  font-size: 0.82rem;
  font-weight: 800;
}

.source-list a {
  overflow-wrap: anywhere;
}

.faq-list {
  display: grid;
  gap: 0.7rem;
}

.faq-item {
  padding: 0.35rem 1rem 0.2rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 800;
  padding: 0.75rem 0;
}

.faq-item p {
  margin-top: 0;
}

.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;
}

@media (min-width: 720px) {
  .card-grid,
  .topic-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .topic-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .split,
  .link-row,
  .footer-grid {
    grid-template-columns: 1.2fr 0.8fr;
  }

  .footer-grid {
    grid-template-columns: 1.3fr 0.7fr 0.9fr;
  }

  .hero-grid {
    display: grid;
    grid-template-columns: 1.45fr 0.55fr;
    gap: 1rem;
    align-items: center;
  }

  .hero-lamp {
    margin-top: 0;
  }
}

@media (min-width: 880px) {
  .site-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.2rem;
    padding: 0;
  }

  .site-nav a {
    border-bottom: 0;
    padding: 0.45rem 0.6rem;
    font-size: 0.98rem;
    border-radius: 999px;
  }

  .site-nav a[aria-current="page"] {
    background: var(--green-soft);
  }

  .nav-toggle,
  .line-btn-compact {
    display: none;
  }

  .header-inner {
    gap: 1rem;
  }
}

@media (max-width: 879px) {
  .brand-sub {
    display: none;
  }

  .line-btn-compact {
    font-size: 0.92rem;
    padding-inline: 0.7rem;
    white-space: nowrap;
  }
}

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