/* ==========================================================================
   legal.css — 隐私政策 / 用户服务协议（/privacy-policy.html、/user-agreement.html）
   独立页面样式：本页不加载 styles.css / hilly.css，避免全站布局互相污染。
   令牌口径与 help.css、quez-light.css 的品牌色一致（#1e5eff / #5a4df0）。
   ★ 法律正文一律逐字不改，本文件只负责排版。
   ========================================================================== */

:root {
  --l-max: 1180px;
  --l-pad: 24px;

  --l-accent: #1e5eff;
  --l-accent-2: #5a4df0;
  --l-accent-soft: rgba(30, 94, 255, .07);
  --l-accent-line: rgba(30, 94, 255, .22);

  --l-page: #f8fafc;
  --l-card: #ffffff;
  --l-soft: #f4f7fb;

  --l-text: #0f172a;
  --l-text-2: #334155;
  --l-muted: #5d6b81;
  --l-line: rgba(15, 23, 42, .10);
  --l-line-soft: rgba(15, 23, 42, .06);

  --l-r-sm: 10px;
  --l-r-md: 14px;
  --l-r-lg: 18px;

  --l-shadow-sm: 0 2px 8px rgba(15, 23, 42, .04);
  --l-shadow-md: 0 18px 40px -24px rgba(15, 23, 42, .20);

  --l-header-h: 64px;
  --l-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--l-page);
  color: var(--l-text);
  font-family: var(--l-font);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

.l-wrap {
  width: min(var(--l-max), calc(100% - var(--l-pad) * 2));
  margin: 0 auto;
}

/* 无障碍跳转（视觉隐藏，聚焦时出现） */
.l-sr {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--l-accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 var(--l-r-sm) 0;
}
.l-sr:focus { left: 0; }

/* ---------------------------------------------------------------- header */
.l-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(248, 250, 252, .88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--l-line-soft);
}

.l-header-in {
  min-height: var(--l-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.l-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--l-text);
}
.l-brand:hover { text-decoration: none; }
.l-brand img { width: 28px; height: 28px; display: block; }

.l-brand-txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.l-brand-txt b { font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.l-brand-txt i {
  font-style: normal;
  font-size: 11.5px;
  color: var(--l-muted);
  letter-spacing: .04em;
}

.l-header-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
  color: var(--l-text-2);
}
.l-header-nav a { color: var(--l-text-2); }
.l-header-nav a:hover { color: var(--l-accent); }

.l-header-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--l-accent);
  color: #fff !important;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 6px 16px -8px rgba(30, 94, 255, .7);
}
.l-header-cta:hover {
  text-decoration: none;
  box-shadow: 0 10px 22px -8px rgba(30, 94, 255, .85);
}

/* ----------------------------------------------------------------- hero */
.l-hero {
  padding: 56px 0 28px;
  background:
    radial-gradient(60% 120% at 12% 0%, rgba(30, 94, 255, .07), transparent 70%),
    radial-gradient(50% 110% at 88% 0%, rgba(90, 77, 240, .06), transparent 70%);
  border-bottom: 1px solid var(--l-line-soft);
}

.l-eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--l-accent);
}

.l-hero h1 {
  margin: 0;
  font-size: clamp(30px, 4.6vw, 44px);
  line-height: 1.2;
  letter-spacing: -.01em;
  font-weight: 800;
}

.l-meta {
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--l-muted);
  line-height: 1.7;
}
.l-meta b { color: var(--l-text-2); font-weight: 600; }

.l-switch {
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--l-muted);
}

/* ----------------------------------------------------------- body layout */
.l-body {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  padding: 36px 0 72px;
}

/* 目录（桌面端 sticky） */
.l-toc {
  position: sticky;
  top: calc(var(--l-header-h) + 20px);
  max-height: calc(100vh - var(--l-header-h) - 48px);
  overflow-y: auto;
  padding: 18px 16px;
  border: 1px solid var(--l-line-soft);
  border-radius: var(--l-r-md);
  background: var(--l-card);
  box-shadow: var(--l-shadow-sm);
  font-size: 13.5px;
}

.l-toc-t {
  margin: 0 0 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--l-muted);
}

