/* =========================================================
   台灣生活試算工具箱 — 全站共用樣式
   mayren.pages.dev
   ========================================================= */

/* ---------- 1. 設計變數（亮色 / 暗色） ---------- */
:root {
  --c-bg: #f5f7fb;
  --c-surface: #ffffff;
  --c-surface-2: #eef2f8;
  --c-text: #172033;
  --c-text-soft: #4a556b;
  --c-muted: #6b7489;
  --c-border: #d8deea;
  --c-primary: #0b63ce;
  --c-primary-hover: #0952ab;
  --c-primary-soft: #e4efff;
  --c-accent: #0e8a5f;
  --c-accent-soft: #e3f6ee;
  --c-warn: #b45309;
  --c-warn-soft: #fff4e0;
  --c-danger: #c0262d;
  --c-danger-soft: #fdecec;
  --c-highlight: #0b3d7a;
  --c-may: #db2777;   /* 品牌 May：粉紅 */
  --c-ren: #0b63ce;   /* 品牌 Ren：藍 */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, .08);
  --radius: 14px;
  --radius-sm: 9px;
  --header-h: 60px;
  --maxw: 1120px;
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Heiti TC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-num: ui-monospace, "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-bg: #0f141c;
    --c-surface: #171e2a;
    --c-surface-2: #1f2836;
    --c-text: #e7ecf4;
    --c-text-soft: #b9c2d3;
    --c-muted: #8f9ab0;
    --c-border: #2c3747;
    --c-primary: #5aa2ff;
    --c-primary-hover: #7fb7ff;
    --c-primary-soft: #19304f;
    --c-accent: #3ccf95;
    --c-accent-soft: #143528;
    --c-warn: #f0b056;
    --c-warn-soft: #3a2a12;
    --c-danger: #ff7a7f;
    --c-danger-soft: #3b1a1c;
    --c-highlight: #cfe3ff;
    --c-may: #f472b6;
    --c-ren: #5aa2ff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 18px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

/* ---------- 2. 基礎重設 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--c-text);
  background: var(--c-bg);
  overflow-x: hidden;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--c-primary); text-underline-offset: 3px; }
a:hover { color: var(--c-primary-hover); }
h1, h2, h3, h4 { line-height: 1.35; margin: 1.6em 0 .6em; color: var(--c-text); }
h1 { font-size: clamp(1.55rem, 4.2vw, 2.15rem); margin-top: .3em; letter-spacing: .01em; }
h2 { font-size: clamp(1.25rem, 3vw, 1.5rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; }
li { margin-bottom: .35em; }
hr { border: 0; border-top: 1px solid var(--c-border); margin: 2rem 0; }
code, .num { font-family: var(--font-num); }
:focus-visible { outline: 3px solid var(--c-primary); outline-offset: 2px; border-radius: 4px; }
.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;
}
.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 1000;
  background: var(--c-primary); color: #fff; padding: 8px 14px; border-radius: 8px;
}
.skip-link:focus { left: 8px; color: #fff; }

/* ---------- 3. 版面容器 ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
main { display: block; padding: 20px 0 48px; }

/* ---------- 4. 頂部導覽列（由 common.js 注入） ---------- */
#site-header { min-height: var(--header-h); } /* 預留高度，避免 CLS */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--header-h); gap: 12px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.08rem; color: var(--c-text); text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--c-primary); }
.brand-logo { width: 32px; height: 32px; flex: none; }
.brand .may, .may { color: var(--c-may); }
.brand .ren, .ren { color: var(--c-ren); }
.brand small { font-weight: 500; color: var(--c-muted); font-size: .78rem; display: block; line-height: 1.1; }

.nav-toggle {
  display: none; background: transparent; border: 1px solid var(--c-border);
  color: var(--c-text); border-radius: 10px; width: 44px; height: 44px; cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle svg { width: 22px; height: 22px; }

.site-nav ul { list-style: none; display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; }
.site-nav li { margin: 0; position: relative; }
.site-nav a, .site-nav .nav-drop-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 12px; border-radius: 9px; font-size: .95rem; font-weight: 600;
  color: var(--c-text-soft); text-decoration: none; background: transparent; border: 0;
  cursor: pointer; font-family: inherit; line-height: 1.4;
}
.site-nav a:hover, .site-nav .nav-drop-btn:hover { background: var(--c-surface-2); color: var(--c-text); }
.site-nav a[aria-current="page"] { color: var(--c-primary); background: var(--c-primary-soft); }
.nav-drop-btn svg { width: 14px; height: 14px; transition: transform .2s; }
.nav-drop[aria-expanded="true"] .nav-drop-btn svg { transform: rotate(180deg); }
.nav-menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 300px;
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 12px;
  box-shadow: var(--shadow-md); padding: 8px; display: none !important; flex-direction: column;
}
.nav-drop[aria-expanded="true"] .nav-menu { display: flex !important; }
.nav-menu a { display: flex; flex-direction: column; align-items: flex-start; gap: 0; width: 100%; padding: 9px 12px; }
.nav-menu a span { font-size: .8rem; font-weight: 400; color: var(--c-muted); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--c-surface); border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow-md); display: none; max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; padding: 8px 16px 16px; gap: 2px; }
  .site-nav a, .site-nav .nav-drop-btn { width: 100%; padding: 12px; font-size: 1rem; }
  .nav-drop-btn { display: none !important; }
  .nav-menu {
    position: static; display: flex !important; box-shadow: none; border: 0;
    padding: 0 0 6px; min-width: 0; background: transparent;
  }
  .nav-menu a { padding-left: 12px; }
}

