/* ══ 李醫師的鳩是魔法 · DrLeeDoveMagic ══════════════════════════
   配色概念：白袍的紙白 × 白斑鳩的羽色（鳩羽色，帶灰的紫）
   ════════════════════════════════════════════════════════════ */

:root {
  --paper:    #faf8f5;   /* 紙白：底色 */
  --surface:  #ffffff;   /* 卡片 */
  --ink:      #262320;   /* 主文字 */
  --ink-soft: #6b645c;   /* 次要文字 */
  --line:     #e7e1d8;   /* 分隔線 */
  --accent:   #7a6c85;   /* 鳩羽色 */
  --accent-soft: #f0ecf2;
  --on-accent: #ffffff;
  --shadow:   0 1px 2px rgba(38,35,32,.04), 0 8px 24px -12px rgba(38,35,32,.12);
  --radius:   14px;
  --wrap:     1080px;
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Hiragino Sans",
          -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-serif: "Noto Serif TC", "Songti TC", "PMingLiU", Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #17161a;  --surface: #1f1d23;  --ink: #ece8e4;
    --ink-soft: #a29b95; --line: #302d36;   --accent: #b6a6c4;
    --accent-soft: #292531;
    --on-accent: #17161a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6);
  }
}

:root[data-theme="dark"] {
  --paper: #17161a;  --surface: #1f1d23;  --ink: #ece8e4;
  --ink-soft: #a29b95; --line: #302d36;   --accent: #b6a6c4;
  --accent-soft: #292531;
  --on-accent: #17161a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6);
}

/* ── 基礎 ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.85;
  letter-spacing: .015em; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; border-radius: 10px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.35; letter-spacing: .01em; margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 1.1em; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em;
  background: var(--accent-soft); padding: .15em .45em; border-radius: 5px;
}
.muted { color: var(--ink-soft); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 720px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 10px 16px; z-index: 99; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ── 頁首 ─────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(1px)) {
  .site-header {
    background: color-mix(in srgb, var(--paper) 86%, transparent);
    backdrop-filter: saturate(160%) blur(12px);
  }
}
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 68px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 11px; margin-right: auto; }
/* 站徽：白斑鳩與聽診器。用圓角方塊，和分類圖示的形狀語言一致 */
.brand-mark {
  width: 38px; height: 38px; flex: none; display: block;
  border-radius: 11px; overflow: hidden; line-height: 0;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.brand-mark.small { width: 32px; height: 32px; border-radius: 9px; }
.brand-text { display: flex; flex-direction: column; }
.brand-zh { font-weight: 700; font-size: 16.5px; letter-spacing: .03em; }
.brand-en { font-size: 10.5px; letter-spacing: .16em; color: var(--ink-soft); text-transform: uppercase; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  padding: 7px 12px; border-radius: 999px; font-size: 14.5px; color: var(--ink-soft);
  transition: background .18s, color .18s;
}
.site-nav a:hover { background: var(--accent-soft); color: var(--ink); }
.site-nav a.current { background: var(--accent); color: var(--on-accent); }
.nav-button { display: none; }

/* ── 首屏：舞台 ───────────────────────────────────────────── */
/* 照片本身是黑底，所以區塊底色也用近黑，讓照片直接融進版面、看不出邊界 */
.hero {
  --stage: #0b0a0d;
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--stage); color: #f5f2ef;
}
.hero-media { position: absolute; inset: 0 0 0 auto; width: 64%; z-index: 0; }
.hero-media img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: 46% 38%; border-radius: 0;
}
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to right,  var(--stage) 4%, rgba(11,10,13,.55) 34%, rgba(11,10,13,0) 70%),
    linear-gradient(to bottom, var(--stage), rgba(11,10,13,0) 22%),
    linear-gradient(to top,    var(--stage), rgba(11,10,13,0) 20%);
}
.hero-inner { padding: 116px 20px 104px; position: relative; z-index: 1; max-width: 640px; margin: 0; }
.hero-mark {
  position: absolute; left: -1.5vw; bottom: -12vh; z-index: 0; font-family: var(--font-serif);
  font-size: min(34vw, 340px); line-height: .8; color: #ffffff;
  opacity: .05; pointer-events: none; user-select: none;
}
.kicker {
  font-size: 11.5px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(2.1rem, 6.2vw, 3.5rem); letter-spacing: .02em; margin-bottom: .55em;
  color: #ffffff; text-shadow: 0 2px 30px rgba(0,0,0,.65);
}
.hero h1 em { font-style: normal; color: #c9b8d8; font-family: var(--font-serif); }
.lede { font-size: 1.06rem; color: var(--ink-soft); line-height: 2; margin-bottom: 1.6em; }
.hero .kicker { color: #c3b2d2; }
.hero .lede { color: rgba(245,242,239,.78); text-shadow: 0 1px 20px rgba(0,0,0,.65); }
.hero .btn { background: #ffffff; color: #17161a; border-color: #ffffff; }
.hero .btn.ghost { background: transparent; color: #ffffff; border-color: rgba(255,255,255,.45); }
.hero .btn.ghost:hover { background: rgba(255,255,255,.14); border-color: #ffffff; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 12px 24px; border-radius: 999px; font-size: 15px;
  font-weight: 600; background: var(--accent); color: var(--on-accent);
  border: 1.5px solid var(--accent);
  transition: transform .18s, box-shadow .18s, background .18s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }

/* ── 區塊標題 ─────────────────────────────────────────────── */
.section { padding: 68px 20px 8px; }
.section-head {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 28px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.section-head h2 { font-size: 1.42rem; margin: 0; }
.section-head h2::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); vertical-align: .32em; margin-right: 10px;
}
.section-head .muted { font-size: 14.5px; margin: 0; }
.link-more { margin-left: auto; font-size: 14.5px; color: var(--accent); font-weight: 600; }
.link-more:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ── 卡片網格 ─────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(276px, 1fr)); gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .2s, box-shadow .2s, border-color .2s; display: block;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent); }
.card-link, .cat-card { display: block; padding: 22px; height: 100%; }
.card-meta {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
  font-size: 12.5px; color: var(--ink-soft);
}
.tag {
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
  padding: 3px 10px; border-radius: 999px; font-size: 12px;
}
.tag.small { font-size: 11px; padding: 2px 8px; }
.card h3 { font-size: 1.08rem; margin-bottom: .45em; }
.excerpt { font-size: 14.5px; color: var(--ink-soft); line-height: 1.8; margin-bottom: 1em; }
.more { font-size: 13.5px; color: var(--accent); font-weight: 600; }
.count { font-size: 12.5px; }
.empty { padding: 40px 0; color: var(--ink-soft); text-align: center; }

