/* UTK 技術誌 — 光明模式閱讀樣式 */
:root {
  /* 品牌色取自 Logo：藍 #0072CE、紅 #E4002B */
  --brand-blue: #0072ce;
  --brand-red: #e4002b;
  --bg: #f3f6f9;
  --surface: #ffffff;
  --text: #1b2130;
  --text-2: #444e60;
  --text-3: #66717f;
  --border: #e1e7ee;
  --border-2: #cfd8e2;
  --accent: var(--brand-blue);
  --accent-ink: #005a9e;
  --accent-soft: #e8f2fb;
  --code-bg: #f2f5f9;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 50, .04), 0 4px 16px rgba(20, 30, 50, .05);
  --shadow-hover: 0 2px 4px rgba(20, 30, 50, .05), 0 10px 28px rgba(20, 30, 50, .09);
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Heiti TC", sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, ui-monospace, "Microsoft JhengHei", monospace;
  --header-h: 64px;

  /* 主題色（文字色 / 淡底色） */
  --models: #6a3fd0;   --models-soft: #f1ecfc;
  --tools: #0067b9;    --tools-soft: #e6f0fa;
  --tips: #0b7d6c;     --tips-soft: #e2f4ef;
  --billing: #a35400;  --billing-soft: #fcf0df;
  --insights: #b5306a; --insights-soft: #fbeaf1;
  --security: var(--brand-red); --security-soft: #fde8ec;
  --team: #2c6a2c;     --team-soft: #e7f3e5;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font);
  letter-spacing: .01em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.muted { color: var(--text-3); }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 40px); }

/* ---------- 頁首 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 28px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-size: 18px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-logo { display: block; width: 56px; height: 36px; }
.brand-text { padding-left: 12px; border-left: 1px solid var(--border-2); font-weight: 700; letter-spacing: .08em; line-height: 1.3; }
.top-nav { display: flex; gap: 4px; }
.top-nav a { color: var(--text-2); padding: 6px 12px; border-radius: 8px; font-size: 15px; }
.top-nav a:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.search {
  margin-left: auto; position: relative; display: flex; align-items: center;
  width: min(340px, 100%);
}
.search .icon { position: absolute; left: 12px; width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.search input {
  width: 100%; height: 40px; padding: 0 44px 0 38px;
  border: 1px solid var(--border-2); border-radius: 10px; background: var(--bg);
  font: inherit; font-size: 15px; color: var(--text);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search kbd {
  position: absolute; right: 10px; font: 12px var(--mono); color: var(--text-3);
  border: 1px solid var(--border-2); border-radius: 5px; padding: 1px 6px; background: #fff;
}
.search input:focus + kbd { display: none; }
.icon { width: 20px; height: 20px; flex: none; }

/* ---------- 首頁主視覺 ---------- */
.hero { background: var(--surface); border-bottom: 1px solid var(--border); padding-block: 44px 36px; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 14px; font-weight: 600; letter-spacing: .06em; }
.eyebrow a { color: inherit; }
.hero .eyebrow::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--brand-red); vertical-align: 1px; }
::selection { background: #cfe3f5; color: var(--text); }
.hero h1, .cat-hero h1 { margin: 0; font-size: clamp(28px, 3vw, 38px); line-height: 1.25; letter-spacing: .02em; }
.lead { margin: 10px 0 0; color: var(--text-2); font-size: 17px; max-width: 46em; }
.stats { display: flex; flex-wrap: wrap; gap: 12px 36px; list-style: none; margin: 22px 0 0; padding: 0; }
.stats li { display: flex; align-items: baseline; gap: 8px; }
.stats b { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats span { color: var(--text-3); font-size: 14px; }
.cat-hero { background: var(--surface); border-bottom: 1px solid var(--border); padding-block: 32px 28px; }
.cat-hero h1 { display: flex; align-items: center; gap: 12px; }
.cat-hero h1 .dot { width: 14px; height: 14px; }

/* ---------- 版面：側欄 + 內容 ---------- */
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; padding-block: 32px 64px; align-items: start; }
.content { min-width: 0; max-width: 920px; }
.sidebar {
  position: sticky; top: calc(var(--header-h) + 20px); max-height: calc(100vh - var(--header-h) - 40px);
  overflow-y: auto; padding-right: 4px; scrollbar-width: thin; scrollbar-color: transparent transparent;
}
.sidebar:hover { scrollbar-color: var(--border-2) transparent; }
.side-block + .side-block { margin-top: 22px; }
.side-title { margin: 0 0 6px; padding-left: 10px; font-size: 13px; font-weight: 600; color: var(--text-3); letter-spacing: .08em; }
.side-link {
  display: flex; align-items: center; gap: 10px; padding: 5px 10px; border-radius: 9px;
  color: var(--text-2); font-size: 15px;
}
.side-link small { margin-left: auto; color: var(--text-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.side-link:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.side-link.is-active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--c, var(--text-3)); }
.dot-all { background: var(--brand-blue); box-shadow: 3px -3px 0 -1px var(--brand-red); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 6px; }
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px;
  color: var(--text-2); background: var(--surface); border: 1px solid var(--border);
}
.tag:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* 主題色對應 */
.c-models { --c: var(--models); --cs: var(--models-soft); }
.c-tools { --c: var(--tools); --cs: var(--tools-soft); }
.c-tips { --c: var(--tips); --cs: var(--tips-soft); }
.c-billing { --c: var(--billing); --cs: var(--billing-soft); }
.c-insights { --c: var(--insights); --cs: var(--insights-soft); }
.c-security { --c: var(--security); --cs: var(--security-soft); }
.c-team { --c: var(--team); --cs: var(--team-soft); }
.chip {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; line-height: 1.6; color: var(--c); background: var(--cs); white-space: nowrap;
}
a.chip:hover { text-decoration: none; filter: brightness(.96); }

