/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* 设计变量与色板 */
:root {
  /* 核心色彩 */
  --color-dark: #140E25;
  --color-paper: #F7F5F3;
  --color-paper-light: #EDEAE6;
  --color-body: #191523;
  --color-brand: #5214EB;
  --color-accent: #C8ED6E;

  /* 组件参数 */
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;

  /* 排版基准 */
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --fs-hero: clamp(2.2rem, 5vw, 3.8rem);
  --fs-h2: clamp(1.6rem, 3vw, 2.4rem);
  --fs-body: 16px;
  --lh-body: 1.65;
}

/* 基础重置与全局 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 100%; }
body {
  font-family: var(--font-main);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-body);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
ul, ol { list-style: none; }

/* 容器与布局 */
.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;
}

/* 表面层颜色覆盖规则 */
.surface-dark { background-color: var(--color-dark); color: var(--color-paper); }
.surface-dark .hl, .surface-dark .brand-text { color: var(--color-accent); }
.surface-dark a:not(.btn) { color: var(--color-accent); }

.surface-paper { background-color: var(--color-paper); color: var(--color-body); }
.surface-paper .hl, .surface-paper .brand-text { color: var(--color-brand); }
.surface-paper a:not(.btn) { color: var(--color-brand); }

.surface-paper-light { background-color: var(--color-paper-light); color: var(--color-body); }
.surface-paper-light .hl, .surface-paper-light .brand-text { color: var(--color-brand); }
.surface-paper-light a:not(.btn) { color: var(--color-brand); }

/* 眉标与标题 */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.surface-dark .eyebrow { color: var(--color-accent); }
.surface-paper .eyebrow, .surface-paper-light .eyebrow { color: var(--color-brand); }

h1 {
  font-size: var(--fs-hero);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
  margin-bottom: var(--gap);
}
h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}
p { margin-bottom: 1rem; max-width: 38em; }
.hl { font-weight: 700; }

/* 按钮系统 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 52px;
  padding: 0 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  border: none;
}
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { background-color: #b8dc5f; }

.btn-secondary {
  background: transparent;
  border: 1.5px solid currentColor;
  color: inherit;
}
.surface-dark .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.surface-paper .btn-secondary { border-color: var(--color-body); color: var(--color-body); }
.btn-secondary:hover { opacity: 0.85; }

/* 导航与页头 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(247, 245, 243, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
  padding: 0.75rem 0;
}
.surface-dark .site-header { background-color: rgba(20, 14, 37, 0.95); border-bottom-color: rgba(247, 245, 243, 0.1); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo-area { display: flex; align-items: center; gap: 0.75rem; }
.logo-area img { height: 32px; width: auto; }
.nav-list { display: flex; gap: 1.5rem; align-items: center; }
.nav-link { font-weight: 500; font-size: 0.95rem; }
.nav-link[aria-current="page"] { color: var(--color-brand); font-weight: 700; }
.surface-dark .nav-link[aria-current="page"] { color: var(--color-accent); }

/* 卡片网格 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
}
.card {
  background: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.surface-dark .card { background: rgba(247, 245, 243, 0.06); border: 1px solid rgba(247, 245, 243, 0.1); }
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px -12px rgba(25, 21, 35, 0.4); }

/* 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}
.surface-dark .data-table th, .surface-dark .data-table td { border-bottom-color: rgba(247, 245, 243, 0.1); }
.data-table th { font-weight: 700; width: 40%; }

/* FAQ 折叠面板 */
.faq-item {
  border: 1px solid rgba(25, 21, 35, 0.1);
  border-radius: var(--radius-card);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.surface-dark .faq-item { border-color: rgba(247, 245, 243, 0.15); }
.faq-item summary {
  padding: 1rem 1.25rem;
  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.25rem; transition: transform 0.2s ease; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-answer { padding: 0 1.25rem 1.25rem; line-height: 1.7; }

/* 步骤条 */
.steps-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  counter-reset: step;
}
.step-item {
  flex: 1 1 200px;
  position: relative;
  padding-left: 3rem;
}
.step-num {
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  border-radius: 4px;
  font-size: 0.9rem;
}

/* SVG 容器通用 */
.svg-wrapper {
  width: 100%;
  height: auto;
  max-width: 100%;
  overflow: visible;
}
.svg-wrapper svg { width: 100%; height: auto; }

/* =========================================
   SVG 动效 (@keyframes & 类)
   ========================================= */
/* 同心轨道呼吸 */
@keyframes orbitBreath {
  0%, 100% { transform: scale(0.95); opacity: 0.6; }
  50% { transform: scale(1.05); opacity: 1; }
}
.anim-orbit {
  transform-box: fill-box;
  transform-origin: center;
  animation: orbitBreath 6s ease-in-out infinite;
}
.anim-orbit-delay { animation-delay: -2s; }

/* 气泡浮现与漂浮 */
@keyframes bubblePop {
  0%, 100% { transform: translateY(0); opacity: 0.8; }
  50% { transform: translateY(-6px); opacity: 1; }
}
.anim-bubble {
  transform-box: fill-box;
  transform-origin: center;
  animation: bubblePop 5s ease-in-out infinite;
}

/* 描边流动 */
@keyframes dashFlow {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
.anim-flow {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dashFlow 4s linear infinite;
}

/* 减少动态效果 */
@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; } /* 简化移动端头部，实际项目可加汉堡菜单 */
  .steps-list { flex-direction: column; }
  .card-grid { grid-template-columns: 1fr; }
  h1 { font-size: clamp(1.8rem, 6vw, 2.8rem); }
  h2 { font-size: clamp(1.4rem, 4vw, 2rem); }
}
