/* 独立静态页样式：协议页（legal.html）与举报页（report.html）。
   这两页脱离 SPA，不加载 css/style.css，所以这里保留一份与官网公开页同源的
   配色 token 与 .site-header 导航样式副本——官网那套在 css/style.css 的
   :root / html.light、.seo-static-page 与 .site-header 三段。改官网那边时这里要
   一起改，否则协议页会重新退化成"另一个产品"的观感（此前它是米色纸 + 橙色强调
   的独立体系，且不跟随明暗主题）。 */

:root {
  color-scheme: dark;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --brand-ring: rgba(108, 99, 241, .55);
  --brand-ring-bg: rgba(99, 102, 241, .10);
  /* 页面色板取自 style.css 的 html:not(.light) .seo-static-page */
  --paper: #11131a;
  --ink: #f2efe9;
  --muted: #aaa9b4;
  --line: rgba(238, 235, 229, .14);
  --accent: #8a86ff;
  --accent-soft: rgba(138, 134, 255, .12);
  --surface: rgba(242, 239, 233, .04);
  --page-bg:
    radial-gradient(circle at 12% 0%, rgba(91, 87, 231, .2), transparent 35rem),
    linear-gradient(180deg, #151823, var(--paper));
}

html.light {
  color-scheme: light;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --brand-ring: rgba(99, 102, 241, .34);
  --brand-ring-bg: rgba(99, 102, 241, .07);
  /* 页面色板取自 style.css 的 .seo-static-page */
  --paper: #f5f1e9;
  --ink: #17191f;
  --muted: #696a73;
  --line: rgba(23, 25, 31, .14);
  --accent: #5b57e7;
  --accent-soft: rgba(91, 87, 231, .08);
  --surface: rgba(255, 253, 247, .74);
  --page-bg:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 35rem),
    linear-gradient(180deg, #faf8f3 0%, var(--paper) 58%, #e9e2d7 100%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page-bg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', 'PingFang SC', sans-serif;
  line-height: 1.85;
}

a { color: inherit; text-underline-offset: .22em; }

/* ===== 公开页面统一导航（与 components/site-header.js 同构的静态副本） ===== */
.site-header {
  --sh-bg: color-mix(in srgb, var(--paper) 84%, transparent);
  --sh-text: var(--ink);
  --sh-muted: var(--muted);
  --sh-line: var(--line);
  --sh-accent: var(--accent);
  position: sticky;
  z-index: 80;
  top: 0;
  width: 100%;
  min-height: 64px;
  border-bottom: 1px solid var(--sh-line);
  background: var(--sh-bg);
  backdrop-filter: blur(20px) saturate(135%);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
}
.site-header-inner {
  display: grid;
  width: min(100%, 1320px);
  min-height: inherit;
  margin: 0 auto;
  padding: 0 24px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.site-header-brand { display: inline-flex; width: max-content; align-items: center; gap: 10px; color: var(--sh-text); text-decoration: none; }
.site-header-brand img { width: 30px; height: 30px; border: 1px solid var(--brand-ring); border-radius: 11px; background: var(--brand-ring-bg); object-fit: contain; }
.site-header-brand span { display: flex; align-items: baseline; gap: 7px; }
.site-header-brand strong { font-size: 15px; letter-spacing: .04em; }
.site-header-brand small { color: var(--sh-muted); font: 500 9px/1 ui-monospace, monospace; letter-spacing: .16em; text-transform: uppercase; }
.site-header-nav { display: flex; align-items: center; gap: 30px; }
.site-header-nav a { position: relative; color: var(--sh-muted); text-decoration: none; font-size: 13px; white-space: nowrap; }
.site-header-nav a::after { content: ''; position: absolute; left: 0; right: 100%; bottom: -8px; height: 2px; border-radius: 2px; background: var(--sh-accent); transition: right .2s ease; }
.site-header-nav a:hover,
.site-header-nav a.active { color: var(--sh-text); }
.site-header-nav a:hover::after,
.site-header-nav a.active::after { right: 0; }
.site-header-actions { display: flex; justify-self: end; align-items: center; gap: 8px; }
.site-header-icon { display: grid; width: 34px; height: 34px; padding: 0; place-items: center; border: 1px solid transparent; border-radius: 999px; color: var(--sh-muted); background: transparent; cursor: pointer; text-decoration: none; }
.site-header-icon:hover { border-color: var(--sh-line); color: var(--sh-text); }
.site-header-icon svg { grid-area: 1 / 1; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.site-header-icon svg.icon-github-mark { fill: currentColor; stroke: none; }
.site-header-cta { padding: 8px 14px; border-radius: 999px; color: #fff !important; background: var(--primary); text-decoration: none; font-size: 12px; font-weight: 600; white-space: nowrap; }
.site-header-cta:hover { background: var(--primary-hover); }
.site-header-nav a:focus-visible,
.site-header-brand:focus-visible,
.site-header-icon:focus-visible,
.site-header-cta:focus-visible { outline: 2px solid var(--sh-accent); outline-offset: 3px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html.light .theme-toggle .icon-sun { display: block; }
html.light .theme-toggle .icon-moon { display: none; }

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.legal-hero {
  position: relative;
  min-height: 480px;
  padding: clamp(80px, 11vw, 130px) 0 70px;
  border-bottom: 1px solid var(--line);
}

.legal-hero::after {
  position: absolute;
  right: 2%;
  bottom: 52px;
  width: clamp(150px, 22vw, 280px);
  height: clamp(150px, 22vw, 280px);
  border: 1px solid var(--accent);
  border-radius: 50%;
  opacity: .35;
  content: "";
}

.legal-eyebrow {
  margin: 0 0 34px;
  color: var(--accent);
  font: 650 10px/1.4 ui-monospace, monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(52px, 7vw, 88px);
  font-weight: 700;
  letter-spacing: -.055em;
  line-height: 1.08;
}

.legal-lead {
  max-width: 700px;
  margin: 40px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
}

.legal-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  max-width: 780px;
  margin: 54px 0 0;
}

.legal-meta div {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.legal-meta dt {
  color: var(--muted);
  font: 600 10px/1.4 ui-monospace, monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.legal-meta dd {
  margin: 6px 0 0;
  font-size: 15px;
}

.legal-meta a { color: var(--accent); text-decoration: none; }

.legal-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 760px);
  gap: clamp(42px, 8vw, 110px);
  justify-content: center;
  padding: 76px 0 120px;
}

aside {
  position: sticky;
  top: 100px;
  height: max-content;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  font-size: 13px;
}

aside p {
  margin: 0 0 16px;
  color: var(--muted);
  font: 600 10px/1.4 ui-monospace, monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
}

aside a {
  display: block;
  margin: 9px 0;
  color: var(--muted);
  text-decoration: none;
}

aside a:hover { color: var(--ink); }

.legal-section {
  position: relative;
  margin-bottom: 96px;
  scroll-margin-top: 100px;
}

.legal-index {
  position: absolute;
  top: 10px;
  left: -62px;
  color: var(--accent);
  font: 650 11px/1 ui-monospace, monospace;
}

h2 {
  margin: 0 0 34px;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.15;
}

h3 {
  margin: 38px 0 10px;
  color: var(--ink);
  font-size: 18px;
}

.legal-section p,
.legal-section li {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
}

.legal-section strong { color: var(--ink); }
.legal-section a { color: var(--accent); }

.legal-section ul { padding-left: 1.2em; }

.legal-section li {
  margin: 8px 0;
  padding-left: .35em;
}

.legal-section-accent {
  margin-right: -34px;
  margin-left: -34px;
  padding: 42px 34px 50px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.legal-callout {
  margin: 0 0 34px;
  padding: 22px 24px;
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
}

.legal-callout strong {
  color: var(--accent);
  font: 650 10px/1.4 ui-monospace, monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.legal-callout p { margin: 6px 0 0; }

/* 页脚与官网公开页 .seo-static-footer 同构 */
footer {
  display: flex;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 48px;
  align-items: center;
  gap: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

footer strong { color: var(--ink); font-size: 13px; }
footer a { margin-left: auto; color: var(--accent); text-decoration: none; }

@media (max-width: 720px) {
  .site-header { min-height: 84px; }
  .site-header-inner { padding: 0 14px 6px; grid-template-columns: auto 1fr auto; grid-template-rows: 50px 28px; gap: 0 10px; }
  .site-header-brand { grid-column: 1; grid-row: 1; }
  .site-header-brand small { display: none; }
  .site-header-nav { grid-column: 1 / -1; grid-row: 2; width: 100%; justify-content: space-between; gap: 12px; overflow: visible; }
  .site-header-nav a { font-size: 12px; }
  .site-header-actions { grid-column: 3; grid-row: 1; gap: 4px; }
  .site-header-icon { width: 30px; height: 30px; }
  .site-header-cta { padding: 6px 10px; font-size: 11px; }
}

@media (max-width: 760px) {
  .legal-hero { min-height: auto; padding-top: 72px; }
  .legal-hero::after { opacity: .18; }
  h1 { font-size: clamp(42px, 13vw, 62px); }
  .legal-meta { grid-template-columns: 1fr; }
  .legal-layout { display: block; padding-top: 48px; }
  aside { display: none; }

  .legal-index {
    position: static;
    display: block;
    margin-bottom: 8px;
  }

  .legal-section-accent {
    margin-right: -12px;
    margin-left: -12px;
    padding-right: 22px;
    padding-left: 22px;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  footer a { margin-left: 0; }
}

/* ---------- 举报页（report.html）---------- */
/* 与协议页共用本文件：都是脱离 SPA 的独立静态页，共享同一套排版变量。 */
.legal-doc {
  max-width: 680px;
  margin: 0 auto;
  padding: 72px 0 96px;
}

.legal-doc h1 {
  font-size: clamp(34px, 5vw, 52px);
  margin: 0 0 18px;
}

.legal-doc h2 {
  font-size: 22px;
  margin: 48px 0 12px;
}

.legal-doc p,
.legal-doc li { color: var(--muted); font-size: 16px; line-height: 1.9; }
.legal-doc a { color: var(--accent); }
.legal-doc strong { color: var(--ink); }
.legal-doc ul { margin: 12px 0; padding-left: 1.2em; }
.legal-doc li { margin: 8px 0; padding-left: .35em; }
.legal-doc code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: .92em;
}
/* .legal-doc p 的特异性高于这两个单类选择器，不重申一次会被压成正文样式 */
.legal-doc .legal-eyebrow { color: var(--accent); }
.legal-doc .legal-lead { margin: 0 0 10px; font-size: clamp(17px, 2vw, 21px); }
.legal-doc .legal-note { margin: 0; font-size: .85rem; }

.legal-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 28px 0 8px;
}

.legal-form label {
  margin-top: 14px;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 600;
}

.legal-form select,
.legal-form input,
.legal-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  box-sizing: border-box;
}

.legal-form select:focus,
.legal-form input:focus,
.legal-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.legal-form textarea { resize: vertical; }

.legal-note {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: .85rem;
  word-break: break-all;
}

.legal-error {
  margin: 10px 0 0;
  color: #f87171;
  font-size: .85rem;
}

html.light .legal-error { color: #d1242f; }

.legal-btn {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 20px;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

/* 表单是 flex column（默认 stretch），不锚一下会被拉成满宽胶囊 */
.legal-form .legal-btn { align-self: flex-start; }

.legal-btn:hover { background: var(--primary-hover); }
.legal-btn:disabled { opacity: .5; cursor: not-allowed; }

.legal-done {
  margin: 32px 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.legal-done h2 { margin-top: 0; }
