/* SafeW 全站共享样式 */
:root {
  /* 色板 */
  --color-deep: #271231;
  --color-paper: #F6F3F7;
  --color-body: #1F1523;
  --color-brand: #9E13DD;
  --color-accent: #ED6EC0;

  /* 设计 Token */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 1px solid rgba(31, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;

  /* 字体与排版 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans SC", sans-serif;
  --line-height-body: 1.65;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--color-body);
  background-color: var(--color-paper);
  line-height: var(--line-height-body);
  -webkit-font-smoothing: antialiased;
}

/* 防止内联元素（如 span）文本过长导致横向溢出 */
span {
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

.container {
  width: min(100% - 32px, var(--content-max));
  margin-inline: auto;
}

/* 版式工具 */
.flex { display: flex; gap: var(--gap); }
.grid { display: grid; gap: var(--gap); }
.text-center { text-align: center; }

/* 标题系统 */
.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  color: var(--color-brand);
}
.dark-section .section-label { color: var(--color-accent); }

h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 0.6rem;
}
h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}
p { margin-bottom: 1rem; max-width: 38em; }
.hl { font-weight: 800; }
.paper-theme .hl { color: var(--color-brand); }
.dark-theme .hl { color: var(--color-accent); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  height: 52px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-deep);
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--color-body);
  color: var(--color-body);
}
.dark-theme .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}
.btn:hover { transform: translateY(-2px); filter: brightness(0.95); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 3px; }
.btn svg { width: 20px; height: 20px; stroke-width: 2; }

/* 卡片与面板 */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
}
.dark-theme .card {
  background: var(--color-deep);
  border-color: rgba(246, 243, 247, 0.1);
}
.panel {
  background: var(--color-deep);
  padding: clamp(2rem, 5vw, 3rem);
}

/* 表格 */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 1.5rem 0;
}
th, td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(31, 21, 35, 0.12);
}
th { font-weight: 700; }
td:first-child { font-weight: 600; color: var(--color-body); }
.dark-theme td:first-child { color: var(--color-paper); }

/* FAQ */
details {
  border: var(--card-border);
  margin-bottom: 12px;
  background: var(--color-paper);
}
summary {
  padding: 16px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 40px;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 400;
}
details[open] summary::after { content: "-"; }
details p { padding: 0 16px 16px; margin: 0; font-size: 0.95rem; color: #333; }

/* 页头与页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 243, 247, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(31, 21, 35, 0.08);
}
.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 { width: 28px; height: 28px; }
nav a { margin-left: 24px; font-size: 0.95rem; font-weight: 500; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-brand); }
.dark-theme nav a { color: var(--color-paper); }
.dark-theme nav a:hover, .dark-theme nav a[aria-current="page"] { color: var(--color-accent); }

.site-footer {
  background: var(--color-deep);
  color: var(--color-paper);
  padding: 48px 0;
  margin-top: var(--section-y);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}
.footer-col h4 { margin-bottom: 12px; color: var(--color-accent); }
.footer-col a { display: block; margin-bottom: 8px; opacity: 0.8; }
.footer-col a:hover { opacity: 1; }
.copyright { text-align: center; margin-top: 32px; opacity: 0.6; font-size: 0.85rem; }

/* SVG 动效基础 */
svg.svgsystem { width: 100%; height: auto; overflow: visible; }
.node-light { fill: var(--color-accent); opacity: 0.2; transform-box: fill-box; transform-origin: center; }
.line-path {
  stroke: var(--color-brand);
  stroke-width: 2;
  fill: none;
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.bubble-shape { fill: var(--color-paper); opacity: 0.9; transform-box: fill-box; transform-origin: center; }
.notification-card { fill: var(--color-deep); stroke: var(--color-accent); stroke-width: 1.5; }

/* 节点呼吸动画 */
@keyframes nodePulse {
  0%, 100% { opacity: 0.2; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}
.node-light:nth-child(1) { animation: nodePulse 4s ease-in-out infinite 0s; }
.node-light:nth-child(2) { animation: nodePulse 4s ease-in-out infinite 0.4s; }
.node-light:nth-child(3) { animation: nodePulse 4s ease-in-out infinite 0.8s; }
.node-light:nth-child(4) { animation: nodePulse 4s ease-in-out infinite 1.2s; }
.node-light:nth-child(5) { animation: nodePulse 4s ease-in-out infinite 1.6s; }
.node-light:nth-child(6) { animation: nodePulse 4s ease-in-out infinite 2.0s; }

/* 线条绘制动画 */
@keyframes lineDraw {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}
.line-path { animation: lineDraw 5s ease-in-out infinite; }

/* 气泡漂浮 */
@keyframes bubbleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.float-group { animation: bubbleFloat 4.5s ease-in-out infinite; }

/* 减少动态效果 */
@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;
  }
  .node-light, .line-path, .float-group { animation: none !important; }
}

/* 兜底：裁掉横向溢出 */
li {
  overflow-x: clip;
}
