/* =============================================================
   GameGuide 攻略本 —— 共享样式（零依赖）
   设计基调：白底 + 细边框 + 单一强调色，尽量少装饰
   每个游戏可在自己的页面里覆盖 --accent 做身份色
   ============================================================= */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #f1f3f7;
  --border: #e6e8ee;
  --border-strong: #d5d9e2;
  --text: #1f2430;
  --text-2: #59607a;
  --text-3: #8f95a5;
  --accent: #4f6ef7;
  --accent-text: #3a55d9;
  --accent-soft: rgba(79, 110, 247, .08);
  --ok: #128a55;
  --ok-soft: rgba(18, 138, 85, .10);
  --warn: #b07f1a;
  --warn-soft: rgba(176, 127, 26, .10);
  --danger: #c0392b;
  --danger-soft: rgba(192, 57, 43, .09);
  --radius: 10px;
  --radius-lg: 14px;
  --content-w: 860px;
  --topbar-h: 56px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181d;
    --surface: #1b1e25;
    --surface-2: #21242c;
    --surface-3: #272b34;
    --border: #2c303a;
    --border-strong: #3a3f4b;
    --text: #e6e8ee;
    --text-2: #a2a8b8;
    --text-3: #767d8e;
    --accent: #7d93ff;
    --accent-text: #a3b2ff;
    --accent-soft: rgba(125, 147, 255, .14);
    --ok: #4ec98d;
    --ok-soft: rgba(78, 201, 141, .14);
    --warn: #e0b45c;
    --warn-soft: rgba(224, 180, 92, .14);
    --danger: #ef7d6f;
    --danger-soft: rgba(239, 125, 111, .14);
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1180px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  font-weight: 650;
  font-size: 15px;
  letter-spacing: .2px;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand span.dot {
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
}
.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-3);
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.crumb a { color: var(--text-2); }
.crumb .sep { opacity: .5; }
.crumb .cur { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.search {
  width: 210px;
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 8px;
  outline: none;
  transition: border-color .15s, width .18s;
}
.search::placeholder { color: var(--text-3); }
.search:focus {
  width: 260px;
  background: var(--surface);
  border-color: var(--accent);
}
.search-stat {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  min-width: 52px;
}
@media (max-width: 720px) {
  .crumb { display: none; }
  .search { width: 120px; }
  .search:focus { width: 150px; }
}

/* ---------------- 布局 ---------------- */
.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 80px;
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}

/* ---------------- 目录 ---------------- */
.toc {
  position: sticky;
  top: calc(var(--topbar-h) + 24px);
  max-height: calc(100vh - var(--topbar-h) - 48px);
  overflow: auto;
  padding-right: 4px;
}
.toc-title {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 10px 10px;
}
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li a {
  display: block;
  padding: 5px 10px;
  font-size: 13px;
  color: var(--text-2);
  border-left: 2px solid var(--border);
  border-radius: 0 6px 6px 0;
  transition: color .15s, border-color .15s, background .15s;
}
.toc li a:hover { color: var(--text); text-decoration: none; background: var(--surface-2); }
.toc li a.active {
  color: var(--accent-text);
  border-left-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}
.toc li ol { padding-left: 12px; }
.toc li ol a { font-size: 12.5px; }
@media (max-width: 1000px) {
  .toc {
    position: static;
    max-height: none;
    padding: 12px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }
  .toc ol {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
  }
  .toc li a { border-left: none; padding: 2px 0; }
  .toc li a.active { background: none; border-left: none; }
  .toc li ol { display: none; }
}

/* ---------------- 正文 ---------------- */
.content { max-width: var(--content-w); min-width: 0; }
.content > section { margin-bottom: 44px; scroll-margin-top: calc(var(--topbar-h) + 20px); }

h1 {
  font-size: 28px;
  line-height: 1.35;
  letter-spacing: -.2px;
  margin: 0 0 12px;
}
h2 {
  font-size: 20px;
  line-height: 1.4;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -.1px;
}
h3 {
  font-size: 16px;
  margin: 26px 0 10px;
}
h4 {
  font-size: 14px;
  margin: 18px 0 8px;
  color: var(--text-2);
}
p { margin: 0 0 12px; }
ul, ol { margin: 0 0 12px; padding-left: 22px; }
li { margin: 4px 0; }
strong { font-weight: 650; color: var(--text); }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
  padding: 1px 5px;
  background: var(--surface-3);
  border-radius: 4px;
}
hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

/* 头部信息 */
.hero { margin-bottom: 32px; }
.hero .kicker {
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 8px;
}
.hero .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
  color: var(--text-3);
  margin-top: 14px;
}
.hero p.lead { color: var(--text-2); font-size: 15px; }

