/* 層級靠細線、留白與字級建立。全站只有一個關鍵路徑色：--accent。 */
:root {
  --paper: #f8f4ea;
  --panel: #f1ebdd;
  --ink: #211c15;
  --ink-2: #574d3f;
  --ink-3: #6f6454;
  --line: #ddd3c0;
  --line-2: #b9ad98;
  --accent: #9c3a10;
  --sans: "Noto Sans TC", "Noto Sans CJK TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --serif: "Noto Serif TC", "Noto Serif CJK TC", "Songti TC", "PMingLiU", serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Noto Sans Mono CJK TC", monospace;
  --col: 640px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17140f;
    --panel: #211c15;
    --ink: #ece4d4;
    --ink-2: #bdb2a0;
    --ink-3: #a09484;
    --line: #352e24;
    --line-2: #554b3c;
    --accent: #e8935a;
  }
}

* { box-sizing: border-box; }

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 1rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.9;
  letter-spacing: .01em;
  overflow-wrap: anywhere;
}

.wrap {
  max-width: 66rem;
  margin: 0 auto;
  padding: 0 1rem;
}

a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip {
  position: absolute;
  left: -999px;
  background: var(--paper);
  padding: .3rem .6rem;
}
.skip:focus { left: 1rem; top: .5rem; z-index: 1; }

/* 頁首 */
.site-head { border-bottom: 1px solid var(--line-2); }
.site-head .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .4rem 1.75rem;
  padding-top: .85rem;
  padding-bottom: .85rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
}
.ankh { width: .95rem; height: 1.27rem; color: var(--accent); flex: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: .1rem 1.15rem; font-size: .95rem; }
.site-nav a {
  color: var(--ink-2);
  text-decoration: none;
  padding: .1rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--line-2); }
