/* ============================================================
   台中重劃區與建案指南 — 全站設計系統（唯一 CSS，合併所有頁面）
   主題：都市計畫／地籍圖靈感。白天為預設；夜晚由 <html data-theme="dark"> 切換。
   字體：Noto Serif SC（標題）＋ Noto Sans SC（內文），自托管鏡像 + 系統 fallback。
   ============================================================ */

/* ---------- 設計 Token ---------- */
:root {
  --font-serif: 'Noto Serif SC', 'Songti TC', 'PMingLiU', 'MingLiU', serif;
  --font-sans: 'Noto Sans SC', 'PingFang TC', 'Microsoft JhengHei', 'Heiti TC', 'Segoe UI', sans-serif;

  --bg: #F6F5F1;            /* 紙面 */
  --bg-2: #EFEEE8;
  --surface: #FFFFFF;
  --surface-2: #FBFAF7;
  --ink: #232A31;
  --ink-2: #454F58;
  --muted: #6E767D;
  --line: #D9DCD3;
  --line-2: #E8EAE2;
  --accent: #0E6B5C;        /* 墨綠＝都市計畫主色 */
  --accent-2: #0B4F44;
  --accent-ink: #FFFFFF;
  --accent-soft: #E2EFEA;
  --warn: #9A5B2F;
  --warn-soft: #F6ECE2;
  --shadow: 0 1px 2px rgba(23, 28, 24, .05), 0 10px 28px rgba(23, 28, 24, .08);
  --shadow-sm: 0 1px 2px rgba(23, 28, 24, .06);
  --radius: 8px;
  --radius-sm: 6px;
  --header-h: 64px;
  --maxw: 1200px;

  /* 台中 9 行政區 + 建案識別色（樹狀圖／treemap／知識圖譜／側欄樹／徽章共用） */
  --c-xitun: #1F7A5C;
  --c-nantun: #3E8E6E;
  --c-beitun: #0E6B5C;
  --c-south: #2E8B7A;
  --c-east: #5A8F6E;
  --c-wuri: #4A9078;
  --c-taiping: #B0713B;
  --c-dali: #A85E3C;
  --c-shalu: #C08A4A;
  --c-fengyuan: #9A6B3F;
  --c-projects: #D98E4A;
}

html[data-theme="dark"] {
  --bg: #14181D;
  --bg-2: #181D23;
  --surface: #1D232A;
  --surface-2: #222930;
  --ink: #E8E6DE;
  --ink-2: #B9BDB6;
  --muted: #8B918B;
  --line: #2C343D;
  --line-2: #333C46;
  --accent: #54B8A0;
  --accent-2: #7FD4BE;
  --accent-ink: #0B201C;
  --accent-soft: #1E3530;
  --warn: #D9A06B;
  --warn-soft: #3A2C1E;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --c-xitun: #5FBF9E;
  --c-nantun: #6FC7A6;
  --c-beitun: #54B8A0;
  --c-south: #5FC0B0;
  --c-east: #8CC79E;
  --c-wuri: #7CC7AC;
  --c-taiping: #D9A06B;
  --c-dali: #D18A66;
  --c-shalu: #D9AE72;
  --c-fengyuan: #C99A6B;
  --c-projects: #E8B07A;
}