/* ---------- 5. 麵包屑 ---------- */
.breadcrumb { font-size: .86rem; color: var(--c-muted); margin: 4px 0 4px; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "›"; margin: 0 6px 0 2px; color: var(--c-muted); }
.breadcrumb a { color: var(--c-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--c-primary); text-decoration: underline; }

.page-intro { color: var(--c-text-soft); font-size: 1.02rem; max-width: 760px; }
.updated { font-size: .84rem; color: var(--c-muted); }

/* ---------- 6. 卡片與工具版面 ---------- */
.card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px;
}
.card + .card { margin-top: 16px; }
.tool-layout > .card + .card { margin-top: 0; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }

.tool-layout { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; margin-top: 16px; }
.tool-layout > * { min-width: 0; }
@media (min-width: 900px) {
  .tool-layout { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 20px; }
  .tool-layout .tool-form { position: sticky; top: calc(var(--header-h) + 14px); }
}

/* ---------- 7. 表單 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 480px) { .form-grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; min-width: 0; }
.field > label, .field > .label {
  font-weight: 700; font-size: .93rem; margin-bottom: 6px; color: var(--c-text);
}
.field .hint { font-size: .8rem; color: var(--c-muted); margin-top: 5px; line-height: 1.5; }
.input-wrap { position: relative; display: flex; align-items: stretch; }
.input-wrap .unit {
  display: inline-flex; align-items: center; padding: 0 12px; font-size: .88rem;
  color: var(--c-muted); background: var(--c-surface-2); border: 1px solid var(--c-border);
  border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; white-space: nowrap;
}
.input-wrap .unit-pre {
  border-left: 1px solid var(--c-border); border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.input-wrap input:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-wrap .unit-pre + input { border-top-left-radius: 0; border-bottom-left-radius: 0; }

input[type="text"], input[type="number"], input[type="email"], select, textarea {
  width: 100%; min-width: 0; font: inherit; font-size: 16px; /* 16px 避免 iOS 自動放大 */
  color: var(--c-text); background: var(--c-surface);
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  padding: 10px 12px; min-height: 46px; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-soft);
}
input.is-invalid, select.is-invalid { border-color: var(--c-danger); box-shadow: 0 0 0 3px var(--c-danger-soft); }
.field-error { color: var(--c-danger); font-size: .82rem; margin-top: 5px; font-weight: 600; }
.field-error:empty { display: none; }

/* 分段選擇（radio pill） */
.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  flex: 1 1 auto; text-align: center; padding: 9px 12px; border: 1px solid var(--c-border);
  border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: .92rem;
  color: var(--c-text-soft); background: var(--c-surface); min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
}
.segmented input:checked + label { border-color: var(--c-primary); background: var(--c-primary-soft); color: var(--c-primary); }
.segmented input:focus-visible + label { outline: 3px solid var(--c-primary); outline-offset: 2px; }

.fieldset { border: 1px dashed var(--c-border); border-radius: var(--radius-sm); padding: 14px; margin: 0; }
.fieldset legend { font-weight: 700; font-size: .9rem; padding: 0 6px; color: var(--c-text-soft); }
.is-hidden { display: none !important; }