/* 卡片 */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin: 0 0 16px;
}
.card > :last-child { margin-bottom: 0; }
.card-title {
  font-size: 14px;
  font-weight: 650;
  margin: 0 0 10px;
}

/* 提示框 */
.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-3);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0 0 16px;
  font-size: 14px;
}
.callout > :last-child { margin-bottom: 0; }
.callout.warn { border-left-color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.callout.danger { border-left-color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.callout.tip { border-left-color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.callout .ct {
  display: block;
  font-weight: 650;
  font-size: 13px;
  margin-bottom: 4px;
}

/* 标签 */
.tag {
  display: inline-block;
  padding: 1px 8px;
  font-size: 12px;
  line-height: 1.7;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  white-space: nowrap;
  vertical-align: 1px;
}
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.now { background: var(--accent-soft); color: var(--accent-text); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.line { background: none; border: 1px solid var(--border-strong); color: var(--text-3); }

/* ---------------- 表格 ---------------- */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--surface-2);
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: center; white-space: nowrap; }
tbody tr.hide { display: none; }
mark {
  background: color-mix(in srgb, var(--accent) 26%, transparent);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

/* ---------------- 折叠块 ---------------- */
details.fold {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 0 0 10px;
  overflow: hidden;
}
details.fold > summary {
  cursor: pointer;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background .15s;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary:hover { background: var(--surface-2); }
details.fold > summary::before {
  content: "";
  width: 5px; height: 5px;
  border-right: 1.5px solid var(--text-3);
  border-bottom: 1.5px solid var(--text-3);
  transform: rotate(-45deg);
  transition: transform .18s;
  flex: 0 0 auto;
  margin-right: 2px;
}
details.fold[open] > summary::before { transform: rotate(45deg); }
details.fold > summary .st { margin-left: auto; font-weight: 500; }
details.fold .fold-body { padding: 2px 14px 14px; }
details.fold .fold-body > :last-child { margin-bottom: 0; }
details.fold[open] > summary { border-bottom: 1px solid var(--border); }

/* ---------------- 清单 ---------------- */
.checklist { list-style: none; padding: 0; margin: 0 0 12px; }
.checklist li {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 5px 0;
  border-bottom: 1px dashed var(--border);
  margin: 0;
}
.checklist li:last-child { border-bottom: none; }
.checklist input[type=checkbox] {
  margin: 6px 0 0;
  width: 15px; height: 15px;
  accent-color: var(--accent);
  flex: 0 0 auto;
  cursor: pointer;
}
.checklist label { cursor: pointer; flex: 1; }
.checklist li.done label { color: var(--text-3); text-decoration: line-through; }
.check-progress {
  font-size: 12px;
  color: var(--text-3);
  margin: 0 0 10px;
}
.reset-checks {
  font-size: 12px;
  color: var(--text-3);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
}
.reset-checks:hover { color: var(--text-2); }

/* ---------------- 首页 ---------------- */
.home {
  max-width: 860px;
  margin: 0 auto;
  padding: 56px 20px 80px;
}
.home h1 { font-size: 30px; margin-bottom: 10px; }
.home .lead { color: var(--text-2); font-size: 15px; max-width: 620px; }
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 34px;
}
.game-card {
  display: block;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  transition: border-color .16s, transform .16s, box-shadow .16s;
}
.game-card:hover {
  text-decoration: none;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px -12px rgba(0, 0, 0, .25);
}
.game-card .gc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.game-card .gc-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-text);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  flex: 0 0 auto;
}
.game-card .gc-name { font-weight: 650; font-size: 15px; line-height: 1.4; }
.game-card .gc-platform { font-size: 12px; color: var(--text-3); }
.game-card .gc-desc { font-size: 13.5px; color: var(--text-2); margin: 0; }
.game-card .gc-guides { font-size: 12.5px; color: var(--text-3); margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--border); }
.game-card.gc-empty { border-style: dashed; }
.game-card.gc-empty:hover { transform: none; box-shadow: none; border-color: var(--border-strong); }

/* ---------------- 页脚 / 回到顶部 ---------------- */
.footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 20px 40px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-3);
}
.totop {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 15px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  box-shadow: 0 4px 14px -8px rgba(0, 0, 0, .3);
}
.totop.show { opacity: 1; pointer-events: auto; }
.totop:hover { transform: translateY(-2px); color: var(--accent-text); }

/* ---------------- 打印 ---------------- */
@media print {
  .topbar, .toc, .totop, .footer { display: none !important; }
  .layout { display: block; padding: 0; }
  .content { max-width: none; }
  details.fold { break-inside: avoid; }
  details.fold:not([open]) .fold-body { display: block !important; }
  .card, .table-wrap { break-inside: avoid; }
  body { font-size: 12px; }
}
