/* 蕾莉娜 Raelena ・ 全站樣式（單一檔案，版本號在 tools/build.py 的 CSS_VER）
   10-19 建置：版型沿用姊妹站（見 docs/architecture.md），配色取自正式 logo（logo/logo-line.ai）：深藏青 #032858＋鵝黃 #ffe771；照片未到位處用 .ph 佔位 */
:root {
  --paper: #fbfaf7;              /* 暖白紙色 */
  --tint: #eef2f8;               /* 標題區、區塊底的淡藍灰 */
  --card: #ffffff;
  --ink: #16213a;
  --muted: #586179;
  --rule: #e0e5ee;
  --accent: #1c427f;             /* 連結與強調：藏青提亮一階，白底對比約 9:1 */
  --accent-soft: #e6ecf7;
  --note: #f2f4f8;
  --warm: #e2b33c;               /* 點綴色（logo 鵝黃加深一階）：只用在小裝飾與合作揭露框，不用在文字 */
  --logo-1: #032858;             /* 正式 logo（logo/logo.ai 原色是鵝黃 #ffe771，淺底上太淡）：淺色模式用 logo-line 的深藏青底色 */
  --logo-2: #032858;
  --foot: #032858;               /* 頁尾底色：logo 深藏青 */
  --foot-ink: #e6ebf5;
  --foot-muted: #a9b5cd;
  --foot-logo: #ffe771;          /* 頁尾標誌：logo 鵝黃（同 logo-line 的配色） */
  --shadow: 0 1px 2px rgba(3, 40, 88, .06), 0 8px 24px rgba(3, 40, 88, .08);
  /* 全站黑體：只用系統內建字型，不載入網路字型。英數字用系統 UI 字型，中文 Apple 蘋方、Android／裝有 Noto 的電腦用 Noto Sans TC、Windows 微軟正黑體 */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Heiti TC", sans-serif;
  --head-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1424;
    --tint: #151d31;
    --card: #161f34;
    --ink: #e8ecf5;
    --muted: #a4adc2;
    --rule: #27314a;
    --accent: #ffe17a;           /* 深色模式連結與按鈕用鵝黃 */
    --accent-soft: #232c44;
    --note: #182035;
    --warm: #ffe17a;
    --logo-1: #ffe771;           /* 深色模式標誌用 logo 原色鵝黃 */
    --logo-2: #ffe771;
    --foot: #070b16;
    --foot-ink: #e0e6f2;
    --foot-muted: #98a3bb;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.85;
  overflow-wrap: anywhere;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .88em; background: var(--note); padding: .1em .35em; border-radius: 4px; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 740px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 28px; } }

/* 題材色：由 tools/build.py 的 cat_css() 依 src/categories.json 產生，內嵌在每頁 <head>；元素用 .card-<slug>／.head-<slug>／.art-<slug>／.topic-<slug>／.ph-<slug> 取得 --c、--s */

/* 頁首：捲動時固定在上方（不用 backdrop-filter，否則手機選單頁的 position: fixed 會被限制在頁首內） */
.site-head { position: sticky; top: 0; z-index: 15; background: var(--paper); border-bottom: 1px solid var(--rule); }
.site-head .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; color: var(--ink); text-decoration: none; }
.brand .mark { width: 32px; height: 32px; flex: none; }
.brand .zh { font-size: 24px; font-weight: 700; letter-spacing: .08em; line-height: 1; }
.brand .en { font-size: 11px; letter-spacing: .3em; color: var(--muted); text-transform: uppercase; line-height: 1; padding-top: 4px; }
.site-nav { display: flex; align-items: center; gap: 4px; font-size: 15px; }
.site-nav a { color: var(--ink); text-decoration: none; white-space: nowrap; padding: 6px 14px; border-radius: 999px; transition: background .15s, color .15s; }
.site-nav a:hover { background: var(--tint); color: var(--accent); }
.site-nav a[aria-current], .site-nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.site-nav a:last-child { margin-left: 6px; box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); }   /* 「聯絡我」用外框膠囊 */

