/* 隱私權政策、使用條款、廣告贊助頁共用的樣式（public/privacy.html、terms.html、sponsor.html）
   跟遊戲一樣的深色配色；不載入外部字型或程式；手機 375 px 寬也不能左右捲動 */
:root {
  color-scheme: dark;
  --bg: #111a26;
  --panel: #172334;
  --panel-2: #1c2a3d;
  --line: rgba(255, 255, 255, 0.12);
  --text: #eef3f8;
  --muted: #a3b1c2;
  --accent: #ffd54a;
  --link: #8cc4ff;
  --me: #4b9bff;
  --good: #3ccf7a;
  --warn: #ff8a7a;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 100px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  font-size: 16px;
  line-height: 1.75;
  overflow-wrap: break-word;
}

a {
  color: var(--link);
  text-underline-offset: 2px;
}
a:hover {
  color: #b9dbff;
}

/* ---------- 上方列：遊戲名稱＋三頁的切換 ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand {
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.5px;
  text-decoration: none;
  white-space: nowrap;
}
.brand span {
  color: var(--accent);
}
.top nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  font-size: 14px;
}
.top nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 4px 0;
}
.top nav a[aria-current='page'] {
  color: var(--accent);
  font-weight: 700;
}

/* ---------- 內文 ---------- */
main {
  max-width: 780px;
  margin: 0 auto;
  padding: 20px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left));
}
h1 {
  margin: 10px 0 4px;
  font-size: 28px;
  line-height: 1.3;
}
h2 {
  margin: 40px 0 10px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 20px;
  line-height: 1.4;
}
h3 {
  margin: 22px 0 6px;
  font-size: 16px;
}
p,
ul,
ol {
  margin: 8px 0 12px;
}
ul,
ol {
  padding-left: 1.4em;
}
li {
  margin: 4px 0;
}
li::marker {
  color: var(--muted);
}
b,
strong {
  color: #fff;
}
.meta {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}
.lead {
  font-size: 17px;
}
.muted,
.note {
  color: var(--muted);
}
.note {
  font-size: 14px;
}
code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
  font-size: 0.88em;
  overflow-wrap: anywhere;
}
.mail {
  overflow-wrap: anywhere;
}

/* 重點摘要、聯絡方塊 */
.card {
  margin: 16px 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.card > :first-child {
  margin-top: 0;
}
.card > :last-child {
  margin-bottom: 0;
}
.card.key {
  border-color: rgba(255, 213, 74, 0.45);
}
.card h2,
.card h3 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

/* 目錄 */
.toc {
  margin: 16px 0;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  font-size: 15px;
}
.toc summary {
  cursor: pointer;
  font-weight: 700;
}
.toc ol {
  margin: 8px 0 4px;
  columns: 2 220px;
  column-gap: 24px;
}
.toc li {
  margin: 2px 0;
  break-inside: avoid;
}

/* ---------- 表格：寬螢幕是一般表格，手機上每一列變成一張卡片 ---------- */
.table-wrap {
  margin: 12px 0 16px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.6;
}
caption {
  padding: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}
th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
thead th {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  background: var(--panel);
}
tbody th {
  font-weight: 700;
}
/* 欄寬（寬螢幕）：資料表 4 欄、版位表 5 欄 */
@media (min-width: 681px) {
  table.stack {
    table-layout: fixed;
  }
  table.cols-data thead th:nth-child(1) {
    width: 32%;
  }
  table.cols-data thead th:nth-child(2) {
    width: 26%;
  }
  table.cols-data thead th:nth-child(3) {
    width: 24%;
  }
  table.cols-data thead th:nth-child(4) {
    width: 18%;
  }
  table.cols-slots thead th:nth-child(1) {
    width: 19%;
  }
  table.cols-slots thead th:nth-child(2) {
    width: 21%;
  }
  table.cols-slots thead th:nth-child(3) {
    width: 9%;
  }
  table.cols-slots thead th:nth-child(4) {
    width: 13%;
  }
  table.cols-slots thead th:nth-child(5) {
    width: 38%;
  }
}
@media (max-width: 680px) {
  table.stack thead {
    display: none;
  }
  table.stack,
  table.stack tbody,
  table.stack tr,
  table.stack th,
  table.stack td {
    display: block;
    width: 100%;
  }
  table.stack tr {
    margin: 0 0 12px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
  }
  table.stack th,
  table.stack td {
    padding: 4px 0;
    border: 0;
  }
  table.stack tbody th {
    padding: 2px 0 6px;
    font-size: 15px;
  }
  table.stack td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
  }
}

/* ---------- 廣告贊助頁 ---------- */
.hero {
  margin: 8px 0 20px;
  padding: 20px;
  border: 1px solid rgba(255, 213, 74, 0.35);
  border-radius: 18px;
  background: linear-gradient(160deg, #1d3047, #131d2b 70%);
}
.hero h1 {
  margin-top: 0;
}
.hero p {
  margin-bottom: 0;
}
.cta {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--accent);
  color: #1a1a1a;
  font-weight: 800;
  text-decoration: none;
}
.cta:hover {
  color: #1a1a1a;
  filter: brightness(1.06);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.grid .card {
  margin: 0;
}
.grid .card h3 {
  margin-bottom: 4px;
}
.figure {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  text-align: center;
}
.figure svg {
  display: block;
  width: 100%;
  max-width: 340px;
  height: auto;
  margin: 0 auto;
}
.figure figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}
.legend li {
  margin: 0;
}
.sw {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border-radius: 3px;
  vertical-align: -1px;
}
.sw.best,
.cv-board.best {
  background: var(--accent);
  fill: #ffd54a;
}
.sw.mid,
.cv-board.mid {
  background: var(--me);
  fill: #4b9bff;
}
.sw.low,
.cv-board.low {
  background: #6d7a8a;
  fill: #6d7a8a;
}
.cv-ground {
  fill: #1f3a2e;
}
.cv-court {
  fill: #2c6b4c;
  stroke: #e8eef5;
  stroke-width: 1.2;
}
.cv-line {
  stroke: #e8eef5;
  stroke-width: 0.8;
  fill: none;
}
.cv-net {
  stroke: #ffffff;
  stroke-width: 2;
  stroke-dasharray: 3 2;
}
.cv-label {
  fill: #dbe5ef;
  font-size: 10.5px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.cv-cam {
  fill: #a3b1c2;
  font-size: 11px;
}
.cv-arrow {
  fill: #a3b1c2;
}
.steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}
.steps li {
  counter-increment: step;
  position: relative;
  margin: 10px 0;
  padding-left: 40px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--accent);
  font-weight: 800;
  line-height: 26px;
  text-align: center;
}
.no {
  color: var(--warn);
}

/* ---------- 頁尾 ---------- */
.foot {
  max-width: 780px;
  margin: 0 auto;
  padding: 18px max(16px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-bottom: 6px;
}
.foot p {
  margin: 4px 0;
}

/* 英文摘要 */
.en {
  margin-top: 40px;
}
.en h2 {
  margin-top: 0;
}
