/* =========================================
   SafeW 全站共享样式 (style.css)
   ========================================= */

/* --- 1. 设计 Token 与变量 --- */
:root {
  /* 色板 */
  --color-deep: #19102D;       /* 深色面背景 */
  --color-paper: #F4F3F7;      /* 浅色纸面背景 */
  --color-text: #191523;       /* 纸面上的正文/标题色 */
  --color-brand: #5214EB;      /* 品牌色（纸面上） */
  --color-accent: #D66EED;     /* 强调色（按钮/深色面上强调） */
  
  /* 结构与间距 */
  --content-max: 1120px;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  
  /* 圆角与边界 */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 0;
  --card-shadow: none;
  
  /* 字体与排版 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  --line-height-base: 1.75;
}

/* --- 2. 基础重置与排版 --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--color-paper);
  color: var(--color-text);
  line-height: var(--line-height-base);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

button, input {
  font: inherit;
  color: inherit;
}

/* 通用容器 */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gap);
  padding-right: var(--gap);
}

/* 标题系统 */
.section-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.5em;
  display: inline-block;
}
/* 纸面眉标用品牌色，深色面眉标用强调色（通过父级类覆盖） */
body .section-eyebrow { color: var(--color-brand); }
.dark-surface .section-eyebrow { color: var(--color-accent); }

h1, h2, h3, h4 {
  line-height: 1.2;
  text-wrap: balance;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; margin-bottom: 0.6em; }
h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5em; letter-spacing: 0.02em; }

p {
  margin-bottom: 1em;
  max-width: 38em;
}
.highlight {
  font-weight: 800;
}
.light-surface .highlight { color: var(--color-brand); }
.dark-surface .highlight { color: var(--color-accent); }

/* 按钮系统 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  height: 52px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
  border: none;
}
.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-deep);
}
.btn-primary:hover {
  background-color: #c95ce0;
}
.btn-secondary {
  background: transparent;
  border: 2px solid var(--color-text);
  color: var(--color-text);
}
.light-surface .btn-secondary {
  border-color: var(--color-text);
  color: var(--color-text);
}
.dark-surface .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}
.btn-secondary:hover {
  background-color: rgba(0,0,0,0.05);
}
.dark-surface .btn-secondary:hover {
  background-color: rgba(255,255,255,0.08);
}
.btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

/* 卡片与面板 */
.card {
  background-color: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  position: relative;
}
.dark-surface .card {
  background-color: #251b3d; /* 深色面上的浅色卡片，恢复纸面取色逻辑的变体 */
}
.visual-panel {
  background-color: var(--color-deep);
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  overflow: hidden;
  position: relative;
}

/* 表格系统 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1em;
  margin-bottom: 1em;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
.dark-surface .data-table th,
.dark-surface .data-table td {
  border-bottom-color: rgba(255,255,255,0.1);
}
.data-table th {
  font-weight: 700;
  width: 40%;
}

/* FAQ 系统 */
.faq-item {
  border-bottom: 1px solid rgba(0,0,0,0.1);
  padding: 16px 0;
}
.dark-surface .faq-item {
  border-bottom-color: rgba(255,255,255,0.1);
}
.faq-item summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.5rem;
  line-height: 1;
  transition: transform 0.2s;
}
.faq-item[open] summary::after {
  transform: rotate(45deg);
}
.faq-item p {
  margin-top: 0.8em;
  margin-bottom: 0;
  color: rgba(var(--color-text-rgb), 0.85);
}

/* 新闻卡片 */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}
.news-card {
  background: rgba(0,0,0,0.03);
  padding: var(--gap);
  border-radius: var(--radius-card);
}
.news-card time {
  font-size: 0.85rem;
  color: rgba(0,0,0,0.5);
  display: block;
  margin-bottom: 0.5em;
}

/* 页头与页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-paper);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  backdrop-filter: blur(8px);
  background-color: rgba(244, 243, 247, 0.9);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand img {
  height: 32px;
  width: auto;
}
.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}
.nav-links a {
  font-weight: 500;
  font-size: 0.95rem;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] {
  opacity: 1;
  color: var(--color-brand);
}
.dark-surface .nav-links a { color: var(--color-paper); }
.dark-surface .nav-links a:hover, .dark-surface .nav-links a[aria-current="page"] { color: var(--color-accent); }

.site-footer {
  background-color: var(--color-deep);
  color: var(--color-paper);
  padding: var(--section-y) 0;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.footer-nav ul {
  display: flex;
  gap: 24px;
  list-style: none;
}
.footer-nav a { opacity: 0.7; transition: opacity 0.2s; }
.footer-nav a:hover { opacity: 1; color: var(--color-accent); }

/* 两列图文交错布局 */
.split-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}
.reverse-order {
  direction: rtl;
}
.reverse-order > * {
  direction: ltr;
}

/* =========================================
   SVG 动效系统
   ========================================= */
.svg-anim-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* 强制 SVG 缩放规则 */
svg.animated-svg {
  width: 100% !important;
  height: auto !important;
  max-width: 100%;
  box-sizing: border-box;
}

/* 呼吸效果 (Opacity) */
@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
.anim-breathe {
  animation: breathe 4s ease-in-out infinite;
}

/* 漂浮效果 (Transform Y) */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.anim-float {
  animation: float 6s ease-in-out infinite;
}

/* 依次浮现 (Opacity + Transform Y) */
@keyframes slideUpFade {
  0%, 100% { opacity: 0.3; transform: translateY(12px); }
  50% { opacity: 1; transform: translateY(0); }
}
.anim-slide-up-1 { animation: slideUpFade 5s ease-in-out infinite 0s; }
.anim-slide-up-2 { animation: slideUpFade 5s ease-in-out infinite 1s; }
.anim-slide-up-3 { animation: slideUpFade 5s ease-in-out infinite 2s; }

/* 描边流动 (Stroke-dashoffset) */
@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 3s linear infinite;
}

/* 几何旋转拼合 (Transform Rotate) */
@keyframes spinSlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.anim-spin {
  animation: spinSlow 20s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.anim-spin-reverse {
  animation: spinSlow 25s linear infinite reverse;
  transform-box: fill-box;
  transform-origin: center;
}

/* 通知卡片滑入 */
@keyframes notifSlide {
  0%, 100% { transform: translateX(10px); opacity: 0.5; }
  50% { transform: translateX(0); opacity: 1; }
}
.anim-notif {
  animation: notifSlide 4s ease-in-out infinite;
}

/* 输入框三点呼吸 */
@keyframes dotPulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}
.anim-dot-1 { animation: dotPulse 1.5s ease-in-out infinite 0s; }
.anim-dot-2 { animation: dotPulse 1.5s ease-in-out infinite 0.2s; }
.anim-dot-3 { animation: dotPulse 1.5s ease-in-out infinite 0.4s; }

/* 减少动态效果适配 */
@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-breathe, .anim-float, .anim-slide-up-1, .anim-slide-up-2, .anim-slide-up-3,
  .anim-draw, .anim-spin, .anim-spin-reverse, .anim-notif, .anim-dot-1, .anim-dot-2, .anim-dot-3 {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    stroke-dashoffset: 0 !important;
  }
}

/* =========================================
   响应式适配
   ========================================= */
@media (max-width: 768px) {
  .split-section {
    grid-template-columns: 1fr;
  }
  .reverse-order {
    direction: ltr;
  }
  .header-inner {
    flex-direction: column;
    height: auto;
    padding: 16px 0;
    gap: 12px;
  }
  .nav-links {
    gap: 16px;
  }
  .news-grid {
    grid-template-columns: 1fr;
  }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