/* 手機選單（≤560px 且有 JavaScript）：頁首右側「選單」按鈕，開啟全螢幕選單頁（主選單五項＋分類＋RSS） */
.menu-btn { display: none; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; margin-right: -6px; border: 1px solid var(--rule); border-radius: 999px; background: var(--card); color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; }
.menu-btn .ico { position: relative; width: 18px; height: 12px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; }
.menu-btn .ico::before { content: ""; position: absolute; left: 0; right: 0; top: 3px; height: 2px; background: currentColor; }
.menu-btn .ico.x { border: 0; }
.menu-btn .ico.x::before, .menu-btn .ico.x::after { content: ""; position: absolute; left: -1px; right: -1px; top: 5px; height: 2px; background: currentColor; transform: rotate(45deg); }
.menu-btn .ico.x::after { transform: rotate(-45deg); }
.m-menu { position: fixed; inset: 0; z-index: 20; background: var(--paper); overflow-y: auto; overscroll-behavior: contain; }
.m-menu[hidden] { display: none; }
.m-top { display: flex; align-items: center; justify-content: space-between; min-height: 60px; border-bottom: 1px solid var(--rule); }
.site-head .m-menu .m-body { display: block; min-height: 0; padding-bottom: 48px; }   /* 選單頁在頁首裡，不吃 .site-head .wrap 的橫排 */
.m-h { margin: 26px 0 10px; font-size: 13px; letter-spacing: .12em; color: var(--muted); }
.m-cats, .m-list { list-style: none; margin: 0; padding: 0; }
.m-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-cats a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 14px; background: var(--card); text-decoration: none; }
.m-cats span { font-size: 20px; font-weight: 700; color: var(--accent); }
.m-cats small { font-size: 13px; color: var(--muted); }
.m-cats a[aria-current], .m-cats a.on { border-color: var(--accent); background: var(--accent-soft); }
.m-list { border-top: 1px solid var(--rule); }
.m-list a { display: flex; align-items: center; gap: 12px; min-height: 52px; border-bottom: 1px solid var(--rule); color: var(--ink); font-size: 17px; text-decoration: none; }
.m-list span { flex: 1; }
.m-list a::after { content: "→"; color: var(--muted); }
.m-list small { font-size: 13px; color: var(--muted); }
.m-list a[aria-current], .m-list a.on { color: var(--accent); font-weight: 700; }
.m-main { margin-top: 18px; }
.m-main a { font-size: 19px; font-weight: 700; }
.m-note { margin: 28px 0 0; font-size: 14px; line-height: 1.8; color: var(--muted); }
html.menu-on, html.menu-on body { overflow: hidden; }
@media (min-width: 561px) { .m-menu { display: none; } }

/* 按鈕與標籤 */
.btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 22px; border-radius: 999px; background: var(--accent); color: var(--paper); font-size: 15px; font-weight: 700; text-decoration: none; transition: filter .15s; }
.btn:hover { filter: brightness(1.12); }
.btn-ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); filter: none; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.cat { font-size: 13px; letter-spacing: .08em; margin: 0 0 8px; color: var(--muted); }
.cat a:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 700; text-decoration: none; }
.cat a:first-child::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); }
.cat a:first-child:hover { color: var(--accent); }
.cat .type { color: var(--muted); }
.cat .type::before { content: "・"; }
a.type { text-decoration: none; }
a.type:hover { color: var(--accent); }

/* 照片佔位（tools/build.py 的 placeholder()）：題材色淡底＋細斜紋＋淡標誌，照片到位後換成 <img> */
.ph { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; border-radius: inherit;
  background: repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, var(--c, var(--accent)) 8%, transparent) 14px 15px), var(--s, var(--accent-soft)); }
