/*
Theme Name: 頂微劇 Ding
Theme URI: https://example.invalid/
Author: SD Network
Description: 極簡畫廊風短劇主題：大面積留白、無邊框卡片、4:5 直幅海報置中、hover 才出現描邊，強調色只用在按鈕與一條底線。適用於頂微劇。
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.1
Text Domain: sd-ding
*/

/* ==========================================================================
   共用基礎層（結構 / 行為）— 顏色與造型一律走變數，各主題在下方覆寫
   需要的變數：--bg --surface --ink --muted --line --accent --accent-2 --accent-soft
              --on-accent --radius --wrap --gut --font --scrim
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.7 var(--font); overflow-x: clip;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body.sd-no-scroll { overflow: hidden; }
img, video, iframe, svg { max-width: 100%; }
img { height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.dg-wrap { width: 100%; max-width: var(--wrap, 1240px); margin: 0 auto; padding: 0 var(--gut, 20px); }
.sr-only, .screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: 12px; top: -80px; z-index: 999; padding: 12px 18px; background: var(--ink); color: var(--bg); }
.skip:focus { top: 12px; }

/* ---------- 搜尋表單 ---------- */
.dg-sf { display: flex; gap: 8px; align-items: stretch; }
.dg-sf input[type="search"] {
  flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--radius);
  -webkit-appearance: none; appearance: none;
}
.dg-sf input[type="search"]::placeholder { color: var(--muted); opacity: .8; }
.dg-sf button {
  flex: 0 0 auto; min-height: 44px; padding: 0 20px; border: 0; border-radius: var(--radius);
  background: var(--accent); color: var(--on-accent); font-weight: 700;
}

/* ---------- 搜尋面板 / 遮罩 / 手機抽屜（app.js 以 id 綁定） ---------- */
.dg-search {
  position: fixed; inset: 0; z-index: 200; display: grid; align-items: start; justify-items: center;
  padding: 12vh 16px 16px; background: var(--scrim, rgba(0, 0, 0, .55));
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
}
.dg-search.is-open { opacity: 1; visibility: visible; }
.dg-search__box {
  width: min(640px, 100%); max-height: 80vh; overflow: auto; padding: 20px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
}
.dg-search__hint { margin: 18px 0 8px; font-size: 13px; color: var(--muted); }
.dg-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.dg-tags a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 14px;
}
.dg-tags a:hover { border-color: var(--accent); color: var(--accent); }

.dg-overlay { position: fixed; inset: 0; z-index: 150; background: var(--scrim, rgba(0, 0, 0, .55)); opacity: 0; transition: opacity .25s; }
.dg-overlay.is-open { opacity: 1; }
.dg-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 160; width: min(320px, 86vw);
  padding: 68px 22px 28px; overflow: auto; background: var(--surface); color: var(--ink);
  border-left: 1px solid var(--line);
  transform: translateX(100%); visibility: hidden; transition: transform .25s, visibility .25s;
}
.dg-drawer.is-open { transform: none; visibility: visible; }
.dg-drawer__close {
  position: absolute; top: 10px; right: 10px; width: 48px; height: 48px;
  display: grid; place-items: center; border: 0; background: transparent; font-size: 20px;
}
.dg-drawer__list { list-style: none; margin: 0; padding: 0; }
.dg-drawer__list a { display: flex; align-items: center; min-height: 52px; border-bottom: 1px solid var(--line); font-size: 17px; }
.dg-drawer__list [aria-current="page"], .dg-drawer__list .current-menu-item > a { color: var(--accent); font-weight: 700; }

