/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* 设计变量 */
:root {
  /* 色板 */
  --color-dark: #1B1231;
  --color-paper: #DBD4ED;
  --color-body: #191523;
  --color-brand: #5214EB;
  --color-accent: #9977EE;

  /* 结构变量 */
  --radius-card: 24px;
  --radius-btn: 999px;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;

  /* 排版变量 */
  --font-main: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --line-height-base: 1.75;
  --line-height-tight: 1.25;
  --letter-spacing-heading: 0;

  /* 语义化文本变量（默认纸面） */
  --text-main: var(--color-body);
  --text-muted: #3A364A;
  --highlight-color: var(--color-brand);
  --border-subtle: rgba(25, 21, 35, 0.08);
}

/* 基础重置 */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  font-size: 16px;
  line-height: var(--line-height-base);
  color: var(--text-main);
  background-color: var(--color-paper);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; letter-spacing: var(--letter-spacing-heading); line-height: var(--line-height-tight); }

/* 布局容器 */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  position: relative;
}
.section + .section {
  border-top: 1px solid var(--border-subtle);
}

/* 页面头部 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(219, 212, 237, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-main);
}
.brand img { width: 32px; height: 32px; object-fit: contain; }
.nav-list { display: flex; gap: 24px; align-items: center; }
.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--text-main); }
.nav-link[aria-current="page"] { font-weight: 600; }

/* 按钮组件 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 28px;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(153, 119, 238, 0.4);
}
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(153, 119, 238, 0.3); }
.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border: 1.5px solid var(--text-main);
}
.btn-secondary:hover { background: rgba(25, 21, 35, 0.05); }
.surface-dark .btn-primary { color: var(--color-dark); }
.surface-dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }

/* 卡片与面板 */
.card {
  background: rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-card);
  padding: var(--gap);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}
.visual-panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: 24px;
  overflow: hidden;
  position: relative;
  max-width: 100%;
  min-width: 0;
}

/* 眉标 */
.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: var(--highlight-color);
}
.surface-dark .section-label { color: var(--color-accent); }

/* 标题与正文 */
.heading-xl { font-size: clamp(2rem, 4.6vw, 3.4rem); }
.heading-lg { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.heading-md { font-size: 1.25rem; }
.text-body { max-width: 38em; }
.hl { color: var(--highlight-color); font-weight: 600; }
.surface-dark .hl { color: var(--color-accent); }

/* 列表与时间线 */
.step-list { counter-reset: step; }
.step-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  margin-bottom: 24px;
  align-items: start;
}
.step-badge {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.surface-dark .step-badge { background: var(--color-accent); color: var(--color-dark); }

/* 表格 */
.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-subtle);
}
.data-table th { font-weight: 600; width: 40%; }
.surface-dark .data-table th, .surface-dark .data-table td { border-color: rgba(255,255,255,0.1); }

/* FAQ */
.faq-item { margin-bottom: 16px; border-bottom: 1px solid var(--border-subtle); padding-bottom: 16px; }
.faq-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.faq-summary {
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
}
.faq-summary::-webkit-details-marker { display: none; }
.faq-summary::after { content: "+"; font-size: 1.2rem; font-weight: 400; transition: transform 0.2s; }
.faq-item[open] .faq-summary::after { transform: rotate(45deg); }
.faq-answer { margin-top: 8px; color: var(--text-muted); line-height: 1.7; }

/* 资讯卡片 */
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--gap); }
.news-card { background: rgba(255,255,255,0.4); border-radius: var(--radius-card); padding: 20px; }
.news-date { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; display: block; }
.news-title { font-weight: 600; margin-bottom: 8px; line-height: 1.4; }
.news-excerpt { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }

/* 页脚 */
.site-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: 48px 0;
  margin-top: 0;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 32px; }
.footer-col h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 16px; color: var(--color-accent); }
.footer-col a { display: block; margin-bottom: 10px; font-size: 0.9rem; opacity: 0.85; transition: opacity 0.2s; }
.footer-col a:hover { opacity: 1; }
.footer-bottom { margin-top: 40px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.1); text-align: center; font-size: 0.8rem; opacity: 0.7; }

/* SVG 动效核心样式 */
.svg-container { width: 100%; height: auto; max-width: 480px; margin: 0 auto; }
svg { width: 100%; height: auto; shape-rendering: geometricPrecision; }
svg path, svg circle, svg rect { transition: transform 0.3s ease; }

/* 描边绘制 */
.draw-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawPath 5s ease-in-out infinite alternate;
}
@keyframes drawPath {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

/* 气泡浮动 */
.float-bubble {
  animation: floatY 6s ease-in-out infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes floatY {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

/* 星点明灭 */
.blink-star {
  animation: blinkOp 4s ease-in-out infinite alternate;
}
@keyframes blinkOp {
  0% { opacity: 0.3; }
  50% { opacity: 0.9; }
  100% { opacity: 0.3; }
}

/* 面板滑入 */
.slide-panel {
  animation: slideIn 7s ease-in-out infinite alternate;
}
@keyframes slideIn {
  0% { transform: translateX(0); }
  100% { transform: translateX(4px); }
}

/* 减少动态效果 */
@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;
  }
}

/* 响应式适配 */
@media (max-width: 768px) {
  .nav-list { display: none; }
  .heading-xl { font-size: clamp(1.8rem, 6vw, 2.6rem); }
  .visual-panel { padding: 16px; }
  .news-grid { grid-template-columns: 1fr; }
}

/* 兜底：裁掉横向溢出 */
div.grid-layout {
  overflow-x: clip;
}