.ph-mark { width: 22%; max-width: 120px; color: var(--c, var(--accent)); opacity: .22; --logo-1: currentColor; --logo-2: currentColor; }
.ph-wide { aspect-ratio: 16 / 9; }
.ph-about { aspect-ratio: 4 / 3; border-radius: 18px; }
.ph-hero { aspect-ratio: 5 / 4; border-radius: 28px 28px 28px 120px; }
/* 非文章頁照片（build.py 的 page_photo()）：首頁 hero、〈關於蕾莉娜〉與關於蕾莉娜標題區，下方小字標示來源與授權 */
.side-photo { margin: 0; }
.side-photo img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 18px; background: var(--note); }
.side-photo figcaption { margin-top: 8px; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.side-photo figcaption a { color: inherit; }

/* 首頁 hero（10-19）：左邊問候與標語、右邊主視覺照片（沒有照片時佔位） */
.hero { padding: 40px 0 56px; background: linear-gradient(180deg, var(--tint), var(--paper)); border-bottom: 1px solid var(--rule); }
.hero-grid { display: grid; gap: 32px; align-items: center; }
.eyebrow { margin: 0 0 14px; font-size: 12.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.eyebrow::before { content: ""; display: inline-block; width: 28px; height: 2px; margin-right: 10px; vertical-align: middle; background: var(--warm); border-radius: 2px; }
.hero h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 0; font-size: clamp(40px, 6vw, 64px); line-height: 1.15; letter-spacing: .08em; }
.hero h1 .mark { width: 52px; height: 52px; flex: none; }
.hero h1 small { font-size: clamp(18px, 2.2vw, 24px); font-weight: 400; letter-spacing: .18em; color: var(--muted); }
.hero-tag { margin: 18px 0 4px; font-size: clamp(20px, 2.4vw, 26px); font-weight: 700; line-height: 1.5; color: var(--accent); }
.hero-en { margin: 0 0 18px; font-size: 15px; font-style: italic; color: var(--muted); letter-spacing: .02em; }
.hero-lead { margin: 0 0 26px; max-width: 30em; }
.hero-tag + .hero-lead { margin-top: 14px; }   /* 沒有英文標語時（TAGLINE_EN 空）標語和開場白之間留白 */
.hero .side-photo img { aspect-ratio: 5 / 4; border-radius: 28px 28px 28px 120px; }
@media (min-width: 860px) { .hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 56px; } .hero { padding: 64px 0 72px; } }

