/* ═══════════════════════════════════════
   和八歲孩子一起玩 Steam
   ═══════════════════════════════════════ */

:root {
  --bg:       #f7f9fb;
  --surface:  #ffffff;
  --text:     #1c2733;
  --muted:    #667484;
  --line:     #e0e6ec;
  --steam:    #1b2838;
  --steam-lt: #2a475e;
  --accent:   #4a9fd4;
  --gold:     #c8912b;
  --danger:   #c4523d;
  --good:     #2f8557;
  --radius: 12px;
  --wrap: 47rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #10161d;
    --surface:  #19212b;
    --text:     #e4eaf0;
    --muted:    #94a2b1;
    --line:     #2a333f;
    --steam:    #66c0f4;
    --steam-lt: #8ed0f8;
    --accent:   #6fb8e0;
    --gold:     #e0b45c;
    --danger:   #e0876f;
    --good:     #66bd8e;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC",
               -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }

/* ── Hero ─────────────────────────────── */

.hero {
  background: linear-gradient(160deg, #10151c, #1b2838 55%, #2a475e);
  color: #fff;
  padding: 4.25rem 0 3.5rem;
  text-align: center;
}
.hero .kicker {
  margin: 0 0 .8rem;
  font-size: .74rem;
  letter-spacing: .3em;
  text-indent: .3em;
  opacity: .7;
}
.hero h1 {
  margin: 0 0 1.2rem;
  font-size: clamp(1.9rem, 6.5vw, 3rem);
  line-height: 1.32;
  letter-spacing: .03em;
}
.hero .lede { margin: 0; font-size: 1.05rem; opacity: .9; }

/* ── 目錄 ─────────────────────────────── */

.toc {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 91%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.toc .wrap {
  display: flex; gap: .3rem;
  overflow-x: auto; scrollbar-width: none;
  padding-top: .5rem; padding-bottom: .5rem;
}
.toc .wrap::-webkit-scrollbar { display: none; }
.toc a {
  flex: none; padding: .3rem .75rem; border-radius: 99px;
  color: var(--muted); font-size: .85rem; text-decoration: none; white-space: nowrap;
}
.toc a:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--steam); }

/* ── 區塊 ─────────────────────────────── */

main { padding-bottom: 2rem; }
section { padding: 3.5rem 0 1.25rem; border-bottom: 1px solid var(--line); }
section:last-child { border-bottom: 0; }

h2 {
  margin: 0 0 1.5rem;
  font-size: 1.65rem;
  line-height: 1.45;
  color: var(--steam);
  position: relative;
  padding-left: .9rem;
}
h2::before {
  content: ""; position: absolute; left: 0; top: .35em;
  width: 4px; height: 1.05em; border-radius: 2px; background: var(--accent);
}

h3 { font-size: 1.1rem; margin: 0 0 .6rem; line-height: 1.6; }
h3.sub {
  margin: 2.5rem 0 .8rem;
  padding-bottom: .35rem;
  border-bottom: 1px dashed var(--line);
  color: var(--steam);
}

p { margin: 0 0 1.1rem; }
.note { color: var(--muted); font-size: .9rem; }
.big { font-size: 1.15rem; font-weight: 600; line-height: 1.85; }

.lead-out {
  border-left: 4px solid var(--gold);
  padding-left: 1rem;
  font-size: 1.02rem;
}

/* ── 框 ───────────────────────────────── */

.box, .warn {
  border-radius: var(--radius);
  padding: 1.2rem 1.35rem .5rem;
  margin: 1.6rem 0;
}
.box { background: var(--surface); border: 2px solid var(--line); }
.box p:first-child strong { color: var(--steam); }
.box.grow {
  border-color: color-mix(in srgb, var(--gold) 50%, transparent);
  background: color-mix(in srgb, var(--gold) 8%, var(--surface));
}
.box.grow p:first-child strong { color: var(--gold); }

.warn {
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
  border-left: 4px solid var(--danger);
}
.warn h3 { color: var(--danger); }

/* ── 步驟 ─────────────────────────────── */

.steps { list-style: none; counter-reset: s; padding: 0; margin: 0 0 1.5rem; }
.steps > li {
  counter-increment: s;
  position: relative;
  padding-left: 3rem;
  margin-bottom: 1.5rem;
}
.steps > li::before {
  content: counter(s);
  position: absolute; left: 0; top: .05em;
  width: 2rem; height: 2rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--steam-lt); color: #fff;
  font-size: .9rem; font-weight: 700;
}
.steps > li p:last-child { margin-bottom: 0; }
.steps.compact > li { margin-bottom: .7rem; padding-left: 2.6rem; }
.steps.compact > li::before { width: 1.7rem; height: 1.7rem; font-size: .8rem; top: .18em; }

/* ── 規格 ─────────────────────────────── */

