/* SafeW 共享样式 */
:root {
  /* 色板 */
  --color-dark: #121531;
  --color-paper: #E8E9EA;
  --color-text: #151723;
  --color-brand: #142CEB;
  --color-accent: #ED7D6E;
  
  /* 设计 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(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 960px;
  
  /* 衍生变量 */
  --bg-dark: var(--color-dark);
  --text-on-dark: var(--color-paper);
  --accent-on-dark: var(--color-accent);
  
  --bg-paper: var(--color-paper);
  --text-on-paper: var(--color-text);
  --brand-on-paper: var(--color-brand);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  line-height: 1.75;
  color: var(--text-on-paper);
  background-color: var(--bg-paper);
  -webkit-font-smoothing: antialiased;
}

/* 布局容器 */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* 页面块节奏 */
.section {
  padding: var(--section-y) 0;
}
.section--dark {
  background-color: var(--bg-dark);
  color: var(--text-on-dark);
}
.section--paper {
  background-color: var(--bg-paper);
  color: var(--text-on-paper);
}

/* 眉标与标题 */
.breadcrumb {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.5em;
}
.section--paper .breadcrumb { color: var(--brand-on-paper); }
.section--dark .breadcrumb { color: var(--accent-on-dark); }

h1, h2, h3 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  margin-bottom: 1em;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: calc(var(--gap) / 1.5);
}
h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  margin-bottom: 0.6em;
}
.hl {
  color: var(--brand-on-paper);
}
.section--dark .hl {
  color: var(--accent-on-dark);
}

p {
  max-width: 38em;
  margin-bottom: 1em;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  height: 52px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-btn);
  text-decoration: none;
  transition: transform 0.2s ease, background-color 0.2s ease;
  cursor: pointer;
  border: none;
}
.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.btn--primary:hover { transform: translateY(-2px); background-color: #d96a5b; }
.btn--secondary {
  background-color: transparent;
  color: var(--text-on-paper);
  border: 2px solid var(--text-on-paper);
}
.section--dark .btn--secondary {
  color: var(--text-on-dark);
  border-color: var(--text-on-dark);
}
.btn svg { width: 20px; height: 20px; }

/* 卡片 (粗描边硬阴影) */
.card {
  background-color: var(--bg-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  color: var(--text-on-paper);
}
.section--dark .card {
  background-color: var(--color-paper);
  border-color: var(--color-dark);
  box-shadow: 4px 4px 0 var(--color-dark);
  color: var(--text-on-paper);
}

/* 列表 */
ul.check-list {
  list-style: none;
  padding-left: 0;
}
ul.check-list li {
  position: relative;
  padding-left: 1.8em;
  margin-bottom: 0.6em;
}
ul.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 10px;
  height: 10px;
  background-color: var(--color-brand);
  border-radius: 50%;
}
.section--dark ul.check-list li::before { background-color: var(--color-accent); }

/* 表格 */
.table-wrap {
  overflow-x: auto;
  margin-top: 1em;
}
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);
}
td:first-child { font-weight: 700; white-space: nowrap; }
.section--dark th, .section--dark td { border-color: rgba(255,255,255,0.15); }

/* FAQ */
details {
  margin-bottom: 16px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 12px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.5);
}
.section--dark details {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
}
summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font-size: 1.2em;
  font-weight: 400;
}
details[open] summary::after { content: "−"; }
details p { margin-top: 12px; margin-bottom: 0; font-size: 0.95rem; opacity: 0.9; }

/* 页头页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(232, 233, 234, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.section--dark ~ .site-header,
.site-header.dark-mode {
  background-color: rgba(18, 21, 49, 0.9);
  border-bottom-color: rgba(255,255,255,0.1);
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  font-weight: 800;
  font-size: 1.1rem;
}
.brand img { height: 32px; width: auto; }
nav ul { display: flex; gap: 24px; list-style: none; }
nav a {
  text-decoration: none;
  color: inherit;
  font-weight: 500;
  opacity: 0.8;
  transition: opacity 0.2s;
}
nav a:hover, nav a[aria-current="page"] { opacity: 1; }

.site-footer {
  padding: 48px 0;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.8;
  border-top: 1px solid rgba(0,0,0,0.05);
}
.section--dark .site-footer { border-color: rgba(255,255,255,0.05); }
.footer-links { display: flex; justify-content: center; gap: 24px; margin-bottom: 16px; }
.footer-links a { color: inherit; text-decoration: none; }

/* 焦点样式 */
:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; }
.section--dark :focus-visible { outline-color: var(--color-accent); }

/* SVG 动效：网格节点依次点亮 */
@keyframes grid-blink {
  0%, 100% { opacity: 0.15; transform: scale(0.8); }
  10% { opacity: 1; transform: scale(1.2); }
  20% { opacity: 0.15; transform: scale(0.8); }
}
.grid-dot {
  animation: grid-blink 6s infinite ease-in-out;
}
.grid-dot:nth-child(1) { animation-delay: 0.0s; }
.grid-dot:nth-child(2) { animation-delay: 0.6s; }
.grid-dot:nth-child(3) { animation-delay: 1.2s; }
.grid-dot:nth-child(4) { animation-delay: 1.8s; }
.grid-dot:nth-child(5) { animation-delay: 2.4s; }
.grid-dot:nth-child(6) { animation-delay: 3.0s; }
.grid-dot:nth-child(7) { animation-delay: 3.6s; }
.grid-dot:nth-child(8) { animation-delay: 4.2s; }
.grid-dot:nth-child(9) { animation-delay: 4.8s; }

/* 消息气泡浮现 */
@keyframes bubble-float {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(-6px); opacity: 1; }
}
.msg-bubble { animation: bubble-float 4s infinite ease-in-out; }
.msg-bubble:nth-child(odd) { animation-duration: 5s; animation-direction: reverse; }

/* 连接线流动 */
@keyframes dash-flow {
  to { stroke-dashoffset: -24; }
}
.flow-line {
  stroke-dasharray: 12 12;
  animation: dash-flow 1.5s linear 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;
  }
}
