/* =========================================
   SafeW 全站共享样式
   ========================================= */
:root {
  /* 色板 */
  --color-dark: #1B1231;
  --color-paper: #DBD4ED;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #9977EE;

  /* 设计 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: 960px;

  /* 排版 */
  --font-main: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 基础重置与全局 */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background-color: var(--color-paper);
  color: var(--color-text);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { padding: 0; margin: 0; list-style: none; }

/* 容器 */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* 面包屑/眉标 */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--color-brand);
  margin-bottom: 12px;
}
.dark-bg .eyebrow { color: var(--color-accent); }

/* 标题系统 */
h1, h2, h3 {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  margin-top: 0;
}
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); margin-bottom: 24px; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 32px; }
h3 { font-size: 1.25rem; margin-bottom: 16px; }
p { margin-bottom: 16px; max-width: 38em; }
.hl { color: var(--color-brand); }
.dark-bg .hl { color: var(--color-accent); }

/* 页面布局区块 */
.section { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.dark-bg { background-color: var(--color-dark); color: var(--color-paper); }
.dark-bg p, .dark-bg li { color: var(--color-paper); }
.dark-bg a { color: var(--color-accent); }
.paper-card {
  background: var(--color-paper);
  color: var(--color-text);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 24px;
}
.paper-card p, .paper-card li { color: var(--color-text); }
.paper-card a { color: var(--color-brand); }

/* 网格与弹性布局 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }
.min-w-0 { min-width: 0; }

/* 按钮组件 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  border: none;
  text-decoration: none;
}
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(0.95); }
.btn-secondary {
  background: transparent;
  border: 2px solid var(--color-text);
  color: var(--color-text);
}
.btn-secondary:hover { transform: translateY(-2px); background: rgba(0,0,0,0.05); }
.dark-bg .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.dark-bg .btn-secondary:hover { background: rgba(255,255,255,0.08); }

/* 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
th { font-weight: 700; }
.dark-bg th, .dark-bg td { border-bottom-color: rgba(255,255,255,0.15); }

/* FAQ 组件 */
details {
  margin-bottom: 12px;
  border: var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-paper);
}
.dark-bg details { background: var(--color-dark); border-color: rgba(255,255,255,0.2); }
.summary {
  padding: 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.summary::-webkit-details-marker { display: none; }
.summary::after { content: "+"; font-size: 1.2rem; transition: transform 0.2s; }
details[open] .summary::after { transform: rotate(45deg); }
.details-content { padding: 0 16px 16px; line-height: 1.6; }

/* 页头页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(219, 212, 237, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.dark-bg .site-header { background: rgba(27, 18, 49, 0.9); border-bottom-color: rgba(255,255,255,0.1); }
.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.25rem; }
.logo img { height: 32px; width: auto; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-link { font-weight: 500; font-size: 0.95rem; transition: color 0.2s; }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--color-brand); }
.dark-bg .nav-link:hover, .dark-bg .nav-link[aria-current="page"] { color: var(--color-accent); }
.site-footer {
  padding: 48px 0;
  border-top: 1px solid rgba(0,0,0,0.08);
  margin-top: 48px;
  font-size: 0.9rem;
  color: rgba(0,0,0,0.6);
}
.dark-bg .site-footer { border-top-color: rgba(255,255,255,0.1); color: rgba(255,255,255,0.6); }
.footer-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; }
.footer-col h4 { font-weight: 700; margin-bottom: 12px; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a:hover { text-decoration: underline; }

/* SVG 动效核心规则 */
.svg-panel {
  width: 100%;
  height: auto;
  max-width: 100%;
}
/* 描边绘制 */
.anim-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawPath 6s ease-in-out infinite;
}
@keyframes drawPath {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}
/* 呼吸效果 */
.anim-breathe {
  animation: breathePulse 3s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes breathePulse {
  0%, 100% { opacity: 0.4; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.05); }
}
/* 悬浮效果 */
.anim-float {
  animation: floatY 5s ease-in-out infinite;
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
/* 滑入效果 */
.anim-slide {
  animation: slideIn 4.5s ease-out infinite;
}
@keyframes slideIn {
  0% { opacity: 0; transform: translateX(-16px); }
  15% { opacity: 1; transform: translateX(0); }
  85% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(16px); }
}
/* 数据点流动 */
.anim-flow {
  animation: flowDash 4s linear infinite;
}
@keyframes flowDash {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 响应式适配 */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero-layout { flex-direction: column-reverse; }
  .header-inner .btn { display: none; }
  .nav-links { gap: 16px; }
  h1 { font-size: clamp(1.8rem, 6vw, 2.8rem); }
  .paper-card { padding: 16px; }
}
