/* =========================================
   SafeW 全站共享样式
   ========================================= */

:root {
  /* 色板 */
  --color-dark: #271334;
  --color-paper: #E9E8EA;
  --color-text: #1D1523;
  --color-brand: #8A13DD;
  --color-accent: #9EED6E;

  /* 圆角 */
  --radius-card: 20px;
  --radius-btn: 12px;

  /* 卡片边界 */
  --card-border: 0;
  --card-shadow: none;

  /* 节奏与密度 */
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --line-height: 1.55;

  /* 内容宽度 */
  --content-max: 1280px;

  /* 字体 */
  --font-body: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}

/* 重置与基础 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background-color: var(--color-paper);
  color: var(--color-text);
  line-height: var(--line-height);
  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);
}

/* 面色切换 */
.bg-dark {
  background-color: var(--color-dark);
  color: var(--color-paper);
}
.bg-dark .hl { color: var(--color-accent); }
.bg-dark a:not(.btn) { color: var(--color-accent); }
.bg-dark .brand-tag { color: var(--color-accent); }

.bg-paper {
  background-color: var(--color-paper);
  color: var(--color-text);
}
.bg-paper .hl { color: var(--color-brand); }
.bg-paper a:not(.btn) { color: var(--color-brand); }
.bg-paper .brand-tag { color: var(--color-brand); }

/* 眉标与标题 */
.brand-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
  margin-bottom: var(--gap);
}
.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: var(--gap);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  padding: 0 1.5rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
  border: none;
}
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.bg-dark .btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(0.95); }
.btn-secondary {
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
}
.bg-dark .btn-secondary { color: var(--color-paper); }
.bg-paper .btn-secondary { color: var(--color-text); }
.btn-secondary:hover { background: rgba(128,128,128,0.1); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

/* 卡片 */
.card {
  background-color: rgba(255,255,255,0.4);
  border-radius: var(--radius-card);
  padding: var(--gap);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}
.bg-dark .card {
  background-color: rgba(255,255,255,0.08);
}

/* 列表与网格 */
.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); }
.list-styled li { position: relative; padding-left: 1.5rem; margin-bottom: 0.5rem; }
.list-styled li::before {
  content: ""; position: absolute; left: 0; top: 0.6em;
  width: 6px; height: 6px; background: currentColor; border-radius: 50%;
}

/* 表格 */
table { width: 100%; border-collapse: collapse; margin: var(--gap) 0; }
th, td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid rgba(128,128,128,0.2); }
th { font-weight: 700; }
td { color: inherit; }

/* FAQ */
details { margin-bottom: var(--gap); border-radius: var(--radius-card); overflow: hidden; }
.summary {
  padding: 1rem; cursor: pointer; font-weight: 600; user-select: none;
  background: rgba(128,128,128,0.05);
}
.details-content { padding: 1rem; background: rgba(128,128,128,0.02); }
details[open] .summary { border-bottom: 1px solid rgba(128,128,128,0.2); }

/* 导航与页脚 */
.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.05);
}
.bg-dark .site-header { background: rgba(39, 19, 52, 0.9); border-bottom-color: rgba(255,255,255,0.1); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo img { height: 32px; width: auto; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { font-weight: 500; transition: opacity 0.2s; }
.nav-links a:hover { opacity: 0.7; }
.nav-links a[aria-current="page"] { color: var(--color-brand); font-weight: 700; }
.bg-dark .nav-links a[aria-current="page"] { color: var(--color-accent); }

.site-footer {
  padding: var(--section-y) 0;
  border-top: 1px solid rgba(128,128,128,0.15);
  margin-top: var(--section-y);
}
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--gap); }
.footer-col h4 { font-weight: 700; margin-bottom: 0.5rem; }
.footer-col ul li { margin-bottom: 0.4rem; }
.footer-bottom { margin-top: var(--gap); padding-top: var(--gap); border-top: 1px solid rgba(128,128,128,0.15); text-align: center; opacity: 0.7; font-size: 0.9rem; }

/* SVG 动效 */
.svg-visual { width: 100%; height: auto; }
.anim-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  animation: drawLine 6s ease-in-out infinite alternate;
}
.anim-float {
  animation: float 5s ease-in-out infinite;
}
.anim-breathe {
  animation: breathe 4s ease-in-out infinite;
}
.anim-delay-1 { animation-delay: 1s; }
.anim-delay-2 { animation-delay: 2s; }
.anim-delay-3 { animation-delay: 3s; }

@keyframes drawLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* 减少动态效果 */
@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-breathe { animation: none !important; }
}

/* 响应式微调 */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; height: auto; padding: 1rem 0; gap: 0.5rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero-grid { flex-direction: column; }
}

/* 兜底：裁掉横向溢出 */
div.hero-grid {
  overflow-x: clip;
}
