/* =========================================
   SafeW 全局样式与 SVG 动效
   ========================================= */

/* --- 设计 Token --- */
:root {
  /* 配色 */
  --color-dark: #17203F;
  --color-paper: #FCFCFD;
  --color-text: #151823;
  --color-brand: #1441EB;
  --color-accent: #6EEDBD;
  
  /* 结构变量 */
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(21, 24, 35, 0.3);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1280px;
  
  /* 排版 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --lh-tight: 1.1;
  --lh-normal: 1.75;
}

/* --- 基础重置 --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background-color: var(--color-paper);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: opacity 0.2s ease; }
a:hover { opacity: 0.85; }
button, [role="button"] { cursor: pointer; font: inherit; border: none; background: none; }

/* --- 布局容器 --- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: 1.5rem;
}
.section {
  padding-block: var(--section-y);
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: center; overflow-x: hidden; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }

/* --- 排版 --- */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}
.text-on-dark .badge { color: var(--color-accent); }
.text-on-paper .badge { color: var(--color-brand); }

h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: var(--lh-tight);
  color: inherit;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 1.5rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; max-width: 38em; }
.hl { font-weight: 800; }
.text-on-dark .hl { color: var(--color-accent); }
.text-on-paper .hl { color: var(--color-brand); }

/* --- 组件：按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 52px;
  padding-inline: 1.5rem;
  border-radius: var(--radius-btn);
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(110, 237, 189, 0.4);
}
.btn-secondary {
  border: 1px solid currentColor;
  color: inherit;
}
.text-on-paper .btn-secondary { color: var(--color-text); border-color: var(--color-text); }
.text-on-dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* --- 组件：卡片 --- */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: 0 14px 32px -12px rgba(21, 24, 35, 0.35); }
.text-on-dark .card { background: var(--color-paper); color: var(--color-text); }

/* --- 组件：表格 --- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  text-align: left;
}
th, td { padding: 0.75rem 1rem; border-bottom: 1px solid rgba(21, 24, 35, 0.1); }
th { font-weight: 700; }
.text-on-dark th, .text-on-dark td { border-color: rgba(252, 252, 253, 0.15); }

/* --- 组件：FAQ --- */
details {
  border: 1px solid rgba(21, 24, 35, 0.1);
  border-radius: var(--radius-card);
  margin-bottom: 0.75rem;
  padding: 1rem 1.25rem;
  transition: background 0.2s ease;
}
details[open] { background: rgba(20, 65, 235, 0.03); }
.summary {
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.summary::-webkit-details-marker { display: none; }
.summary::after { content: "+"; font-weight: 400; font-size: 1.25rem; transition: transform 0.2s ease; }
details[open] .summary::after { transform: rotate(45deg); }
.summary p { margin: 0; }
.details-content { margin-top: 0.75rem; color: #444; }

/* --- 页头 / 页脚 --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(252, 252, 253, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(21, 24, 35, 0.08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 0.75rem; font-weight: 800; font-size: 1.1rem; }
.brand img { height: 32px; width: auto; }
.nav { display: flex; gap: 1.5rem; align-items: center; }
.nav a { font-weight: 600; font-size: 0.95rem; }
.nav a[aria-current="page"] { color: var(--color-brand); }
.footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding-block: 3rem;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-col h4 { font-size: 1rem; margin-bottom: 0.75rem; color: var(--color-accent); }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { color: rgba(252, 252, 253, 0.8); font-size: 0.9rem; }
.footer-bottom {
  border-top: 1px solid rgba(252, 252, 253, 0.1);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(252, 252, 253, 0.5);
}

/* --- SVG 动效系统 --- */
.svg-container { width: 100%; height: auto; overflow: visible; }
svg { width: 100%; height: auto; display: block; }

/* 轨道呼吸 */
@keyframes orbit-breathe {
  0%, 100% { transform: scale(0.96); opacity: 0.6; }
  50% { transform: scale(1.04); opacity: 1; }
}
.anim-orbit { animation: orbit-breathe 8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-orbit-delayed { animation: orbit-breathe 8s ease-in-out infinite; animation-delay: -4s; transform-box: fill-box; transform-origin: center; }

/* 气泡上浮 */
@keyframes bubble-float {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50% { transform: translateY(-6px); opacity: 1; }
}
.anim-bubble { animation: bubble-float 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-bubble-alt { animation: bubble-float 5s ease-in-out infinite; animation-delay: -2s; transform-box: fill-box; transform-origin: center; }

/* 描边绘制 */
@keyframes draw-stroke {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw-stroke 3s ease forwards; transform-box: fill-box; transform-origin: center; }

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  .anim-orbit, .anim-orbit-delayed, .anim-bubble, .anim-bubble-alt, .anim-draw {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* --- 响应式微调 --- */
@media (max-width: 768px) {
  .header-inner { flex-direction: row; }
  .nav { display: none; } /* 简化移动端导航处理 */
  h1 { font-size: 2.2rem; }
  .hero-layout { grid-template-columns: 1fr !important; }
}
