/* ========================================
   SafeW 全站共享样式
   ======================================== */

/* --- 设计变量 --- */
:root {
  /* 基础色板 */
  --color-dark: #13102D;
  --color-paper: #F7F5F3;
  --color-text: #171523;
  --color-brand: #2714EB;
  --color-accent: #89ED6E;

  /* 结构变量 */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px var(--color-text);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;

  /* 上下文覆盖变量（由容器类控制） */
  --bg-surface: var(--color-paper);
  --text-primary: var(--color-text);
  --text-secondary: rgba(23, 21, 35, 0.75);
  --accent-highlight: var(--color-brand);
  --border-subtle: rgba(23, 21, 35, 0.08);

  /* 字体栈 */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  --font-heading: "Inter", "PingFang SC", "Microsoft YaHei", var(--font-body);
}

/* 深色面上下文 */
.bg-dark {
  --bg-surface: var(--color-dark);
  --text-primary: var(--color-paper);
  --text-secondary: rgba(247, 245, 243, 0.75);
  --accent-highlight: var(--color-accent);
  --border-subtle: rgba(247, 245, 243, 0.12);
}

/* 浅色卡片上下文（置于深色面内） */
.card-light {
  --bg-surface: var(--color-paper);
  --text-primary: var(--color-text);
  --text-secondary: rgba(23, 21, 35, 0.75);
  --accent-highlight: var(--color-brand);
  --border-subtle: rgba(23, 21, 35, 0.08);
}

/* --- 基础重置与排版 --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
ul, ol { list-style: none; }
button, input { font-family: inherit; }

/* 标题层级 */
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 500; line-height: 1.15; color: var(--text-primary); }
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); letter-spacing: -0.02em; margin-bottom: 1.2rem; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); margin-bottom: 1.5rem; }
h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); margin-bottom: 0.8rem; }
p { margin-bottom: 1rem; max-width: 38em; }

/* 眉标 */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-highlight);
  margin-bottom: 0.8rem;
}

/* 高亮词 */
.hl { color: var(--accent-highlight); font-weight: 600; }

/* --- 布局容器 --- */
.container { width: 100%; max-width: var(--content-max); margin-inline: auto; padding-inline: var(--gap); }
.section { padding-block: var(--section-y); background-color: var(--bg-surface); position: relative; }
.grid-2 { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); align-items: center; }
.grid-3 { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }

/* --- 组件：按钮 --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  padding: 0.9rem 1.8rem; border-radius: var(--radius-btn); font-weight: 600;
  cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  white-space: nowrap; border: none; font-size: 1rem;
}
.btn:focus-visible { outline: 3px solid var(--accent-highlight); outline-offset: 3px; }
.btn-primary {
  background-color: var(--color-accent); color: var(--color-dark);
  box-shadow: 0 4px 12px rgba(137, 237, 110, 0.25);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-secondary {
  background: transparent; border: 1.5px solid var(--text-primary); color: var(--text-primary);
}
.btn-secondary:hover { background: rgba(128,128,128,0.1); transform: translateY(-1px); }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* --- 组件：卡片与面板 --- */
.card {
  background: var(--bg-surface);
  border: var(--card-border) solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 1.8rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  overflow-wrap: break-word;
  word-break: break-word;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px -12px var(--color-text); }
