/* =========================================
   SafeW 共享样式表 (style.css)
   ========================================= */

/* 设计变量与 Token */
:root {
  /* 色板 */
  --color-dark: #141838;
  --color-paper: #FCFCFD;
  --color-text: #151723;
  --color-brand: #142CEB;
  --color-accent: #6EAFED;

  /* 组件边界 */
  --radius-card: 8px;
  --radius-btn: 6px;

  /* 卡片样式 */
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);

  /* 节奏与密度 */
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --body-lh: 1.55;

  /* 内容宽度 */
  --content-max: 1120px;

  /* 标题规范 */
  --title-lh: 1.25;
  --title-weight: 600;
}

/* 面板上下文变量覆盖 */
.panel-dark {
  --bg: var(--color-dark);
  --text: var(--color-paper);
  --highlight: var(--color-accent);
  --link: var(--color-accent);
  --card-border: 2px solid var(--color-paper);
  --card-shadow: 4px 4px 0 var(--color-paper);
}
.panel-light {
  --bg: var(--color-paper);
  --text: var(--color-text);
  --highlight: var(--color-brand);
  --link: var(--color-brand);
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
}

/* 基础重置与排版 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  background: var(--color-paper);
  color: var(--color-text);
  line-height: var(--body-lh);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; transition: opacity 0.2s ease; }
a:hover { opacity: 0.85; }
ul, ol { list-style: none; }
strong { font-weight: 600; }

/* 容器与网格 */
.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}
.grid-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap);
  align-items: center;
}
@media (min-width: 768px) {
  .grid-split { grid-template-columns: 1fr 1fr; }
  .grid-split .order-img-first { order: 1; }
}
.grid-magazine {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap);
}
@media (min-width: 960px) {
  .grid-magazine { grid-template-columns: 240px 1fr; }
}

/* 排版层级 */
h1, h2, h3, h4 {
  font-weight: var(--title-weight);
  line-height: var(--title-lh);
  letter-spacing: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: calc(var(--gap) * 2); }
h3 { font-size: 1.25rem; margin-bottom: calc(var(--gap) * 0.75); }
p { max-width: 38em; margin-bottom: var(--gap); }
.hl { color: var(--highlight); }

/* 眉标 */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--highlight);
  margin-bottom: calc(var(--gap) * 0.5);
  position: relative;
  padding-left: 1.2em;
}
.eyebrow::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 0.6em; height: 2px;
  background: currentColor;
  transform: translateY(-50%);
}

/* 头部与导航 */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid rgba(128,128,128,0.2);
  backdrop-filter: blur(8px);
  transition: background 0.3s ease, border-color 0.3s ease;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand img { height: 32px; width: auto; }
.nav-list { display: flex; gap: 1.5rem; align-items: center; }
.nav-link {
  font-size: 0.95rem; font-weight: 500; color: var(--text);
  padding: 0.5rem 0; position: relative;
}
.nav-link[aria-current="page"], .nav-link:hover { color: var(--highlight); }
.nav-link[aria-current="page"]::after {
  content: ""; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background: var(--highlight);
}
.btn-download {
  background: var(--color-accent); color: var(--color-dark);
  padding: 0.6rem 1.2rem; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 0.95rem;
  display: inline-flex; align-items: center; gap: 0.5rem;
  border: none; cursor: pointer; transition: transform 0.2s ease, background 0.2s ease;
}
.btn-download:hover { transform: translateY(-1px); opacity: 1; background: #5a9fd9; }
.btn-download:focus-visible { outline: 2px solid var(--highlight); outline-offset: 2px; }

/* 页脚 */
.site-footer {
  padding: var(--section-y) 0;
  border-top: 1px solid rgba(128,128,128,0.2);
  text-align: center;
  color: rgba(128,128,128,0.8);
  font-size: 0.9rem;
}
.footer-links { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 1rem; }
.footer-links a { color: var(--text); }
.footer-links a:hover { color: var(--highlight); }

/* 按钮系统 */
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.75rem;
  background: var(--color-accent); color: var(--color-dark);
  padding: 0.75rem 1.5rem; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 1rem; height: 52px;
  border: none; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn-primary:focus-visible { outline: 3px solid var(--highlight); outline-offset: 2px; }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: transparent; color: var(--text);
  padding: 0.75rem 1.5rem; border-radius: var(--radius-btn);
  border: 2px solid var(--text); font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}
.btn-secondary:hover { background: rgba(128,128,128,0.1); }
.btn-secondary:focus-visible { outline: 3px solid var(--highlight); outline-offset: 2px; }

/* 卡片与面板 */
.card {
  background: var(--bg); color: var(--text);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-2px); }

/* 表格 */
.spec-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.95rem; margin-bottom: var(--gap);
}
.spec-table th, .spec-table td {
  padding: 0.75rem 1rem; text-align: left;
  border-bottom: 1px solid rgba(128,128,128,0.3);
}
.spec-table th { font-weight: 600; width: 40%; }
.spec-table tr:last-child td { border-bottom: none; }

/* FAQ */
.faq-item {
  border: var(--card-border);
  border-radius: var(--radius-card);
  margin-bottom: var(--gap);
  overflow: hidden;
  background: var(--bg); color: var(--text);
}
.faq-item summary {
  padding: 1rem 1.25rem; cursor: pointer; font-weight: 600;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
  transition: background 0.2s ease;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.25rem; transition: transform 0.2s ease; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { background: rgba(128,128,128,0.05); }
.faq-item p { padding: 0 1.25rem 1rem; margin: 0; font-size: 0.95rem; line-height: 1.6; }
.faq-item:focus-within { outline: 2px solid var(--highlight); outline-offset: -2px; }

/* SVG 动效基础 */
.svg-panel { width: 100%; height: auto; }
svg { overflow: visible; }
.anim-draw {
  stroke-dasharray: 1; stroke-dashoffset: 0;
  animation: drawPath 6s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}
.anim-float {
  animation: floatDot 8s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}
.anim-pulse {
  animation: pulseOpacity 4s ease-in-out infinite alternate;
}
.anim-flow-dot {
  animation: flowAlong 10s linear infinite;
  transform-box: fill-box; transform-origin: center;
}
@keyframes drawPath {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes floatDot {
  from { transform: translateY(0); opacity: 0.6; }
  to { transform: translateY(-6px); opacity: 1; }
}
@keyframes pulseOpacity {
  from { opacity: 0.4; }
  to { opacity: 0.9; }
}
@keyframes flowAlong {
  0% { offset-distance: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .anim-draw, .anim-float, .anim-pulse, .anim-flow-dot {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* 响应式适配 */
@media (max-width: 767px) {
  .header-inner { flex-direction: column; height: auto; padding: 1rem 0; }
  .nav-list { flex-wrap: wrap; justify-content: center; margin-top: 0.75rem; }
  .btn-download { display: none; }
  h1 { font-size: 2.2rem; }
  .grid-split, .grid-magazine { grid-template-columns: 1fr; }
  .grid-split .order-img-first { order: 0; }
}
