/* =========================================
   SafeW 全站共享样式
   ========================================= */

:root {
  /* 色板 */
  --color-dark: #2D1438;
  --color-paper: #F6F3F7;
  --color-text: #1F1523;
  --color-brand: #9E13DD;
  --color-accent: #6EEDA8;

  /* 圆角 */
  --radius-card: 20px;
  --radius-btn: 12px;

  /* 卡片边界 */
  --card-border: 1px solid;
  --card-shadow: none;

  /* 节奏与密度 */
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --line-height-body: 1.75;

  /* 内容最大宽度 */
  --content-max: 960px;

  /* 字体栈 */
  --font-sans: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

/* 基础重置与排版 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  line-height: var(--line-height-body);
  color: var(--color-text);
  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; transition: color 0.2s ease; }
ul, ol { list-style: none; }

/* 布局容器 */
.page-wrapper {
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}
.sidebar {
  width: 240px;
  background: var(--color-dark);
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  z-index: 100;
  flex-shrink: 0;
}
.main-content {
  flex: 1;
  padding: 0 var(--gap);
  max-width: calc(var(--content-max) + var(--gap) * 2);
  margin: 0 auto;
  width: 100%;
  overflow-x: hidden;
}

/* 响应式：窄屏退回顶部导航 */
@media (max-width: 768px) {
  .page-wrapper { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: fixed;
    top: 0;
    left: 0;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  }
  .main-content {
    padding-top: 80px;
    padding-bottom: var(--section-y);
    width: 100%;
  }
  .nav-links { display: flex; gap: 1rem; }
  .nav-links a { font-size: 0.9rem; padding: 0.4rem 0.8rem; border-radius: var(--radius-btn); }
}

/* 品牌标识 */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-paper);
}
.brand-logo img { width: 32px; height: 32px; object-fit: contain; }

/* 导航链接 */
.nav-links { display: flex; flex-direction: column; gap: 0.5rem; }
.nav-links a {
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-btn);
  color: rgba(246, 243, 247, 0.8);
  font-size: 0.95rem;
  font-weight: 500;
}
.nav-links a:hover, .nav-links a[aria-current="page"] {
  background: rgba(255,255,255,0.1);
  color: var(--color-paper);
}

/* 区块通用 */
.section {
  padding: var(--section-y) 0;
  position: relative;
}
.container {
  max-width: var(--content-max);
  margin: 0 auto;
}

/* 背景上下文 */
.bg-dark { background-color: var(--color-dark); color: var(--color-paper); }
.bg-dark .hl { color: var(--color-accent); }
.bg-dark .link { color: var(--color-accent); }
.paper-section { background-color: var(--color-paper); color: var(--color-text); }
.paper-section .hl { color: var(--color-brand); }
.paper-section .link { color: var(--color-brand); }

/* 标题系统 */
.subtitle-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.paper-section .subtitle-tag { color: var(--color-brand); }
.bg-dark .subtitle-tag { color: var(--color-accent); }

h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}
h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.75rem;
}
p { margin-bottom: 1rem; max-width: 38em; }
.text-center { text-align: center; }
.w-full { max-width: 100%; }

/* 高亮词 */
.hl { font-weight: 600; }

/* 按钮系统 */
.btn-group { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.5rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  padding: 0 1.5rem;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
  border: 2px solid var(--color-accent);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(0.95); }
.btn-secondary {
  background: transparent;
  border: 2px solid;
}
.paper-section .btn-secondary { color: var(--color-text); border-color: var(--color-text); }
.bg-dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.btn-secondary:hover { filter: brightness(0.9); transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

/* 卡片与面板 */
.card {
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  background: var(--color-paper);
  box-shadow: var(--card-shadow);
}
.bg-dark .card { background: var(--color-paper); color: var(--color-text); }
.panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}
.paper-section .panel { background: var(--color-paper); border: 1px solid rgba(31, 21, 35, 0.12); }

/* 表格 */
.platform-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}
.platform-table th, .platform-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(31, 21, 35, 0.1);
  text-align: left;
}
.platform-table th { font-weight: 600; color: var(--color-text); }
.bg-dark .platform-table th { color: var(--color-paper); }
.bg-dark .platform-table td { color: var(--color-paper); }
.platform-table tr:last-child td { border-bottom: none; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 1rem; }
.faq-item {
  border: var(--card-border);
  border-radius: var(--radius-card);
  background: var(--color-paper);
  overflow: hidden;
}
.bg-dark .faq-item { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); }
.faq-item summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  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.25rem; font-weight: 400; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { padding: 0 1.25rem 1rem; margin: 0; font-size: 0.95rem; line-height: 1.65; }

