:root {
  --canvas: #f3f1ec;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --ink: #1b2420;
  --ink-2: #3a4741;
  --muted: #66736d;
  --line: #e2ddd3;
  --line-strong: #c9c2b5;
  --brand: #0f5c4c;
  --brand-ink: #ffffff;
  --brand-soft: #e3efe9;
  --focus: rgba(15, 92, 76, .35);
  --warn-bg: #fbeee2;
  --warn-ink: #8a3f12;
  --hit: #b5452f;
  --shadow: 0 1px 2px rgba(27, 36, 32, .05), 0 4px 16px rgba(27, 36, 32, .05);
  --shadow-hover: 0 2px 4px rgba(27, 36, 32, .06), 0 10px 28px rgba(27, 36, 32, .09);
  --t1: #2f5f8a; --t1-bg: #e6eef6;
  --t2: #8a4b14; --t2-bg: #f7ebdd;
  --t3: #1f6b48; --t3-bg: #e2f1e8;
  --t4: #6b3f86; --t4-bg: #f0e7f5;
  --t5: #a2343e; --t5-bg: #f8e5e6;
  --tx: #4b5a54; --tx-bg: #ecefed;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #121715; --surface: #1a211e; --surface-2: #1f2723; --ink: #e8ede9; --ink-2: #c9d3ce; --muted: #93a39b;
    --line: #2c3632; --line-strong: #3d4943; --brand: #6ccfa6; --brand-ink: #0d1c16; --brand-soft: #1f3a2f; --focus: rgba(108, 207, 166, .4);
    --warn-bg: #3a2718; --warn-ink: #f2b48a; --hit: #f09a83;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-hover: 0 6px 22px rgba(0, 0, 0, .45);
    --t1: #8ab8e6; --t1-bg: #1d2d3c; --t2: #e6b27f; --t2-bg: #362818; --t3: #7fd3a4; --t3-bg: #193326;
    --t4: #c9a3e3; --t4-bg: #2d2238; --t5: #ef9aa2; --t5-bg: #3a1f23; --tx: #b5c2bc; --tx-bg: #26302c;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-padding-top: 180px; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: 16px/1.7 "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; letter-spacing: 0; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }
.wrap { width: min(1200px, calc(100% - 32px)); margin: 0 auto; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 30; padding: 8px 14px; background: var(--surface); color: var(--brand); }
.skip-link:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- 頂端 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand-row { min-height: 68px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; flex: 1; min-width: 0; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; flex: 0 0 auto; }
.brand-mark svg { width: 28px; height: 28px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 19px; line-height: 1.3; font-weight: 750; letter-spacing: .01em; }
.brand-text small { color: var(--muted); font-size: 13px; }
.search { position: relative; width: min(380px, 40vw); }
.search svg { position: absolute; left: 12px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--muted); }
.search input {
  width: 100%; height: 42px; padding: 0 14px 0 38px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
}
.search input:focus { outline: 3px solid var(--focus); border-color: var(--brand); }
.filter-toggle { display: none; }

.controls { display: grid; gap: 10px; padding: 4px 0 14px; }
.control-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.control-label { width: 64px; flex: 0 0 auto; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.control-hint { color: var(--muted); font-size: 13px; }
.segment { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.segment button { border: 0; background: transparent; min-height: 34px; padding: 0 14px; border-radius: 7px; color: var(--ink-2); white-space: nowrap; font-size: 15px; }
.segment button:hover { background: var(--brand-soft); }
.segment button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); font-weight: 700; box-shadow: var(--shadow); }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 13px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 14px;
  transition: background .15s, border-color .15s;
}
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: 0 0 auto; }
.chip .count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--c); }
.chip[aria-pressed="true"] { background: var(--c-bg); border-color: var(--c); color: var(--c); font-weight: 700; }
.chip[aria-pressed="true"] .count { color: inherit; }
.chip:disabled { opacity: .45; cursor: default; }

.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 0 12px; font-size: 13px; color: var(--muted); }
.active-filters:empty { display: none; }
.active-filters button {
  border: 1px solid var(--brand); border-radius: 999px; background: var(--brand-soft); color: var(--brand);
  min-height: 30px; padding: 0 12px; font-size: 13px; font-weight: 700;
}

