/* DSH Mobile site — design system (site-plan.md §3)
   Zero external resources. System font stack. Dark-first (respects prefers-color-scheme). */

:root {
  color-scheme: dark;

  /* palette (from DSH-Mobile brand: docs/design/README.md) */
  --brand-500: #4D6BFE;
  --brand-400: #5A77FF;
  --brand-600: #2E47DB;
  --accent: #4ADE80;

  --bg: #0F1115;
  --bg-soft: #12161F;
  --surface: #161B26;
  --surface-2: #1B2230;
  --hairline: rgba(255, 255, 255, 0.08);
  --text: #E9EDF5;
  --text-dim: #9AA6BD;
  --text-faint: #8B95AB;   /* ≥4.5:1 on --bg（0F1115）——WCAG AA（review 修复） */

  --grad-brand: linear-gradient(135deg, var(--brand-400) 0%, var(--brand-600) 100%);

  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
          "Helvetica Neue", "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #F7F8FC;
    --bg-soft: #FFFFFF;
    --surface: #FFFFFF;
    --surface-2: #F0F2FA;
    --hairline: rgba(20, 30, 60, 0.10);
    --text: #141A2A;
    --text-dim: #4C586F;
    --text-faint: #5A6478;   /* ≥4.5:1 on --bg（F7F8FC）——WCAG AA（review 修复） */
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Skip link (a11y) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--brand-500);
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus { left: 8px; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.brand img, .brand svg { width: 30px; height: 30px; display: block; }
.brand .wordmark { white-space: nowrap; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.main-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: color .15s ease, background .15s ease;
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav a[aria-current="page"] { color: var(--text); font-weight: 600; }
.main-nav a.cta {
  margin-left: 8px;
  color: #fff !important;
  background: var(--grad-brand);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 46px; height: 46px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.nav-toggle:hover { background: var(--surface-2); border-color: rgba(90, 119, 255, 0.4); }

/* hamburger icon — 3 bars, morphs to an X when the menu is open */
.nav-icon {
  position: relative;
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: background .2s ease;
}
.nav-icon::before,
.nav-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .2s ease, top .2s ease;
}
.nav-icon::before { top: -6px; }
.nav-icon::after  { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-icon { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-icon::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-icon::after  { top: 0; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 72px;
  text-align: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -30% -20% auto;
  height: 130%;
  background:
    radial-gradient(38% 52% at 50% 8%, rgba(90, 119, 255, 0.22), transparent 70%),
    radial-gradient(22% 30% at 78% 22%, rgba(74, 222, 128, 0.08), transparent 70%);
  pointer-events: none;
}

.hero .container { position: relative; }

.hero-mark {
  width: 84px; height: 84px;
  margin: 0 auto 26px;
  display: block;
  filter: drop-shadow(0 12px 30px rgba(46, 71, 219, 0.35));
}

.hero h1 {
  margin: 0 auto;
  max-width: 15ch;
  font-size: clamp(2.3rem, 6vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 720;
}
.hero p.lead {
  margin: 22px auto 0;
  max-width: 58ch;
  color: var(--text-dim);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 620;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  color: #fff;
  background: var(--grad-brand);
  box-shadow: 0 8px 24px rgba(46, 71, 219, 0.35);
}
.btn-primary:hover { box-shadow: 0 12px 30px rgba(46, 71, 219, 0.45); }
.btn-secondary {
  color: var(--text);
  border-color: var(--hairline);
  background: var(--surface);
}
.btn-secondary:hover { background: var(--surface-2); }
.badge { font-size: 13px; color: var(--text-faint); margin-top: 18px; }

/* ---------- Sections ---------- */
.section { padding: 68px 0; border-top: 1px solid var(--hairline); }
.section > .container { position: relative; }

.section-head { margin-bottom: 40px; }
.section-kicker {
  color: var(--brand-400);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.section h2 {
  margin: 10px 0 0;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-weight: 700;
}
.section .sub {
  margin-top: 12px;
  color: var(--text-dim);
  max-width: 62ch;
}

/* feature cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: transform .15s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); border-color: rgba(90, 119, 255, 0.4); }
.card .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--grad-brand);
  color: #fff;
  font-size: 20px;
  margin-bottom: 16px;
}
.card h3 { margin: 0 0 8px; font-size: 19px; font-weight: 660; }
.card p { margin: 0; color: var(--text-dim); font-size: 15.5px; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.step { padding: 24px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); }
.step .n {
  display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--grad-brand); color: #fff; font-size: 14px; font-weight: 700;
  margin-bottom: 12px;
}
.step h3 { margin: 0 0 6px; font-size: 17px; font-weight: 660; }
.step p { margin: 0; color: var(--text-dim); font-size: 15px; }
/* vertical guide stepper (setup page): steps flow top→bottom so the install
   command block gets full container width; the number badge rides a left rail. */
.steps-rail { display: block; }
.steps-rail .step {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr;
  column-gap: 20px;
  align-items: start;
  padding: 0 0 40px;
  background: none;
  border: none;
  border-radius: 0;
}
.steps-rail .step:last-child { padding-bottom: 0; }
.steps-rail .step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 19px;                  /* badge centre (40px rail) */
  top: 40px;                   /* just below the badge */
  bottom: 6px;
  width: 1px;
  background: var(--hairline);
}
.steps-rail .n {
  grid-column: 1;
  grid-row: 1;
  width: 40px; height: 40px;
  font-size: 17px;
  margin: 0;
  justify-self: start;
  align-self: start;
}
.steps-rail .step > :not(.n) { grid-column: 2; }
.steps-rail .step h3 { margin: 10px 0 10px; font-size: 19px; }
.steps-rail .step p  { margin: 0 0 10px; font-size: 16px; line-height: 1.65; }
.steps-rail .step p:last-child { margin-bottom: 0; }
.steps-rail .step pre { margin: 14px 0; }
.steps-rail .step ul { margin: 0 0 10px; }
.steps-rail .step li { color: var(--text-dim); font-size: 16px; margin-bottom: 6px; }
.steps-rail .step .note-sm { font-size: 15px; }

code {
  font-family: var(--mono); font-size: 0.9em;
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: 6px; padding: 1px 7px;
}
pre {
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: 12px; padding: 16px 18px; overflow-x: auto;
}
pre code { background: none; border: none; padding: 0; }

/* table (features matrix) */
.table-wrap { overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--hairline); }
thead th { background: var(--surface); font-weight: 620; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface); }
td .minus { color: var(--text-faint); }

/* faq */
.faq-item { border: 1px solid var(--hairline); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 10px; }
.faq-item summary {
  padding: 16px 18px; cursor: pointer; font-weight: 600; font-size: 16px;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--text-faint); font-size: 20px; transition: transform .15s ease; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .a { padding: 0 18px 16px; color: var(--text-dim); font-size: 15.5px; }

/* policy pages */
.policy { max-width: 760px; margin: 0 auto; }
.policy h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); letter-spacing: -0.02em; }
.policy .meta { color: var(--text-faint); font-size: 14px; margin: 8px 0 30px; }
.policy h2 { font-size: 1.4rem; margin: 2em 0 0.7em; letter-spacing: -0.01em; }
.policy h3 { font-size: 1.16rem; margin: 1.6em 0 0.5em; }
.policy p, .policy li { color: var(--text-dim); font-size: 16.5px; }
.policy a { color: var(--brand-400); text-decoration: underline; text-underline-offset: 3px; }
.policy hr { border: none; border-top: 1px solid var(--hairline); margin: 2.4em 0; }
.policy blockquote {
  margin: 1.4em 0; padding: 14px 18px;
  border-left: 3px solid var(--brand-500);
  background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-dim); font-size: 15px;
}

