/* =========================================
   SafeW 全站共享样式 / Design Tokens
   ========================================= */
:root {
  /* 色板 */
  --color-dark: #240F29;
  --color-paper: #F6F3F7;
  --color-light-paper: #EAE7EC;
  --color-body: #201523;
  --color-brand: #A711CF;
  --color-accent: #ED6E73;
  --color-white: #FFFFFF;

  /* 结构性约束 */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 2px solid var(--color-body);
  --card-shadow: 4px 4px 0 var(--color-body);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;

  /* 字体比例 */
  --font-display: system-ui, -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --size-h1: clamp(2rem, 4.6vw, 3.4rem);
  --size-h2: clamp(1.6rem, 3vw, 2.4rem);
  --size-body: 1rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-display);
  font-size: var(--size-body);
  line-height: 1.65;
  color: var(--color-body);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
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);
}

.bg-dark { background-color: var(--color-dark); color: var(--color-paper); }
.bg-paper { background-color: var(--color-paper); color: var(--color-body); }
.bg-light { background-color: var(--color-light-paper); color: var(--color-body); }

/* 排版 */
.megatag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.bg-dark .megatag { color: var(--color-accent); }
.bg-paper .megatag, .bg-light .megatag { color: var(--color-brand); }
.megatag::before { content: ""; display: block; width: 12px; height: 2px; }

h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.25;
  text-wrap: balance;
}
h1 { font-size: var(--size-h1); margin-bottom: 1rem; }
h2 { font-size: var(--size-h2); margin-bottom: 1.25rem; }
h3 { font-size: 1.15rem; margin-bottom: 0.6rem; }

p { margin-bottom: 1rem; max-width: 38em; }
.text-hl { color: var(--color-brand); }
.bg-dark .text-hl { color: var(--color-accent); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-btn);
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 3px; }
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
  border: 2px solid transparent;
}
.btn-primary:hover { background-color: #d95b60; }

.btn-secondary {
  background: transparent;
  color: var(--color-body);
  border: 2px solid var(--color-body);
}
.bg-dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.bg-dark .btn-secondary:hover { background-color: rgba(255,255,255,0.1); }

/* 卡片与面板 */
.card {
  background: var(--color-white);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--color-body); }
.panel {
  background: var(--color-dark);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.bg-paper .panel { border-color: var(--color-body); }

/* 网格与列表 */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.list-steps li { position: relative; padding-left: 2rem; margin-bottom: 1.25rem; }
.list-steps li::before {
  content: attr(data-num);
  position: absolute; left: 0; top: 0;
  width: 28px; height: 28px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
}
.list-def dt { font-weight: 600; margin-bottom: 0.25rem; }
.list-def dd { margin-left: 0; margin-bottom: 1.25rem; color: rgba(32,21,35,0.85); }

/* 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid rgba(32,21,35,0.15); }
th { font-weight: 600; background: rgba(167,17,207,0.06); }
td:first-child { font-weight: 600; }

/* FAQ */
details { border: var(--card-border); margin-bottom: 0.75rem; background: var(--color-white); }
summary { padding: 1rem 1.25rem; cursor: pointer; font-weight: 600; list-style: none; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 1.25rem; top: 1.25rem; font-weight: 700; }
details[open] summary::after { content: "−"; }
details p { padding: 0 1.25rem 1rem; margin-bottom: 0; }

/* 页头页脚 */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246,243,247,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(32,21,35,0.1);
}
.bg-dark .site-header { background: rgba(36,15,41,0.95); border-bottom-color: rgba(255,255,255,0.1); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; 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; padding: 0.5rem 0; position: relative; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--color-brand); }
.bg-dark .nav a { color: var(--color-paper); }
.bg-dark .nav a:hover, .bg-dark .nav a[aria-current="page"] { color: var(--color-accent); }

.site-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: 3rem 0 2rem;
  border-top: 2px solid rgba(255,255,255,0.1);
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.footer-col h4 { color: var(--color-accent); margin-bottom: 0.75rem; font-size: 0.95rem; }
.footer-col a { display: block; padding: 0.25rem 0; opacity: 0.8; transition: opacity 0.2s; }
.footer-col a:hover { opacity: 1; }
.footer-bottom { text-align: center; font-size: 0.85rem; opacity: 0.6; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.08); }

/* SVG 动效基础 */
.svg-layer { width: 100%; height: auto; }
.orbit-ring { fill: none; stroke-width: 1.5; opacity: 0.6; transform-box: fill-box; transform-origin: center; }
.chat-bubble { opacity: 0.85; transform-box: fill-box; transform-origin: center; }
.dash-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; stroke-width: 2; }

/* 关键帧 */
@keyframes orbitBreathe {
  0%, 100% { transform: scale(0.95); opacity: 0.4; }
  50% { transform: scale(1.05); opacity: 0.8; }
}
@keyframes floatBubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes drawPulse {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}
@keyframes slideIn {
  0% { transform: translateY(8px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* 动效应用类 */
.anim-orbit-1 { animation: orbitBreathe 6s ease-in-out infinite; }
.anim-orbit-2 { animation: orbitBreathe 8s ease-in-out infinite reverse; }
.anim-orbit-3 { animation: orbitBreathe 10s ease-in-out infinite; }
.anim-float-1 { animation: floatBubble 4s ease-in-out infinite; }
.anim-float-2 { animation: floatBubble 5s ease-in-out infinite 1s; }
.anim-draw { animation: drawPulse 4s ease-in-out infinite; }
.anim-slide { animation: slideIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
}

/* 响应式微调 */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; height: auto; padding: 1rem 0; gap: 0.75rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero-layout { flex-direction: column; }
}
