/* 奧娜莉 Aunalee ・ 全站樣式（單一檔案，版本號在 tools/build.py 的 CSS_VER） */
:root {
  --paper: #faf8f4;
  --card: #ffffff;
  --ink: #1c1b19;
  --muted: #5e5a53;
  --rule: #e4dfd6;
  --accent: #1f5c55;
  --accent-soft: #e6f0ee;
  --note: #f3efe6;
  --logo: #c4653a;               /* 暫用標誌的赤陶色（tools/make_logo.py） */
  --serif: "Noto Serif TC", "Source Han Serif TC", "Songti TC", "PMingLiU", serif;
  --sans: system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151412;
    --card: #1d1c19;
    --ink: #ece8e1;
    --muted: #a8a298;
    --rule: #34302b;
    --accent: #8fcfc3;
    --accent-soft: #182826;
    --note: #221f1b;
    --logo: #ffffff;             /* 深色模式標誌用白色 */
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@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; }
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: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 740px; margin: 0 auto; padding: 0 16px; }

/* 頁首 */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: inline-flex; align-items: baseline; gap: 10px; color: var(--ink); text-decoration: none; }
.brand .mark { width: 30px; height: 30px; flex: none; align-self: center; color: var(--logo); }
.brand .zh { font-family: var(--serif); font-size: 26px; font-weight: 700; letter-spacing: .08em; }
.brand .en { font-size: 12px; letter-spacing: .28em; color: var(--muted); text-transform: uppercase; }
.site-nav { display: flex; gap: 22px; font-size: 15px; }
.site-nav a { color: var(--ink); text-decoration: none; white-space: nowrap; padding: 4px 0; }
.site-nav a:hover, .site-nav a[aria-current], .site-nav a.on { color: var(--accent); }
.site-nav a[aria-current], .site-nav a.on { box-shadow: inset 0 -2px 0 var(--accent); }
.site-nav a:last-child { position: relative; margin-left: 6px; }
.site-nav a:last-child::before { content: ""; position: absolute; left: -15px; top: 6px; bottom: 6px; border-left: 1px solid var(--rule); }

/* 手機選單（≤560px 且有 JavaScript）：頁首右側「選單」按鈕，開啟全螢幕選單頁（10-13 使用者「漢堡頁需要重新設計」） */
.menu-btn { display: none; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; margin-right: -12px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; }
.menu-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.menu-btn .ico { position: relative; width: 20px; height: 14px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; }
.menu-btn .ico::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; 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: 6px; 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: 10px; background: var(--card); text-decoration: none; }
.m-cats span { font-family: var(--serif); 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-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; } }

/* 首頁 */
.hero { padding: 64px 0 40px; border-bottom: 1px solid var(--rule); }
.hero h1 { font-family: var(--serif); font-size: clamp(34px, 6vw, 52px); line-height: 1.25; margin: 0 0 6px; letter-spacing: .06em; }
.hero .en { font-size: 13px; letter-spacing: .32em; color: var(--muted); margin: 0 0 20px; text-transform: uppercase; }
.hero .lede { font-size: 19px; color: var(--ink); max-width: 640px; margin: 0 0 24px; }
.topics { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.topics li { font-size: 14px; border: 1px solid var(--rule); border-radius: 999px; padding: 2px 14px; color: var(--muted); background: var(--card); }
.topics a { text-decoration: none; }

.section-t { font-family: var(--serif); font-size: 22px; margin: 44px 0 8px; }
.posts { list-style: none; margin: 0 0 56px; padding: 0; }
.post { padding: 26px 0; border-bottom: 1px solid var(--rule); }
.post .cat { font-size: 13px; letter-spacing: .1em; color: var(--accent); margin: 0 0 6px; }
.cat .type { color: var(--muted); }
.cat .type::before { content: "・"; }
a.type { text-decoration: none; }
a.type:hover { color: var(--accent); }
.more { margin: -36px 0 8px; font-size: 15px; }
.more a { text-decoration: none; }
.more a::after { content: " →"; }

/* 首頁題材區塊（階段 2） */
.topic-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 16px 0 56px; }
.topic { border: 1px solid var(--rule); border-radius: 10px; padding: 18px 20px 14px; }
.topic h3 { font-family: var(--serif); font-size: 20px; margin: 0 0 6px; }
.topic h3 a { color: var(--accent); text-decoration: none; }
.topic ul { list-style: none; margin: 0; padding: 0; }
.topic li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.topic li a { color: var(--ink); text-decoration: none; line-height: 1.5; }
.topic li a:hover { color: var(--accent); }
.topic time { flex: none; font-size: 13px; color: var(--muted); }
.topic .more { margin: 10px 0 0; font-size: 14px; }
.list-lead { color: var(--muted); margin: -8px 0 8px; }
@media (min-width: 768px) { .topic-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .topic li { display: block; } .topic time { display: block; margin-top: 2px; } .topic { padding: 16px 16px 12px; } }
.post h2, .post h3 { font-family: var(--serif); font-size: 23px; line-height: 1.45; margin: 0 0 8px; }
.post h2 a, .post h3 a { color: var(--ink); text-decoration: none; }
.post h2 a:hover, .post h3 a:hover { color: var(--accent); }
.post p { margin: 0 0 8px; color: var(--muted); }
.post .meta { font-size: 14px; }

