/* 全民補助算盤 — Astro 新增頁面（縣市頁、補助頁、縣市索引、廣告預留位）
   沿用 styles.css 的色票與元件，這裡只補版面 */

/* ---------- 共用：頁首橫幅 ---------- */
.page-hero { background: linear-gradient(135deg, var(--banner), var(--banner-2)); padding: 24px 0 32px; }
@media (min-width: 768px) { .page-hero { padding: 32px 0 48px; } }
.page-hero h1 { margin: 8px 0 8px; font-size: clamp(26px, 4vw, 38px); line-height: 1.25; font-weight: 700; }
.page-hero h1 .year { color: var(--accent); }
.page-hero .lead { margin: 0 0 16px; color: var(--ink-2); font-size: 17px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--ink-2); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.page-cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.page-sec { padding: 40px 0 8px; }
.page-note { margin-top: 16px; }

/* 縣市頁：右側插圖拼貼（手機隱藏） */
.page-hero-ill { display: none; }
@media (min-width: 900px) {
  .page-hero-split { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 32px; align-items: center; }
  .page-hero-split > div:last-child { grid-row: 1; grid-column: 1; }
  .page-hero-ill { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; grid-column: 2; grid-row: 1; }
  .phi { display: grid; place-items: center; aspect-ratio: 1.25; border-radius: var(--r-lg); background: rgba(255,255,255,.7); box-shadow: var(--shadow); }
  .phi .iso-svg { width: 62%; height: auto; }
  .phi-birth { background: var(--p-pink); } .phi-housing { background: var(--p-purple); }
  .phi-energy { background: var(--p-yellow); } .phi-senior { background: var(--p-green); }
  .phi:nth-child(2), .phi:nth-child(4) { transform: translateY(16px); }
}

/* 縣市頁：生育津貼亮點 */
.hl-box { display: inline-grid; gap: 2px; padding: 16px 24px; border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-card); text-decoration: none; color: var(--ink); transition: transform .2s; }
.hl-box:hover { transform: translateY(-2px); }
.hl-k { font-size: 14px; font-weight: 700; color: var(--muted); }
.hl-v { font-size: 34px; font-weight: 700; color: var(--money); line-height: 1.15; }
.hl-v small { font-size: 14px; color: var(--muted); margin-right: 4px; }
.hl-u { font-size: 14px; color: var(--ink-2); }

/* ---------- 靜態卡片（整張是連結） ---------- */
.card-link { color: inherit; text-decoration: none; }
.card-static .card-body { padding-bottom: 24px; }
.card-more { grid-column: 1 / -1; margin-top: 12px; display: inline-flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 700; color: var(--accent); }
.card-link:hover .card-more { text-decoration: underline; text-underline-offset: 3px; }
.card-link:focus-visible { outline-offset: -3px; border-radius: var(--r-lg); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- 補助頁 ---------- */
.item-head { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; margin-top: 8px; }
.ico-lg { width: 72px; height: 72px; grid-row: auto; border-radius: var(--r-lg); background-color: #fff !important; box-shadow: var(--shadow); }
.ico-lg .iso-svg { width: 70px; }
.item-head h1 { margin: 8px 0 4px; font-size: clamp(22px, 3.4vw, 32px); }
.item-layout { display: grid; gap: 24px; padding-top: 24px; padding-bottom: 8px; }
.item-aside { display: grid; gap: 16px; align-content: start; }
.item-box { display: grid; gap: 8px; padding: 16px; border-radius: var(--r-lg); background: #fff; box-shadow: inset 0 0 0 1px var(--line), var(--shadow-card); margin-top: -48px; position: relative; }
.item-box .src { margin: 0 0 4px; }
.item-box .civic-note { display: flex; gap: 4px; align-items: flex-start; margin: 2px 0 10px; font-size: 12px; }
.item-box .civic-note .icon { flex: none; margin-top: 2px; }
@media (min-width: 960px) {
  .item-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; }
  .item-aside { order: 2; position: sticky; top: 88px; }
  .item-main { order: 1; }
}
.item-main { display: grid; gap: 32px; align-content: start; min-width: 0; }
.item-main .sec h2 { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 0 12px; font-size: 21px; font-weight: 700; }
.item-main .sec h2 .meta { font-size: 14px; font-weight: 400; color: var(--muted); }
.item-main .sec > p { margin: 0 0 12px; color: var(--ink-2); font-size: 17px; line-height: 1.75; }
.elig-lg { margin: 0; gap: 8px; font-size: 16px; }
.elig-lg li { padding: 12px 16px; border-radius: var(--r-md); background: var(--bg-soft); }
.doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.doc-list li { display: flex; gap: 10px; padding: 12px 16px; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--line); font-size: 16px; }
.doc-list .icon { color: var(--accent); margin-top: 4px; }
.report-row { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.sources { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; }
.sources a { display: inline-flex; gap: 4px; align-items: center; }
.sources .src { display: inline; }

/* ---------- 首頁：各縣市索引 ---------- */
.counties-sec { padding: 48px 0 24px; }
.county-groups { display: grid; gap: 24px; }
@media (min-width: 960px) { .county-groups { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; } }
.county-group h3 { margin: 0 0 8px; font-size: 15px; color: var(--muted); font-weight: 700; }
.county-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 600px) and (max-width: 959px) { .county-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 960px) { .county-grid { grid-template-columns: 1fr; } }
.county-tile { display: grid; gap: 0; padding: 12px 14px; min-height: 44px; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); text-decoration: none; transition: box-shadow .2s, transform .15s; }
.county-tile:hover { box-shadow: inset 0 0 0 1.5px var(--accent-bright), var(--shadow); transform: translateY(-2px); }
.county-tile b { font-size: 16px; }
.county-tile span { font-size: 13px; font-weight: 700; color: var(--money); }
.county-tile small { font-size: 12px; color: var(--muted); }

