/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* === 设计 Token === */
:root {
  /* 色板 */
  --color-dark: #251943;
  --color-paper: #DBD4ED;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED6E89;
  --color-white: #FFFFFF;

  /* 几何与边界 */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);

  /* 节奏与密度 */
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 960px;
  --lh-body: 1.55;
  --lh-title: 1.1;

  /* 字体 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

/* === 基础重置 === */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-paper);
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* === 布局容器 === */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}
.section {
  padding-block: var(--section-y);
  position: relative;
}
.section--dark {
  background: var(--color-dark);
  color: var(--color-paper);
}
.section--paper {
  background: var(--color-paper);
  color: var(--color-text);
}

/* === 排版系统 === */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: calc(var(--gap) * 0.5);
  padding-inline-start: 1.2em;
  position: relative;
}
.badge::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0.6em;
  height: 1px;
}
.section--paper .badge { color: var(--color-brand); }
.section--paper .badge::before { background: var(--color-brand); }
.section--dark .badge { color: var(--color-accent); }
.section--dark .badge::before { background: var(--color-accent); }

h1, h2, h3, h4 {
  font-weight: 800;
  line-height: var(--lh-title);
  letter-spacing: -0.02em;
  margin: 0 0 calc(var(--gap) * 0.75) 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
p { margin: 0 0 1em 0; max-width: 38em; }
strong { font-weight: 700; }

.text-accent { color: var(--color-accent); }
.text-brand { color: var(--color-brand); }

/* === 按钮组件 === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  height: 48px;
  padding: 0 1.5em;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
  border-color: var(--color-accent);
}
.btn-primary:hover { background: #d95a75; }
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-text);
}
.section--dark .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}
.btn-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* === 卡片与面板 === */
.card {
  background: var(--color-white);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  border-radius: var(--radius-card);
  transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: 0 14px 32px -12px rgba(25, 21, 35, 0.35); }
.panel {
  background: var(--color-dark);
  padding: var(--gap);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
}
.section--paper .panel { background: var(--color-paper); }

/* === 表格 === */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-block: var(--gap);
}
.data-table th, .data-table td {
  text-align: left;
  padding: 0.75em 1em;
  border-bottom: 1px solid currentColor;
  opacity: 0.9;
}
.data-table th { font-weight: 700; width: 40%; }
.data-table td { font-weight: 400; }
.section--dark .data-table { border-color: rgba(219, 212, 237, 0.2); }
.section--paper .data-table { border-color: rgba(25, 21, 35, 0.15); }

/* === FAQ / Details === */
details {
  border-bottom: 1px solid rgba(25, 21, 35, 0.15);
  padding: 1em 0;
}
.section--dark details { border-color: rgba(219, 212, 237, 0.15); }
summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-inline-end: 1em;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-weight: 400; opacity: 0.6; }
details[open] summary::after { content: "−"; }
details p { margin-top: 0.75em; margin-bottom: 0; }

/* === 页头与页脚 === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(219, 212, 237, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}
.section--dark .site-header { background: rgba(37, 25, 67, 0.9); border-color: rgba(219, 212, 237, 0.1); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-list { display: flex; gap: var(--gap); }
.nav-link { font-weight: 500; opacity: 0.8; transition: opacity 0.2s; }
.nav-link:hover, .nav-link[aria-current="page"] { opacity: 1; }
.nav-link[aria-current="page"] { font-weight: 700; }
.site-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: var(--section-y) 0;
  border-top: 1px solid rgba(219, 212, 237, 0.1);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--gap);
}
.footer-col h4 { font-size: 0.9rem; margin-bottom: 0.5em; opacity: 0.9; }
.footer-col a { display: block; padding: 0.3em 0; opacity: 0.7; transition: opacity 0.2s; }
.footer-col a:hover { opacity: 1; }
.copyright { margin-top: var(--gap); font-size: 0.85rem; opacity: 0.6; text-align: center; }

/* === SVG 动效类 === */
.hero-svg { width: 100%; height: auto; }
.svg-anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 8s ease-in-out infinite;
}
.svg-anim-float {
  animation: floatBubble 6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.svg-anim-slide {
  animation: slidePanel 10s ease-in-out infinite;
}
.svg-anim-breathe {
  animation: breatheDots 4s ease-in-out infinite;
}
.svg-anim-pulse {
  animation: pulseRing 5s ease-in-out infinite;
}

@keyframes drawLine {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}
@keyframes floatBubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes slidePanel {
  0%, 100% { transform: translateX(0); opacity: 1; }
  50% { transform: translateX(12px); opacity: 0.85; }
}
@keyframes breatheDots {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes pulseRing {
  0%, 100% { stroke-opacity: 0.2; stroke-width: 1; }
  50% { stroke-opacity: 0.6; stroke-width: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .svg-anim-draw, .svg-anim-float, .svg-anim-slide, .svg-anim-breathe, .svg-anim-pulse {
    animation: none !important;
  }
}

/* === 响应式适配 === */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr !important; }
  .flex-row { flex-direction: column !important; }
  .hide-mobile { display: none !important; }
}
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.flex-row { display: flex; align-items: center; gap: var(--gap); }
.feature-list li { position: relative; padding-inline-start: 1.5em; margin-bottom: 0.5em; }
.feature-list li::before { content: "•"; position: absolute; left: 0; color: var(--color-brand); }
.section--dark .feature-list li::before { color: var(--color-accent); }
.step-item { display: flex; gap: 1em; margin-bottom: 1.5em; }
.step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap); }
.news-card { background: var(--color-white); padding: var(--gap); border-radius: var(--radius-card); }
.news-date { font-size: 0.8rem; opacity: 0.7; margin-bottom: 0.5em; display: block; }
.news-title { font-weight: 700; margin-bottom: 0.5em; line-height: 1.3; }
.news-excerpt { font-size: 0.9rem; margin: 0; line-height: 1.6; }