/* ---------- 麵包屑 ---------- */
.sd-crumbs { padding: 14px 0 4px; font-size: 13px; color: var(--muted); }
.sd-crumbs__list { display: flex; flex-wrap: wrap; align-items: center; list-style: none; margin: 0; padding: 0; }
.sd-crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.sd-crumbs li + li::before { content: "/"; margin: 0 8px; opacity: .5; }
.sd-crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
.sd-crumbs a:hover { color: var(--accent); }
.sd-crumbs [aria-current="page"] { color: var(--ink); max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 分頁 ---------- */
.sd-pagination { margin: 36px 0 8px; }
.sd-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sd-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 600;
}
.sd-pagination a.page-numbers:hover { border-color: var(--accent); color: var(--accent); }
.sd-pagination .current { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.sd-pagination .dots { background: none; border-color: transparent; }

/* ---------- 播放器 / 提示框 ---------- */
.sd-player { background: #000; overflow: hidden; }
.sd-player video { display: block; width: 100%; aspect-ratio: 9 / 16; max-height: 78vh; object-fit: contain; background: #000; }
.sd-embed { aspect-ratio: 9 / 16; max-height: 78vh; background: #000; }
.sd-embed iframe { display: block; width: 100%; height: 100%; border: 0; }
.sd-player__fallback { padding: 18px; color: #e5e7eb; font-size: 14px; }
.sd-player__fallback a { text-decoration: underline; }
.sd-callout { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 20px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.sd-callout__body { flex: 1 1 200px; }
.sd-callout__title { font-weight: 800; margin-bottom: 4px; }
.sd-callout__desc { color: var(--muted); font-size: 14px; }
.sd-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px;
  border: 0; border-radius: var(--radius); background: var(--accent); color: var(--on-accent); font-weight: 700;
}

/* ---------- 版面骨架（詳情 / 分集）：左播放器、右選集；≤900px 上下堆疊 ---------- */
.dg-dgrid { display: grid; grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); gap: 32px; align-items: start; }
.dg-dgrid__l, .dg-dgrid__r { min-width: 0; }
.dg-dposter img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.dg-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.dg-pill { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; font-size: 13px; border: 1px solid var(--line); border-radius: 999px; }
a.dg-pill { min-height: 44px; }
.dg-pill--accent { border-color: var(--accent); color: var(--accent); }
.dg-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.dg-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--radius); font-weight: 600;
}
.dg-btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.dg-note { padding: 14px 16px; border: 1px dashed var(--line); color: var(--muted); font-size: 14px; }
.dg-pn { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.dg-pn a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); background: var(--surface); }
.dg-pn a.is-next { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.dg-side-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 16px; color: var(--accent); font-weight: 600; }
.dg-prose { max-width: 70ch; }
.dg-prose img { height: auto; }
.dg-faq details { border-bottom: 1px solid var(--line); }
.dg-faq summary { display: flex; align-items: center; min-height: 52px; cursor: pointer; font-weight: 600; }
.dg-faq details p { color: var(--muted); }
.dg-empty, .dg-notfound { padding: 48px 0; }
.dg-notfound__search { max-width: 520px; margin: 22px 0; }
.dg-notfound__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dg-results { display: grid; gap: 0; }
.dg-result { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: flex-start; min-width: 0; }
.dg-result__img { width: 72px; flex: 0 0 72px; aspect-ratio: 2 / 3; object-fit: cover; }
.dg-result__body { display: grid; gap: 4px; min-width: 0; }
.dg-result__t { font-weight: 700; overflow-wrap: anywhere; }
.dg-result__m, .dg-result__x { font-size: 13px; color: var(--muted); }
.dg-searchbar { max-width: 640px; margin: 4px 0 24px; }

/* ---------- 篩選條：行內捲動，不撐破版面 ---------- */
.dg-filter { display: grid; gap: 4px; margin: 0 0 24px; }
.dg-filter__row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dg-filter__label { flex: 0 0 auto; font-size: 13px; color: var(--muted); }
.dg-filter__list { display: flex; flex: 1 1 auto; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.dg-filter__list::-webkit-scrollbar { display: none; }
.dg-filter__list a { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; white-space: nowrap; }

/* ---------- 選集容器（app.js 會把目前集捲到可視範圍） ---------- */
[data-eps] { position: relative; }

@media (max-width: 900px) {
  .dg-dgrid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .dg-dgrid__l .sd-player, .dg-dgrid__l .dg-dposter { max-width: 420px; margin-inline: auto; }
}
@media (max-width: 560px) {
  :root { --gut: 16px; }
  .dg-filter__row { gap: 8px; }
  .sd-crumbs [aria-current="page"] { max-width: 48vw; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   頂微劇 · 「極簡畫廊」：白底大留白 / 無邊框卡片 / 海報 4:5 置中 / hover 才有描邊
   強調色 --accent 只出現在「按鈕」與「首頁標語的一條底線」，其餘一律墨黑與灰。
   ========================================================================== */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #111111;
  --muted: #7b7b7b;
  --line: #e7e7e7;
  --accent: #c8553d;
  --accent-2: #e08e6d;
  --accent-soft: rgba(200, 85, 61, .14);
  --on-accent: #ffffff;
  --radius: 2px;
  --wrap: 1320px;
  --gut: 40px;
  --scrim: rgba(255, 255, 255, .9);
  --font: "Helvetica Neue", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Heiti TC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --space: clamp(72px, 10vw, 150px);
}

body { font-size: 15px; font-weight: 400; letter-spacing: .02em; }
h1, h2, h3 { font-weight: 300; letter-spacing: .06em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

/* ---------- 頁首 ---------- */
.dg-head { position: sticky; top: 0; z-index: 60; background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid transparent; transition: border-color .25s; }
.dg-head.is-stuck { border-bottom-color: var(--line); }
.dg-head__in { display: flex; align-items: center; justify-content: space-between; gap: 32px; min-height: 84px; }
.dg-logo { display: inline-flex; align-items: center; min-height: 44px; font: 300 22px/1 var(--font); letter-spacing: .32em; white-space: nowrap; }
.dg-logo__img { max-height: 36px; width: auto; }
.dg-nav { flex: 1 1 auto; min-width: 0; }
.dg-nav__list { display: flex; justify-content: center; gap: 8px; list-style: none; margin: 0; padding: 0; }
.dg-nav__list a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; font-size: 14px; letter-spacing: .2em; color: var(--muted); white-space: nowrap; }
.dg-nav__list a:hover { color: var(--ink); }
.dg-nav__list [aria-current="page"], .dg-nav__list .current-menu-item > a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 8px; }
.dg-tools { display: flex; gap: 4px; }
.dg-tool { min-height: 44px; padding: 0 14px; border: 0; background: transparent; font-size: 14px; letter-spacing: .2em; }
.dg-tool:hover { text-decoration: underline; text-underline-offset: 6px; }
.dg-tool--menu { display: none; }

/* ---------- 通用元件（強調色只留給按鈕） ---------- */
.dg-btn, .sd-btn { min-height: 48px; padding: 0 34px; border-radius: 0; border: 1px solid var(--ink); background: transparent; color: var(--ink); letter-spacing: .24em; font-weight: 400; }
.dg-btn:hover { background: var(--ink); color: #fff; }
.dg-btn--primary, .sd-btn { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.dg-btn--primary:hover, .sd-btn:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.dg-sf input[type="search"] { border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; background: transparent; padding: 0 2px; }
.dg-sf button { border-radius: 0; background: var(--accent); color: var(--on-accent); font-weight: 400; letter-spacing: .24em; padding: 0 28px; }
.dg-sf button:hover { background: var(--ink); }
.dg-search__box { border: 0; border-radius: 0; box-shadow: none; background: transparent; width: min(720px, 100%); }
.dg-search { background: var(--scrim); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dg-tags a { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0 4px; }
.dg-tags a:hover { border-color: var(--ink); color: var(--ink); }
.dg-drawer { border-left: 0; box-shadow: -20px 0 60px -30px rgba(0, 0, 0, .25); }
.dg-drawer__list a { border-bottom-color: var(--line); font-weight: 300; letter-spacing: .14em; }
.dg-drawer__list [aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; }
.dg-pill { min-height: 24px; padding: 0 16px 0 0; border: 0; border-radius: 0; font-size: 13px; letter-spacing: .12em; color: var(--muted); }
a.dg-pill { min-height: 44px; }
.dg-pill--accent { color: var(--ink); }
.dg-pill--link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }
.sd-crumbs a:hover { color: var(--ink); text-decoration: underline; }
.dg-btn--primary:focus-visible, .sd-btn:focus-visible { outline-color: var(--ink); }

/* ---------- 區塊標題 ---------- */
.dg-block { margin-top: var(--space); }
.dg-sec { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: clamp(36px, 5vw, 64px); text-align: center; }
.dg-sec h2 { font-size: clamp(22px, 2.4vw, 30px); letter-spacing: .4em; padding-left: .4em; }
.dg-sec__more { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; letter-spacing: .24em; color: var(--muted); border-bottom: 1px solid transparent; }
.dg-sec__more:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- 主視覺 ---------- */
.dg-hero { display: flex; flex-direction: column; align-items: center; padding: clamp(56px, 9vw, 130px) 0 0; text-align: center; }
.dg-eyebrow { margin: 0 0 28px; font-size: 12px; letter-spacing: .6em; padding-left: .6em; color: var(--muted); }
.dg-hero h1 { display: grid; gap: 22px; justify-items: center; }
.dg-h1__brand { font-size: clamp(56px, 11vw, 148px); font-weight: 200; line-height: 1; letter-spacing: .16em; padding-left: .16em; }
.dg-h1__tag { font-size: clamp(17px, 2vw, 24px); font-weight: 300; letter-spacing: .3em; padding-left: .3em; }
.dg-ul { padding-bottom: 8px; background: linear-gradient(var(--accent), var(--accent)) left bottom / 100% 2px no-repeat; }
.dg-hero__lead { max-width: 32em; margin: 34px 0 32px; color: var(--muted); font-size: 15px; line-height: 2; }
.dg-hero__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 0; }
.dg-hero__poster { display: block; width: min(420px, 78vw); margin-top: clamp(56px, 8vw, 110px); }
.dg-hero__frame { display: block; }
.dg-hero__frame img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: outline-color .3s; outline: 1px solid transparent; outline-offset: 12px; }
.dg-hero__poster:hover .dg-hero__frame img { outline-color: var(--ink); }
.dg-hero__cap { display: block; margin-top: 28px; font-size: 20px; font-weight: 300; letter-spacing: .2em; padding-left: .2em; overflow-wrap: anywhere; }
.dg-hero__meta { display: block; margin-top: 6px; font-size: 12.5px; letter-spacing: .14em; color: var(--muted); }

/* ---------- 畫廊卡片 ---------- */
.dg-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 72px 44px; }
.dg-card { display: block; min-width: 0; text-align: center; }
.dg-card__media { display: block; }
.dg-card__media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; outline: 1px solid transparent; outline-offset: 10px; transition: outline-color .3s ease; }
.dg-card:hover .dg-card__media img, .dg-card:focus-visible .dg-card__media img { outline-color: var(--ink); }
.dg-card__t { display: block; margin-top: 26px; font-size: 16px; font-weight: 400; letter-spacing: .12em; line-height: 1.5; overflow-wrap: anywhere; }
.dg-card__m { display: block; margin-top: 6px; font-size: 12.5px; letter-spacing: .12em; color: var(--muted); }
.dg-grid--feature { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px 64px; }