/* 首頁「最新一篇」：大圖＋文字，桌機左右排 */
.feature { display: grid; gap: 18px; margin: 0 0 28px; padding: 16px; border: 1px solid var(--rule); border-radius: 22px; background: var(--card); }
.feature-img { display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 16px; background: var(--note); }
.feature-img img, .feature-img .ph { width: 100%; height: 100%; object-fit: cover; aspect-ratio: auto; transition: transform .5s; }
.feature-img:hover img { transform: scale(1.03); }
.feature-body { align-self: center; padding: 0 8px 8px; }
.feature h3 { margin: 0 0 10px; font-size: clamp(23px, 2.8vw, 30px); line-height: 1.45; }
.feature h3 a { color: var(--ink); text-decoration: none; }
.feature h3 a:hover { color: var(--accent); }
.feature-d { margin: 0 0 10px; color: var(--muted); }
.feature-m { margin: 0; font-size: 13px; color: var(--muted); }
@media (min-width: 860px) { .feature { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 32px; padding: 18px; } }
.kicker { display: inline-flex; flex-wrap: wrap; align-items: center; margin: 0 0 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.kicker a { color: var(--ink); text-decoration: none; }
.kicker a:hover { color: var(--accent); }
.kicker .dot { margin-right: 6px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; }

.home { padding-bottom: 24px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 52px 0 20px; }
.sec-head .section-t { margin: 0; }
.section-t { font-size: clamp(22px, 2.6vw, 28px); line-height: 1.35; margin: 52px 0 20px; letter-spacing: .04em; }
.more { font-size: 15px; font-weight: 700; text-decoration: none; white-space: nowrap; }
a.more::after, p.more a::after, .more-line a::after { content: " →"; }
.more a, .more-line a { text-decoration: none; font-weight: 700; }

/* 文章卡片（首頁、列表頁、延伸閱讀） */
.cards { list-style: none; margin: 0 0 56px; padding: 0; display: grid; grid-template-columns: 1fr; gap: 22px; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; } }
.card { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--rule); border-radius: 18px; overflow: hidden; transition: transform .2s, box-shadow .2s, border-color .2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--c, var(--accent)) 35%, var(--rule)); }
.card:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.card-media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--note); }
.card-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-media img { transform: scale(1.03); }
.card-media .ph { height: 100%; aspect-ratio: auto; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 18px 20px 18px; }
.card .cat { position: relative; z-index: 1; }   /* 題材連結浮在整張卡片的連結之上 */
.card-t { font-size: 20px; line-height: 1.5; margin: 0 0 10px; }
.card-t a { color: var(--ink); text-decoration: none; }
.card-t a::after { content: ""; position: absolute; inset: 0; }   /* 整張卡片可點 */
.card-t a:focus-visible { outline: none; }
.card:hover .card-t a { color: var(--accent); }
.card-d { margin: 0 0 14px; font-size: 15px; line-height: 1.75; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
/* 分類卡片（首頁〈分類探索〉與 /categories/，build.py 的 cat_tiles()）：全部主題都列出，沒有文章的標「準備中」 */
.tiles { list-style: none; margin: 0 0 56px; padding: 0; display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
.tile { position: relative; display: flex; flex-direction: column; padding: 20px 22px 18px; border: 1px solid var(--rule); border-radius: 20px; background: var(--card); overflow: hidden; }
.tile::before { content: ""; position: absolute; right: -36px; top: -36px; width: 110px; height: 110px; border-radius: 50%; background: var(--s, var(--accent-soft)); }
.tile > * { position: relative; }
.tile-en { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--c, var(--accent)); }
.tile-t { margin: 4px 0 6px; font-size: 22px; line-height: 1.4; }
.tile-t a { color: var(--ink); text-decoration: none; }
.tile-t a::after { content: ""; position: absolute; inset: 0; }   /* 有文章的整張卡片可點 */
.tile-t a:hover { color: var(--accent); }
.tile:has(.tile-t a):hover { border-color: color-mix(in srgb, var(--c, var(--accent)) 40%, var(--rule)); box-shadow: var(--shadow); }
.tile-d { margin: 0 0 12px; font-size: 15px; line-height: 1.75; color: var(--muted); }
.tile-list { list-style: none; margin: 0 0 12px; padding: 0; position: relative; z-index: 1; }
.tile-list li { padding: 8px 0; border-top: 1px solid var(--rule); font-size: 15px; line-height: 1.55; }
.tile-list a { color: var(--ink); text-decoration: none; }
.tile-list a:hover { color: var(--accent); text-decoration: underline; }
.tile-n { margin: auto 0 0; font-size: 13px; font-weight: 700; color: var(--c, var(--accent)); }
.tile.soon .tile-n { color: var(--muted); font-weight: 400; }
.tile.soon .tile-n::before { content: "○ "; }
.type-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.type-list li { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.type-list a { font-weight: 700; text-decoration: none; }
.type-list span { color: var(--muted); font-size: 15px; }

/* 首頁〈關於蕾莉娜〉 */
.about-band { display: grid; gap: 24px; align-items: center; margin: 0 0 64px; padding: 24px; border-radius: 22px; background: var(--tint); }
.about-band .section-t { margin: 0 0 10px; }
.about-band p { margin: 0 0 10px; }
.more-line a + a { margin-left: 8px; }
@media (min-width: 768px) { .about-band { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 40px; padding: 32px; } }

/* 列表頁與一般頁的標題區 */
.page-head { background: var(--s, var(--tint)); border-bottom: 1px solid var(--rule); padding: 8px 0 36px; }
.page-head h1 small.en { display: block; margin-top: 4px; font-size: 13px; font-weight: 700; letter-spacing: .3em; color: var(--c, var(--muted)); text-transform: uppercase; }
.page-head h1 { font-size: clamp(30px, 4.6vw, 44px); line-height: 1.3; margin: 10px 0 10px; letter-spacing: .04em; }
.page-head h1::before { content: ""; display: block; width: 40px; height: 4px; margin-bottom: 18px; border-radius: 2px; background: var(--c, var(--accent)); }
.list-lead { color: var(--muted); margin: 0; max-width: 40em; }
.head-doc { background: var(--tint); }
.head-grid { display: grid; gap: 24px; align-items: center; }
.head-grid .ph, .head-grid .side-photo { margin-top: 24px; }
.head-grid .ph, .head-grid .side-photo img { aspect-ratio: 16 / 9; }
@media (min-width: 768px) { .head-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 48px; } .head-grid .ph, .head-grid .side-photo { margin-top: 28px; } }
.page { padding-top: 40px; padding-bottom: 64px; }
.page .cards { margin-bottom: 0; }

/* 麵包屑 */
.crumb { font-size: 14px; color: var(--muted); padding: 22px 0 0; }
.crumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumb li + li::before { content: "›"; margin-right: 6px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); text-decoration: underline; }
.crumb [aria-current] { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; max-width: 100%; }

