/* =========================================
   SafeW 全站共享样式
   ========================================= */
:root {
  /* 色板 */
  --color-dark-bg: #231334;
  --color-paper: #E9E8EA;
  --color-text: #1C1523;
  --color-brand: #7D14EB;
  --color-accent: #EDD26E;
  --color-text-on-dark: #E9E8EA;
  
  /* 排版与节奏 */
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1120px;
  --line-height-base: 1.65;
  --line-height-tight: 1.25;
  
  /* 组件参数 */
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: none;
  
  /* 字体栈 */
  --font-sans: 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-sans);
  background-color: var(--color-paper);
  color: var(--color-text);
  line-height: var(--line-height-base);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 容器 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.section-wrapper { padding: var(--section-y) 0; }
.divider { height: 1px; background: rgba(28, 21, 35, 0.1); margin: 0 auto; max-width: var(--content-max); }

/* 排版 */
h1, h2, h3, h4 { font-weight: 600; line-height: var(--line-height-tight); letter-spacing: 0; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); margin-bottom: var(--gap); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin: var(--section-y) 0 var(--gap); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin: var(--gap) 0 0.5em; }
p { margin-bottom: 1em; max-width: 38em; }
.text-hl { font-weight: 700; }

/* 链接与眉标 */
a { color: var(--color-brand); text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 0.5em; color: var(--color-brand); }
.section-dark .badge { color: var(--color-accent); }

/* 页头与导航 */
header { position: sticky; top: 0; z-index: 100; background: rgba(233, 232, 234, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(28, 21, 35, 0.08); }
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo img { height: 32px; width: auto; vertical-align: middle; }
nav ul { display: flex; gap: 1.5rem; list-style: none; }
nav a { color: var(--color-text); text-decoration: none; font-weight: 500; padding: 0.25em 0; border-bottom: 2px solid transparent; transition: border-color 0.2s; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-brand); border-bottom-color: var(--color-brand); }

/* 页脚 */
footer { background: var(--color-dark-bg); color: var(--color-text-on-dark); padding: var(--section-y) 0; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); }
.footer-col h4 { color: var(--color-accent); margin-bottom: 0.75em; font-size: 1rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.5em; }
.footer-col a { color: var(--color-text-on-dark); opacity: 0.85; text-decoration: none; }
.footer-col a:hover { opacity: 1; text-decoration: underline; }
.copyright { text-align: center; margin-top: var(--gap); opacity: 0.6; font-size: 0.85rem; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 0.5em; padding: 0.75em 1.5em; border-radius: var(--radius-btn); font-weight: 600; text-decoration: none; transition: transform 0.2s ease, opacity 0.2s ease; cursor: pointer; border: none; font-size: 1rem; }
.btn-primary { background: var(--color-accent); color: var(--color-dark-bg); }
.btn-secondary { background: transparent; border: 1px solid var(--color-text); color: var(--color-text); }
.btn-primary:hover, .btn-secondary:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--color-brand); outline-offset: 2px; }
.section-dark .btn-secondary { border-color: var(--color-text-on-dark); color: var(--color-text-on-dark); }

/* 区块背景控制 */
.section-dark { background: var(--color-dark-bg); color: var(--color-text-on-dark); }
.section-dark a { color: var(--color-accent); }
.section-dark .divider { background: rgba(233, 232, 234, 0.15); }
.section-dark .card { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08); }
.card { background: rgba(255, 255, 255, 0.5); border-radius: var(--radius-card); padding: var(--gap); border: var(--card-border); box-shadow: var(--card-shadow); }

/* 表格 */
table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 0.95rem; }
th, td { padding: 0.75em 1em; text-align: left; border-bottom: 1px solid rgba(28, 21, 35, 0.1); vertical-align: top; }
.section-dark th, .section-dark td { border-bottom-color: rgba(233, 232, 234, 0.15); }
th { font-weight: 600; }
tr:last-child td { border-bottom: none; }

/* FAQ */
details { margin-bottom: 1em; border-bottom: 1px solid rgba(28, 21, 35, 0.1); padding-bottom: 1em; }
.section-dark details { border-bottom-color: rgba(233, 232, 234, 0.15); }
summary { cursor: pointer; font-weight: 600; list-style: none; padding: 0.5em 0; display: flex; align-items: center; gap: 0.5em; }
summary::-webkit-details-marker { display: none; }
summary::marker { display: none; content: ""; }
summary:hover { color: var(--color-brand); }
.summary-icon { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; flex-shrink: 0; }

/* 步骤徽标 */
.step-list { counter-reset: step; list-style: none; }
.step-list li { position: relative; padding-left: 2.5em; margin-bottom: 1.25em; }
.step-list li::before { counter-increment: step; content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 0; width: 28px; height: 28px; background: var(--color-accent); color: var(--color-dark-bg); font-weight: 700; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; border-radius: 6px; }

/* 图文交错布局 */
.split-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: center; margin-bottom: var(--section-y); }
.split-row.reverse { direction: rtl; }
.split-row.reverse > * { direction: ltr; }
.panel-dark { background: var(--color-dark-bg); border-radius: var(--radius-card); padding: var(--gap); aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.panel-light { background: #ffffff; border-radius: var(--radius-card); padding: var(--gap); aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }

/* SVG 基础与动效类 */
svg { width: 100%; height: auto; max-width: 100%; display: block; }
svg g, svg path, svg circle, svg rect, svg line, svg polyline { transform-box: fill-box; transform-origin: center; }

@keyframes drawLine { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes slideIn { from { transform: translateX(-15px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes flowDash { to { stroke-dashoffset: -16; } }

.draw-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 3s ease forwards; }
.float { animation: float 4s ease-in-out infinite; }
.breathe { animation: breathe 3s ease-in-out infinite; }
.slide-in { animation: slideIn 0.8s ease-out forwards; }
.flow-line { stroke-dasharray: 8 8; animation: flowDash 2s linear infinite; }

/* 减少动态效果适配 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .draw-line { stroke-dashoffset: 0; }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 1em 0; }
  nav ul { flex-direction: column; gap: 0.5em; width: 100%; padding-top: 1em; }
  .split-row { grid-template-columns: 1fr; }
  .split-row.reverse { direction: ltr; }
  h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); }
}