.l-toc ul { list-style: none; margin: 0; padding: 0; }
.l-toc li { margin: 0; }
.l-toc a {
  display: block;
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--l-text-2);
  line-height: 1.5;
}
.l-toc a:hover {
  background: var(--l-accent-soft);
  color: var(--l-accent);
  text-decoration: none;
}
.l-toc .l-sub a { padding-left: 20px; color: var(--l-muted); font-size: 13px; }

/* 正文 */
.l-doc {
  padding: 40px 44px 48px;
  border: 1px solid var(--l-line-soft);
  border-radius: var(--l-r-lg);
  background: var(--l-card);
  box-shadow: var(--l-shadow-md);
  min-width: 0;
}

.l-doc h2 {
  margin: 40px 0 12px;
  padding-top: 4px;
  font-size: 20px;
  line-height: 1.45;
  font-weight: 700;
  color: var(--l-text);
  scroll-margin-top: calc(var(--l-header-h) + 20px);
  position: relative;
}
.l-doc h2:first-child { margin-top: 0; }

/* 二级编号（2.1 / 5.1）弱化为小标题 */
.l-doc h2.l-h3 {
  margin: 26px 0 8px;
  font-size: 16px;
  font-weight: 650;
  color: var(--l-text-2);
  padding-left: 12px;
  border-left: 3px solid var(--l-accent-line);
}

.l-doc p {
  margin: 0 0 14px;
  color: var(--l-text-2);
  font-size: 15.5px;
  line-height: 1.92;
}

.l-doc ul {
  margin: 0 0 18px;
  padding-left: 0;
  list-style: none;
}
.l-doc ul li {
  position: relative;
  margin: 0 0 10px;
  padding-left: 18px;
  color: var(--l-text-2);
  font-size: 15.5px;
  line-height: 1.92;
}
.l-doc ul li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .82em;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--l-accent-line);
}

.l-doc strong { color: var(--l-text); font-weight: 650; }

/* 正文收尾提示 */
.l-note {
  margin: 40px 0 0;
  padding: 16px 18px;
  border-radius: var(--l-r-sm);
  background: var(--l-soft);
  border: 1px solid var(--l-line-soft);
  font-size: 14px;
  color: var(--l-muted);
  line-height: 1.8;
}
.l-note a { font-weight: 600; }

/* ---------------------------------------------------------------- footer */
.l-footer {
  border-top: 1px solid var(--l-line-soft);
  background: var(--l-card);
  padding: 32px 0 44px;
  font-size: 13.5px;
  color: var(--l-muted);
  line-height: 1.9;
}

.l-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 14px;
  font-size: 14px;
}
.l-footer-links a { color: var(--l-text-2); }
.l-footer-links a:hover { color: var(--l-accent); }

.l-footer-legal { color: var(--l-muted); }
.l-footer-legal span + span::before {
  content: "·";
  margin: 0 8px;
  color: var(--l-line);
}

/* ------------------------------------------------------------ responsive */
@media (max-width: 960px) {
  .l-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding: 24px 0 56px;
  }
  .l-toc {
    position: static;
    max-height: none;
    overflow: visible;
  }
  /* 移动端目录默认收起，避免一屏全是目录 */
  .l-toc[data-collapse] ul { display: none; }
  .l-toc[data-collapse].is-open ul { display: block; }
  .l-toc-t {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
    cursor: pointer;
  }
  .l-toc[data-collapse] .l-toc-t::after {
    content: "展开";
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--l-accent);
  }
  .l-toc[data-collapse].is-open .l-toc-t::after { content: "收起"; }
  .l-toc[data-collapse].is-open .l-toc-t { margin-bottom: 10px; }
}

@media (max-width: 640px) {
  :root { --l-pad: 16px; }
  .l-hero { padding: 36px 0 22px; }
  .l-header-nav { gap: 14px; font-size: 13px; }
  .l-header-nav .l-hide-sm { display: none; }
  .l-doc { padding: 26px 20px 32px; border-radius: var(--l-r-md); }
  .l-doc h2 { font-size: 18px; }
  .l-doc p, .l-doc ul li { font-size: 15px; }
  .l-header-cta { height: 32px; padding: 0 12px; font-size: 13px; }
}

@media print {
  .l-header, .l-toc, .l-footer, .l-switch { display: none !important; }
  .l-body { grid-template-columns: 1fr; padding: 0; }
  .l-doc { box-shadow: none; border: 0; padding: 0; }
  .l-hero { background: none; border: 0; }
}