.visual-panel {
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  aspect-ratio: 4 / 3;
  position: relative;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.visual-panel svg { width: 100%; height: 100%; max-width: 100%; }

/* --- 组件：表格 --- */
.platform-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.platform-table th, .platform-table td {
  padding: 0.9rem 1rem; text-align: left; border-bottom: 1px solid var(--border-subtle);
}
.platform-table th { font-weight: 600; color: var(--text-primary); }
.platform-table td { color: var(--text-secondary); }
.platform-table tr:last-child td { border-bottom: none; }
.platform-table a { color: var(--accent-highlight); text-decoration: underline; text-underline-offset: 3px; }

/* --- 组件：FAQ --- */
.faq-item { border-bottom: 1px solid var(--border-subtle); padding: 1.2rem 0; }
.faq-item summary {
  cursor: pointer; font-weight: 600; color: var(--text-primary);
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.2rem; transition: transform 0.2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin-top: 0.8rem; color: var(--text-secondary); padding-left: 0.5rem; }

/* --- 组件：步骤条 --- */
.steps-bar { display: flex; gap: var(--gap); flex-wrap: wrap; }
.step-item { flex: 1 1 200px; position: relative; padding-left: 2.5rem; }
.step-num {
  position: absolute; left: 0; top: 0; width: 28px; height: 28px;
  background: var(--color-accent); color: var(--color-dark);
  border-radius: 8px; display: grid; place-items: center;
  font-weight: 700; font-size: 0.9rem;
}

/* --- 组件：新闻卡片 --- */
.news-card { display: flex; flex-direction: column; gap: 0.6rem; }
.news-card time { font-size: 0.85rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.news-card h4 { font-size: 1.1rem; margin: 0; }
.news-card p { font-size: 0.95rem; color: var(--text-secondary); margin: 0; }

/* --- 页头与页脚 --- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247, 245, 243, 0.85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
}
.bg-dark .site-header { background: rgba(19, 16, 45, 0.9); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 0.8rem; font-weight: 700; font-size: 1.2rem; }
.logo img { width: 32px; height: 32px; object-fit: contain; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { font-weight: 500; font-size: 0.95rem; color: var(--text-primary); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--accent-highlight); }
.site-footer { padding: 3rem 0; border-top: 1px solid var(--border-subtle); text-align: center; color: var(--text-secondary); font-size: 0.9rem; }

/* --- SVG 动效系统 --- */
.svg-anim-container { width: 100%; height: 100%; }
.geo-shape {
  transform-box: fill-box;
  transform-origin: center;
  animation: geo-spin 18s linear infinite;
}
.geo-shape-alt {
  transform-box: fill-box;
  transform-origin: center;
  animation: geo-spin-alt 22s linear infinite reverse;
}
.ui-bubble {
  animation: float-gentle 4s ease-in-out infinite;
}
.ui-bubble-delay { animation-delay: 1.5s; }
.typing-dot { animation: dot-breathe 2s ease-in-out infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.3s; }
.typing-dot:nth-child(3) { animation-delay: 0.6s; }
.draw-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-path 6s ease-in-out infinite alternate;
}
.slide-in-card {
  animation: slide-up 5s ease-in-out infinite alternate;
}

@keyframes geo-spin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.05); }
  100% { transform: rotate(360deg) scale(1); }
}
@keyframes geo-spin-alt {
  0% { transform: rotate(0deg) translate(0, 0); }
  33% { transform: rotate(120deg) translate(4px, -4px); }
  66% { transform: rotate(240deg) translate(-4px, 4px); }
  100% { transform: rotate(360deg) translate(0, 0); }
}
@keyframes float-gentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes dot-breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes draw-path {
  0% { stroke-dashoffset: 1; }
  30% { stroke-dashoffset: 0; }
  70% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}
@keyframes slide-up {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-8px); opacity: 0.95; }
}

/* 减少动态效果 */
@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;
  }
}

/* --- 对比度修复：深色背景下的文字颜色 --- */
.bg-dark p,
#features p {
  color: #E8E6F0;
}
.bg-dark span.card {
  color: #FFFFFF;
}
.section.bg-dark h2,
.section.bg-dark .container h2 {
  color: #FFFFFF;
}
.section.bg-dark strong {
  color: #FFFFFF;
}
.section.bg-dark .checklist p {
  color: #D8D6E0;
}
.section.bg-dark .eyebrow {
  color: #89ED6E; /* 保持品牌强调色，确保在深色底上可见 */
}

/* 响应式微调 */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .visual-panel { order: -1; aspect-ratio: 16/9; }
  .steps-bar { flex-direction: column; }
  .nav-links { gap: 1rem; }
  .header-inner .btn { padding: 0.7rem 1.2rem; font-size: 0.9rem; }
}
