/* =========================================
   SafeW 全站共享样式
   ========================================= */
:root {
  /* 色板 */
  --color-dark: #10112D;
  --color-paper: #F5F0E5;
  --color-body-text: #151523;
  --color-brand: #1416EB;
  --color-accent: #89ED6E;
  --color-accent-dark: #0A0A1C;

  /* 结构 Token */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(21, 21, 35, 0.3);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

/* 基础重置 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-body-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--color-brand); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: #1a1cf0; }
ul, ol { list-style: none; }

/* 布局容器 */
.container { max-width: var(--content-max); margin-inline: auto; padding-inline: var(--gap); }
section { padding-block: var(--section-y); }

/* 面与取色变量 */
.dark-face { background-color: var(--color-dark); color: var(--color-paper); }
.dark-face h1, .dark-face h2, .dark-face h3, .dark-face p, .dark-face li { color: var(--color-paper); }
.dark-face .eyebrow { color: var(--color-accent); }
.dark-face .hl { color: var(--color-accent); }
.dark-face .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.dark-face .btn-secondary:hover { background-color: rgba(245, 240, 229, 0.1); }
.dark-face .card { background-color: var(--color-paper); color: var(--color-body-text); }
.dark-face .card h3, .dark-face .card p, .dark-face .card li { color: var(--color-body-text); }

.paper-face { background-color: var(--color-paper); color: var(--color-body-text); }
.paper-face .eyebrow { color: var(--color-brand); }
.paper-face .hl { color: var(--color-brand); }

/* 排版 */
h1, h2, h3 { font-weight: 700; line-height: 1.25; letter-spacing: 0.02em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); margin-bottom: 0.6em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 0.8em; }
h3 { font-size: 1.25rem; margin-bottom: 0.6em; }
p { max-width: 38em; margin-bottom: 1em; }
.eyebrow { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.5em; }
.hl { font-weight: 700; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0 1.5em; height: 52px; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 1rem; cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  border: none; text-decoration: none;
}
.btn-primary { background-color: var(--color-accent); color: var(--color-accent-dark); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(137, 237, 110, 0.35); }
.btn-secondary { background: transparent; color: var(--color-body-text); border: 1px solid var(--color-body-text); }
.btn:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; }

/* 卡片与面板 */
.card {
  background-color: var(--color-paper);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 1.5em;
  position: relative;
  overflow: hidden;
}
.panel {
  background-color: var(--color-dark);
  border-radius: var(--radius-card);
  padding: 2em;
  box-shadow: var(--card-shadow);
}

/* 页头与导航 */
header { position: sticky; top: 0; z-index: 100; background-color: var(--color-paper); border-bottom: 1px solid rgba(21, 21, 35, 0.08); }
.nav-wrapper { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo { display: flex; align-items: center; gap: 0.6em; font-weight: 700; font-size: 1.1rem; color: var(--color-body-text); }
.logo img { height: 28px; width: auto; }
nav ul { display: flex; list-style: none; gap: 1.5em; }
nav a { color: var(--color-body-text); font-weight: 500; padding: 0.4em 0; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-brand); }
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; }

/* 表格 */
table { width: 100%; border-collapse: collapse; margin-bottom: 1.5em; }
th, td { padding: 0.9em 1em; text-align: left; border-bottom: 1px solid rgba(21, 21, 35, 0.1); }
th { font-weight: 600; white-space: nowrap; }
td { color: var(--color-body-text); }

/* FAQ */
details { margin-bottom: 1em; border-bottom: 1px solid rgba(21, 21, 35, 0.1); }
summary { cursor: pointer; font-weight: 600; padding: 0.8em 0; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.2em; font-weight: 400; transition: transform 0.2s; }
details[open] summary::after { content: "−"; }
details p { margin-top: 0.5em; margin-bottom: 0; }

/* 新闻网格 */
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--gap); margin-top: 1.5em; }
.news-card { display: flex; flex-direction: column; gap: 0.8em; }
.news-card time { font-size: 0.85rem; color: #666; }

/* 步骤徽标 */
.step-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background-color: var(--color-accent); color: var(--color-accent-dark);
  font-weight: 700; font-size: 0.9rem; margin-right: 0.6em;
}

/* 两栏布局工具 */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: center; }
.reverse { direction: rtl; }
.reverse > * { direction: ltr; }

/* SVG 动效基类 */
.svg-visual { width: 100%; height: auto; }
.svg-element { transform-box: fill-box; transform-origin: center; }

/* 动效关键帧 */
@keyframes orbit-breathe {
  0%, 100% { transform: scale(0.94); opacity: 0.5; }
  50% { transform: scale(1.06); opacity: 1; }
}
@keyframes dash-flow {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}
@keyframes float-subtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes bubble-pop {
  0%, 100% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.05); opacity: 1; }
}

.anim-orbit-1 { animation: orbit-breathe 6s ease-in-out infinite; }
.anim-orbit-2 { animation: orbit-breathe 8s ease-in-out infinite 1.2s; }
.anim-orbit-3 { animation: orbit-breathe 10s ease-in-out infinite 2.4s; }
.anim-dash { animation: dash-flow 3s linear infinite; }
.anim-float { animation: float-subtle 4.5s ease-in-out infinite; }
.anim-bubble { animation: bubble-pop 3.5s ease-in-out infinite; }

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation-delay: 0ms !important;
  }
}

/* 响应式 */
@media (max-width: 768px) {
  .nav-wrapper { flex-direction: column; height: auto; padding: 1em 0; gap: 0.5em; }
  nav ul { flex-wrap: wrap; justify-content: center; gap: 1em; }
  .mobile-menu-btn { display: block; }
  .two-col { grid-template-columns: 1fr !important; }
  .reverse { direction: ltr; }
  .hero-layout { flex-direction: column; }
  .panel { padding: 1.5em; }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
