/* ============================================
   声韵记（Cadence Recorder）— Official Site
   Modern minimal light theme
   ============================================ */

:root {
  --brand: #4f5bd5;
  --brand-strong: #3d49c0;
  --brand-soft: #eef0fe;
  --brand-ring: rgba(79, 91, 213, 0.16);
  --accent: #0fb5c9;
  --accent-soft: #e5f8fb;
  --ink: #171a21;
  --ink-2: #555d6b;
  --ink-3: #8a91a0;
  --line: #e7e9f2;
  --bg: #ffffff;
  --bg-soft: #f7f8fc;
  --danger: #e5484d;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(23, 26, 33, 0.05);
  --shadow-md: 0 10px 30px -12px rgba(23, 26, 33, 0.16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- Language switching ---------- */
html[data-lang="zh"] [data-lang="en"] { display: none !important; }
html[data-lang="en"] [data-lang="zh"] { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 26px; border-radius: 999px; border: 1px solid transparent;
  font-size: 15px; font-weight: 600; line-height: 1.3;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .12s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-light { background: #fff; color: var(--brand); }
.btn-light:hover { background: var(--brand-soft); }
.btn-sm { padding: 8px 18px; font-size: 14px; }
.btn-lg { padding: 15px 34px; font-size: 16px; }
.btn-block { width: 100%; }

/* ---------- Navigation ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand svg { flex: none; }
.brand img { flex: none; border-radius: 9px; }
.brand-text { display: inline-flex; flex-direction: column; line-height: 1.18; }
.brand-zh { font-size: 16.5px; font-weight: 800; letter-spacing: 0.06em; color: var(--ink); }
.brand-en { font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; color: var(--ink-3); }
.nav-links { display: flex; gap: 26px; margin-left: 8px; }
.nav-links a { font-size: 14.5px; color: var(--ink-2); font-weight: 500; transition: color .15s; }
.nav-links a:hover { color: var(--brand); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.lang-toggle {
  display: inline-flex; align-items: center; border: 1px solid var(--line);
  border-radius: 999px; padding: 3px; background: var(--bg-soft);
}
.lang-toggle button {
  border: 0; background: transparent; border-radius: 999px;
  padding: 4px 12px; font-size: 13px; font-weight: 600; color: var(--ink-3);
  transition: background .15s, color .15s;
}
.lang-toggle button.active { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }

.nav-menu-btn {
  display: none; border: 1px solid var(--line); background: #fff;
  border-radius: 10px; width: 38px; height: 38px;
  align-items: center; justify-content: center; color: var(--ink);
}

.mobile-menu {
  display: none; border-top: 1px solid var(--line);
  background: #fff; padding: 10px 24px 18px;
}
.mobile-menu a { display: block; padding: 11px 4px; font-size: 15px; color: var(--ink-2); border-bottom: 1px solid var(--bg-soft); }
.site-nav.nav-open .mobile-menu { display: block; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 84px 0 96px;
  background:
    radial-gradient(52% 60% at 82% 8%, var(--brand-soft) 0%, rgba(238, 240, 254, 0) 70%),
    radial-gradient(40% 48% at 6% 92%, var(--accent-soft) 0%, rgba(229, 248, 251, 0) 70%),
    var(--bg);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 16px; font-size: 13px; font-weight: 600; color: var(--ink-2);
  box-shadow: var(--shadow-sm); margin-bottom: 22px;
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.hero h1 { font-size: 46px; line-height: 1.18; letter-spacing: -0.02em; font-weight: 800; margin-bottom: 20px; }
.hero h1 .grad { color: var(--brand); }
.hero-sub { font-size: 17px; color: var(--ink-2); max-width: 540px; margin-bottom: 32px; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 30px; }

.hero-langs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hero-langs .chip {
  font-size: 12.5px; color: var(--ink-2); background: #fff;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
}
.hero-langs .chip.more { color: var(--brand); border-color: var(--brand-ring); background: var(--brand-soft); font-weight: 600; }

/* ---------- Phone mockup ---------- */
.hero-visual { display: flex; justify-content: center; position: relative; }
.phone {
  width: 312px; border-radius: 44px; padding: 12px;
  background: #171a21; box-shadow: var(--shadow-md);
  position: relative;
}
.phone::after {
  content: ""; position: absolute; top: 22px; left: 50%; transform: translateX(-50%);
  width: 96px; height: 24px; border-radius: 999px; background: #171a21; z-index: 2;
}
.phone-screen {
  background: linear-gradient(180deg, #fbfbfe 0%, #f4f6fc 100%);
  border-radius: 34px; padding: 52px 18px 22px; min-height: 560px;
  display: flex; flex-direction: column; gap: 14px;
}
.app-top { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--ink-3); }
.app-top .rec { display: inline-flex; align-items: center; gap: 6px; color: var(--danger); font-weight: 700; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.app-timer { text-align: center; font-size: 34px; font-weight: 800; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; color: var(--ink); }

.wave { display: flex; align-items: center; justify-content: center; gap: 3px; height: 64px; padding: 0 4px; }
.wave i {
  width: 4px; border-radius: 999px; background: var(--brand);
  height: calc(var(--h) * 56px + 6px);
  animation: wave 1.15s ease-in-out var(--d, 0s) infinite;
  transform-origin: center;
}
.wave i:nth-child(4n) { background: var(--accent); }
@keyframes wave { 0%, 100% { transform: scaleY(0.35); } 50% { transform: scaleY(1); } }

.app-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; box-shadow: var(--shadow-sm);
}
.app-card .label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; color: var(--brand); margin-bottom: 6px;
}
.app-card .label.summary { color: #8a5cf6; }
.app-card p, .app-card li { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.app-card ul { display: grid; gap: 4px; }
.app-card li::before { content: "·"; color: var(--brand); font-weight: 800; margin-right: 6px; }

.app-bottom { margin-top: auto; display: flex; justify-content: center; padding-top: 6px; }
.record-btn {
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--brand); border: 5px solid var(--brand-soft);
  display: flex; align-items: center; justify-content: center;
}
.record-btn::after { content: ""; width: 20px; height: 20px; border-radius: 6px; background: #fff; }

/* ---------- Sections ---------- */
.section { padding: 92px 0; scroll-margin-top: 72px; }
.section-alt { background: var(--bg-soft); }
.section-head { max-width: 680px; margin: 0 auto 56px; text-align: center; }
.section-head .eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--brand); background: var(--brand-soft); border-radius: 999px;
  padding: 6px 14px; margin-bottom: 16px;
}
.section-head h2 { font-size: 34px; line-height: 1.25; letter-spacing: -0.015em; font-weight: 800; margin-bottom: 14px; }
.section-head p { font-size: 16px; color: var(--ink-2); }

/* ---------- Features ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 26px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.section-alt .feature-card { background: #fff; }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--brand-ring); }
.feature-icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
}
.feature-icon.teal { background: var(--accent-soft); color: var(--accent); }
.feature-icon.violet { background: #f1ecfe; color: #7c5cf0; }
.feature-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.01em; }
.feature-card p { font-size: 14.5px; color: var(--ink-2); }
.feature-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.feature-tags span {
  font-size: 12px; font-weight: 600; color: #7c5cf0;
  background: #f1ecfe; border-radius: 999px; padding: 4px 11px;
}

/* ---------- Workflow ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step {
  position: relative; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px 26px;
}
.step-num {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 800; font-size: 16px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.step h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.step p { font-size: 14.5px; color: var(--ink-2); }
.step .step-arrow {
  position: absolute; top: 44px; right: -20px; color: var(--ink-3); z-index: 1;
}
.step:last-child .step-arrow { display: none; }

/* ---------- Platforms ---------- */
.platform-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.platform-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 26px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.platform-card .p-icon {
  width: 56px; height: 56px; border-radius: 16px; background: var(--bg-soft);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: var(--ink); letter-spacing: 0.02em;
}
.platform-card .p-logo { width: 56px; height: 56px; border-radius: 16px; }
.platform-card h3 { font-size: 18px; font-weight: 700; }
.platform-card p { font-size: 14px; color: var(--ink-2); min-height: 44px; }

/* ---------- Languages ---------- */
.lang-cloud { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 860px; margin: 0 auto; }
.lang-cloud .chip {
  font-size: 14px; color: var(--ink-2); background: #fff;
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 18px;
  transition: all .15s ease;
}
.lang-cloud .chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.lang-cloud .chip.dialect { background: var(--bg-soft); }
.lang-cloud .chip.more { color: var(--brand); font-weight: 600; border-style: dashed; border-color: var(--brand-ring); }
.lang-note { text-align: center; margin-top: 22px; font-size: 13px; color: var(--ink-3); }

/* ---------- FAQ ---------- */
.faq-list { max-width: 760px; margin: 0 auto; display: grid; gap: 12px; }
.faq-item {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0 22px; transition: border-color .15s;
}
.faq-item[open] { border-color: var(--brand-ring); }
.faq-item summary {
  cursor: pointer; padding: 18px 0; font-weight: 600; font-size: 15.5px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-size: 20px; color: var(--brand); font-weight: 600; flex: none;
  transition: transform .2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-body { padding: 0 0 18px; color: var(--ink-2); font-size: 14.5px; }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--brand);
  background-image: radial-gradient(60% 120% at 85% 20%, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 60%);
  padding: 72px 0; text-align: center; color: #fff;
}
.cta-band h2 { font-size: 30px; font-weight: 800; letter-spacing: -0.015em; margin-bottom: 12px; }
.cta-band p { opacity: 0.86; margin-bottom: 30px; font-size: 15.5px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--line); padding: 56px 0 36px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; margin-bottom: 44px; }
.footer-brand p { font-size: 14px; color: var(--ink-2); margin-top: 14px; max-width: 300px; }
.footer-col h4 { font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.footer-col a, .footer-col span { display: block; font-size: 14px; color: var(--ink-2); padding: 5px 0; }
.footer-col a:hover { color: var(--brand); }
.footer-col .mail { color: var(--brand); font-weight: 600; word-break: break-all; }
.footer-bottom {
  border-top: 1px solid var(--line); padding-top: 24px;
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
  font-size: 13px; color: var(--ink-3);
}

/* ---------- Legal pages ---------- */
.page-hero { padding: 64px 0 40px; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.015em; margin: 10px 0 8px; }
.page-hero .meta { font-size: 13.5px; color: var(--ink-3); }
.back-link { font-size: 14px; color: var(--brand); font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }

.legal { padding: 56px 0 96px; }
.legal-inner { max-width: 780px; margin: 0 auto; }
.legal h2 { font-size: 20px; font-weight: 700; margin: 34px 0 12px; letter-spacing: -0.01em; }
.legal h2:first-child { margin-top: 0; }
.legal p { color: var(--ink-2); font-size: 15px; margin-bottom: 12px; }
.legal ul { margin: 0 0 12px; display: grid; gap: 8px; }
.legal ul li { color: var(--ink-2); font-size: 15px; padding-left: 20px; position: relative; }
.legal ul li::before { content: ""; position: absolute; left: 4px; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.legal strong { color: var(--ink); }
.legal .contact-box {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 20px 22px; margin-top: 14px; font-size: 14.5px; color: var(--ink-2);
}
.legal .contact-box a { color: var(--brand); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero h1 { font-size: 38px; }
  .hero-sub { max-width: 100%; }
  .feature-grid, .platform-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .step .step-arrow { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-menu-btn { display: inline-flex; }
  .nav-cta-desktop { display: none; }
}

@media (max-width: 640px) {
  .hero { padding: 56px 0 64px; }
  .hero h1 { font-size: 31px; }
  .hero-sub { font-size: 15.5px; }
  .section { padding: 64px 0; }
  .section-head h2 { font-size: 26px; }
  .feature-grid, .platform-grid { grid-template-columns: 1fr; }
  .phone { width: 288px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .cta-band h2 { font-size: 24px; }
  .btn-lg { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wave i, .rec-dot { animation: none !important; }
  * { transition: none !important; }
}

/* ---------- 协议页自适应：main.js detectPlatform() 按 UA 给 body 加 platform-mobile / platform-app ---------- */
.legal .legal-loading, .legal .legal-error { color: var(--ink-3); font-size: 14px; text-align: center; padding: 24px 0; }
.legal .legal-error { color: var(--ink-2); }

/* 移动端 / H5（含 App 内嵌 WebView 或系统浏览器）：收紧留白、全宽排版，字号轻度下调 */
@media (max-width: 640px) {
  .legal { padding: 28px 0 56px; }
  .legal-inner { max-width: none; }
  .legal h2 { font-size: 18px; margin: 26px 0 10px; }
  .legal p, .legal ul li { font-size: 14.5px; }
  .page-hero { padding: 40px 0 24px; }
  .page-hero h1 { font-size: 26px; }
}

body.platform-mobile .legal { padding: 32px 0 64px; }
body.platform-mobile .legal-inner { max-width: none; }
body.platform-mobile .legal h2 { font-size: 18px; margin: 28px 0 10px; }
body.platform-mobile .legal p, body.platform-mobile .legal ul li { font-size: 14.5px; }
body.platform-mobile .page-hero { padding: 44px 0 28px; }
body.platform-mobile .page-hero h1 { font-size: 27px; }

body.platform-app .legal { padding: 24px 0 48px; }
body.platform-app .legal-inner { max-width: none; }
body.platform-app .legal h2 { font-size: 17.5px; margin: 26px 0 10px; }
body.platform-app .legal p, body.platform-app .legal ul li { font-size: 14px; }
body.platform-app .page-hero { padding: 36px 0 22px; }
