/* Shared stylesheet for /terms and /privacy pages.
   Matches the marketing site's color tokens + serif/sans pairing
   but uses a quieter, more readable single-column layout suited
   to long-form policy copy. */

:root {
  --brand: #FFE135;
  --ink: #1A1A1A;
  --ink-2: #2a2a2a;
  --muted: #6b6b6b;
  --rule: #e9e6df;
  --paper: #fafafa;
  --serif: ui-serif, "New York", Georgia, serif;
  --sans:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
a { color: inherit; }

html {
  -webkit-text-size-adjust: 100%;
  background-color: var(--paper);
}

body {
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--paper);
}

.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 56px);
  border-bottom: 1px solid var(--rule);
  background: #fff;
}

.legal-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.legal-header .brand img {
  width: 30px;
  height: 30px;
  border-radius: 7px;
}

.legal-header nav {
  display: inline-flex;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.legal-header nav a {
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.legal-header nav a[aria-current="page"] {
  border-color: var(--ink);
  color: var(--ink);
  font-weight: 600;
}

main.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(36px, 6vw, 72px) clamp(20px, 5vw, 40px) 96px;
}

.legal h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
}

.legal .updated {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 36px;
}

.legal h2 {
  font-family: var(--serif);
  font-size: clamp(22px, 2.6vw, 26px);
  letter-spacing: -0.01em;
  margin: 40px 0 12px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}

.legal h2:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.legal p, .legal li {
  font-size: 16px;
  color: var(--ink-2);
}

.legal ul {
  padding-left: 22px;
  margin: 8px 0 16px;
}

.legal li {
  margin-bottom: 6px;
}

.legal strong {
  color: var(--ink);
  font-weight: 600;
}

.legal a.inline-link {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.legal-footer {
  border-top: 1px solid var(--rule);
  padding: 24px clamp(16px, 5vw, 56px);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  background: #fff;
  line-height: 1.9;
}

.legal-footer .copy {
  /* On desktop this hugs the · separator we draw between copy and
     the link list; on mobile we stack instead (see media query). */
}

/* Desktop: one row. Insert a · between the © line and the link list. */
.legal-footer .copy::after {
  content: " · ";
  margin: 0 2px;
}

.legal-footer a {
  color: var(--muted);
  text-decoration: none;
  margin: 0 6px;
  /* Keep each link as one wrap unit so "Help & Support" / "联系我们"
     never break across lines mid-phrase. */
  white-space: nowrap;
}

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

/* Mobile (h5): two-line layout — © on top, links on second line. The
   separator between copy and links is suppressed; the link row stays
   on one line if it fits, wraps cleanly if it doesn't. */
@media (max-width: 520px) {
  .legal-footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .legal-footer .copy::after {
    content: none;
  }
  .legal-footer .links {
    display: block;
  }
}

/* ===== FAQ + Contact additions ===== */

.faq-list {
  margin: 8px 0 28px;
}

.faq-list details {
  border-bottom: 1px solid var(--rule);
  padding: 18px 0;
}

.faq-list details:last-child {
  border-bottom: 0;
}

.faq-list summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-right: 4px;
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::after {
  content: "+";
  font-weight: 400;
  font-size: 22px;
  color: var(--muted);
  transition: transform 200ms ease;
  line-height: 1;
}

.faq-list details[open] summary::after {
  content: "−";
  color: var(--ink);
}

.faq-list .faq-a {
  margin: 12px 0 4px;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.65;
}

.faq-list .faq-a a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.contact-card {
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: clamp(24px, 4vw, 36px);
  background: #fff;
  margin: 8px 0 24px;
}

.contact-card .label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}

.contact-card .email {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 36px);
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  display: inline-block;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

/* ===== Dark mode (跟随系统) =====
   Mirrors the light layout exactly — only color tokens and a few hard-
   coded backgrounds flip. Triggered purely by prefers-color-scheme so
   the user's iOS / macOS system setting drives it; no toggle needed. */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f1efe9;
    --ink-2: #d5d2c9;
    --muted: #8e8a82;
    --rule: #2a2826;
    --paper: #0f0e0d;
  }

  html, body {
    background-color: var(--paper);
    color: var(--ink);
  }

  .legal-header,
  .legal-footer,
  .contact-card {
    background-color: #1a1917;
  }

  .legal-header nav a[aria-current="page"] {
    border-color: var(--ink);
    color: var(--ink);
  }

  .legal a.inline-link,
  .legal-footer a:hover,
  .contact-card .email,
  .faq-list .faq-a a {
    color: var(--ink);
  }

  .faq-list summary::after {
    color: var(--muted);
  }

  .faq-list details[open] summary::after {
    color: var(--ink);
  }
}
