/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* --- 设计 Token --- */
:root {
  /* 颜色 */
  --color-dark: #271334;
  --color-paper: #E9E8EA;
  --color-text: #1D1523;
  --color-brand: #8A13DD;
  --color-accent: #9EED6E;
  
  /* 圆角 */
  --radius-card: 20px;
  --radius-btn: 12px;
  
  /* 卡片边界 */
  --card-border: 0;
  --card-shadow: none;
  
  /* 节奏与密度 */
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  
  /* 内容最大宽度 */
  --content-max: 1120px;
  
  /* 字体 */
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- 基础重置与排版 --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.55;
  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: opacity 0.2s ease; }
a:hover { opacity: 0.85; }
ul, ol { list-style: none; }

/* --- 容器 --- */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* --- 页头 --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(233, 232, 234, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(29, 21, 35, 0.08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}
.brand img { width: 32px; height: 32px; object-fit: contain; }
.nav-list { display: flex; gap: 24px; align-items: center; }
.nav-link { font-size: 0.95rem; font-weight: 500; position: relative; }
.nav-link[aria-current="page"] { color: var(--color-brand); }
.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  border: none;
}
.btn:focus-visible { outline: 3px solid var(--color-brand); outline-offset: 2px; }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(158, 237, 110, 0.3); }
.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--color-text);
  color: var(--color-text);
}
.btn-secondary:hover { background: rgba(29, 21, 35, 0.05); }
.dark-surface .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.dark-surface .btn-secondary:hover { background: rgba(233, 232, 234, 0.1); }

/* --- 通用区块 --- */
.section { padding: var(--section-y) 0; }
.section-dark { background-color: var(--color-dark); }
.section-light { background-color: var(--color-paper); }

/* 眉标 */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.paper-theme .eyebrow { color: var(--color-brand); }
.dark-theme .eyebrow { color: var(--color-accent); }

/* 标题 */
h1, h2, h3, h4 { font-weight: 500; line-height: 1.15; letter-spacing: -0.02em; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); margin-bottom: 24px; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 20px; text-wrap: balance; }
h3 { font-size: 1.35rem; margin-bottom: 12px; }
p { margin-bottom: 16px; max-width: 38em; }
.highlight { color: var(--color-brand); }
.dark-theme .highlight { color: var(--color-accent); }

/* 胶囊 */
.capsule-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.capsule {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(29, 21, 35, 0.06);
  border-radius: 99px;
  font-size: 0.9rem;
  font-weight: 500;
}
.dark-theme .capsule { background: rgba(233, 232, 234, 0.1); }
.capsule svg { width: 16px; height: 16px; stroke: currentColor; }

/* --- 卡片与面板 --- */
.card {
  background: rgba(29, 21, 35, 0.03);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 24px;
}
.panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: 32px;
  position: relative;
  overflow: hidden;
}
.panel-light {
  background: var(--color-paper);
  border: 1px solid rgba(29, 21, 35, 0.08);
}

/* --- 表格 --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(29, 21, 35, 0.1);
}
.data-table th { font-weight: 600; color: var(--color-brand); width: 40%; }
.dark-theme .data-table th { color: var(--color-accent); }
.dark-theme .data-table td { border-bottom-color: rgba(233, 232, 234, 0.15); }

/* --- FAQ --- */
.faq-item {
  border-bottom: 1px solid rgba(29, 21, 35, 0.1);
  padding: 16px 0;
}
.faq-summary {
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
}
.faq-summary::-webkit-details-marker { display: none; }
.faq-summary::after {
  content: "+";
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--color-brand);
}
details[open] .faq-summary::after { content: "−"; }
.faq-answer { margin-top: 12px; color: rgba(29, 21, 35, 0.85); line-height: 1.6; }

/* --- 步骤条 --- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
}
.step-card {
  background: rgba(29, 21, 35, 0.03);
  border-radius: var(--radius-card);
  padding: 20px;
  position: relative;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 8px;
  margin-bottom: 12px;
}
.dark-theme .step-card { background: rgba(233, 232, 234, 0.08); }

/* --- 资讯卡片 --- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
}
.news-card {
  background: rgba(29, 21, 35, 0.03);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.news-date { font-size: 0.8rem; color: rgba(29, 21, 35, 0.6); }
.dark-theme .news-card { background: rgba(233, 232, 234, 0.08); }
.dark-theme .news-date { color: rgba(233, 232, 234, 0.6); }

/* --- SVG 基础 --- */
.svg-container {
  width: 100%;
  height: auto;
  max-width: 100%;
}
.svg-container svg {
  width: 100%;
  height: auto;
  display: block;
}

/* --- SVG 动效 Keyframes --- */
@keyframes float-slow {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}
@keyframes float-medium {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
}
@keyframes float-fast {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}
@keyframes dash-flow {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes bubble-pop {
  0%, 100% { opacity: 0.4; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.02); }
}
@keyframes input-breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}
@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* 动效类 */
.anim-float-slow { animation: float-slow 6s ease-in-out infinite; }
.anim-float-medium { animation: float-medium 5s ease-in-out infinite 0.5s; }
.anim-float-fast { animation: float-fast 4s ease-in-out infinite 1s; }
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: dash-flow 2s linear infinite alternate; }
.anim-bubble { animation: bubble-pop 3s ease-in-out infinite; }
.anim-input { animation: input-breathe 2.5s ease-in-out infinite; }
.anim-slide { animation: slide-in-right 0.8s ease-out forwards; }

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- 响应式 --- */
@media (max-width: 768px) {
  .nav-list { display: none; }
  .hero-layout { flex-direction: column; }
  .split-layout { flex-direction: column; }
  .steps-grid { grid-template-columns: 1fr; }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
