/* 像素戰機 · 政策頁面專用樣式
   沿用復古街機色票（米白紙 × 墨黑 × 信號紅），不載入遊戲外殼腳本。
   粗描邊、實色硬陰影、直角切角、等寬編號；無漸變、無發光、無模糊。 */
:root {
  --paper: #f3ead6;
  --cream: #fff8e9;
  --ink: #181410;
  --ink-2: #443a2e;
  --red: #e03427;
  --red-dark: #ab231b;
  --yellow: #f5b812;
  --line: #cdbb9c;
  --muted: #655847;
  --blush: #fbe3d7;
  --mono: "Courier New", ui-monospace, Consolas, monospace;
  --display: "Arial Black", "PingFang TC", "Microsoft JhengHei", "Microsoft YaHei", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(24, 20, 16, .11) 1px, transparent 1.3px);
  background-size: 8px 8px;
  color: var(--ink);
  font-family: "PingFang TC", "Microsoft JhengHei", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px; line-height: 1.8; text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.page { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- 機台銘牌頂欄 ---------- */
.top {
  position: relative; display: flex; align-items: center; gap: 20px;
  padding: calc(14px + var(--safe-top)) calc(24px + var(--safe-right)) 14px calc(24px + var(--safe-left));
  background: var(--ink); border-bottom: 4px solid var(--red); color: var(--cream);
}
.top::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 7px;
  background: repeating-linear-gradient(45deg, var(--red) 0 12px, var(--ink) 12px 24px);
}
.home {
  display: inline-flex; align-items: center; min-height: 34px; padding: 4px 12px;
  background: var(--red); border: 2px solid var(--cream); color: var(--cream);
  font: 700 11px var(--mono); letter-spacing: .08em; text-decoration: none;
  box-shadow: 3px 3px 0 var(--yellow);
}
.home:hover { background: var(--yellow); color: var(--ink); }
.brand { display: flex; flex-direction: column; line-height: 1.15; }
.brand b { font-family: var(--display); font-size: 18px; letter-spacing: .1em; }
.brand small { color: var(--yellow); font: 700 9px var(--mono); letter-spacing: .22em; }
.edition {
  margin-left: auto; color: var(--yellow);
  font: 700 10px var(--mono); letter-spacing: .18em; white-space: nowrap;
}

/* ---------- 頁面招牌 ---------- */
.wrap { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 32px 24px 48px; }
.banner {
  position: relative; margin-bottom: 26px; padding: 26px 28px 24px;
  background: var(--cream); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--red);
}
.banner::after {
  content: ''; position: absolute; top: -3px; right: -3px; width: 16px; height: 16px;
  background: var(--red); border-left: 3px solid var(--ink); border-bottom: 3px solid var(--ink);
}
.stamp {
  display: inline-block; padding: 4px 10px; background: var(--red); color: var(--cream);
  border: 2px solid var(--ink); font: 700 10px var(--mono); letter-spacing: .18em;
  transform: rotate(-2deg);
}
.banner h1 { font-family: var(--display); font-size: clamp(32px, 5vw, 52px); line-height: 1.15; margin: 16px 0 10px; }
.banner p { color: var(--muted); font-size: 13px; max-width: 72ch; }

/* ---------- 左側目錄 + 右側內文 ---------- */
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.side {
  position: sticky; top: 16px; padding: 12px;
  background: var(--ink); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--red);
}
.side b {
  display: block; margin: 4px 8px 10px; color: var(--yellow);
  font: 700 10px var(--mono); letter-spacing: .18em;
}
.side a {
  display: block; padding: 9px 10px; color: var(--cream);
  border-left: 4px solid transparent; font-size: 12px; font-weight: 700;
  letter-spacing: .04em; text-decoration: none;
}
.side a + a { border-top: 1px solid rgba(255, 248, 233, .18); }
.side a:hover { color: var(--yellow); }
.side a.active { background: var(--red); border-left-color: var(--yellow); }

