/* =========================================
   SafeW 全站共享样式 (style.css)
   ========================================= */

/* --- 设计 Token & 变量 --- */
:root {
  /* 色板 */
  --bg-dark: #21163C;
  --bg-paper: #F4F3F7;
  --text-body: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED926E;

  /* 结构与圆角 */
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 1px solid rgba(25, 21, 35, 0.16);
  --card-shadow: none;
  
  /* 节奏与密度 */
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;
  
  /* 字体 */
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --line-height-base: 1.65;
}

/* --- 全局重置与基础排版 --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background-color: var(--bg-paper);
  color: var(--text-body);
  line-height: var(--line-height-base);
  font-size: 16px;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; object-fit: contain; }
a { color: inherit; text-decoration: none; transition: opacity 0.2s; }
ul, ol { list-style: none; }

/* --- 容器 --- */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* --- 面与卡片取色逻辑 --- */
.bg-dark {
  --bg-surface: var(--bg-dark);
  --text-primary: var(--bg-paper);
  --text-secondary: rgba(244, 243, 247, 0.85);
  --accent: var(--color-accent);
  --brand: var(--color-accent);
}
.bg-paper {
  --bg-surface: var(--bg-paper);
  --text-primary: var(--text-body);
  --text-secondary: var(--text-body);
  --accent: var(--color-accent);
  --brand: var(--color-brand);
}
.card-light {
  --bg-surface: var(--bg-paper);
  --text-primary: var(--text-body);
  --text-secondary: var(--text-body);
  --accent: var(--color-accent);
  --brand: var(--color-brand);
}

/* --- 排版组件 --- */
.milestone {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.5em;
  color: var(--brand);
}
.hl { color: var(--brand); font-weight: 600; }
.bg-dark .hl { color: var(--accent); }

h1, h2, h3 { font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; color: var(--text-primary); }
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); margin-bottom: 1.5rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 0.8em; }
h3 { font-size: 1.35rem; margin-bottom: 0.6em; }
p { margin-bottom: 1em; max-width: 38em; }
.text-secondary { color: var(--text-secondary); }

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  height: 52px;
  padding: 0 1.5em;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background-color: var(--accent);
  color: var(--bg-dark);
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--text-primary);
  color: var(--text-primary);
}
.bg-dark .btn-secondary { border-color: var(--bg-paper); color: var(--bg-paper); }

.icon-svg { width: 20px; height: 20px; flex-shrink: 0; }
.stroke-icon { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* --- 头部与底部 --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 243, 247, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.bg-dark .site-header { background: rgba(33, 22, 60, 0.9); border-bottom-color: rgba(255,255,255,0.08); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; }
.brand img { width: 32px; height: 32px; }
nav { display: flex; gap: 1.5em; align-items: center; }
nav a { font-size: 0.95rem; font-weight: 500; opacity: 0.8; }
nav a:hover, nav a[aria-current="page"] { opacity: 1; color: var(--brand); }
.bg-dark nav a { color: var(--bg-paper); }
.bg-dark nav a[aria-current="page"], .bg-dark nav a:hover { color: var(--accent); }

.site-footer {
  padding: 3em 0;
  border-top: 1px solid rgba(0,0,0,0.06);
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2em; }
.footer-links { display: flex; gap: 1.5em; }

/* --- 区块通用 --- */
.section { padding: var(--section-y) 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }

/* --- 卡片与列表 --- */
.card {
  background: var(--bg-surface);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 1.5em;
  box-shadow: var(--card-shadow);
}
.feature-list li {
  position: relative;
  padding-left: 1.5em;
  margin-bottom: 0.8em;
}
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  background: var(--brand);
  border-radius: 50%;
}

/* --- 表格 --- */
.spec-table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.spec-table th, .spec-table td { text-align: left; padding: 0.8em 1em; border-bottom: 1px solid rgba(0,0,0,0.08); }
.spec-table th { font-weight: 600; color: var(--text-primary); width: 40%; }
.spec-table td { color: var(--text-secondary); }

/* --- FAQ --- */
details {
  border: var(--card-border);
  border-radius: var(--radius-card);
  margin-bottom: 0.8em;
  background: var(--bg-surface);
}
summary {
  padding: 1em 1.2em;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.2em; font-weight: 400; }
details[open] summary::after { content: "−"; }
details > div { padding: 0 1.2em 1.2em; color: var(--text-secondary); }

/* --- 时间轴 --- */
.timeline { position: relative; padding-left: 2em; border-left: 2px solid rgba(0,0,0,0.1); }
.timeline-item { position: relative; margin-bottom: 2em; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.4em;
  top: 0.4em;
  width: 10px;
  height: 10px;
  background: var(--brand);
  border-radius: 50%;
  border: 2px solid var(--bg-paper);
}
.bg-dark .timeline-item::before { border-color: var(--bg-dark); }
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: var(--bg-dark);
  font-weight: 700;
  border-radius: 8px;
  margin-right: 0.8em;
  flex-shrink: 0;
}

/* --- SVG 动效 --- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes float-alt {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}
@keyframes draw-path {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes slide-in {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

.anim-float { animation: float 6s ease-in-out infinite; }
.anim-float-alt { animation: float-alt 7s ease-in-out infinite 1.5s; }
.anim-draw { animation: draw-path 1.8s ease-out forwards; }
.anim-breathe { animation: breathe 3.5s ease-in-out infinite; }
.anim-slide { animation: slide-in 0.8s ease-out forwards; }

/* 减少动态效果偏好 */
@media (prefers-reduced-motion: reduce) {
  .anim-float, .anim-float-alt, .anim-draw, .anim-breathe, .anim-slide {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* 旋转中心修正 */
.rot-center { transform-box: fill-box; transform-origin: center; }

/* --- 响应式微调 --- */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; height: auto; padding: 1em 0; gap: 1em; }
  nav { flex-wrap: wrap; justify-content: center; }
  .grid-2 { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
}
/* factory-contrast-width */
@media (min-width: 1440px) {
  [data-fc-1440="paper"] {
    color: #f4f3f7 !important;
    -webkit-text-fill-color: #f4f3f7 !important;
  }
}
