/* SafeW 全站共享样式 */
:root {
  /* 色板 */
  --color-dark: #140E25;
  --color-paper: #FCFCFD;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #6EEDD2;
  /* 卡片与面板底色微调 */
  --bg-card-light: rgba(0, 0, 0, 0.03);
  --bg-card-dark: rgba(255, 255, 255, 0.06);
  /* 结构 Token */
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;
  --font-body: 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; font-size: 16px; }
body {
  font-family: var(--font-body);
  background-color: var(--color-paper);
  color: var(--color-text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--color-brand); text-decoration: none; transition: opacity 0.2s ease; }
a:hover { opacity: 0.85; }
a:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; border-radius: 2px; }

/* 排版 */
h1, h2, h3, h4 { font-weight: 700; letter-spacing: 0.02em; line-height: 1.25; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); margin-bottom: var(--gap); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: calc(var(--gap) * 1.5); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: var(--gap); }
.eyebrow {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 0.5rem; display: inline-block;
}
.paper-theme .eyebrow { color: var(--color-brand); }
.dark-theme .eyebrow { color: var(--color-accent); }
.hl { font-weight: 800; }
.paper-theme .hl { color: var(--color-brand); }
.dark-theme .hl { color: var(--color-accent); }
p { max-width: 38em; margin-bottom: 1rem; }

/* 布局容器 */
.container { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding: var(--section-y) 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: center; }
@media (min-width: 900px) { .grid-2.auto-reverse { direction: rtl; } .grid-2.auto-reverse > * { direction: ltr; } }

/* 页头 */
header { position: sticky; top: 0; z-index: 100; background: var(--color-paper); transition: box-shadow 0.3s; }
header.scrolled { box-shadow: 0 1px 0 rgba(0,0,0,0.08); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.1rem; color: var(--color-text); }
.brand img { width: 32px; height: 32px; }
nav { display: flex; gap: var(--gap); align-items: center; }
nav a { font-weight: 600; font-size: 0.95rem; }
nav a[aria-current="page"] { color: var(--color-brand); }
.mobile-toggle { display: none; background: none; border: none; cursor: pointer; }
.mobile-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--color-paper); padding: var(--gap); border-top: 1px solid rgba(0,0,0,0.05); flex-direction: column; gap: 1rem; }
.mobile-nav.open { display: flex; }
@media (max-width: 768px) {
  nav.desktop { display: none; }
  .mobile-toggle { display: block; }
}

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0 1.25rem; height: 48px; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 1rem; cursor: pointer; transition: transform 0.2s, background 0.2s, border-color 0.2s;
  text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { background: #5bdcc0; transform: translateY(-1px); }
.btn-secondary { background: transparent; border: 1px solid var(--color-text); color: var(--color-text); }
.btn-secondary:hover { background: rgba(0,0,0,0.05); transform: translateY(-1px); }
.dark-theme .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.dark-theme .btn-secondary:hover { background: rgba(255,255,255,0.1); }

/* 卡片与面板 */
.card { background: var(--bg-card-light); border-radius: var(--radius-card); padding: var(--gap); }
.dark-panel { background: var(--color-dark); color: var(--color-paper); border-radius: var(--radius-card); padding: var(--gap); }
.paper-panel { background: var(--color-paper); color: var(--color-text); border-radius: var(--radius-card); padding: var(--gap); }

/* 表格 */
table { width: 100%; border-collapse: collapse; margin: var(--gap) 0; }
th, td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid rgba(0,0,0,0.1); }
th { font-weight: 700; }
.dark-theme th, .dark-theme td { border-bottom-color: rgba(255,255,255,0.1); }

/* FAQ */
details { border-bottom: 1px solid rgba(0,0,0,0.1); padding: 1rem 0; }
.dark-theme details { border-bottom-color: rgba(255,255,255,0.1); }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::marker { display: none; } summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.2rem; }
details[open] summary::after { content: "-"; }
details p { margin-top: 0.5rem; }

/* 资讯网格 */
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--gap); }
.news-card { background: var(--color-paper); border-radius: var(--radius-card); padding: var(--gap); }
.news-card time { font-size: 0.85rem; color: var(--color-brand); font-weight: 600; display: block; margin-bottom: 0.5rem; }

/* 步骤条 */
.steps-row { display: flex; gap: var(--gap); overflow-x: auto; padding-bottom: 1rem; }
.step-item { flex: 1 1 200px; min-width: 0; }
.step-num { width: 32px; height: 32px; background: var(--color-accent); color: var(--color-dark); border-radius: 6px; display: grid; place-items: center; font-weight: 700; margin-bottom: 0.5rem; }

/* SVG 动效基础 */
.svg-container { width: 100%; height: auto; }
svg { width: 100%; height: auto; }
.anim-draw { animation: drawLine 4s ease-in-out infinite; pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }
.anim-float { animation: floatAnim 4s ease-in-out infinite; }
.anim-breathe { animation: breatheAnim 2.5s ease-in-out infinite; }
.anim-slide { animation: slideInAnim 5s ease-in-out infinite; }
.svg-el { transform-box: fill-box; transform-origin: center; }
@keyframes drawLine { 0%, 100% { stroke-dashoffset: 1; } 50% { stroke-dashoffset: 0; } }
@keyframes floatAnim { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes breatheAnim { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes slideInAnim { 0%, 100% { transform: translateX(0); opacity: 1; } 10% { transform: translateX(-8px); opacity: 0; } 20%, 80% { transform: translateX(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .anim-draw, .anim-float, .anim-breathe, .anim-slide { animation: none !important; }
}

/* 页脚 */
footer { background: var(--color-dark); color: var(--color-paper); padding: var(--section-y) 0; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--gap); }
.footer-links { display: flex; gap: var(--gap); }
.footer-links a { color: var(--color-accent); }
.copyright { margin-top: 2rem; font-size: 0.9rem; opacity: 0.8; }

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
