/* 路克醫師 郭哲宏｜耳鼻喉顏面外科 —— 手機優先、不破框 */
:root {
  --bg: #f7f9fb;
  --surface: #ffffff;
  --text: #1c2733;
  --muted: #5b6b7a;
  --line: #e1e7ec;
  --brand: #0f6e8c;
  --brand-dark: #0b4f66;
  --brand-soft: #e3f1f5;
  --shadow: 0 1px 2px rgba(16, 32, 48, .06), 0 8px 24px rgba(16, 32, 48, .06);
  --radius: 14px;
  --content: 44rem;
  --wrap: 68rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f151b;
    --surface: #182129;
    --text: #e6edf3;
    --muted: #9fb0bf;
    --line: #26323d;
    --brand: #5fc0dc;
    --brand-dark: #8ad3e8;
    --brand-soft: #14313c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}
img, video, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; font-weight: 700; letter-spacing: .01em; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--brand); color: #fff; padding: 8px 12px; }
.skip:focus { left: 8px; z-index: 100; }

/* 頂欄 */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar .wrap { display: flex; align-items: center; min-height: 56px; }
.brand { color: var(--text); font-weight: 700; font-size: 1.05rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .6em; }
.brand:hover { text-decoration: none; }
.brand-sub { color: var(--muted); font-weight: 500; font-size: .9rem; }

/* HERO：左文字、右形象照。人像高度以橫幅高度為準等比縮小，整個上半身都在橫幅內 */
.hero { --hero-h: clamp(350px, 42vw, 528px); --ink: rgba(15, 110, 140, 1); position: relative; isolation: isolate;
  background: linear-gradient(100deg, #f4f5f6 0%, #e2e5e8 55%, #cfd4d8 100%); color: #1c2733; overflow: hidden; }
/* 背景裝飾：青藍柔光、斜向色帶、細點陣、一組同心圓 —— 專業中帶一點活潑 */
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background:
  radial-gradient(circle at 8% 18%, rgba(15, 110, 140, .20), transparent 38%),
  radial-gradient(circle at 60% 120%, rgba(15, 110, 140, .16), transparent 42%),
  linear-gradient(112deg, transparent 46%, rgba(222, 140, 70, .13) 46%, rgba(222, 140, 70, .13) 60%, transparent 60%),
  radial-gradient(rgba(15, 110, 140, .16) 1.2px, transparent 1.4px) 0 0 / 22px 22px; }
.hero::after { content: ""; position: absolute; z-index: -1; pointer-events: none; left: -140px; bottom: -190px; width: 480px; height: 480px; border-radius: 50%;
  border: 1.5px solid rgba(15, 110, 140, .22); box-shadow: 0 0 0 60px rgba(15, 110, 140, .05), 0 0 0 61.5px rgba(15, 110, 140, .16), 0 0 0 130px rgba(15, 110, 140, .04), 0 0 0 131.5px rgba(15, 110, 140, .10); }
.hero-inner { display: grid; grid-template-columns: 1fr; align-items: end; gap: 0 24px; position: relative; }
.hero-text { padding: 20px 0 28px; order: 2; }
.hero-text h1 { font-size: clamp(1.75rem, 6vw, 2.9rem); margin: 0; color: #12202b; }
.hero-sub { margin: .1em 0 .5em; font-size: clamp(1.05rem, 3.4vw, 1.45rem); font-weight: 600; color: #0b4f66; display: inline-block; position: relative; }
.hero-sub::after { content: ""; display: block; height: 4px; width: 56px; margin-top: 6px; border-radius: 2px; background: linear-gradient(90deg, #0f6e8c, #5fc0dc); }
.hero-tagline { margin: 0; max-width: 34rem; font-size: clamp(.95rem, 2.6vw, 1.05rem); color: #3e4c58; }
.hero-img { order: 1; justify-self: center; height: min(330px, 75vw); width: auto; max-width: 100%; object-fit: contain; object-position: bottom; margin-top: 0;
  /* 邊緣淡出，讓照片本身的灰底融入 HERO 背景 */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 20%, #000 80%, transparent), linear-gradient(to bottom, transparent, #000 3%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 20%, #000 80%, transparent), linear-gradient(to bottom, transparent, #000 3%);
  mask-composite: intersect; }
@media (min-width: 720px) {
  .hero-inner { grid-template-columns: 1fr auto; height: var(--hero-h); }
  .hero-text { order: 1; align-self: center; padding: 28px 0; }
  .hero-img { order: 2; justify-self: end; align-self: end; height: var(--hero-h); width: auto; max-width: 42vw; margin-top: 0; object-position: right bottom;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 22%, #000 90%, transparent), linear-gradient(to bottom, transparent, #000 3%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to right, transparent, #000 22%, #000 90%, transparent), linear-gradient(to bottom, transparent, #000 3%);
    mask-composite: intersect; }
}
/* 照片本身是淺灰底，HERO 在深色模式也維持淺色，讓照片邊緣自然融入 */

/* 卡片 */
main { padding: 28px 20px 48px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 1.35rem; }
.site-updated { margin: 0; color: var(--muted); font-size: .9rem; }
.cards { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 18px 14px; display: flex; flex-direction: column; min-width: 0; transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-2px); }
.card-link { color: inherit; flex: 1; }
.card-link:hover { text-decoration: none; }
.card-link:hover .card-title { color: var(--brand); }
.card-title { font-size: 1.12rem; margin-bottom: .35em; }
.card-summary { margin: 0 0 12px; color: var(--muted); font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* 日期／作者／瀏覽 */
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: .85rem; }
.meta-item { white-space: nowrap; }
.views { font-variant-numeric: tabular-nums; }

/* 文章頁 */
.post-wrap { max-width: var(--content); }
.crumbs { margin: 4px 0 18px; font-size: .95rem; }
.post-head h1 { font-size: clamp(1.55rem, 5vw, 2.2rem); }
.post-head .meta { margin-bottom: 20px; }
.post-hero { margin: 0 0 24px; }
.post-hero img { width: 100%; max-width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.post-hero figcaption, .credit { color: var(--muted); font-size: .8rem; margin-top: 8px; line-height: 1.5; }
.post-body > :first-child { margin-top: 0; }
.post-body h2 { font-size: 1.4rem; margin-top: 1.8em; padding-bottom: .25em; border-bottom: 1px solid var(--line); }
.post-body h3 { font-size: 1.15rem; margin-top: 1.5em; }
.post-body p, .post-body ul, .post-body ol { margin: 0 0 1.1em; }
.post-body li { margin-bottom: .3em; }
.post-body img { margin: 1em auto; border-radius: 10px; }
.post-body blockquote { margin: 1.2em 0; padding: 10px 16px; border-left: 4px solid var(--brand); background: var(--brand-soft); border-radius: 0 10px 10px 0; }
.post-body blockquote p:last-child { margin-bottom: 0; }
.post-body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; background: var(--brand-soft); padding: .1em .35em; border-radius: 5px; }
.post-body pre { overflow-x: auto; background: #10202a; color: #e7eef4; padding: 14px 16px; border-radius: 10px; max-width: 100%; }
.post-body pre code { background: none; padding: 0; color: inherit; }
.table-wrap { overflow-x: auto; max-width: 100%; margin: 1.2em 0; -webkit-overflow-scrolling: touch; }
.post-body table { border-collapse: collapse; min-width: 100%; font-size: .95rem; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.post-body th { background: var(--brand-soft); }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

/* 頁尾 */
.footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .85rem; padding: 24px 0 36px; }
.footer p { margin: 0 0 8px; }
