/* ============================================================
   貞．診所 SEO 健檢報告  —  樣式表
   行動裝置優先（Mobile First）
   ============================================================ */

:root {
  --ivory:      #FAF7F4;
  --ivory-2:    #F3EDE7;
  --card:       #FFFFFF;
  --ink:        #241E1B;
  --ink-2:      #574C46;
  --ink-3:      #75675F;
  --line:       #E6DCD3;
  --rose:       #A8635C;
  --rose-deep:  #8E4C46;
  --rose-soft:  #C99A92;
  --rose-wash:  #F6EAE7;
  --red:        #B8332B;
  --red-wash:   #FBEAE8;
  --amber:      #8A5A10;
  --amber-wash: #FCF2E0;
  --green:      #3F7355;
  --green-wash: #E7F1EA;
  --blue:       #3C5A78;
  --blue-wash:  #E9EFF5;
  --shadow:     0 1px 2px rgba(36,30,27,.05), 0 8px 24px -12px rgba(36,30,27,.16);
  --shadow-lg:  0 2px 4px rgba(36,30,27,.05), 0 24px 56px -20px rgba(36,30,27,.24);
  --radius:     14px;
  --maxw:       880px;
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", -apple-system,
          BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ivory:#17130F; --ivory-2:#1F1A16; --card:#211C18; --ink:#F2EBE4;
    --ink-2:#C7BAB0; --ink-3:#A99A8F; --line:#362E28;
    --rose:#D89C93; --rose-deep:#E5B4AC; --rose-soft:#8C5E58; --rose-wash:#33231F;
    --red:#E8877E; --red-wash:#36201D; --amber:#DFAE5F;
    --amber-wash:#33281A; --green:#7FB795; --green-wash:#1C2A21;
    --blue:#8FB2D2; --blue-wash:#1B242E;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.7);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 24px 56px -20px rgba(0,0,0,.8);
  }
}
:root[data-theme="dark"] {
  --ivory:#17130F; --ivory-2:#1F1A16; --card:#211C18; --ink:#F2EBE4;
  --ink-2:#C7BAB0; --ink-3:#A99A8F; --line:#362E28;
  --rose:#D89C93; --rose-deep:#E5B4AC; --rose-soft:#8C5E58; --rose-wash:#33231F;
  --red:#E8877E; --red-wash:#36201D; --amber:#DFAE5F; --amber-wash:#33281A;
  --green:#7FB795; --green-wash:#1C2A21; --blue:#8FB2D2; --blue-wash:#1B242E;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.7);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 24px 56px -20px rgba(0,0,0,.8);
}
:root[data-theme="light"] {
  --ivory:#FAF7F4; --ivory-2:#F3EDE7; --card:#FFFFFF; --ink:#241E1B;
  --ink-2:#574C46; --ink-3:#75675F; --line:#E6DCD3; --rose:#A8635C; --rose-deep:#8E4C46;
  --rose-soft:#C99A92; --rose-wash:#F6EAE7; --red:#B8332B; --red-wash:#FBEAE8;
  --amber:#8A5A10; --amber-wash:#FCF2E0; --green:#3F7355; --green-wash:#E7F1EA;
  --blue:#3C5A78; --blue-wash:#E9EFF5;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: .01em;
  overflow-x: hidden;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

img, svg { max-width: 100%; }
a { color: var(--rose); text-underline-offset: 3px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- 進度條 ---------- */
#progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--rose), var(--rose-soft));
  z-index: 100; transition: width .1s linear;
}

/* ---------- 主題切換 ---------- */
.theme-btn {
  position: fixed; top: 12px; right: 12px; z-index: 99;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  font-size: 17px; cursor: pointer; box-shadow: var(--shadow);
  display: grid; place-items: center; padding: 0;
}

/* ---------- 封面 ---------- */
.hero {
  position: relative;
  padding: 64px 0 44px;
  background:
    radial-gradient(120% 80% at 80% -10%, var(--rose-wash) 0%, transparent 60%),
    radial-gradient(90% 60% at 0% 0%, var(--ivory-2) 0%, transparent 55%);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.eyebrow {
  font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--rose); font-weight: 700; margin: 0 0 14px;
}
.hero h1 {
  font-size: clamp(29px, 8.2vw, 50px);
  line-height: 1.22; margin: 0 0 6px; font-weight: 800; letter-spacing: -.01em;
}
.hero .sub { color: var(--ink-2); margin: 0 0 26px; font-size: 15px; }
.hero .sub b { color: var(--ink); font-weight: 700; }

.verdict {
  background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  border-radius: var(--radius); padding: 18px 18px 16px;
  box-shadow: var(--shadow); margin-top: 26px;
}
.verdict h2 { font-size: 15px; margin: 0 0 8px; color: var(--red); letter-spacing: .02em; }
.verdict p { margin: 0; font-size: 16.5px; line-height: 1.8; }
.verdict p b { background: linear-gradient(transparent 62%, var(--rose-wash) 62%); font-weight: 800; }

/* ---------- 分數儀表 ---------- */
.gauge-row { display: grid; gap: 22px; align-items: center; margin-top: 30px; }
.gauge { display: grid; place-items: center; position: relative; }
.gauge svg { width: min(230px, 62vw); height: auto; display: block; }
.gauge-center {
  position: absolute; inset: 0; display: grid; place-content: center;
  text-align: center; pointer-events: none;
}
.gauge-num {
  font-size: clamp(46px, 15vw, 62px); font-weight: 800; line-height: 1;
  color: var(--red); font-variant-numeric: tabular-nums; letter-spacing: -.03em;
}
.gauge-den { font-size: 13px; color: var(--ink-3); margin-top: 4px; letter-spacing: .1em; }
.gauge-grade {
  display: inline-block; margin-top: 10px; padding: 3px 12px; border-radius: 99px;
  background: var(--red-wash); color: var(--red); font-size: 12px; font-weight: 800;
  letter-spacing: .1em;
}
.gauge-note { font-size: 13.5px; color: var(--ink-2); text-align: center; max-width: 34em; margin: 0 auto; }

/* ---------- 三大數字 ---------- */
.bigstats { display: grid; gap: 12px; margin-top: 34px; }
.bigstat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.bigstat::after {
  content: ""; position: absolute; right: -18px; top: -18px;
  width: 84px; height: 84px; border-radius: 50%; background: var(--red-wash); opacity: .55;
}
.bigstat .n {
  font-size: 38px; font-weight: 800; line-height: 1.05; color: var(--red);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em; position: relative;
}
.bigstat .n small { font-size: 16px; font-weight: 700; margin-left: 3px; }
.bigstat .l { font-size: 14.5px; font-weight: 700; margin-top: 6px; position: relative; }
.bigstat .d { font-size: 13.5px; color: var(--ink-2); margin-top: 4px; position: relative; line-height: 1.65; }

/* ---------- 區塊 ---------- */
section { padding: 52px 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: 0; }
.sec-num {
  display: inline-block; font-family: var(--mono); font-size: 11.5px; letter-spacing: .18em;
  color: var(--rose-deep); background: var(--rose-wash); padding: 4px 10px; border-radius: 99px;
  margin-bottom: 14px; font-weight: 700;
}
h2.sec {
  font-size: clamp(22px, 5.6vw, 30px); line-height: 1.35; margin: 0 0 10px;
  font-weight: 800; letter-spacing: -.01em;
}
.lede { color: var(--ink-2); font-size: 15.5px; margin: 0 0 26px; max-width: 40em; }

h3.sub { font-size: 17.5px; margin: 34px 0 12px; font-weight: 800; }

/* ---------- 面向評分 ---------- */
.dims { display: grid; gap: 10px; }
.dim {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; box-shadow: var(--shadow);
}
.dim-head {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center;
  padding: 13px 14px; cursor: pointer; width: 100%; background: none; border: 0;
  font-family: inherit; text-align: left; color: inherit;
}
.dim-name { font-size: 15px; font-weight: 700; }
.dim-w { font-size: 11.5px; color: var(--ink-3); font-weight: 500; margin-left: 6px; }
.dim-score { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 46px; text-align: right; }
.dim-caret { color: var(--ink-3); font-size: 12px; transition: transform .25s; }
.dim[open] .dim-caret, .dim.open .dim-caret { transform: rotate(180deg); }
.bar { height: 6px; background: var(--ivory-2); position: relative; }
.bar > i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 0 3px 3px 0; transition: width 1.1s cubic-bezier(.22,1,.36,1); }
.dim-body {
  padding: 0 14px 16px; font-size: 14.5px; color: var(--ink-2); line-height: 1.8;
  display: none;
}
.dim.open .dim-body { display: block; }
.dim-body .plain {
  background: var(--ivory-2); border-radius: 10px; padding: 11px 13px; margin: 12px 0 0;
  font-size: 14px;
}
.dim-body .plain b { color: var(--ink); }

