/* 華佗AI專欄 · 地中海藍白樣式（column-aegean）
   色票取自康寧街景首頁 :root，與〈三聖堂形象片〉夏季版同一套。
   海軍藍＋白是主調；暖色只留給燈、太陽、螢火這種小點綴。只做淺色主題。 */

:root {
  --aegean-deep: #003d82;
  --aegean: #1e5aa8;
  --aegean-mid: #4a7cb8;
  --aegean-soft: #6f9bd0;
  --sky-pale: #E8F4FF;
  --sky-mist: #C8DCEE;
  --sea-foam: #DDEBF8;

  --stucco: #FFFFFF;
  --stucco-warm: #FAF8F3;
  --sand: #F4EEE0;
  --sand-pale: #FAF6EE;
  --sand-warm: #F0E8D8;

  --olive: #5B7744;
  --warm-glow: #FFC97A;
  --gold: #C4880A;
  --gold-bright: #E8B84C;

  --text-dark: #2D2A26;
  --text-body: #4A4642;
  --text-muted: #8B8580;
  --text-on-blue: rgba(255, 255, 255, 0.96);

  --rule-blue: rgba(0, 61, 130, 0.16);
  --rule-sand: rgba(196, 136, 10, 0.20);

  --night: #0b1a33;
  --night-2: #1d3a66;

  --f-display: 'Cormorant Garamond', 'Noto Serif TC', Georgia, serif;
  --f-serif: 'Noto Serif TC', 'Source Han Serif TC', serif;
  --f-body: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;

  --measure: 720px;
}

/* ========== 基底 ========== */
html { font-size: 18px; -webkit-text-size-adjust: 100%; }

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--stucco-warm);
  color: var(--text-dark);
  font-family: var(--f-serif);
  font-size: 1.18rem;
  line-height: 2.0;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: lining-nums;
  overflow-x: hidden;
}

body.is-fullscreen { background: var(--stucco-warm); }

.ph { display: inline-block; }

.container {
  max-width: calc(var(--measure) + 3rem);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* ========== 導覽列 ========== */
.essay-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--rule-blue);
  padding: 0.45rem 1.2rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  transition: transform 0.32s cubic-bezier(.4, 0, .2, 1), opacity 0.32s ease;
}
.essay-nav.is-hidden { transform: translateY(-100%); opacity: 0; pointer-events: none; }
.essay-nav .nav-left, .essay-nav .nav-right { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.essay-nav .nav-title {
  font-family: var(--f-display);
  font-size: 0.74rem; letter-spacing: 0.18em;
  color: var(--aegean-deep); font-weight: 500; padding-left: 0.3rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.essay-nav .nav-btn {
  display: inline-flex; align-items: center; gap: 0.32rem;
  padding: 0.32rem 0.6rem; border: none; border-radius: 999px; background: transparent;
  font-family: var(--f-serif); font-size: 0.78rem; line-height: 1.4;
  color: var(--aegean-deep); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease; outline: none;
}
.essay-nav .nav-btn:hover { background: var(--sky-pale); color: var(--aegean); }
.essay-nav .nav-btn:focus-visible { background: var(--sky-pale); outline: 1px solid var(--aegean-soft); outline-offset: 2px; }
.essay-nav .nav-btn svg { width: 13px; height: 13px; fill: currentColor; opacity: 0.8; flex: none; }
.essay-nav .nav-btn:hover svg { opacity: 1; }

/* ========== 頁首主圖 ========== */
.hero {
  position: relative;
  margin: 0;
  width: 100%;
  height: max(56vh, 40vw);
  max-height: 78vh;
  min-height: 300px;
  overflow: hidden;
  background: var(--sky-mist);
}
.hero img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}
.hero::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 26%;
  background: linear-gradient(180deg,
    rgba(250, 248, 243, 0) 0%,
    rgba(250, 248, 243, 0.55) 55%,
    var(--stucco-warm) 100%);
  pointer-events: none;
}
.hero-tag {
  position: absolute; top: 1rem; left: 1.2rem; z-index: 1;
  display: inline-block;
  padding: 0.3rem 0.95rem 0.32rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 12px rgba(11, 26, 51, 0.12);
  font-family: var(--f-display);
  font-size: 0.8rem; font-weight: 500; line-height: 1.5;
  letter-spacing: 0.14em;
  color: var(--aegean-deep);
}

