/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* --- 设计变量 --- */
:root {
  /* 色板 */
  --bg-dark: #140E25;
  --bg-paper: #F5F0E5;
  --text-body: #191523;
  --brand: #5214EB;
  --accent: #C8ED6E;
  
  /* 结构 Token */
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1280px;
  
  /* 排版 */
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --lh-tight: 1.25;
  --lh-body: 1.55;
  --fw-head: 600;
  --fw-bold: 800;
}

/* --- 基础重置与排版 --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-main);
  background-color: var(--bg-paper);
  color: var(--text-body);
  line-height: var(--lh-body);
  font-size: 16px;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* --- 容器与网格 --- */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }

/* --- 表面层变量覆盖 --- */
.surface-dark {
  --bg-surface: var(--bg-dark);
  --text-surface: var(--bg-paper);
  --brand-surface: var(--accent);
  --accent-surface: var(--accent);
  --border-surface: rgba(245, 240, 229, 0.15);
}
.surface-paper {
  --bg-surface: var(--bg-paper);
  --text-surface: var(--text-body);
  --brand-surface: var(--brand);
  --accent-surface: var(--accent);
  --border-surface: rgba(25, 21, 35, 0.1);
}
.surface-light-card {
  --bg-surface: #FFFFFF;
  --text-surface: var(--text-body);
  --brand-surface: var(--brand);
  --accent-surface: var(--brand);
}

/* --- 区块通用 --- */
.section {
  padding-block: var(--section-y);
  background-color: var(--bg-surface, transparent);
  color: var(--text-surface, var(--text-body));
  position: relative;
}
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: var(--fw-head);
  line-height: var(--lh-tight);
  margin-bottom: calc(var(--gap) * 1.5);
  letter-spacing: 0;
  text-wrap: balance;
}
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-surface);
  margin-bottom: var(--gap);
}
.section-label::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 2px;
  background-color: currentColor;
}
.hl { color: var(--brand-surface); }

/* --- 按钮 --- */
.btn-group { display: flex; flex-wrap: wrap; gap: var(--gap); margin-top: var(--gap); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.btn:focus-visible { outline: 3px solid var(--accent-surface); outline-offset: 2px; }
.btn-primary {
  background-color: var(--accent-surface);
  color: var(--bg-dark);
  border: none;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(200, 237, 110, 0.25); }
.btn-secondary {
  background: transparent;
  color: var(--text-surface);
  border: 1px solid var(--text-surface);
}
.btn-secondary:hover { background-color: rgba(255,255,255,0.05); }
.surface-paper .btn-secondary:hover { background-color: rgba(25, 21, 35, 0.05); }

/* --- 卡片与面板 --- */
.card {
  background-color: var(--bg-surface, #FFFFFF);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 14px 32px -12px rgba(25, 21, 35, 0.35); }
.panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-surface);
  border-radius: 12px;
  padding: var(--gap);
  position: relative;
  overflow: hidden;
}
.panel-inner { position: relative; z-index: 2; }

/* --- 表格 --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-surface);
}
.data-table th { font-weight: 600; color: var(--brand-surface); }
.data-table tr:last-child td { border-bottom: none; }
.surface-paper .data-table th { color: var(--brand); }
.surface-paper .data-table td { color: var(--text-body); }

/* --- FAQ --- */
.faq-item {
  border: 1px solid var(--border-surface);
  border-radius: var(--radius-card);
  margin-bottom: var(--gap);
  overflow: hidden;
}
.faq-item summary {
  padding: 16px;
  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.2rem;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 16px 16px; color: var(--text-surface); opacity: 0.9; line-height: var(--lh-body); }

/* --- 导航与页脚 --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-dark);
  border-bottom: 1px solid rgba(245, 240, 229, 0.1);
  backdrop-filter: blur(8px);
}
.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}
.brand img { height: 32px; width: auto; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-link { font-size: 0.95rem; font-weight: 500; opacity: 0.85; transition: opacity 0.2s; color: #f5f0e5; }
.nav-link:hover, .nav-link[aria-current="page"] { opacity: 1; color: var(--accent); }
.site-footer {
  background-color: var(--bg-dark);
  color: var(--bg-paper);
  padding: 48px 0;
  border-top: 1px solid rgba(245, 240, 229, 0.1);
  font-size: 0.9rem;
}
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--gap); }
.footer-links { display: flex; gap: 16px; }
.footer-links a { opacity: 0.7; transition: opacity 0.2s; }
.footer-links a:hover { opacity: 1; }

/* --- SVG 动效系统 --- */
.svg-container { width: 100%; height: auto; max-width: 100%; }
.svg-panel { width: 100%; height: auto; }
/* 描边自绘 */
.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 4s ease forwards;
}
@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
/* 漂浮 */
.anim-float {
  animation: floatPanel 5s ease-in-out infinite;
}
@keyframes floatPanel {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
/* 呼吸 */
.anim-breathe {
  animation: breatheOpacity 3s ease-in-out infinite;
}
@keyframes breatheOpacity {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
/* 滑入 */
.anim-slide-in {
  animation: slideIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@keyframes slideIn {
  0% { transform: translateX(-16px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
/* 流程箭头流动 */
.anim-flow {
  stroke-dasharray: 0.2 0.8;
  animation: dashFlow 1.5s linear infinite;
}
@keyframes dashFlow {
  to { stroke-dashoffset: -1; }
}

/* 旋转中心修正 */
.rot-center { 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;
  }
  .anim-draw, .anim-float, .anim-breathe, .anim-slide-in, .anim-flow {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* --- 响应式微调 --- */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero-layout { flex-direction: column-reverse; }
  .timeline-axis::before { display: none; }
  .timeline-item { padding-left: 0 !important; }
}