.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: .6rem;
  margin: 1.5rem 0;
}
.spec {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: .8rem .5rem;
  text-align: center;
}
.spec .k { margin: 0 0 .1rem; font-size: .8rem; color: var(--muted); }
.spec .v { margin: 0; font-size: 1.05rem; font-weight: 800; color: var(--steam); }

/* ── 事實 ─────────────────────────────── */

.facts { list-style: none; padding: 0; margin: 0 0 1rem; }
.facts li {
  display: grid; grid-template-columns: 6.5rem 1fr; gap: .8rem;
  padding: .75rem 0; border-bottom: 1px dashed var(--line);
}
.facts li:last-child { border-bottom: 0; }
.facts .k { font-weight: 700; color: var(--steam); }

/* ── 表格 ─────────────────────────────── */

.tablewrap {
  overflow-x: auto;
  margin: 0 0 1.5rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: .94rem;
}

th, td {
  padding: .7rem .9rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

thead th {
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  color: var(--steam);
}

tbody th { font-weight: 700; color: var(--text); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }

tbody tr.light { background: color-mix(in srgb, var(--good) 6%, transparent); }
tbody tr.heavy { background: color-mix(in srgb, var(--danger) 6%, transparent); }

code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: .88em;
  padding: .1em .45em;
  background: color-mix(in srgb, var(--muted) 16%, transparent);
  border-radius: 5px;
}

/* ── 遊戲卡 ───────────────────────────── */

.games {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.game {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem 1rem;
}

.ghead h4 { margin: 0; font-size: 1.08rem; line-height: 1.5; color: var(--steam); }
.gzh { margin: 0 0 .7rem; font-size: .86rem; color: var(--muted); }

.gmeta { display: flex; align-items: center; gap: .5rem; margin-bottom: .7rem; }
.gprice {
  font-weight: 800; font-size: 1rem;
  color: var(--good);
  font-variant-numeric: tabular-nums;
}
.glang {
  padding: .05rem .55rem; border-radius: 99px;
  font-size: .74rem; font-weight: 700;
}
.glang.ok   { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.glang.mid  { background: color-mix(in srgb, var(--gold) 22%, transparent); color: var(--gold); }
.glang.none { background: color-mix(in srgb, var(--muted) 20%, transparent); color: var(--muted); }

.gtags { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .8rem; }
.gt {
  padding: .05rem .55rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: .74rem;
  color: var(--muted);
}

.gwhy { margin: 0 0 .7rem; font-size: .95rem; line-height: 1.85; }
.gwarn {
  margin: 0 0 1rem;
  padding: .6rem .8rem;
  background: color-mix(in srgb, var(--danger) 7%, transparent);
  border-radius: 8px;
  font-size: .88rem;
  line-height: 1.8;
  color: var(--muted);
}
.gwarn strong { color: var(--danger); }

.gbtn {
  margin-top: auto;
  display: block;
  padding: .5rem;
  border-radius: 8px;
  background: var(--steam-lt);
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 700;
}
.gbtn:hover { background: var(--steam); }

@media (prefers-color-scheme: dark) {
  .gbtn { background: #2a475e; }
  .gbtn:hover { background: #35597a; }
}

/* ── 對照 ─────────────────────────────── */

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.5rem 0; }
.side {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem .8rem;
}
.side.a { border-top: 6px solid var(--accent); }
.side.b { border-top: 6px solid var(--gold); }
.side h3 { color: var(--steam); font-size: 1.02rem; }
.side p { font-size: .95rem; }
.side .tag {
  display: inline-block;
  padding: .1rem .6rem; border-radius: 99px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--steam);
  font-size: .78rem; font-weight: 700;
  margin-bottom: .3rem;
}

/* ── 頁尾 ─────────────────────────────── */

footer {
  border-top: 1px solid var(--line);
  padding: 2.25rem 0;
  color: var(--muted);
  font-size: .87rem;
  line-height: 1.85;
  text-align: center;
}
footer p { margin: 0 0 .5rem; }
footer .small { font-size: .8rem; opacity: .8; }

a { color: var(--steam); }

/* ── 手機 ─────────────────────────────── */

@media (max-width: 34rem) {
  body { font-size: 16px; }
  .hero { padding: 3rem 0 2.5rem; }
  section { padding-top: 2.75rem; }
  .split { grid-template-columns: 1fr; }
  .facts li { grid-template-columns: 1fr; gap: .15rem; }
  .games { grid-template-columns: 1fr; }
}

/* ── 訪問計數器 ───────────────────────── */

footer .counter {
  display: inline-flex;
  align-items: center;
  margin-bottom: 1rem;
  padding: .35rem 1rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  font-size: .85rem;
}

footer .counter strong {
  color: var(--steam);
  font-variant-numeric: tabular-nums;
  margin: 0 .15rem;
}