/* =========================================================
   Chinese Education — shared legal stylesheet
   Loaded by privacy.html and terms-of-service.html ONLY.
   Dark warm theme with olive-green accents.
   ========================================================= */

.legal-page {
  background-color: #0E0C0A;
  color: #EFEAE2;
}

:root {
  --legal-bg: #0E0C0A;
  --legal-surface: #1A1815;
  --legal-card: #211E1A;
  --legal-line: #2A2620;
  --legal-text: #EFEAE2;
  --legal-dim: #C9C1B4;
  --legal-faint: #A79E90;
  --legal-accent: #65A30D;
  --legal-accent-bright: #84CC16;
  --legal-accent-dark: #3F6212;
  --legal-heading: #A3D94A;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--legal-text);
  background-color: var(--legal-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a:hover {
  color: var(--legal-accent);
}

/* ---------- Header ---------- */
.legal-header {
  background: linear-gradient(135deg, var(--legal-accent-dark) 0%, var(--legal-bg) 78%);
  border-bottom: 1px solid var(--legal-line);
  padding: 72px 0 56px;
}

.legal-header-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.legal-kicker {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--legal-accent-bright);
  margin-bottom: 12px;
}

.legal-header h1 {
  font-size: 2.7rem;
  line-height: 1.15;
  font-weight: 800;
  color: var(--legal-text);
  margin-bottom: 12px;
}

.legal-meta {
  color: var(--legal-dim);
  font-size: 0.95rem;
}

/* ---------- Layout: toc + content ---------- */
.legal-wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 48px;
  align-items: start;
}

/* ---------- Table of contents ---------- */
.toc {
  position: sticky;
  top: 24px;
  background-color: var(--legal-surface);
  border: 1px solid var(--legal-line);
  border-radius: 14px;
  padding: 24px;
}

.toc h2 {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--legal-heading);
  margin-bottom: 16px;
}

.toc ol {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toc a {
  color: var(--legal-dim);
  font-size: 0.95rem;
  line-height: 1.45;
}

.toc a:hover {
  color: var(--legal-accent-bright);
}

/* ---------- Content ---------- */
.legal-content {
  min-width: 0;
}

/* Scope isolation: never let shared section backgrounds bleed in */
.legal-page .legal-content section {
  background-color: transparent !important;
}

.legal-content section {
  padding-bottom: 36px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--legal-line);
}

.legal-content section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.legal-content h2 {
  font-size: 1.6rem;
  line-height: 1.25;
  font-weight: 800;
  color: var(--legal-heading);
  margin-bottom: 14px;
}

.legal-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--legal-text);
  margin: 20px 0 10px;
}

.legal-content p {
  color: var(--legal-dim);
  margin-bottom: 14px;
}

.legal-content p:last-child {
  margin-bottom: 0;
}

.legal-content strong {
  color: var(--legal-text);
}

/* ---------- Footer ---------- */
.legal-footer {
  background-color: var(--legal-surface);
  border-top: 1px solid var(--legal-line);
  padding: 32px 0;
}

.legal-footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  align-items: center;
  justify-content: space-between;
}

.legal-footer p {
  color: var(--legal-faint);
  font-size: 0.9rem;
}

.legal-footer a {
  color: var(--legal-accent-bright);
}

.legal-footer a:hover {
  color: var(--legal-accent);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .legal-wrap {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .toc {
    position: static;
  }

  .legal-header h1 {
    font-size: 2.1rem;
  }
}