/* ========== 標題區（主圖下方白底） ========== */
.essay-header {
  container-type: inline-size;
  text-align: center;
  padding: 1.6rem 0 2.4rem;
  margin: 0 auto 2.6rem;
  max-width: var(--measure);
  border-bottom: 1px solid var(--rule-blue);
}
.essay-number {
  font-family: var(--f-display);
  font-size: 0.82rem; letter-spacing: 0.24em;
  color: var(--aegean-mid);
  margin-bottom: 1rem;
}
h1 {
  font-family: var(--f-serif);
  font-weight: 700;
  color: var(--aegean-deep);
  line-height: 1.3;
  margin: 0;
  letter-spacing: 0.02em;
}
/* 主標維持一行——字級隨標題區寬度縮放，放得下時維持原大小 */
h1 .main { display: block; white-space: nowrap; font-size: min(2.6rem, 7.9cqi); }
h1 .sub {
  display: block;
  margin-top: 0.9rem;
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.3rem;
  line-height: 1.6;
  letter-spacing: 0.04em;
  color: var(--aegean-mid);
  text-wrap: balance;
}
.meta {
  display: inline-block;
  margin-top: 1.6rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule-blue);
  font-family: var(--f-display);
  font-size: 0.86rem; line-height: 1.6;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.meta .dot { margin: 0 0.7em; color: var(--aegean-soft); }

/* ========== 正文 ========== */
.container > p,
.container > ol,
.container > ul,
.container > h2,
.container > .origin,
.container > .tablewrap,
.container > .reel-wrap,
.container > .fieldtest,
.container > .callout,
.container > .vid,
.container > .pull-quote,
.container > .essay-footer {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}

p { margin: 0 0 1.7rem; text-wrap: pretty; }
p.lead {
  font-size: 1.3rem;
  line-height: 1.95;
  color: var(--aegean-deep);
  margin-top: 2.2rem;
  margin-bottom: 2rem;
}
strong { font-weight: 700; color: var(--aegean-deep); }
em, .emph { font-style: italic; color: var(--aegean); }
.small { font-size: 0.95rem; color: var(--text-body); line-height: 1.8; }
.label-tag {
  font-family: var(--f-display);
  font-size: 0.82rem; letter-spacing: 0.18em;
  color: var(--aegean-mid); margin: 0 0 0.6rem;
}

.container a {
  color: var(--aegean);
  text-decoration: none;
  border-bottom: 1px solid rgba(30, 90, 168, 0.3);
  overflow-wrap: anywhere; word-break: break-word;
}
.container a:hover { color: var(--aegean-deep); border-bottom-color: var(--aegean); }

/* ========== 古籍引文 ========== */
.origin {
  margin-top: 0;
  margin-bottom: 0.5rem;
  padding: 1.3rem 1.7rem 1.2rem;
  background: var(--sea-foam);
  border-left: 3px solid var(--aegean);
  border-radius: 10px;
  font-family: var(--f-serif);
  font-size: 1.2rem; line-height: 1.95;
  color: var(--aegean-deep);
  text-wrap: pretty;
}
.origin .src {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.82rem; line-height: 1.6;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* ========== 小標 ========== */
h2 {
  font-family: var(--f-serif);
  font-weight: 600;
  font-size: 1.55rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--aegean-deep);
  margin-top: 4rem;
  margin-bottom: 1.3rem;
  text-wrap: pretty;
}
/* 藍白小飾：一段細藍線＋一顆小圓點（像海平線上的太陽） */
h2::before {
  content: "";
  display: block;
  width: 40px; height: 8px;
  margin-bottom: 0.9rem;
  background:
    radial-gradient(circle at 36px 4px, var(--aegean) 0 3px, transparent 3.6px),
    linear-gradient(var(--aegean), var(--aegean)) 0 3.5px / 28px 1.5px no-repeat;
}

