/* ==========================================================================
   游戏隐私政策站点 —— 全站共用样式
   文件：privacy-site/assets/site.css
   说明：纯 CSS，无外部依赖；移动端优先；自动跟随系统深色模式。
   ========================================================================== */

/* ---------------------------- 1. 主题变量 ---------------------------- */
:root {
  --brand: #2a6fb0;
  --brand-2: #164a77;
  --brand-soft: #e8f2fc;
  --ink: #1c2834;
  --ink-soft: #566b7e;
  --bg: #f4f7fb;
  --card: #ffffff;
  --line: #e1e8f0;
  --note-bg: #eef6ff;
  --note-line: #2a6fb0;
  --ok-bg: #edfaf3;
  --ok-line: #1f9c67;
  --warn-bg: #fffbea;
  --warn-line: #dfa800;
  --warn-ink: #8a6100;
  --mark-bg: #ffe07a;
  --mark-ink: #7a4e00;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 42, 70, .05), 0 10px 28px -14px rgba(16, 42, 70, .22);
  --maxw: 860px;
}

/* 深色模式：只换颜色变量，布局完全复用 */
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #6cb2f2;
    --brand-2: #9ccdfb;
    --brand-soft: #12293a;
    --ink: #e7eef6;
    --ink-soft: #a0b2c4;
    --bg: #0d161f;
    --card: #151f2a;
    --line: #24313d;
    --note-bg: #102634;
    --note-line: #4f9fe0;
    --ok-bg: #0f2a20;
    --ok-line: #34b47c;
    --warn-bg: #2a230f;
    --warn-line: #c99a00;
    --warn-ink: #f2d27a;
    --mark-bg: #6b5410;
    --mark-ink: #ffe58f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 12px 32px -16px rgba(0, 0, 0, .75);
  }
}

/* ---------------------------- 2. 基础重置 ---------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* 跳转锚点时让出吸顶栏的高度 */
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a {
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
  word-break: break-word;
}
a:hover { border-bottom-color: var(--brand); }

/* ---------------------------- 3. 顶部导航 ---------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  color: var(--ink);
  border: 0;
  font-size: 15px;
  line-height: 1.3;
}
.brand:hover { border: 0; }
.brand svg { flex: 0 0 auto; display: block; }

.brand-sub {
  color: var(--ink-soft);
  font-weight: 400;
  font-size: 12.5px;
  display: block;
}

.topbar-doc {
  margin-left: auto;
  font-size: 13px;
  color: var(--ink-soft);
  border: 0;
  text-align: right;
}

/* ---------------------------- 4. 主体容器 ---------------------------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 18px 72px;
}

/* ---------------------------- 5. 标题区（Hero） ---------------------------- */
.hero {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 22px 22px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
/* 左上角一抹品牌色光晕 */
.hero::before {
  content: "";
  position: absolute;
  inset: -60% auto auto -20%;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 22%, transparent), transparent 68%);
  pointer-events: none;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(22px, 5.4vw, 30px);
  line-height: 1.35;
  letter-spacing: .01em;
  position: relative;
}

.hero .lede {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 14.5px;
  position: relative;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  position: relative;
}
.tag {
  font-size: 12.5px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 999px;
  padding: 3px 11px;
  line-height: 1.6;
  white-space: nowrap;
}

/* 更新日期 / 生效日期 / 版本 */
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 13.5px;
  color: var(--ink-soft);
  position: relative;
}
.meta b { color: var(--ink); font-weight: 600; }

/* ---------------------------- 6. 目录卡片 ---------------------------- */
.toc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px 22px;
  margin-bottom: 22px;
}
.toc h2 {
  margin: 0 0 4px;
  font-size: 16px;
  border: 0;
  padding: 0;
}
.toc h2::before { content: none; }
.toc > p {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--ink-soft);
}
.toc ol {
  list-style: none;
  counter-reset: toc;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 2px 18px;
}
.toc li { counter-increment: toc; }
.toc a {
  display: block;
  padding: 7px 4px 7px 0;
  font-size: 14.5px;
  border-bottom: 1px dashed var(--line);
  color: var(--ink);
}
.toc a::before {
  content: counter(toc) ". ";
  color: var(--brand);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.toc a:hover { color: var(--brand); border-bottom-color: var(--brand); }
/* 当前阅读位置的目录项高亮（由 site.js 维护 .is-active） */
.toc a.is-active { color: var(--brand); font-weight: 600; }

/* ---------------------------- 7. 正文卡片 ---------------------------- */
.doc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px 22px 30px;
}

/* 章节标题 */
.doc h2 {
  position: relative;
  margin: 40px 0 14px;
  padding: 0 0 0 14px;
  font-size: 19px;
  line-height: 1.5;
  border-left: 4px solid var(--brand);
  letter-spacing: .01em;
}
.doc h2:first-child { margin-top: 26px; }

.doc h3 {
  margin: 26px 0 8px;
  font-size: 16px;
  color: var(--brand-2);
  font-weight: 700;
}

.doc h4 {
  margin: 20px 0 6px;
  font-size: 15px;
  color: var(--ink);
}

.doc p { margin: 10px 0; }

.doc ul,
.doc ol { margin: 10px 0; padding-left: 22px; }
.doc li { margin: 6px 0; }
.doc li > ul,
.doc li > ol { margin: 6px 0; }

.doc strong { color: var(--ink); font-weight: 700; }

