/* =========================================
   SafeW 全站共享样式
   ========================================= */
:root {
  /* 色板 */
  --color-dark: #1B1231;
  --color-paper: #DBD4ED;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #9977EE;

  /* 取色变量（纸面默认） */
  --bg: var(--color-paper);
  --fg: var(--color-text);
  --hl: var(--color-brand);

  /* 结构 Token */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1120px;

  /* 排版 */
  --font-main: "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* 深色面覆盖 */
.dark-section {
  --bg: var(--color-dark);
  --fg: var(--color-paper);
  --hl: var(--color-accent);
}

/* 浅色卡片（置于深色面内时恢复纸面取色） */
.light-card {
  --bg: var(--color-paper);
  --fg: var(--color-text);
  --hl: var(--color-brand);
}

/* 基础重置 */
*, *::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: 1.55;
  color: var(--fg);
  background-color: var(--bg);
  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-header {
  margin-bottom: var(--gap);
}
.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--hl);
  margin-bottom: 0.6rem;
}
h1, h2, h3 {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--fg);
}
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 1rem; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: 0.8rem; }
p { margin-bottom: 1rem; max-width: 38em; }
p:last-child { margin-bottom: 0; }
span.hl { color: var(--hl); font-weight: 600; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  height: 52px;
  padding: 0 1.5rem;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { transform: translateY(-2px); background-color: #8a68dd; }
.btn-secondary {
  background: transparent;
  border-color: var(--fg);
  color: var(--fg);
}
.btn-secondary:hover { background-color: rgba(0,0,0,0.05); transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--hl); outline-offset: 4px; }

/* 卡片与面板 */
.card {
  background-color: var(--bg);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  position: relative;
}
.panel {
  background-color: var(--bg);
  border-radius: var(--radius-card);
  padding: var(--gap);
  position: relative;
  overflow: hidden;
}

/* 表格 */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: var(--gap);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}
th, td {
  text-align: left;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--fg);
  vertical-align: top;
}
th { font-weight: 700; }
td:first-child { font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: none; }

/* 列表 */
.list-check li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.6rem;
}
.list-check li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.4rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--hl);
}
.step-list { counter-reset: step; }
.step-list li {
  position: relative;
  padding-left: 2.8rem;
  margin-bottom: 1rem;
}
.step-list li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  border-radius: 8px;
}

/* FAQ */
details {
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 1rem 1.2rem;
  margin-bottom: var(--gap);
  background-color: var(--bg);
}
summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "+";
  font-weight: 700;
  color: var(--hl);
  width: 1.2rem;
  text-align: center;
  transition: transform 0.2s ease;
}
details[open] summary::before { transform: rotate(45deg); }
details p { margin-top: 0.8rem; margin-bottom: 0; color: var(--fg); opacity: 0.9; }

/* 页头页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg);
  border-bottom: 1px solid var(--fg);
  padding: 0.8rem 0;
  transition: box-shadow 0.2s ease;
}
.site-header.scrolled { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo img { height: 32px; width: auto; margin-right: 0.8rem; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { font-weight: 500; opacity: 0.85; transition: opacity 0.2s; }
.nav-links a:hover, .nav-links [aria-current="page"] { opacity: 1; }
.nav-links [aria-current="page"] { color: var(--hl); }
.footer {
  border-top: 1px solid var(--fg);
  padding: 2rem 0;
  margin-top: var(--section-y);
  text-align: center;
  opacity: 0.8;
  font-size: 0.9rem;
}

/* SVG 动效类 */
svg.ui-mockup {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
svg.ui-mockup path,
svg.ui-mockup rect,
svg.ui-mockup circle,
svg.ui-mockup line,
svg.ui-mockup polyline,
svg.ui-mockup polygon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.layer-a { animation: floatA 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.layer-b { animation: floatB 7.5s ease-in-out infinite; animation-delay: -2s; transform-box: fill-box; transform-origin: center; }
.layer-c { animation: floatC 5s ease-in-out infinite; animation-delay: -1s; transform-box: fill-box; transform-origin: center; }
.draw-line { stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 4s ease forwards; }
.breathe { animation: breathe 3s ease-in-out infinite; }
.slide-in { animation: slideIn 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

@keyframes floatA { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes floatB { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes floatC { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes drawLine { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes breathe { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes slideIn { 0% { transform: translateX(20px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .layer-a, .layer-b, .layer-c, .draw-line, .breathe, .slide-in {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* 响应式微调 */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero-layout { flex-direction: column; }
  .hero-visual { order: -1; max-width: 90%; margin-inline: auto; }
  .steps-row { flex-direction: column; }
  .step-list li { padding-left: 2.2rem; }
}
.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(280px, 1fr)); gap: var(--gap); }
.hero-layout { display: flex; gap: var(--gap); align-items: center; }
.hero-content { flex: 1; min-width: 0; }
.hero-visual { flex: 1; min-width: 0; }
.steps-row { display: flex; gap: var(--gap); }
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--gap); }