.s-bad   { color: var(--red); }    .b-bad   { background: var(--red); }
.s-mid   { color: var(--amber); }  .b-mid   { background: var(--amber); }
.s-good  { color: var(--green); }  .b-good  { background: var(--green); }

/* ---------- Google 視角切換 ---------- */
.toggle-row {
  display: inline-flex; background: var(--ivory-2); border-radius: 99px; padding: 4px;
  gap: 4px; border: 1px solid var(--line); margin-bottom: 18px;
}
.toggle-row button {
  border: 0; background: none; font-family: inherit; font-size: 13.5px; font-weight: 700;
  padding: 10px 18px; border-radius: 99px; cursor: pointer; color: var(--ink-2);
  min-height: 44px;
}
.toggle-row button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

.viewport-demo {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--card); box-shadow: var(--shadow-lg);
}
.vd-bar {
  display: flex; align-items: center; gap: 6px; padding: 9px 12px;
  background: var(--ivory-2); border-bottom: 1px solid var(--line);
}
.vd-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.vd-url {
  margin-left: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vd-body { padding: 16px; min-height: 260px; }

.vd-human { display: grid; gap: 9px; }
.ph { border-radius: 8px; background: linear-gradient(100deg, var(--rose-wash), var(--ivory-2)); }
.ph.hero  { height: 108px; }
.ph.line  { height: 11px; }
.ph.line.w70 { width: 70%; } .ph.line.w50 { width: 50%; } .ph.line.w85 { width: 85%; }
.ph.grid { height: 62px; }
.ph-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.ph-tag {
  font-size: 11px; color: var(--ink-3); font-family: var(--mono); text-align: center;
  padding-top: 2px;
}

.vd-bot { font-family: var(--mono); font-size: 13px; line-height: 2; }
.vd-bot .crawl-label {
  font-family: var(--font); font-size: 12.5px; font-weight: 700; color: var(--red);
  background: var(--red-wash); display: inline-block; padding: 3px 10px; border-radius: 99px;
  margin-bottom: 12px;
}
.crawl-text {
  background: var(--ivory-2); border: 1px dashed var(--line); border-radius: 10px;
  padding: 13px; color: var(--ink-2); word-break: break-all; font-size: 12.5px; line-height: 1.95;
}
.crawl-text .nav { color: var(--ink-3); }
.crawl-meter { margin-top: 14px; font-family: var(--font); font-size: 13.5px; color: var(--ink-2); }
.crawl-meter b { color: var(--red); font-size: 17px; }

/* ---------- 文字量比較條 ---------- */
.cmp { display: grid; gap: 12px; margin-top: 22px; }
.cmp-item { font-size: 13.5px; }
.cmp-item .cl { display: flex; justify-content: space-between; margin-bottom: 5px; gap: 10px; }
.cmp-item .cl b { font-variant-numeric: tabular-nums; }
.cmp-track { height: 26px; background: var(--ivory-2); border-radius: 6px; overflow: hidden; }
.cmp-track > i { display: block; height: 100%; width: 0; transition: width 1.2s cubic-bezier(.22,1,.36,1); border-radius: 6px; }

/* ---------- 問題卡 ---------- */
.issues { display: grid; gap: 14px; }
.issue {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.issue-top { padding: 16px 16px 0; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 800;
  padding: 4px 10px; border-radius: 99px; letter-spacing: .04em;
}
.chip.p1 { background: var(--red-wash); color: var(--red); }
.chip.p2 { background: var(--amber-wash); color: var(--amber); }
.chip.p3 { background: var(--green-wash); color: var(--green); }
.chip.law { background: var(--blue-wash); color: var(--blue); }
.issue h4 { font-size: 17.5px; margin: 11px 0 0; line-height: 1.45; font-weight: 800; }
.issue-body { padding: 0 16px 16px; }
.field { margin-top: 14px; }
.field > .k {
  font-size: 11.5px; font-weight: 800; letter-spacing: .12em; color: var(--ink-3);
  text-transform: uppercase; margin-bottom: 5px; display: block;
}
.field > .v { font-size: 14.8px; color: var(--ink-2); line-height: 1.8; }
.field > .v strong { color: var(--ink); }
.evidence {
  font-family: var(--mono); font-size: 12.5px; background: var(--ivory-2);
  border-radius: 8px; padding: 10px 12px; color: var(--ink-2);
  overflow-x: auto; white-space: pre-wrap; word-break: break-word; line-height: 1.75;
  border-left: 3px solid var(--rose-soft);
}
.fix-list { margin: 0; padding-left: 1.15em; }
.fix-list li { margin-bottom: 7px; font-size: 14.8px; color: var(--ink-2); }
.fix-list li strong { color: var(--ink); }
.meta-row {
  display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.tag {
  font-size: 12px; background: var(--ivory-2); color: var(--ink-2);
  padding: 4px 10px; border-radius: 6px; font-weight: 600;
}
.tag b { color: var(--ink); }

/* ---------- 搜尋結果模擬 ---------- */
.serp {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.serp + .serp { margin-top: 12px; }
.serp .u { font-size: 12.5px; color: var(--ink-3); font-family: var(--mono); margin-bottom: 3px; }
.serp .t { font-size: 17px; color: #1a58c9; line-height: 1.4; font-weight: 500; }
:root[data-theme="dark"] .serp .t, html:not([data-theme]) .serp .t { }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .serp .t { color: #8ab4f8; } }
:root[data-theme="dark"] .serp .t { color: #8ab4f8; }
:root[data-theme="light"] .serp .t { color: #1a58c9; }
.serp .d { font-size: 13.8px; color: var(--ink-2); margin-top: 4px; line-height: 1.65; }
.serp .d mark { background: var(--red-wash); color: var(--red); padding: 0 2px; border-radius: 3px; }
.serp-note {
  margin-top: 12px; font-size: 13.5px; color: var(--red); background: var(--red-wash);
  padding: 10px 12px; border-radius: 8px; line-height: 1.7;
}

/* ---------- 表格 ---------- */
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 6px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 14px; }
th, td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.65; }
th { background: var(--ivory-2); font-size: 12.5px; letter-spacing: .06em; font-weight: 800; color: var(--ink-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.ok { color: var(--green); font-weight: 700; }
td.no { color: var(--red); font-weight: 700; }
.scroll-hint { font-size: 12px; color: var(--ink-3); margin-top: 7px; }

/* ---------- 法規 ---------- */
.law-card {
  background: var(--blue-wash); border: 1px solid var(--line); border-left: 4px solid var(--blue);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
}
.law-card h4 { margin: 0 0 8px; font-size: 16px; font-weight: 800; }
.law-card p { margin: 0 0 8px; font-size: 14.5px; color: var(--ink-2); line-height: 1.8; }
.law-card p:last-child { margin-bottom: 0; }
.law-src {
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-3);
  border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 10px;
}
.penalty {
  display: inline-block; background: var(--red-wash); color: var(--red); font-weight: 800;
  font-size: 13px; padding: 4px 11px; border-radius: 7px; margin-top: 4px;
}

/* ---------- 檢查清單 ---------- */
.phase { margin-bottom: 26px; }
.phase-h {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.phase-h h3 { margin: 0; font-size: 18px; font-weight: 800; }
.phase-h .when { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.phase-goal { font-size: 13.8px; color: var(--ink-2); margin: 0 0 12px; }
.check { display: grid; gap: 8px; }
.check label {
  display: grid; grid-template-columns: auto 1fr; gap: 11px; align-items: start;
  background: var(--card); border: 1px solid var(--line); border-radius: 11px;
  padding: 13px 14px; cursor: pointer; box-shadow: var(--shadow);
  transition: opacity .2s, background .2s;
  min-height: 48px;
}
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--rose); flex-shrink: 0; }
.check .ct { font-size: 14.8px; line-height: 1.65; }
.check .ct em { font-style: normal; display: block; font-size: 12.8px; color: var(--ink-3); margin-top: 3px; }
.check input:checked + .ct { text-decoration: line-through; color: var(--ink-3); }
.check-progress {
  font-size: 13px; color: var(--ink-2); margin-top: 12px; background: var(--ivory-2);
  padding: 10px 13px; border-radius: 9px; display: flex; justify-content: space-between; gap: 10px;
  align-items: center; flex-wrap: wrap;
}
.check-progress button {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  font-family: inherit; font-size: 12.5px; padding: 9px 15px; border-radius: 7px; cursor: pointer;
  min-height: 44px;
}

/* ---------- 影響預估 ---------- */
.impact {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); margin-top: 8px;
}
.impact-row { display: grid; gap: 4px; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.impact-row:last-child { border-bottom: 0; padding-bottom: 0; }
.impact-row:first-child { padding-top: 0; }
.impact-k { font-size: 14.5px; font-weight: 700; }
.impact-v { font-size: 13.8px; color: var(--ink-2); }
.impact-v b { color: var(--green); }

/* ---------- 頁尾 ---------- */
footer { padding: 40px 0 60px; color: var(--ink-3); font-size: 13px; line-height: 1.85; }
footer strong { color: var(--ink-2); }
.disclaimer {
  background: var(--ivory-2); border-radius: 11px; padding: 14px; margin-top: 18px;
  font-size: 12.8px; line-height: 1.8;
}

/* ---------- 目錄 ---------- */
.toc {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px; box-shadow: var(--shadow); margin-top: 28px;
}
.toc a {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 12px 12px; border-radius: 9px; text-decoration: none; color: var(--ink);
  font-size: 14.5px; font-weight: 600; min-height: 48px;
}
.toc a:active { background: var(--ivory-2); }
.toc a span.n { font-family: var(--mono); font-size: 11.5px; color: var(--rose); }
.toc a + a { border-top: 1px solid var(--line); }

/* ---------- 動畫 ----------
   預設為「看得見」。只有在 JS 確認可以安全播放進場動畫時，
   才由 JS 在 <html> 加上 .js-anim，內容才會先隱藏。
   如此一來，即使 JS 失效或 IntersectionObserver 沒觸發，
   報告內容也絕不會整段消失。                                */
.reveal { transition: opacity .6s ease, transform .6s cubic-bezier(.22,1,.36,1); }
.js-anim .reveal:not(.in) { opacity: 0; transform: translateY(14px); }

/* ---------- 平板以上 ---------- */
@media (min-width: 620px) {
  body { font-size: 16.5px; }
  .wrap { padding: 0 32px; }
  .bigstats { grid-template-columns: repeat(3, 1fr); }
  .gauge-row { grid-template-columns: auto 1fr; text-align: left; }
  .gauge-note { text-align: left; margin: 0; }
  .impact-row { grid-template-columns: 220px 1fr; gap: 14px; align-items: baseline; }
  section { padding: 68px 0; }
  .hero { padding: 84px 0 56px; }
}
@media (min-width: 900px) {
  .wrap { padding: 0 24px; }
}

@media print {
  .theme-btn, #progress, .toc { display: none; }
  .dim-body { display: block !important; }
  section { break-inside: avoid; padding: 24px 0; }
  body { background: #fff; }
}