/* ========== 清單 ========== */
ol.step-list {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin-top: 1.8rem;
  margin-bottom: 2.2rem;
}
ol.step-list > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6rem;
  margin-bottom: 1.2rem;
  line-height: 1.95;
}
ol.step-list > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0.28em;
  width: 1.6rem; height: 1.6rem;
  border-radius: 50%;
  background: var(--aegean);
  color: #fff;
  font-family: var(--f-serif);
  font-variant-numeric: lining-nums;
  font-size: 0.8rem; font-weight: 600;
  line-height: 1.6rem;
  text-align: center;
  box-shadow: 0 0 0 3px var(--sky-pale);
}

ul.care-list { list-style: none; padding-left: 0; margin: 1.8rem 0 2.2rem; }
ul.care-list > li { position: relative; padding-left: 1.7rem; margin-bottom: 1rem; line-height: 1.9; }
ul.care-list > li::before {
  content: ""; position: absolute; left: 0.2rem; top: 0.8em;
  width: 0.45rem; height: 0.45rem; border-radius: 50%;
  background: var(--aegean);
}

/* ========== 提示框（共用，預留給之後的篇章） ========== */
.callout {
  margin-top: 2.6rem; margin-bottom: 2.6rem;
  padding: 1.5rem 1.7rem 1.1rem;
  border-radius: 12px;
  background: var(--stucco);
  border: 1px solid var(--rule-blue);
  border-left: 3px solid var(--aegean);
}
.callout .callout-title {
  font-weight: 600; font-size: 1.15rem; color: var(--aegean-deep);
  margin-bottom: 0.8rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.55rem;
  text-wrap: pretty;
}
.callout .callout-title .tag {
  font-size: 0.78rem; font-weight: 500; letter-spacing: 0.08em;
  padding: 0.1rem 0.65rem; border-radius: 999px; white-space: nowrap;
  color: var(--aegean-deep); background: var(--sky-pale);
}
.callout p:last-child { margin-bottom: 0.4rem; }
.callout.is-note { border-left-color: var(--aegean-soft); }
.callout.is-warn { border-left-color: var(--gold); }
.callout.is-warn .callout-title .tag { background: var(--sand-pale); color: var(--text-dark); }
.callout.is-doctor { border-left-color: var(--aegean-deep); background: var(--sky-pale); }