.site-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* 標題與內文 */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.45; }
h1 { font-size: 2.3rem; margin: 0; letter-spacing: .02em; }
h2 {
  font-size: 1.55rem;
  margin: 4.25rem 0 1.25rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--line-2);
}
h3 { font-size: 1.2rem; margin: 2.75rem 0 .75rem; }
p { margin: 0 0 2rem; }
ul, ol { margin: 0 0 2rem; padding-left: 1.3rem; }
li { margin-bottom: .55rem; }
li > ul, li > ol { margin: .55rem 0 0; }
code {
  font-family: var(--mono);
  font-size: .88em;
  margin: 0 .12em;
  overflow-wrap: anywhere;
}
blockquote {
  margin: 0 0 2rem;
  padding: 1rem 0 1rem 1.25rem;
  color: var(--ink-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
blockquote p:last-child { margin-bottom: 0; }

.article > * { max-width: var(--col); }
.page-head {
  padding: 3rem 0 1.5rem;
  margin-bottom: 2.25rem;
  border-bottom: 2px solid var(--ink);
  max-width: none;
}
.sub { margin: .35rem 0 0; color: var(--ink-3); font-size: .95rem; }
.lead { font-size: 1.12rem; line-height: 1.95; }
.source { font-size: .86rem; color: var(--ink-3); line-height: 1.8; }

/* 圖片：截圖都是像素畫，桌面維持銳利；手機寬度下非整數縮放才改回平滑。 */
.fig { margin: 0 0 2.5rem; }
.fig a { display: block; line-height: 0; }
.fig img { display: block; max-width: 100%; height: auto; image-rendering: pixelated; background: #000; }
.fig.smooth img { image-rendering: auto; }
.fig figcaption {
  margin-top: .65rem;
  color: var(--ink-2);
  font-size: .9rem;
  line-height: 1.8;
}
.fig figcaption code { font-size: .86em; }

@media (min-width: 1020px) {
  .article > .fig {
    display: grid;
    grid-template-columns: var(--col) minmax(0, 1fr);
    column-gap: 1.75rem;
    max-width: none;
    align-items: start;
  }
  .article > .fig img { width: var(--col); }
  .article > .fig.natural img { width: auto; }
  .article > .fig figcaption {
    margin-top: 0;
    padding-top: .6rem;
    border-top: 1px solid var(--line-2);
  }
}

@media (max-width: 700px) {
  .fig img { image-rendering: auto; }
}

/* 同一畫面的不同模式才並排，用來比較。 */
.compare { max-width: none !important; display: flex; flex-wrap: wrap; gap: 1.25rem 1rem; margin-bottom: 2.5rem; }
.compare .fig { margin: 0; width: 320px; max-width: 100%; }
.compare .fig img { width: 320px; image-rendering: auto; }
.compare .fig figcaption { margin-top: .4rem; font-size: .85rem; }

/* 表格：只用細線 */
.table-wrap { max-width: none !important; overflow-x: auto; margin: 0 0 2.5rem; }
table { border-collapse: collapse; min-width: 100%; font-size: .92rem; line-height: 1.75; }
th {
  color: var(--ink-3);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-align: left;
  vertical-align: bottom;
  padding: .55rem 1.1rem .55rem 0;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
td {
  padding: .75rem 1.1rem .75rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
td:last-child, th:last-child { padding-right: 0; }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
td.nowrap { white-space: nowrap; }

.get { padding-left: 0; list-style: none; }
.get li { padding: .5rem 0; margin: 0; border-bottom: 1px solid var(--line); }
.get li:first-child { border-top: 1px solid var(--line); }

/* 首頁 */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--col);
  gap: 2.25rem;
  align-items: end;
  padding: 3rem 0 2.75rem;
  border-bottom: 2px solid var(--ink);
}
.hero h1 { font-size: 2.55rem; line-height: 1.38; }
.hero p { margin: 1.25rem 0 0; }
.hero .fig { margin: 0; }
.hero .fig img { width: var(--col); }
.hero .fig figcaption { font-size: .85rem; }

.home h2 { margin-top: 3.75rem; }
.home section > p, .home section > .source { max-width: var(--col); }

.games { list-style: none; margin: 0; padding: 0; }
.game {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr) 320px;
  gap: 1.75rem;
  padding: 2rem 0;
  margin: 0;
  border-top: 1px solid var(--line);
}
.game:first-child { border-top: 0; padding-top: .5rem; }
.game .numeral {
  font-family: var(--serif);
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink-3);
}
.game h3 { margin: 0 0 .15rem; font-size: 1.3rem; }
.game h3 a { color: var(--ink); text-decoration: none; }
.game h3 a:hover { color: var(--accent); text-decoration: underline; }
.game .year { margin: 0 0 .8rem; font-size: .88rem; color: var(--ink-3); }
.game .blurb { margin: 0 0 .8rem; }
.game .state { margin: 0; font-size: .9rem; color: var(--ink-2); }
.game .fig { margin: 0; }
.game .fig img { width: 320px; image-rendering: auto; }

.family {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}
.family .fig { margin: 0; }
.family .fig img { width: 300px; image-rendering: auto; }
.family blockquote { max-width: var(--col); border: 0; padding: 0; font-family: var(--serif); font-size: 1.15rem; color: var(--ink); }

/* 上一篇、下一篇與頁尾 */
.pager {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: none !important;
  margin-top: 4.5rem;
  padding-top: 1.1rem;
  border-top: 2px solid var(--ink);
}
.pager a { display: block; text-decoration: none; line-height: 1.6; }
.pager a:hover { text-decoration: underline; }
.pager span { display: block; color: var(--ink-3); font-size: .82rem; }
.pager .next { text-align: right; margin-left: auto; }

.site-foot { margin-top: 5rem; border-top: 1px solid var(--line-2); color: var(--ink-3); font-size: .85rem; line-height: 1.8; }
.site-foot .wrap { padding-top: 1.5rem; padding-bottom: 2.5rem; }
.site-foot p { margin: 0 0 .5rem; max-width: var(--col); }

@media (max-width: 1100px) {
  .hero { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .hero .fig img { width: 100%; max-width: var(--col); }
}

@media (max-width: 860px) {
  .game { grid-template-columns: 3.25rem minmax(0, 1fr); gap: .9rem 1rem; }
  .game .numeral { font-size: 1.6rem; }
  .game .fig { grid-column: 2; }
}

@media (max-width: 700px) {
  html { font-size: 16px; }
  h1 { font-size: 1.95rem; }
  .hero h1 { font-size: 2.05rem; }
  .page-head, .hero { padding-top: 2rem; }
  .family { grid-template-columns: minmax(0, 1fr); }
  .family .fig img { width: 100%; max-width: 300px; }
  .compare .fig, .compare .fig img { width: 100%; }
}

@media print {
  .site-head, .pager, .skip { display: none; }
  body { background: #fff; color: #000; }
}

/* 欄位多的表格在窄螢幕改橫向捲動，避免逐字換行。 */
@media (max-width: 760px) {
  table:has(th:nth-child(3)) { min-width: 32rem; }
  table:has(th:nth-child(4)) { min-width: 42rem; }
}

/* 四種模式排成一列。 */
@media (min-width: 1020px) {
  .compare.four .fig, .compare.four .fig img { width: 255px; }
}

/* 全家福：照片本身不是像素比例截圖，固定顯示尺寸。 */
.fig.portrait img, .article > .fig.portrait img { width: 360px; max-width: 100%; }
