/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* --- 设计变量与基础设置 --- */
:root {
  /* 色板 */
  --color-dark: #271231;
  --color-paper: #F6F3F7;
  --color-body: #1F1523;
  --color-brand: #9E13DD;
  --color-accent: #ED6EC0;
  
  /* 结构 Token */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(31, 21, 35, 0.3);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 960px;
  
  /* 排版 Token */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --line-height-base: 1.75;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--line-height-base);
  color: var(--color-body);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* --- 容器与布局 --- */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

.section-dark {
  background-color: var(--color-dark);
  color: var(--color-paper);
}

.section-dark .label,
.section-dark .hl { color: var(--color-accent); }

.label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  color: var(--color-brand);
}

.section-dark .label { color: var(--color-accent); }

h1, h2, h3, h4 {
  line-height: 1.2;
  letter-spacing: 0.02em;
  font-weight: 700;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: calc(var(--gap) * 0.75); }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }

p { margin-bottom: 1rem; max-width: 38em; }
strong { font-weight: 700; }

.hl {
  color: var(--color-brand);
  font-weight: 800;
}
.section-dark .hl { color: var(--color-accent); }

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  padding: 0 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
  border: 2px solid transparent;
}
.btn-primary:hover { background-color: #d95aae; }

.btn-secondary {
  background: transparent;
  color: var(--color-body);
  border: 1px solid var(--color-body);
}
.section-dark .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}
.btn-secondary:hover { background-color: rgba(0,0,0,0.05); }
.section-dark .btn-secondary:hover { background-color: rgba(255,255,255,0.08); }

.btn-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* --- 卡片与面板 --- */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  transition: box-shadow 0.3s ease;
}
.card:hover { box-shadow: 0 14px 32px -12px rgba(31, 21, 35, 0.35); }

.panel {
  background-color: var(--color-dark);
  border-radius: var(--radius-card);
  padding: var(--gap);
  position: relative;
  overflow: hidden;
}

/* --- 表格 --- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 500px;
}
th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(31, 21, 35, 0.12);
}
.section-dark th, .section-dark td { border-bottom-color: rgba(246, 243, 247, 0.15); }
th { font-weight: 700; }

/* --- FAQ --- */
.faq-item { border-bottom: 1px solid rgba(31, 21, 35, 0.1); }
.summary-custom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.summary-custom::-webkit-details-marker { display: none; }
.summary-custom::after {
  content: "+";
  font-size: 1.5rem;
  font-weight: 400;
  transition: transform 0.2s;
}
details[open] .summary-custom::after { transform: rotate(45deg); }
.details-content { padding-bottom: 1.25rem; line-height: 1.7; }

/* --- 页头与页脚 --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 243, 247, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(31, 21, 35, 0.08);
}
.section-dark ~ .header { background: rgba(39, 18, 49, 0.95); border-bottom-color: rgba(246, 243, 247, 0.1); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo { display: flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 1.1rem; }
.logo img { width: 32px; height: 32px; object-fit: contain; }
.nav { display: flex; gap: 1.5rem; align-items: center; }
.nav a { font-weight: 500; font-size: 0.95rem; padding: 0.5rem 0; position: relative; }
.nav a:hover { color: var(--color-brand); }
.section-dark .nav a { color: var(--color-paper); }
.section-dark .nav a:hover { color: var(--color-accent); }
.nav a[aria-current="page"] { color: var(--color-brand); font-weight: 700; }
.section-dark .nav a[aria-current="page"] { color: var(--color-accent); }

.footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: 3rem 0;
  font-size: 0.9rem;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  text-align: center;
}
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.footer-links a:hover { color: var(--color-accent); }
.copyright { opacity: 0.7; margin-top: 1rem; }

/* --- SVG 动效系统 --- */
.svg-visual { width: 100%; height: auto; }
.svg-visual path, .svg-visual circle, .svg-visual rect { transition: fill 0.3s, stroke 0.3s, opacity 0.3s; }

/* 描边绘制 */
.draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.anim-draw {
  animation: drawLine 4s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}
@keyframes drawLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

/* 节点依次点亮 */
.node { fill: rgba(246, 243, 247, 0.2); }
.anim-node-light:nth-child(1) { animation: pulseNode 3s 0s infinite; }
.anim-node-light:nth-child(2) { animation: pulseNode 3s 0.5s infinite; }
.anim-node-light:nth-child(3) { animation: pulseNode 3s 1s infinite; }
.anim-node-light:nth-child(4) { animation: pulseNode 3s 1.5s infinite; }
.anim-node-light:nth-child(5) { animation: pulseNode 3s 2s infinite; }
.anim-node-light:nth-child(6) { animation: pulseNode 3s 2.5s infinite; }
@keyframes pulseNode {
  0%, 100% { fill: rgba(246, 243, 247, 0.2); opacity: 0.3; }
  50% { fill: var(--color-accent); opacity: 1; }
}

/* 悬浮与呼吸 */
.float { animation: floatAnim 6s ease-in-out infinite; }
@keyframes floatAnim {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.breathe { animation: breatheAnim 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes breatheAnim {
  0%, 100% { opacity: 0.4; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.05); }
}
.slide-in { animation: slideIn 5s ease-in-out infinite alternate; }
@keyframes slideIn {
  from { transform: translateX(-10px); opacity: 0.6; }
  to { 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;
    animation-name: none;
  }
  .float, .breathe, .slide-in, .anim-draw, .anim-node-light { animation: none !important; }
}

/* --- 响应式微调 --- */
@media (max-width: 768px) {
  .nav { gap: 1rem; }
  .btn { height: 44px; font-size: 0.95rem; }
  .hero-grid { grid-template-columns: 1fr !important; }
}
