:root {
  --bg: #f5f6f3;
  --card: #ffffff;
  --text: #1b1f24;
  --muted: #5b6470;
  --line: #e2e5e9;
  --accent: #0f6e5a;
  --accent-2: #14896f;
  --accent-soft: #e4f2ed;
  --accent-ink: #ffffff;
  --gold: #b7791f;
  --warn: #9a5b00;
  --warn-soft: #fff4e0;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
  --radius: 14px;
  --max: 1080px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121417;
    --card: #1b1e22;
    --text: #e9eaec;
    --muted: #a3aab4;
    --line: #2d3137;
    --accent: #4cc3a4;
    --accent-2: #3fb093;
    --accent-soft: #19302b;
    --accent-ink: #0b1714;
    --gold: #e2b25c;
    --warn: #f0b24a;
    --warn-soft: #3a2d15;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.75;
  font-size: 16px;
}
a { color: var(--accent); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
main.wrap { padding-bottom: 8px; }
.prose { max-width: 760px; }

/* ── 頁首 ── */
header.site {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; letter-spacing: .02em; text-decoration: none; color: var(--text); white-space: nowrap; }
.brand svg { width: 28px; height: 28px; flex: none; }
header.site nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
header.site nav::-webkit-scrollbar { display: none; }
header.site nav a { padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: 15px; white-space: nowrap; }
header.site nav a:hover { background: var(--accent-soft); color: var(--accent); }
header.site nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* ── 標題區 ── */
.crumbs { font-size: 13px; color: var(--muted); margin: 20px 0 0; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
h1 { font-size: clamp(26px, 4vw, 34px); line-height: 1.3; margin: 10px 0 8px; letter-spacing: .01em; }
h2 { font-size: 21px; line-height: 1.4; margin: 40px 0 10px; }
h3 { font-size: 17px; margin: 22px 0 8px; }
.lead { color: var(--muted); margin: 0 0 8px; max-width: 720px; font-size: 17px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.badges li { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.badges li::before { content: "✓"; }

/* ── 首頁主視覺 ── */
.hero {
  margin: 20px 0 8px; padding: 36px 28px; border-radius: 20px;
  background: radial-gradient(1200px 400px at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%), var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.hero h1 { margin-top: 0; }
@media (max-width: 640px) { .hero { padding: 26px 20px; } .hero h1 br { display: none; } }
.quick { display: flex; gap: 10px; margin-top: 22px; max-width: 520px; }
.quick input { flex: 1; font-size: 18px; padding: 12px 14px; }
.quick button { flex: none; }
.quick-note { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ── 卡片與表單 ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 16px 0; box-shadow: var(--shadow); }
.card-title { font-size: 15px; color: var(--muted); font-weight: 600; margin: 0 0 14px; letter-spacing: .04em; }
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; align-items: start; margin-top: 22px; }
.calc > .card { margin: 0; }
.calc .result-card { position: sticky; top: 76px; }
@media (max-width: 820px) {
  .calc { grid-template-columns: 1fr; }
  .calc .result-card { position: static; }
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fields { display: grid; gap: 14px; }
label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
input, select {
  width: 100%; padding: 11px 12px; font-size: 16px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; color: var(--text); font-size: 15px; background: var(--bg); }
.seg input { width: auto; accent-color: var(--accent); }
.seg label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
details.more { border: none; padding: 4px 0 0; }
details.more summary { font-weight: 500; font-size: 14px; color: var(--accent); }

/* ── 結果 ── */
.result { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); border-radius: 12px; padding: 20px 22px; }
.result .note { color: inherit; opacity: .85; }
.result .big { font-size: clamp(34px, 5vw, 44px); font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; margin: 2px 0 4px; }
.result .big small { font-size: 16px; font-weight: 500; opacity: .85; }
.result-card table { margin-top: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
tr:last-child th, tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.prose table { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.prose table tr:nth-child(even) td { background: color-mix(in srgb, var(--bg) 60%, transparent); }
.table-scroll { overflow-x: auto; }
.note { font-size: 14px; color: var(--muted); }
.warn { background: var(--warn-soft); color: var(--warn); padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-top: 14px; }

/* ── 內文 ── */
.prose ul { padding-left: 1.3em; }
.prose li { margin: 4px 0; }

/* ── 按鈕 ── */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--accent); color: var(--accent-ink); border: none; cursor: pointer;
  padding: 12px 20px; border-radius: 10px; text-decoration: none; font-weight: 700; font-size: 16px; font-family: inherit;
}
.btn:hover { background: var(--accent-2); }

/* ── 工具卡片 ── */
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 22px; }
.tools a {
  display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, border-color .15s;
}
.tools a:hover { border-color: var(--accent); transform: translateY(-2px); }
.tools .ico { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.tools .ico svg { width: 24px; height: 24px; }
.tools b { font-size: 17px; margin-top: 6px; }
.tools span { font-size: 14px; color: var(--muted); }
.tools em { font-style: normal; font-size: 14px; color: var(--accent); font-weight: 600; margin-top: auto; padding-top: 6px; }
.tools.small { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.tools.small a { padding: 14px 16px; flex-direction: row; align-items: center; gap: 12px; }
.tools.small b { margin: 0; font-size: 15px; }
.tools.small .ico { width: 36px; height: 36px; }

/* ── 商品推廣 ── */
.promo {
  display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center;
  border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line)); background: var(--card);
  border-radius: var(--radius); padding: 22px; margin: 32px 0; box-shadow: var(--shadow);
}
.promo .tag { display: inline-block; font-size: 12px; font-weight: 700; color: var(--gold); border: 1px solid currentColor; border-radius: 999px; padding: 1px 10px; margin-bottom: 6px; }
.promo strong { display: block; font-size: 19px; line-height: 1.4; margin-bottom: 8px; }
.promo ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 2px 16px; font-size: 14px; color: var(--muted); }
.promo li::before { content: "✓ "; color: var(--accent); font-weight: 700; }
.promo .buy { text-align: center; }
.promo .price { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1.2; }
.promo .price small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.promo .btn { margin-top: 10px; white-space: nowrap; }
@media (max-width: 640px) {
  .promo { grid-template-columns: 1fr; }
  .promo .buy { text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .promo .btn { margin-top: 0; }
}

/* ── 常見問題 ── */
.faq { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.faq details { border-bottom: 1px solid var(--line); padding: 0 18px; }
.faq details:last-child { border-bottom: none; }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 28px 14px 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 10px; font-size: 22px; color: var(--accent); font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 14px; color: var(--muted); }

.ad-slot { margin: 24px 0; }
.section-title { font-size: 21px; margin: 40px 0 0; }

/* ── 頁尾 ── */
footer.site { margin-top: 56px; padding: 32px 0 40px; border-top: 1px solid var(--line); background: var(--card); font-size: 14px; color: var(--muted); }
footer.site .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; }
footer.site h4 { margin: 0 0 8px; font-size: 14px; color: var(--text); }
footer.site ul { list-style: none; margin: 0; padding: 0; }
footer.site li { margin: 4px 0; }
footer.site a { color: var(--muted); text-decoration: none; }
footer.site a:hover { color: var(--accent); }
footer.site .fine { margin-top: 24px; font-size: 12px; line-height: 1.7; }
@media (max-width: 640px) { footer.site .cols { grid-template-columns: 1fr 1fr; } footer.site .cols > :first-child { grid-column: 1 / -1; } }
