/* =========================================
   SafeW 全站共享样式
   ========================================= */

:root {
  /* 色板 */
  --color-dark: #271231;
  --color-paper: #F6F3F7;
  --color-body: #1F1523;
  --color-brand: #9E13DD;
  --color-accent: #ED6EC0;

  /* 结构性 Token */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 1px solid;
  --card-shadow: none;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1120px;
  --line-height: 1.65;

  /* 字体 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

/* 基础重置与排版 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--line-height);
  color: var(--color-body);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--color-brand); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-accent); }
a:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: 2px; }

/* 布局容器 */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

/* 页头与页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-paper);
  border-bottom: 1px solid rgba(31, 21, 35, 0.1);
  padding: 16px 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--color-body); }
.brand img { height: 32px; width: auto; }
nav ul { display: flex; gap: 24px; list-style: none; }
nav a { font-weight: 500; font-size: 0.95rem; color: var(--color-body); }
nav a[aria-current="page"] { color: var(--color-brand); pointer-events: none; }
nav a:not([aria-current="page"]):hover { color: var(--color-accent); }

.site-footer {
  padding: 48px 0 32px;
  border-top: 1px solid rgba(31, 21, 35, 0.1);
  margin-top: var(--section-y);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
}
.footer-col h4 { font-size: 0.85rem; font-weight: 700; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-copy { font-size: 0.8rem; color: rgba(31, 21, 35, 0.6); margin-top: 32px; text-align: center; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-btn);
  transition: transform 0.2s, opacity 0.2s;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { transform: translateY(-1px); opacity: 0.9; }
.btn-secondary {
  background: transparent;
  color: var(--color-body);
  border: 1px solid var(--color-body);
}
.btn-secondary:hover { background: rgba(31, 21, 35, 0.05); }

/* 卡片与面板 */
.card {
  background: #fff;
  border: var(--card-border) rgba(31, 21, 35, 0.16);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 24px;
  transition: transform 0.2s;
}
.card:hover { transform: translateY(-2px); }
.panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: 32px;
  color: var(--color-paper);
}
.panel .hl { color: var(--color-accent); }

/* 标题系统 */
.label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: var(--color-brand);
}
.dark-surface .label { color: var(--color-accent); }
h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 24px;
}
h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 12px;
  margin-top: 24px;
}
.text-xl { font-size: clamp(1.1rem, 1.5vw, 1.25rem); }
.muted { color: rgba(31, 21, 35, 0.6); font-size: 0.9rem; }
.dark-surface .muted { color: rgba(246, 243, 247, 0.7); }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid rgba(31, 21, 35, 0.1); }
th { font-weight: 600; background: rgba(31, 21, 35, 0.03); }
td:first-child { font-weight: 600; }
.dark-surface th, .dark-surface td { border-color: rgba(246, 243, 247, 0.1); }
.dark-surface th { background: rgba(246, 243, 247, 0.05); }

/* FAQ */
.faq-item { border-bottom: 1px solid rgba(31, 21, 35, 0.1); }
.faq-item:last-child { border-bottom: none; }
details summary {
  padding: 16px 0;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 32px;
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  transition: transform 0.2s;
}
details[open] summary::after { content: "−"; }
details p { padding-bottom: 16px; line-height: 1.7; }

/* 响应式 */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; gap: 16px; }
  nav ul { gap: 16px; }
  .grid-layout { grid-template-columns: 1fr !important; }
  table { font-size: 0.9rem; }
}

/* SVG 动效核心 */
.hero-svg { width: 100%; height: auto; }
.grid-overlay { transform-origin: center; }
.node { fill: transparent; stroke: var(--color-accent); stroke-width: 2; pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }
.bubble { transform-origin: center; }
.line-flow { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }
.dot-breathe { transform-origin: center; }

@keyframes gridDraw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes floatUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes flowDash {
  to { stroke-dashoffset: -1; }
}
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 1; }
}

.anim-grid .node { animation: gridDraw 3s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate; }
.anim-bubble .bubble { animation: floatUp 4s ease-in-out infinite; }
.anim-line .line-flow { animation: flowDash 2s linear infinite; }
.anim-dot .dot-breathe { animation: breathe 2.5s ease-in-out infinite; }

/* 延迟错开 */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

@media (prefers-reduced-motion: reduce) {
  .anim-grid, .anim-bubble, .anim-line, .anim-dot,
  .node, .bubble, .line-flow, .dot-breathe {
    animation: none !important;
    stroke-dashoffset: 0 !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