.doc {
  padding: 26px 30px 30px; background: var(--cream);
  border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink);
}
.meta {
  padding-bottom: 12px; margin-bottom: 22px; border-bottom: 2px dashed var(--line);
  color: var(--red-dark); font: 700 10px var(--mono); letter-spacing: .1em; line-height: 1.8;
}
.meta .nowrap { white-space: nowrap; }
.doc section { margin-bottom: 24px; }
.doc section:last-of-type { margin-bottom: 16px; }
.doc h2 { font-family: var(--display); font-size: 18px; line-height: 1.4; margin-bottom: 8px; }
.doc h2::before {
  content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 10px;
  background: var(--red); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink);
  vertical-align: baseline;
}
.doc p, .doc li { font-size: 14px; line-height: 1.95; }
.doc ul { margin: 8px 0 0; padding-left: 22px; }
.doc li { margin-bottom: 4px; }
.doc p + p { margin-top: 8px; }
.doc strong { font-weight: 800; }
.doc a { color: var(--red-dark); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.doc a:hover { color: var(--red); }
.notice {
  margin-top: 12px; padding: 12px 14px; background: var(--blush);
  border: 2px solid var(--red); font-size: 13px; line-height: 1.8;
}
.closing {
  padding-top: 14px; margin-top: 6px; border-top: 2px dashed var(--line);
  color: var(--muted); font-size: 12px;
}
.contact-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding: 14px 16px; background: var(--ink); color: var(--cream);
  border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--red); margin: 12px 0 18px;
}
.contact-line b { font: 700 10px var(--mono); letter-spacing: .16em; color: var(--yellow); }
.contact-line a { color: var(--cream); font: 700 15px var(--mono); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- 索引頁卡片 ---------- */
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.info-card {
  display: block; padding: 16px 18px; background: var(--cream);
  border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); text-decoration: none;
  transition: transform .12s, box-shadow .12s;
}
.info-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--red); }
.info-card small { display: block; color: var(--red-dark); font: 700 10px var(--mono); letter-spacing: .16em; }
.info-card b { display: block; margin: 4px 0 6px; font-family: var(--display); font-size: 19px; }
.info-card span { color: var(--muted); font-size: 12px; line-height: 1.7; }

/* ---------- 頁尾 ---------- */
.foot {
  padding: 18px calc(24px + var(--safe-right)) calc(18px + var(--safe-bottom)) calc(24px + var(--safe-left));
  background: var(--ink); border-top: 4px solid var(--red); color: var(--cream);
  font: 10px var(--mono); letter-spacing: .08em;
}
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 10px; }
.foot a { text-decoration: none; border-bottom: 1px dotted var(--yellow); }
.foot a:hover { color: var(--yellow); }
.foot p { color: #d2c1a2; }

@media (max-width: 900px) {
  .top { flex-wrap: wrap; gap: 8px 12px; padding: calc(12px + var(--safe-top)) calc(14px + var(--safe-right)) 12px calc(14px + var(--safe-left)); }
  .brand b { font-size: 15px; }
  .edition { width: 100%; margin-left: 0; font-size: 9px; }
  .wrap { padding: 20px calc(14px + var(--safe-right)) calc(30px + var(--safe-bottom)) calc(14px + var(--safe-left)); }
  .banner { padding: 20px 18px; box-shadow: 4px 4px 0 var(--red); }
  .layout { grid-template-columns: 1fr; gap: 16px; }
  .side { position: static; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; box-shadow: 3px 3px 0 var(--red); }
  .side b { width: 100%; margin: 0 4px 2px; }
  .side a { flex: 1 1 44%; min-height: 38px; padding: 7px 8px; text-align: center; border: 1px solid rgba(255, 248, 233, .28); }
  .side a + a { border-top: 1px solid rgba(255, 248, 233, .28); }
  .side a.active { border: 1px solid var(--red); }
  .doc { padding: 18px 16px 22px; box-shadow: 4px 4px 0 var(--ink); }
  .doc p, .doc li { font-size: 14px; }
  .meta {
    display: flex; flex-wrap: wrap; gap: 0 12px;
    font-size: 9px; letter-spacing: .02em; line-height: 1.9;
  }
  .meta .sep { display: none; }
  .card-grid { grid-template-columns: 1fr; }
  .foot { padding: 16px calc(14px + var(--safe-right)) calc(16px + var(--safe-bottom)) calc(14px + var(--safe-left)); }
}
