/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* --- 设计变量 --- */
:root {
  --color-dark: #19102D;
  --color-paper: #FCFCFD;
  --color-paper-light: #F3F2F6;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #D66EED;
  --color-border: #E5E4EA;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --content-max: 960px;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --header-h: 64px;

  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 0;
  --card-shadow: none;
}

/* --- 基础重置 --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; transition: opacity 0.2s; }
a:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 3px; }
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--dark {
  background: var(--color-dark);
  color: var(--color-paper);
}
.section--paper {
  background: var(--color-paper);
  color: var(--color-text);
}
.section--paper-light {
  background: var(--color-paper-light);
  color: var(--color-text);
}

/* --- 排版系统 --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.section--dark .badge { color: var(--color-accent); }
.section--paper .badge { color: var(--color-brand); }
.badge::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 2px;
  background: currentColor;
}
h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  margin-bottom: 16px;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 24px;
}
h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 12px;
}
p { margin-bottom: 16px; max-width: 38em; }
.hl {
  font-weight: 700;
}
.section--dark .hl { color: var(--color-accent); }
.section--paper .hl { color: var(--color-brand); }

/* --- 组件：按钮 --- */
.btn-group { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 24px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding-inline: 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.2s, opacity 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { opacity: 0.9; }
.btn-secondary {
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
}
.section--dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.section--paper .btn-secondary { color: var(--color-text); border-color: var(--color-text); }

/* --- 组件：卡片 --- */
.card {
  background: var(--color-paper-light);
  padding: 24px;
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  position: relative;
}
.section--dark .card {
  background: rgba(255,255,255,0.06);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}
.card-group-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid currentColor;
  display: inline-block;
}

/* --- 组件：表格 --- */
.table-wrap { overflow-x: auto; margin-top: 24px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
th { font-weight: 700; background: rgba(0,0,0,0.03); }
.section--dark th { background: rgba(255,255,255,0.05); }

/* --- 组件：FAQ --- */
details {
  border-bottom: 1px solid var(--color-border);
  padding: 16px 0;
  cursor: pointer;
}
summary {
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
summary::marker { display: none; }
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "+";
  font-weight: 700;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  flex-shrink: 0;
}
details[open] summary::before { content: "-"; }
details p { margin-top: 12px; font-size: 0.95rem; }

/* --- 组件：步骤条 --- */
.steps {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.step-item {
  flex: 1;
  min-width: 180px;
  counter-increment: step;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  margin-bottom: 12px;
}
.section--dark .step-num { background: var(--color-accent); color: var(--color-dark); }

/* --- 组件：场景标签 --- */
.tag-row { display: flex; gap: 8px; margin-bottom: 12px; }
.tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  background: rgba(0,0,0,0.06);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.section--dark .tag { background: rgba(255,255,255,0.08); }

/* --- 页头与页脚 --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-paper);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-h);
  display: flex;
  align-items: center;
}
.section--dark .site-header { background: var(--color-dark); border-color: rgba(255,255,255,0.1); }
.header-inner {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; }
.logo img { height: 32px; width: auto; }
.nav-list { display: flex; gap: 24px; }
.nav-link { font-weight: 500; opacity: 0.8; }
.nav-link:hover, .nav-link[aria-current="page"] { opacity: 1; }
.nav-link[aria-current="page"] { border-bottom: 2px solid currentColor; padding-bottom: 4px; }
.site-footer {
  padding-block: 48px;
  border-top: 1px solid var(--color-border);
  margin-top: 48px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 32px;
}
.footer-col h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 12px; }
.footer-col a { display: block; padding-block: 4px; opacity: 0.8; }
.footer-col a:hover { opacity: 1; }
.copyright {
  margin-top: 48px;
  font-size: 0.85rem;
  opacity: 0.7;
  text-align: center;
}

/* --- SVG 动效关键帧 --- */
@keyframes dash {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes draw-loop {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
@keyframes slide-in {
  0% { transform: translateX(-12px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes spin-slow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes pulse-line {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

/* 动效类绑定 */
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: dash 3s ease-out forwards; }
.anim-loop-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw-loop 6s ease-in-out infinite; }
.anim-float { animation: float 4s ease-in-out infinite; }
.anim-breathe { animation: breathe 2.5s ease-in-out infinite; }
.anim-slide { animation: slide-in 0.8s ease-out forwards; }
.anim-spin { animation: spin-slow 20s linear infinite; }
.anim-pulse { stroke-dasharray: 1; stroke-dashoffset: 0; animation: pulse-line 4s ease-in-out infinite; }

/* 减少动态效果适配 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    animation: none !important;
  }
}

/* --- 响应式微调 --- */
@media (max-width: 768px) {
  .steps { flex-direction: column; }
  .hero-layout { flex-direction: column-reverse; }
  h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); }
}