/* ---------- 分類入口 / 熱榜 ---------- */
.dg-cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 36px; list-style: none; margin: 0; padding: 0; }
.dg-cats a { display: inline-flex; align-items: flex-start; min-height: 56px; padding: 8px 0; font-size: clamp(22px, 2.6vw, 34px); font-weight: 200; letter-spacing: .18em; border-bottom: 1px solid transparent; }
.dg-cats a:hover { border-bottom-color: var(--ink); }
.dg-cats sup { margin-left: 6px; font-size: 11px; letter-spacing: 0; color: var(--muted); }
.dg-top { list-style: none; margin: 0 auto; padding: 0; max-width: 760px; }
.dg-top a { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: baseline; gap: 16px; min-height: 64px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.dg-top__no { font-size: 13px; letter-spacing: .2em; color: var(--muted); }
.dg-top__t { font-size: 17px; font-weight: 300; letter-spacing: .1em; overflow-wrap: anywhere; }
.dg-top__m { font-size: 12.5px; color: var(--muted); letter-spacing: .1em; white-space: nowrap; }
.dg-top a:hover .dg-top__t { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }

/* ---------- 內頁抬頭 / 篩選條 ---------- */
.dg-pagehead { padding: clamp(48px, 7vw, 100px) 0 clamp(28px, 4vw, 52px); text-align: center; }
.dg-pagehead h1 { font-size: clamp(30px, 4.4vw, 58px); font-weight: 200; letter-spacing: .3em; padding-left: .3em; }
.dg-pagehead p { margin: 18px 0 0; color: var(--muted); letter-spacing: .12em; }
.dg-filter { max-width: 900px; margin: 0 auto clamp(40px, 6vw, 80px); }
.dg-filter__row { justify-content: center; }
.dg-filter__label { font-size: 12px; letter-spacing: .3em; }
.dg-filter__list { justify-content: flex-start; gap: 2px; }
.dg-filter__list a { font-size: 14px; letter-spacing: .12em; color: var(--muted); }
.dg-filter__list a:hover { color: var(--ink); }
.dg-filter__list [aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 8px; text-decoration-thickness: 1px; }

/* ---------- 詳情 / 分集 ---------- */
.dg-dhead { padding: clamp(32px, 5vw, 72px) 0 clamp(32px, 5vw, 56px); text-align: center; }
.dg-dhead h1 { font-size: clamp(28px, 4.2vw, 54px); font-weight: 200; letter-spacing: .2em; padding-left: .2em; line-height: 1.3; overflow-wrap: anywhere; }
.dg-dhead .dg-meta { justify-content: center; gap: 4px 6px; }
.dg-dgrid { gap: clamp(32px, 6vw, 88px); }
.dg-player { background: #000; }
.dg-dposter img { aspect-ratio: 4 / 5; }
.dg-syn { font-size: 16px; font-weight: 300; line-height: 2.1; letter-spacing: .06em; }
.dg-actions .dg-btn { padding: 0 26px; }
.dg-h2 { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); font-size: 18px; font-weight: 300; letter-spacing: .3em; }
.dg-h2 small { font-size: 12px; letter-spacing: .14em; color: var(--muted); }
.dg-eps-sec { margin-top: 36px; }
.dg-eps { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; max-height: 420px; overflow-y: auto; padding: 2px; }
.dg-ep { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; border: 1px solid var(--line); font-size: 14px; font-variant-numeric: tabular-nums; transition: border-color .2s, background .2s; }
a.dg-ep:hover { border-color: var(--ink); }
.dg-ep.is-current { background: var(--ink); border-color: var(--ink); color: #fff; }
.dg-ep.is-off { color: #bbb; }
.dg-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 40px; margin: 0 auto; max-width: 960px; }
.dg-fact { padding: 18px 0; border-bottom: 1px solid var(--line); text-align: center; }
.dg-fact--wide { grid-column: 1 / -1; }
.dg-fact dt { font-size: 11.5px; letter-spacing: .3em; color: var(--muted); }
.dg-fact dd { margin: 6px 0 0; font-size: 17px; font-weight: 300; letter-spacing: .08em; overflow-wrap: anywhere; }
.dg-prose { margin-inline: auto; font-weight: 300; line-height: 2.1; }
.dg-faq { max-width: 760px; margin-inline: auto; }
.dg-faq summary { font-weight: 300; letter-spacing: .08em; }
.dg-pn a { border: 0; border-bottom: 1px solid var(--line); background: transparent; letter-spacing: .14em; }
.dg-pn a.is-next { background: var(--accent); border: 0; color: var(--on-accent); }
.dg-side-link { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; font-weight: 300; }
.dg-note { border-radius: 0; }
.dg-block > .dg-grid, .dg-block > .dg-faq, .dg-block > .dg-facts { margin-top: 0; }

/* ---------- 搜尋 / 404 ---------- */
.dg-searchbar { margin-inline: auto; }
.dg-results { max-width: 820px; margin: 0 auto; }
.dg-result { padding: 22px 0; }
.dg-result__t { font-weight: 300; font-size: 19px; letter-spacing: .1em; }
.dg-result:hover .dg-result__t { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.dg-empty, .dg-notfound { text-align: center; }
.dg-empty__title { font-size: 24px; font-weight: 200; letter-spacing: .2em; }
.dg-notfound { padding: clamp(56px, 9vw, 130px) 0; }
.dg-notfound__code { margin: 0; font: 200 clamp(110px, 22vw, 260px)/1 var(--font); letter-spacing: .06em; }
.dg-notfound h1 { font-size: clamp(24px, 3vw, 36px); letter-spacing: .24em; padding-left: .24em; }
.dg-notfound__desc { margin: 14px auto 0; max-width: 32em; color: var(--muted); }
.dg-notfound__search { margin: 28px auto; }
.dg-notfound__actions { justify-content: center; }
.dg-article { max-width: 760px; margin-inline: auto; }

/* ---------- 分頁 ---------- */
.sd-pagination { margin-top: clamp(56px, 8vw, 110px); }
.sd-pagination .page-numbers { border: 0; border-radius: 0; background: transparent; color: var(--muted); font-weight: 300; letter-spacing: .1em; }
.sd-pagination a.page-numbers:hover { color: var(--ink); border: 0; text-decoration: underline; text-underline-offset: 6px; }
.sd-pagination .current { background: transparent; color: var(--ink); border: 0; text-decoration: underline; text-underline-offset: 8px; text-decoration-thickness: 1px; }

/* ---------- 頁尾 ---------- */
.dg-foot { margin-top: var(--space); padding: 72px 0 48px; border-top: 1px solid var(--line); text-align: center; }
.dg-foot__name { margin: 0 0 12px; font: 200 28px/1 var(--font); letter-spacing: .4em; padding-left: .4em; }
.dg-foot__desc { max-width: 32em; margin: 0 auto 32px; color: var(--muted); }
.dg-foot__nav h2 { margin-bottom: 4px; font-size: 11.5px; letter-spacing: .4em; padding-left: .4em; color: var(--muted); font-weight: 400; }
.dg-foot__nav { margin-bottom: 18px; }
.dg-foot ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 22px; list-style: none; margin: 0; padding: 0; }
.dg-foot li a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; font-size: 14px; letter-spacing: .12em; }
.dg-foot li a:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.dg-foot__note { max-width: 40em; margin: 28px auto 6px; font-size: 12.5px; color: var(--muted); }
.dg-foot__copy { margin: 0; font-size: 12px; letter-spacing: .14em; color: var(--muted); }

/* ---------- 響應式 ---------- */
@media (max-width: 1100px) {
  .dg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px 32px; }
}
@media (max-width: 960px) {
  :root { --gut: 28px; }
  .dg-nav { display: none; }
  .dg-tool--menu { display: inline-flex; }
  .dg-head__in { min-height: 68px; }
  .dg-logo { font-size: 19px; letter-spacing: .26em; }
  .dg-grid--feature { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 24px; }
}
@media (max-width: 640px) {
  :root { --gut: 18px; }
  .dg-grid, .dg-grid--feature { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 16px; }
  .dg-card__t { margin-top: 16px; font-size: 14px; letter-spacing: .06em; }
  .dg-card__media img, .dg-hero__frame img { outline-offset: 6px; }
  .dg-cats { gap: 0 22px; }
  .dg-top a { grid-template-columns: 40px minmax(0, 1fr); }
  .dg-top__m { grid-column: 2; }
  .dg-hero__cta .dg-btn { padding: 0 22px; }
  .dg-foot ul { gap: 0 14px; }
}
