/* ============================================================
   SafeW — 共享样式表
   设计变量 · 基础排版 · 组件 · SVG 动效
   ============================================================ */

/* ---------- 色板与设计 Token ---------- */
:root {
  /* 颜色 */
  --color-deep: #17203F;
  --color-paper: #FCFCFD;
  --color-body: #151823;
  --color-brand: #1441EB;
  --color-accent: #6EEDBD;

  /* 圆角 */
  --radius-card: 8px;
  --radius-btn: 6px;

  /* 卡片 */
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(21, 24, 35, 0.3);

  /* 节奏 */
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --line-height: 1.75;

  /* 容器宽度 */
  --content-max: 1280px;

  /* 字体 */
  --font-sans: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

/* ---------- 重置与基础 ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--line-height);
  color: var(--color-body);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.paper .section-label { color: var(--color-brand); }
.deep .section-label { color: var(--color-accent); }

.section-label::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
}

/* ---------- 标题 ---------- */
h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.25;
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.25;
}

/* 高亮关键词 */
.hl {
  color: var(--color-brand);
}

.deep .hl {
  color: var(--color-accent);
}

/* ---------- 正文段落 ---------- */
p {
  max-width: 38em;
  margin-bottom: 1em;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 28px;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-deep);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(110, 237, 189, 0.3);
}

.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--color-body);
  color: var(--color-body);
}

.deep .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}

.btn-secondary:hover {
  transform: translateY(-1px);
  background: rgba(21, 24, 35, 0.06);
}

.deep .btn-secondary:hover {
  background: rgba(252, 252, 253, 0.08);
}

.btn-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  transition: box-shadow 0.25s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: 0 14px 36px -12px rgba(21, 24, 35, 0.38);
  transform: translateY(-2px);
}

/* ---------- 面：纸面 / 深色面 ---------- */
.paper {
  background: var(--color-paper);
}

.deep {
  background: var(--color-deep);
}

/* 深色面上的文字默认用纸面色 */
.deep h1, .deep h2, .deep h3, .deep p, .deep span, .deep li, .deep td, .deep th, .deep summary {
  color: var(--color-paper);
}

/* 深色面上品牌色改为强调色 */
.deep .section-label { color: var(--color-accent); }
.deep .hl { color: var(--color-accent); }
.deep a:not(.btn):not(.btn-secondary) { color: var(--color-accent); }

/* 深色面内的浅色卡片恢复纸面取色 */
.deep .card {
  background: var(--color-paper);
  color: var(--color-body);
}

.deep .card .section-label { color: var(--color-brand); }
.deep .card .hl { color: var(--color-brand); }
.deep .card a { color: var(--color-brand); }

/* ---------- 表格 ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid rgba(21, 24, 35, 0.1);
}

th {
  font-weight: 700;
  white-space: nowrap;
}

td strong {
  font-weight: 700;
}

tr:last-child td {
  border-bottom: none;
}

/* ---------- 提示框 ---------- */
.note {
  border-left: 3px solid var(--color-brand);
  background: rgba(20, 65, 235, 0.04);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 0.95rem;
}

.deep .note {
  border-left-color: var(--color-accent);
  background: rgba(110, 237, 189, 0.08);
}

/* ---------- FAQ ---------- */
.faq-item {
  border-bottom: 1px solid rgba(21, 24, 35, 0.1);
}

.faq-item summary {
  padding: 18px 0;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::before {
  content: "+";
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--color-brand);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.faq-item[open] summary::before {
  transform: rotate(45deg);
}

.faq-item summary:hover { color: var(--color-brand); }

.faq-item .faq-answer {
  padding-bottom: 18px;
  color: var(--color-body);
  line-height: 1.7;
}

/* ---------- 步骤编号徽标 ---------- */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--color-accent);
  color: var(--color-deep);
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ---------- 特性胶囊 ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 100px;
  background: rgba(20, 65, 235, 0.08);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-brand);
}

.deep .chip {
  background: rgba(110, 237, 189, 0.12);
  color: var(--color-accent);
}

.chip-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ---------- 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(252, 252, 253, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(21, 24, 35, 0.08);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.site-header.scrolled {
  background: rgba(252, 252, 253, 0.96);
  border-bottom-color: rgba(21, 24, 35, 0.12);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--color-body);
}

.brand img {
  width: 32px;
  height: 32px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-body);
  transition: color 0.2s ease;
  position: relative;
}

.nav-links a:hover { color: var(--color-brand); }

.nav-links a[aria-current="page"] {
  color: var(--color-brand);
}

.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-brand);
  border-radius: 1px;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
  stroke: var(--color-body);
}

/* ---------- 页脚 ---------- */
.site-footer {
  background: var(--color-deep);
  padding: 48px 0;
  color: var(--color-paper);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
}

.footer-brand img {
  width: 28px;
  height: 28px;
}

.footer-nav {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.footer-nav a {
  font-size: 0.9rem;
  color: rgba(252, 252, 253, 0.7);
  transition: color 0.2s ease;
}

.footer-nav a:hover { color: var(--color-accent); }
.footer-nav a[aria-current="page"] { color: var(--color-accent); }

.footer-copy {
  width: 100%;
  text-align: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(252, 252, 253, 0.1);
  font-size: 0.8rem;
  color: rgba(252, 252, 253, 0.45);
}

/* ---------- 网格布局 ---------- */
.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);
}