/* ---------- 頁尾縣市連結 ---------- */
.foot-counties { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--line-strong); }
.foot-counties ul { display: flex !important; flex-wrap: wrap; gap: 0 16px !important; }

/* ---------- 廣告／合作推廣預留位（與補助內容明確分開） ---------- */
.ad-slot { position: relative; display: grid; place-items: center; min-height: 100px; margin: 24px 0; border: 2px dashed var(--line-strong); border-radius: var(--r-md); background: repeating-linear-gradient(45deg, transparent 0 10px, rgba(0,0,0,.015) 10px 20px); color: var(--muted); font-size: 14px; text-align: center; padding: 24px 16px 16px; }
.ad-affiliate { min-height: 140px; margin: 0; }
.ad-label { position: absolute; top: 6px; left: 10px; font-size: 12px; font-weight: 700; letter-spacing: .05em; color: var(--muted); }

/* 子頁不需要首頁的底部福袋列 */
.is-page .bar { display: none; }

/* ---------- 社群分享列（純連結，不載入平台 SDK） ---------- */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share-label { font-size: 14px; font-weight: 700; color: var(--muted); margin-right: 4px; }
.share-btn { width: 44px; height: 44px; border: 0; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--ink-2); transition: transform .15s, box-shadow .2s, filter .2s; }
.share-btn svg { width: 22px; height: 22px; display: block; }
.share-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); filter: brightness(1.06); }
.share-btn:active { transform: scale(.94); }
.share-btn[hidden] { display: none; }
.sb-line { background: #06C755; } .sb-line svg { width: 26px; height: 26px; }
.sb-facebook { background: #1877F2; }
.sb-threads, .sb-x { background: #1F2633; }
.sb-email { background: #FFF; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.sb-copy { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent-line); }
.sb-native { background: var(--surface-2); color: var(--ink-2); }
.sb-native svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* 桌機左側浮動（像 Money101），寬螢幕才出現，避免壓到內容 */
.share-float { display: none; }
@media (min-width: 1280px) {
  .share-float { display: flex; flex-direction: column; flex-wrap: nowrap; position: fixed; left: 12px; top: 50%; transform: translateY(-50%); z-index: 25; padding: 10px 6px; border-radius: var(--r-pill); background: rgba(255,255,255,.92); backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-hover); }
  .share-float .share-label { margin: 0; font-size: 12px; writing-mode: horizontal-tb; }
  .share-float .share-btn { width: 40px; height: 40px; }
  .share-float .share-btn svg { width: 20px; height: 20px; }
  .share-float .sb-line svg { width: 24px; height: 24px; }
}
.page-hero .share { margin-top: 16px; }
.item-box .share { justify-content: center; padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--line); }
.item-box .share-label { flex-basis: 100%; text-align: center; margin: 0; }
.item-box .share-btn { width: 40px; height: 40px; }
.foot-share { margin-bottom: 24px; padding: 16px; border-radius: var(--r-lg); background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
@media (max-width: 600px) {
  .share-inline { gap: 6px; }
  .share-inline .share-label { flex-basis: 100%; margin: 0 0 2px; }
  .share-inline .share-btn { width: 40px; height: 40px; }
}
@media (max-width: 600px) { .item-box .share-btn { width: 36px; height: 36px; } .item-box .share-btn svg { width: 19px; height: 19px; } }

/* ---------- 首頁量身估算：一頁列出所有問題 ---------- */
.profile { display: grid; gap: 10px; }
.pq { display: grid; gap: 6px; }
.pq-label { font-size: 14px; font-weight: 700; color: var(--ink-2); display: flex; align-items: baseline; gap: 6px; }
.pq-label small { font-size: 12px; font-weight: 400; color: var(--muted); }
.pq-chips { gap: 6px; }
.chip-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
/* 觸控螢幕：按鈕至少 44px 高、間距 8px，長輩手指也好按（Apple／WCAG 建議） */
@media (pointer: coarse) {
  .pq-chips { gap: 8px; }
  .chip-sm { min-height: 44px; padding: 0 14px; font-size: 15px; }
  .pq-label { font-size: 15px; }
  .chip-sm { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
}
@media (min-width: 640px) {
  .pq { grid-template-columns: 88px minmax(0, 1fr); align-items: start; gap: 8px; }
  .pq-label { flex-direction: column; gap: 0; padding-top: 7px; }
}
.est-k b { color: var(--money); font-size: 1.15em; }
.est-warn { display: flex; gap: 6px; align-items: flex-start; margin: 4px 0 0; font-size: 13px; color: var(--warn); }
.est-warn .icon { margin-top: 2px; }

/* ---------- 縣市頁主視覺：專屬淡色底＋台灣定位地圖 ---------- */
.county-hero { position: relative; background: linear-gradient(135deg, hsl(var(--hue) 75% 96%), hsl(calc(var(--hue) + 18) 70% 92%)); overflow: hidden; }
.county-hero::after { content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(closest-side, hsl(var(--hue) 80% 88% / .7), transparent); pointer-events: none; }
.county-hero .wrap { position: relative; z-index: 1; }
.tw-map { margin: 0; display: grid; justify-items: center; gap: 4px; }
.tw-map svg { width: 100%; height: auto; overflow: visible; }
.tw-c { fill: rgba(255,255,255,.78); stroke: hsl(var(--hue) 30% 80%); stroke-width: .8; stroke-linejoin: round; transition: fill .2s; }
.tw-map a:hover .tw-c, .tw-map a:focus-visible .tw-c { fill: hsl(var(--hue) 60% 86%); }
.tw-on { fill: hsl(var(--hue) 58% 50%); stroke: #fff; stroke-width: 1.4; filter: drop-shadow(0 4px 6px hsl(var(--hue) 50% 40% / .35)); }
.tw-inset { fill: rgba(255,255,255,.35); stroke: hsl(var(--hue) 30% 80%); stroke-dasharray: 3 3; stroke-width: .8; }
.tw-inset-t { font-size: 11px; fill: hsl(var(--hue) 25% 45%); font-family: var(--font); }
.tw-map figcaption { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--ink-2); background: rgba(255,255,255,.8); padding: 4px 12px; border-radius: var(--r-pill); }
.tw-dot { width: 10px; height: 10px; border-radius: 50%; background: hsl(var(--hue) 58% 50%); }
.tw-region { font-weight: 400; color: var(--muted); }
.tw-region::before { content: "・"; }
/* 手機：右上角小地圖，不擋標題 */
.page-hero-map { position: absolute; right: 12px; top: 12px; width: 92px; opacity: .95; }
.page-hero-map figcaption { display: none; }
.county-hero h1, .county-hero .lead { padding-right: 96px; }
@media (min-width: 900px) {
  .page-hero-map { position: static; width: auto; grid-column: 2; grid-row: 1; max-width: 300px; justify-self: center; }
  .page-hero-map figcaption { display: inline-flex; }
  .county-hero h1, .county-hero .lead { padding-right: 0; }
  .county-hero .page-hero-split { grid-template-columns: minmax(0, 1fr) 320px; }
}

.dot.gray { background: #9AA1AC; }


/* ---------- 說明頁（關於、隱私、免責、聯絡） ---------- */
.prose { max-width: 760px; padding-top: 32px; padding-bottom: 48px; font-size: 17px; line-height: 1.8; color: var(--ink-2); }
.prose h2 { margin: 32px 0 8px; font-size: 21px; color: var(--ink); font-weight: 700; }
.prose ul, .prose-list { padding-left: 22px; display: grid; gap: 8px; }
.prose .note { margin: 16px 0; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 24px; }
.foot-links a { min-height: 36px; }
.est-pending { display: flex; gap: 6px; align-items: flex-start; margin: 8px 0 0; padding: 8px 12px; border-radius: var(--r-sm); background: rgba(255,255,255,.7); font-size: 13px; color: var(--ink-2); }
.est-pending .icon { margin-top: 2px; color: var(--accent); flex: none; }
.est-pending b { color: var(--money); }
.est-pending .link-btn { min-height: 0; padding: 0 0 0 4px; font-size: 13px; }
/* 資格自檢 */
.selfcheck { background: var(--surface-2); border-radius: 16px; padding: 16px; }
.selfcheck h2 { margin-top: 0; }
.sc-list { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.sc-list label { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.sc-list input { width: 20px; height: 20px; flex: none; margin-top: 2px; accent-color: #D9440F; }
.sc-tool { background: #fff; border: 1px dashed var(--line-strong); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.sc-row { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0; }
.sc-row input { font: inherit; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 8px; }
.sc-row input[type=number] { width: 4.5em; }
.sc-out .sc-ok { display: inline; }
.sc-ok { color: #1F7A3D; }
.sc-ok .icon { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }
.sc-tool-out { margin: 0; font-size: 14px; }
.sc-out p { margin: 6px 0; }
.sc-done .btn { margin: 8px 0; }