/* ---------- 基礎 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-sans); font-size: 16px; line-height: 1.75;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-serif); line-height: 1.35; color: var(--ink); font-weight: 700; }
h1 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin: 0 0 .5em; }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); margin: 0 0 .6em; }
h3 { font-size: 1.15rem; margin: 0 0 .45em; }
p { margin: 0 0 .9em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0 0 .9em; padding-left: 1.3em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.4em 0; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--accent); color: var(--accent-ink);
  padding: .5em 1em; z-index: 300; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 44px 0; }
.section-tight { padding: 24px 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 1em; flex-wrap: wrap; }
.sec-title { font-size: 1.35rem; }
.sec-title::before { content: ''; display: inline-block; width: .55em; height: .55em; border-radius: 2px; background: var(--accent); margin-right: .45em; vertical-align: .06em; }
.eyebrow { font-size: .78rem; letter-spacing: .16em; color: var(--muted); text-transform: none; margin: 0 0 .4em; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.note { font-size: .88rem; color: var(--muted); }
sup { font-size: .68em; color: var(--accent); }
.callout { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: .9em 1.1em; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 1em 0; }
.callout-warn { background: var(--warn-soft); border-left-color: var(--warn); }
.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; }

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: .55em 1.1em; border-radius: var(--radius-sm); cursor: pointer;
  font-family: var(--font-sans); font-size: .95rem; line-height: 1.4; text-decoration: none;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: .3em .7em; font-size: .85rem; }
.btn-block { display: flex; width: 100%; }
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* ---------- 麵包屑（BreadcrumbList schema 由 JSON-LD 提供） ---------- */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: .35em; font-size: .88rem; color: var(--muted); padding: 10px 0; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35em; margin: 0; padding: 0; }
.breadcrumb li { display: flex; align-items: center; gap: .35em; }
.breadcrumb li + li::before { content: '›'; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb [aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------- 頁首導覽 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 120; background: var(--surface);
  border-bottom: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}
.site-header.scrolled { box-shadow: var(--shadow); }
.topbar { display: flex; align-items: center; gap: 14px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-serif); font-weight: 900; font-size: 1.12rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand small { display: block; font-family: var(--font-sans); font-weight: 400; font-size: .68rem; color: var(--muted); letter-spacing: .08em; }
.main-nav { display: flex; align-items: center; gap: 2px; }
.nav-link { display: inline-block; padding: .45em .7em; border-radius: var(--radius-sm); color: var(--ink-2); font-size: .95rem; }
.nav-link:hover { background: var(--bg-2); color: var(--accent); text-decoration: none; }
.nav-link.active { color: var(--accent); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* 全站搜尋框 */
.searchbox { position: relative; width: min(240px, 30vw); }
.searchbox input {
  width: 100%; border: 1px solid var(--line); background: var(--bg-2); color: var(--ink);
  border-radius: 20px; padding: .42em .95em .42em 2.2em; font-size: .9rem; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.searchbox input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.searchbox .search-ico { position: absolute; left: .75em; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; display: none; z-index: 130;
}
.suggest.open { display: block; }
.suggest-item { display: block; padding: .55em .85em; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.suggest-item:last-child { border-bottom: 0; }
.suggest-item:hover, .suggest-item.active { background: var(--accent-soft); }
.suggest-item .s-t { font-size: .9rem; color: var(--ink); }
.suggest-item .s-d { font-size: .78rem; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Mega 選單 */
.mega { position: relative; }
.mega-trigger { display: inline-flex; align-items: center; gap: .3em; }
.mega-panel {
  position: absolute; top: calc(100% + 8px); left: -40px; width: min(860px, 92vw);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; display: none; z-index: 140;
}
.mega.open .mega-panel { display: block; }
.mega-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 22px; }
.mega-col h4 { font-size: .95rem; margin: 0 0 .35em; display: flex; align-items: center; gap: .4em; }
.mega-col h4 .dot { width: .5em; height: .5em; border-radius: 50%; background: var(--muted); }
.mega-col ul { list-style: none; margin: 0; padding: 0; }
.mega-col li a { display: block; padding: .22em .3em; font-size: .88rem; color: var(--ink-2); border-radius: var(--radius-sm); }
.mega-col li a:hover { background: var(--bg-2); color: var(--accent); text-decoration: none; }
.mega-foot { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-2); display: flex; gap: 16px; flex-wrap: wrap; font-size: .85rem; }

/* 下拉／浮層（Dropdown / Popover 共用機制） */
.dd { position: relative; }
.dd-panel {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 190px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 6px; display: none; z-index: 150;
}
.dd.open .dd-panel { display: block; }
.dd-panel a, .dd-panel button.dd-item {
  display: flex; width: 100%; align-items: center; gap: .5em; text-align: left;
  padding: .5em .7em; border: 0; background: none; color: var(--ink-2); font-size: .9rem;
  border-radius: var(--radius-sm); cursor: pointer; font-family: var(--font-sans);
}
.dd-panel a:hover, .dd-panel button.dd-item:hover { background: var(--bg-2); color: var(--accent); text-decoration: none; }
.dd-panel .dd-sep { border-top: 1px solid var(--line-2); margin: 5px 6px; }
.dd-arrow { font-size: .7em; margin-left: .15em; transition: transform .15s; }
.dd.open .dd-arrow { transform: rotate(180deg); }
.popover {
  position: fixed; width: 250px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; display: none; z-index: 150;
}
.popover.open { display: block; }
.popover h5 { margin: 0 0 .35em; font-size: .92rem; }
.popover p { margin: 0; font-size: .84rem; color: var(--ink-2); }

/* 漢堡選單（手機） */
.hamburger {
  display: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  width: 40px; height: 40px; border-radius: var(--radius-sm); cursor: pointer; align-items: center; justify-content: center;
}
.drawer {
  position: fixed; inset: 0 0 0 auto; width: min(320px, 86vw); background: var(--surface);
  border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .25s ease;
  z-index: 220; overflow-y: auto; padding: 18px;
}
.drawer.open { transform: translateX(0); }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(10, 12, 10, .45); z-index: 210; display: none; }
.drawer-backdrop.open { display: block; }
.drawer h4 { margin: 1em 0 .4em; }
.drawer .drawer-link { display: block; padding: .5em .2em; color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
.drawer .drawer-link:hover { color: var(--accent); text-decoration: none; }

/* ---------- 側欄樹狀圖 ---------- */
.sidebar { position: relative; }
.tree { list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.tree ul { list-style: none; margin: 0; padding-left: 1.05em; }
.tree li { position: relative; }
.tree-toggle {
  background: none; border: 0; padding: .28em .4em; cursor: pointer; color: var(--muted);
  font-size: .72rem; position: absolute; left: -4px; top: .42em; transition: transform .15s; border-radius: 3px;
}
.tree-toggle:hover { color: var(--accent); }
.tree-branch > .tree-label { display: flex; align-items: center; gap: .45em; padding: .32em .4em .32em .9em; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 600; }
.tree-branch > .tree-label .dot { width: .55em; height: .55em; border-radius: 2px; }
.tree-branch.collapsed > ul { display: none; }
.tree-branch.collapsed > .tree-toggle { transform: rotate(-90deg); }
.tree li > a.leaf { display: block; padding: .3em .4em .3em 1.5em; color: var(--ink-2); border-radius: var(--radius-sm); }
.tree li > a.leaf:hover { background: var(--bg-2); color: var(--accent); text-decoration: none; }
.tree li > a.leaf.current { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* ---------- Treemap（SVG 容器） ---------- */
.treemap { width: 100%; }
.treemap svg { display: block; width: 100%; height: auto; }
.treemap .tm-cell { cursor: pointer; transition: opacity .15s; }
.treemap .tm-cell:hover { opacity: .78; }
.treemap .tm-label { font-size: 10px; fill: #fff; font-weight: 600; pointer-events: none; }

/* ---------- TOC ---------- */
.toc { position: sticky; top: calc(var(--header-h) + 20px); font-size: .88rem; }
.toc-title { font-weight: 700; margin: 0 0 .55em; color: var(--ink-2); display: flex; align-items: center; gap: .4em; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li { margin: 0; }
.toc a { display: block; padding: .3em .7em; color: var(--muted); border-left: 2px solid transparent; margin-left: -1px; }
.toc a:hover { color: var(--accent); text-decoration: none; }
.toc a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.toc .toc-h3 { padding-left: 1.4em; font-size: .84rem; }

/* ---------- 標籤系統（僅互動型標籤顯示 pointer，純裝飾 badge 不誤導） ---------- */
.tag {
  display: inline-flex; align-items: center; gap: .3em; padding: .18em .75em; border-radius: 20px;
  background: var(--bg-2); color: var(--ink-2); font-size: .8rem; border: 1px solid var(--line);
  cursor: default; transition: background .15s, color .15s, border-color .15s;
}
a.tag:hover, button.tag:hover, .tag[data-facet]:hover, .tag[data-tagfacet]:hover, .tag.on:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
a.tag, button.tag, .tag[data-facet], .tag[data-tagfacet] { cursor: pointer; }
.tag.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud .tag { font-size: .82rem; }
.tag-lg { font-size: .9rem; padding: .3em .9em; }
.county-badge { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.county-badge::before { content: ''; display: inline-block; width: .5em; height: .5em; border-radius: 2px; background: currentColor; margin-right: .35em; vertical-align: .05em; }
.dev-badge { background: var(--warn-soft); color: var(--warn); }

/* ---------- 卡片 ---------- */
.card-zone {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s;
}
.card-zone:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-family: var(--font-serif); font-size: 1.02rem; line-height: 1.4; margin: 0; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-desc { font-size: .87rem; color: var(--muted); margin: 0; line-height: 1.6; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; align-items: center; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.grid-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-cards[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.mini-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: block; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.mini-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); }
.mini-card .mc-img { aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-2); }
.mini-card .mc-img img { width: 100%; height: 100%; object-fit: cover; }
.mini-card .mc-body { padding: 10px 12px 12px; }
.mini-card .mc-t { font-family: var(--font-serif); font-size: .92rem; line-height: 1.45; margin: 0 0 .3em; }
.mini-card .mc-m { font-size: .78rem; color: var(--muted); }

/* ---------- 文章＋側欄目錄雙欄 ---------- */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 34px; align-items: start; }
@media (max-width: 1024px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 重劃區頁 Hero ---------- */
.hero-zone { position: relative; border-radius: var(--radius); overflow: hidden; margin: 8px 0 26px; background: var(--bg-2); }
.hero-zone img { width: 100%; height: clamp(240px, 34vw, 420px); object-fit: cover; }
.hero-overlay {
  position: absolute; inset: auto 0 0 0; padding: 60px 22px 18px;
  background: linear-gradient(180deg, rgba(10, 14, 12, 0) 0%, rgba(10, 14, 12, .72) 100%);
  color: #fff;
}
.hero-overlay .h-zone { font-family: var(--font-serif); font-size: clamp(1.2rem, 2.6vw, 1.8rem); font-weight: 900; margin: 0 0 .15em; }
.hero-overlay .h-sub { font-size: .92rem; opacity: .92; margin: 0; }
.hero-zone .hero-credit { position: absolute; top: 10px; right: 10px; font-size: .72rem; color: rgba(255,255,255,.9); background: rgba(10,14,12,.55); padding: 3px 9px; border-radius: 10px; }

/* ---------- 快速摘要 ---------- */
.summary-box { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 18px 20px; margin: 20px 0; box-shadow: var(--shadow-sm); }
.summary-box h2 { margin: 0 0 .5em; font-size: 1.05rem; }
.summary-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 22px; margin: 0; padding: 0; list-style: none; font-size: .94rem; }
.summary-list li { display: flex; gap: .55em; }
.summary-list b { color: var(--accent); flex: none; }
.summary-list span { color: var(--ink-2); }

/* ---------- 表格（強制固定欄寬：table-layout fixed + colgroup 每欄寬度總和 100%） ---------- */
.table-wrap { overflow-x: auto; margin: 1em 0; }
table.tbl { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: .92rem; }
table.tbl th, table.tbl td { border: 1px solid var(--line); padding: .6em .75em; text-align: left; vertical-align: top; word-wrap: break-word; }
table.tbl th { background: var(--bg-2); font-weight: 700; color: var(--ink-2); }
table.tbl tbody tr:nth-child(even) { background: var(--surface-2); }
.tbl-note { font-size: .8rem; color: var(--muted); margin-top: .4em; }

/* ---------- 時間軸（grid 三列：時間 / 軸 / 內容，圓點由布局引擎居中，像素級對齊） ---------- */
.timeline { display: grid; grid-template-columns: 96px 34px minmax(0, 1fr); gap: 0; margin: 8px 0 20px; }
.tl-row { display: contents; }
.tl-time { padding: 14px 6px 14px 0; text-align: right; font-weight: 700; color: var(--ink-2); font-size: .9rem; }
.tl-axis { position: relative; padding: 0 8px; display: flex; justify-content: center; }
.tl-axis::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--line-2); transform: translateX(-50%); }
.tl-dot {
  width: 13px; height: 13px; margin-top: 19px; border-radius: 50%; background: var(--accent);
  border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--accent-soft); flex: none;
}
.tl-content { padding: 14px 0 14px 14px; }
.tl-content h4 { margin: 0 0 .25em; font-size: .98rem; }
.tl-content p { margin: 0; font-size: .88rem; color: var(--ink-2); }

/* ---------- 手風琴（Accordion / FAQ） ---------- */
.accordion { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.acc-item + .acc-item { border-top: 1px solid var(--line); }
.acc-head {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px;
  background: none; border: 0; padding: .85em 1em; font-family: var(--font-sans);
  font-size: .97rem; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left;
}
.acc-head:hover { color: var(--accent); }
.acc-head::after { content: '+'; font-size: 1.2rem; color: var(--accent); transition: transform .2s; flex: none; }
.acc-item.open .acc-head::after { transform: rotate(45deg); }
.acc-body { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.acc-inner { padding: 0 1em 1em; font-size: .93rem; color: var(--ink-2); }
.acc-inner p:last-child { margin-bottom: 0; }

/* ---------- 頁籤（Tabs） ---------- */
.tabs { margin: 1em 0; }
.tab-list { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid var(--line); }
.tab-btn {
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -2px;
  padding: .5em 1em; font-family: var(--font-sans); font-size: .93rem; color: var(--muted); cursor: pointer;
}
.tab-btn:hover { color: var(--accent); }
.tab-btn[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab-panel { padding-top: 14px; }
.tab-panel[hidden] { display: none; }

/* ---------- 篩選（Faceted Search） ---------- */
.facet-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 12px 0 16px; }
.facet-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.facet-label { font-size: .85rem; color: var(--muted); margin-right: 2px; }
.facet-select {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: var(--radius-sm); padding: .38em .6em; font-size: .9rem; font-family: var(--font-sans);
}
.facet-clear { font-size: .84rem; }
.result-count { font-size: .88rem; color: var(--muted); }

/* ---------- 分頁 ---------- */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; margin: 22px 0 6px; }
.page-btn {
  min-width: 36px; height: 36px; padding: 0 .6em; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-2); cursor: pointer; font-size: .9rem; display: inline-flex; align-items: center; justify-content: center;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.page-btn[disabled] { opacity: .4; pointer-events: none; }

/* ---------- 前後篇／相關文章 ---------- */
.prenext { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.pn-card {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; color: var(--ink); transition: transform .15s, box-shadow .15s;
}
.pn-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); }
.pn-card.next { text-align: right; }
.pn-label { font-size: .76rem; color: var(--muted); letter-spacing: .1em; display: block; margin-bottom: .3em; }
.pn-title { font-family: var(--font-serif); font-size: .95rem; margin: 0; }

/* ---------- 收藏 ---------- */
.fav-btn {
  display: inline-flex; align-items: center; gap: .3em; background: none; border: 1px solid var(--line);
  border-radius: 20px; padding: .28em .8em; font-size: .82rem; color: var(--muted); cursor: pointer; font-family: var(--font-sans);
}
.fav-btn:hover { border-color: var(--warn); color: var(--warn); }
.fav-btn.on { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.fav-star { width: 1.05em; height: 1.05em; flex: none; }
.fav-btn.on .fav-star { fill: currentColor; }

/* ---------- 右下角站內導航（FAB 群） ---------- */
.fab-group { position: fixed; right: 18px; bottom: 18px; z-index: 180; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.fab {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); box-shadow: var(--shadow); cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s, transform .1s; font-size: 1rem;
}
.fab:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.fab:active { transform: scale(.95); }
.fab[hidden] { display: none; }
.fab-label { font-size: .68rem; line-height: 1.1; text-align: center; }
.fab-back { border-radius: 14px; width: auto; height: auto; padding: .45em .8em; gap: .3em; flex-direction: column; }
.fab-back svg { width: 18px; height: 18px; }

/* ---------- 自訂右鍵選單（Context Menu） ---------- */
.context-menu {
  position: fixed; z-index: 300; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 5px; min-width: 180px; display: none;
}
.context-menu.open { display: block; }
.context-menu button {
  display: flex; width: 100%; gap: .55em; align-items: center; border: 0; background: none; color: var(--ink-2);
  padding: .5em .7em; font-size: .88rem; border-radius: var(--radius-sm); cursor: pointer; font-family: var(--font-sans); text-align: left;
}
.context-menu button:hover { background: var(--bg-2); color: var(--accent); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--ink); color: var(--bg); padding: .6em 1.2em; border-radius: 22px; font-size: .88rem;
  box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; max-width: 88vw;
}
.toast.show { opacity: 1; transform: translateY(0); }
html[data-theme="dark"] .toast { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }

/* ---------- 表單 ---------- */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 5px; }
.field label { font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: var(--radius-sm); padding: .55em .8em; font-size: .95rem; font-family: var(--font-sans); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field .err { color: var(--warn); font-size: .8rem; display: none; }
.field.invalid input, .field.invalid textarea { border-color: var(--warn); }
.field.invalid .err { display: block; }
.form-note { font-size: .8rem; color: var(--muted); }

/* ---------- 知識圖譜／最新文章／標籤雲 ---------- */
.kg { width: 100%; }
.kg svg { display: block; width: 100%; height: auto; }
.kg .kg-node { cursor: pointer; }
.kg .kg-node:hover circle { stroke-width: 2.5px; }
.latest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.latest-list li { display: flex; gap: 12px; align-items: center; }
.latest-list .ll-img { width: 76px; height: 52px; border-radius: var(--radius-sm); object-fit: cover; flex: none; background: var(--bg-2); }
.latest-list a { color: var(--ink); font-size: .92rem; line-height: 1.45; }
.latest-list a:hover { color: var(--accent); }
.latest-list .ll-meta { display: block; font-size: .78rem; color: var(--muted); }

/* ---------- 內容保護（anti-copy / protection） ---------- */
.protected { user-select: none; -webkit-user-select: none; }
.protected img { pointer-events: none; user-select: none; -webkit-user-drag: none; }

/* ---------- 搜尋結果列 ---------- */
.card-zone.result-row { flex-direction: row; }
.result-row .rr-img { width: 220px; flex: none; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-2); }
.result-row .rr-img img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 640px) {
  .card-zone.result-row { flex-direction: column; }
  .result-row .rr-img { width: 100%; aspect-ratio: 16 / 8; }
}

/* ---------- 頁尾 ---------- */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--line); margin-top: 48px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 26px; padding: 38px 0 26px; }
.footer-grid h4 { font-size: 1rem; margin: 0 0 .7em; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .9rem; }
.footer-links a { color: var(--ink-2); }
.footer-links a:hover { color: var(--accent); }
.social-icons { display: flex; gap: 8px; }
.social-icons a {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 50%; color: var(--ink-2); background: var(--surface);
}
.social-icons a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.contact-info { font-size: .88rem; color: var(--ink-2); display: grid; gap: 6px; }
.contact-info div { display: flex; gap: .5em; align-items: center; }
.footer-bottom { border-top: 1px solid var(--line); padding: 14px 0; font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

/* ---------- 實用 ---------- */
.flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.reveal { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
.img-lazy { background: var(--bg-2); }
.img-lazy img { opacity: 0; transition: opacity .4s; }
.img-lazy.loaded img { opacity: 1; }
.stat-num { font-family: var(--font-serif); font-weight: 900; font-size: 1.9rem; color: var(--accent); line-height: 1.2; }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.stat-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat-item .s-label { font-size: .8rem; color: var(--muted); }
.stat-item .s-note { font-size: .74rem; color: var(--muted); }
.empty-state { text-align: center; padding: 46px 16px; color: var(--muted); }
.empty-state .es-ico { font-size: 2rem; margin-bottom: .4em; }

/* ---------- 響應式 ---------- */
@media (max-width: 1180px) {
  /* 卡片牆在 3 欄會末行零散，故跳過 3 欄直接 2 欄 */
  .grid-cards { grid-template-columns: repeat(2, 1fr); }
  .mega-panel { left: -120px; }
}
@media (max-width: 960px) {
  .grid-cards { grid-template-columns: repeat(2, 1fr); }
  /* related-grid 維持 3 欄（3%3=0），僅在手機改 1 欄 */
  .summary-list { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .main-nav { display: none; }
  .hamburger { display: inline-flex; }
  .searchbox { width: 46px; }
  .searchbox input { padding-left: 2.2em; }
  .searchbox input:focus { width: 190px; }
  .mega-panel { left: auto; right: 0; }
  .toc { position: static; }
}
@media (max-width: 720px) {
  .grid-cards { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .prenext { grid-template-columns: 1fr; }
  .pn-card.next { text-align: left; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .timeline { grid-template-columns: 72px 26px minmax(0, 1fr); }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .brand small { display: none; }
  .hamburger { width: 44px; height: 44px; }
  .btn-sm { min-height: 40px; }
  .tag { min-height: 34px; font-size: .84rem; }
  .fav-btn { min-height: 38px; }
  .breadcrumb a { padding: .3em 0; }
  .drawer .drawer-link { padding: .72em .2em; }
  .fab .fab-label { display: none; }
}
@media (max-width: 560px) {
  .stats-row { grid-template-columns: 1fr; }
  .searchbox { display: none; }
  body { font-size: 15.5px; }
}

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