/* ============================================================
   产品定义 · 子页共享样式 (pages/pd/*)
   ----------------------------------------------------
   引用顺序：tokens-editorial.css → _subpage.css → 页内 style
============================================================ */

/* ★ 全局键盘可见焦点环 · WCAG 2.4.7 Focus Visible */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
button:focus-visible,
a:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
textarea:focus-visible,
input:focus-visible {
  outline: none;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft, rgba(255,107,61,0.20));
}

:root[data-theme="light"] {
  /* ★ 近白色板 · 整体色调贴近 hume.ai */
  --bg-1: #FBFAF7;   /* 主背景：近白 + 一丝暖意 */
  --bg-2: #FFFFFF;   /* 卡片底：纯白 */
  --bg-3: #F2F0EB;   /* 深层：极淡暖灰，做层次/marquee/footer */
  --bg-dark: #1A1A1A;
  --bg-card: #FFFFFF;

  --tx-1: rgba(28,28,28,0.95);
  --tx-2: rgba(28,28,28,0.68);
  --tx-3: rgba(28,28,28,0.55);   /* AA 达标：≈ 5.0:1 on #FBFAF7 */
  --tx-4: rgba(28,28,28,0.22);

  --border-1: rgba(28,28,28,0.09);
  --border-2: rgba(28,28,28,0.16);
  --border-3: rgba(28,28,28,0.30);

  --grid: rgba(28,28,28,0.06);

  --accent: #FF6B3D;
  --accent-deep: #D14618;
  --accent-bg: #FFD7C2;
  --accent-soft: #FFEEE3;

  --nav-bg: rgba(251,250,247,0.85);
}

:root[data-theme="dark"] {
  --bg-1: #141414;
  --bg-2: #1D1D1D;
  --bg-3: #242424;
  --bg-dark: #080808;
  --bg-card: #1D1D1D;

  --tx-1: rgba(248,247,241,0.94);
  --tx-2: rgba(248,247,241,0.66);
  --tx-3: rgba(248,247,241,0.55);   /* AA 达标 dark mode */
  --tx-4: rgba(248,247,241,0.20);

  --border-1: rgba(248,247,241,0.08);
  --border-2: rgba(248,247,241,0.14);
  --border-3: rgba(248,247,241,0.28);

  --grid: rgba(248,247,241,0.05);

  --accent: #FF9269;
  --accent-deep: #FF6B3D;
  --accent-bg: #5C2A18;
  --accent-soft: #36180E;

  --nav-bg: rgba(20,20,20,0.85);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; transition: background-color 320ms ease; }
body {
  margin: 0;
  background: var(--bg-1);
  color: var(--tx-1);
  font-family: 'Inter', 'Noto Sans SC', -apple-system, 'PingFang SC', sans-serif;
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: 0;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 320ms ease, color 320ms ease;
}
a { color: inherit; text-decoration: none; transition: color 220ms ease; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--accent-bg); color: var(--tx-1); }

/* Chinese italic fix */
i {
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
  font-family: 'Fraunces', serif;
}
.emp { font-style: normal; color: var(--accent-deep); font-weight: 600; }
em { font-style: normal; color: var(--accent-deep); font-weight: 600; }

.num {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-feature-settings: 'tnum', 'cv11';
  letter-spacing: -0.02em;
}
.num-display {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-feature-settings: 'tnum', 'cv11';
  letter-spacing: -0.04em;
}

.h-display, .h1, .h2, .h3 {
  font-family: 'Fraunces', 'Noto Serif SC', serif;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--tx-1);
  margin: 0;
}

.container { max-width: 1180px; margin: 0 auto; padding: 0 32px; }
.container--narrow { max-width: 820px; }
.section { padding: 96px 0; position: relative; }
.section--alt { background: var(--bg-3); }
@media (max-width: 640px) { .container { padding: 0 20px; } .section { padding: 64px 0; } }

