/* =========================================
   SafeW 全站共享样式
   ========================================= */

:root {
  /* 色板 */
  --color-dark: #19102D;
  --color-paper: #F4F3F7;
  --color-body: #191523;
  --color-brand: #5214EB;
  --color-accent: #D66EED;

  /* 结构 Token */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;

  /* 排版 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

/* 取色覆盖层 */
.dark-surface {
  --text-main: var(--color-paper);
  --text-sub: rgba(244, 243, 247, 0.75);
  --text-link: var(--color-accent);
  --bg-surface: var(--color-dark);
  --accent-use: var(--color-accent);
}

.paper-surface {
  --text-main: var(--color-body);
  --text-sub: rgba(25, 21, 35, 0.65);
  --text-link: var(--color-brand);
  --bg-surface: var(--color-paper);
  --accent-use: var(--color-brand);
}

/* 基础重置 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background-color: var(--color-paper);
  color: var(--color-body);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* 容器 */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* 排版 */
h1, h2, h3, h4 { line-height: 1.1; letter-spacing: -0.02em; font-weight: 800; color: var(--text-main); }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); margin-bottom: 0.5em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 0.6em; }
h3 { font-size: 1.25rem; margin-bottom: 0.4em; }
p { margin-bottom: 1em; max-width: 38em; }
.text-sub { color: var(--text-sub); }

/* 眉标 */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5em;
  color: var(--text-link);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  height: 52px;
  padding: 0 1.5em;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.btn:focus-visible { outline: 2px solid var(--accent-use); outline-offset: 3px; }
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border: 1px solid currentColor;
}
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* 链接 */
a { color: var(--text-link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { opacity: 0.85; }

/* 区块容器 */
.section-wrap {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  background-color: var(--bg-surface);
  position: relative;
}
.section-wrap + .section-wrap::before {
  content: "";
  display: block;
  height: 1px;
  background-color: currentColor;
  opacity: 0.12;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

/* 卡片 */
.card {
  background: color-mix(in srgb, var(--bg-surface) 92%, white);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  margin-bottom: var(--gap);
}

/* 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--gap);
}
.data-table th, .data-table td {
  text-align: left;
  padding: 0.8em 1em;
  border-bottom: 1px solid color-mix(in srgb, var(--text-main) 12%, transparent);
}
.data-table th { font-weight: 700; color: var(--text-main); }
.data-table td { color: var(--text-sub); }

/* FAQ */
.faq-item { border-bottom: 1px solid color-mix(in srgb, var(--text-main) 12%, transparent); }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1.2em 0;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-weight: 400; font-size: 1.2em; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { padding-bottom: 1.2em; color: var(--text-sub); }

/* 页头 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-paper);
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo-img { height: 32px; width: auto; vertical-align: middle; }
.nav-links { display: flex; gap: 2em; list-style: none; }
.nav-links a { color: var(--color-body); text-decoration: none; font-weight: 500; }
.nav-links a[aria-current="page"], .nav-links a:hover { color: var(--color-brand); }
.mobile-toggle { display: none; background: none; border: none; cursor: pointer; }

/* 页脚 */
.site-footer {
  padding: 3em 0;
  border-top: 1px solid rgba(25, 21, 35, 0.08);
  background-color: var(--color-paper);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
}
.footer-col h4 { font-size: 0.9rem; margin-bottom: 0.8em; color: var(--color-body); }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.5em; }
.footer-col a { color: var(--text-sub); text-decoration: none; font-size: 0.9rem; }
.footer-col a:hover { color: var(--color-brand); }
.copyright { margin-top: 2em; font-size: 0.85rem; color: var(--text-sub); text-align: center; }

/* 响应式 */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-toggle { display: block; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* =========================================
   SVG 动效系统
   ========================================= */
.svg-visual {
  width: 100%;
  height: auto;
  max-width: 600px;
  overflow: visible;
}

/* 线条绘制 */
@keyframes draw-line {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}
.draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-line 6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* 气泡浮动 */
@keyframes float-bubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.float {
  animation: float-bubble 5s ease-in-out infinite;
}

/* 输入点呼吸 */
@keyframes pulse-dot {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}
.pulse {
  animation: pulse-dot 2.4s ease-in-out infinite;
}
.pulse:nth-child(2) { animation-delay: 0.2s; }
.pulse:nth-child(3) { animation-delay: 0.4s; }

/* 通知滑入 */
@keyframes slide-in {
  0%, 10% { transform: translateX(20px); opacity: 0; }
  20%, 80% { transform: translateX(0); opacity: 1; }
  90%, 100% { transform: translateX(20px); opacity: 0; }
}
.slide-in {
  animation: slide-in 8s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

/* 几何旋转拼合 */
@keyframes rotate-merge {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(180deg); }
  100% { transform: rotate(360deg); }
}
.rotate-merge {
  animation: rotate-merge 12s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .draw, .float, .pulse, .slide-in, .rotate-merge {
    animation: none !important;
  }
}
