/* 夜行帳本 — 離線靜態樣式，無外部字型或 CDN */
:root {
  color-scheme: dark;
  --bg: #090b14;
  --bg-alt: #0e111d;
  --surface: #141829;
  --surface-2: #1c2138;
  --line: #282e4a;
  --line-2: #454d76;
  --ink: #f2f0e9;
  --ink-2: #c3c6da;
  --ink-3: #969cba;
  --amber: #ffb54a;
  --amber-hi: #ffd08a;
  --amber-ink: #1c1204;
  --rose: #ff7388;
  --jade: #63dcb4;
  --sky: #82c6ff;
  --paper: #f3eee1;
  --paper-ink: #1e1a13;
  --paper-2: #5d5647;
  --serif: "Noto Serif TC", "Source Han Serif TC", "Songti TC", "PMingLiU", serif;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --num: "Bahnschrift", "DIN Alternate", "Roboto Condensed", var(--sans);
  --mono: "Cascadia Mono", "SF Mono", Consolas, var(--sans);
  --head-h: 58px;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 16px/1.75 var(--sans);
  color: var(--ink);
  overflow-wrap: break-word;
  -webkit-tap-highlight-color: rgba(255, 181, 74, 0.18);
}
[hidden] { display: none !important; }
.no-js .js-only { display: none !important; }

