/* =========================================
   SafeW 全站共享样式
   ========================================= */
:root {
  /* 色板 */
  --color-dark: #121531;
  --color-paper: #E8E9EA;
  --color-body: #151723;
  --color-brand: #142CEB;
  --color-accent: #ED7D6E;

  /* 派生取色规则 */
  --text-on-dark: var(--color-paper);
  --text-on-paper: var(--color-body);
  --link-on-dark: var(--color-accent);
  --link-on-paper: var(--color-brand);

  /* 结构 Token */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 2px solid var(--color-body);
  --card-shadow: 4px 4px 0 var(--color-body);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1280px;

  /* 排版 Token */
  --font-main: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --lh-body: 1.75;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  line-height: var(--lh-body);
  color: var(--text-on-paper);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 布局容器 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-top: var(--section-y); padding-bottom: var(--section-y); }

/* 面色切换 */
.section-dark { background-color: var(--color-dark); color: var(--text-on-dark); }
.section-dark .hl { color: var(--color-accent); }
.section-dark .link { color: var(--color-accent); }
.section-dark .eyebrow { color: var(--color-accent); }
.section-dark .btn-secondary { border-color: var(--text-on-dark); color: var(--text-on-dark); }
.section-light { background-color: var(--color-paper); color: var(--text-on-paper); }
.section-light .hl { color: var(--color-brand); }
.section-light .link { color: var(--color-brand); }
.section-light .eyebrow { color: var(--color-brand); }

/* 标题与正文 */
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 600; line-height: 1.25; letter-spacing: 0; margin-bottom: 1rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 600; line-height: 1.25; margin-bottom: 1.5rem; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.3; margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; max-width: 38em; }
.eyebrow { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; margin-bottom: 0.5rem; }
.hl { color: inherit; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; height: 48px; border-radius: var(--radius-btn);
  font-weight: 600; text-decoration: none; cursor: pointer; transition: transform 0.2s ease, filter 0.2s ease;
  border: none; font-size: 1rem;
}
.btn-primary { background-color: var(--color-accent); color: var(--color-dark); }
.btn-secondary { background: transparent; border: 2px solid var(--color-body); color: var(--color-body); }
.btn:hover { transform: translateY(-2px); filter: brightness(0.95); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

/* 卡片 */
.card {
  background-color: var(--color-paper); border: var(--card-border);
  border-radius: var(--radius-card); box-shadow: var(--card-shadow);
  padding: 1.5rem; position: relative;
}
.section-dark .card { background-color: var(--color-paper); color: var(--text-on-paper); }

/* 网格与弹性布局 */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }
.hero-layout { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }
.hero-text { flex: 1 1 480px; }
.hero-visual { flex: 1 1 400px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: 0.95rem; }
th, td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid var(--color-body); }
.section-dark th, .section-dark td { border-bottom-color: rgba(232, 233, 234, 0.25); }
th { font-weight: 600; }

/* FAQ */
details { margin-bottom: 1rem; border: var(--card-border); border-radius: 12px; overflow: hidden; }
summary { padding: 1rem; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.25rem; transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details > div { padding: 0 1rem 1rem; line-height: 1.7; }

/* 页头页脚 */
header { position: sticky; top: 0; z-index: 100; background-color: var(--color-paper); border-bottom: 1px solid rgba(21, 23, 35, 0.08); padding: 1rem 0; backdrop-filter: blur(8px); }
.header-inner { display: flex; justify-content: space-between; align-items: center; }
nav ul { display: flex; list-style: none; gap: 1.5rem; }
nav a { text-decoration: none; color: var(--color-body); font-weight: 500; transition: color 0.2s; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-brand); }
footer { background-color: var(--color-dark); color: var(--text-on-dark); padding: 3rem 0; margin-top: var(--section-y); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-nav a { color: var(--text-on-dark); text-decoration: none; margin-left: 1.5rem; font-size: 0.9rem; }
.footer-nav a:hover { color: var(--color-accent); }

/* SVG 基础 */
svg.product-svg { width: 100%; height: auto; max-width: 100%; display: block; }
svg path, svg rect, svg circle, svg line { transition: stroke-dashoffset 0.4s ease; }

/* 动效 Keyframes */
@keyframes floatPanel { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes drawPath { to { stroke-dashoffset: 0; } }
@keyframes pulseNode { 0%, 100% { fill: #2a2e4a; opacity: 0.6; } 50% { fill: var(--color-accent); opacity: 1; } }
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes breathe { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

.anim-float { animation: floatPanel 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawPath 3.5s ease forwards; }
.anim-node { animation: pulseNode 5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-node:nth-child(2) { animation-delay: 0.8s; }
.anim-node:nth-child(3) { animation-delay: 1.6s; }
.anim-node:nth-child(4) { animation-delay: 2.4s; }
.anim-slide { animation: slideUp 0.8s ease forwards; opacity: 0; }
.anim-breathe { animation: breathe 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; }
  .anim-float, .anim-draw, .anim-node, .anim-slide, .anim-breathe { animation: none !important; }
}

/* 响应式微调 */
@media (max-width: 768px) {
  .hero-layout { flex-direction: column; }
  nav ul { gap: 1rem; }
  .card { padding: 1.25rem; }
}