/* ---------- 8. 按鈕 ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer;
  padding: 11px 20px; min-height: 48px; border-radius: var(--radius-sm);
  border: 1px solid transparent; text-decoration: none; transition: background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--c-primary); color: #fff; flex: 1 1 160px; }
.btn-primary:hover { background: var(--c-primary-hover); color: #fff; }
.btn-ghost { background: var(--c-surface); color: var(--c-text); border-color: var(--c-border); }
.btn-ghost:hover { background: var(--c-surface-2); color: var(--c-text); }
.btn-sm { min-height: 38px; padding: 6px 12px; font-size: .88rem; }
.btn svg { width: 18px; height: 18px; }

/* ---------- 9. 計算結果 ---------- */
.result-empty {
  text-align: center; color: var(--c-muted); padding: 36px 16px;
  border: 2px dashed var(--c-border); border-radius: var(--radius);
}
.result-hero {
  background: linear-gradient(135deg, var(--c-primary-soft), var(--c-accent-soft));
  border: 1px solid var(--c-border); border-radius: var(--radius); padding: 20px; margin-bottom: 14px;
}
.result-hero .label { font-size: .92rem; font-weight: 700; color: var(--c-text-soft); }
.result-hero .value {
  font-size: clamp(2rem, 7vw, 2.7rem); font-weight: 800; color: var(--c-highlight);
  line-height: 1.2; font-variant-numeric: tabular-nums; word-break: break-all;
}
.result-hero .value small { font-size: .45em; font-weight: 700; margin-left: 4px; }
.result-hero .sub { font-size: .9rem; color: var(--c-text-soft); margin-top: 4px; }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .stat-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat {
  background: var(--c-surface-2); border-radius: var(--radius-sm); padding: 12px 14px; min-width: 0;
}
.stat .k { font-size: .82rem; color: var(--c-muted); font-weight: 600; }
.stat .v { font-size: 1.22rem; font-weight: 800; font-variant-numeric: tabular-nums; word-break: break-all; }
.stat .v small { font-size: .72em; font-weight: 600; color: var(--c-text-soft); margin-left: 2px; }
.stat.good .v { color: var(--c-accent); }
.stat.bad .v { color: var(--c-danger); }

.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.notice {
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: .92rem; margin: 14px 0;
  background: var(--c-primary-soft); border-left: 4px solid var(--c-primary);
}
.notice.warn { background: var(--c-warn-soft); border-left-color: var(--c-warn); }
.notice.danger { background: var(--c-danger-soft); border-left-color: var(--c-danger); }
.notice.good { background: var(--c-accent-soft); border-left-color: var(--c-accent); }
.notice p:last-child { margin-bottom: 0; }

/* 長條圖（SVG） */
.chart-wrap { margin-top: 16px; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.chart-legend { display: flex; gap: 16px; font-size: .84rem; color: var(--c-text-soft); margin-top: 6px; flex-wrap: wrap; }
.chart-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- 10. 表格 ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 12px 0 18px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; background: var(--c-surface); }
caption { caption-side: top; text-align: left; font-weight: 700; padding: 10px 12px; color: var(--c-text-soft); background: var(--c-surface-2); }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--c-border); text-align: left; vertical-align: top; }
thead th { background: var(--c-surface-2); font-weight: 700; white-space: nowrap; position: sticky; top: 0; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody tr:nth-child(even) { background: color-mix(in srgb, var(--c-surface-2) 45%, transparent); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-scroll { max-height: 440px; overflow-y: auto; }

/* ---------- 11. 廣告版位 ---------- */
/* 預設隱藏：尚未設定 AdSense 前不顯示空白框（避免審查時被視為未完成頁面）。
   common.js 偵測到 ADSENSE_CLIENT 或網址加上 ?debug_ads=1 時才會加上 .ads-on */
.ad-slot { display: none; }
.ads-on .ad-slot {
  display: block; margin: 20px auto; min-height: 100px; width: 100%; text-align: center; overflow: hidden;
}
.ads-on .ad-slot::before {
  content: "廣告"; display: block; font-size: .72rem; color: var(--c-muted); letter-spacing: .1em; margin-bottom: 4px;
}
.ads-debug .ad-slot {
  background: repeating-linear-gradient(45deg, var(--c-surface-2), var(--c-surface-2) 10px, var(--c-surface) 10px, var(--c-surface) 20px);
  border: 1px dashed var(--c-border); border-radius: var(--radius-sm);
  display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--c-muted); font-size: .85rem;
}
.ads-debug .ad-slot::after { content: attr(data-slot-name); }
.ad-slot-top { min-height: 90px; }

/* ---------- 12. 聯盟推薦卡片 ---------- */
.affiliate-box {
  margin: 20px 0; border: 1px solid var(--c-border); border-radius: var(--radius);
  background: var(--c-surface); padding: 18px; box-shadow: var(--shadow-sm);
}
.affiliate-box > h2, .affiliate-box > h3 { margin: 0 0 4px; font-size: 1.12rem; display: flex; align-items: center; gap: 8px; }
.affiliate-box .aff-disclosure { font-size: .78rem; color: var(--c-muted); margin-bottom: 12px; }
.aff-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .aff-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .aff-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.aff-card {
  display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--c-border);
  border-radius: var(--radius-sm); padding: 14px; background: var(--c-surface-2); min-width: 0;
}
.aff-card .aff-tag {
  align-self: flex-start; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--c-accent-soft); color: var(--c-accent);
}
.aff-card h4 { margin: 0; font-size: 1rem; }
.aff-card p { margin: 0; font-size: .88rem; color: var(--c-text-soft); flex: 1; line-height: 1.6; }
.aff-card .btn { margin-top: 6px; min-height: 42px; font-size: .92rem; }