.cat-grid .cat-card { display: flex; flex-direction: column; }
.cat-icon {
  display: inline-grid; place-items: center; width: 42px; height: 42px; margin-bottom: 14px;
  border-radius: 11px; background: var(--accent-soft); color: var(--accent);
}
.icon { width: 21px; height: 21px; }
.cat-card .count { margin-top: auto; }

/* ── 關於帶 ───────────────────────────────────────────────── */
.about-band {
  margin-top: 72px; border-top: 1px solid var(--line);
  background: linear-gradient(10deg, var(--accent-soft), var(--paper) 70%);
}
.about-inner {
  padding: 66px 20px; display: grid; gap: 40px;
  grid-template-columns: 1.4fr 1fr; align-items: start;
}
.about-inner h2 { font-size: 1.6rem; }
.about-inner p { color: var(--ink-soft); }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.facts li {
  display: flex; flex-direction: column; padding: 14px 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 11px;
}
.facts strong { font-size: 15px; }
.facts .muted { font-size: 13px; }

/* ── 內文 ─────────────────────────────────────────────────── */
.page, .post { padding: 56px 20px 20px; }
.page-head { margin-bottom: 34px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(1.7rem, 4.6vw, 2.3rem); }
.category-head { text-align: center; border-bottom: none; padding-top: 44px; }
.category-head .cat-icon { width: 52px; height: 52px; margin-inline: auto; }
.category-head .cat-icon .icon { width: 25px; height: 25px; }
.category-head .lede { max-width: 520px; margin-inline: auto; margin-bottom: .6em; }

