/* =========================================
   SafeW 全站共享样式
   设计变量 · 基础排版 · 组件 · SVG 动效
   ========================================= */

:root {
  /* 色板 */
  --bg-paper: #E9E8EA;
  --bg-dark: #21163C;
  --text-main: #191523;
  --text-on-dark: #E9E8EA;
  --brand: #5214EB;
  --accent: #ED926E;

  /* 卡片与边界 */
  --card-border: 1px solid rgba(25, 21, 35, 0.16);
  --card-shadow: none;
  --radius-card: 20px;
  --radius-btn: 12px;

  /* 节奏与间距 */
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1280px;

  /* 字体 */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-main);
  background-color: var(--bg-paper);
  -webkit-font-smoothing: antialiased;
  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);
}

/* 面色控制类 */
.paper-surface { color: var(--text-main); }
.dark-surface {
  background-color: var(--bg-dark);
  color: var(--text-on-dark);
}
.dark-surface .hl, .dark-surface .brand-text { color: var(--accent); }
.paper-surface .hl, .paper-surface .brand-text { color: var(--brand); }

/* 标题系统 */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--gap);
}
.paper-surface .section-tag { color: var(--brand); }
.dark-surface .section-tag { color: var(--accent); }

h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 var(--gap) 0;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 var(--gap) 0;
  text-wrap: balance;
}
h3 {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.5em 0;
}
p { margin: 0 0 1em 0; max-width: 38em; }
strong { font-weight: 600; }

/* 高亮词 */
.hl { font-weight: 700; }

/* 区块骨架 */
.section {
  padding-block: var(--section-y);
  position: relative;
}
.section + .section { border-top: 1px solid rgba(25, 21, 35, 0.12); }
.dark-surface .section + .section { border-top-color: rgba(233, 232, 234, 0.12); }

/* 页头 */
.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(25, 21, 35, 0.08);
}
.dark-surface .site-header { background: rgba(33, 22, 60, 0.9); border-bottom-color: rgba(233, 232, 234, 0.1); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; }
.logo img { width: 28px; height: 28px; object-fit: contain; }
.nav-list { display: flex; gap: 24px; }
.nav-link { font-weight: 500; font-size: 0.95rem; transition: opacity 0.2s; }
.nav-link:hover, .nav-link[aria-current="page"] { opacity: 0.8; }
.nav-link[aria-current="page"] { font-weight: 700; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-primary {
  background-color: var(--accent);
  color: var(--bg-dark);
  border: none;
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-secondary {
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
}
.paper-surface .btn-secondary { border-color: var(--text-main); }
.dark-surface .btn-secondary { border-color: var(--text-on-dark); }
.btn-secondary:hover { background: rgba(25, 21, 35, 0.06); }
.dark-surface .btn-secondary:hover { background: rgba(233, 232, 234, 0.08); }
.btn-group { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }

/* 卡片与面板 */
.card {
  background: var(--bg-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--card-shadow);
}
.dark-surface .card { background: rgba(233, 232, 234, 0.05); border-color: rgba(233, 232, 234, 0.15); }
.panel {
  background: var(--bg-dark);
  border-radius: var(--radius-card);
  padding: 32px;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.paper-surface .panel { background: var(--bg-paper); border: var(--card-border); }

/* 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 16px 0;
}
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}
.dark-surface .data-table th, .dark-surface .data-table td { border-bottom-color: rgba(233, 232, 234, 0.1); }
.data-table th { font-weight: 600; width: 40%; }

/* 列表与提示 */
.check-list { display: grid; gap: 16px; }
.check-item { display: flex; gap: 12px; align-items: flex-start; }
.check-icon { flex-shrink: 0; width: 20px; height: 20px; stroke: var(--brand); }
.dark-surface .check-icon { stroke: var(--accent); }

/* FAQ */
.faq-list { display: grid; gap: 12px; }
.faq-item { border: var(--card-border); border-radius: var(--radius-card); overflow: hidden; }
.faq-item summary {
  padding: 16px 20px;
  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-weight: 400; font-size: 1.2rem; transition: transform 0.2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-content { padding: 0 20px 16px 20px; line-height: 1.6; }

/* 新闻卡片 */
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.news-card { display: flex; flex-direction: column; }
.news-card time { font-size: 0.8rem; opacity: 0.7; margin-bottom: 8px; display: block; }
.news-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.news-card p { font-size: 0.95rem; opacity: 0.85; margin-bottom: 0; }

/* 页脚 */
.site-footer {
  padding-block: 48px;
  border-top: 1px solid rgba(25, 21, 35, 0.1);
}
.dark-surface .site-footer { border-top-color: rgba(233, 232, 234, 0.1); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; }
.footer-col h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 12px; opacity: 0.8; }
.footer-col a { display: block; padding: 4px 0; font-size: 0.9rem; opacity: 0.7; transition: opacity 0.2s; }
.footer-col a:hover { opacity: 1; }
.footer-bottom { margin-top: 32px; font-size: 0.8rem; opacity: 0.6; text-align: center; }

/* SVG 基础 */
.svg-icon { width: 24px; height: 24px; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.svg-panel { width: 100%; height: auto; max-width: 480px; }

/* SVG 动效 Keyframes */
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes float-delayed {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes draw-path {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes pulse-opacity {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
@keyframes slide-up {
  0% { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* 动效类绑定 */
.anim-float { animation: float-y 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-float-alt { animation: float-delayed 7s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw-path 3s ease forwards; }
.anim-pulse { animation: pulse-opacity 4s ease-in-out infinite; }
.anim-slide { animation: slide-up 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
  html { scroll-behavior: auto; }
}

/* 响应式微调 */
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 12px 0; }
  .nav-list { gap: 16px; margin-top: 8px; }
  .hero-layout { flex-direction: column; }
  .hero-visual { margin-top: 24px; }
}