/* ========== 表格 ========== */
.tablewrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--stucco);
  border: 1px solid var(--rule-blue);
  border-radius: 12px;
  margin-top: 1.6rem;
  margin-bottom: 2.4rem;
}
table { width: 100%; border-collapse: collapse; font-size: 0.98rem; }
th, td {
  padding: 0.75rem 1rem;
  text-align: left; vertical-align: top;
  line-height: 1.75;
  border-bottom: 1px solid var(--rule-blue);
  overflow-wrap: anywhere; word-break: break-word;
}
thead th {
  background: var(--sky-pale);
  color: var(--aegean-deep);
  font-weight: 600; font-size: 0.92rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
td.tm { white-space: nowrap; }

/* ========== 影片框 ========== */
.reel-wrap,
.fieldtest {
  margin-top: 2.2rem;
  margin-bottom: 2.2rem;
  padding: 0.75rem;
  background: var(--stucco);
  border: 1px solid var(--rule-blue);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 61, 130, 0.08), 0 2px 6px rgba(0, 61, 130, 0.05);
}
.reel-frame {
  display: block; border-radius: 10px; overflow: hidden;
  background: var(--night); line-height: 0;
}
.reel-frame video,
.fieldtest video {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9;
  background: var(--night);
}
.fieldtest video { border-radius: 10px; }
.reel-cap {
  font-size: 0.92rem; color: var(--text-muted);
  margin: 0.8rem 0.3rem 0.1rem; line-height: 1.7;
}
.fieldtest-labels {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0.1rem 0 0.65rem;
}
.fieldtest-labels span {
  justify-self: center;
  display: inline-block;
  padding: 0.18rem 1rem;
  border-radius: 999px;
  background: var(--sky-pale);
  border: 1px solid var(--rule-blue);
  color: var(--aegean-deep);
  font-size: 0.88rem; font-weight: 600; line-height: 1.6;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.fieldtest figcaption {
  font-size: 0.88rem; line-height: 1.7;
  color: var(--text-muted);
  margin: 0.7rem 0.3rem 0.1rem;
}

.vid { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.2rem auto 0; }
.vid a {
  display: flex; flex-direction: column; gap: 0.2rem; flex: 1 1 18rem;
  font-size: 1rem; line-height: 1.5; padding: 0.75rem 1rem;
  border: 1px solid var(--rule-blue); border-radius: 10px;
  background: var(--stucco); color: var(--text-dark); text-decoration: none;
}
.vid a:hover { border-color: var(--aegean-soft); color: var(--aegean-deep); }
.vid .t { font-family: var(--f-display); font-size: 0.86rem; color: var(--text-muted); font-style: italic; }

/* ========== 結尾引言：片尾夜色 ========== */
.pull-quote {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  margin-top: 4.2rem;
  margin-bottom: 4.2rem;
  padding: 3.6rem 2.2rem;
  border-radius: 18px;
  background: radial-gradient(ellipse at 50% 45%, var(--night-2) 0%, var(--night) 75%);
  color: var(--text-on-blue);
  font-family: var(--f-serif);
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.85;
  letter-spacing: 0.04em;
  text-align: center;
  box-shadow: 0 18px 40px rgba(11, 26, 51, 0.18);
}
/* 螢火：兩層各六顆小光點，靜態；動畫只在使用者沒有要求減少動態時才有 */
.pull-quote::before,
.pull-quote::after {
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  pointer-events: none;
  background-repeat: no-repeat;
}
.pull-quote::before {
  background-image:
    radial-gradient(circle, rgba(255, 201, 122, 0.95) 0 1.6px, rgba(255, 201, 122, 0.28) 2.6px, transparent 6px),
    radial-gradient(circle, rgba(255, 201, 122, 0.85) 0 1.2px, rgba(255, 201, 122, 0.22) 2.2px, transparent 5px),
    radial-gradient(circle, rgba(255, 201, 122, 0.9) 0 1.8px, rgba(255, 201, 122, 0.3) 3px, transparent 7px),
    radial-gradient(circle, rgba(255, 201, 122, 0.75) 0 1.1px, rgba(255, 201, 122, 0.2) 2px, transparent 5px),
    radial-gradient(circle, rgba(255, 201, 122, 0.9) 0 1.5px, rgba(255, 201, 122, 0.26) 2.6px, transparent 6px),
    radial-gradient(circle, rgba(255, 201, 122, 0.8) 0 1.3px, rgba(255, 201, 122, 0.22) 2.2px, transparent 5px);
  background-size: 14px 14px;
  background-position: 8% 18%, 21% 78%, 88% 14%, 94% 62%, 72% 88%, 4% 52%;
}
.pull-quote::after {
  background-image:
    radial-gradient(circle, rgba(255, 201, 122, 0.8) 0 1.2px, rgba(255, 201, 122, 0.22) 2.2px, transparent 5px),
    radial-gradient(circle, rgba(255, 201, 122, 0.9) 0 1.6px, rgba(255, 201, 122, 0.28) 2.8px, transparent 6px),
    radial-gradient(circle, rgba(255, 201, 122, 0.7) 0 1px, rgba(255, 201, 122, 0.18) 2px, transparent 4px),
    radial-gradient(circle, rgba(255, 201, 122, 0.85) 0 1.4px, rgba(255, 201, 122, 0.24) 2.4px, transparent 6px),
    radial-gradient(circle, rgba(255, 201, 122, 0.75) 0 1.1px, rgba(255, 201, 122, 0.2) 2px, transparent 5px),
    radial-gradient(circle, rgba(255, 201, 122, 0.9) 0 1.5px, rgba(255, 201, 122, 0.26) 2.6px, transparent 6px);
  background-size: 14px 14px;
  background-position: 34% 9%, 58% 92%, 79% 33%, 14% 91%, 46% 4%, 97% 90%;
}
@media (prefers-reduced-motion: no-preference) {
  .pull-quote::before { animation: aegean-glow 5.5s ease-in-out infinite alternate; }
  .pull-quote::after { animation: aegean-glow 7s ease-in-out -3s infinite alternate; }
}
@keyframes aegean-glow {
  from { opacity: 1; }
  to { opacity: 0.45; }
}
.pull-quote .pq-row { display: flex; align-items: center; justify-content: center; gap: 1.6rem; }
.pull-quote .pq-phone {
  flex: none; width: 44px; height: auto;
  color: var(--warm-glow);
  filter: drop-shadow(0 0 6px rgba(255, 201, 122, 0.35));
}

/* ========== 我的把關 ========== */
.essay-footer {
  margin-top: 4.5rem;
  padding: 2.2rem 2.2rem 2rem;
  background: var(--sand-pale);
  border: 1px solid var(--rule-sand);
  border-radius: 16px;
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-body);
}
.essay-footer h2 {
  font-size: 1.3rem;
  margin: 0 0 1rem;
}
.essay-footer .keeper { font-size: 1.04rem; color: var(--text-dark); line-height: 1.9; }
.essay-footer .keeper p { margin-bottom: 0.9rem; }
.essay-footer .keeper p:last-child { margin-bottom: 0; }
.essay-footer .sign {
  text-align: center;
  margin-top: 2.2rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--rule-sand);
}
.essay-footer .seal {
  display: inline-block;
  padding: 0.25rem 1rem;
  margin-bottom: 0.9rem;
  border: 1px solid var(--aegean-deep);
  border-radius: 4px;
  font-family: var(--f-serif);
  font-size: 0.95rem; font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--aegean-deep);
}
.essay-footer .attribution {
  font-family: var(--f-display);
  font-size: 0.84rem; letter-spacing: 0.06em;
  color: var(--text-muted);
}
.essay-footer .disclaimer {
  max-width: 42em;
  margin: 1.2rem auto 0;
  font-size: 0.84rem; line-height: 1.75;
  color: var(--text-muted);
  text-wrap: pretty;
}
.essay-footer a { color: var(--aegean); }