h1, h2, h3, h4, h5 { font-family: var(--serif); line-height: 1.35; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: var(--amber-hi); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: #fff; text-decoration-thickness: 2px; }
a, button, label, summary, select { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
/* 固定頁首不可蓋住錨點或鍵盤焦點 */
[id], a, button, input, select, summary { scroll-margin-top: calc(var(--head-h) + 16px); }
.dest :is(a, button, summary, .table-wrap) { scroll-margin-top: calc(var(--head-h) + 90px); }

.wrap {
  width: min(1180px, 100% - 40px - env(safe-area-inset-left) - env(safe-area-inset-right));
  margin-inline: auto;
}

.skip {
  position: fixed; left: 12px; top: 10px; z-index: 100;
  padding: 10px 16px; border-radius: 8px;
  background: var(--amber); color: var(--amber-ink); font-weight: 700;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }
.skip:hover { color: var(--amber-ink); }

/* ---------- 頁首 ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  background: rgba(9, 11, 20, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--head-h); }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-weight: 800; font-size: 1.05rem;
  color: var(--ink); text-decoration: none; white-space: nowrap; letter-spacing: 0.08em;
}
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 36px;
  border: 1.5px solid var(--amber); border-radius: 6px; color: var(--amber);
  box-shadow: 0 0 14px rgba(255, 181, 74, 0.45), inset 0 0 8px rgba(255, 181, 74, 0.25);
  font-size: 1rem;
}
.top ul { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.top nav a {
  display: block; padding: 8px 12px; border-radius: 8px;
  color: var(--ink-2); text-decoration: none; font-size: 0.92rem; white-space: nowrap;
}
.top nav a:hover { background: var(--surface-2); color: #fff; }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  padding: clamp(36px, 5vw, 68px) 0 56px;
  background:
    radial-gradient(60% 55% at 12% 0%, rgba(255, 181, 74, 0.17), transparent 70%),
    radial-gradient(50% 50% at 92% 18%, rgba(255, 90, 130, 0.14), transparent 70%),
    radial-gradient(70% 40% at 55% 100%, rgba(70, 120, 255, 0.13), transparent 70%);
}
.eyebrow { margin: 0 0 18px; color: var(--amber); font-size: 0.9rem; font-weight: 700; letter-spacing: 0.14em; }
.hero h1 {
  margin: 0 0 24px;
  font-size: clamp(2.4rem, 6.4vw, 4.9rem);
  font-weight: 900; line-height: 1.14; letter-spacing: 0.01em;
}
.hero h1 span { display: block; }
.hero h1 span:last-child { color: var(--amber-hi); text-shadow: 0 0 34px rgba(255, 181, 74, 0.45); }
.lede { max-width: 62ch; margin: 0 0 28px; color: var(--ink-2); font-size: 1.02rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px;
  padding: 10px 22px; border-radius: 999px; border: 1px solid var(--amber);
  background: var(--amber); color: var(--amber-ink);
  font: 700 0.98rem var(--sans); text-decoration: none; cursor: pointer;
  transition: transform 0.15s ease;
}
.btn:hover { transform: translateY(-2px); background: var(--amber-hi); color: var(--amber-ink); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--amber); color: #fff; }
.boundaries { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.boundaries li { padding: 3px 12px; border: 1px solid var(--line-2); border-radius: 6px; color: var(--ink-2); font-size: 0.84rem; }
.meta-line { margin: 0; color: var(--ink-3); font-size: 0.84rem; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: 56px; align-items: center; }
.no-js .hero-grid { grid-template-columns: minmax(0, 1fr); }
.teaser { margin: 0; width: 100%; transform: rotate(1.6deg); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); }
.teaser dt { flex: 1 1 auto; min-width: 0; line-height: 1.45; color: var(--paper-ink); }
.teaser dt small { display: block; color: var(--paper-2); font-size: 0.72rem; }
.teaser dd { align-self: center; white-space: nowrap; }
.teaser p:not(.receipt-head) { font-size: 0.8rem; color: var(--paper-2); }

/* 招牌街 */
.street { margin-top: 52px; }
.street ul {
  position: relative; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 12px; align-items: start; margin: 0; padding: 22px 0 0; list-style: none;
}
.street ul::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--line-2); }
.street li { position: relative; }
.street li::before { content: ""; position: absolute; top: -22px; left: 50%; width: 1px; height: 22px; background: var(--line-2); }
.street li:nth-child(even) { padding-top: 22px; }
.street li:nth-child(even)::before { height: 44px; }
.sign {
  --glow: 255, 181, 74;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  min-height: 218px; padding: 18px 8px 14px; border-radius: 10px;
  border: 1.5px solid rgb(var(--glow));
  background: linear-gradient(180deg, rgba(var(--glow), 0.13), rgba(var(--glow), 0.03)), var(--bg-alt);
  box-shadow: 0 0 22px rgba(var(--glow), 0.24), inset 0 0 18px rgba(var(--glow), 0.12);
  color: var(--ink); text-decoration: none; text-align: center;
  transition: transform 0.18s ease;
  animation: light-on 0.7s ease both;
}
.street li:nth-child(2) .sign { animation-delay: 0.06s; }
.street li:nth-child(3) .sign { animation-delay: 0.12s; }
.street li:nth-child(4) .sign { animation-delay: 0.18s; }
.street li:nth-child(5) .sign { animation-delay: 0.24s; }
.street li:nth-child(6) .sign { animation-delay: 0.3s; }
.street li:nth-child(7) .sign { animation-delay: 0.36s; }
.street li:nth-child(8) .sign { animation-delay: 0.42s; }
@keyframes light-on { from { opacity: 0.25; } to { opacity: 1; } }
.sign.s1 { --glow: 255, 115, 136; }
.sign.s2 { --glow: 99, 220, 180; }
.sign.s3 { --glow: 130, 198, 255; }
.sign:hover { transform: translateY(-6px); color: #fff; text-decoration: none; box-shadow: 0 0 34px rgba(var(--glow), 0.5), inset 0 0 24px rgba(var(--glow), 0.22); }
.sign-city {
  writing-mode: vertical-rl; text-orientation: upright;
  font: 900 2.1rem/1 var(--serif); letter-spacing: 0.16em; color: rgb(var(--glow));
  text-shadow: 0 0 16px rgba(var(--glow), 0.7);
  flex: 1; min-height: 92px;
}
.sign-country { font-size: 0.82rem; color: var(--ink-2); line-height: 1.3; }
.sign-from { font: 600 0.86rem/1.3 var(--num); color: var(--ink); font-variant-numeric: tabular-nums; min-height: 2.6em; }
.sign-from small { display: block; font: 400 0.72rem var(--sans); color: var(--ink-3); }
.street-note { margin: 18px 0 0; color: var(--ink-3); font-size: 0.8rem; }

/* ---------- 區塊 ---------- */
.block { padding: clamp(56px, 7vw, 92px) 0; border-top: 1px solid var(--line); }
.block.alt { background: var(--bg-alt); }
.block-head { margin-bottom: 30px; }
.block-head h2 { margin: 0 0 6px; font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 900; }
.block-head p { margin: 0; color: var(--ink-2); }
.anchor { display: block; height: 0; }
.notice { padding: 12px 16px; border: 1px solid var(--amber); border-radius: 10px; }

/* ---------- 試算 ---------- */
.controls {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 18px 24px;
  padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend, .field { color: var(--ink-3); font-size: 0.8rem; font-weight: 500; }
legend { padding: 0; margin-bottom: 6px; }
.seg label, .chip { position: relative; cursor: pointer; }
.seg input, .chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg-row { display: flex; }
.seg label + label { margin-left: -1px; }
.seg span {
  display: grid; place-items: center; min-width: 60px; height: 42px; padding: 0 14px;
  border: 1px solid var(--line-2); background: var(--bg-alt); color: var(--ink-2);
  font-size: 0.92rem; white-space: nowrap;
}
.seg label:first-of-type span { border-radius: 10px 0 0 10px; }
.seg label:last-of-type span { border-radius: 0 10px 10px 0; }
.seg input:checked + span { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); font-weight: 700; }
.seg label:hover span { border-color: var(--amber); }
.seg input:focus-visible + span, .chip input:focus-visible + span { outline: 3px solid var(--sky); outline-offset: 2px; }
.field { display: grid; gap: 6px; }
select {
  height: 42px; min-width: 150px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background-color: var(--bg-alt); color: var(--ink);
  font: 400 0.92rem var(--sans);
}
select:hover { border-color: var(--amber); }
option { background-color: var(--bg-alt); color: var(--ink); }
.chips { flex-basis: 100%; }
.chip { display: inline-block; margin: 0 6px 6px 0; }
.chip span {
  display: block; padding: 6px 14px; border: 1px solid var(--line-2); border-radius: 999px;
  color: var(--ink-2); font-size: 0.88rem;
}
.chip:hover span { border-color: var(--amber); color: #fff; }
.chip input:checked + span { background: var(--surface-2); border-color: var(--amber); color: var(--amber-hi); font-weight: 700; }
.chip input:checked + span::before { content: "✓ "; }

.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 20px; margin: 22px 0 4px; }
.status { margin: 0; color: var(--ink-2); font-size: 0.9rem; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 0; padding: 0; list-style: none; color: var(--ink-2); font-size: 0.82rem; }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.swatch { display: inline-block; width: 26px; height: 10px; border-radius: 4px; }
.solid { background: var(--amber); }
.hatch, .is-hatch .bar { background: repeating-linear-gradient(135deg, var(--amber) 0 2.5px, rgba(255, 181, 74, 0.2) 2.5px 6px); box-shadow: inset 0 0 0 1px var(--amber); }

.axis, .row-btn { display: grid; grid-template-columns: minmax(0, 17rem) minmax(0, 1fr) 10.5rem; gap: 18px; }
.axis { padding: 0 14px; height: 24px; align-items: end; color: var(--ink-3); font: 400 0.76rem var(--num); }
#finder-axis { position: relative; height: 18px; }
#finder-axis span { position: absolute; bottom: 0; transform: translateX(-50%); white-space: nowrap; font-variant-numeric: tabular-nums; }
#finder-axis span:first-child { transform: none; }

.rows { margin: 0; padding: 0; list-style: none; }
.rows > li { border-top: 1px solid var(--line); }
.rows > li:last-child { border-bottom: 1px solid var(--line); }
.row-btn {
  width: 100%; align-items: center; padding: 12px 14px; border: 0; background: transparent;
  color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.row-btn:hover { background: var(--surface); }
.row-btn[aria-expanded="true"] { background: var(--surface-2); }
.row-btn:focus-visible { outline-offset: -3px; }
.r-name { display: block; min-width: 0; font-size: 0.94rem; line-height: 1.45; }
.track { position: relative; display: block; height: 26px; background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: var(--step, 25%) 100%; border-right: 1px solid var(--line); }
.bar { position: absolute; top: 8px; height: 10px; min-width: 8px; border-radius: 4px; background: var(--amber); left: var(--a); width: var(--w); }
.is-apart .bar { background: transparent; box-shadow: none; border: 1.5px dashed var(--ink-2); }
.capline { position: absolute; top: -4px; bottom: -4px; left: var(--cap); border-left: 2px dashed var(--rose); }
.r-val { display: block; text-align: right; font: 600 1.08rem/1.3 var(--num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.r-val small { display: block; font: 400 0.74rem var(--sans); color: var(--ink-3); }

.tag {
  display: inline-block; margin-left: 8px; padding: 0 7px; border-radius: 5px;
  border: 1px solid currentColor; font: 500 0.7rem/1.7 var(--sans); white-space: nowrap; vertical-align: 0.08em;
}
.tag-official { color: var(--jade); }
.tag-public { color: var(--sky); }
.tag-mixed { color: var(--amber-hi); }
.tag-est { color: var(--amber); border-style: dashed; }
.tag-broker { color: var(--rose); border-style: dashed; }
.tag-partial, .tag-room, .tag-unpriced { color: var(--ink-2); border-style: dotted; }
.chart-note { margin: 14px 2px 0; color: var(--ink-3); font-size: 0.84rem; }

/* 帳單明細 */
.detail { padding: 8px 14px 26px; background: var(--surface-2); }
.receipt {
  position: relative; max-width: 640px; margin-inline: auto; padding: 24px 26px 28px;
  background: var(--paper); color: var(--paper-ink); font-size: 0.9rem;
  --tooth: 7px;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(var(--tooth) * 2) 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(var(--tooth) * 2) 100%;
}
.receipt a { color: #7a3e00; font-weight: 700; }
.receipt a:hover { color: #000; }
.receipt :focus-visible { outline-color: #0a52a8; }
.receipt-head { margin: 0 0 10px; padding-bottom: 10px; border-bottom: 2px dashed #b9b09c; font: 700 0.86rem var(--mono); letter-spacing: 0.08em; }
.receipt dl { margin: 0 0 12px; }
.receipt dl div { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; border-bottom: 1px dotted #c8c0ad; }
.receipt:not(.teaser) dt { flex: none; }
.receipt dt { color: var(--paper-2); }
.receipt dd { margin: 0; text-align: right; font: 600 1.05rem var(--num); font-variant-numeric: tabular-nums; }
.receipt dd.text { font: 400 0.88rem var(--sans); }
.receipt p { margin: 0 0 10px; }
.receipt p.receipt-label { margin: 12px 0 2px; font-weight: 700; font-size: 0.8rem; color: var(--paper-2); }

.empty { padding: 36px 16px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--ink-2); }
.apart { margin-top: 40px; }
.apart h3 { margin: 0 0 4px; font-size: 1.15rem; }
.apart > p { margin: 0 0 14px; color: var(--ink-3); font-size: 0.88rem; }

details.method { margin-top: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
details.method summary { padding: 14px 18px; cursor: pointer; font-weight: 700; }
details.method summary:hover { color: var(--amber-hi); }
details.method p { margin: 0; padding: 0 18px 18px; color: var(--ink-2); font-size: 0.92rem; }

/* ---------- 分頁 ---------- */
[data-tabs] { scroll-margin-top: calc(var(--head-h) + 8px); }
.tablist { position: relative; display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; padding: 6px 2px 10px; margin-bottom: 18px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.tablist button {
  flex: none; padding: 10px 18px; border: 1px solid var(--line-2); border-radius: 999px;
  background: transparent; color: var(--ink-2); font: 500 0.95rem var(--sans); cursor: pointer;
}
.tablist button:hover { border-color: var(--amber); color: #fff; }
.tablist button[aria-selected="true"] { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); font-weight: 700; }
.tablist.small button { padding: 6px 13px; font-size: 0.86rem; }
.tablist.sticky { position: sticky; top: calc(var(--head-h) + env(safe-area-inset-top)); z-index: 20; background: var(--bg); padding-top: 12px; }
.js [role="tabpanel"] { scroll-margin-top: calc(var(--head-h) + 90px); }
.panel-title { margin: 20px 0 8px; font: 700 1.05rem var(--serif); color: var(--amber-hi); }
.js .panel-title { display: none; }
.tabpanel > h3:first-child { margin-top: 0; }

.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.filter { display: flex; flex-wrap: wrap; gap: 6px; }
.filter button {
  padding: 5px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: transparent;
  color: var(--ink-2); font: 400 0.85rem var(--sans); cursor: pointer;
}
.filter button:hover { border-color: var(--amber); color: #fff; }
.filter button[aria-pressed="true"] { background: var(--surface-2); border-color: var(--amber); color: var(--amber-hi); font-weight: 700; }
.link-btn { border: 0; background: none; padding: 6px 0; color: var(--amber-hi); font: 500 0.88rem var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: #fff; text-decoration-thickness: 2px; }

/* ---------- 表格 ---------- */
.caption { color: var(--ink-3); font-size: 0.9rem; }
.prose { max-width: 78ch; color: var(--ink-2); }
.table-wrap { margin: 18px 0 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-variant-numeric: tabular-nums; }
tbody tr:last-child > * { border-bottom: 0; }
thead th { background: var(--surface-2); color: var(--ink-2); font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
tbody th { font-weight: 700; }
tbody tr:hover { background: rgba(255, 181, 74, 0.05); }
.sort-btn { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.sort-btn::after { content: " ↕"; opacity: 0.45; }
.sort-btn:hover { color: #fff; }
th[aria-sort="ascending"] .sort-btn::after { content: " ↑"; opacity: 1; color: var(--amber); }
th[aria-sort="descending"] .sort-btn::after { content: " ↓"; opacity: 1; color: var(--amber); }
.t-price table { min-width: 720px; }
.t-price tbody th { width: 21%; }
.t-price td.num { font: 500 0.96rem/1.6 var(--num); }
#party-table td:last-child { width: 24%; }
#compare-table td:last-child { width: 28%; }
.t-price .tag { display: table; margin: 6px 0 0; }
.why summary { cursor: pointer; color: var(--amber-hi); font-size: 0.85rem; white-space: nowrap; }
.why summary:hover { color: #fff; }
.why > div { margin-top: 8px; color: var(--ink-2); font-size: 0.85rem; min-width: 0; }
.t-price tr:has(.why[open]) td:last-child { width: 42%; }
.t-stack td.num { white-space: normal; }
.t-stack table { min-width: 720px; }

/* 一律卡片 */
.t-cards { border: 0; background: none; overflow: visible; }
.t-cards table, .t-cards tbody, .t-cards tr, .t-cards th, .t-cards td { display: block; width: 100%; }
.t-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.t-cards tbody { display: grid; gap: 14px; }
.t-cards tr { padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.t-cards tr:hover { background: var(--surface); border-color: var(--line-2); }
.t-cards th, .t-cards td { border: 0; padding: 0; }
.t-cards tbody th { margin-bottom: 10px; font: 700 1.15rem/1.4 var(--serif); color: var(--amber-hi); }
.t-cards td { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 14px; padding: 8px 0; border-top: 1px solid var(--line); text-align: left; }
.t-cards td::before { content: attr(data-label); color: var(--ink-3); font-size: 0.8rem; }
.t-cards td a { overflow-wrap: anywhere; }
.t-cards td > div { min-width: 0; }
.t-price .sub { display: block; margin-top: 2px; color: var(--ink-2); font-size: 0.86rem; }

@media (max-width: 760px) {
  .t-price table, .t-stack table { min-width: 0; }
  :is(.t-price, .t-stack) { border: 0; background: none; overflow: visible; }
  :is(.t-price, .t-stack) :is(table, tbody, tr, th, td) { display: block; width: auto !important; }
  :is(.t-price, .t-stack) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  :is(.t-price, .t-stack) tr { margin-bottom: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  :is(.t-price, .t-stack) :is(th, td) { border: 0; padding: 0; }
  :is(.t-price, .t-stack) tbody th { margin-bottom: 8px; font-size: 1rem; color: var(--amber-hi); }
  :is(.t-price, .t-stack) td { padding: 7px 0; border-top: 1px solid var(--line); text-align: left; white-space: normal; }
  :is(.t-price, .t-stack) td::before { content: attr(data-label); display: block; color: var(--ink-3); font-size: 0.76rem; font-family: var(--sans); }
  :is(.t-price, .t-stack) td:last-child:has(.why)::before { display: none; }
  .t-price .tag { display: inline-block; margin: 0 0 0 8px; }
}

/* ---------- 目的地 ---------- */
.dest { padding-top: 6px; }
.js .dest { animation: light-on 0.25s ease; }
.dest-title { margin: 10px 0 18px; font-size: 1.9rem; font-weight: 900; color: var(--amber-hi); }
.no-js .dest { margin-bottom: 64px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1px; margin: 0 0 18px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.facts div { padding: 16px 18px; background: var(--surface); }
.facts dt { color: var(--ink-3); font-size: 0.78rem; }
.facts dd { margin: 4px 0 0; font-weight: 700; line-height: 1.5; }
.dest h4 { margin: 40px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 1.3rem; }
.dest h5 { margin: 28px 0 10px; font-size: 1.08rem; color: var(--ink); }
.dest > p, .dest .group > p, .dest .bill-card > p, .dest .sub > p { max-width: 78ch; }
.dest .group { margin-top: 6px; }
.dest .group-head h4 { margin-top: 36px; }
.js .tabs .tabpanel > .group-head { display: none; }
.dest .tabs .tabpanel > .group-head + * { margin-top: 0; }

/* 提醒方塊：info 天藍、warn 琥珀、danger 玫瑰 */
.callout { --c: 255, 181, 74; margin: 16px 0; padding: 16px 20px; border: 1px solid rgba(var(--c), 0.6); border-radius: var(--radius); background: rgba(var(--c), 0.08); color: var(--ink-2); }
.callout.info { --c: 130, 198, 255; }
.callout.danger { --c: 255, 115, 136; }
.callout strong { display: block; margin-bottom: 2px; color: rgb(var(--c)); }
.callout > div { color: var(--ink); }

/* 店家卡片 */
.venue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; margin: 14px 0 22px; }
.venue-card { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.dest .venue-card h5 { margin: 0 0 6px; font: 700 1.05rem/1.45 var(--serif); color: var(--amber-hi); }
.venue-card .badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.badge { display: inline-block; padding: 0 8px; border: 1px solid currentColor; border-radius: 5px; font: 500 0.72rem/1.75 var(--sans); }
.badge-pub { color: var(--sky); }
.badge-ok { color: var(--jade); }
.badge-est { color: var(--amber); border-style: dashed; }
.badge-warn { color: var(--rose); border-style: dashed; }
.badge-muted { color: var(--ink-3); border-style: dotted; }
.kv { display: grid; grid-template-columns: 5.6rem minmax(0, 1fr); gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 0.9rem; }
.kv .k { color: var(--ink-3); font-size: 0.78rem; }
.kv .v { color: var(--ink-2); overflow-wrap: anywhere; }
.venue-card .area { align-self: flex-start; margin-bottom: 4px; padding: 0 8px; border-radius: 5px; background: var(--surface-2); color: var(--ink-2); font-size: 0.76rem; }
.venue-card .maps { margin-top: auto; padding-top: 10px; font-size: 0.86rem; }
details.fold { margin: 16px 0 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
details.fold > summary { padding: 12px 18px; cursor: pointer; color: var(--amber-hi); font-size: 0.9rem; font-weight: 500; }
details.fold > summary:hover { color: #fff; }
details.fold .table-wrap { margin: 0 12px 12px; }
.bill-card { margin: 8px 0 18px; }

/* 韓國層級金字塔：上窄下寬 */
.tier-pyramid { display: grid; gap: 6px; margin: 18px auto 24px; padding: 0; max-width: 760px; list-style: none; }
.tier-pyramid li { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 14px; margin-inline: auto; padding: 12px 18px; border: 1px solid rgba(255, 181, 74, var(--a, 0.6)); border-radius: 10px; background: rgba(255, 181, 74, var(--b, 0.1)); text-align: center; }
.tier-pyramid li:nth-child(1) { width: 52%; --a: 0.95; --b: 0.2; }
.tier-pyramid li:nth-child(2) { width: 64%; --a: 0.8; --b: 0.16; }
.tier-pyramid li:nth-child(3) { width: 76%; --a: 0.65; --b: 0.12; }
.tier-pyramid li:nth-child(4) { width: 88%; --a: 0.5; --b: 0.08; }
.tier-pyramid li:nth-child(5) { width: 100%; --a: 0.35; --b: 0.05; }
.tier-pyramid strong { color: var(--amber-hi); font-family: var(--serif); }
.tier-pyramid span { color: var(--ink-2); font-size: 0.86rem; }
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin: 0 0 18px; padding: 0; list-style: none; }
.steps li { counter-increment: step; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 0.92rem; color: var(--ink-2); }
.steps li::before { content: counter(step, decimal-leading-zero); display: block; margin-bottom: 6px; font: 700 1.5rem/1 var(--num); color: var(--amber); }
.step-title { margin-bottom: 6px; color: var(--ink); font-weight: 700; font-size: 1rem; }
.props { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.props dt { color: var(--ink-3); }
.props dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- 守則與來源 ---------- */
.universal { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 0 0 32px; padding: 0; list-style: none; }
.universal li { padding: 20px; border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--ink-2); font-size: 0.92rem; }
.universal strong { display: block; margin-bottom: 6px; font: 900 1.25rem var(--serif); color: var(--amber-hi); }
.caution-list { columns: 2 380px; column-gap: 36px; margin: 0; padding-left: 1.2em; color: var(--ink-2); font-size: 0.92rem; }
.caution-list li { margin-bottom: 12px; break-inside: avoid; }
.sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.source { display: flex; flex-direction: column; height: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; transition: transform 0.15s ease; }
.source:hover { transform: translateY(-2px); border-color: var(--amber); background: var(--surface); text-decoration: none; }
.source h3 { margin: 0 0 4px; font: 700 0.95rem/1.45 var(--sans); }
.source .site { color: var(--ink-2); font-size: 0.8rem; overflow-wrap: anywhere; }
.source .date { margin-top: auto; padding-top: 4px; color: var(--ink-3); font: 400 0.76rem var(--num); }

footer { padding: 36px 0 calc(48px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--ink-3); font-size: 0.86rem; }

/* ---------- 窄螢幕 ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .teaser { max-width: 420px; transform: none; }
  .street ul { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 14px; padding-top: 0; }
  .street ul::before, .street li::before { display: none; }
  .street li:nth-child(even) { padding-top: 0; }
  .sign { min-height: 188px; height: 100%; }
  .axis { grid-template-columns: minmax(0, 1fr); }
  .axis > span { display: none; }
  .row-btn { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name val" "track track"; gap: 4px 12px; }
  .r-name { grid-area: name; }
  .r-val { grid-area: val; }
  .track { grid-area: track; }
}
@media (max-width: 600px) {
  :root { --head-h: 54px; }
  .wrap { width: calc(100% - 28px - env(safe-area-inset-left) - env(safe-area-inset-right)); }
  .top .wrap { gap: 8px; }
  .brand-mark { width: 28px; height: 34px; }
  .brand-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .top ul { gap: 0; }
  .top nav a { padding: 10px 9px; font-size: 0.88rem; }
  .controls { padding: 16px 14px; }
  .seg, .field { width: 100%; }
  .seg label { flex: 1; }
  .seg span { min-width: 0; width: 100%; padding: 0 4px; }
  select { width: 100%; font-size: 1rem; }
  .sign { padding: 14px 4px 10px; min-height: 176px; }
  .sign-city { font-size: 1.6rem; }
  .detail { padding-inline: 6px; }
  .receipt { padding: 18px 16px 24px; }
  .receipt dl div { flex-wrap: wrap; }
  .t-cards td { display: block; }
  .t-cards td::before { display: block; margin-bottom: 2px; }
  .t-cards tr { padding: 16px; }
  .props { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .props dd { margin-bottom: 10px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div { padding: 12px; }
  .facts div:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

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

@media print {
  :root { color-scheme: light; --ink: #000; --ink-2: #222; --ink-3: #555; --surface: #fff; --surface-2: #eee; --bg: #fff; --bg-alt: #fff; --line: #bbb; --amber: #8a5200; --amber-hi: #6b4000; }
  html, body { background: #fff; }
  .top, .street, .finder, .teaser, .tablist, .toolbar, .skip, .actions { display: none !important; }
  .js [role="tabpanel"][hidden] { display: block !important; }
  .js .panel-title { display: block; }
}
