/* SafeW 全站共享样式 */
:root {
  /* 色板 */
  --c-dark: #121531;
  --c-paper: #E8E9EA;
  --c-body: #151723;
  --c-brand: #142CEB;
  --c-accent: #ED7D6E;

  /* 设计 Token */
  --r-card: 24px;
  --r-btn: 999px;
  --card-border: 0;
  --card-shadow: none;
  --sec-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --max-w: 1280px;
  --lh-body: 1.65;
  --lh-head: 1.25;
  --font-main: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}

/* 表面层颜色覆盖变量 */
.surface-dark {
  --txt-primary: var(--c-paper);
  --txt-secondary: rgba(232, 233, 234, 0.85);
  --icon-color: var(--c-accent);
  --hl-color: var(--c-accent);
  --bg-surface: var(--c-dark);
  --bg-card: #1a1d3a;
  --border-subtle: rgba(232, 233, 234, 0.12);
}

.surface-light {
  --txt-primary: var(--c-body);
  --txt-secondary: #4a4d5e;
  --icon-color: var(--c-brand);
  --hl-color: var(--c-brand);
  --bg-surface: var(--c-paper);
  --bg-card: #ffffff;
  --border-subtle: rgba(21, 23, 35, 0.1);
}

/* 基础重置与排版 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: var(--lh-body);
  color: var(--txt-primary);
  background-color: var(--bg-surface);
  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(--max-w);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* 区块节奏 */
.section {
  padding-block: var(--sec-y);
  background-color: var(--bg-surface);
}

/* 标题系统 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--icon-color);
  margin-bottom: 0.75rem;
}
.badge::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 2px;
  background-color: currentColor;
  border-radius: 2px;
}
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: var(--lh-head);
  letter-spacing: 0;
  color: var(--txt-primary);
}
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 1.5rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
p { color: var(--txt-secondary); margin-bottom: 1rem; max-width: 38em; }
.text-hl { color: var(--hl-color); font-weight: 700; }

/* 按钮组件 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--r-btn);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  border: none;
  outline: none;
}
.btn:focus-visible { box-shadow: 0 0 0 3px var(--c-accent); }
.btn-primary {
  background-color: var(--c-accent);
  color: var(--c-dark);
}
.btn-primary:hover { transform: translateY(-2px); background-color: #d96b5c; }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--txt-primary);
  color: var(--txt-primary);
}
.btn-secondary:hover { background-color: rgba(255,255,255,0.08); }
.surface-light .btn-secondary { border-color: var(--c-body); color: var(--c-body); }
.surface-light .btn-secondary:hover { background-color: rgba(21,23,35,0.05); }

/* 卡片与面板 */
.card {
  background-color: var(--bg-card);
  border: var(--card-border);
  border-radius: var(--r-card);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  position: relative;
}
.panel {
  background-color: var(--bg-card);
  border-radius: var(--r-card);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  position: relative;
  overflow: hidden;
}

/* 网格布局 */
.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;
  color: var(--txt-primary);
}
th, td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}
th { font-weight: 600; color: var(--txt-primary); }
td { color: var(--txt-secondary); }
tr:last-child td { border-bottom: none; }

/* 步骤条 */
.steps { display: flex; flex-wrap: wrap; gap: var(--gap); counter-reset: step; }
.step-item {
  flex: 1 1 280px;
  counter-increment: step;
  position: relative;
  padding-left: 48px;
}
.step-item::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0; top: 0;
  width: 32px; height: 32px;
  background-color: var(--c-accent);
  color: var(--c-dark);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* FAQ */
.faq-list details {
  margin-bottom: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background-color: var(--bg-card);
  padding: 16px 20px;
}
.faq-list summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--icon-color);
  transition: transform 0.2s;
}
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list p { margin-top: 10px; font-size: 0.95rem; }

/* 新闻卡片 */
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--gap); }
.news-card {
  background-color: var(--bg-card);
  border-radius: var(--r-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: var(--card-border);
}
.news-card time {
  font-size: 0.8rem;
  color: var(--icon-color);
  font-weight: 600;
}
.news-card h4 { font-size: 1.05rem; font-weight: 600; }
.news-card p { font-size: 0.9rem; margin: 0; }

/* 页头页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(18, 21, 49, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; }
.brand img { height: 32px; width: auto; }
.main-nav { display: flex; gap: 24px; }
.main-nav a { font-size: 0.95rem; font-weight: 500; opacity: 0.85; transition: opacity 0.2s; color: #e8e9ea !important; }
.main-nav a:hover, .main-nav a[aria-current="page"] { opacity: 1; color: var(--c-accent) !important; }
@media (max-width: 768px) {
  .main-nav { display: none; }
}
.site-footer {
  background-color: var(--c-dark);
  color: var(--c-paper);
  padding: 48px 0 32px;
  border-top: 1px solid var(--border-subtle);
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; margin-bottom: 32px; }
.footer-col h5 { font-size: 0.9rem; font-weight: 600; margin-bottom: 12px; color: var(--c-accent); }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a { font-size: 0.9rem; opacity: 0.8; transition: opacity 0.2s; }
.footer-col a:hover { opacity: 1; }
.footer-bottom { text-align: center; font-size: 0.8rem; opacity: 0.6; border-top: 1px solid var(--border-subtle); padding-top: 24px; }

/* SVG 动效基类 */
.svg-anim-group { transform-box: fill-box; transform-origin: center; }
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw-outline 5s ease-in-out infinite alternate; }
.anim-float { animation: float-up 6s ease-in-out infinite; }
.anim-breathe { animation: breathe-dots 3s ease-in-out infinite; }
.anim-slide { animation: slide-in 4s ease-out forwards; }
.anim-pulse { animation: pulse-scale 4s ease-in-out infinite; }

@keyframes draw-outline {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes float-up {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes breathe-dots {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes slide-in {
  0% { transform: translateX(-20px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes pulse-scale {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* 减少动态效果偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .svg-anim-group { animation: none !important; transform: none !important; }
}
