/* ============================================
   SafeW — 全站共享样式
   ============================================ */

/* ---------- 设计变量 ---------- */
:root {
  /* 色板 */
  --c-dark: #121531;
  --c-paper: #E8E9EA;
  --c-body: #151723;
  --c-brand: #142CEB;
  --c-accent: #ED7D6E;

  /* 圆角 */
  --radius-card: 24px;
  --radius-btn: 999px;
  --radius-sm: 8px;

  /* 卡片边界与阴影 */
  --card-border: 2px solid var(--c-body);
  --card-shadow: 4px 4px 0 var(--c-body);

  /* 节奏与密度 */
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --line-height: 1.75;

  /* 内容最大宽度 */
  --content-max: 960px;

  /* 取色变量（纸面默认） */
  --text-primary: var(--c-body);
  --text-secondary: var(--c-body);
  --link-color: var(--c-brand);
  --accent-color: var(--c-brand);
  --surface-bg: var(--c-paper);
  --surface-fg: var(--c-body);
  --border-color: rgba(21, 23, 35, 0.12);
}

/* ---------- 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  line-height: var(--line-height);
  color: var(--text-primary);
  background: var(--surface-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }

a {
  color: var(--link-color);
  text-decoration: none;
  transition: opacity 0.2s ease;
}
a:hover { opacity: 0.8; }
a:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 3px;
  border-radius: 2px;
}

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);
}

.section + .section {
  border-top: 1px solid var(--border-color);
}

.dark-section + .section {
  border-top: none;
}

.section__eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-color);
  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;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.section__title .hl {
  color: var(--accent-color);
}

.section__desc {
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  line-height: var(--line-height);
  color: var(--text-secondary);
  max-width: 38em;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 28px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.btn--primary {
  background-color: var(--c-accent);
  color: var(--c-dark);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(237, 125, 110, 0.35);
}

.btn--secondary {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--text-primary);
}
.btn--secondary:hover {
  transform: translateY(-2px);
  background: rgba(21, 23, 35, 0.06);
}

.btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ---------- 胶囊标签 ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-btn);
  background: rgba(20, 44, 235, 0.08);
  color: var(--c-brand);
  border: 1px solid rgba(20, 44, 235, 0.15);
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface-bg);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
}

.card--light-on-dark {
  background: var(--c-paper);
  border-color: rgba(21, 23, 35, 0.15);
  box-shadow: 4px 4px 0 rgba(21, 23, 35, 0.1);
}

/* ---------- 表格 ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-card);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.7;
}

th, td {
  padding: 14px 20px;
  text-align: left;
  vertical-align: top;
}

th {
  background: rgba(20, 44, 235, 0.06);
  font-weight: 700;
  white-space: nowrap;
}

td {
  border-top: 1px solid var(--border-color);
}

tr:last-child td {
  border-bottom: 1px solid var(--border-color);
}

/* ---------- 步骤编号徽标 ---------- */
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: var(--c-accent);
  color: var(--c-dark);
  font-size: 0.95rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
}

/* ---------- 提示框 ---------- */
.tip-box {
  border-left: 4px solid var(--c-accent);
  background: rgba(237, 125, 110, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  margin-top: 1rem;
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ---------- FAQ ---------- */
.faq-list details {
  border: var(--card-border);
  border-radius: var(--radius-card);
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-list summary {
  padding: 18px 24px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background-color 0.2s ease;
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--accent-color);
  border-bottom: 2px solid var(--accent-color);
  transform: rotate(-45deg);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.faq-list details[open] summary::before {
  transform: rotate(45deg);
}

.faq-list summary:hover {
  background: rgba(20, 44, 235, 0.04);
}

.faq-list .faq-answer {
  padding: 0 24px 20px;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

/* ---------- 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(232, 233, 234, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.site-header.scrolled {
  border-bottom-color: var(--border-color);
  background: rgba(232, 233, 234, 0.97);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
  text-decoration: none;
}

.header-logo img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.header-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  position: relative;
}

.header-nav a:hover { opacity: 0.7; }

.header-nav a[aria-current="page"] {
  color: var(--accent-color);
  font-weight: 700;
}

.header-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-color);
  border-radius: 1px;
}

.header-cta {
  margin-left: 12px;
}

/* ---------- 页脚 ---------- */
.site-footer {
  background: var(--c-dark);
  color: var(--c-paper);
  padding: 48px var(--gap) 32px;
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
}

.footer-brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-links a {
  color: rgba(232, 233, 234, 0.7);
  font-size: 0.9rem;
  text-decoration: none;
}

.footer-links a:hover { color: var(--c-paper); }

.footer-bottom {
  max-width: var(--content-max);
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(232, 233, 234, 0.1);
  font-size: 0.8rem;
  color: rgba(232, 233, 234, 0.45);
  text-align: center;
}

/* ---------- 深色面覆盖 ---------- */
.dark-surface {
  --text-primary: var(--c-paper);
  --text-secondary: rgba(232, 233, 234, 0.75);
  --link-color: var(--c-accent);
  --accent-color: var(--c-accent);
  --surface-bg: var(--c-dark);
  --surface-fg: var(--c-paper);
  --border-color: rgba(232, 233, 234, 0.1);
}

/* 浅色卡片放在深色面上，恢复纸面取色 */
.paper-card-in-dark {
  --text-primary: var(--c-body);
  --text-secondary: var(--c-body);
  --link-color: var(--c-brand);
  --accent-color: var(--c-brand);
  --surface-bg: var(--c-paper);
  --surface-fg: var(--c-body);
  --border-color: rgba(21, 23, 35, 0.12);
}

/* ---------- SVG 动效 ---------- */

/* 呼吸动画 */
@keyframes breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* 浮动动画 */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* 滑入动画 */
@keyframes slideIn {
  0%, 100% { transform: translateX(0); opacity: 1; }
  50% { transform: translateX(-4px); opacity: 0.85; }
}

/* 描边流动 */
@keyframes drawFlow {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

/* 数据点流动 */
@keyframes dotFlow {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

/* 气泡浮现 */
@keyframes bubblePop {
  0%, 100% { transform: scale(1) translateY(0); opacity: 0.95; }
  50% { transform: scale(1.03) translateY(-3px); opacity: 1; }
}

/* 通知卡滑动 */
@keyframes notifSlide {
  0%, 100% { transform: translateX(0); opacity: 0.9; }
  40% { transform: translateX(-3px); opacity: 1; }
}

/* 类绑定 */
.anim-breathe {
  animation: breathe 3s ease-in-out infinite;
}

.anim-float {
  animation: float 6s ease-in-out infinite;
}

.anim-slide {
  animation: slideIn 5s ease-in-out infinite;
}

.anim-flow {
  animation: drawFlow 4s linear infinite;
}

.anim-dot-flow {
  animation: dotFlow 6s ease-in-out infinite;
}

.anim-bubble {
  animation: bubblePop 4.5s ease-in-out infinite;
}

.anim-notif {
  animation: notifSlide 7s ease-in-out infinite;
}

/* 延迟错开 */
.delay-1 { animation-delay: 0.3s; }
.delay-2 { animation-delay: 0.8s; }
.delay-3 { animation-delay: 1.4s; }
.delay-4 { animation-delay: 2s; }
.delay-5 { animation-delay: 2.6s; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .header-nav { display: none; }
  .btn { height: 48px; padding: 0 20px; font-size: 0.95rem; }
  th, td { padding: 10px 14px; font-size: 0.88rem; }
}

/* ---------- 减少动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation-delay: 0ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ---------- 修复横向溢出 ---------- */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
}
.step-bar {
  -webkit-overflow-scrolling: touch;
}
