/* SafeW 全站共享样式 */
:root {
  /* 色板 */
  --color-dark: #140E25;
  --color-paper: #FCFCFD;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #6EEDD2;
  --color-text-on-dark: #FCFCFD;
  --color-accent-on-dark: #6EEDD2;

  /* 设计 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-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);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* 布局容器 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-block: var(--section-y); }

/* 面型切换变量 */
.paper-face { background-color: var(--color-paper); color: var(--color-text); }
.paper-face .hl { color: var(--color-brand); }
.paper-face .eyebrow { color: var(--color-brand); }

.dark-face { background-color: var(--color-dark); color: var(--color-text-on-dark); }
.dark-face .hl { color: var(--color-accent-on-dark); }
.dark-face .eyebrow { color: var(--color-accent-on-dark); }
.dark-face .card { background: rgba(255, 255, 255, 0.06); }
.dark-face .btn-secondary { color: var(--color-text-on-dark); }
.dark-face table th, .dark-face table td { border-color: rgba(255, 255, 255, 0.12); }
.dark-face details { border-color: rgba(255, 255, 255, 0.12); }
.dark-face details[open] summary { background: rgba(255, 255, 255, 0.05); }

/* 排版层级 */
h1, h2, h3 { font-weight: 700; letter-spacing: 0.02em; line-height: 1.2; }
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: 1.25rem; margin-top: calc(var(--gap) * 1.5); margin-bottom: var(--gap); }
p { margin-bottom: var(--gap); max-width: 38em; }
strong { font-weight: 600; }
.eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.5em; display: block; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.8em 1.6em; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 1rem; cursor: pointer;
  border: 1px solid transparent; transition: transform 0.2s ease, opacity 0.2s ease;
  min-height: 48px;
}
.btn:hover { transform: translateY(-1px); opacity: 0.92; }
.btn:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; }
.btn-primary { background-color: var(--color-accent); color: var(--color-dark); }
.btn-secondary { background: transparent; border-color: currentColor; }

/* 网格与卡片 */
.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); }
.card {
  background: rgba(0, 0, 0, 0.02);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
}

/* 表格 */
table { width: 100%; border-collapse: collapse; margin-top: var(--gap); min-width: 0; }
th, td { padding: 0.8em 1em; text-align: left; border-bottom: 1px solid rgba(0, 0, 0, 0.08); vertical-align: top; white-space: normal; }
th { font-weight: 600; }
@media (min-width: 640px) {
  table { min-width: 500px; }
  th, td { white-space: nowrap; }
}

/* FAQ / Details */
details { border: 1px solid rgba(0, 0, 0, 0.08); border-radius: var(--radius-card); margin-bottom: var(--gap); overflow: hidden; }
summary {
  padding: 1em; font-weight: 600; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
summary::-webkit-details-marker { display: none; }
details[open] summary { background: rgba(0, 0, 0, 0.02); }
.faq-content { padding: 0 1em 1em; line-height: 1.7; }

/* 页头页脚 */
header { position: sticky; top: 0; z-index: 100; background: var(--color-paper); border-bottom: 1px solid rgba(0, 0, 0, 0.06); backdrop-filter: saturate(180%) blur(8px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 0.75em; font-weight: 700; font-size: 1.1rem; }
.brand img { width: 32px; height: 32px; object-fit: contain; }
nav { display: flex; gap: 1.5em; align-items: center; }
nav a { font-weight: 500; font-size: 0.95rem; padding: 0.4em 0; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-brand); }
.footer-nav { display: flex; gap: 1.5em; flex-wrap: wrap; margin-bottom: 1.5em; }
.footer-nav a { opacity: 0.8; transition: opacity 0.2s; }
.footer-nav a:hover { opacity: 1; color: var(--color-accent-on-dark); }
.copyright { font-size: 0.85rem; opacity: 0.6; margin-top: 1em; }

/* SVG 动效系统 */
.svg-panel { width: 100%; height: auto; }
.svg-panel [class*="anim-"] { transform-box: fill-box; transform-origin: center; }
.flow-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }
.dot-flow { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }

@keyframes dash-flow {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: -1; }
}
@keyframes dot-travel {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: -1; }
}
@keyframes float-bubble {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50% { transform: translateY(-5px); opacity: 1; }
}
@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.08); opacity: 1; }
}

.anim-draw { animation: dash-flow 6s linear infinite; }
.anim-dot { animation: dot-travel 8s linear infinite; }
.anim-float { animation: float-bubble 5s ease-in-out infinite; }
.anim-pulse { animation: pulse-ring 4s ease-in-out infinite; }

/* 减少动态效果支持 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 响应式适配 */
@media (max-width: 768px) {
  .hero-grid { flex-direction: column; }
  .feature-row { flex-direction: column; }
  h1 { font-size: 2.2rem; }
  .header-inner { padding: 0 var(--gap); }
  nav { display: none; } /* 移动端简化导航，保留主按钮 */
}
@media (min-width: 769px) {
  .feature-row { display: flex; align-items: center; gap: var(--gap); }
  .feature-row.reverse { flex-direction: row-reverse; }
  .feature-text { flex: 1; }
  .feature-visual { flex: 1; }
}

/* 兜底：裁掉横向溢出 */
div.container {
  overflow-x: clip;
}