/* 文章 */
.art-head { padding: 26px 0 10px; }
.art-head .cat { font-size: 14px; margin: 0 0 14px; }
.art-head h1 { font-size: clamp(28px, 4.6vw, 42px); line-height: 1.4; margin: 0 0 16px; letter-spacing: .02em; }
.art-head .dek { font-size: 18.5px; line-height: 1.8; color: var(--muted); margin: 0 0 20px; }
.byline { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 0 0 24px; padding: 14px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.byline .by { display: inline-flex; align-items: center; gap: 8px; }
.byline .mark { width: 24px; height: 24px; }
.byline strong { color: var(--ink); font-weight: 700; }
.media-wide { max-width: 960px; margin: 0 auto 32px; padding: 0 16px; }
.article-photo { margin: 0; border-radius: 16px; }
.article-photo img { display: block; width: 100%; height: auto; border-radius: 16px; background: var(--note); }
.article-photo .ph { border-radius: 16px; }
.article-photo figcaption { max-width: 708px; margin: 10px auto 0; font-size: 13px; line-height: 1.7; color: var(--muted); }
.article-photo figcaption a { color: inherit; }
.disclose.sponsored { border-left-color: var(--warm); color: var(--ink); }
.disclose { font-size: 14px; color: var(--muted); background: var(--note); border-left: 3px solid var(--rule); padding: 10px 14px; margin: 0 0 26px; }

.sum { position: relative; background: var(--accent-soft); border-radius: 16px; padding: 20px 24px 12px; margin: 0 0 24px; border-left: 4px solid var(--accent); }
.sum .sum-t { font-weight: 700; margin: 0 0 8px; color: var(--accent); letter-spacing: .1em; font-size: 15px; }
.sum ul { margin: 0; padding-left: 1.2em; }
.sum li { margin: 0 0 8px; }
.sum li::marker { color: var(--accent); }

.toc { border: 1px solid var(--rule); border-radius: 16px; padding: 0 22px; margin: 0 0 36px; background: var(--card); }
.toc summary { display: flex; align-items: center; gap: 12px; padding: 14px 0; cursor: pointer; list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "展開"; margin-left: auto; padding: 2px 12px; border-radius: 999px; background: var(--accent-soft); font-size: 13px; font-weight: 700; color: var(--accent); }
.toc details[open] > summary::after { content: "收合"; }
.toc .toc-t { font-weight: 700; }
.toc .toc-n { font-size: 14px; color: var(--muted); }
.toc ol { margin: 0; padding: 4px 0 16px; list-style: none; font-size: 15.5px; counter-reset: toc; border-top: 1px solid var(--rule); }
.toc li { margin: 0; padding: 6px 0 0 34px; position: relative; counter-increment: toc; }
.toc li::before { content: counter(toc, decimal-leading-zero); position: absolute; left: 0; top: 7px; width: 26px; font-size: 13px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

.prose { font-size: 17.5px; line-height: 1.95; }
.prose h2 { position: relative; font-size: 26px; line-height: 1.45; margin: 56px 0 18px; padding-top: 26px; border-top: 1px solid var(--rule); }
.prose h2::before { content: ""; position: absolute; top: -2px; left: 0; width: 48px; height: 3px; border-radius: 2px; background: var(--accent); }
.prose h3 { font-size: 19px; line-height: 1.6; margin: 32px 0 8px; }
.prose p { margin: 0 0 20px; }
.prose ul, .prose ol { margin: 0 0 20px; padding-left: 1.4em; }
.prose li { margin: 0 0 8px; }
.prose li::marker { color: var(--accent); }
.prose strong { font-weight: 700; }
.prose blockquote { margin: 0 0 22px; padding: 4px 0 4px 20px; border-left: 3px solid var(--rule); color: var(--muted); }
.empty { margin: 8px 0 40px; padding: 18px 20px; border: 1px dashed var(--rule); border-radius: 14px; color: var(--muted); }   /* 還沒有文章時的準備中提示 */
/* 文末「資料來源」：連結多、句子長，字級比內文小（10-13 使用者） */
.prose .sources { font-size: 14.5px; line-height: 1.8; padding: 18px 20px 4px; border-radius: 14px; background: var(--note); }
.prose .sources li { margin: 0 0 6px; }
.prose .sources p { margin: 0 0 12px; }
.tw { overflow-x: auto; margin: 0 0 24px; border: 1px solid var(--rule); border-radius: 14px; background: var(--card); }
.tw table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 15.5px; line-height: 1.7; }
.tw th, .tw td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--rule); }
.tw th { background: var(--accent-soft); color: var(--ink); font-weight: 700; white-space: nowrap; }
.tw tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--note) 60%, transparent); }
.tw tr:last-child td { border-bottom: 0; }
.tw .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }   /* 整欄數字靠右（build.py 的 NUM_CELL 判斷） */
.tw .numeric td:first-child { white-space: nowrap; }   /* 有數字欄的表格，第一欄都是短標籤（年度、縣市、方案）：不換行，避免手機上被數字欄擠成一字一行 */
/* 平板以上：第一欄多是短標籤（「傳統洗衣店」「台中市」）不拆字，長句只在標點、空格處換行；手機維持一般換行，避免第一欄太寬 */
@media (min-width: 768px) {
  .tw td:first-child { word-break: keep-all; overflow-wrap: normal; }
}
/* 桌機：表格左右各多 96px（最寬約 900px），內文欄寬不變（一行約 40 字） */
@media (min-width: 980px) {
  .prose .tw { margin-left: -96px; margin-right: -96px; }
}

