/* =========================================
   SafeW 全局设计变量与基础样式
   ========================================= */
:root {
  /* 色板 */
  --bg-dark: #10112D;
  --bg-paper: #F5F0E5;
  --text-body: #151523;
  --color-brand: #1416EB;
  --color-accent: #89ED6E;

  /* 结构 Token */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 1px solid rgba(21, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;

  /* 排版 Token */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --line-height-base: 1.65;
  --line-height-tight: 1.1;
  --letter-tight: -0.02em;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg-paper);
  color: var(--text-body);
  line-height: var(--line-height-base);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color 0.2s; }
ul, ol { list-style: none; }

/* =========================================
   布局与容器
   ========================================= */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
.section {
  padding: var(--section-y) 0;
  position: relative;
}
.section-divider {
  height: 1px;
  background: rgba(21, 21, 35, 0.12);
  margin: 0;
}

/* 面层级控制 */
.dark-surface {
  background: var(--bg-dark);
  color: var(--bg-paper);
}
.dark-surface .brand-text,
.dark-surface .link-accent { color: var(--color-accent); }
.dark-surface h1, .dark-surface h2, .dark-surface h3,
.dark-surface p, .dark-surface li { color: var(--bg-paper); }
.light-card {
  background: var(--bg-paper);
  color: var(--text-body);
  border-radius: var(--radius-card);
  padding: var(--gap);
  border: var(--card-border);
}
.light-card h1, .light-card h2, .light-card h3,
.light-card p, .light-card li { color: var(--text-body); }
.light-card .brand-text,
.light-card .link-accent { color: var(--color-brand); }

/* =========================================
   排版系统
   ========================================= */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}
.dark-surface .badge { color: var(--color-accent); }
.light-surface .badge { color: var(--color-brand); }

h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-tight);
  margin-bottom: 1rem;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: var(--letter-tight);
  margin-bottom: 1.5rem;
}
h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}
p { margin-bottom: 1rem; max-width: 38em; }
.text-hl { color: var(--color-brand); font-weight: 700; }
.dark-surface .text-hl { color: var(--color-accent); }

/* =========================================
   组件：按钮
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 1.5rem;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
  border: none;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--bg-dark);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(0.95); }
.btn-secondary {
  background: transparent;
  color: var(--text-body);
  border: 2px solid var(--text-body);
}
.dark-surface .btn-secondary { color: var(--bg-paper); border-color: var(--bg-paper); }
.btn-secondary:hover { transform: translateY(-2px); opacity: 0.85; }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

/* =========================================
   组件：卡片与网格
   ========================================= */
.card-grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}
.feature-card {
  background: var(--bg-paper);
  color: var(--text-body);
  border-radius: var(--radius-card);
  padding: var(--gap);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}
.dark-surface .feature-card {
  background: rgba(245, 240, 229, 0.08);
  border-color: rgba(245, 240, 229, 0.15);
}

/* =========================================
   组件：表格
   ========================================= */
.platform-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}
.platform-table th, .platform-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(21, 21, 35, 0.1);
  text-align: left;
}
.platform-table th { font-weight: 700; background: rgba(21, 21, 35, 0.04); }
.dark-surface .platform-table th { background: rgba(245, 240, 229, 0.06); border-color: rgba(245, 240, 229, 0.1); }
.dark-surface .platform-table td { border-color: rgba(245, 240, 229, 0.1); }

/* =========================================
   组件：FAQ (Details/Summary)
   ========================================= */
.faq-item {
  border: var(--card-border);
  border-radius: var(--radius-card);
  margin-bottom: 0.75rem;
  background: var(--bg-paper);
  overflow: hidden;
}
.dark-surface .faq-item { background: rgba(245, 240, 229, 0.06); border-color: rgba(245, 240, 229, 0.15); }
.faq-item summary {
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 400;
  transition: transform 0.2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .answer {
  padding: 0 1.5rem 1.25rem;
  font-size: 0.95rem;
  line-height: 1.7;
  opacity: 0.9;
}

/* =========================================
   组件：时间线
   ========================================= */
.timeline { counter-reset: step; }
.timeline-step {
  position: relative;
  padding-left: 3.5rem;
  margin-bottom: 2rem;
}
.timeline-step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0; top: 0;
  width: 2.5rem; height: 2.5rem;
  background: var(--color-accent);
  color: var(--bg-dark);
  font-weight: 800;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.dark-surface .timeline-step::before { background: var(--color-accent); color: var(--bg-dark); }

/* =========================================
   SVG 动效体系
   ========================================= */
.svg-panel { width: 100%; height: auto; max-width: 100%; }
.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawStroke 5s ease-in-out infinite;
}
@keyframes drawStroke {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}
.anim-float {
  animation: floatMove 6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes floatMove {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.anim-breathe {
  animation: breathePulse 3s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes breathePulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
.anim-slide-in {
  animation: slideIn 4s ease-out forwards;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes slideIn {
  0% { transform: translateX(20px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
.anim-flow {
  stroke-dasharray: 0.2 0.8;
  animation: flowDash 2s linear infinite;
}
@keyframes flowDash {
  to { stroke-dashoffset: -1; }
}

/* =========================================
   响应式与无障碍
   ========================================= */
@media (max-width: 768px) {
  .grid-2col { grid-template-columns: 1fr !important; }
  h1 { font-size: clamp(2rem, 8vw, 3rem); }
  h2 { font-size: clamp(1.4rem, 5vw, 2rem); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .anim-draw, .anim-float, .anim-breathe, .anim-slide-in, .anim-flow {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
/* =========================================
   页头与页脚
   ========================================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(245, 240, 229, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(21, 21, 35, 0.08);
}
.dark-surface .site-header { background: rgba(16, 17, 45, 0.92); border-color: rgba(245, 240, 229, 0.1); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo-wrap { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.1rem; }
.logo-img { width: 32px; height: 32px; object-fit: contain; }
.nav-links { display: flex; gap: 1.5rem; font-weight: 500; font-size: 0.95rem; }
.nav-links a.current { color: var(--color-brand); font-weight: 700; }
.dark-surface .nav-links a.current { color: var(--color-accent); }
.nav-links a:hover { opacity: 0.75; }

.site-footer {
  background: var(--bg-dark);
  color: var(--bg-paper);
  padding: 3rem 0;
  font-size: 0.9rem;
}
.footer-inner {
  display: flex; flex-direction: column; gap: 1.5rem;
  align-items: center; text-align: center;
}
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.footer-links a { opacity: 0.8; }
.footer-links a:hover { opacity: 1; color: var(--color-accent); }
.footer-copy { opacity: 0.6; margin-top: 1rem; }
