/*
 * 相友圈 PhotoQuan 宣传官网样式
 * 严格对齐 design-system-spec.md 与 prototype/photoquan-redesign.html 暖珊瑚设计系统
 */

/* ========== Tokens ========== */
:root {
  /* 语义色 */
  --brand: #FF6A3D;
  --brand-2: #FF8A5B;
  --brand-soft: #FFEDE5;
  --brand-ink: #C2421B;
  --bg: #F4F2EF;
  --surface: #FFFFFF;
  --surface-2: #FAF8F5;
  --text: #1C1B1A;
  --text-2: #6E6A64;
  --text-3: #A39E97;
  --line: #ECE8E2;
  --line-2: #F2EFEA;
  --name: #4A6FA5;
  --like: #FA5151;
  --green: #2BA471;
  --danger: #E5484D;
  --gold: #E0A23B;

  /* 字号 */
  --fs-xs: 11px;
  --fs-sm: 13px;
  --fs-base: 15px;
  --fs-md: 17px;
  --fs-lg: 20px;
  --fs-xl: 24px;
  --fs-2xl: 32px;
  --fs-3xl: 44px;

  /* 圆角 / 阴影 / 间距 */
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 6px 24px rgba(40, 30, 20, .08);
  --shadow-lg: 0 14px 40px rgba(40, 30, 20, .16);
  --shadow-xl: 0 24px 60px rgba(40, 30, 20, .18);
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;

  /* 字体 */
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;

  /* 布局 */
  --header-h: 64px;
  --max-w: 1160px;
}

/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-size: var(--fs-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--brand-ink); text-decoration: none; }
a:not(.btn):hover { text-decoration: underline; }

:focus-visible { outline: 3px solid rgba(255, 106, 61, .45); outline-offset: 3px; border-radius: 4px; }

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: var(--sp-4);
  background: var(--brand);
  color: #fff;
  padding: 6px 12px;
  border-radius: 0 0 8px 8px;
  z-index: 1000;
  font-weight: 600;
}
.skip-link:focus { top: 0; }

/* ========== Layout utilities ========== */
.container {
  width: 92%;
  max-width: var(--max-w);
  margin: 0 auto;
}

.section { padding: 88px 0; }
.section-alt { background: var(--surface-2); }

.section-head {
  max-width: 640px;
  margin: 0 auto var(--sp-7);
  text-align: center;
}

.section-dot {
  display: inline-flex;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 4px 12px rgba(255, 106, 61, .35);
  margin-bottom: var(--sp-3);
}

.section-head h2 {
  font-size: var(--fs-3xl);
  font-weight: 800;
  line-height: 1.18;
  margin: 0 0 var(--sp-3);
  color: var(--text);
}