/* ---------- 13. 文章內容區 ---------- */
.prose { max-width: 820px; }
.prose h2 { padding-top: .4em; border-top: 1px solid var(--c-border); }
.prose h2:first-child { border-top: 0; padding-top: 0; }
.formula {
  background: var(--c-surface-2); border-radius: var(--radius-sm); padding: 12px 16px;
  font-family: var(--font-num); font-size: .92rem; overflow-x: auto; white-space: pre-wrap; line-height: 1.7;
  border-left: 4px solid var(--c-primary);
}
.toc { background: var(--c-surface-2); border-radius: var(--radius-sm); padding: 12px 18px; margin: 16px 0; font-size: .92rem; }
.toc strong { display: block; margin-bottom: 4px; }
.toc ol { margin: 0; }

/* FAQ */
.faq details {
  border: 1px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-surface);
  margin-bottom: 10px; overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 14px 44px 14px 16px; font-weight: 700; position: relative; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-size: 1.3rem; color: var(--c-primary); font-weight: 400;
}
.faq details[open] summary::after { content: "−"; }
.faq details[open] summary { border-bottom: 1px solid var(--c-border); background: var(--c-surface-2); }
.faq .faq-a { padding: 12px 16px 4px; color: var(--c-text-soft); }

/* 相關工具 / 首頁工具卡 */
.tool-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 16px 0; }
@media (min-width: 640px) { .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px) { .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tool-card {
  display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: var(--radius);
  background: var(--c-surface); border: 1px solid var(--c-border); box-shadow: var(--shadow-sm);
  text-decoration: none; color: var(--c-text); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--c-primary); color: var(--c-text); }
.tool-card .icon {
  width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--c-primary-soft); font-size: 1.4rem;
}
.tool-card h3 { margin: 0; font-size: 1.08rem; }
.tool-card p { margin: 0; font-size: .9rem; color: var(--c-text-soft); flex: 1; }
.tool-card .go { font-weight: 700; color: var(--c-primary); font-size: .9rem; }

.hero {
  padding: 28px 0 8px;
}
.hero h1 { margin-bottom: .3em; }
.hero p { font-size: 1.06rem; color: var(--c-text-soft); max-width: 720px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.pill-row li { margin: 0; font-size: .85rem; padding: 4px 12px; border-radius: 999px; background: var(--c-surface); border: 1px solid var(--c-border); color: var(--c-text-soft); }

/* ---------- 14. 頁尾 ---------- */
.site-footer {
  background: var(--c-surface); border-top: 1px solid var(--c-border); padding: 32px 0 24px;
  font-size: .9rem; color: var(--c-text-soft); margin-top: 24px;
}
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 2fr 1.4fr 1fr; } }
.site-footer h2 { font-size: .95rem; margin: 0 0 8px; color: var(--c-text); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--c-text-soft); text-decoration: none; }
.site-footer a:hover { color: var(--c-primary); text-decoration: underline; }
.footer-bottom { border-top: 1px solid var(--c-border); margin-top: 22px; padding-top: 16px; font-size: .82rem; color: var(--c-muted); }

/* ---------- 15. Toast 提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: #1d2433; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: .92rem;
  box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 999;
  max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 16. 列印 ---------- */
@media print {
  .site-header, .site-footer, .ad-slot, .affiliate-box, .btn-row, .result-actions, .nav-toggle, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border-color: #ccc; }
  .tool-layout { grid-template-columns: 1fr; }
}

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