/* 动动星球官网 · 法律文件页。配色沿用首页的软陶星夜：深蓝夜空做底，奶油色纸张承载正文。
   页面由 scripts/website/build_legal.py 生成。 */

:root {
  --night-950: #071226;
  --night-900: #0b1a33;
  --night-800: #12264a;
  --cream: #fff8ec;
  --cream-300: #eadcc4;
  --ink: #142433;
  --ink-2: #4f6370;
  --ink-3: #8a9aa3;
  --muted: #9fb2c9;
  --go: #1fa463;
  --go-lip: #12774a;
  --energy: #ffcc33;
  --line: rgba(20, 36, 51, .1);
  --body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --bar-h: 68px;
}

* { box-sizing: border-box; }
html { background: var(--night-950); scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(46, 196, 182, .12), transparent 60%),
              radial-gradient(900px 500px at 0% 0%, rgba(156, 123, 242, .12), transparent 60%),
              var(--night-950);
}
a { color: inherit; }

/* 顶栏 */
.bar {
  position: sticky; top: 0; z-index: 10;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(7, 18, 38, .82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(182, 211, 242, .12);
}
.bar-inner { max-width: 1180px; height: var(--bar-h); margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); display: flex; align-items: center; justify-content: space-between; }
.brand img { display: block; width: 112px; height: auto; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .45)); }
.back {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; text-decoration: none;
  background: rgba(255, 248, 236, .08); box-shadow: inset 0 0 0 1.5px rgba(255, 248, 236, .3);
  transition: background-color .2s ease;
}
.back::before { content: "‹"; margin-right: 6px; font-size: 20px; line-height: 1; }
.back:hover { background: rgba(255, 248, 236, .16); }

.page { max-width: 1180px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px) 64px; }

/* 文件切换 */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 24px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: none; padding: 9px 16px; border-radius: 999px; font-size: 14px; text-decoration: none; color: var(--muted);
  box-shadow: inset 0 0 0 1.5px rgba(182, 211, 242, .18); transition: color .2s ease, background-color .2s ease;
}
.tabs a:hover { color: var(--cream); }
.tabs a[aria-current="page"] { color: #fff; font-weight: 600; background: var(--go); box-shadow: 0 3px 0 var(--go-lip); }

.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start; }

/* 目录 */
.toc { position: sticky; top: calc(var(--bar-h) + 24px); max-height: calc(100vh - var(--bar-h) - 48px); overflow-y: auto; padding-right: 4px; }
.toc-title { margin: 4px 0 12px; font-size: 13px; letter-spacing: .1em; color: var(--energy); }
.toc ol, .toc-mobile ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 7px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.5; color: var(--muted); text-decoration: none; transition: color .2s ease, background-color .2s ease; }
.toc a:hover { color: var(--cream); background: rgba(255, 248, 236, .06); }

/* 正文纸张 */
.doc {
  min-width: 0; padding: clamp(24px, 5vw, 56px); border-radius: 28px;
  background: var(--cream); color: var(--ink); box-shadow: 0 6px 0 var(--cream-300), 0 24px 60px rgba(0, 0, 0, .35);
  font-size: 15.5px; line-height: 1.9;
}
.doc-head { padding-bottom: 20px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.doc h1 { margin: 0 0 14px; font-size: clamp(24px, 3.4vw, 32px); line-height: 1.35; }
.doc .meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-3); }
.doc h2 { margin: 40px 0 12px; font-size: 21px; line-height: 1.45; }
.doc h3 { margin: 28px 0 8px; font-size: 17px; line-height: 1.5; }
.doc p { margin: 0 0 14px; color: var(--ink-2); }
.doc ul, .doc ol { margin: 0 0 16px; padding-left: 1.5em; color: var(--ink-2); }
.doc li { margin: 4px 0; }
.doc li::marker { color: var(--go); }
.doc strong { color: var(--ink); font-weight: 650; }
.doc a { color: var(--go-lip); text-underline-offset: 3px; }
.doc code { padding: 1px 6px; border-radius: 6px; font-size: .9em; background: rgba(20, 36, 51, .06); }
.doc blockquote { margin: 0 0 16px; padding: 12px 18px; border-radius: 14px; background: rgba(255, 204, 51, .16); }
.doc blockquote p { margin: 0; }

.table { overflow-x: auto; margin: 4px 0 20px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.doc table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14px; line-height: 1.7; }
.doc th, .doc td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.doc th { background: rgba(20, 36, 51, .05); color: var(--ink); font-weight: 650; white-space: nowrap; }
.doc td { color: var(--ink-2); }
.doc tr:last-child td { border-bottom: 0; }

/* 窄屏目录：折叠在标题下方 */
.toc-mobile { display: none; margin: 16px 0 8px; border-radius: 14px; background: rgba(20, 36, 51, .05); }
.toc-mobile summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style: none; }
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary::after { content: "+"; float: right; color: var(--go); font-weight: 700; }
.toc-mobile[open] summary::after { content: "−"; }
.toc-mobile ol { padding: 0 8px 10px; }
.toc-mobile a { display: block; padding: 6px 8px; font-size: 14px; color: var(--ink-2); text-decoration: none; }

/* 页脚 */
.foot { max-width: 1180px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px) calc(40px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid rgba(182, 211, 242, .12); display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot a { text-decoration: none; }
.foot a:hover, .foot a[aria-current="page"] { color: var(--cream); }
.foot p { margin: 0; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .toc { display: none; }
  .toc-mobile { display: block; }
}
@media (max-width: 560px) {
  .page { padding-top: 18px; }
  .doc { border-radius: 22px; font-size: 15px; }
  .doc h2 { font-size: 19px; margin-top: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
