/* ============================================================
   JiFengYunFan — Legal Pages Stylesheet (privacy / terms)
   Loaded ONLY by privacy.html and terms-of-service.html
   ============================================================ */

/* Legal pages define their own light background */
.legal-page {
  background-color: #FAF9F6;
  color: #1B2437;
}

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

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

body {
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: #1B2437;
  background-color: #FAF9F6;
  overflow-x: hidden;
}

a {
  color: #2450C0;
  text-decoration: none;
}

a:hover {
  color: #1C3F9E;
  text-decoration: underline;
}

/* ------------------------------------------------------------
   LEGAL HEADER (a <header>, never a <section>)
   ------------------------------------------------------------ */
.legal-header {
  background-color: #1C3F9E;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.10) 1px, transparent 1px),
    linear-gradient(135deg, #4A7BEA 0%, #2450C0 100%);
  background-size: 46px 46px, 46px 46px, 100% 100%;
  color: #FFFFFF;
  padding: 56px 0 52px;
}

.legal-header .legal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}

.legal-header .legal-brand {
  font-weight: 800;
  font-size: 1.25rem;
  color: #FFFFFF;
}

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

.legal-header .back-link {
  color: #DCE5F7;
  font-weight: 600;
  font-size: 0.95rem;
}

.legal-header .back-link:hover {
  color: #FFFFFF;
}

.legal-header .legal-kicker {
  display: inline-block;
  color: #C9973F;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.legal-header h1 {
  color: #FFFFFF;
  font-size: clamp(2.1rem, 4.5vw, 3.1rem);
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin-bottom: 14px;
}

.legal-header .legal-sub {
  color: #DCE5F7;
  font-size: 1.05rem;
  max-width: 620px;
}

/* ------------------------------------------------------------
   LEGAL CONTENT
   ------------------------------------------------------------ */
.legal-content {
  padding: 56px 0 72px;
}

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

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

.legal-content .toc {
  background-color: #FFFFFF;
  border: 1px solid #E7E5DF;
  border-radius: 14px;
  padding: 26px 28px;
  margin-bottom: 44px;
}

.legal-content .toc h2 {
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #2450C0;
  margin-bottom: 16px;
}

.legal-content .toc ol {
  list-style: none;
  counter-reset: toc;
}

.legal-content .toc ol li {
  counter-increment: toc;
  margin-bottom: 8px;
}

.legal-content .toc ol li a {
  color: #3A4258;
  font-size: 0.96rem;
}

.legal-content .toc ol li a::before {
  content: counter(toc, decimal-leading-zero) "  ";
  color: #C9973F;
  font-weight: 700;
  font-size: 0.82rem;
}

.legal-content .toc ol li a:hover {
  color: #2450C0;
  text-decoration: none;
}

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

.legal-content section h2 {
  color: #2450C0;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #E7E5DF;
}

.legal-content section h3 {
  color: #1B2437;
  font-size: 1.08rem;
  margin: 20px 0 10px;
}

.legal-content section p {
  color: #3A4258;
  font-size: 1rem;
  margin-bottom: 16px;
}

.legal-content section ul {
  margin: 0 0 16px 22px;
}

.legal-content section ul li {
  color: #3A4258;
  font-size: 1rem;
  margin-bottom: 8px;
}

.legal-content .legal-note {
  background-color: #EEF2FB;
  border-left: 4px solid #2450C0;
  border-radius: 6px;
  padding: 16px 20px;
  margin: 20px 0;
}

.legal-content .legal-note p {
  margin-bottom: 0;
  color: #1B2437;
}

/* ------------------------------------------------------------
   LEGAL FOOTER (back to homepage)
   ------------------------------------------------------------ */
.legal-footer {
  background-color: #F4F2ED;
  border-top: 1px solid #E7E5DF;
  padding: 36px 0;
}

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

.legal-footer .legal-brand-row {
  font-weight: 800;
  font-size: 1.15rem;
  color: #1B2437;
  margin-bottom: 6px;
}

.legal-footer p {
  color: #5A6276;
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.legal-footer a {
  color: #2450C0;
  font-weight: 600;
  font-size: 0.95rem;
}

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

@media (max-width: 600px) {
  .legal-content {
    padding: 40px 0 56px;
  }

  .legal-header {
    padding: 40px 0;
  }
}