/* footer */
.site-footer { border-top: 1px solid var(--hairline); padding: 52px 0 36px; margin-top: 40px; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
.site-footer h4 { margin: 0 0 12px; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); }
.site-footer a { display: block; color: var(--text-dim); text-decoration: none; font-size: 15px; padding: 4px 0; }
.site-footer a:hover { color: var(--text); }
.site-footer .fine { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--hairline); color: var(--text-faint); font-size: 13.5px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.site-footer .about-line { color: var(--text-dim); font-size: 15px; max-width: 46ch; margin-top: 8px; }

/* pages */
.page-head { padding: 72px 0 12px; }
.page-head h1 { margin: 0; font-size: clamp(2rem, 5vw, 2.9rem); letter-spacing: -0.03em; }
.page-head .sub { color: var(--text-dim); margin-top: 10px; max-width: 62ch; }
.content { padding: 44px 0 20px; }
.content h2 { font-size: 1.5rem; margin: 2em 0 0.7em; }

/* spacing/width helpers（由类驱动——行内 style 与 CSP style-src 'self' 冲突，禁止新增） */
.sp-44 { margin-bottom: 44px; }
.sp-56 { margin-bottom: 56px; }
.mt-16 { margin-top: 16px; }
.mw-860 { max-width: 860px; margin-left: auto; margin-right: auto; }
.note-sm { margin-top: 10px; color: var(--text-dim); font-size: 15px; }
.list-sm { margin: 0; padding-left: 18px; color: var(--text-dim); font-size: 15px; }
.list-dim { color: var(--text-dim); }

/* a11y & motion */
:focus-visible { outline: 2px solid var(--brand-400); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* mobile nav */
@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute;
    top: 64px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--hairline);
    padding: 12px 16px 16px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 14px; font-size: 16px; }
  .main-nav a.cta { margin-left: 0; }
  .hero { padding: 64px 0 52px; }
  .section { padding: 50px 0; }
  .site-footer .cols { grid-template-columns: 1fr; }
  /* guide stepper on narrow screens: drop the left rail, full-width content */
  .steps-rail .step { display: block; padding: 0 0 30px; }
  .steps-rail .step:not(:last-child)::after { display: none; }
  .steps-rail .n { display: inline-flex; margin-bottom: 12px; }
  .steps-rail .step h3 { margin: 0 0 8px; font-size: 18px; }
}

/* very small screens: stack hero CTAs full-width (removes wrap dependency) */
@media (max-width: 480px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .hero p.lead { overflow-wrap: anywhere; }
}