/* ---------- 清單 ---------- */
main { padding: 26px 0 56px; }
.result-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.view-title { margin: 0; font-size: 22px; line-height: 1.35; }
.result-meta { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.sort-controls { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.sort-controls select { min-height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: 14px; }
.text-button { border: 0; background: transparent; color: var(--brand); font-weight: 700; min-height: 36px; padding: 0 4px; }
.text-button:hover { text-decoration: underline; }

.issue { margin: 0 0 40px; }
.issue-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.issue-head h2 { margin: 0; font-size: 18px; }
.issue-head span { color: var(--muted); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }

.card {
  --c: var(--tx); --c-bg: var(--tx-bg);
  position: relative; min-width: 0; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s;
  scroll-margin-top: 190px;
}
.card:hover { box-shadow: var(--shadow-hover); }
.card::before { content: ""; height: 4px; background: var(--c); }
.card.open { grid-column: 1 / -1; }
.card.target { outline: 3px solid var(--hit); outline-offset: 2px; }
.card.dim { opacity: .62; }
.card.dim:hover { opacity: 1; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 14px; }
.tag-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.tag {
  display: inline-flex; align-items: center; min-height: 26px; padding: 2px 9px; border-radius: 6px;
  border: 1px solid transparent; background: var(--c-bg); color: var(--c); font-size: 12.5px; font-weight: 700; line-height: 1.3;
}
.tag.plain { --c: var(--tx); --c-bg: var(--tx-bg); font-weight: 600; }
button.tag:hover { border-color: currentColor; }
button.tag[aria-pressed="true"] { box-shadow: inset 0 0 0 1px currentColor; border-color: currentColor; }
.tag.lens-hit { border-color: currentColor; }
.tag-row .issue-tag { margin-left: auto; }
.card-title { margin: 0 0 6px; font-size: 18px; line-height: 1.45; font-weight: 750; overflow-wrap: anywhere; }
.card-title a { color: inherit; text-decoration: none; }
.card-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.meta { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.meta span + span::before { content: "・"; margin: 0 2px; color: var(--muted); }
.meta .no-primary { color: var(--warn-ink); font-weight: 700; white-space: nowrap; }
.label { display: block; color: var(--muted); font-size: 11.5px; font-weight: 800; letter-spacing: .06em; margin-bottom: 3px; }
.summary { margin: 0 0 12px; color: var(--ink-2); font-size: 15px; line-height: 1.75; }
.notice { margin: 0 0 18px; padding: 6px 10px; border-radius: 7px; background: var(--warn-bg); color: var(--warn-ink); font-size: 13px; }
.lens-panel { margin: 0 0 12px; padding: 10px 12px; border-left: 3px solid var(--hit); background: var(--surface-2); border-radius: 0 8px 8px 0; font-size: 14px; color: var(--ink-2); }
.lens-panel .label { color: var(--hit); }
.extra-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }

.report { margin-top: auto; border-top: 1px solid var(--line); }
.report > summary {
  list-style: none; display: flex; align-items: center; gap: 6px; padding: 11px 0 4px;
  color: var(--brand); font-weight: 750; cursor: pointer; font-size: 15px;
}
.report > summary::-webkit-details-marker { display: none; }
.report > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-right: 4px; }
.report[open] > summary::before { transform: rotate(45deg); }
.report .reading-time { color: var(--muted); font-weight: 400; font-size: 13px; }
.report-body { max-width: 720px; margin: 14px auto 6px; font-size: 16.5px; line-height: 1.95; overflow-wrap: anywhere; }
.report-body h4 { font-size: 19px; margin: 30px 0 8px; line-height: 1.5; }
.report-body p { margin: 0 0 18px; }
.cite {
  display: inline-block; margin-left: 2px; padding: 0 4px; border-radius: 4px; vertical-align: 1px;
  font-size: 12px; line-height: 1.6; font-weight: 700; text-decoration: none; background: var(--brand-soft); color: var(--brand);
}
.cite:hover { background: var(--brand); color: var(--brand-ink); }
.unverified { margin: 24px 0 18px; padding: 12px 16px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-ink); font-size: 15px; line-height: 1.8; }
.unverified h5 { margin: 0 0 4px; font-size: 14px; }
.unverified ul { margin: 0; padding-left: 20px; }
.sources { margin: 26px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.7; }
.sources h5 { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.sources ol { margin: 0; padding-left: 26px; }
.sources li { margin-bottom: 4px; }
.kind { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; font-size: 11.5px; font-weight: 700; background: var(--tx-bg); color: var(--tx); }
.kind.primary { background: var(--brand-soft); color: var(--brand); }

.card-footer { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.card-footer .status { margin-right: auto; color: var(--muted); font-size: 13px; }
.link-button { border: 0; background: transparent; color: var(--muted); font-size: 13px; padding: 4px 0; min-height: 32px; text-decoration: underline; text-underline-offset: 3px; }
.link-button:hover { color: var(--ink); }
.read-link { color: var(--brand); font-size: 13.5px; font-weight: 750; text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.read-link:hover { text-decoration: underline; }

.empty { padding: 48px 20px; border: 1px dashed var(--line-strong); border-radius: 12px; text-align: center; color: var(--muted); background: var(--surface); }
.empty p { margin: 0 0 14px; }
.empty button { min-height: 38px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); font-weight: 700; }

.site-footer { padding: 22px 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; line-height: 1.8; }
.site-footer p { margin: 0 0 8px; max-width: 780px; }
.site-footer strong { color: var(--ink-2); }
.to-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 15; min-height: 44px; padding: 0 16px; border-radius: 22px;
  border: 1px solid var(--line); background: var(--surface); color: var(--brand); font-weight: 700; box-shadow: var(--shadow-hover);
}
[hidden] { display: none !important; }

@media (max-width: 980px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  html { scroll-padding-top: 120px; }
  .wrap { width: calc(100% - 24px); }
  .brand-row { min-height: 0; padding: 10px 0; flex-wrap: wrap; gap: 10px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 8px; }
  .brand-mark svg { width: 23px; height: 23px; }
  .brand-text strong { font-size: 16.5px; }
  .brand-text small { display: none; }
  .filter-toggle {
    display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 8px;
    border: 1px solid var(--line-strong); background: var(--surface); color: var(--brand); font-weight: 700; font-size: 14px;
  }
  .filter-toggle[aria-expanded="true"] { background: var(--brand-soft); border-color: var(--brand); }
  .search { order: 3; width: 100%; }
  .controls { display: none; }
  .topbar.controls-open .controls { display: grid; }
  .control-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .control-label { width: auto; }
  .segment { display: flex; overflow-x: auto; }
  .segment button { flex: 1 0 auto; }
  .chip-list { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px; padding: 2px 12px 6px; }
  .chip { flex: 0 0 auto; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .card { scroll-margin-top: 130px; }
  .card-body { padding: 14px 14px 12px; }
  .report-body { font-size: 16px; }
  .result-head { align-items: flex-start; }
  .link-button, .read-link { min-height: 40px; font-size: 14px; }
}
@media print {
  .topbar, .to-top, .card-footer, .sort-controls { display: none !important; }
  body { background: #fff; color: #000; }
  .grid { display: block; }
  .card { box-shadow: none; border: 0; break-inside: avoid; margin-bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