/* 文章 */
.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); }
.art-head { padding: 26px 0 8px; }
.art-head .cat { font-size: 14px; letter-spacing: .1em; margin: 0 0 10px; }
.art-head .cat a { text-decoration: none; }
.art-head h1 { font-family: var(--serif); font-size: clamp(27px, 4.6vw, 38px); line-height: 1.4; margin: 0 0 14px; }
.art-head .dek { font-size: 18px; color: var(--muted); margin: 0 0 16px; }
.byline { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 18px; }
.byline strong { color: var(--ink); font-weight: 600; }
.article-photo { margin: 0 0 26px; }
.article-photo img { display: block; width: 100%; height: auto; border-radius: 8px; background: var(--note); }
.article-photo figcaption { margin-top: 8px; font-size: 13px; line-height: 1.7; color: var(--muted); }
.article-photo figcaption a { color: inherit; }
.disclose { font-size: 14px; color: var(--muted); background: var(--note); border-left: 3px solid var(--rule); padding: 10px 14px; margin: 0 0 26px; }

.sum { background: var(--accent-soft); border-radius: 10px; padding: 18px 22px 10px; margin: 0 0 26px; }
.sum .sum-t { font-weight: 700; margin: 0 0 6px; color: var(--accent); letter-spacing: .08em; }
.sum ul { margin: 0; padding-left: 1.2em; }
.sum li { margin: 0 0 8px; }

.toc { border: 1px solid var(--rule); border-radius: 10px; padding: 0 22px; margin: 0 0 34px; background: var(--card); }
.toc summary { display: flex; align-items: center; gap: 12px; padding: 13px 0; cursor: pointer; list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "展開"; margin-left: auto; font-size: 14px; font-weight: 700; color: var(--accent); }
.toc details[open] > summary::after { content: "收合"; }
.toc summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.toc .toc-t { font-weight: 700; }
.toc .toc-n { font-size: 14px; color: var(--muted); }
.toc ol { margin: 0; padding: 2px 0 14px; list-style: none; font-size: 15.5px; counter-reset: toc; border-top: 1px solid var(--rule); }
.toc li { margin: 0; padding: 5px 0 0 30px; position: relative; counter-increment: toc; }
.toc li::before { content: counter(toc); position: absolute; left: 0; top: 5px; width: 22px; font-size: 13.5px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }

.prose h2 { font-family: var(--serif); font-size: 25px; line-height: 1.45; margin: 52px 0 16px; padding-top: 22px; border-top: 1px solid var(--rule); scroll-margin-top: 16px; }
.prose h3 { font-size: 18px; line-height: 1.6; margin: 28px 0 6px; }
.prose p { margin: 0 0 18px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 1.4em; }
.prose li { margin: 0 0 8px; }
.prose strong { font-weight: 700; }
.empty { margin: 8px 0 40px; padding: 18px 20px; border: 1px dashed var(--rule); border-radius: 10px; color: var(--muted); }   /* 還沒有文章時的準備中提示 */
/* 文末「資料來源」：連結多、句子長，字級比內文小（10-13 使用者） */
.prose .sources { font-size: 14.5px; line-height: 1.8; }
.prose .sources li { margin: 0 0 6px; }
.prose .sources p { margin: 0 0 12px; }
.tw { overflow-x: auto; margin: 0 0 22px; border: 1px solid var(--rule); border-radius: 8px; 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: 10px 14px; border-bottom: 1px solid var(--rule); }
.tw th { background: var(--note); font-weight: 700; white-space: nowrap; }
.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），內文欄寬不變（一行約 41 字） */
@media (min-width: 980px) {
  .prose .tw { margin-left: -96px; margin-right: -96px; }
}

.author-box { border-top: 1px solid var(--rule); margin: 48px 0 64px; padding-top: 20px; font-size: 15px; color: var(--muted); }
.author-box strong { color: var(--ink); }

/* 一般頁 */
.page { padding-top: 40px; padding-bottom: 64px; }
.page h1 { font-family: var(--serif); font-size: clamp(28px, 4.6vw, 38px); margin: 0 0 20px; }

/* 頁尾 */
.site-foot { border-top: 1px solid var(--rule); padding: 32px 0 84px; font-size: 14px; color: var(--muted); }
.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(--muted); }
.site-foot a:hover { color: var(--accent); }
.site-foot .foot-grid { display: grid; grid-template-columns: 1fr; gap: 28px; }
.foot-brand p { margin: 0 0 8px; line-height: 1.7; }
.foot-name { display: flex; align-items: baseline; gap: 8px; font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: .06em; }
.foot-name .mark { width: 22px; height: 22px; align-self: center; color: var(--logo); }
.foot-name span { font-family: var(--sans); font-size: 11px; font-weight: 400; letter-spacing: .28em; color: var(--muted); text-transform: uppercase; }
.foot-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.foot-h { font-size: 13px; letter-spacing: .12em; color: var(--ink); font-weight: 700; margin: 0 0 8px; }
.foot-col ul { list-style: none; margin: 0; padding: 0; }
.foot-col li { margin: 0 0 6px; }
.foot-col a { text-decoration: none; }
@media (min-width: 768px) { .site-foot .foot-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.6fr); gap: 40px; } }
.site-foot .copy { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 13px; }
.site-foot .legal a { white-space: nowrap; }

/* 返回頂部：捲動超過 600px 才出現（tools/build.py 的 page() 底部腳本） */
.to-top { position: fixed; right: 20px; bottom: 20px; width: 44px; height: 44px; 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 2px 10px rgba(0, 0, 0, .18); 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 (max-width: 560px) {
  body { font-size: 16.5px; }
  .brand .zh { font-size: 22px; }
  .brand .mark { width: 26px; height: 26px; }
  .brand .en { display: none; }
  .site-head .wrap { flex-wrap: wrap; row-gap: 0; min-height: 0; padding-top: 12px; }
  .site-nav { gap: 18px; 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: 60px; padding-top: 0; }
  .js .menu-btn { display: inline-flex; }
  .hero { padding: 40px 0 28px; }
  .prose h2 { font-size: 22px; }
  .sum, .toc { padding-left: 16px; padding-right: 16px; }
  .to-top { right: 16px; bottom: 16px; }
}