/* ========== 頁尾海平線 ========== */
body::after {
  content: "";
  display: block;
  height: 56px;
  margin-top: 1rem;
  background: linear-gradient(180deg, var(--sky-mist) 0%, rgba(200, 220, 238, 0.45) 30%, rgba(200, 220, 238, 0) 100%);
}

/* ========== 窄螢幕 ========== */
@media (max-width: 720px) {
  .essay-nav .nav-btn .label { display: none; }
  .essay-nav .nav-btn { padding: 0.32rem 0.45rem; }
  .essay-nav .nav-title { font-size: 0.64rem; letter-spacing: 0.12em; padding-left: 0.1rem; }
}

@media (max-width: 640px) {
  body { font-size: 1.08rem; }
  .container { padding: 0 1rem 3rem; }
  .hero { height: 42vh; min-height: 240px; max-height: none; }
  .hero::after { height: 24%; }
  .hero-tag { top: 0.75rem; left: 0.9rem; font-size: 0.72rem; padding: 0.26rem 0.8rem; }
  .essay-header { padding: 1.1rem 0 1.8rem; margin-bottom: 2rem; }
  .essay-number { font-size: 0.74rem; letter-spacing: 0.18em; margin-bottom: 0.7rem; }
  h1 .sub { font-size: 1.05rem; margin-top: 0.7rem; }
  .meta { font-size: 0.78rem; margin-top: 1.2rem; }
  .meta .dot { margin: 0 0.45em; }
  p.lead { font-size: 1.16rem; margin-top: 1.8rem; }
  .origin { padding: 1.05rem 1.15rem 1rem; font-size: 1.08rem; }
  h2 { font-size: 1.32rem; margin-top: 3.2rem; }
  ol.step-list > li { padding-left: 2.3rem; }
  table { font-size: 0.92rem; }
  th, td { padding: 0.6rem 0.7rem; }
  thead th { white-space: normal; }
  .reel-wrap, .fieldtest { padding: 0.5rem; border-radius: 12px; }
  .fieldtest-labels span { padding: 0.12rem 0.8rem; font-size: 0.8rem; letter-spacing: 0.06em; }
  .pull-quote { font-size: 1.2rem; padding: 2.8rem 1.2rem; margin-top: 3.2rem; margin-bottom: 3.2rem; border-radius: 16px; }
  .pull-quote .pq-row { flex-direction: column; gap: 1.1rem; }
  .pull-quote .pq-phone { width: 30px; }
  .essay-footer { padding: 1.6rem 1.2rem 1.5rem; border-radius: 14px; }
  .callout { padding: 1.2rem 1.15rem 0.9rem; }
}

@media print {
  .essay-nav { display: none; }
  .pull-quote::before, .pull-quote::after { display: none; }
}