/* 手機用的主題橫捲列 */
.chip-bar { display: none; }

/* ---------- 文章列表 ---------- */
.month + .month { margin-top: 36px; }
.month-head {
  position: sticky; top: var(--header-h); z-index: 5;
  display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; padding: 10px 2px;
  background: var(--bg); font-size: 18px; font-weight: 700;
}
.month-head small { color: var(--text-3); font-size: 14px; font-weight: 500; }
.card { margin-bottom: 14px; }
.card-link {
  display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 20px; align-items: start;
  padding: 20px 22px; border-radius: var(--radius); background: var(--surface); color: inherit;
  border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: box-shadow .18s, border-color .18s, transform .18s;
}
.card-link:hover { text-decoration: none; border-color: var(--border-2); box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.card-link:hover .card-title { color: var(--accent-ink); }
.card-date {
  display: flex; flex-direction: column; align-items: center; padding-top: 2px;
  border-right: 1px solid var(--border); padding-right: 16px; margin-right: -4px;
}
.cd-d { font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cd-m { font-size: 13px; color: var(--text-2); }
.cd-w { font-size: 12px; color: var(--text-3); }
.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.card-meta time { display: none; font-size: 13px; color: var(--text-3); }
.card-title { margin: 8px 0 6px; font-size: 19px; line-height: 1.45; font-weight: 700; color: var(--text); transition: color .15s; }
.card-sum {
  margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.75;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot { margin-top: 10px; font-size: 13px; color: var(--text-3); }
.card-thumb {
  width: 148px; height: 100px; object-fit: cover; object-position: top center;
  border-radius: 10px; border: 1px solid var(--border); background: var(--bg);
}

/* 搜尋與篩選 */
.filter-note {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 18px;
  padding: 12px 16px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: 15px;
}
.filter-note button {
  margin-left: auto; border: 0; background: #fff; color: var(--accent-ink); font: inherit; font-size: 14px;
  padding: 4px 12px; border-radius: 8px; cursor: pointer;
}
.results .card-sum { -webkit-line-clamp: 3; }
.results mark { background: #fff1a8; color: inherit; padding: 0 1px; border-radius: 3px; }
.empty { padding: 48px 24px; text-align: center; color: var(--text-3); background: var(--surface); border-radius: var(--radius); border: 1px dashed var(--border-2); }

/* ---------- 文章頁 ---------- */
.progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 40; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
.post-layout {
  display: grid; grid-template-columns: minmax(0, 720px) 280px; gap: 56px; justify-content: center;
  padding-block: 28px 72px; align-items: start;
}
.post {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 36px 48px 40px; box-shadow: var(--shadow); min-width: 0;
}
.crumbs { display: flex; gap: 8px; font-size: 14px; color: var(--text-3); }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--accent); }
.post-head h1 { margin: 14px 0 0; font-size: clamp(26px, 2.4vw, 32px); line-height: 1.4; letter-spacing: .015em; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 14px; color: var(--text-3); font-size: 14px; }
.meta-upd { color: var(--models); }
.standfirst {
  margin: 22px 0 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent);
  font-size: 18.5px; line-height: 1.8; color: #34405a;
}

.post-body { margin-top: 30px; font-size: 17.5px; line-height: 1.9; color: #232a38; overflow-wrap: break-word; }
.post-body > :first-child { margin-top: 0; }
.post-body p { margin: 0 0 1.05em; }
.post-body strong { color: var(--text); font-weight: 700; }
.post-body h2 {
  margin: 2.1em 0 .7em; padding-top: 1.1em; border-top: 1px solid var(--border);
  font-size: 22.5px; line-height: 1.45;
}
.post-body > h2:first-child { border-top: 0; padding-top: 0; }
.post-body h3 { margin: 1.6em 0 .5em; font-size: 18.5px; line-height: 1.5; }
.post-body h2 + h3 { margin-top: .8em; }
.post-body ul, .post-body ol { margin: 0 0 1.1em; padding-left: 1.5em; }
.post-body li { margin: .35em 0; padding-left: .2em; }
.post-body li::marker { color: var(--text-3); font-weight: 600; }
.post-body a { overflow-wrap: anywhere; }

/* 行內程式碼 */
.post-body code { font: .86em var(--mono); background: var(--code-bg); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; overflow-wrap: anywhere; }

/* 表格 */
.table-wrap { margin: 1.2em 0 1.6em; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.6; }
.table-wrap th, .table-wrap td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.table-wrap th { background: #f5f7fa; font-weight: 700; color: var(--text); white-space: nowrap; font-size: 14.5px; }
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap tbody tr:nth-child(even) td { background: #fbfcfd; }
.table-wrap td strong { color: var(--accent-ink); }
.table-wrap td code {
  font-size: 13.5px; background: #fff; border: 1px solid var(--border-2); border-bottom-width: 2px;
  border-radius: 6px; padding: 1px 7px; white-space: nowrap;
}

/* 提示框 */
.callout {
  margin: 1.3em 0 1.5em; padding: 14px 18px; border-radius: 12px;
  border: 1px solid var(--co-b); border-left: 4px solid var(--co); background: var(--co-bg);
  font-size: 16.5px; line-height: 1.8;
}
.callout p { margin: 0; }
.callout p + p { margin-top: .5em; }
.callout strong:first-child { color: var(--co); }
.callout.is-note { --co: var(--accent); --co-b: #cfe3f5; --co-bg: #f3f8fd; }
.callout.is-tip { --co: var(--tips); --co-b: #cfeae2; --co-bg: #f2faf7; }
.callout.is-warn { --co: var(--billing); --co-b: #f3dfc0; --co-bg: #fdf8f0; }
.callout.is-update { --co: var(--models); --co-b: #e2d8f7; --co-bg: #f8f5fe; }

/* 程式碼與提示詞區塊 */
.codebox { margin: 1em 0 1.5em; border: 1px solid var(--border-2); border-radius: 12px; overflow: hidden; background: var(--code-bg); }
.codebox.is-prompt { border-color: #cde1f4; background: #f4f8fd; }
.codebox-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 16px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-3); font-weight: 600; }
.codebox.is-prompt .codebox-head { color: var(--accent); border-bottom-color: #dcebf7; }
.copy {
  border: 1px solid var(--border-2); background: #fff; color: var(--text-2); font: inherit; font-size: 13px;
  padding: 3px 12px; border-radius: 7px; cursor: pointer;
}
.copy:hover { border-color: var(--accent); color: var(--accent); }
.copy.is-done { color: var(--tips); border-color: var(--tips); }
.codebox pre { margin: 0; padding: 14px 16px; overflow-x: auto; }
.codebox code { font: 15px/1.75 var(--mono); white-space: pre-wrap; color: #22304a; background: none; border: 0; padding: 0; overflow-wrap: anywhere; }

/* 延伸閱讀卡片 */
.link-list { list-style: none; margin: 0 0 1em; padding: 0; display: grid; gap: 10px; }
.link-list li { margin: 0; padding: 0; }
.link-card {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px;
  border: 1px solid var(--border); border-radius: 12px; background: #fbfcfd; color: var(--text);
  line-height: 1.5; transition: border-color .15s, background .15s;
}
.link-card:hover { text-decoration: none; border-color: var(--accent); background: var(--accent-soft); }
.link-card:hover .lc-title { color: var(--accent-ink); }
.lc-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); flex: none; }
.lc-body { display: flex; flex-direction: column; min-width: 0; }
.lc-site { font-size: 12.5px; font-weight: 600; color: var(--text-3); letter-spacing: .02em; }
.lc-title { font-size: 16px; font-weight: 600; color: var(--text); }
.lc-desc { font-size: 14px; color: var(--text-2); }
.lc-go { margin-left: auto; padding-left: 8px; color: var(--text-3); font-size: 18px; }

/* 圖片 */
.fig { margin: 1.5em 0 1.7em; text-align: center; }
.zoom { position: relative; display: inline-block; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 12px; max-width: 100%; }
.zoom img { display: block; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); }
.fig.is-small .zoom img { max-width: min(100%, 520px); }
.fig figcaption { margin-top: 10px; font-size: 14px; line-height: 1.6; color: var(--text-3); }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 1.5em 0 1.7em; align-items: start; }
.gallery .fig { margin: 0; }

.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }
.post-nav a {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--border); color: var(--text); line-height: 1.5;
}
.post-nav a:hover { border-color: var(--accent); text-decoration: none; background: var(--accent-soft); }
.post-nav small { color: var(--text-3); font-size: 13px; }
.post-nav span { font-weight: 600; font-size: 15px; }
.pn-next { text-align: right; }

/* 文章側欄 */
.post-aside { position: sticky; top: calc(var(--header-h) + 28px); display: flex; flex-direction: column; gap: 20px; }
.toc, .related { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.toc summary, .related h2 { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--text-2); letter-spacing: .06em; cursor: pointer; list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { margin: 0; padding-left: 0; list-style: none; counter-reset: t; }
.toc li { margin: 2px 0; }
.toc a { display: block; padding: 5px 10px; border-radius: 8px; font-size: 14px; line-height: 1.5; color: var(--text-2); border-left: 2px solid transparent; }
.toc a:hover { background: var(--bg); text-decoration: none; color: var(--text); }
.toc a.is-active { color: var(--accent-ink); background: var(--accent-soft); border-left-color: var(--accent); }
.post .toc { margin-top: 20px; box-shadow: none; background: #fbfcfd; }
.post .toc summary::after { content: "▾"; float: right; color: var(--text-3); }
.toc-side { max-height: 62vh; overflow-y: auto; scrollbar-width: thin; }
.related ol { list-style: none; margin: 0; padding: 0; }
.related li + li { border-top: 1px solid var(--border); }
.related a { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; color: var(--text); font-size: 15px; line-height: 1.5; }
.related a:hover { text-decoration: none; color: var(--accent-ink); }
.related time { font-size: 12.5px; color: var(--text-3); }
.related .more { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 600; }

/* ---------- 頁尾、浮動按鈕、燈箱 ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding-block: 32px; font-size: 14px; color: var(--text-2); }
.footer-inner p { margin: 0 0 4px; }
.footer-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.footer-brand img { display: block; width: 50px; height: 32px; }
.footer-brand div { padding-left: 14px; border-left: 1px solid var(--border-2); }
.footer-brand b { display: block; font-size: 16px; color: var(--text); }
.footer-brand small { display: block; font-size: 12.5px; color: var(--text-3); letter-spacing: .06em; }

/* ---------- 關於頁 ---------- */
.about { padding-block: 32px 64px; }
.about-body { max-width: 820px; margin-inline: auto; }
.about-h { margin: 2em 0 .8em; padding-top: 1.1em; border-top: 1px solid var(--border); font-size: 22.5px; }
.cat-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.cat-list a {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 12px; color: var(--text); background: #fbfcfd;
}
.cat-list a:hover { border-color: var(--accent); text-decoration: none; background: var(--accent-soft); }
.cat-list .dot { width: 10px; height: 10px; }
.cat-list span:last-child { grid-column: 2; font-size: 14px; color: var(--text-2); }
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 20; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border-2); background: #fff; color: var(--text-2); font-size: 18px; cursor: pointer;
  box-shadow: var(--shadow-hover); opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.to-top.is-on { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--accent); border-color: var(--accent); }

.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(14, 18, 26, .94); color: #fff;
}
.lightbox::backdrop { background: rgba(14, 18, 26, .6); }
.lightbox[open] { display: flex; flex-direction: column; }
.lb-scroll { flex: 1; overflow: auto; display: flex; padding: 56px 24px 12px; cursor: zoom-out; }
.lb-scroll img { margin: auto; max-width: 100%; height: auto; border-radius: 8px; background: #fff; cursor: default; }
.lb-scroll.is-tall img { margin-top: 0; }
.lb-cap { margin: 0; padding: 12px 24px 20px; text-align: center; font-size: 14px; color: #cfd6e2; }
.lb-close {
  position: absolute; top: 12px; right: 16px; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 18px; cursor: pointer; z-index: 2;
}
.lb-close:hover { background: rgba(255, 255, 255, .26); }

/* ---------- 寬螢幕（1920 × 1080） ---------- */
@media (min-width: 1600px) {
  .wrap { max-width: 1320px; }
  .layout { grid-template-columns: 260px minmax(0, 1fr); gap: 64px; }
  .post-layout { grid-template-columns: minmax(0, 760px) 300px; gap: 64px; }
  .post-body { font-size: 18px; }
}

/* ---------- 平板 ---------- */
@media (max-width: 1100px) {
  .post-layout { grid-template-columns: minmax(0, 760px); }
  .post-aside { position: static; }
  .toc-side { display: none; }
}
@media (min-width: 1101px) {
  .post .toc { display: none; }
}
@media (max-width: 1024px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-top: 20px; }
  .sidebar { display: none; }
  .content { max-width: none; }
  .chip-bar {
    display: flex; gap: 8px; overflow-x: auto; margin: 0 calc(-1 * clamp(16px, 4vw, 40px)) 18px; padding: 2px clamp(16px, 4vw, 40px) 6px;
    scrollbar-width: none;
  }
  .chip-bar::-webkit-scrollbar { display: none; }
  .cb-item {
    display: inline-flex; align-items: center; gap: 7px; flex: none; padding: 7px 14px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-size: 14px; white-space: nowrap;
  }
  .cb-item small { color: var(--text-3); }
  .cb-item.is-active { background: var(--text); border-color: var(--text); color: #fff; }
  .cb-item.is-active small { color: rgba(255, 255, 255, .7); }
  .cb-item:hover { text-decoration: none; }
}

/* ---------- 手機 ---------- */
@media (max-width: 720px) {
  :root { --header-h: 0px; }
  body { font-size: 15.5px; }
  .site-header { position: static; }
  .header-inner { flex-wrap: wrap; height: auto; gap: 10px 14px; padding-block: 12px; }
  .brand { font-size: 16px; }
  .brand { gap: 10px; }
  .brand-logo { width: 47px; height: 30px; }
  .brand-text { padding-left: 10px; }
  .top-nav { margin-left: auto; }
  .top-nav a { padding: 6px 8px; font-size: 14px; }
  .search { order: 3; width: 100%; margin-left: 0; }
  .search kbd { display: none; }
  .search input { padding-right: 14px; font-size: 16px; }
  .hero { padding-block: 26px 22px; }
  .lead { font-size: 15.5px; }
  .stats { gap: 8px 22px; margin-top: 16px; }
  .stats b { font-size: 19px; }
  .cat-hero { padding-block: 22px 20px; }
  .month-head { font-size: 16.5px; position: static; padding-block: 4px; }
  .card-link { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 16px; }
  .card-date { display: none; }
  .card-meta time { display: inline; }
  .card-title { font-size: 17px; margin-top: 6px; }
  .card-sum { font-size: 14.5px; -webkit-line-clamp: 3; }
  .card-thumb { width: 84px; height: 84px; }
  .post-layout { padding-block: 0 48px; padding-inline: 0; }
  .post { border-radius: 0; border-inline: 0; padding: 22px 18px 28px; box-shadow: none; }
  .post-head h1 { font-size: 24px; line-height: 1.45; }
  .post-meta { gap: 6px 12px; font-size: 13.5px; }
  .standfirst { font-size: 16.5px; padding-left: 14px; margin-top: 18px; }
  .post-body { font-size: 17px; line-height: 1.85; margin-top: 24px; }
  .post-body h2 { font-size: 20px; }
  .post-body h3 { font-size: 17.5px; }
  .table-wrap { margin-inline: -4px; }
  .table-wrap table { font-size: 14.5px; }
  .table-wrap th, .table-wrap td { padding: 8px 10px; }
  .table-wrap th { white-space: normal; }
  .callout { padding: 12px 14px; font-size: 15.5px; }
  .link-card { padding: 10px 12px; gap: 12px; }
  .lc-icon { width: 34px; height: 34px; }
  .lc-title { font-size: 15px; }
  .gallery { grid-template-columns: 1fr 1fr; gap: 10px; }
  .about { padding-block: 0 48px; padding-inline: 0; }
  .post-nav { grid-template-columns: 1fr; }
  .pn-next { text-align: left; }
  .post-nav .is-empty { display: none; }
  .post-aside { padding-inline: 16px; }
  .to-top { right: 16px; bottom: 16px; }
  .lb-scroll { padding: 56px 8px 8px; }
}

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