/* =========================================
   SafeW 全站共享样式 (style.css)
   ========================================= */

/* --- 设计变量与基础重置 --- */
:root {
  /* 配色体系 */
  --dark-surface: #1B1231;
  --paper-surface: #F4F3F7;
  --body-text: #191523;
  --brand-color: #5214EB;
  --accent-color: #9977EE;

  /* 结构 Token */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 2px solid var(--body-text);
  --card-shadow: 4px 4px 0 var(--body-text);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1120px;

  /* 字体与排版 */
  --font-main: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --lh-base: 1.65;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background-color: var(--paper-surface);
  color: var(--body-text);
  line-height: var(--lh-base);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; transition: color 0.2s; }
ul, ol { padding-left: 0; list-style: none; }

/* --- 排版系统 --- */
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; color: inherit; }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.25; margin-bottom: calc(var(--gap) * 1.5); }
h3 { font-size: 1.25rem; margin-bottom: 0.75em; }
p { max-width: 38em; margin-bottom: 1em; }
small { font-size: 0.875rem; opacity: 0.8; }

/* 眉标与高亮 */
 Eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.5em; display: block; }
.paper-section .eyebrow { color: var(--brand-color); }
.dark-section .eyebrow { color: var(--accent-color); }

.hl { font-weight: 800; }
.paper-section .hl { color: var(--brand-color); }
.dark-section .hl { color: var(--accent-color); }

/* --- 布局容器 --- */
.container { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-block: var(--section-y); }
.paper-section { background-color: var(--paper-surface); color: var(--body-text); }
.dark-section { background-color: var(--dark-surface); color: var(--paper-surface); }

/* --- 导航与页头 --- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background-color: var(--paper-surface);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: background-color 0.3s, border-color 0.3s;
}
.dark-scroll .site-header { background-color: rgba(244,243,247,0.95); backdrop-filter: blur(8px); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 0.75em; font-weight: 800; font-size: 1.1rem; }
.brand img { height: 32px; width: auto; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { font-weight: 600; font-size: 0.95rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--brand-color); }
.header-actions { display: flex; gap: 0.75rem; align-items: center; }

/* --- 按钮组件 --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  height: 48px; padding: 0 1.75em; border-radius: var(--radius-btn);
  font-weight: 700; font-size: 1rem; cursor: pointer; border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s;
}
.btn:focus-visible { outline: 3px solid var(--accent-color); outline-offset: 3px; }
.btn-primary {
  background-color: var(--accent-color); color: var(--dark-surface);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(153,119,238,0.3); }
.btn-secondary {
  background: transparent; border: 2px solid var(--body-text); color: var(--body-text);
}
.btn-secondary:hover { background-color: rgba(0,0,0,0.04); transform: translateY(-2px); }
.dark-section .btn-secondary { border-color: var(--paper-surface); color: var(--paper-surface); }
.dark-section .btn-secondary:hover { background-color: rgba(255,255,255,0.08); }
.btn svg { width: 20px; height: 20px; stroke-width: 2; }

/* --- 卡片与面板 --- */
.card {
  background: var(--paper-surface);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 1.5em;
  transition: transform 0.2s;
}
.card:hover { transform: translateY(-4px); }
.dark-section .card {
  background: var(--dark-surface);
  border-color: var(--accent-color);
  box-shadow: 4px 4px 0 var(--accent-color);
  color: var(--paper-surface);
}
.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); }

/* --- 表格 --- */
.data-table { width: 100%; border-collapse: collapse; margin: 1.5em 0; }
.data-table th, .data-table td { padding: 0.75em 1em; text-align: left; border-bottom: 1px solid rgba(0,0,0,0.1); }
.data-table th { font-weight: 700; width: 40%; }
.dark-section .data-table th, .dark-section .data-table td { border-bottom-color: rgba(255,255,255,0.1); }

/* --- FAQ --- */
.faq-list details {
  margin-bottom: 1rem; border: var(--card-border); border-radius: 12px; overflow: hidden;
  background: var(--paper-surface);
}
.dark-section .faq-list details { background: var(--dark-surface); border-color: var(--accent-color); }
.faq-list summary {
  padding: 1rem 1.25rem; font-weight: 700; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; font-size: 1.25rem; transition: transform 0.2s; }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list .answer { padding: 0 1.25rem 1.25rem; line-height: 1.7; }

/* --- 时间线 (快速开始) --- */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: ""; position: absolute; left: 12px; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(to bottom, var(--brand-color), var(--accent-color));
}
.timeline-step { position: relative; margin-bottom: 2.5rem; padding-left: 1.5rem; }
.timeline-step::before {
  content: attr(data-step); position: absolute; left: -2rem; top: 0;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent-color); color: var(--dark-surface);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem;
}
.dark-section .timeline-step::before { background: var(--accent-color); color: var(--dark-surface); }

/* --- SVG 动效方向 (几何体旋转拼合 / 线条绘制 / 呼吸漂浮) --- */
.svg-panel { width: 100%; height: auto; max-width: 100%; }
.anim-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw-line 3s ease-in-out infinite alternate; }
.anim-rotate { transform-box: fill-box; transform-origin: center; animation: rotate-slow 12s linear infinite; }
.anim-float { animation: float-gentle 4s ease-in-out infinite; }
.anim-breathe { animation: breathe 2.5s ease-in-out infinite; }

@keyframes draw-line { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes rotate-slow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes float-gentle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes breathe { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

/* --- 响应式与无障碍 --- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero-stack { flex-direction: column; }
  .hero-visual { order: -1; }
  :where(.grid-2, .grid-3) { grid-template-columns: 1fr; }
}

@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;
  }
  .timeline::before { background: var(--brand-color); }
}
