/* ============================================
   Genix AI — Legal pages (Privacy / Terms)
   依赖 contact.css 提供主题变量（自动适配三套主题）
   ============================================ */

/* legal.css 内的 Header/Footer 样式会与 contact.css 重复，
   因此本文件只保留法律页专属部分，Header/Footer 直接复用 contact.css。 */

:root {
  --legal-max: 860px;
  --toc-w: 240px;
}

/* ---------- 法律页专属样式 ---------- */

/* 顶部阅读进度条 */
.reading-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  z-index: 300;
  background: var(--grad-btn);
  transition: width .12s linear;
}

/* ---------- Hero ---------- */
.legal-hero {
  position: relative;
  padding: calc(var(--header-h) + 54px) 0 46px;
  background: var(--bg);
  overflow: hidden;
  text-align: center;
}

.legal-hero::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 720px; height: 340px;
  border-radius: 50%;
  background: var(--hero-glow, rgba(167, 139, 250, .32));
  filter: blur(80px);
  pointer-events: none;
}

.legal-hero-inner { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; }

.legal-eyebrow {
  display: inline-block;
  margin-bottom: 20px;
  padding: 6px 16px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--accent);
}

.legal-hero h1 {
  font-size: clamp(32px, 3.8vw, 48px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.2px;
  color: var(--ink);
}

.legal-hero h1 em {
  font-style: normal;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.legal-meta {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--hero-sub, #5b4b86);
}

.legal-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); opacity: .6; }

.legal-meta a {
  color: var(--accent);
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.legal-meta a:hover { border-bottom-color: currentColor; }

/* ---------- Layout：正文 + 侧边目录 ---------- */
.legal-body {
  background: var(--bg-2);
  padding: 0 0 96px;
}

.legal-wrap {
  position: relative;
  z-index: 2;
  margin-top: -34px;
  display: grid;
  grid-template-columns: var(--toc-w) minmax(0, var(--legal-max));
  gap: 32px;
  align-items: start;
  justify-content: center;
}

/* 侧边目录 */
.toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  background: var(--form-bg, #fff);
  border: 1px solid var(--form-border, transparent);
  border-radius: var(--radius-card);
  padding: 24px 22px;
  box-shadow: var(--shadow);
}

.toc h2 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--form-muted, #6b7490);
}

.toc ol {
  margin-top: 16px;
  counter-reset: toc;
}

.toc li { counter-increment: none; }

.toc a {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  margin: 2px -10px;
  border-radius: var(--radius-input);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--form-muted, #6b7490);
  border-left: 2px solid transparent;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}

.toc-num {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  opacity: .55;
  padding-top: 1px;
  font-variant-numeric: tabular-nums;
}

.toc-label { min-width: 0; }