.section-sub {
  font-size: var(--fs-md);
  color: var(--text-2);
  margin: 0;
  line-height: 1.65;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font);
  font-size: var(--fs-base);
  font-weight: 600;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  padding: 10px 20px;
  white-space: nowrap;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.btn:active { transform: translateY(1px) scale(.99); }

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 6px 18px rgba(255, 106, 61, .32);
}
.btn-primary:hover, .btn-primary:focus { box-shadow: 0 8px 22px rgba(255, 106, 61, .42); filter: brightness(1.03); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.btn-secondary:hover, .btn-secondary:focus { background: var(--surface-2); }

.btn-ghost {
  background: rgba(255, 255, 255, .16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .32);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover, .btn-ghost:focus { background: rgba(255, 255, 255, .26); }

.btn-wechat {
  background: linear-gradient(135deg, #3AC47D, var(--green));
  color: #fff;
  box-shadow: 0 6px 18px rgba(43, 164, 113, .26);
}
.btn-wechat:hover, .btn-wechat:focus { box-shadow: 0 8px 22px rgba(43, 164, 113, .36); filter: brightness(1.03); }

.btn-lg { padding: 14px 28px; font-size: var(--fs-md); min-height: 52px; }
.btn-sm { padding: 8px 16px; font-size: var(--fs-sm); }
.btn-block { width: 100%; }

/* ========== Header / Nav ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(244, 242, 239, .86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.site-header.is-scrolled {
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 1px 0 var(--line), 0 6px 18px rgba(40, 30, 20, .06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-w);
  width: 92%;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}
.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
}
.brand-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  font-size: var(--fs-md);
}
.brand-wordmark strong { font-weight: 800; letter-spacing: .2px; }
.brand-wordmark span { font-size: var(--fs-xs); color: var(--text-3); font-weight: 600; letter-spacing: .4px; }

.site-nav { display: block; }
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--sp-1);
}
.nav-list a {
  display: block;
  padding: 8px 14px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  border-radius: 999px;
  transition: background .15s, color .15s;
}
.nav-list a:hover, .nav-list a:focus { color: var(--text); background: var(--surface); }

.header-actions { display: flex; align-items: center; gap: var(--sp-3); }

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border-radius: 10px;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ========== Hero ========== */
.hero {
  padding: 64px 0 96px;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  align-items: center;
}
.hero-copy { max-width: 560px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-ink);
  background: var(--brand-soft);
  font-size: var(--fs-sm);
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: var(--sp-4);
}
.eyebrow--light {
  background: rgba(255, 255, 255, .2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .35);
  backdrop-filter: blur(6px);
}
.hero-copy h1 {
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: -.5px;
  margin: 0 0 var(--sp-4);
}
.hero-lead {
  font-size: var(--fs-lg);
  color: var(--text-2);
  line-height: 1.7;
  margin: 0 0 var(--sp-6);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-bottom: var(--sp-6); }
.hero-trust { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.trust-pill {
  font-size: var(--fs-sm);
  color: var(--text-2);
  background: var(--surface-2);
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 460px;
}

/* ========== Phone mockup (from preview.html, adapted) ========== */
.phone-frame {
  background: #1c1c1e;
  border-radius: 46px;
  padding: 14px;
  box-shadow: var(--shadow-xl);
  width: 340px;
  flex-shrink: 0;
  z-index: 2;
}
.phone {
  position: relative;
  background: #000;
  border-radius: 34px;
  overflow: hidden;
  aspect-ratio: 9 / 19.5;
}
.wallpaper {
  position: absolute;
  inset: 0;
  background: radial-gradient(160% 120% at 50% 0%, #FFB199 0%, #FF8A5B 38%, #E96A3D 100%);
  z-index: 0;
}
.wallpaper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 60% at 50% 100%, rgba(0, 0, 0, .18), transparent 60%);
}
.notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 124px;
  height: 30px;
  background: #1c1c1e;
  border-radius: 0 0 18px 18px;
  z-index: 5;
}
.status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px 0;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  position: relative;
  z-index: 4;
}
.status-r { display: flex; gap: 5px; align-items: center; }
.screen {
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 54px 16px 0;
  display: flex;
  flex-direction: column;
}
.screen-date { text-align: center; margin-bottom: 14px; color: #fff; }
.screen-time { font-size: 68px; font-weight: 200; letter-spacing: -2px; line-height: 1; text-shadow: 0 2px 12px rgba(0, 0, 0, .18); }
.screen-day { font-size: 15px; font-weight: 500; margin-top: 6px; text-shadow: 0 1px 6px rgba(0, 0, 0, .18); }
.app-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 10px;
  align-items: start;
  margin-top: 12px;
}
.app-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
.app-icon {
  width: 54px;
  height: 54px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
  background: linear-gradient(135deg, #fff, #dcd8d2);
  color: #4a4a4a;
  overflow: hidden;
}
.app-cell.brand .app-icon { background: transparent; box-shadow: 0 6px 16px rgba(0, 0, 0, .22); }
.app-cell.brand .app-icon img { width: 100%; height: 100%; }
.dock {
  margin: auto 0 8px;
  padding: 10px;
  background: rgba(255, 255, 255, .18);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.dock .app-icon { width: 50px; height: 50px; border-radius: 12px; }

/* Floating cards */
.float-card {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
  z-index: 3;
}
.float-ic { font-size: 18px; line-height: 1; }
.card-cloud { top: 18%; right: 2%; animation: float 5s ease-in-out infinite; }
.card-circles { bottom: 26%; left: 2%; animation: float 6s ease-in-out infinite .8s; }
.card-member { bottom: 12%; right: 8%; animation: float 5.5s ease-in-out infinite .4s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ========== Features ========== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5);
  margin-bottom: var(--sp-7);
}
.feature-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--sp-6);
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: var(--sp-4);
}
.feature-card h3 {
  font-size: var(--fs-xl);
  font-weight: 800;
  margin: 0 0 var(--sp-2);
}
.feature-card p {
  margin: 0;
  color: var(--text-2);
  line-height: 1.7;
  font-size: var(--fs-base);
}

