/* ============================================================
   JiangXia — shared legal stylesheet
   Loaded by privacy.html and terms-of-service.html ONLY
   (these pages do NOT load style.css)
   ============================================================ */

.legal-page {
  background-color: #F7F4FB;
  color: #221B38;
}

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

.legal-page {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.legal-page a {
  color: #5A3FA8;
  text-decoration: none;
}

.legal-page a:hover {
  text-decoration: underline;
}

/* ---------- Header ---------- */

.legal-header {
  background: linear-gradient(135deg, #4A3594 0%, #6D4FC1 70%, #7C5CD0 100%);
  padding: 56px 24px 48px;
}

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

.legal-brand {
  display: inline-block;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  margin-bottom: 22px;
}

.legal-brand:hover {
  color: #F4E7C8;
  text-decoration: none;
}

.legal-header h1 {
  color: #FFFFFF;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.legal-header .legal-updated {
  margin-top: 14px;
  color: #E6DFF7;
  font-size: 0.95rem;
}

/* ---------- Content ---------- */

.legal-content {
  padding: 48px 0 24px;
}

.legal-content .container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.legal-content section {
  margin-bottom: 40px;
}

/* Scope-isolation rule: never paint over legal text */
.legal-page .legal-content section {
  background-color: transparent !important;
}

.legal-content h2 {
  color: #4A3594;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #E4DDF0;
}

.legal-content h3 {
  color: #221B38;
  font-size: 1.12rem;
  margin: 22px 0 10px;
}

.legal-content p {
  color: #4A3E63;
  margin-bottom: 16px;
}

.legal-content ul {
  color: #4A3E63;
  margin: 0 0 16px 22px;
}

.legal-content ul li {
  margin-bottom: 8px;
}

/* ---------- Table of contents ---------- */

.legal-content .toc {
  background-color: #FFFFFF;
  border: 1px solid #E4DDF0;
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 36px;
}

.legal-content .toc h2 {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 14px;
  font-size: 1.05rem;
  color: #221B38;
}

.legal-content .toc ol {
  margin: 0;
  padding-left: 20px;
  columns: 2;
  column-gap: 32px;
  color: #4A3E63;
}

.legal-content .toc li {
  margin-bottom: 8px;
  break-inside: avoid;
}

.legal-content .toc a {
  color: #5A3FA8;
  font-size: 0.92rem;
}

/* ---------- Footer ---------- */

.legal-footer {
  background-color: #1D1730;
  color: #B9AEE0;
  padding: 32px 24px;
  margin-top: 24px;
}

.legal-footer .container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}

.legal-footer p {
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.legal-footer a {
  color: #F4E7C8;
  font-weight: 700;
}

.legal-footer a:hover {
  color: #FFFFFF;
}

@media (max-width: 640px) {
  .legal-content .toc ol {
    columns: 1;
  }
}
