/* P207 系統架構概覽 — 奶茶北歐．老花眼友善
   刻意單一淺色主題：與 cyc-reports 其他報告一致，
   且四張圖為預先渲染的淺底 SVG，維持「紙上圖版」的一致觀感。 */

:root {
  --ground:      #F6F2EC;   /* 奶茶底 */
  --paper:       #FFFDF9;   /* 圖版與卡片 */
  --paper-alt:   #EFE9E0;
  --ink:         #2A2622;   /* 暖褐近黑，非純黑 */
  --ink-mid:     #574E45;
  --ink-soft:    #7D7264;
  --line:        #E0D7CB;
  --line-firm:   #C8BCAC;
  --clay:        #B0562F;   /* 唯一重點色 */
  --clay-soft:   #F3E7DC;
  --sage:        #67735D;

  --measure: 40rem;

  --t--1: 1rem;
  --t-0:  1.25rem;    /* 內文 20px */
  --t-1:  1.4rem;
  --t-2:  1.75rem;
  --t-3:  2.25rem;
  --t-4:  2.9rem;

  --sans: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei",
          -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
[id] { scroll-margin-top: 1.5rem; }

body {
  font-family: var(--sans);
  font-size: var(--t-0);
  line-height: 1.85;
  color: var(--ink);
  background: var(--ground);
  padding: 0 1.25rem 6rem;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--measure); margin: 0 auto; }
.wrap-wide { max-width: 62rem; margin: 0 auto; }

p { margin: 0; }
strong { font-weight: 650; }

a { color: var(--clay); text-decoration: underline; text-underline-offset: .25em; text-decoration-thickness: 1px; }
a:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; border-radius: 2px; }

/* ── 頁首 ───────────────────────────────────────────── */
.top { padding: 4rem 0 2.5rem; }
.back {
  display: inline-block; font-size: var(--t--1); font-family: var(--mono);
  color: var(--ink-soft); margin-bottom: 2rem; text-decoration: none;
  border-bottom: 1px solid var(--line-firm); padding-bottom: 2px;
}
.kicker {
  font-family: var(--mono); font-size: var(--t--1); font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft);
}
h1 {
  font-size: var(--t-4); line-height: 1.28; letter-spacing: -.02em;
  font-weight: 680; margin-top: 1rem; text-wrap: balance;
}
.lede { font-size: var(--t-1); line-height: 1.75; color: var(--ink-mid); margin-top: 1.4rem; }
.meta {
  display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; margin-top: 2rem;
  font-family: var(--mono); font-size: var(--t--1); color: var(--ink-soft);
}

/* ── 導讀卡 ─────────────────────────────────────────── */
.howto {
  background: var(--clay-soft); border-left: 3px solid var(--clay);
  padding: 1.5rem 1.6rem; border-radius: 0 4px 4px 0; margin-top: 2.5rem;
}
.howto h2 { font-size: var(--t-0); font-weight: 680; margin-bottom: .6rem; border: 0; padding: 0; }
.howto p { color: var(--ink-mid); }
.howto p + p { margin-top: .7rem; }

/* ── 分區標題 ───────────────────────────────────────── */
.part { margin-top: 5rem; }
.part-no {
  font-family: var(--mono); font-size: var(--t--1); font-weight: 650;
  letter-spacing: .16em; text-transform: uppercase; color: var(--clay);
}
.part h2 {
  font-size: var(--t-3); line-height: 1.35; letter-spacing: -.015em;
  font-weight: 680; margin-top: .5rem; text-wrap: balance;
}
.part > p { color: var(--ink-mid); margin-top: 1rem; }

/* ── 圖版 ───────────────────────────────────────────── */
.fig { margin-top: 3.5rem; }
.fig-head { max-width: var(--measure); margin: 0 auto; }
.fig-tag {
  display: inline-block; font-family: var(--mono); font-size: var(--t--1);
  font-weight: 650; letter-spacing: .1em; color: var(--clay);
  background: var(--clay-soft); border-radius: 3px; padding: .2rem .7rem;
}
.fig h3 { font-size: var(--t-2); font-weight: 680; line-height: 1.4; margin-top: .8rem; letter-spacing: -.01em; }
.fig-desc { color: var(--ink-mid); margin-top: .9rem; }

.plate {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 6px; margin-top: 1.6rem; overflow: hidden;
}
.plate-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 1.5rem; }
.plate-scroll img { display: block; height: auto; max-width: none; }
.plate-foot {
  border-top: 1px solid var(--line); padding: .85rem 1.5rem;
  font-family: var(--mono); font-size: var(--t--1); color: var(--ink-soft);
  display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center;
}

/* ── 看圖重點 ───────────────────────────────────────── */
.keys { max-width: var(--measure); margin: 1.8rem auto 0; }
.keys-h {
  font-family: var(--mono); font-size: var(--t--1); font-weight: 650;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft);
  margin-bottom: 1rem;
}
.list { display: flex; flex-direction: column; gap: .95rem; }
.li { display: flex; gap: .85rem; align-items: baseline; }
.li-mk {
  flex: 0 0 1.4rem; font-family: var(--mono); font-size: var(--t--1);
  font-weight: 650; color: var(--clay); font-variant-numeric: tabular-nums;
}
.li-tx { flex: 1 1 auto; min-width: 0; }

/* ── FAQ ────────────────────────────────────────────── */
.faq-group { margin-top: 3rem; }
.faq-group > h3 {
  font-size: var(--t-1); font-weight: 680;
  padding-bottom: .7rem; border-bottom: 2px solid var(--ink);
}
.qa { padding: 1.75rem 0; border-bottom: 1px solid var(--line); }
.qa:last-child { border-bottom: 0; }
.qa .q {
  font-size: var(--t-1); font-weight: 680; line-height: 1.55;
  display: flex; gap: .8rem; align-items: baseline;
}
.qa .q::before {
  content: "Q"; flex: 0 0 auto; font-family: var(--mono);
  font-size: var(--t--1); color: var(--clay); font-weight: 650;
}
.qa .a { margin-top: .8rem; padding-left: 1.9rem; color: var(--ink-mid); }
.qa .a > * + * { margin-top: .8rem; }
.qa .a strong { color: var(--ink); }

.pin {
  background: var(--paper-alt); border-radius: 5px;
  padding: 1.1rem 1.3rem; border: 1px solid var(--line);
}
.pin-h {
  font-family: var(--mono); font-size: var(--t--1); font-weight: 650;
  letter-spacing: .1em; text-transform: uppercase; color: var(--sage);
  display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem;
}

/* ── 表 ─────────────────────────────────────────────── */
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; min-width: 28rem; font-size: var(--t-0); }
th, td { text-align: left; vertical-align: top; padding: .9rem 1rem; border-bottom: 1px solid var(--line); line-height: 1.7; }
thead th {
  font-family: var(--mono); font-size: var(--t--1); letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-soft); font-weight: 600;
  border-bottom: 1px solid var(--line-firm); white-space: nowrap;
}
tbody th { font-weight: 680; white-space: nowrap; color: var(--ink); }
tr:last-child td, tr:last-child th { border-bottom: 0; }

/* ── 頁尾 ───────────────────────────────────────────── */
.foot {
  margin-top: 5rem; padding-top: 2.5rem; border-top: 1px solid var(--line);
  color: var(--ink-soft); font-size: var(--t--1); line-height: 1.85;
}
.foot > * + * { margin-top: .6rem; }

@media (min-width: 40rem) {
  body { padding: 0 2rem 7rem; }
  .plate-scroll { padding: 2rem; }
}

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