/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* --- 设计变量 --- */
:root {
  --c-dark: #13102D;
  --c-paper: #D6D4ED;
  --c-body: #171523;
  --c-brand: #2714EB;
  --c-accent: #89ED6E;
  --r-card: 24px;
  --r-btn: 999px;
  --shadow-card: 0 10px 28px -14px rgba(23, 21, 35, 0.3);
  --sec-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --max-w: 1280px;
  --lh-body: 1.7;
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", 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: var(--lh-body);
  color: var(--c-body);
  background: var(--c-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

/* --- 容器与布局 --- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gap); }
.section { padding: var(--sec-y) 0; }
.grid-alt { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: center; }
@media (max-width: 768px) { .grid-alt { grid-template-columns: 1fr; } }

/* --- 表面上下文变量 --- */
.paper-surface { background: var(--c-paper); color: var(--c-body); }
.paper-surface .eyebrow { color: var(--c-brand); }
.paper-surface .hl { color: var(--c-brand); }
.paper-surface a { color: var(--c-brand); }
.paper-surface .btn-secondary { color: var(--c-body); border-color: var(--c-body); }
.paper-surface details { background: rgba(255, 255, 255, 0.6); border-color: rgba(23, 21, 35, 0.1); }

.dark-surface { background: var(--c-dark); color: var(--c-paper); }
.dark-surface .eyebrow { color: var(--c-accent); }
.dark-surface .hl { color: var(--c-accent); }
.dark-surface a { color: var(--c-accent); }
.dark-surface .btn-secondary { color: var(--c-paper); border-color: var(--c-paper); }
.dark-surface details { background: rgba(214, 212, 237, 0.1); border-color: rgba(214, 212, 237, 0.15); }

/* 深色面内的浅色卡片恢复纸面取色 */
.dark-surface .card {
  background: var(--c-paper);
  color: var(--c-body);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: var(--gap);
}
.dark-surface .card .eyebrow { color: var(--c-brand); }
.dark-surface .card .hl { color: var(--c-brand); }
.dark-surface .card a { color: var(--c-brand); }
.dark-surface .card .btn-secondary { color: var(--c-body); border-color: var(--c-body); }

/* --- 排版 --- */
h1 { font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; line-height: 1.25; margin-top: 0; margin-bottom: 1rem; }
h3 { font-size: 1.25rem; font-weight: 700; line-height: 1.3; margin-top: 1.5rem; margin-bottom: 0.75rem; }
p { max-width: 38em; margin-bottom: 1rem; }
.eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.5rem; display: block; }

/* --- 组件：按钮 --- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  height: 52px; padding: 0 24px; border-radius: var(--r-btn);
  font-weight: 600; font-size: 1rem; cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  border: none; text-align: center; justify-content: center;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; }
.btn-primary { background: var(--c-accent); color: var(--c-dark); }
.btn-secondary { background: transparent; }
.btn-icon { width: 20px; height: 20px; stroke-width: 2; }

/* --- 组件：卡片 --- */
.card {
  background: var(--c-paper); color: var(--c-body);
  border-radius: var(--r-card); box-shadow: var(--shadow-card);
  padding: var(--gap); transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: 0 12px 32px -12px rgba(23, 21, 35, 0.4); }

/* --- 组件：表格 --- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 0; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid rgba(23, 21, 35, 0.1); }
.dark-surface th, .dark-surface td { border-color: rgba(214, 212, 237, 0.15); }
th { font-weight: 700; white-space: nowrap; }
td a { text-decoration: underline; text-underline-offset: 3px; }

/* --- 组件：FAQ --- */
details { margin-bottom: var(--gap); border-radius: 12px; overflow: hidden; }
summary { cursor: pointer; font-weight: 600; list-style: none; position: relative; padding: 16px; user-select: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 16px; top: 16px; transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details > div { padding: 0 16px 16px; }

/* --- 组件：新闻卡片 --- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--gap); }
.news-card { padding: 24px; border: 1px solid rgba(23, 21, 35, 0.08); border-radius: var(--r-card); background: var(--c-paper); transition: transform 0.2s; }
.news-card:hover { transform: translateY(-3px); }
.news-card time { font-size: 0.85rem; font-weight: 600; color: var(--c-brand); display: block; margin-bottom: 8px; }
.news-card h4 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; line-height: 1.4; }
.news-card p { font-size: 0.95rem; margin-bottom: 0; }

/* --- 组件：SVG 响应式 --- */
.svg-responsive { width: 100%; height: auto; }

/* --- SVG 动效 --- */
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLoop 6s ease-in-out infinite; }
.anim-float { animation: floatMove 7s ease-in-out infinite; }
.anim-breathe { animation: breatheOp 5s ease-in-out infinite; }
.anim-slide { animation: slideIn 8s ease-in-out infinite; }
.anim-pulse { animation: pulseScale 4s ease-in-out infinite; }

@keyframes drawLoop {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}
@keyframes floatMove {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes breatheOp {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
@keyframes slideIn {
  0%, 100% { transform: translateX(16px); opacity: 0.7; }
  50% { transform: translateX(0); opacity: 1; }
}
@keyframes pulseScale {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* 统一变换中心 */
[class^="anim-"], [class*=" anim-"] { transform-box: fill-box; transform-origin: center; }

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  [class^="anim-"], [class*=" anim-"] { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* --- 页头页脚 --- */
header { position: sticky; top: 0; z-index: 100; backdrop-filter: blur(12px); background: rgba(214, 212, 237, 0.92); border-bottom: 1px solid rgba(23, 21, 35, 0.08); padding: 12px 0; }
.dark-surface header { background: rgba(19, 16, 45, 0.92); border-bottom-color: rgba(214, 212, 237, 0.1); }
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.logo-wrap { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; }
.logo-wrap img { width: 32px; height: 32px; object-fit: contain; }
nav { display: flex; gap: 24px; align-items: center; }
nav a { font-weight: 500; transition: color 0.2s; }
nav a:hover, nav a[aria-current="page"] { color: var(--c-brand); }
.dark-surface nav a { color: var(--c-paper); }
.dark-surface nav a:hover, .dark-surface nav a[aria-current="page"] { color: var(--c-accent); }
footer { padding: 48px 0; border-top: 1px solid rgba(23, 21, 35, 0.08); margin-top: var(--sec-y); }
.dark-surface footer { border-top-color: rgba(214, 212, 237, 0.1); }
.footer-inner { display: flex; flex-direction: column; gap: 24px; align-items: center; text-align: center; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.copyright { font-size: 0.85rem; opacity: 0.8; }

/* --- 辅助类 --- */
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-lg { margin-top: 2rem; }
.mb-md { margin-bottom: 1.5rem; }
.step-list { counter-reset: step; }
.step-list li { counter-increment: step; position: relative; padding-left: 2.5rem; margin-bottom: 1.25rem; }
.step-list li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; background: var(--c-accent); color: var(--c-dark); font-weight: 700; font-size: 0.9rem; display: grid; place-items: center; border-radius: 8px; }
.dark-surface .step-list li::before { background: var(--c-accent); color: var(--c-dark); }
.feature-block { margin-bottom: 3rem; padding-bottom: 2rem; border-bottom: 1px solid rgba(23, 21, 35, 0.08); }
.dark-surface .feature-block { border-color: rgba(214, 212, 237, 0.15); }
.feature-block:last-child { border-bottom: none; }
