/* ============================================================
   Prismway 官网样式 —— 遵循「Clear Prism 清晰棱镜」设计语言
   设计令牌来源：docs/08-UI-UX设计规范.md §2
   ============================================================ */

:root {
  --brand-primary: #3B5BFF;
  --brand-secondary: #7B4DFF;
  --brand-gradient: linear-gradient(135deg, #3B5BFF 0%, #7B4DFF 100%);
  --success: #00B578;
  --warning: #FF9F0A;
  --error: #FF3B30;
  --surface-primary: #FFFFFF;
  --surface-secondary: #F5F6F8;
  --surface-elevated: #FFFFFF;
  --text-primary: #1A1D26;
  --text-secondary: #6B7280;
  --border: rgba(26, 29, 38, 0.08);
  --shadow-card: 0 2px 8px rgba(26, 29, 38, 0.04);
  --shadow-float: 0 8px 24px rgba(26, 29, 38, 0.08);
  --radius-card: 16px;
  --radius-button: 12px;
  --radius-input: 10px;
  --max-width: 1120px;
  --nav-height: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface-primary: #14161D;
    --surface-secondary: #1C1E26;
    --surface-elevated: #242833;
    --text-primary: #F2F3F7;
    --text-secondary: #9AA0AE;
    --border: rgba(255, 255, 255, 0.08);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.24);
    --shadow-float: 0 8px 24px rgba(0, 0, 0, 0.32);
    --success: #14C787;
    --warning: #FFAD1F;
    --error: #FF5247;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-height) + 16px); }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro", "Segoe UI", Roboto,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--surface-primary);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

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

.mono { font-variant-numeric: tabular-nums; }

/* ---------- 导航 ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  z-index: 100;
  background: color-mix(in srgb, var(--surface-primary) 82%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.2px;
}
.nav-logo:hover { text-decoration: none; }
.nav-logo img { width: 28px; height: 28px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text-primary); background: var(--surface-secondary); text-decoration: none; }
.nav-links a.active { color: var(--brand-primary); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px !important;
  border-radius: 999px !important;
  background: var(--brand-gradient);
  color: #fff !important;
  font-weight: 600 !important;
}
.nav-cta:hover { opacity: 0.92; background: var(--brand-gradient) !important; }

.lang-switch {
  position: relative;
  margin-left: 8px;
}

.lang-switch button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-primary);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.lang-switch button:hover { color: var(--text-primary); border-color: var(--text-secondary); }

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  box-shadow: var(--shadow-float);
  padding: 6px;
  display: none;
}
.lang-menu.open { display: block; }
.lang-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
}
.lang-menu button:hover { background: var(--surface-secondary); }
.lang-menu button.current { color: var(--brand-primary); font-weight: 600; }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-primary);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
  padding: calc(var(--nav-height) + 88px) 0 96px;
  text-align: center;
  background:
    radial-gradient(ellipse 60% 50% at 50% -10%, rgba(59, 91, 255, 0.14), transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 10%, rgba(123, 77, 255, 0.10), transparent 70%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-secondary);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 24px;
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }

.hero h1 {
  font-size: clamp(34px, 6vw, 60px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.hero h1 .gradient-text {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  font-size: clamp(16px, 2.4vw, 20px);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-button);
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: 0 4px 16px rgba(59, 91, 255, 0.32);
}
.btn-primary:hover { opacity: 0.94; }

.btn-secondary {
  background: var(--surface-primary);
  border-color: var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover { border-color: var(--text-secondary); }

.hero-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ---------- 通用区块 ---------- */
.section { padding: 88px 0; }
.section.alt { background: var(--surface-secondary); }

.section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 56px;
}

.section-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-primary);
  margin-bottom: 12px;
}

.section-head h2 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.section-head p { color: var(--text-secondary); font-size: 16px; }

/* ---------- 卡片网格 ---------- */
.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.section:not(.alt) .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-float); }
.section.alt .card { background: var(--surface-elevated); }

.card-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(59,91,255,0.10), rgba(123,77,255,0.10));
  color: var(--brand-primary);
  margin-bottom: 16px;
  font-size: 22px;
}

.card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.card p { color: var(--text-secondary); font-size: 14px; }

.card ul { list-style: none; margin-top: 12px; }
.card ul li {
  position: relative;
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 6px;
}
.card ul li::before {
  content: "";
  position: absolute;
  left: 2px; top: 8px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand-primary);
}

/* ---------- 三模式 ---------- */
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.mode-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 32px 28px;
  background: var(--surface-primary);
  overflow: hidden;
}
.mode-card.featured { border-color: transparent; background: var(--brand-gradient); color: #fff; }
.mode-card.featured p, .mode-card.featured li { color: rgba(255,255,255,0.85) !important; }
.mode-card.featured ul li::before { background: #fff; }

.mode-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-secondary);
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.mode-card.featured .mode-tag { background: rgba(255,255,255,0.18); color: #fff; }

.mode-card h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.mode-card > p { color: var(--text-secondary); font-size: 14px; margin-bottom: 14px; }
.mode-card ul { list-style: none; }
.mode-card ul li { position: relative; padding-left: 20px; font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
.mode-card ul li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-primary); }

/* ---------- 特性横排（图文交替） ---------- */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  padding: 40px 0;
}
.feature-row + .feature-row { border-top: 1px solid var(--border); }
.feature-row.reverse .feature-media { order: 2; }