/* 资讯卡片 */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
  margin-top: 2rem;
}
.news-card {
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  background: var(--color-paper);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.news-card time { font-size: 0.8rem; color: var(--color-brand); font-weight: 500; }
.bg-dark .news-card time { color: var(--color-accent); }
.news-card h4 { font-size: 1.05rem; font-weight: 600; line-height: 1.35; }
.news-card p { font-size: 0.9rem; color: rgba(31, 21, 35, 0.8); margin: 0; }
.bg-dark .news-card p { color: rgba(246, 243, 247, 0.85); }

/* 时间轴 */
.timeline {
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid rgba(31, 21, 35, 0.15);
  margin-top: 1.5rem;
}
.paper-section .timeline { border-color: rgba(31, 21, 35, 0.15); }
.bg-dark .timeline { border-color: rgba(246, 243, 247, 0.2); }
.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  padding-left: 1rem;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.35rem;
  top: 0.25rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-brand);
  border: 2px solid var(--color-paper);
}
.bg-dark .timeline-item::before { background: var(--color-accent); border-color: var(--color-dark); }
.timeline-time { font-size: 0.85rem; font-weight: 700; color: var(--color-brand); margin-bottom: 0.25rem; }
.bg-dark .timeline-time { color: var(--color-accent); }

/* 步骤列表 */
.steps-list { counter-reset: step; margin-top: 1.5rem; }
.step-item {
  position: relative;
  padding-left: 3rem;
  margin-bottom: 1.5rem;
}
.step-item::before {
  counter-increment: step;
  content: "0" counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-item p { margin: 0.25rem 0 0; font-size: 0.95rem; }

/* 特性交错布局 */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
  margin-bottom: var(--section-y);
}
.feature-row.reverse .feature-text { order: 2; }
.feature-row.reverse .feature-visual { order: 1; }
@media (max-width: 768px) {
  .feature-row { grid-template-columns: 1fr; }
  .feature-row.reverse .feature-text { order: 1; }
  .feature-row.reverse .feature-visual { order: 2; }
}

/* SVG 动效核心 */
.svg-container { width: 100%; height: auto; }
svg { width: 100%; height: auto; display: block; }
svg[role="img"] { width: 24px; height: 24px; }

/* 描边绘制动画 */
.draw-path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-line 6s ease-in-out infinite;
}
@keyframes draw-line {
  0%, 100% { stroke-dashoffset: 1; }
  30%, 70% { stroke-dashoffset: 0; }
}

/* 节点依次点亮 */
.grid-node {
  opacity: 0.3;
  transform: scale(0.9);
  transform-box: fill-box;
  transform-origin: center;
  animation: node-glow 8s ease-in-out infinite;
}
.node-1 { animation-delay: 0s; }
.node-2 { animation-delay: 0.8s; }
.node-3 { animation-delay: 1.6s; }
.node-4 { animation-delay: 2.4s; }
.node-5 { animation-delay: 3.2s; }
.node-6 { animation-delay: 4.0s; }
@keyframes node-glow {
  0%, 100% { opacity: 0.3; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* 气泡漂浮 */
.bubble {
  transform-box: fill-box;
  transform-origin: center;
  animation: float-bubble 5s ease-in-out infinite;
}
.bubble-1 { animation-delay: 0s; }
.bubble-2 { animation-delay: 1.5s; }
@keyframes float-bubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* 输入呼吸点 */
.input-dot {
  opacity: 0.4;
  animation: breathe 3s ease-in-out infinite;
}
.dot-1 { animation-delay: 0s; }
.dot-2 { animation-delay: 0.4s; }
.dot-3 { animation-delay: 0.8s; }
@keyframes breathe {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* 滑入通知 */
.slide-in {
  opacity: 0;
  transform: translateX(20px);
  animation: slide-enter 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: 1s;
}
@keyframes slide-enter {
  to { opacity: 1; transform: translateX(0); }
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation-name: none;
  }
  .grid-node, .bubble, .input-dot, .draw-path, .slide-in {
    opacity: 1;
    transform: none;
  }
}

/* 页脚 */
.site-footer {
  padding: 3rem 0;
  border-top: 1px solid rgba(31, 21, 35, 0.1);
  margin-top: var(--section-y);
  font-size: 0.9rem;
}
.bg-dark .site-footer { border-color: rgba(246, 243, 247, 0.15); }
.footer-links { display: flex; gap: 1.5rem; margin-top: 1rem; }
.footer-links a:hover { text-decoration: underline; }