/* Top nav */
.topnav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border-1);
  padding: 14px 0;
  transition: all 320ms ease;
}
.topnav__inner {
  max-width: 1440px; margin: 0 auto; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.topnav__brand {
  font-family: 'Fraunces', 'Noto Serif SC', serif;
  font-weight: 700; font-size: 19px; color: var(--tx-1);
  display: flex; align-items: center; gap: 8px;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.topnav__brand i { font-style: italic; color: var(--accent); }
.topnav__brand-icon {
  width: 22px; height: 22px;
  border-radius: 5px;
  flex-shrink: 0;
}
.topnav__nav { display: flex; gap: 28px; align-items: center; }
.topnav__nav a { color: var(--tx-2); font-size: 14px; font-weight: 500; }
.topnav__nav a:hover { color: var(--tx-1); }
.topnav__actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  width: 36px; height: 36px; border-radius: 9999px;
  border: 1px solid var(--border-2); background: transparent;
  color: var(--tx-2); cursor: pointer;
  display: grid; place-items: center;
  transition: all 220ms ease;
}
.theme-toggle:hover { background: var(--bg-2); color: var(--tx-1); border-color: var(--border-3); }
.theme-toggle svg { width: 16px; height: 16px; transition: transform 320ms ease; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
.theme-toggle:hover svg { transform: rotate(20deg); }
@media (max-width: 768px) { .topnav__nav { display: none; } }

/* Breadcrumb */
.crumb {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  font-size: 13px; font-weight: 500;
  color: var(--tx-3);
  margin-bottom: 24px;
}
.crumb a {
  color: var(--tx-3);
  transition: color 220ms ease;
}
.crumb a:hover { color: var(--accent); }
.crumb__sep { opacity: 0.5; }
.crumb__current { color: var(--tx-1); font-weight: 600; }

/* Buttons */
.btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  font-size: 13px; line-height: 17px; font-weight: 600;
  letter-spacing: 0.28px; text-transform: uppercase;
  border-radius: 9999px;
  border: 1px solid var(--tx-1); background: transparent; color: var(--tx-1);
  cursor: pointer; overflow: hidden;
  transition: all 200ms ease;
  white-space: nowrap; text-decoration: none;
}
.btn::before {
  content: ""; position: absolute; top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  pointer-events: none; transition: left 0s;
}
.btn:hover::before { left: 100%; transition: left 1500ms ease; }
.btn--solid { background: var(--tx-1); color: var(--bg-1); }
.btn--accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--accent:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn--ghost { color: var(--tx-1); border-color: var(--border-3); }
.btn--ghost:hover { background: var(--tx-1); color: var(--bg-1); border-color: var(--tx-1); }
.btn .arrow { display: inline-block; transition: transform 200ms ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* Label */
.label {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  font-size: 13px; line-height: 17px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent-deep);
}
.label::before { content: ""; display: inline-block; width: 24px; height: 1px; background: var(--accent-deep); }

/* Typography */
.h-display { font-size: clamp(40px, 5.5vw, 64px); line-height: 1.12; }
.h1 { font-size: clamp(32px, 4vw, 48px); line-height: 1.15; }
.h2 { font-size: clamp(28px, 3.4vw, 42px); line-height: 1.18; max-width: 720px; }
.h3 { font-size: 22px; line-height: 1.3; font-weight: 600; }
.lede { font-size: 19px; line-height: 1.6; color: var(--tx-2); max-width: 600px; }
.body { font-size: 17px; line-height: 1.7; color: var(--tx-1); }
.body-sm { font-size: 15px; line-height: 1.6; color: var(--tx-2); }
.mono { font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: 0.04em; }

/* Hero */
.subhero { padding: 64px 0 48px; }
.subhero__inner { max-width: 820px; }
.subhero__title { margin: 18px 0 24px; }
.subhero__lede { margin-bottom: 32px; }
.subhero__meta {
  display: flex; gap: 32px; flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid var(--border-1);
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--tx-3);
}
.subhero__meta strong {
  font-family: 'Fraunces', 'Noto Serif SC', serif;
  font-weight: 700; font-size: 18px;
  color: var(--tx-1);
  letter-spacing: 0;
  text-transform: none;
  margin-left: 6px;
}
.subhero__meta .num-display { color: var(--accent-deep); }

/* Footer */
.footer {
  margin-top: 96px;
  background: var(--bg-dark); color: rgba(245,244,238,0.78);
  padding: 80px 0 40px;
}
.footer__inner { max-width: 1440px; margin: 0 auto; padding: 0 32px; }
.footer__top {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 32px; margin-bottom: 64px;
}
.footer__col h4 {
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 20px; padding-bottom: 12px;
  border-bottom: 1px solid rgba(245,244,238,0.12);
}
.footer__col a {
  display: block; font-size: 14px;
  color: rgba(245,244,238,0.62);
  margin-bottom: 12px;
  transition: color 220ms ease;
}
.footer__col a:hover { color: var(--accent); }
.footer__bottom {
  border-top: 1px solid rgba(245,244,238,0.10);
  padding-top: 24px;
  display: flex; justify-content: space-between; align-items: end;
  flex-wrap: wrap; gap: 24px;
}
.footer__logo {
  font-family: 'Fraunces', serif;
  font-style: italic; font-weight: 700;
  font-size: clamp(56px, 7vw, 88px);
  line-height: 0.9; letter-spacing: -0.02em;
  color: var(--accent);
}
.footer__meta {
  font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 500;
  color: rgba(245,244,238,0.42); letter-spacing: 0.10em;
  display: flex; gap: 20px; flex-wrap: wrap;
}
@media (max-width: 900px) { .footer__top { grid-template-columns: 1fr 1fr; gap: 36px; } }
@media (max-width: 600px) { .footer__top { grid-template-columns: 1fr; } }

/* Reveal */
.reveal {
  opacity: 0; transform: translate3d(0, 24px, 0);
  transition: opacity 700ms cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 700ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.reveal.is-in { opacity: 1; transform: translate3d(0, 0, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
