/* =====================================================================
   全民補助算盤 v5 — 活潑插畫版
   參考方向：白底＋一個主色＋粉彩主題卡＋可愛插畫帶情緒（不靠大面積紅）
   間距 8pt：8 / 16 / 24 / 32 / 48 / 64
   ===================================================================== */
:root {
  color-scheme: light;
  --bg: #FFFFFF; --bg-soft: #F6F7F9;
  --surface: #FFFFFF; --surface-2: #F3F4F6; --line: #ECEEF1; --line-strong: #D5D9DF;
  --ink: #1F2633; --ink-2: #3D4655; --muted: #5F6878;
  --accent: #CC4212; --accent-hover: #B33910; --on-accent: #FFFFFF;
  --accent-bright: #FF7A45; --accent-soft: #FFF0E8; --accent-line: #FFD3BF;
  --money: #D9440F;
  --banner: #FFF1E6; --banner-2: #FFE6EC;
  --p-pink: #FFEEF1; --p-purple: #F1EEFF; --p-yellow: #FFF6D9; --p-blue: #E9F4FF; --p-green: #E8F7EF; --p-orange: #FFF0E6;
  --r-xl: 32px; --r-lg: 24px; --r-md: 16px; --r-sm: 12px; --r-pill: 999px;
  --shadow: 0 2px 8px -2px rgba(31,38,51,.06); --shadow-card: 0 12px 32px -12px rgba(204,66,18,.22); --shadow-hover: 0 16px 32px -14px rgba(31,38,51,.18); --shadow-pop: 0 24px 48px -16px rgba(31,38,51,.3);
  --ok: #0E8A4F; --ok-soft: #E8F7EF; --warn: #B4540A; --warn-soft: #FFF4E5;
  --font: "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", sans-serif;  /* 蘋方放最前：Apple 用內建；Android 退回系統思源黑體；Windows 用下載的 Noto Sans TC */
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: clip; }
body.has-bar { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
html.lock { overflow: hidden; }
svg { display: block; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.tnum { font-variant-numeric: tabular-nums; }
.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; }
:focus-visible { outline: 3px solid #2563EB; outline-offset: 2px; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-sm { width: 16px; height: 16px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 32px; } }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: #fff; padding: 8px 16px; z-index: 100; }
.skip:focus { top: 8px; }

/* ---------- 按鈕 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: var(--r-md); border: 0; font-weight: 700; font-size: 16px; text-decoration: none; white-space: nowrap; transition: background-color .2s, color .2s, transform .12s, box-shadow .2s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 16px -8px rgba(204,66,18,.6); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--surface-2); color: var(--ink); }
.btn-ghost:hover { background: #E9EBEF; }
.btn-added { background: var(--accent-soft); color: var(--money); box-shadow: inset 0 0 0 1.5px var(--accent-line); }
.btn-line { background: #06C755; color: #fff; }
.btn-line:hover { background: #05B34C; }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 15px; border-radius: var(--r-sm); }
.count { min-width: 24px; height: 24px; padding: 0 6px; border-radius: var(--r-pill); background: var(--accent); color: #fff; font-size: 13px; display: inline-grid; place-items: center; }
.link-btn { border: 0; background: none; color: var(--accent); font-weight: 700; padding: 8px 0; min-height: 40px; display: inline-flex; align-items: center; gap: 4px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Header ---------- */
.header { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.9); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.header .wrap { height: 64px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.brand-mark svg { width: 32px; height: 32px; }
.brand-name { font-weight: 700; font-size: 19px; letter-spacing: .02em; }
.nav { display: none; gap: 4px; margin-right: auto; }
.nav a { color: var(--ink-2); text-decoration: none; font-weight: 700; font-size: 15px; padding: 8px 12px; border-radius: var(--r-sm); }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
@media (min-width: 900px) { .nav { display: flex; } }
.header-bag { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent); border: 0; font-weight: 700; font-size: 15px; }
@media (min-width: 900px) { .header-bag { margin-left: 0; } }
.header-bag .icon-fubag { width: 24px; height: 24px; }

/* ---------- 首屏橫幅 ---------- */
.hero { padding: 16px 0 8px; }
@media (min-width: 1024px) { .hero { padding: 32px 0 16px; } }
.banner { position: relative; display: grid; gap: 16px; padding: 24px 16px 16px; border-radius: var(--r-xl); background: radial-gradient(120% 90% at 100% 0%, var(--banner-2) 0%, transparent 60%), var(--banner); overflow: hidden; }
@media (min-width: 768px) { .banner { padding: 40px; } }
@media (min-width: 1024px) { .banner { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; padding: 56px; align-items: start; } }
.banner-copy { position: relative; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 6px 12px; border-radius: var(--r-pill); background: rgba(255,255,255,.75); font-size: 14px; font-weight: 700; color: var(--accent); }
.eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-bright); box-shadow: 0 0 0 4px rgba(255,122,69,.2); }
.hero h1 { font-weight: 700; font-size: clamp(26px, 6.6vw, 46px); line-height: 1.32; letter-spacing: -.01em; margin: 0 0 12px; max-width: 13em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { margin: 0 0 24px; color: var(--ink-2); font-size: 17px; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 16px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.trust li { display: inline-flex; align-items: center; gap: 6px; }

/* 主視覺：算盤插圖（anatomy kit 建模） */
.banner-side { position: relative; z-index: 1; display: grid; gap: 8px; }
.iso.hero-ill, .iso.topic-ill, .iso.ico, .iso.empty-ill { background: none; }
.hero-ill { width: 100%; max-width: 520px; margin: -16px auto -24px; aspect-ratio: 560 / 330; } /* 預留插圖空間，JS 塞入 SVG 時不跳版 */
.hero-ill .iso-svg { width: 100%; height: auto; overflow: visible; }
@media (max-width: 1023px) {
  .banner { gap: 0; }
  .banner-copy, .banner-side { display: contents; }
  .banner .eyebrow { order: 1; justify-self: start; } .banner h1 { order: 2; } .banner .lead { order: 3; margin-bottom: 0; }
  .hero-ill { order: 4; max-width: 440px; margin: -4px auto 0; }
  .finder { order: 5; } .trust { order: 6; margin-bottom: 16px; } .estimate { order: 7; }
}
.bead-g { transition: transform .7s cubic-bezier(.34,1.6,.45,1); }
@media (prefers-reduced-motion: reduce) { .bead-g { transition-duration: .01s; } }
.estimate .abacus { display: none; }

/* 快篩（白卡） */
.finder { display: grid; gap: 24px; padding: 24px; background: var(--surface); border-radius: var(--r-lg); box-shadow: 0 8px 24px -16px rgba(204,66,18,.35); }
@media (max-width: 599px) { .finder { padding: 16px; gap: 16px; } }
.step-label { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; margin: 0 0 8px; }
.step-num { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-bright); color: #fff; font-size: 13px; display: grid; place-items: center; font-weight: 700; }
.step-hint { font-weight: 400; color: var(--muted); font-size: 14px; }
.geo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.select-wrap { position: relative; }
.select-wrap select { appearance: none; -webkit-appearance: none; width: 100%; min-height: 48px; padding: 0 40px 0 16px; border: 1.5px solid transparent; border-radius: var(--r-sm); background: var(--surface-2); font-size: 16px; font-weight: 400; cursor: pointer; transition: border-color .2s, background-color .2s; }
.select-wrap select:hover { background: #ECEEF1; }
.select-wrap select:focus { outline: none; border-color: var(--accent-bright); background: #fff; }
.select-wrap select:disabled { opacity: .55; cursor: not-allowed; }
.select-wrap .icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
.geo-note { grid-column: 1 / -1; margin: 0; font-size: 14px; color: var(--warn); display: flex; gap: 6px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: var(--r-pill); border: 1.5px solid transparent; background: var(--surface-2); color: var(--ink-2); font-size: 15px; font-weight: 400; transition: background-color .2s, color .2s, border-color .2s, transform .12s; }
.chip:hover { background: #ECEEF1; }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-bright); color: var(--accent); font-weight: 700; }
.chip .check { display: none; }
.chip[aria-pressed="true"] .check { display: block; }
.chip-count { font-size: 12px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: rgba(0,0,0,.06); display: inline-grid; place-items: center; }
.chip[aria-pressed="true"] .chip-count { background: rgba(204,66,18,.12); }

/* ---------- 試算卡 ---------- */
.estimate { position: relative; overflow: hidden; padding: 24px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-card); }
@media (min-width: 1024px) { .estimate { padding: 32px 32px 24px; } }
.coins { display: none; }
.est-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; border: 0; background: var(--accent-soft); color: var(--accent); border-radius: var(--r-pill); min-height: 36px; padding: 0 14px; font-size: 14px; font-weight: 700; }
.est-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.est-k { margin: 16px 0 0; font-size: 15px; color: var(--muted); }
.est-v { margin: 0; font-weight: 700; font-size: clamp(44px, 11vw, 60px); line-height: 1.1; letter-spacing: -.02em; color: var(--money); display: flex; align-items: baseline; gap: 6px; }
.est-v small { font-size: 18px; font-weight: 700; color: var(--ink); letter-spacing: 0; }
.est-m { margin: 4px 0 0; font-size: 15px; color: var(--muted); }
.est-rows { list-style: none; margin: 16px 0 0; padding: 16px 0 0; border-top: 1px dashed var(--line-strong); display: grid; gap: 8px; max-height: 200px; overflow-y: auto; overflow-x: hidden; }
.est-row { display: flex; align-items: baseline; gap: 8px; font-size: 15px; min-width: 0; }
.est-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 64%; color: var(--ink-2); }
.est-row .lead-dots { flex: 1; border-bottom: 2px dotted var(--line-strong); transform: translateY(-4px); min-width: 16px; }
.est-row .amt { font-weight: 700; white-space: nowrap; flex: none; }
.est-row .name { min-width: 0; flex: 0 1 auto; max-width: none; }
.est-row .amt small { font-weight: 400; font-size: 12px; color: var(--muted); }
.est-toggle { margin-top: 8px; border: 0; background: none; color: var(--accent); font-weight: 700; font-size: 14px; padding: 8px 0; display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 1023px) { .estimate:not(.open) .est-rows { display: none; } }
@media (min-width: 1024px) { .est-toggle { display: none; } }
.est-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; }
.est-cta { flex: 1 1 auto; min-height: 52px; border-radius: var(--r-md); background: var(--accent); color: #fff; border: 0; font-weight: 700; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 24px; box-shadow: 0 10px 20px -10px rgba(204,66,18,.7); transition: transform .12s, background-color .2s; }
.est-cta:hover { background: var(--accent-hover); }
.est-cta:active { transform: scale(.97); }
.est-fine { margin: 16px 0 0; font-size: 13px; color: var(--muted); }

/* 算盤珠 */
.abacus-wrap { display: flex; align-items: center; gap: 8px; }
.abacus { position: relative; display: flex; gap: 6px; padding: 6px 2px; margin: 0; list-style: none; }
.abacus::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: var(--line-strong); }
.bead { position: relative; width: 20px; height: 13px; border-radius: 50%; background: #fff; border: 2px solid var(--line-strong); transition: transform .45s cubic-bezier(.34,1.7,.5,1), background-color .3s, border-color .3s; }
.bead.on { background: radial-gradient(circle at 35% 35%, #FFF1A8, #F2B632 70%); border-color: #D89A00; transform: translateY(-6px); }
.abacus-label { font-size: 13px; color: var(--muted); }

/* 算盤式數字 */
.odo { display: inline-flex; align-items: flex-start; height: 1.1em; line-height: 1.1em; overflow: hidden; vertical-align: bottom; }
.odo-d { display: inline-block; height: 1.1em; overflow: hidden; flex: none; }
.odo { flex: none; }
.odo .reel { display: flex; flex-direction: column; transition: transform .8s cubic-bezier(.2,.9,.25,1); }
.odo .reel span { display: block; height: 1.1em; line-height: 1.1em; text-align: center; }
.odo-sep { display: inline-block; height: 1.1em; line-height: 1.1em; }

/* ---------- 區塊標題 ---------- */
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 16px; }
.sec-head h2 { margin: 0; font-size: clamp(21px, 2.6vw, 26px); font-weight: 700; }
.sec-head p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- 熱門主題（粉彩插畫卡） ---------- */
.topics-sec { padding: 40px 0 8px; }
@media (min-width: 1024px) { .topics-sec { padding-top: 56px; } }
.topics { display: grid; grid-auto-flow: column; grid-auto-columns: 74%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 4px 16px 16px; scrollbar-width: none; }
.topics::-webkit-scrollbar { display: none; }
@media (min-width: 600px) { .topics { grid-auto-columns: 44%; } }
@media (min-width: 1024px) { .topics { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; margin: 0; padding: 0; gap: 16px; } }
.topic { position: relative; scroll-snap-align: start; display: flex; flex-direction: column; justify-content: space-between; min-height: 176px; padding: 24px; border: 0; border-radius: var(--r-lg); text-align: left; color: var(--ink); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.topic:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.topic:active { transform: scale(.98); }
.topic-txt { position: relative; z-index: 1; display: grid; gap: 8px; }
.topic b { font-size: 18px; line-height: 1.45; font-weight: 700; }
.topic-more { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; color: var(--ink-2); font-weight: 400; }
.topic-ill { position: absolute; right: 0; bottom: 0; width: 132px; transition: transform .3s cubic-bezier(.34,1.6,.5,1); }
.topic-ill .iso-svg { width: 100%; height: auto; }
.topic:hover .topic-ill { transform: translateY(-4px) rotate(-4deg) scale(1.05); }
@media (min-width: 1024px) { .topic { min-height: 200px; } .topic-ill { width: 150px; } }
.t-birth { background: var(--p-pink); } .t-housing { background: var(--p-purple); } .t-energy { background: var(--p-yellow); }
.t-career { background: var(--p-blue); } .t-senior { background: var(--p-green); } .t-relief { background: var(--p-orange); }

/* ---------- 結果區 ---------- */
.results { padding: 40px 0 48px; }
.results-layout { display: grid; gap: 24px; }
@media (min-width: 1024px) { .results { padding-top: 56px; } .results-layout { grid-template-columns: 264px minmax(0, 1fr); gap: 40px; align-items: start; } }
.aside { display: grid; gap: 16px; }
@media (min-width: 1024px) { .aside { position: sticky; top: 88px; padding: 24px; border-radius: var(--r-lg); background: var(--bg-soft); } .aside .chips { flex-direction: column; } .aside .chip { justify-content: space-between; width: 100%; border-radius: var(--r-sm); background: #fff; } .aside .chip[aria-pressed="true"] { background: var(--accent-soft); } }
.aside-title { margin: 0; font-size: 14px; font-weight: 700; color: var(--muted); }
@media (max-width: 1023px) { .aside-title { display: none; } }
.search { position: relative; }
.search input { width: 100%; min-height: 48px; padding: 0 44px; border: 1.5px solid transparent; border-radius: var(--r-sm); background: #fff; font-size: 16px; box-shadow: inset 0 0 0 1px var(--line); }
.search input:focus { outline: none; border-color: var(--accent-bright); box-shadow: 0 0 0 3px var(--accent-soft); }
.search > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .clear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; width: 40px; height: 40px; color: var(--muted); display: none; place-items: center; }
.search .clear.show { display: grid; }
.try { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }
.try button { border: 0; background: #fff; color: var(--ink-2); border-radius: var(--r-pill); min-height: 32px; padding: 0 12px; font-size: 14px; box-shadow: inset 0 0 0 1px var(--line-strong); }
.try button:hover { color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-bright); }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }

.results-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.results-head h2 { margin: 0; font-weight: 700; font-size: clamp(21px, 2.6vw, 26px); line-height: 1.3; }
.results-head h2 strong { color: var(--money); }
.results-sub { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.sort { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.sort .select-wrap select { min-height: 40px; font-size: 15px; }

.filterbar { position: sticky; top: 64px; z-index: 20; margin: 0 -16px 16px; padding: 8px 16px; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); display: flex; gap: 8px; }
.filterbar .summary { flex: 1; min-width: 0; min-height: 44px; border-radius: var(--r-pill); background: var(--surface-2); border: 0; padding: 0 16px; display: flex; align-items: center; gap: 8px; text-align: left; font-size: 15px; font-weight: 400; }
.filterbar .summary .icon { color: var(--accent); }
.filterbar .summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-dot { min-width: 20px; height: 20px; border-radius: var(--r-pill); background: var(--accent); color: #fff; font-size: 12px; display: inline-grid; place-items: center; padding: 0 5px; }
@media (min-width: 720px) { .filterbar { display: none; } }
@media (max-width: 719px) { .results-layout > .aside { display: none; } }

/* 補助卡 */
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); transition: box-shadow .2s, transform .2s; }
.card:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-hover); }
.card.in-list { box-shadow: inset 0 0 0 2px var(--accent-bright), var(--shadow); }
.card-body { padding: 24px 24px 16px; display: grid; grid-template-columns: 56px 1fr; gap: 4px 16px; cursor: pointer; flex: 1; align-content: start; }
.ico { grid-row: span 2; width: 56px; height: 56px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--p-orange); }
.ico .iso-svg { width: 54px; height: auto; }
.ico.cat-birth { background: var(--p-pink); } .ico.cat-housing { background: var(--p-purple); } .ico.cat-energy { background: var(--p-yellow); }
.ico.cat-career { background: var(--p-blue); } .ico.cat-senior { background: var(--p-green); } .ico.cat-relief { background: var(--p-orange); }
.card:hover .ico .iso-svg { animation: wiggle .5s ease; }
@keyframes wiggle { 30% { transform: rotate(-8deg); } 60% { transform: rotate(6deg); } }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 700; }
.tag-local { background: var(--accent-soft); color: var(--accent); }
.status { display: inline-flex; align-items: center; gap: 4px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #16A34A; }
.dot.amber { background: #D97706; }
.card h3 { grid-column: 2; margin: 0; font-size: 18px; line-height: 1.4; font-weight: 700; }
.card-org { grid-column: 2; margin: 0; font-size: 13px; color: var(--muted); }
.amount { grid-column: 1 / -1; margin-top: 16px; padding: 16px; border-radius: var(--r-md); background: var(--bg-soft); display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.amount-value { font-size: 26px; font-weight: 700; color: var(--money); line-height: 1.15; letter-spacing: -.01em; }
.amount-value small { font-size: 13px; color: var(--muted); margin-right: 4px; font-weight: 700; }
.amount-unit { font-size: 13px; color: var(--muted); }
.amount.building .amount-value { color: var(--ink-2); }
.elig { grid-column: 1 / -1; list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
.elig li { display: flex; gap: 8px; }
.elig .icon { color: var(--ok); margin-top: 3px; }
.clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.mini-steps { grid-column: 1 / -1; margin-top: 8px; font-size: 13px; color: var(--accent); font-weight: 700; display: flex; gap: 6px; align-items: center; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 24px 24px; }
.empty { text-align: center; padding: 40px 24px; background: var(--bg-soft); border-radius: var(--r-lg); }
.empty-ill { display: block; width: 120px; margin: 0 auto; }
.empty > .icon { margin: 0 auto; width: 36px; height: 36px; color: var(--accent); }
.empty h3 { margin: 16px 0 8px; font-size: 18px; }
.empty p { margin: 0 auto 16px; color: var(--muted); max-width: 30em; }

/* ---------- 怎麼用 ---------- */
.how-sec { padding: 8px 0 56px; }
.how { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .how { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .how { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.how-item { display: flex; gap: 16px; align-items: flex-start; padding: 20px; border-radius: var(--r-lg); background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.how-item b { display: block; font-size: 16px; margin-bottom: 2px; }
.how-item p { margin: 0; font-size: 14px; color: var(--muted); }
.how-ico { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; }
.how-ico.h1 { background: var(--p-orange); color: #E0612A; } .how-ico.h2 { background: var(--p-green); color: #1E9A5C; }
.how-ico.h3 { background: var(--p-blue); color: #2F7FD1; } .how-ico.h4 { background: var(--p-purple); color: #6F5EE0; }

/* ---------- Footer ---------- */
.footer { background: var(--bg-soft); padding: 48px 0 calc(32px + env(safe-area-inset-bottom)); font-size: 15px; color: var(--ink-2); }
.footer h2 { font-size: 16px; margin: 0 0 8px; color: var(--ink); }
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer p { margin: 0 0 8px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.footer a { color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; min-height: 36px; }
.footer .legal { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line-strong); font-size: 13px; color: var(--muted); }
.disclaimer { display: flex; gap: 8px; padding: 16px; border-radius: var(--r-md); background: #fff; }

/* ---------- 福袋底部列 ---------- */
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.95); backdrop-filter: blur(12px); box-shadow: 0 -8px 24px -12px rgba(31,38,51,.18); transform: translateY(110%); transition: transform .25s; }
.bar.show { transform: none; }
.bar-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 16px; }
.bar-sum { flex: 1; min-width: 0; line-height: 1.3; }
.bar-sum .k { font-size: 13px; color: var(--muted); }
.bar-sum .v { font-size: 19px; font-weight: 700; color: var(--money); display: flex; align-items: baseline; gap: 2px; white-space: nowrap; overflow: hidden; transform-origin: left center; }
.bar.bump .bar-sum .v { animation: bump .45s cubic-bezier(.34,1.6,.5,1); }
@keyframes bump { 40% { transform: scale(1.08); } }

/* ---------- Dialogs ---------- */
dialog.sheet { padding: 0; border: 0; margin: auto 0 0 0; width: 100%; max-width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--bg); color: var(--ink); box-shadow: var(--shadow-pop); overflow: hidden; }
dialog.sheet[open] { display: flex; flex-direction: column; animation: up .28s cubic-bezier(.2,.7,.2,1); }
dialog.sheet::backdrop { background: rgba(31,38,51,.4); backdrop-filter: blur(3px); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 768px) {
  dialog.sheet { margin: 0 0 0 auto; height: 100vh; height: 100dvh; max-height: none; width: 560px; border-radius: var(--r-lg) 0 0 var(--r-lg); }
  dialog.sheet[open] { animation-name: side; }
  @keyframes side { from { transform: translateX(40px); opacity: 0; } }
  dialog#filters { width: 420px; }
}
.sheet-grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 8px auto 0; }
@media (min-width: 768px) { .sheet-grab { display: none; } }
.sheet-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 8px 0 0; font-size: 21px; line-height: 1.35; font-weight: 700; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 24px; display: grid; gap: 24px; align-content: start; }
.sheet-foot { padding: 16px 24px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sheet-foot.one { grid-template-columns: 1fr; }
.close { border: 0; background: var(--surface-2); border-radius: 50%; width: 44px; height: 44px; display: grid; place-items: center; flex: none; color: var(--ink-2); }
.sec h3 { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 17px; }
.sec h3 .meta { font-size: 14px; font-weight: 400; color: var(--muted); }
.note { display: flex; gap: 8px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-md); font-size: 15px; }
.note .icon { margin-top: 2px; }
.note-info { background: var(--bg-soft); color: var(--ink-2); }
.note-warn { background: var(--warn-soft); color: #7C2D12; }
.note-ok { background: var(--ok-soft); color: #14532D; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; font-size: 15px; }
.checklist input { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; margin: 1px 0 0; border: 2px solid var(--line-strong); border-radius: 7px; flex: none; display: grid; place-items: center; background: #fff; cursor: pointer; }
.checklist input:checked { background: var(--accent-bright); border-color: var(--accent-bright); }
.checklist input:checked::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.checklist input:checked + span { color: var(--muted); }
.progress { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; margin-bottom: 8px; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, #FFB65C, var(--accent-bright)); width: 0; transition: width .3s; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; position: relative; padding-bottom: 16px; }
.steps li:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--line); }
.steps .n { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; }
.steps b { display: block; font-size: 16px; }
.steps p { margin: 2px 0 0; font-size: 15px; color: var(--ink-2); }
.agency { padding: 16px; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 8px; }
.agency-row { display: flex; gap: 8px; font-size: 15px; color: var(--ink-2); }
.agency-row .icon { color: var(--muted); margin-top: 3px; }
.agency-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
/* 去哪裡辦（offices.js） */
.office-slot:empty { display: none; }
.office-slot { margin-top: 12px; }
.ofc { padding: 16px; border-radius: var(--r-md); background: var(--surface-2); display: grid; gap: 10px; }
.ofc .ofc-h { display: flex; align-items: center; justify-content: flex-start; gap: 6px; margin: 0; font-size: 16px; }
.ofc-h .icon { color: var(--accent); }
.ofc-hint { margin: 0; font-size: 14px; color: var(--ink-2); }
.ofc-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ofc-pick .select-wrap select { background: var(--surface); min-height: 44px; font-size: 15px; }
.ofc-body { display: grid; gap: 8px; }
.ofc-ask { margin: 0; font-size: 15px; color: var(--muted); }
.ofc-note { display: flex; gap: 6px; margin: 0; font-size: 14px; color: var(--ink-2); }
.ofc-note .icon { flex: none; margin-top: 3px; color: var(--muted); }
.ofc-card { padding: 14px; border-radius: var(--r-sm); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 6px; }
.ofc-warn { display: block; color: var(--muted); font-size: 13px; }
.ofc-more { display: grid; gap: 8px; }
.ofc-more > summary { cursor: pointer; font-size: 15px; color: var(--accent); padding: 4px 0; }
.ofc-more[open] > summary { margin-bottom: 8px; }
.ofc-more .ofc-card + .ofc-card { margin-top: 8px; }
.ofc-src, .ofc-priv { margin: 0; }
.ofc-src a { margin-left: 4px; }
.ofc-priv { display: flex; gap: 4px; align-items: center; }
.src { margin: 0; font-size: 13px; color: var(--muted); }
.detail-amount { padding: 16px 24px; border-radius: var(--r-md); background: var(--accent-soft); }
.detail-amount .amount-value { font-size: 32px; }
.related-btn { width: 100%; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: var(--r-md); background: var(--surface); border: 0; box-shadow: inset 0 0 0 1px var(--line); }
.related-btn:hover { box-shadow: inset 0 0 0 1px var(--accent-bright); }

/* 追蹤器 */
.tracker { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 8px; }
.tracker button { position: relative; border: 0; background: none; padding: 26px 0 0; min-height: 52px; font-size: 13px; color: var(--muted); }
.tracker button::before { content: ""; position: absolute; top: 9px; left: 0; right: 0; height: 3px; background: var(--line); }
.tracker button:first-child::before { left: 50%; }
.tracker button:last-child::before { right: 50%; }
.tracker button::after { content: ""; position: absolute; top: 2px; left: 50%; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: #fff; border: 2px solid var(--line-strong); box-sizing: border-box; transition: transform .2s; }
.tracker button.done { color: var(--ink-2); }
.tracker button.done::before { background: #FFC24D; }
.tracker button.done::after { background: #FFC93D; border-color: #E5A000; }
.tracker button.current { color: var(--accent); font-weight: 700; }
.tracker button.current::after { background: var(--accent-bright); border-color: var(--accent-bright); transform: scale(1.2); }
.list-item { padding: 16px; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.list-item.paid { box-shadow: inset 0 0 0 2px #FFC93D; background: #FFFCF0; }
.li-top { display: flex; gap: 12px; align-items: flex-start; }
.li-top .grow { flex: 1; min-width: 0; }
.list-item b { display: block; font-size: 15px; }
.list-item .v { color: var(--money); font-weight: 700; font-size: 15px; }
.list-item .u { font-size: 13px; color: var(--muted); }
.icon-btn { border: 0; background: transparent; width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--accent); }
.totals { display: grid; gap: 8px; padding: 16px; border-radius: var(--r-md); background: var(--accent-soft); }
.totals .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.totals .row span { color: var(--ink-2); font-size: 15px; }
.totals .row strong { font-size: 20px; color: var(--money); }
.opt { display: flex; gap: 8px; align-items: center; min-height: 44px; font-size: 15px; cursor: pointer; }
.opt input { width: 20px; height: 20px; accent-color: var(--accent); }

/* Toast + 金幣 */
.toast-region { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 60; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: var(--r-md); background: #2B3240; color: #fff; font-size: 15px; box-shadow: var(--shadow-pop); animation: up .2s; }
.toast .icon { color: #FFC93D; }
.toast button { margin-left: auto; border: 0; background: none; color: #FFB48F; font-weight: 700; min-height: 36px; }
.coin-burst { position: fixed; z-index: 70; pointer-events: none; left: 50%; top: 45%; }
.coin-burst i { position: absolute; width: 18px; height: 18px; margin: -9px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FFE58A, #E3A62B 65%, #A0740A); animation: fly .9s cubic-bezier(.2,.8,.3,1) forwards; }
@keyframes fly { to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .coin-burst { display: none; }
}

/* 列印：申辦小抄 */
#print-area { display: none; }
@media print {
  @page { size: A4 portrait; margin: 14mm; }
  body { background: #fff !important; padding: 0 !important; font-size: 11pt; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; color: #000; }
  .p-sheet { page-break-after: always; } .p-sheet:last-child { page-break-after: auto; }
  .p-head { border-bottom: 2px solid #000; padding-bottom: 6pt; margin-bottom: 10pt; }
  .p-head h1 { font-size: 16pt; margin: 0 0 2pt; } .p-head p { margin: 0; font-size: 9.5pt; color: #333; }
  .p-sec { margin: 0 0 10pt; break-inside: avoid; } .p-sec h2 { font-size: 12pt; margin: 0 0 4pt; }
  .p-sec ul, .p-sec ol { margin: 0; padding-left: 0; list-style: none; }
  .p-sec li { margin: 0 0 3pt; padding-left: 16pt; text-indent: -16pt; }
  .p-box { display: inline-block; width: 10pt; height: 10pt; border: 1pt solid #000; margin-right: 6pt; vertical-align: -1pt; }
  .p-foot { font-size: 8.5pt; color: #444; border-top: 1px solid #999; padding-top: 4pt; margin-top: 8pt; }
  .p-env { border: 1.5pt dashed #000; padding: 12pt 14pt; margin-top: 8pt; } .p-env .to { font-size: 15pt; font-weight: 700; margin: 4pt 0; }
}

/* 首屏左欄：收錄範圍數字，桌機補滿左下空白並與右欄底部對齊 */
.hero-stats { display: none; }
@media (max-width: 1023px) { .finder-go { display: none; } }
@media (min-width: 1024px) {
  .banner { align-items: stretch; }
  .banner-copy { display: flex; flex-direction: column; }
  .banner-copy .finder { flex: 1; grid-template-rows: auto auto 1fr; }
  .finder-go { display: grid; align-content: end; gap: 12px; }
  .hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0; padding: 20px 0 0; list-style: none; }
  .hero-stats li { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 6px; padding: 16px 18px; border-radius: var(--r-md); background: rgba(255,255,255,.62); box-shadow: inset 0 0 0 1px rgba(204,66,18,.10); }
  .hero-stats b { font-size: 32px; line-height: 1.1; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
  .hero-stats span { font-weight: 700; color: var(--ink, #2B2220); }
  .hero-stats small { grid-column: 1 / -1; margin-top: 4px; font-size: 13px; color: var(--muted); }
}
/* 首屏右欄（2026-11-21）：欄寬鎖在欄內（算盤 SVG 原始寬度曾把卡片撐出右緣被切掉）；
   算盤列只佔自己的高度，剩下的高度全給試算卡，卡片底部和左欄對齊，算盤下方不再留白 */
.est-how, .est-quick, .est-extra { display: none; }
@media (min-width: 1024px) {
  .banner-side { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .estimate { display: flex; flex-direction: column; }
  .estimate .est-rows { flex: 0 1 auto; max-height: none; min-height: 96px; align-content: start; }
  .est-extra { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; margin: 16px 0 0; padding: 16px 0 0; border-top: 1px dashed var(--line-strong); }
  .est-extra p { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
  .est-extra ul { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: grid; gap: 2px; align-content: start; }
  .est-extra button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 4px 8px; border: 0; border-radius: var(--r-sm); background: none; text-align: left; font-size: 15px; color: var(--ink-2); cursor: pointer; }
  .est-extra button:hover { background: var(--surface-2); }
  .est-extra .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .est-extra .tag-mini { flex: none; font-size: 12px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); }
  .estimate .est-foot { margin-top: auto; padding-top: 24px; }
  .est-how { display: grid; gap: 12px; margin: 24px 0 0; padding: 20px 0 0; border-top: 1px dashed var(--line-strong); list-style: none; counter-reset: how; }
  .est-how li { display: grid; grid-template-columns: 32px 1fr; column-gap: 12px; align-items: center; counter-increment: how; }
  .est-how li::before { content: counter(how); grid-row: span 2; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
  .est-how b { font-size: 16px; color: var(--ink); }
  .est-how span { font-size: 14px; color: var(--muted); }
  .estimate > .est-chip { align-self: flex-start; }
  .est-quick { display: block; margin: 24px 0 0; padding: 20px 0 0; border-top: 1px dashed var(--line-strong); }
  .est-quick p { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
  .est-quick-row { display: flex; flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 400px) { .bar-sum .v { font-size: 17px; } }
#bar-mon { margin-left: 6px; font-size: 14px; font-weight: 700; flex: none; }
@media (max-width: 480px) {
  .bar-sum .v { flex-wrap: wrap; row-gap: 0; }
  #bar-mon { flex-basis: 100%; margin-left: 0; font-size: 12px; line-height: 1.25; }
}
/* 資料可信度 */
.tag-warn { background: var(--warn-soft); color: #7C2D12; }
.note-ok { background: #E8F7EF; color: #14532D; }
.sources { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.sources a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; display: inline-flex; align-items: center; gap: 4px; }
.grid-more { display: flex; justify-content: center; padding: 16px 0 8px; } .grid-more[hidden] { display: none; }
/* 結果分組（2026-11-22）：「全部補助」時依類別分組，每組只列前幾張 */
.grid-group { scroll-margin-top: 140px; grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.grid-group:first-child { margin-top: 0; }
.grid-group h3 { margin: 0; font-size: 20px; font-weight: 700; color: var(--ink); display: flex; align-items: baseline; gap: 8px; }
.grid-group h3 span { font-size: 14px; font-weight: 400; color: var(--muted); }
.grid-group .link-btn { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; font-size: 15px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.grid-more small { margin-left: 4px; font-weight: 400; color: var(--muted); }