.toc a:hover { color: var(--form-ink, #14182e); background: var(--ico-bg, rgba(124, 58, 237, .07)); }

/* 目录当前项高亮 */
.toc a.current {
  color: var(--accent);
  background: var(--ico-bg, rgba(124, 58, 237, .1));
  border-left-color: var(--accent);
  font-weight: 600;
}

/* 目录项过长时省略号（移动端横向滚动用） */
.toc a span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 文档卡 */
.doc {
  background: var(--form-bg, #fff);
  border: 1px solid var(--form-border, transparent);
  border-radius: var(--radius-card);
  padding: 46px 48px;
  box-shadow: var(--shadow);
  color: var(--form-ink, #14182e);
}

/* ---------- 正文排版 ---------- */
.doc h2 {
  margin-top: 44px;
  padding-top: 30px;
  border-top: 1px solid var(--form-border, rgba(15, 20, 45, .09));
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.4px;
  line-height: 1.35;
  color: var(--form-ink, #14182e);
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.doc h2:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }

/* 章节序号 */
.sec-num {
  display: inline-block;
  margin-right: 10px;
  font-size: .82em;
  font-weight: 800;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: .85;
  font-variant-numeric: tabular-nums;
}

.doc h3 {
  margin-top: 26px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--form-ink, #14182e);
}

.doc p {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.78;
  color: var(--form-muted, #5c6478);
}

.doc p.lead {
  font-size: 16px;
  line-height: 1.75;
  color: var(--form-ink, #14182e);
}

.doc a {
  color: var(--accent);
  font-weight: 500;
  border-bottom: 1px solid currentColor;
  transition: opacity .2s ease;
}
.doc a:hover { opacity: .72; }

.doc ul,
.doc ol {
  margin-top: 14px;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.doc ul { list-style: none; padding-left: 20px; }

.doc ul li {
  position: relative;
  font-size: 15px;
  line-height: 1.72;
  color: var(--form-muted, #5c6478);
}

.doc ul li::before {
  content: "";
  position: absolute;
  left: -18px; top: 11px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .55;
}

.doc ol { list-style: decimal; }
.doc ol li { font-size: 15px; line-height: 1.72; color: var(--form-muted, #5c6478); }
.doc ol li::marker { color: var(--accent); font-weight: 700; }

/* 原稿里裸 <div> 包裹的第三方政策段落 */
.doc div {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: var(--radius-input);
  border: 1px solid var(--input-border, transparent);
  background: var(--ico-bg, rgba(124, 58, 237, .05));
}

.doc div > p:first-child { margin-top: 0; }
.doc div > p:last-child { margin-bottom: 0; }

/* 强调块 */
.doc .callout {
  margin-top: 22px;
  padding: 20px 22px;
  border-radius: var(--radius-input);
  border: 1px solid var(--input-border, transparent);
  border-left: 3px solid var(--accent);
  background: var(--ico-bg, rgba(124, 58, 237, .07));
}

.doc .callout strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--form-ink, #14182e);
}

.doc .callout p { margin-top: 0; font-size: 14px; line-height: 1.7; }

/* 数据表 */
.doc .table-wrap {
  margin-top: 20px;
  overflow-x: auto;
  border: 1px solid var(--form-border, rgba(15, 20, 45, .09));
  border-radius: var(--radius-input);
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.doc th,
.doc td {
  padding: 14px 18px;
  text-align: left;
  line-height: 1.6;
}

.doc th {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--form-muted, #6b7490);
  background: var(--ico-bg, rgba(124, 58, 237, .06));
  white-space: nowrap;
}

.doc td { color: var(--form-muted, #5c6478); border-top: 1px solid var(--form-border, rgba(15, 20, 45, .08)); }
.doc td:first-child { font-weight: 600; color: var(--form-ink, #14182e); white-space: nowrap; }

/* ---------- 底部翻页 ---------- */
.doc-nav {
  margin-top: 48px;
  padding-top: 30px;
  border-top: 1px solid var(--form-border, rgba(15, 20, 45, .09));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.doc-nav a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 20px;
  min-width: 190px;
  border-radius: var(--radius-input);
  border: 1px solid var(--input-border, transparent);
  background: var(--ico-bg, rgba(124, 58, 237, .05));
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}

.doc-nav a:hover { border-color: var(--accent); transform: translateY(-2px); }
.doc-nav a.next { text-align: right; margin-left: auto; }

.doc-nav .dn-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--form-muted, #6b7490);
}

.doc-nav .dn-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--accent);
}

.doc-nav .dn-arrow {
  font-size: 11px;
  color: var(--form-muted, #6b7490);
  font-weight: 700;
  letter-spacing: 1.4px;
}

/* ---------- Footer：仅法律页特有的当前项高亮，基础样式复用 contact.css ---------- */
.footer-links a.active { color: #fff; font-weight: 600; }

/* Header 的 Get Started 按钮（contact.css 里是内联样式，这里给类名版本） */
.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 30px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: var(--radius-btn);
  background: var(--grad-btn);
  color: #fff;
  transition: transform .25s ease, box-shadow .25s ease;
}

.header-cta:hover { transform: translateY(-2px); }

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1000px) {
  .legal-wrap {
    grid-template-columns: minmax(0, 1fr);
    max-width: var(--legal-max);
    margin-left: auto;
    margin-right: auto;
  }

  /* 目录转为顶部横向滚动条 */
  .toc {
    position: static;
    padding: 18px 20px;
  }

  .toc h2 { margin-bottom: 4px; }

  .toc ol {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
  }

  .toc li { flex: 0 0 auto; }

  .toc a {
    margin: 0;
    padding: 7px 14px;
    border-radius: var(--radius-btn);
    border-left: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
  }

  .toc a.current { border-left: none; border-bottom-color: var(--accent); }
}

@media (max-width: 900px) {
  .legal-hero { padding: calc(var(--header-h) + 34px) 0 38px; }
  .legal-wrap { margin-top: -26px; }
  .doc { padding: 32px 26px; }
  .header-cta { padding: 11px 24px; font-size: 14px; }
}

@media (max-width: 520px) {
  .legal-hero h1 { letter-spacing: -1px; }
  .legal-eyebrow { font-size: 10px; padding: 5px 13px; }
  .legal-meta { font-size: 12.5px; gap: 8px; }

  .doc { padding: 26px 18px; border-radius: var(--radius-input); }
  .doc h2 { font-size: 18.5px; margin-top: 36px; padding-top: 24px; }
  .doc p, .doc ul li, .doc ol li { font-size: 14.5px; }

  .doc-nav { flex-direction: column; align-items: stretch; }
  .doc-nav a { min-width: 0; }
  .doc-nav a.next { text-align: left; margin-left: 0; }
}
