/* =========================================
   SafeW 全站共享样式 (style.css)
   ========================================= */

/* 设计变量 */
:root {
  /* 色板 */
  --color-dark: #140E25;
  --color-paper: #F7F5F3;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #C8ED6E;
  
  /* 结构尺寸 */
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1120px;
  
  /* 字体与排版 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", 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; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--line-height-body);
  color: var(--color-text);
  background-color: var(--color-paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: opacity 0.2s ease; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* 容器与布局 */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
.grid { display: grid; gap: var(--gap); }
.flex { display: flex; gap: var(--gap); align-items: center; }

/* 头部与导航 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 245, 243, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
}
.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.02em; }
.brand img { width: 28px; height: 28px; object-fit: contain; }
.nav-links { display: flex; gap: 24px; }
.nav-links a { font-size: 0.95rem; font-weight: 500; opacity: 0.8; }
.nav-links a:hover, .nav-links a[aria-current="page"] { opacity: 1; color: var(--color-brand); }
.mobile-toggle { display: none; background: none; border: none; cursor: pointer; }

/* 页脚 */
.site-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: 48px 0 32px;
  margin-top: var(--section-y);
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; }
.footer-col h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 16px; color: var(--color-accent); }
.footer-col ul li { margin-bottom: 10px; }
.footer-col a { opacity: 0.8; font-size: 0.9rem; }
.footer-col a:hover { opacity: 1; color: var(--color-accent); }
.footer-bottom {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(247, 245, 243, 0.15);
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.7;
}

/* 按钮系统 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 24px;
  height: 48px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(200, 237, 110, 0.35); }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--color-text);
  color: var(--color-text);
}
.btn-secondary:hover { background: rgba(25, 21, 35, 0.05); }
.dark-surface .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.dark-surface .btn-secondary:hover { background: rgba(247, 245, 243, 0.1); }
.btn:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 3px; }

/* 表面与区块 */
.surface-paper { background: var(--color-paper); color: var(--color-text); }
.surface-dark { background: var(--color-dark); color: var(--color-paper); }
.surface-dark .hl { color: var(--color-accent); }
.section-divider { height: 1px; background: rgba(25, 21, 35, 0.12); margin: 0; }
.surface-dark .section-divider { background: rgba(247, 245, 243, 0.15); }

/* 标题系统 */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  padding: 4px 10px;
  border-radius: 4px;
}
.paper-badge { color: var(--color-brand); background: rgba(82, 20, 235, 0.08); }
.dark-badge { color: var(--color-accent); background: rgba(200, 237, 110, 0.12); }
h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 16px;
}
h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 12px;
}
.hl { color: var(--color-brand); }
.surface-dark .hl { color: var(--color-accent); }

/* 卡片与面板 */
.card {
  background: #fff;
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px -12px rgba(25, 21, 35, 0.35); }
.panel {
  background: var(--color-dark);
  border-radius: 12px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.dark-surface .panel { background: rgba(247, 245, 243, 0.06); border: 1px solid rgba(247, 245, 243, 0.1); }

/* 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}
.data-table th { font-weight: 600; color: var(--color-text); background: rgba(25, 21, 35, 0.03); }
.surface-dark .data-table th, .surface-dark .data-table td { border-color: rgba(247, 245, 243, 0.1); color: var(--color-paper); }

/* FAQ 详情块 */
.faq-item { margin-bottom: 16px; border: 1px solid rgba(25, 21, 35, 0.1); border-radius: var(--radius-card); overflow: hidden; }
.faq-item summary {
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(25, 21, 35, 0.02);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.2rem; font-weight: 400; transition: transform 0.2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 16px 20px; font-size: 0.95rem; line-height: 1.7; color: rgba(25, 21, 35, 0.85); }
.surface-dark .faq-item { border-color: rgba(247, 245, 243, 0.15); }
.surface-dark .faq-item summary { background: rgba(247, 245, 243, 0.05); color: var(--color-paper); }
.surface-dark .faq-item p { color: rgba(247, 245, 243, 0.85); }

/* 图文交错布局 */
.split-layout { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: center; }
.reverse-layout { direction: rtl; }
.reverse-layout > * { direction: ltr; }

/* 步骤条 */
.steps-bar { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.step-node {
  flex: 1 0 180px;
  background: rgba(25, 21, 35, 0.03);
  padding: 16px;
  border-radius: var(--radius-card);
  border-left: 3px solid var(--color-brand);
}
.surface-dark .step-node { background: rgba(247, 245, 243, 0.05); border-left-color: var(--color-accent); }
.step-num { font-weight: 800; color: var(--color-brand); margin-bottom: 8px; }
.surface-dark .step-num { color: var(--color-accent); }

/* SVG 动效系统 */
.svg-container { width: 100%; height: auto; }
svg { width: 100%; height: auto; shape-rendering: geometricPrecision; }
svg path, svg rect, svg circle, svg line { fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* 绘制动画 */
.draw-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawStroke 3s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}
@keyframes drawStroke {
  0%, 100% { stroke-dashoffset: 0; }
  50% { stroke-dashoffset: 1; }
}

/* 呼吸点 */
.breath-dot {
  fill: var(--color-brand);
  animation: breathPulse 2.5s ease-in-out infinite alternate;
}
.surface-dark .breath-dot { fill: var(--color-accent); }
@keyframes breathPulse {
  0% { opacity: 0.4; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1.1); }
}
.transform-origin-center { transform-box: fill-box; transform-origin: center; }

/* 卡片层叠漂浮 */
.float-card {
  animation: cardFloat 6s ease-in-out infinite alternate;
}
.float-card.delay-1 { animation-delay: -1.5s; }
.float-card.delay-2 { animation-delay: -3s; }
@keyframes cardFloat {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-8px); }
}

/* 减少动态效果 */
@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;
  }
  .draw-line, .float-card, .breath-dot { animation: none !important; }
}

/* 响应式适配 */
@media (max-width: 900px) {
  .split-layout { grid-template-columns: 1fr; }
  .reverse-layout { direction: ltr; }
  .steps-bar { flex-direction: column; }
  .mobile-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--color-paper); flex-direction: column; padding: 24px; border-bottom: 1px solid rgba(0,0,0,0.1); }
  .nav-links.open { display: flex; }
}
@media (min-width: 901px) {
  .nav-links { display: flex !important; }
}
