/* =========================================
   SafeW 全站共享样式 (style.css)
   ========================================= */

/* --- 1. 设计 Token 与变量 --- */
:root {
  /* 色板 */
  --color-dark: #10112D;      /* 深色面底色 */
  --color-paper: #F5F0E5;     /* 纸面底色 */
  --color-text: #151523;      /* 纸面正文/标题色 */
  --color-brand: #1416EB;     /* 纸面品牌色 */
  --color-accent: #89ED6E;    /* 强调色 */

  /* 衍生色 (仅用于边框或极细微区分) */
  --border-subtle: rgba(21, 21, 35, 0.16);
  --border-dark-subtle: rgba(245, 240, 229, 0.16);

  /* 结构与布局 */
  --content-max: 1280px;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  
  /* 圆角 */
  --radius-card: 24px;
  --radius-btn: 999px;

  /* 字体 */
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
}

/* --- 2. 基础重置与排版 --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background-color: var(--color-paper);
  color: var(--color-text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* 容器限制 */
.container {
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gap);
  padding-right: var(--gap);
}

/* 标题系统 */
h1, h2, h3, h4 {
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); margin-bottom: var(--gap); }
h3 { font-size: clamp(1.4rem, 2.5vw, 1.8rem); margin-bottom: 1rem; }

p { margin-bottom: 1rem; max-width: 38em; }

/* 眉标 (Section Label) */
.section-label {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  color: var(--color-brand);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::before {
  content: "";
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-brand);
}

/* 高亮关键词 */
.hl {
  color: var(--color-brand);
}

/* 分割线 (Paper 面) */
.divider-line {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: var(--section-y) 0;
}

/* --- 3. 组件：按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 32px;
  height: 52px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(137, 237, 110, 0.3);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-text);
}
.btn-secondary:hover {
  background-color: rgba(21, 21, 35, 0.05);
  transform: translateY(-2px);
}

/* 深色面上的按钮变体 */
.dark-surface .btn-primary {
  color: var(--color-dark);
}
.dark-surface .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}
.dark-surface .btn-secondary:hover {
  background-color: rgba(245, 240, 229, 0.1);
}

:focus-visible {
  outline: 3px solid var(--color-brand);
  outline-offset: 4px;
}

/* --- 4. 组件：卡片与面板 --- */
.card {
  background-color: #fff; /* 默认白底，若需继承纸面可改为 var(--color-paper) */
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 2rem;
  box-shadow: var(--card-shadow);
}

.visual-panel {
  background-color: var(--color-dark);
  border-radius: var(--radius-card);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  aspect-ratio: 4 / 3;
}

/* --- 5. 组件：表格 --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  table-layout: fixed;
  min-width: 0;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  overflow-wrap: break-word;
  word-break: break-all;
}
.data-table th {
  font-weight: 700;
  color: var(--color-brand);
  width: 30%;
}

/* --- 6. 组件：FAQ --- */
.faq-item {
  border: var(--card-border);
  border-radius: 16px;
  margin-bottom: 1rem;
  overflow: hidden;
  background: #fff;
}
.faq-item summary {
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--color-brand);
}
.faq-item[open] summary::after { content: "-"; }
.faq-item p {
  padding: 0 1.5rem 1.5rem 1.5rem;
  color: #4a4a5a;
  font-size: 0.95rem;
}

/* --- 7. 页头与页脚 --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(245, 240, 229, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 0;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand-logo img { height: 32px; width: auto; vertical-align: middle; }
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-links a:hover, .nav-links a[aria-current="page"] {
  color: var(--color-brand);
}

.site-footer {
  background-color: var(--color-dark);
  color: var(--color-paper);
  padding: var(--section-y) 0;
  margin-top: var(--section-y);
}
.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
}
.footer-col h4 { color: var(--color-accent); margin-bottom: 1rem; }
.footer-col a {
  display: block;
  color: var(--color-paper);
  text-decoration: none;
  margin-bottom: 0.75rem;
  opacity: 0.8;
}
.footer-col a:hover { opacity: 1; text-decoration: underline; }

/* --- 8. SVG 动效体系 (Grid Node Blink) --- */
.svg-grid-node {
  fill: currentColor;
  opacity: 0.2;
  transition: opacity 0.3s ease;
}
/* 节点依次点亮 */
.node-a { animation: blink-a 4s infinite 0.5s; }
.node-b { animation: blink-b 4s infinite 1.5s; }
.node-c { animation: blink-c 4s infinite 2.5s; }
.node-d { animation: blink-d 4s infinite 3.5s; }

@keyframes blink-a {
  0%, 20% { opacity: 0.2; }
  10% { opacity: 1; }
  20%, 100% { opacity: 0.2; }
}
@keyframes blink-b {
  0%, 20% { opacity: 0.2; }
  10% { opacity: 1; }
  20%, 100% { opacity: 0.2; }
}
@keyframes blink-c {
  0%, 20% { opacity: 0.2; }
  10% { opacity: 1; }
  20%, 100% { opacity: 0.2; }
}
@keyframes blink-d {
  0%, 20% { opacity: 0.2; }
  10% { opacity: 1; }
  20%, 100% { opacity: 0.2; }
}

/* 减少动态效果适配 */
@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;
  }
  .svg-grid-node { opacity: 1 !important; }
}