.feature-row h3 { font-size: 24px; font-weight: 800; margin-bottom: 12px; letter-spacing: -0.01em; }
.feature-row p { color: var(--text-secondary); margin-bottom: 16px; }

.check-list { list-style: none; }
.check-list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
  color: var(--text-secondary);
  font-size: 14px;
}
.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0; top: 0;
  width: 20px; height: 20px;
  color: var(--success);
  font-weight: 700;
}

.feature-media {
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background: var(--surface-secondary);
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ---------- 模拟手机界面 ---------- */
.phone-mock {
  width: 240px;
  border-radius: 28px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-float);
  padding: 20px 16px;
  margin: 24px 0;
}
.phone-mock .pm-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-secondary); margin-bottom: 16px;
}
.phone-mock .pm-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.phone-mock .pm-button {
  width: 96px; height: 96px;
  border-radius: 50%;
  margin: 8px auto 16px;
  background: var(--brand-gradient);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
  box-shadow: 0 6px 20px rgba(59,91,255,0.35);
}
.phone-mock .pm-line {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-secondary);
  font-size: 13px;
  margin-bottom: 8px;
}
.phone-mock .pm-line .latency { color: var(--success); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- 合规/安全横幅 ---------- */
.trust-band {
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  padding: 32px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  background: var(--surface-primary);
}
.trust-item { text-align: center; }
.trust-item .num { font-size: 28px; font-weight: 800; background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.trust-item .label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* ---------- CTA ---------- */
.cta {
  text-align: center;
  border-radius: 24px;
  padding: 72px 32px;
  background: var(--brand-gradient);
  color: #fff;
}
.cta h2 { font-size: clamp(24px, 4vw, 36px); font-weight: 800; margin-bottom: 14px; }
.cta p { color: rgba(255,255,255,0.85); max-width: 520px; margin: 0 auto 28px; }
.cta .btn-light {
  background: #fff;
  color: var(--brand-primary);
  font-weight: 700;
}
.cta .btn-light:hover { opacity: 0.92; }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 56px 0 32px;
  background: var(--surface-secondary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}

.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; margin-bottom: 12px; }
.footer-brand img { width: 26px; height: 26px; }
.footer p.desc { color: var(--text-secondary); font-size: 13px; max-width: 280px; }

.footer h4 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); margin-bottom: 14px; }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 10px; }
.footer ul a { color: var(--text-primary); font-size: 14px; }
.footer ul a:hover { color: var(--brand-primary); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ---------- 文档/法律页面 ---------- */
.page-main { padding: calc(var(--nav-height) + 56px) 0 96px; }

.doc-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.doc-toc {
  position: sticky;
  top: calc(var(--nav-height) + 32px);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  background: var(--surface-primary);
  max-height: calc(100vh - var(--nav-height) - 64px);
  overflow: auto;
}
.doc-toc h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); margin-bottom: 12px; }
.doc-toc a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}
.doc-toc a:hover { background: var(--surface-secondary); color: var(--text-primary); text-decoration: none; }

.doc-content { min-width: 0; }
.doc-content h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 8px; }
.doc-content .doc-updated { color: var(--text-secondary); font-size: 13px; margin-bottom: 36px; }
.doc-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 44px 0 14px;
  padding-top: 12px;
}
.doc-content h3 { font-size: 17px; font-weight: 700; margin: 26px 0 10px; }
.doc-content p { margin-bottom: 12px; color: var(--text-primary); }
.doc-content ul, .doc-content ol { margin: 0 0 14px 22px; color: var(--text-primary); }
.doc-content li { margin-bottom: 6px; }
.doc-content strong { font-weight: 700; }

.doc-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 20px;
  font-size: 14px;
  display: block;
  overflow-x: auto;
}
.doc-content th, .doc-content td {
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--border);
  vertical-align: top;
}
.doc-content th { background: var(--surface-secondary); font-weight: 600; white-space: nowrap; }

.doc-content code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
}
.doc-content pre {
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 16px;
  overflow-x: auto;
  margin: 0 0 16px;
}
.doc-content pre code { background: none; border: none; padding: 0; }

.callout {
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand-primary);
  border-radius: var(--radius-input);
  background: var(--surface-secondary);
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 14px;
}
.callout.warning { border-left-color: var(--warning); }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .grid.cols-3, .grid.cols-4, .modes { grid-template-columns: repeat(2, 1fr); }
  .trust-band { grid-template-columns: repeat(2, 1fr); }
  .feature-row { grid-template-columns: 1fr; gap: 24px; }
  .feature-row.reverse .feature-media { order: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .doc-layout { grid-template-columns: 1fr; }
  .doc-toc { position: static; max-height: none; }
}

@media (max-width: 640px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .modes { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .hero { padding: calc(var(--nav-height) + 56px) 0 64px; }

  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface-primary);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px 20px;
    gap: 4px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; font-size: 15px; }
  .lang-switch { margin: 8px 0 0; }
  .lang-menu { position: static; box-shadow: none; border: none; padding: 0 0 0 12px; }
  .lang-menu.open { display: flex; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