.feature-foot {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}
.feature-foot-card {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--sp-4);
}
.feature-foot-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.feature-foot-card h4 { margin: 0 0 4px; font-size: var(--fs-md); }
.feature-foot-card p { margin: 0; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.6; }

/* ========== Scenarios ========== */
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5);
}
.scenario-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-6);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.scenario-card:hover { border-color: rgba(255, 106, 61, .35); box-shadow: var(--shadow); }
.scenario-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-4);
}
.scenario-icon svg { width: 28px; height: 28px; }
.scenario-card h3 { font-size: var(--fs-lg); font-weight: 800; margin: 0 0 var(--sp-2); }
.scenario-card p { margin: 0; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.7; }

/* ========== Download ========== */
.download-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5);
}
.download-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--sp-6);
  box-shadow: var(--shadow);
  text-align: center;
  display: flex;
  flex-direction: column;
}
.download-card.wide { grid-column: 1 / -1; max-width: 520px; margin: 0 auto; }
.download-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--surface-2);
  color: var(--brand-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-4);
}
.download-card h3 { font-size: var(--fs-lg); font-weight: 800; margin: 0 0 var(--sp-2); }
.download-card p { flex: 1; margin: 0 0 var(--sp-5); color: var(--text-2); font-size: var(--fs-sm); line-height: 1.65; }

/* ========== WEB Login ========== */
.web-login-section {
  padding: 96px 0;
  background: radial-gradient(140% 100% at 50% 0%, #FFB199 0%, #FF8A5B 38%, #E96A3D 100%);
  position: relative;
}
.web-login-section::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 50% 100%, rgba(0, 0, 0, .18), transparent 55%);
  pointer-events: none;
}
.web-login-card {
  position: relative;
  z-index: 1;
  background: rgba(28, 27, 26, .22);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--radius);
  padding: var(--sp-7);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-7);
  align-items: center;
  color: #fff;
  box-shadow: var(--shadow-xl);
}
.web-login-visual {
  position: relative;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}
.web-login-visual img {
  width: 100%;
  height: 100%;
  border-radius: 30px;
  position: relative;
  z-index: 2;
  box-shadow: 0 16px 40px rgba(90, 36, 16, .35);
}
.web-login-glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .28);
  filter: blur(30px);
  z-index: 1;
}
.web-login-body h2 {
  font-size: clamp(26px, 3.6vw, 36px);
  font-weight: 900;
  margin: var(--sp-2) 0 var(--sp-3);
  line-height: 1.2;
}
.web-login-body p {
  font-size: var(--fs-md);
  opacity: .92;
  max-width: 560px;
  margin: 0 0 var(--sp-5);
  line-height: 1.7;
}
.web-login-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.web-login-meta {
  display: flex;
  gap: 8px;
  font-size: var(--fs-sm);
  opacity: .82;
  font-weight: 600;
}

