/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* 设计变量 */
:root {
  /* 色板 */
  --bg-dark: #121531;
  --bg-paper: #E8E9EA;
  --text-body: #151723;
  --brand: #142CEB;
  --accent: #ED7D6E;

  /* 结构 Token */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1120px;

  /* 排版 */
  --font-main: "PingFang SC", "SF Pro Text", "Helvetica Neue", "Noto Sans SC", system-ui, sans-serif;
  --lh-body: 1.65;
  --lh-tight: 1.1;
  --ls-tight: -0.02em;
}

/* 基础重置与排版 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: var(--lh-body);
  color: var(--text-body);
  background: var(--bg-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
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;
}

.light-paper { background: var(--bg-paper); color: var(--text-body); }
.dark-surface {
  background: var(--bg-dark);
  color: var(--paper);
  --text: var(--paper);
  --link: var(--accent);
  --highlight: var(--accent);
}

/* 文字组件 */
.kicker {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.6em;
  color: var(--brand);
}
.dark-surface .kicker { color: var(--accent); }

h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  text-wrap: balance;
  margin-bottom: 1em;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: var(--ls-tight);
  margin-bottom: 0.8em;
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5em;
}

p { margin-bottom: 1em; max-width: 38em; }
strong { font-weight: 700; }

.hl { color: var(--brand); font-weight: 700; }
.dark-surface .hl { color: var(--accent); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  height: 52px;
  padding: 0 1.6em;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.btn-primary {
  background: var(--accent);
  color: var(--bg-dark);
}
.btn-primary:hover { filter: brightness(1.05); }

.btn-secondary {
  background: transparent;
  border: 2px solid var(--text-body);
  color: var(--text-body);
}
.dark-surface .btn-secondary {
  border-color: var(--paper);
  color: var(--paper);
}
.btn-secondary:hover {
  filter: brightness(0.9);
  background: rgba(0,0,0,0.05);
}
.dark-surface .btn-secondary:hover {
  background: rgba(255,255,255,0.08);
}

.btn-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* 卡片 */
.card {
  background: var(--bg-card, #ffffff);
  border-radius: var(--radius-card);
  padding: var(--gap);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}
.dark-surface .card {
  background: rgba(255, 255, 255, 0.06);
  --bg-card: rgba(255, 255, 255, 0.06);
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }

/* 表格 */
.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.8em 1em;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
.dark-surface th, .dark-surface td { border-bottom-color: rgba(255,255,255,0.12); }
th { font-weight: 700; color: var(--brand); }
.dark-surface th { color: var(--accent); }
tr:last-child td { border-bottom: none; }

/* 列表 */
.check-list li {
  position: relative;
  padding-left: 1.6em;
  margin-bottom: 0.6em;
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 8px;
  height: 8px;
  background: var(--brand);
  border-radius: 2px;
  transform: rotate(45deg);
}
.dark-surface .check-list li::before { background: var(--accent); }

/* 步骤徽标 */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: var(--bg-dark);
  font-weight: 800;
  font-size: 0.9rem;
  border-radius: 8px;
  margin-right: 0.8em;
  flex-shrink: 0;
}

/* FAQ */
details {
  border-bottom: 1px solid rgba(0,0,0,0.1);
  padding: 1em 0;
}
.dark-surface details { border-bottom-color: rgba(255,255,255,0.12); }
summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font-size: 1.2em;
  transition: transform 0.2s;
}
details[open] summary::after { transform: rotate(45deg); }
details p { margin-top: 0.8em; color: var(--text-body); }
.dark-surface details p { color: var(--paper); }

/* 页头与页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(232, 233, 234, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  transition: background 0.3s, border-color 0.3s;
}
.dark-surface .site-header { background: rgba(18, 21, 49, 0.9); border-bottom-color: rgba(255,255,255,0.08); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-links { display: flex; gap: 1.5em; align-items: center; }
.nav-link { font-weight: 500; font-size: 0.95rem; }
.nav-link[aria-current="page"], .nav-link:hover { color: var(--brand); }
.dark-surface .nav-link[aria-current="page"], .dark-surface .nav-link:hover { color: var(--accent); }

.site-footer {
  padding: var(--section-y) 0;
  border-top: 1px solid rgba(0,0,0,0.08);
  font-size: 0.9rem;
}
.dark-surface .site-footer { border-top-color: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5em;
}
.footer-links { display: flex; gap: 1.2em; }
.copyright { margin-top: 1.5em; opacity: 0.7; }

/* SVG 动效基类 */
.hero-svg { width: 100%; max-width: 480px; height: auto; }
.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.anim-twinkle { animation: twinkle 4s ease-in-out infinite alternate; }
.anim-float { animation: float 5s ease-in-out infinite alternate; }
.anim-delay-1 { animation-delay: 1s; }
.anim-delay-2 { animation-delay: 2s; }
.anim-delay-3 { animation-delay: 0.5s; }

@keyframes drawLine {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .anim-draw, .anim-twinkle, .anim-float { animation: none !important; }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .header-inner { flex-direction: column; height: auto; padding: 0.8em 0; gap: 0.8em; }
  .nav-links { gap: 1em; }
  h1 { font-size: clamp(2rem, 8vw, 3rem); }
}
