/* =========================================
   SafeW 全站共享样式
   ========================================= */
:root {
  /* 色板 */
  --color-dark: #271334;
  --color-paper: #E9E8EA;
  --color-text: #1D1523;
  --color-brand: #8A13DD;
  --color-accent: #9EED6E;

  /* 结构 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(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;

  /* 字体 */
  --font-main: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

/* 基础重置与排版 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background: var(--color-paper);
  color: var(--color-text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
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-top: var(--section-y); padding-bottom: var(--section-y); position: relative; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap); }

/* 标题系统 */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.5em;
  color: var(--color-brand);
}
.dark-section .badge { color: var(--color-accent); }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 0.6em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
p { margin-bottom: 1em; max-width: 38em; }
.hl { color: var(--color-brand); }
.dark-section .hl { color: var(--color-accent); }

/* 按钮组件 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  height: 52px;
  padding: 0 1.5em;
  border-radius: var(--radius-btn);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
  box-shadow: 0 4px 12px rgba(158, 237, 110, 0.3);
}
.btn-primary:hover { background: #8dd95f; }
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-text);
}
.dark-section .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.dark-section .btn-secondary:hover { background: rgba(255,255,255,0.1); }

/* 卡片组件 */
.card {
  background: #fff;
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  display: flex;
  flex-direction: column;
}
.dark-section .card {
  background: var(--color-paper);
  color: var(--color-text);
  border-color: var(--color-paper);
  box-shadow: 4px 4px 0 var(--color-paper);
}

/* 表格组件 */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin-top: 1em;
}
.spec-table th, .spec-table td {
  padding: 0.75em 1em;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
.dark-section .spec-table th, .dark-section .spec-table td { border-color: rgba(255,255,255,0.15); }
.spec-table th { font-weight: 700; width: 35%; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: none; }

/* FAQ 组件 */
.faq-item { border-bottom: 1px solid rgba(0,0,0,0.1); margin-bottom: 0.5em; }
.dark-section .faq-item { border-color: rgba(255,255,255,0.15); }
details summary {
  cursor: pointer;
  font-weight: 700;
  padding: 1em 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; font-size: 1.2em; transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { padding-bottom: 1em; line-height: 1.7; }

/* 步骤条 */
.step-list { display: flex; flex-direction: column; gap: var(--gap); counter-reset: step; }
.step-item {
  display: flex;
  gap: 1em;
  align-items: flex-start;
}
.step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.dark-section .step-num { background: var(--color-accent); color: var(--color-dark); }

/* 页头页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(233, 232, 234, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  padding: 0.75em 0;
}
.dark-section.site-header { background: rgba(39, 19, 52, 0.9); border-bottom-color: rgba(255,255,255,0.1); }
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.nav-links { display: flex; gap: 1.5em; font-weight: 600; }
.nav-links a { transition: color 0.2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--color-brand); }
.dark-section .nav-links a { color: var(--color-paper); }
.dark-section .nav-links a:hover, .dark-section .nav-links a[aria-current="page"] { color: var(--color-accent); }
.site-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: var(--section-y) 0;
  margin-top: var(--section-y);
}
.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.8em; font-size: 1rem; }
.footer-col ul li { margin-bottom: 0.5em; }
.footer-col a:hover { text-decoration: underline; }
.copyright { text-align: center; margin-top: 2em; opacity: 0.7; font-size: 0.9rem; }

/* =========================================
   SVG 动效系统
   ========================================= */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes draw {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
@keyframes slideIn {
  0% { transform: translateX(-16px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes rotateSlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes breathe {
  0%, 100% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.05); opacity: 1; }
}

.anim-float { animation: float 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw 3s ease forwards; }
.anim-pulse { animation: pulse 4s ease-in-out infinite; }
.anim-slide-in { animation: slideIn 1.8s cubic-bezier(.2,.8,.2,1) both; }
.anim-rotate { animation: rotateSlow 20s linear infinite; transform-box: fill-box; transform-origin: center; }
.anim-breathe { animation: breathe 5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

/* 减少动态效果适配 */
@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-float, .anim-draw, .anim-pulse, .anim-slide-in, .anim-rotate, .anim-breathe {
    animation: none !important;
  }
}

/* 兜底：裁掉横向溢出 */
div.card {
  overflow-x: clip;
}