/* ---------- 图文交错 ---------- */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}

.feature-row.reverse .feature-text { order: 2; }
.feature-row.reverse .feature-panel { order: 1; }

/* ---------- 流程条 ---------- */
.flow-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 140px;
}

.flow-arrow {
  width: 48px;
  height: 2px;
  background: var(--color-brand);
  position: relative;
  flex-shrink: 0;
}

.flow-arrow::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--color-brand);
  border-top: 2px solid var(--color-brand);
  transform: rotate(45deg);
}

.flow-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-brand);
  color: var(--color-paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.deep .flow-number {
  background: var(--color-accent);
  color: var(--color-deep);
}

/* ---------- 分割线 ---------- */
.divider {
  height: 1px;
  background: rgba(21, 24, 35, 0.1);
  border: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .feature-row {
    grid-template-columns: 1fr;
  }

  .feature-row.reverse .feature-text { order: 1; }
  .feature-row.reverse .feature-panel { order: 2; }

  .nav-links { display: none; }
  .mobile-menu-btn { display: block; }

  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .flow-bar {
    flex-direction: column;
    gap: 16px;
  }

  .flow-arrow {
    width: 2px;
    height: 32px;
  }

  .flow-arrow::after {
    right: -3px;
    top: auto;
    bottom: -2px;
    transform: rotate(135deg);
  }
}

/* ============================================================
   SVG 动效（仅使用 transform、opacity、stroke-dashoffset）
   ============================================================ */

/* ---- Hero 界面卡片漂浮 ---- */
@keyframes floatA {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes floatB {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes floatC {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.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 8s ease-in-out infinite 1s; }

/* ---- 消息气泡依次浮现 ---- */
@keyframes bubbleIn {
  0%, 100% { opacity: 0.3; transform: translateY(4px); }
  15%, 85% { opacity: 1; transform: translateY(0); }
}

.bubble-1 { animation: bubbleIn 5s ease-in-out infinite 0s; }
.bubble-2 { animation: bubbleIn 5s ease-in-out infinite 1.2s; }
.bubble-3 { animation: bubbleIn 5s ease-in-out infinite 2.4s; }

/* ---- 输入中三点呼吸 ---- */
@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.3; }
  40% { opacity: 1; }
}

.dot-pulse-1 { animation: dotPulse 2.4s ease-in-out infinite 0s; }
.dot-pulse-2 { animation: dotPulse 2.4s ease-in-out infinite 0.3s; }
.dot-pulse-3 { animation: dotPulse 2.4s ease-in-out infinite 0.6s; }

/* ---- 通知卡片滑入 ---- */
@keyframes slideIn {
  0%, 100% { opacity: 0.4; transform: translateX(12px); }
  20%, 80% { opacity: 1; transform: translateX(0); }
}

.anim-slide-in { animation: slideIn 6s ease-in-out infinite 2s; }

/* ---- 连接线流动 ---- */
@keyframes dashFlow {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

.anim-dash-flow {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dashFlow 4s ease-in-out infinite;
}

/* ---- 面板边框描边绘制 ---- */
@keyframes drawStroke {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

.anim-draw-stroke {
  pathLength: 1;
  stroke-dasharray: 1;
  animation: drawStroke 3s ease-in-out infinite;
}

/* ---- 功能图标旋转 ---- */
@keyframes gentleRotate {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(12deg); }
}

.anim-rotate {
  transform-box: fill-box;
  transform-origin: center;
  animation: gentleRotate 5s ease-in-out infinite;
}

/* ---- 脉冲点 ---- */
@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.4); opacity: 1; }
}

.anim-pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: pulseDot 3s ease-in-out infinite;
}

/* ---- 通知卡片入场后轻微漂浮 ---- */
@keyframes notifFloat {
  0%, 100% { opacity: 0.5; transform: translateX(8px) translateY(0); }
  20%, 80% { opacity: 1; transform: translateX(0) translateY(0); }
  50% { transform: translateX(0) translateY(-4px); }
}

.anim-notif-float {
  animation: notifFloat 7s ease-in-out infinite 1.5s;
}

/* ---- 同步箭头循环 ---- */
@keyframes syncPulse {
  0%, 100% { opacity: 0.4; transform: translateX(0); }
  50% { opacity: 1; transform: translateX(3px); }
}

.anim-sync {
  transform-box: fill-box;
  transform-origin: center;
  animation: syncPulse 3.5s ease-in-out infinite;
}

/* ============================================================
   减少动态效果
   ============================================================ */
@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;
  }

  .anim-float-a,
  .anim-float-b,
  .anim-float-c,
  .bubble-1, .bubble-2, .bubble-3,
  .dot-pulse-1, .dot-pulse-2, .dot-pulse-3,
  .anim-slide-in,
  .anim-dash-flow,
  .anim-draw-stroke,
  .anim-rotate,
  .anim-pulse,
  .anim-notif-float,
  .anim-sync {
    animation: none !important;
  }
}

/* ============================================================
   焦点可见性
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.deep :focus-visible {
  outline-color: var(--color-accent);
}

/* ============================================================
   长文本换行保护
   ============================================================ */
.long-text {
  overflow-wrap: anywhere;
}