.author-box { display: flex; gap: 16px; align-items: flex-start; margin: 52px 0 64px; padding: 22px 24px; border-radius: 16px; background: var(--tint); font-size: 15px; color: var(--muted); }
.author-box .mark { width: 44px; height: 44px; flex: none; }
.author-box p { margin: 0; }
.author-box strong { color: var(--ink); }

.related { padding: 8px 0 8px; background: var(--tint); border-top: 1px solid var(--rule); }
.related .section-t { margin-top: 44px; }

/* 404 */
.nf { text-align: center; padding-top: 72px; }
.nf-mark { width: 72px; height: 72px; }
.nf-code { margin: 12px 0 0; font-size: 14px; letter-spacing: .3em; color: var(--muted); }
.nf h1 { font-size: clamp(28px, 4.6vw, 38px); margin: 4px 0 12px; }
.nf .hero-cta { justify-content: center; margin-top: 24px; }

/* 頁尾：深藏青底，標誌鵝黃 */
.site-foot { background: var(--foot); color: var(--foot-muted); padding: 52px 0 88px; font-size: 14px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.site-foot p { margin: 0; }
.site-foot a { color: var(--foot-ink); text-decoration: none; }
.site-foot a:hover { color: #fff; text-decoration: underline; }
.site-foot .foot-grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
.foot-brand p { margin: 0 0 8px; line-height: 1.75; }
.foot-name { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; color: #fff; letter-spacing: .06em; }
.foot-name .mark { width: 30px; height: 30px; --logo-1: var(--foot-logo, #fff); --logo-2: var(--foot-logo, #fff); }
.foot-name span { font-size: 11px; font-weight: 400; letter-spacing: .3em; color: var(--foot-muted); text-transform: uppercase; padding-top: 4px; }
.foot-tag { max-width: 26em; color: var(--foot-ink); }
.site-foot .foot-en { margin-top: -4px; font-size: 13px; font-style: italic; color: var(--foot-muted); }
.foot-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.foot-h { font-size: 12px; letter-spacing: .2em; color: var(--foot-muted); font-weight: 700; margin: 0 0 12px; }
.foot-col ul { list-style: none; margin: 0; padding: 0; }
.foot-col li { margin: 0 0 8px; }
@media (min-width: 768px) { .site-foot .foot-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.6fr); gap: 48px; } }
.site-foot .copy { margin-top: 32px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .14); font-size: 13px; }
.site-foot .legal a { white-space: nowrap; color: var(--foot-muted); }
.site-foot .legal a:hover { color: #fff; }

/* 返回頂部：捲動超過 600px 才出現（tools/build.py 的 page() 底部腳本） */
.to-top { position: fixed; right: 20px; bottom: 20px; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent); color: var(--paper); font-size: 20px; line-height: 1; text-decoration: none; box-shadow: 0 4px 14px rgba(3, 40, 88, .28); opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s, transform .2s, visibility .2s; z-index: 10; }
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { text-decoration: none; filter: brightness(1.12); }
.to-top:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .card, .card-media img, .feature-img img, .site-nav a, .btn, .to-top { transition: none; }
  .card:hover { transform: none; }
  .card:hover .card-media img { transform: none; }
}

@media (max-width: 560px) {
  :root { --head-h: 60px; }
  body { font-size: 16.5px; }
  .brand .zh { font-size: 21px; }
  .brand .mark { width: 28px; height: 28px; }
  .brand .en { display: none; }
  .site-head .wrap { flex-wrap: wrap; row-gap: 0; min-height: 0; padding-top: 12px; }
  .site-nav { gap: 2px; font-size: 15px; width: 100%; overflow-x: auto; padding: 6px 0 8px; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a:last-child { margin-left: auto; }
  .js .site-nav { display: none; }
  .js .site-head .wrap { flex-wrap: nowrap; min-height: var(--head-h); padding-top: 0; }
  .js .menu-btn { display: inline-flex; }
  .sec-head { margin-top: 40px; }
  .hero { padding: 28px 0 40px; }
  .eyebrow { font-size: 11px; letter-spacing: .14em; }
  .eyebrow::before { display: none; }
  .ph-hero, .hero .side-photo img { aspect-ratio: 16 / 10; border-radius: 22px 22px 22px 72px; }
  .hero h1 .mark { width: 42px; height: 42px; }
  .feature { padding: 12px; }
  .prose { font-size: 17px; }
  .prose h2 { font-size: 22.5px; }
  .art-head .dek { font-size: 17px; }
  .sum, .toc { padding-left: 16px; padding-right: 16px; }
  .card-body { padding: 16px 18px; }
  .about-band { padding: 18px; }
  .author-box { padding: 18px; gap: 12px; }
  .author-box .mark { width: 36px; height: 36px; }
  .tile { padding: 18px 18px 16px; }
  .to-top { right: 16px; bottom: 16px; }
}
