/* =========================================
   SafeW 全站共享样式
   ========================================= */

:root {
  /* 基础色板 */
  --color-dark: #231334;
  --color-paper: #E9E8EA;
  --color-paper-alt: #F4F3F5;
  --color-text: #1C1523;
  --color-brand: #7D14EB;
  --color-accent: #EDD26E;

  /* 结构 Token */
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 960px;

  /* 排版 */
  --font-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "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);
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-text);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--color-brand); text-decoration: none; transition: opacity .2s; }
a:hover { opacity: .85; }
a:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin-bottom: .5em;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin-bottom: 1em; max-width: 38em; }
ul, ol { padding-left: 1.2em; margin-bottom: 1em; }
li { margin-bottom: .5em; }

/* 布局容器 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.section { padding: var(--section-y) 0; position: relative; }
.section-dark { background: var(--color-dark); color: var(--color-paper); --color-brand: var(--color-accent); }
.section-paper { background: var(--color-paper); }
.section-paper-alt { background: var(--color-paper-alt); }

/* 页头与页脚 */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(233, 232, 234, .95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(28, 21, 35, .1);
}
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.2rem; color: var(--color-text); }
.logo img { height: 32px; width: auto; }
nav ul { display: flex; gap: 24px; list-style: none; }
nav a { color: var(--color-text); font-weight: 500; }
nav a[aria-current="page"] { color: var(--color-brand); border-bottom: 2px solid var(--color-brand); }

footer { background: var(--color-dark); color: var(--color-paper); padding: 48px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 24px; }
.footer-links a { color: var(--color-accent); margin-left: 16px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 52px; padding: 0 24px; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 1rem; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
  border: none;
}
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn-primary { background: var(--color-accent); color: #231334; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(237, 210, 110, .4); }
.btn-outline { background: transparent; border: 2px solid currentColor; color: inherit; }
.btn-outline:hover { transform: translateY(-2px); opacity: .85; }
.btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; }

/* 卡片与面板 */
.card {
  background: var(--color-paper); border: var(--card-border);
  box-shadow: var(--card-shadow); border-radius: var(--radius-card); padding: 24px;
}
.panel {
  background: var(--color-dark); border-radius: var(--radius-card);
  padding: 32px; overflow: hidden;
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }

/* 表格 */
table { width: 100%; border-collapse: collapse; margin-bottom: 1em; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid rgba(28, 21, 35, .15); }
th { font-weight: 700; }
.section-dark th, .section-dark td { border-color: rgba(233, 232, 234, .2); }

/* FAQ */
details {
  border: var(--card-border); box-shadow: var(--card-shadow);
  border-radius: var(--radius-card); margin-bottom: 16px; background: var(--color-paper);
}
.section-dark details { background: #2a1a40; border-color: var(--color-paper); box-shadow: 4px 4px 0 var(--color-paper); }
summary {
  padding: 16px 24px; font-weight: 700; cursor: pointer;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.5rem; font-weight: 300; }
details[open] summary::after { content: "−"; }
.faq-body { padding: 0 24px 24px; line-height: 1.8; }

/* 标签与辅助 */
.tag { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 12px; color: var(--color-brand); }
.section-dark .tag { color: var(--color-accent); }
.hl { color: var(--color-brand); }
.section-dark .hl { color: var(--color-accent); }
.lead { font-size: 1.125rem; line-height: 1.6; margin-bottom: 24px; }

/* SVG 动效核心 */
@keyframes drawStroke { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes floatUp { 0%, 100% { transform: translateY(0); opacity: .8; } 50% { transform: translateY(-8px); opacity: 1; } }
@keyframes gridPulse { 0%, 100% { fill: rgba(255,255,255,.15); } 50% { fill: var(--color-accent); } }
@keyframes breathe { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }

.draw-line { stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawStroke 3s ease-in-out infinite alternate; }
.float-bubble { animation: floatUp 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.grid-node { animation: gridPulse 6s ease-in-out infinite; }
.breath-dot { animation: breathe 2s ease-in-out infinite; }
.delay-1 { animation-delay: .5s; } .delay-2 { animation-delay: 1s; }
.delay-3 { animation-delay: 1.5s; } .delay-4 { animation-delay: 2s; } .delay-5 { animation-delay: 2.5s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* 兜底：裁掉横向溢出 */
div.container {
  overflow-x: clip;
}
