/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* --- 设计变量 --- */
:root {
  --bg-dark: #2D1438;
  --bg-paper: #F6F3F7;
  --text-main: #1F1523;
  --brand: #9E13DD;
  --accent: #6EEDA8;
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 1px solid;
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;
  --border-color: rgba(31, 21, 35, 0.16);
  --btn-text-dark: #2D1438;
  --btn-text-light: #F6F3F7;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* --- 基础重置 --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--bg-paper);
  color: var(--text-main);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* --- 布局容器 --- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}
section {
  padding-block: var(--section-y);
  position: relative;
}
/* 细线分节 */
section:not(.hero, .footer-cta, .site-header) {
  border-top: 1px solid var(--border-color);
}

/* --- 排版系统 --- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.paper-face .eyebrow { color: var(--brand); }
.dark-face .eyebrow { color: var(--accent); }

h1, h2, h3 {
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); margin-bottom: 0.6em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 0.5em; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: 0.4em; }
p { margin-bottom: 1em; max-width: 38em; }
.hl { color: var(--brand); }
.dark-face .hl { color: var(--accent); }

/* --- 组件：按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  height: 52px;
  padding-inline: 1.5em;
  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;
}
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-primary {
  background: var(--accent);
  color: var(--btn-text-dark);
  border: none;
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--text-main);
}
.dark-face .btn-secondary {
  color: var(--btn-text-light);
  border-color: var(--btn-text-light);
}
.btn-secondary:hover { background: rgba(0,0,0,0.04); }
.dark-face .btn-secondary:hover { background: rgba(255,255,255,0.08); }

/* --- 组件：卡片 --- */
.card {
  background: var(--bg-paper);
  border: var(--card-border) var(--border-color);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-2px); }

/* --- 组件：表格 --- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  padding: 0.8em 1em;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}
th { font-weight: 600; color: var(--brand); }
.dark-face th { color: var(--accent); }

/* --- 组件：FAQ --- */
details {
  border: var(--card-border) var(--border-color);
  border-radius: var(--radius-card);
  margin-bottom: 0.8em;
  background: var(--bg-paper);
  padding: 1em 1.2em;
}
summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.6em;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(-45deg);
  transition: transform 0.2s;
}
details[open] summary::before { transform: rotate(45deg); }
details p { margin-top: 0.8em; color: var(--text-main); }

/* --- 组件：步骤徽标 --- */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--btn-text-dark);
  font-weight: 700;
  font-size: 0.9rem;
  margin-right: 0.8em;
  flex-shrink: 0;
}

/* --- 页头/页脚 --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 243, 247, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.8em 0;
  transition: background 0.3s;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 0.6em; }
.brand img { height: 32px; width: auto; }
nav { display: flex; gap: 1.5em; align-items: center; }
nav a { font-weight: 500; font-size: 0.95rem; }
nav a:hover, nav a[aria-current="page"] { color: var(--brand); }
.dark-face nav a:hover, .dark-face nav a[aria-current="page"] { color: var(--accent); }

.site-footer {
  padding: var(--gap) 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-main);
}
.footer-links { display: flex; justify-content: center; gap: 1.2em; margin-bottom: 0.8em; }

/* --- SVG 动效核心 --- */
.svg-anim { width: 100%; height: auto; }
.geo-shape {
  transform-box: fill-box;
  transform-origin: center;
  animation: spin-slow 20s linear infinite;
}
.draw-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-stroke 4s ease-in-out infinite alternate;
}
.float-layer {
  animation: float-gentle 6s ease-in-out infinite alternate;
}
.pulse-dot {
  animation: pulse-opacity 3s ease-in-out infinite alternate;
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes draw-stroke {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes float-gentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes pulse-opacity {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* --- 响应式与无障碍 --- */
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; gap: 0.8em; }
  nav { order: 3; width: 100%; justify-content: center; flex-wrap: wrap; }
  .grid-auto { grid-template-columns: 1fr !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}
.min-w-zero { min-width: 0; }
.text-center { text-align: center; }
.mt-gap { margin-top: var(--gap); }
.mb-gap { margin-bottom: var(--gap); }
