/* SafeW 全站共享样式 */
:root {
  /* 色板 */
  --color-dark: #240F29;
  --color-paper: #F6F3F7;
  --color-text: #201523;
  --color-brand: #A711CF;
  --color-accent: #ED6E73;
  --color-light-paper: #EDEAF0;

  /* 设计 Token */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1120px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;

  /* 取色变量（随容器覆盖） */
  --fg-primary: var(--color-text);
  --fg-secondary: var(--color-text);
  --fg-highlight: var(--color-brand);
  --bg-surface: var(--color-paper);
}

/* 基础重置与排版 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg-surface);
  color: var(--fg-primary);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* 布局容器 */
.site-wrapper {
  display: flex;
  min-height: 100vh;
}
.sidebar-nav {
  width: 260px;
  background: var(--color-dark);
  color: var(--color-paper);
  padding: 32px 24px;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.main-content {
  flex: 1;
  margin-left: 260px;
  min-width: 0;
}
.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}

/* 导航链接 */
.nav-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.nav-logo img { width: 32px; height: 32px; object-fit: contain; }
.nav-list { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.nav-link {
  display: block;
  padding: 8px 12px;
  color: var(--color-paper);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--color-accent); }
.mobile-header {
  display: none;
  position: sticky; top: 0; z-index: 90;
  background: var(--color-dark);
  padding: 12px var(--gap);
  align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.mobile-menu-btn { background: none; border: none; color: white; cursor: pointer; padding: 8px; }

/* 区块背景与表面 */
.surface-dark { background: var(--color-dark); color: var(--color-paper); }
.surface-dark .hl { color: var(--color-accent); }
.surface-dark .eyebrow { color: var(--color-accent); }
.surface-dark .btn-primary { background: var(--color-accent); color: var(--color-dark); }
.surface-dark .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.surface-paper { background: var(--color-paper); color: var(--color-text); }
.surface-paper .hl { color: var(--color-brand); }
.surface-paper .eyebrow { color: var(--color-brand); }
.surface-light-paper { background: var(--color-light-paper); color: var(--color-text); }
.surface-light-paper .hl { color: var(--color-brand); }

/* 排版 */
h1, h2, h3, h4 { font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-block: 0.6em; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-block: 0.5em; }
p { max-width: 38em; margin-block: 1em; }
.section-title { margin-bottom: var(--gap); }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.hl { font-weight: 600; }

/* 按钮 */
.btn-group { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 24px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0 24px; height: 48px;
  font-size: 1rem; font-weight: 600;
  text-decoration: none; border: 2px solid transparent;
  cursor: pointer; transition: transform 0.2s ease, filter 0.2s ease;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-secondary { border-color: var(--color-text); color: var(--color-text); background: transparent; }

/* 胶囊与面板 */
.pill-group { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border: 1px solid var(--fg-secondary);
  font-size: 0.9rem; color: var(--fg-secondary);
}
.panel {
  background: var(--bg-surface);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: 24px;
  overflow: hidden;
}
.svg-container { width: 100%; height: auto; max-width: 100%; }
.svg-container svg { width: 100%; height: auto; display: block; }

/* 定义列表（核心功能） */
.feature-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.feature-dl dt { font-weight: 600; font-size: 1.1rem; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 2px solid var(--fg-highlight); display: inline-block; }
.feature-dl dd { margin-left: 0; line-height: 1.6; }

/* 步骤与提示 */
.timeline-step { display: flex; gap: 16px; margin-bottom: 24px; }
.step-num {
  flex-shrink: 0; width: 48px; height: 48px;
  background: var(--color-accent); color: var(--color-dark);
  display: grid; place-items: center; font-weight: 800; font-size: 1.2rem;
}
.step-content h3 { margin-top: 0; font-size: 1.25rem; }
.tip-item { padding: 16px 0; border-bottom: 1px solid rgba(128,128,128,0.2); }
.tip-item:last-child { border-bottom: none; }
.tip-label { font-weight: 700; color: var(--fg-highlight); margin-right: 8px; }

/* 表格 */
.data-table { width: 100%; border-collapse: collapse; margin-block: 24px; table-layout: fixed; }
.data-table th, .data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid rgba(128,128,128,0.3); overflow-wrap: break-word; word-break: break-word; }
.data-table th { font-weight: 600; background: rgba(128,128,128,0.05); }
.data-table tr:last-child td { border-bottom: none; }

/* 卡片（资讯） */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.news-card {
  border: var(--card-border); box-shadow: var(--card-shadow);
  padding: 20px; display: flex; flex-direction: column; gap: 12px;
}
.news-card time { font-size: 0.85rem; color: var(--fg-secondary); }
.news-card p { font-size: 0.95rem; margin: 0; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 16px; }
.faq-item summary {
  padding: 16px; background: rgba(128,128,128,0.05);
  cursor: pointer; font-weight: 600; 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.5rem; font-weight: 300; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { padding: 16px; margin: 0; line-height: 1.7; }

/* SVG 动画基础 */
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 6s ease-in-out infinite; }
.anim-flow { animation: flowDash 8s linear infinite; }
.anim-float { animation: floatY 4s ease-in-out infinite; }
.anim-bubble { animation: popIn 5s ease-in-out infinite; }
.anim-dot { animation: moveDot 6s linear infinite; offset-path: path("M 20 180 Q 100 100 180 140 T 340 120"); }

@keyframes drawLine {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}
@keyframes flowDash {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes popIn {
  0%, 100% { opacity: 0.3; transform: scale(0.95); }
  20%, 80% { opacity: 1; transform: scale(1); }
}
@keyframes moveDot {
  0% { offset-distance: 0%; }
  100% { offset-distance: 100%; }
}

/* 响应式 */
@media (max-width: 900px) {
  .sidebar-nav { display: none; }
  .mobile-header { display: flex; }
  .main-content { margin-left: 0; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-svg-wrap { order: 2; }
  .feature-dl { grid-template-columns: 1fr; }
}
@media (min-width: 901px) {
  .hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--gap); align-items: center; }
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
  .svg-container svg { animation: none !important; }
}