/* 行内代码：包名、文件路径等 */
.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .875em;
  background: var(--brand-soft);
  color: var(--brand-2);
  padding: 1px 5px;
  border-radius: 5px;
  word-break: break-all;
}

.doc hr {
  border: 0;
  border-top: 1px dashed var(--line);
  margin: 30px 0;
}

/* ---------------------------- 8. 提示块 ---------------------------- */
.callout {
  border-radius: 12px;
  padding: 14px 16px;
  margin: 18px 0;
  font-size: 14.5px;
  border-left: 4px solid var(--note-line);
  background: var(--note-bg);
}
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }
.callout .ct-title {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}

.callout.ok {
  border-left-color: var(--ok-line);
  background: var(--ok-bg);
}
.callout.warn {
  border-left-color: var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.callout.warn .ct-title { color: var(--warn-ink); }

/* 草稿提示条：正式发布前删掉这段 HTML 即可 */
.draft {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-radius: var(--radius);
  padding: 13px 16px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.7;
}
.draft svg { flex: 0 0 auto; margin-top: 2px; }
.draft b { color: var(--warn-ink); }

/* ---------------------------- 9. 待填写占位符 ---------------------------- */
/* 用 <span class="fill">【待填写：xxx】</span> 标记，页面上一眼就能找到 */
.fill {
  background: var(--mark-bg);
  color: var(--mark-ink);
  font-weight: 600;
  border-radius: 4px;
  padding: 0 4px;
  font-style: normal;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* ---------------------------- 10. 表格 ---------------------------- */
.tbl-wrap {
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 520px;
}

th,
td {
  padding: 10px 13px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
th:last-child,
td:last-child { border-right: 0; }
tr:last-child td { border-bottom: 0; }

thead th {
  background: var(--brand-soft);
  color: var(--brand-2);
  font-weight: 700;
  white-space: nowrap;
}

tbody tr:nth-child(even) { background: color-mix(in srgb, var(--line) 22%, transparent); }

td.nowrap { white-space: nowrap; }

/* ---------------------------- 11. 首页游戏卡片 ---------------------------- */
.game-list {
  display: grid;
  gap: 14px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.game-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
  color: inherit;
  border-bottom: 1px solid var(--line);
}
.game-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  box-shadow: 0 2px 4px rgba(16, 42, 70, .06), 0 16px 34px -16px rgba(16, 42, 70, .3);
}

.game-card .gc-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.game-card h3 {
  margin: 0;
  font-size: 17px;
  color: var(--ink);
}
.game-card .gc-more {
  margin-left: auto;
  font-size: 13px;
  color: var(--brand);
  white-space: nowrap;
}
.game-card p {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}
.game-card .gc-meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12.5px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.game-card .gc-meta code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--brand-soft);
  color: var(--brand-2);
  padding: 1px 6px;
  border-radius: 5px;
}

/* 首页说明块 */
.intro {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 22px;
}
.intro p { margin: 0 0 10px; font-size: 15px; }
.intro p:last-child { margin-bottom: 0; }
.intro ul { margin: 8px 0 0; padding-left: 20px; font-size: 14.5px; color: var(--ink-soft); }
.intro li { margin: 6px 0; }

/* ---------------------------- 12. 页脚 / 翻页 ---------------------------- */
.pager {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.pager a {
  flex: 1 1 200px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  box-shadow: var(--shadow);
}
.pager a:hover { border-color: var(--brand); }
.pager .pg-label {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
  border: 0;
}
.pager .pg-next { text-align: right; }

.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 8px 18px 56px;
  color: var(--ink-soft);
  font-size: 13px;
  text-align: center;
  line-height: 1.9;
}
.site-footer p { margin: 4px 0; }

/* ---------------------------- 13. 返回顶部 ---------------------------- */
.to-top {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 60;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--brand);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.to-top.is-on {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.to-top:hover { border-color: var(--brand); }
.to-top:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------------------------- 14. 无障碍 / 打印 ---------------------------- */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--card);
  padding: 10px 16px;
  z-index: 100;
  border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; border: 0; }

@media print {
  .topbar,
  .to-top,
  .toc,
  .pager,
  .draft { display: none !important; }
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
    line-height: 1.7;
  }
  .wrap { max-width: none; padding: 0; }
  .hero,
  .doc { border: 0; box-shadow: none; padding: 0; margin: 0; }
  .hero::before { display: none; }
  .doc h2 { page-break-after: avoid; border-left-color: #000; }
  .doc h3 { page-break-after: avoid; }
  table { font-size: 9.5pt; }
  th, td { border-color: #999; }
  thead th { background: #eee !important; color: #000; }
  .callout { border: 1px solid #999; border-left-width: 4px; background: #fafafa !important; }
  .fill { background: #ffe07a !important; color: #000 !important; }
  a { color: #000; border-bottom: 0; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
}

/* ---------------------------- 15. 窄屏微调 ---------------------------- */
@media (max-width: 480px) {
  body { font-size: 15.5px; line-height: 1.8; }
  .wrap { padding: 16px 13px 64px; }
  .hero { padding: 22px 17px 18px; }
  .doc { padding: 4px 17px 24px; }
  .toc { padding: 16px 17px 18px; }
  .toc ol { grid-template-columns: 1fr; }
  .doc h2 { font-size: 17.5px; margin-top: 34px; }
  .doc ul, .doc ol { padding-left: 19px; }
  .topbar-doc { display: none; }
  .to-top { right: 12px; bottom: 14px; }
}

/* 尊重减少动态效果偏好 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