.prose { font-size: 17px; }
.prose h2 { font-size: 1.3rem; margin-top: 2.2em; padding-top: .2em; }
.prose h3 { font-size: 1.08rem; margin-top: 1.8em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin-bottom: .5em; }
.prose a {
  color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.prose blockquote {
  margin: 1.6em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent);
  color: var(--ink-soft);
}
.prose img { margin: 1.8em 0; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 1.6em 0; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { color: var(--ink-soft); font-size: 13.5px; font-weight: 600; }

.post-foot { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.byline { font-size: 14px; }
.post-nav { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; margin-top: 10px; }
.post-nav a {
  padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 15px; font-weight: 600; background: var(--surface); transition: border-color .2s;
}
.post-nav a:hover { border-color: var(--accent); }
.post-nav .muted { font-size: 12px; font-weight: 400; }
.post-nav .next { text-align: right; grid-column: 2; }

.cat-switch { margin: 66px 0 10px; padding-top: 26px; border-top: 1px solid var(--line); text-align: center; }
.cat-switch h2 { font-size: .95rem; color: var(--ink-soft); font-weight: 600; letter-spacing: .1em; }
.chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.chip {
  padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px;
  background: var(--surface); transition: border-color .2s, color .2s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

.year { font-size: 1.2rem; margin: 2em 0 .6em; color: var(--accent); }
.archive-list { list-style: none; padding: 0; margin: 0; }
.archive-list li {
  display: flex; align-items: baseline; gap: 14px; padding: 12px 0;
  border-bottom: 1px solid var(--line); font-size: 15.5px;
}
.archive-list time { color: var(--ink-soft); font-size: 13.5px; font-variant-numeric: tabular-nums; flex: none; }
.archive-list a { flex: 1; }
.archive-list a:hover { color: var(--accent); }

/* ── 頁尾 ─────────────────────────────────────────────────── */
.site-footer { margin-top: 80px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { display: grid; gap: 34px; grid-template-columns: 2fr 1fr 1fr; padding: 50px 20px 34px; }
.footer-brand { display: flex; gap: 14px; align-items: flex-start; }
.footer-brand p { margin: 0; font-size: 14.5px; line-height: 1.9; }
.footer-nav { display: flex; flex-direction: column; gap: 9px; }
.footer-nav h3 { font-size: 12px; letter-spacing: .14em; color: var(--ink-soft); margin: 0 0 4px; }
.footer-nav a { font-size: 14.5px; color: var(--ink-soft); }
.footer-nav a:hover { color: var(--accent); }
.footer-base { padding: 18px 20px 30px; border-top: 1px solid var(--line); }
.footer-base p { margin: 0; font-size: 12.5px; }

/* ── 手機 ─────────────────────────────────────────────────── */
@media (max-width: 760px) {
  body { font-size: 16.5px; }
  .wrap { padding: 0 16px; }
  .header-inner { min-height: 60px; gap: 12px; }
  .nav-button { display: grid; gap: 5px; cursor: pointer; padding: 8px 4px; }
  .nav-button span { display: block; width: 22px; height: 1.6px; background: var(--ink); border-radius: 2px; }
  .site-nav { display: none; width: 100%; flex-direction: column; gap: 2px; padding-bottom: 12px; }
  .nav-toggle:checked ~ .site-nav { display: flex; }
  .site-nav a { padding: 11px 14px; border-radius: 9px; font-size: 15.5px; }
  /* 手機：照片放上方整寬，底部漸層過渡到文字區 */
  .hero { display: flex; flex-direction: column; }
  .hero-media { position: relative; width: 100%; height: min(52vh, 340px); }
  .hero-media img { object-position: 50% 32%; }
  .hero-media::after {
    background: linear-gradient(to bottom,
      rgba(11,10,13,.5) 0%, rgba(11,10,13,0) 28%, rgba(11,10,13,.25) 64%, var(--stage) 100%);
  }
  .hero-inner { padding: 6px 16px 50px; max-width: none; }
  .hero-mark { font-size: 56vw; left: -8vw; bottom: -5vh; }
  .section { padding: 48px 16px 4px; }
  .about-inner, .footer-inner { grid-template-columns: 1fr; padding: 46px 16px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; grid-column: 1; }
  .page, .post { padding: 40px 16px 10px; }
}

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