:root {
  --bg: #f4efe6;
  --bg-card: #fffdf8;
  --ink: #1c1917;
  --muted: #57534e;
  --line: #e7e0d4;
  --accent: #0f5f5b;
  --accent-hover: #0a4744;
  --accent-soft: #e6f3f2;
  --warn: #9a3412;
  --radius: 14px;
  --max: 68rem;
  --text: 40rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Iwanami Mincho", "Source Han Sans TC", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Hiragino Sans TC", sans-serif;
  font-size: 1.05rem;
  line-height: 1.7;
}

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-hover); }
img, svg { max-width: 100%; }

.wrap { width: min(var(--max), calc(100% - 2rem)); margin-inline: auto; }
.prose { width: min(var(--text), 100%); }

header.site {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, white);
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(10px);
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.7rem 0;
}
.logo {
  display: inline-flex; align-items: baseline; gap: 0;
  text-decoration: none; color: inherit; font-weight: 700; letter-spacing: 0.01em;
}
.logo span { color: var(--accent); font-weight: 800; }
nav.primary { display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; }
nav.primary a { text-decoration: none; color: var(--ink); font-size: 0.95rem; }
nav.primary a:hover, nav.primary a[aria-current="page"] { color: var(--accent); }

.hero {
  padding: 3rem 0 2.2rem;
}
.hero h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.25; margin: 0 0 0.8rem; }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 42rem; }

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
}
.card h2, .card h3 { margin-top: 0; }
.kicker {
  font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin: 0 0 0.35rem;
}

.btn {
  display: inline-block;
  background: var(--accent); color: #fff; text-decoration: none;
  padding: 0.45rem 0.9rem; border-radius: 999px; font-weight: 600;
}
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

.note, .disclaimer {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 0.8rem 1rem;
  border-radius: 0 10px 10px 0;
  color: #1f3d3b;
  font-size: 0.95rem;
}
.source { font-size: 0.88rem; color: var(--muted); }

.table-wrap { overflow-x: auto; margin: 1rem 0 1.4rem; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-card); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #efe8dc; font-weight: 700; }
tr:last-child td { border-bottom: 0; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

main { padding-bottom: 3rem; }
main h1 { font-size: clamp(1.6rem, 2.6vw, 2.15rem); margin-bottom: 0.6rem; }
h2 { font-size: 1.28rem; margin-top: 2rem; }
h3 { font-size: 1.08rem; }

footer.site {
  border-top: 1px solid var(--line);
  padding: 1.6rem 0 2.2rem;
  color: var(--muted);
  font-size: 0.92rem;
}
footer.site nav { display: flex; flex-wrap: wrap; gap: 0.6rem 1.1rem; margin-bottom: 0.7rem; }
footer.site a { color: inherit; }

.lang-ready { font-size: 0.8rem; color: var(--muted); }

.calc label { display: block; font-weight: 600; margin: 0.8rem 0 0.25rem; }
.calc input, .calc select {
  width: 100%; max-width: 22rem;
  padding: 0.45rem 0.6rem; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff;
}
.calc .row { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.calc output {
  display: block; margin-top: 1rem; padding: 1rem;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
}
.calc .big { font-size: 1.6rem; font-weight: 700; }

.toc { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin: 1rem 0 1.5rem; }
.crumbs { font-size: 0.9rem; color: var(--muted); margin-bottom: 1rem; }
.crumbs a { color: inherit; }

@media (max-width: 720px) {
  .header-row { flex-direction: column; align-items: flex-start; }
  body { font-size: 1rem; }
}

.btn.official { display: inline-flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.btn-tag {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0;
  background: rgba(255,255,255,0.18); color: inherit;
  border-radius: 999px; padding: 0.1rem 0.45rem;
}
.btn.secondary .btn-tag { background: var(--accent-soft); color: var(--accent); }

.preset-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 1.2rem; }
.preset-row button {
  font: inherit; cursor: pointer;
  background: var(--bg-card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.35rem 0.85rem;
}
.preset-row button:hover, .preset-row button[aria-pressed="true"] {
  border-color: var(--accent); color: var(--accent); background: var(--accent-soft);
}

.todo {
  background: #fff7ed; border: 1px dashed #c2410c; color: #9a3412;
  padding: 0.8rem 1rem; border-radius: 10px;
}
.compare-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr)); }
.compare-grid h3 { margin-top: 0; }
.flag { font-size: 0.8rem; color: var(--muted); }
.calc input[type="checkbox"] { width: auto; max-width: none; margin-right: 0.35rem; }
.calc label.inline { font-weight: 500; display: flex; align-items: center; gap: 0.25rem; margin: 0.4rem 0; }

@media (max-width: 720px) {
  .btn { padding: 0.5rem 0.85rem; }
  .num { white-space: normal; }
}
