/* SafeW 全局样式与动效 */
:root {
  /* 色板 */
  --color-dark: #231334;
  --color-paper: #F5F3F7;
  --color-text: #1C1523;
  --color-brand: #7D14EB;
  --color-accent: #EDD26E;
  
  /* 设计 Token */
  --radius-card: 20px;
  --radius-btn: 12px;
  --radius-sm: 8px;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1120px;
  --line-height-body: 1.55;
  --font-weight-heading: 600;
  --heading-line-height: 1.25;
  --h1-size: clamp(2rem, 4.6vw, 3.4rem);
  
  /* 上下文变量（默认纸面） */
  --ctx-bg: var(--color-paper);
  --ctx-text: var(--color-text);
  --ctx-accent: var(--color-brand);
  --ctx-link: var(--color-brand);
  --ctx-btn-text: var(--color-dark);
}

/* 基础重置与排版 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 16px;
  line-height: var(--line-height-body);
  color: var(--ctx-text);
  background: var(--ctx-bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--ctx-link); text-decoration: none; transition: color 0.2s; }
a:hover { opacity: 0.85; }
ul, ol { list-style: none; }

/* 布局容器 */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
.section {
  padding-block: var(--section-y);
}

/* 标题系统 */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--ctx-accent);
  margin-bottom: 0.5em;
}
h1 {
  font-size: var(--h1-size);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ctx-text);
  margin-bottom: 1em;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: var(--font-weight-heading);
  line-height: var(--heading-line-height);
  color: var(--ctx-text);
  margin-bottom: 0.8em;
}
h3 {
  font-size: 1.25rem;
  font-weight: var(--font-weight-heading);
  line-height: 1.3;
  color: var(--ctx-text);
  margin-bottom: 0.6em;
}
p { margin-bottom: 1em; }
strong { font-weight: 600; }

/* 高亮词 */
.hl { color: var(--ctx-accent); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  height: 52px;
  padding: 0 1.2em;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, color 0.2s;
  white-space: nowrap;
}
.btn:focus-visible { outline: 3px solid var(--ctx-accent); outline-offset: 2px; }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
  border: none;
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(0.95); }
.btn-secondary {
  background: transparent;
  color: var(--ctx-text);
  border: 2px solid var(--ctx-text);
}
.btn-secondary:hover { background: rgba(0,0,0,0.05); }

/* 卡片 */
.card {
  background: var(--ctx-bg);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 1.5em;
}

/* 表格 */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
}
.spec-table td {
  padding: 0.8em 1em;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  vertical-align: top;
}
.spec-table td:first-child {
  font-weight: 600;
  width: 35%;
  color: var(--ctx-text);
}

/* 步骤条 */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}
.step-item {
  display: flex;
  gap: 1em;
  align-items: flex-start;
}
.step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  border-radius: var(--radius-btn);
}

/* FAQ */
details {
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: var(--radius-sm);
  padding: 1em;
  margin-bottom: 0.8em;
  background: var(--ctx-bg);
}
summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-left: 1.2em;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 8px;
  height: 8px;
  border: 2px solid var(--ctx-text);
  border-radius: 50%;
}
details[open] summary { margin-bottom: 0.6em; }

/* 资讯卡片 */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}
.news-card {
  background: var(--ctx-bg);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 1.2em;
  display: flex;
  flex-direction: column;
  gap: 0.6em;
}
.news-date {
  font-size: 0.85rem;
  color: var(--ctx-text);
  opacity: 0.7;
}

/* 上下文覆盖：深色区 */
.bg-dark {
  --ctx-bg: var(--color-dark);
  --ctx-text: var(--color-paper);
  --ctx-accent: var(--color-accent);
  --ctx-link: var(--color-accent);
  --ctx-btn-text: var(--color-dark);
}
.bg-dark .card {
  background: var(--color-paper);
  border-color: var(--color-text);
  color: var(--color-text);
}
.bg-dark .card h3, .bg-dark .card p, .bg-dark .card strong { color: var(--color-text); }
.bg-dark .badge { color: var(--color-accent); }
.bg-dark .spec-table td { border-color: rgba(0,0,0,0.15); }
.bg-dark .spec-table td:first-child { color: var(--color-text); }

/* 页头与页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ctx-bg);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  padding: 0.8em 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
}
.logo { display: flex; align-items: center; gap: 0.6em; font-weight: 700; font-size: 1.1rem; color: inherit; text-decoration: none; }
.logo img { height: 32px; width: auto; }
.nav-list { display: flex; gap: 1.5em; align-items: center; }
.nav-list a { font-weight: 500; }
.nav-list a[aria-current="page"] { color: var(--ctx-accent); font-weight: 700; }
.footer {
  background: var(--ctx-bg);
  border-top: 1px solid rgba(0,0,0,0.08);
  padding: 2em 0;
  margin-top: var(--section-y);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--gap);
}
.footer-links { display: flex; gap: 1em; flex-wrap: wrap; }

/* SVG 动效基础 */
.svg-visual { width: 100%; height: auto; overflow: visible; }
.svg-visual [class*="anim-"] { transform-box: fill-box; transform-origin: center; }
.anim-float { animation: float 6s ease-in-out infinite; }
.anim-float-delay { animation: float 6s ease-in-out infinite 1.5s; }
.anim-slide-in { animation: slideIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 2s linear infinite alternate; }
.anim-breathe { animation: breathe 3s ease-in-out infinite; }
.anim-pulse-dot { animation: pulseDot 2s ease-in-out infinite; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes drawLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; }
}

/* 减少动态效果 */
@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;
  }
  [class*="anim-"] { animation: none !important; }
}

/* 响应式微调 */
@media (max-width: 768px) {
  .nav-list { display: none; }
  .steps-grid { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }
  h1 br { display: none; }
}
