/* ============================================
   SafeW 全站共享样式
   ============================================ */

/* ---- 设计变量 ---- */
:root {
  /* 色板 */
  --color-dark-bg: #251943;
  --color-paper: #DBD4ED;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED6E89;

  /* 取色变量（纸面默认） */
  --bg-surface: var(--color-paper);
  --text-primary: var(--color-text);
  --text-secondary: var(--color-text);
  --brand-color: var(--color-brand);
  --accent-color: var(--color-accent);

  /* 圆角 */
  --radius-card: 0;
  --radius-btn: 0;

  /* 卡片边界 */
  --card-border: 1px solid rgba(25, 21, 35, 0.16);
  --card-shadow: none;

  /* 间距 */
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1280px;

  /* 标题 */
  --title-weight: 600;
  --title-letter-spacing: 0;
  --title-line-height: 1.25;
  --h1-size: clamp(2rem, 4.6vw, 3.4rem);

  /* 正文 */
  --body-size: clamp(1rem, 1.1vw, 1.125rem);
  --body-line-height: 1.75;

  /* 按钮 */
  --btn-height: 52px;
}

/* ---- 深色面覆盖 ---- */
.dark-surface {
  --bg-surface: var(--color-dark-bg);
  --text-primary: var(--color-paper);
  --text-secondary: var(--color-paper);
  --brand-color: var(--color-accent);
  --accent-color: var(--color-accent);
}

/* 深色面内的浅色卡片恢复纸面取色 */
.dark-surface .paper-card {
  --bg-surface: var(--color-paper);
  --text-primary: var(--color-text);
  --text-secondary: var(--color-text);
  --brand-color: var(--color-brand);
  --accent-color: var(--color-accent);
}

/* ---- 基础排版 ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: var(--body-size);
  line-height: var(--body-line-height);
  color: var(--text-primary);
  background: var(--bg-surface);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

a {
  color: var(--brand-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover { color: var(--accent-color); }
a:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 2px; }

strong, b { font-weight: 700; }

/* ---- 容器 ---- */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* ---- 眉标 ---- */
.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  color: var(--brand-color);
}

.dark-surface .section-label { color: var(--accent-color); }

/* ---- 标题 ---- */
h1, h2, h3, h4 {
  font-weight: var(--title-weight);
  letter-spacing: var(--title-letter-spacing);
  line-height: var(--title-line-height);
  color: var(--text-primary);
}

h1 { font-size: var(--h1-size); }
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 0.75rem;
}

h3 {
  font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  margin-bottom: 0.5rem;
}

.hl { color: var(--brand-color); }
.dark-surface .hl { color: var(--accent-color); }

/* ---- 段落 ---- */
p {
  max-width: 38em;
  margin-bottom: 1rem;
}

/* ---- 区块 ---- */
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  position: relative;
}

.section-divider {
  border: none;
  border-top: 1px solid rgba(25, 21, 35, 0.1);
  margin: 0;
}

.dark-surface .section-divider {
  border-top-color: rgba(219, 212, 237, 0.12);
}

/* ---- 按钮 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: var(--btn-height);
  padding: 0 1.75rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  border-radius: var(--radius-btn);
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: var(--accent-color);
  color: var(--color-dark-bg);
  border: 2px solid var(--accent-color);
}

.btn-primary:hover {
  background: #d95a73;
  border-color: #d95a73;
  transform: translateY(-1px);
  color: var(--color-dark-bg);
}

.btn-primary:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--text-primary);
}

.btn-secondary:hover {
  background: var(--text-primary);
  color: var(--bg-surface);
  transform: translateY(-1px);
}

.dark-surface .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

.dark-surface .btn-secondary:hover {
  background: var(--color-paper);
  color: var(--color-dark-bg);
}

/* ---- 卡片 ---- */
.card {
  background: var(--bg-surface);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  transition: border-color 0.2s ease;
}

.card:hover { border-color: var(--brand-color); }

/* ---- 网格 ---- */
.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);
}

/* ---- 图文交错 ---- */
.split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}

.split-row.reverse { direction: rtl; }
.split-row.reverse > * { direction: ltr; }

/* ---- 视觉面板 ---- */
.visual-panel {
  background: var(--color-dark-bg);
  border-radius: var(--radius-card);
  padding: 2rem;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.dark-surface .visual-panel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(219, 212, 237, 0.1);
}

/* ---- 表格 ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}

.dark-surface .data-table th,
.dark-surface .data-table td {
  border-bottom-color: rgba(219, 212, 237, 0.1);
}

.data-table th {
  font-weight: 700;
  color: var(--text-primary);
  width: 35%;
}

/* ---- 列表 ---- */
.styled-list {
  list-style: none;
  padding: 0;
}

.styled-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.6rem;
}

.styled-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  background: var(--brand-color);
  border-radius: 0;
}

.dark-surface .styled-list li::before {
  background: var(--accent-color);
}

/* ---- 步骤编号徽标 ---- */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--accent-color);
  color: var(--color-dark-bg);
  font-weight: 800;
  font-size: 0.9rem;
  border-radius: var(--radius-btn);
  flex-shrink: 0;
}

.step-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  align-items: flex-start;
}

/* ---- FAQ ---- */
.faq-item {
  border: var(--card-border);
  border-radius: var(--radius-card);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-item summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: background-color 0.15s ease;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--brand-color);
  color: var(--brand-color);
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.2s ease;
}

