/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* 设计变量与基础重置 */
:root {
  --c-dark: #21163C;
  --c-paper: #F4F3F7;
  --c-text: #191523;
  --c-brand: #5214EB;
  --c-accent: #ED926E;
  
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;
  --font-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --line-height: 1.75;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--line-height);
  color: var(--c-text);
  background-color: var(--c-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: opacity 0.2s ease; }
a:hover { opacity: 0.85; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* 容器与布局 */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

section {
  padding: var(--section-y) 0;
}

/* 颜色覆盖系统（严格遵循面与卡片的取色规则） */
.dark-section {
  --bg: var(--c-dark);
  --text: var(--c-paper);
  --link: var(--c-accent);
  --icon: var(--c-accent);
  background: var(--bg);
  color: var(--text);
}
.light-card {
  --bg: var(--c-paper);
  --text: var(--c-text);
  --link: var(--c-brand);
  --icon: var(--c-brand);
  background: var(--bg);
  color: var(--text);
  border: var(--card-border) solid transparent;
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  transition: box-shadow 0.3s ease;
}
.light-card:hover { box-shadow: 0 14px 32px -12px rgba(25, 21, 35, 0.35); }

/* 排版系统 */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-brand);
  margin-bottom: 0.75rem;
}
.dark-section .badge { color: var(--c-accent); }

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
  margin: 0 0 1rem;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; margin-top: 1.5rem; }
p { margin: 0 0 1rem; max-width: 38em; }
.hl { color: var(--c-brand); }
.dark-section .hl { color: var(--c-accent); }

/* 页头与导航 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 243, 247, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo-area { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.1rem; }
.logo-area img { height: 32px; width: auto; }
nav ul { display: flex; gap: 24px; }
nav a { font-weight: 500; padding: 8px 0; position: relative; }
nav a[aria-current="page"] { color: var(--c-brand); font-weight: 700; }
.dark-section nav { background: transparent; border-bottom: none; }
.dark-section .site-header { background: rgba(33, 22, 60, 0.9); border-bottom: 1px solid rgba(244, 243, 247, 0.1); }

/* 按钮组件 */
.btn-group { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 1.5rem; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--c-accent);
  color: var(--c-dark);
}
.btn-secondary {
  border: 1px solid var(--c-text);
  color: var(--c-text);
}
.dark-section .btn-secondary { border-color: var(--c-paper); color: var(--c-paper); }

/* 网格与卡片 */
.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); }
.feature-card { display: flex; flex-direction: column; gap: 12px; }
.feature-card svg { width: 24px; height: 24px; flex-shrink: 0; stroke: var(--icon); fill: none; }

/* 表格 */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 1rem; }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid rgba(25, 21, 35, 0.1); }
th { font-weight: 700; }
.dark-section th, .dark-section td { border-color: rgba(244, 243, 247, 0.15); }

/* FAQ 折叠面板 */
.faq-list { display: flex; flex-direction: column; gap: 12px; margin-top: 1.5rem; }
.faq-item details {
  background: var(--bg);
  border: var(--card-border) solid transparent;
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  transition: box-shadow 0.2s ease;
}
.faq-item summary {
  font-weight: 600;
  cursor: pointer;
  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; font-weight: 400; }
.faq-item details[open] summary::after { content: "−"; }
.faq-item p { margin: 12px 0 0; font-size: 0.95rem; }

/* 时间轴与步骤 */
.timeline { position: relative; padding-left: 32px; margin-top: 1.5rem; }
.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(25, 21, 35, 0.1);
}
.dark-section .timeline::before { background: rgba(244, 243, 247, 0.2); }
.timeline-step { position: relative; margin-bottom: 2rem; }
.step-num {
  position: absolute;
  left: -44px;
  top: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-accent);
  color: var(--c-dark);
  font-weight: 800;
  border-radius: 10px;
  font-size: 0.9rem;
}
.time-marker {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--c-brand);
  background: rgba(82, 20, 235, 0.08);
  padding: 4px 10px;
  border-radius: 8px;
  margin-bottom: 8px;
}
.dark-section .time-marker { color: var(--c-accent); background: rgba(237, 146, 110, 0.15); }

/* 新闻卡片 */
.news-card { display: flex; flex-direction: column; gap: 12px; }
.news-card time { font-size: 0.85rem; color: rgba(25, 21, 35, 0.6); font-weight: 500; }
.dark-section .news-card time { color: rgba(244, 243, 247, 0.6); }

/* 页脚 */
.site-footer {
  padding: 48px 0;
  border-top: 1px solid rgba(25, 21, 35, 0.08);
  text-align: center;
  font-size: 0.9rem;
  color: rgba(25, 21, 35, 0.6);
}
.dark-section .site-footer { border-top: 1px solid rgba(244, 243, 247, 0.1); color: rgba(244, 243, 247, 0.6); }
.footer-links { display: flex; justify-content: center; gap: 24px; margin-bottom: 16px; }
.footer-links a { font-weight: 500; }

/* =========================================
   SVG 动效关键帧与工具类
   ========================================= */
@keyframes floatA {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes floatB {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
@keyframes dashDraw {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0.3; }
  100% { stroke-dashoffset: 1; }
}
@keyframes slideIn {
  0% { transform: translateX(20px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

.anim-float { animation: floatA 6s ease-in-out infinite; }
.anim-float-slow { animation: floatB 8s ease-in-out infinite; }
.anim-breathe { animation: breathe 3s ease-in-out infinite; }
.anim-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: dashDraw 4s ease-in-out infinite; }
.anim-slide { animation: slideIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

/* SVG 变换中心修正 */
.svg-transform { transform-box: fill-box; transform-origin: center; }

/* 减少动态效果偏好 */
@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;
  }
  .anim-float, .anim-float-slow, .anim-breathe, .anim-draw, .anim-slide {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