/* ========== Footer ========== */
.site-footer {
  background: var(--text);
  color: #fff;
  padding: 64px 0 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-6);
}
.site-footer .brand { color: #fff; margin-bottom: var(--sp-3); }
.site-footer .brand-icon { border-radius: 10px; }
.site-footer .brand-wordmark span { color: rgba(255, 255, 255, .65); }
.footer-tagline { color: rgba(255, 255, 255, .7); margin: 0 0 var(--sp-4); font-size: var(--fs-sm); }
.footer-copy, .footer-icp { color: rgba(255, 255, 255, .45); font-size: var(--fs-xs); margin: 0 0 6px; }
.footer-col h3 { font-size: var(--fs-sm); font-weight: 800; margin: 0 0 var(--sp-4); color: rgba(255, 255, 255, .9); }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li + li { margin-top: 10px; }
.footer-col a { color: rgba(255, 255, 255, .6); font-size: var(--fs-sm); }
.footer-col a:hover, .footer-col a:focus { color: #fff; text-decoration: none; }

/* ========== Toast ========== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: var(--fs-sm);
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 1001;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========== Reveal animation ========== */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .55s ease, transform .55s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ========== Responsive ========== */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { margin: 0 auto; }
  .hero-actions { justify-content: center; }
  .hero-trust { justify-content: center; }
  .hero-visual { order: -1; min-height: 380px; }
  .phone-frame { transform: scale(.9); }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-foot { grid-template-columns: 1fr; }
  .scenario-grid { grid-template-columns: repeat(2, 1fr); }
  .download-grid { grid-template-columns: repeat(2, 1fr); }
  .web-login-card { grid-template-columns: 1fr; text-align: center; }
  .web-login-visual { margin: 0 auto; }
  .web-login-actions { justify-content: center; }
  .web-login-meta { justify-content: center; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  :root { --header-h: 60px; }
  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, .98);
    backdrop-filter: blur(16px);
    padding: 24px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .site-nav.is-open { transform: translateX(0); }
  .nav-list { flex-direction: column; gap: 8px; align-items: center; }
  .nav-list a { font-size: var(--fs-md); padding: 12px 20px; }
  .menu-toggle { display: flex; }
  .section { padding: 64px 0; }
  .scenario-grid { grid-template-columns: 1fr; }
  .download-grid { grid-template-columns: 1fr; }
  .download-card.wide { max-width: 100%; }
  .phone-frame { transform: scale(.82); }
  .float-card { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--sp-5); }
}

@media (max-width: 420px) {
  .hero-copy h1 { font-size: 32px; }
  .hero-lead { font-size: var(--fs-md); }
  .section-head h2 { font-size: 28px; }
  .web-login-card { padding: var(--sp-5); }
}

/* ========== Legal pages（legal/privacy.html、legal/terms.html） ========== */
/* 由 tools/gen-legal-html.js 生成，零 JavaScript，样式全部复用上方 Token */

.legal-hero {
  background: linear-gradient(180deg, var(--brand-soft), var(--bg));
  border-bottom: 1px solid var(--line);
  padding: 56px 0 40px;
}
.legal-hero .eyebrow { margin-bottom: var(--sp-4); }
.legal-hero h1 {
  font-size: var(--fs-2xl);
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 var(--sp-5);
  color: var(--text);
}
.legal-meta {
  max-width: 760px;
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.legal-meta p { margin: 0; font-size: var(--fs-sm); line-height: 1.7; color: var(--text-2); }
.legal-meta p + p { margin-top: 4px; }
.legal-meta strong { color: var(--text); font-weight: 700; }
.legal-sibling { margin: var(--sp-5) 0 0; font-size: var(--fs-sm); color: var(--text-2); }

/* 双栏：左侧目录吸顶，右侧正文 */
.legal-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  align-items: start;
  gap: var(--sp-7);
  padding: 48px 0 80px;
}

.legal-toc {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow: auto;
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.legal-toc-title {
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--text-3);
}
.legal-toc-list, .legal-toc-sub { list-style: none; margin: 0; padding: 0; }
.legal-toc-list > li + li { margin-top: 10px; }
.legal-toc-list a { display: block; font-size: var(--fs-sm); line-height: 1.5; color: var(--text-2); }
.legal-toc-list a:hover, .legal-toc-list a:focus { color: var(--brand-ink); text-decoration: none; }
.legal-toc-sub { margin-top: 8px; padding-left: var(--sp-4); border-left: 2px solid var(--line); }
.legal-toc-sub li + li { margin-top: 6px; }
.legal-toc-sub a { color: var(--text-3); }