.faq-item[open] summary::before {
  content: "−";
  color: var(--accent-color);
  border-color: var(--accent-color);
}

.faq-item summary:hover { background: rgba(82, 20, 235, 0.04); }
.dark-surface .faq-item summary:hover { background: rgba(219, 212, 237, 0.06); }

.faq-item summary:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: -2px;
}

.faq-item .faq-answer {
  padding: 0 1.25rem 1rem;
  color: var(--text-primary);
  line-height: var(--body-line-height);
}

/* ---- 提示框 ---- */
.callout {
  border-left: 3px solid var(--brand-color);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  background: rgba(82, 20, 235, 0.04);
  border-radius: 0;
  font-size: 0.95rem;
}

.dark-surface .callout {
  border-left-color: var(--accent-color);
  background: rgba(237, 110, 137, 0.06);
}

/* ---- 页头 ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
  backdrop-filter: saturate(1.2);
  transition: border-color 0.2s ease;
}

.dark-surface .site-header {
  border-bottom-color: rgba(219, 212, 237, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand img {
  height: 28px;
  width: auto;
}

.brand-name {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.nav-links a:hover { color: var(--brand-color); }

.nav-links a[aria-current="page"] {
  color: var(--brand-color);
  font-weight: 700;
}

.dark-surface .nav-links a { color: var(--color-paper); }
.dark-surface .nav-links a:hover { color: var(--accent-color); }
.dark-surface .nav-links a[aria-current="page"] { color: var(--accent-color); }

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text-primary);
}

/* ---- 页脚 ---- */
.site-footer {
  background: var(--color-dark-bg);
  color: var(--color-paper);
  padding: 3rem 0 2rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--gap);
}

.footer-brand p {
  font-size: 0.9rem;
  color: var(--color-paper);
  opacity: 0.7;
  margin-top: 0.5rem;
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--color-paper);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.footer-col ul {
  list-style: none;
  padding: 0;
}

.footer-col li { margin-bottom: 0.5rem; }

.footer-col a {
  color: var(--color-paper);
  opacity: 0.7;
  font-size: 0.9rem;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.footer-col a:hover {
  opacity: 1;
  color: var(--accent-color);
}

.footer-bottom {
  border-top: 1px solid rgba(219, 212, 237, 0.1);
  margin-top: 2rem;
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-paper);
  opacity: 0.5;
}

/* ---- 胶囊 ---- */
.capsule-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.capsule {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: var(--card-border);
  border-radius: var(--radius-card);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-surface);
}

.capsule svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ---- SVG 动效 ---- */

/* 卡片漂浮 */
@keyframes floatA {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes floatB {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes floatC {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes floatD {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.anim-float-a { animation: floatA 6s ease-in-out infinite; }
.anim-float-b { animation: floatB 7s ease-in-out infinite 0.5s; }
.anim-float-c { animation: floatC 5.5s ease-in-out infinite 1s; }
.anim-float-d { animation: floatD 8s ease-in-out infinite 1.5s; }

/* 呼吸点 */
@keyframes breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.anim-breathe { animation: breathe 2s ease-in-out infinite; }
.anim-breathe-delay-1 { animation-delay: 0.3s; }
.anim-breathe-delay-2 { animation-delay: 0.6s; }

/* 滑入通知 */
@keyframes slideInNotif {
  0%, 100% { transform: translateX(0); opacity: 1; }
  5% { transform: translateX(15px); opacity: 0; }
  10%, 80% { transform: translateX(0); opacity: 1; }
  85% { transform: translateX(-15px); opacity: 0; }
  90%, 100% { transform: translateX(0); opacity: 1; }
}

.anim-slide-notif { animation: slideInNotif 10s ease-in-out infinite; }

/* 连接线流动 */
@keyframes flowLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

.anim-flow {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: flowLine 3s linear infinite;
}

/* 气泡浮现 */
@keyframes bubblePop {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.85; }
  50% { transform: translateY(-3px) scale(1.03); opacity: 1; }
}

.anim-bubble { animation: bubblePop 4s ease-in-out infinite; }
.anim-bubble-delay-1 { animation-delay: 0.8s; }
.anim-bubble-delay-2 { animation-delay: 1.6s; }

/* ---- 响应式 ---- */
@media (max-width: 900px) {
  .split-row,
  .split-row.reverse {
    grid-template-columns: 1fr;
    direction: ltr;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .nav-links { display: none; }

  .mobile-toggle { display: block; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid rgba(25, 21, 35, 0.1);
    padding: 1rem var(--gap);
    gap: 1rem;
  }

  .dark-surface .nav-links.open {
    border-bottom-color: rgba(219, 212, 237, 0.1);
  }
}

@media (max-width: 600px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .capsule-row { flex-direction: column; }
}

/* ---- 减少动态效果 ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  html { scroll-behavior: auto; }

  .anim-float-a,
  .anim-float-b,
  .anim-float-c,
  .anim-float-d,
  .anim-breathe,
  .anim-slide-notif,
  .anim-flow,
  .anim-bubble,
  .anim-bubble-delay-1,
  .anim-bubble-delay-2 {
    animation: none !important;
  }
}

/* ---- SVG 尺寸 ---- */
svg.hero-svg,
svg.panel-svg {
  width: 100%;
  height: auto;
}

svg.icon-svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

svg.icon-lg {
  width: 28px;
  height: 28px;
}

/* ---- 旋转 SVG 子元素 ---- */
svg [class*="rotating"] {
  transform-box: fill-box;
  transform-origin: center;
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