/* 正文卡片 */
.legal-doc {
  min-width: 0;
  padding: var(--sp-8);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.legal-doc h2 {
  margin: var(--sp-8) 0 var(--sp-4);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--line-2);
  font-size: var(--fs-xl);
  font-weight: 800;
  line-height: 1.3;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.legal-doc > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.legal-doc h3 {
  margin: var(--sp-6) 0 var(--sp-3);
  font-size: var(--fs-md);
  font-weight: 800;
  color: var(--brand-ink);
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.legal-doc p { margin: 0 0 var(--sp-4); font-size: var(--fs-base); line-height: 1.85; color: var(--text-2); }
.legal-doc strong { color: var(--text); font-weight: 700; }
.legal-doc ul, .legal-doc ol { margin: 0 0 var(--sp-4); padding-left: 1.5em; }
.legal-doc li { font-size: var(--fs-base); line-height: 1.85; color: var(--text-2); }
.legal-doc li + li { margin-top: 6px; }
.legal-doc blockquote {
  margin: 0 0 var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface-2);
  border-left: 3px solid var(--brand-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.legal-doc blockquote p { margin: 0; font-size: var(--fs-sm); }
.legal-doc blockquote p + p { margin-top: 4px; }

/* 表格：协议里有三列宽表，窄屏必须能横向滚 */
.legal-table-wrap {
  margin: 0 0 var(--sp-5);
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
}
.legal-doc table { width: 100%; min-width: 520px; border-collapse: collapse; }
.legal-doc th, .legal-doc td {
  padding: 10px 14px;
  font-size: var(--fs-sm);
  line-height: 1.7;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line-2);
}
.legal-doc th { background: var(--surface-2); color: var(--text); font-weight: 800; white-space: nowrap; }
.legal-doc td { color: var(--text-2); }
.legal-doc tbody tr:last-child td { border-bottom: 0; }

/* 协议页页脚：三列缩为两列（品牌 + 法律 + 返回） */
.footer-legal {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--sp-6);
}

@media (max-width: 980px) {
  .legal-layout { grid-template-columns: 1fr; gap: var(--sp-6); padding: 36px 0 64px; }
  .legal-toc { position: static; max-height: none; }
  .legal-doc { padding: var(--sp-6); }
  .legal-doc table { min-width: 460px; }
  .footer-legal { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .legal-hero { padding: 40px 0 32px; }
  .legal-hero h1 { font-size: var(--fs-xl); }
  .legal-doc h2 { font-size: var(--fs-lg); }
  .footer-legal { grid-template-columns: 1fr; gap: var(--sp-5); }
}

/* ========== Help page（help.html） ========== */
/* 由 tools/gen-help-html.js 生成，零 JavaScript；页面骨架复用上方 Legal pages 段，
   本段只负责「常见问题」的 <details> 折叠样式（浏览器原生交互，无脚本）。 */
.help-faq {
  margin: var(--sp-5) 0 0;
}

.help-faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}

.help-faq-item + .help-faq-item {
  margin-top: var(--sp-3);
}

.help-faq-item > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4);
  font-size: var(--fs-base);
  font-weight: 700;
  line-height: 1.6;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

/* 去掉 Safari / Chrome 默认三角，改用自绘箭头（展开时旋转 90°） */
.help-faq-item > summary::-webkit-details-marker { display: none; }
.help-faq-item > summary::after {
  content: '';
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: rotate(-45deg);
  transition: transform .2s ease;
}
.help-faq-item[open] > summary::after { transform: rotate(45deg); }
.help-faq-item > summary:hover { background: var(--surface-2); }

.help-faq-body {
  padding: var(--sp-1) var(--sp-4) var(--sp-4);
  border-top: 1px solid var(--line);
}

/* 折叠区内的段落/列表：去掉首尾多余外边距，避免展开后上下留白过大 */
.help-faq-body > p:first-child { margin-top: var(--sp-4); }
.help-faq-body > *:last-child { margin-bottom: 0; }
.help-faq-body ol,
.help-faq-body ul { padding-left: 1.5em; }

/* 协议页允许打印 / 另存为 PDF —— 法务与平台核验常需要纸质件 */
@media print {
  .site-header, .legal-toc, .skip-link, .legal-sibling, .legal-hero .eyebrow { display: none !important; }
  body { background: #fff; }
  .legal-hero { background: none; border-bottom: 0; padding: 0 0 var(--sp-4); }
  .legal-hero h1 { font-size: var(--fs-xl); }
  .legal-layout { display: block; padding: 0; }
  .legal-doc { padding: 0; border: 0; box-shadow: none; }
  .legal-table-wrap { overflow: visible; }
  .legal-doc table { min-width: 0; }
  .legal-doc h2, .legal-doc h3 { break-after: avoid; }
  .legal-doc tr, .legal-doc li { break-inside: avoid; }
}
