/* ============================================================
   SafeW — 全站共享样式
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
  /* 色板 */
  --color-dark: #2D1438;
  --color-paper: #F6F3F7;
  --color-body: #1F1523;
  --color-brand: #9E13DD;
  --color-accent: #6EEDA8;

  /* 圆角 */
  --radius-card: 20px;
  --radius-btn: 12px;

  /* 卡片边界 */
  --card-border: 1px solid rgba(31, 21, 35, 0.16);
  --card-shadow: none;

  /* 节奏与密度 */
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);

  /* 内容最大宽度 */
  --content-max: 1280px;

  /* 取色默认（纸面） */
  --text-primary: var(--color-body);
  --text-secondary: rgba(31, 21, 35, 0.65);
  --text-link: var(--color-brand);
  --bg-surface: var(--color-paper);
  --badge-color: var(--color-brand);
}

/* ---------- 深色面覆盖 ---------- */
.dark-surface {
  --text-primary: var(--color-paper);
  --text-secondary: rgba(246, 243, 247, 0.65);
  --text-link: var(--color-accent);
  --bg-surface: var(--color-dark);
  --badge-color: var(--color-accent);
}

/* 深色面内的浅色卡片恢复纸面取色 */
.dark-surface .light-card {
  --text-primary: var(--color-body);
  --text-secondary: rgba(31, 21, 35, 0.65);
  --text-link: var(--color-brand);
  --bg-surface: var(--color-paper);
  --badge-color: var(--color-brand);
  background: var(--color-paper);
  border: var(--card-border);
}

/* ---------- 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-primary);
  background: var(--bg-surface);
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

a {
  color: var(--text-link);
  text-decoration: underline;
  transition: opacity 0.2s ease;
}
a:hover { opacity: 0.8; }

ul, ol { list-style: none; }

/* ---------- 容器 ---------- */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* ---------- 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 243, 247, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(31, 21, 35, 0.08);
  transition: background 0.3s ease;
}
.site-header.scrolled {
  background: rgba(246, 243, 247, 0.95);
  box-shadow: 0 1px 0 rgba(31, 21, 35, 0.08);
}

.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);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}
.brand img { height: 32px; width: auto; }
.brand-name {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-list a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 4px 0;
  position: relative;
}
.nav-list a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--badge-color);
  border-radius: 1px;
  transition: width 0.25s ease;
}
.nav-list a:hover::after,
.nav-list a[aria-current="page"]::after { width: 100%; }
.nav-list a[aria-current="page"] { color: var(--badge-color); font-weight: 700; }

.header-cta {
  margin-left: 16px;
}

/* 移动端菜单按钮 */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 32px; height: 32px;
  padding: 0;
}
.menu-toggle svg { width: 24px; height: 24px; stroke: var(--text-primary); }

@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .nav-list {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--color-paper);
    flex-direction: column;
    padding: 16px var(--gap);
    gap: 12px;
    border-bottom: 1px solid rgba(31, 21, 35, 0.08);
  }
  .nav-list.open { display: flex; }
  .header-cta { margin-left: 0; }
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-btn);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}
.btn:focus-visible {
  outline: 2px solid var(--badge-color);
  outline-offset: 2px;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover {
  background: #5bd895;
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--text-primary);
}
.btn-outline:hover {
  background: rgba(31, 21, 35, 0.06);
}
.dark-surface .btn-outline {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

.btn-icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
}

/* ---------- 眉标 ---------- */
.badge-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--badge-color);
  margin-bottom: 12px;
}

/* ---------- 标题 ---------- */
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
  margin-bottom: 8px;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: var(--gap);
  max-width: 640px;
}

.hl {
  color: var(--badge-color);
}

/* ---------- 区块骨架 ---------- */
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}
.section + .section {
  border-top: 1px solid rgba(31, 21, 35, 0.08);
}
.dark-surface .section + .section {
  border-top-color: rgba(246, 243, 247, 0.1);
}

/* ---------- 两栏布局 ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}
@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; }
}

/* ---------- 面板（视觉区域） ---------- */
.visual-panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: 32px;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.visual-panel svg { width: 100%; height: auto; max-width: 100%; }

/* ---------- 功能卡片 ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
}
.feature-card {
  background: var(--bg-surface);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 28px;
  box-shadow: var(--card-shadow);
}
.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.35;
}
.feature-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}
.feature-card .card-icon {
  width: 28px; height: 28px;
  color: var(--badge-color);
  margin-bottom: 14px;
}

/* ---------- 时间轴 ---------- */
.timeline {
  position: relative;
  padding-left: 32px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 8px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--badge-color), rgba(158, 19, 221, 0.15));
  border-radius: 1px;
}
.timeline-item {
  position: relative;
  padding-bottom: 32px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -28px; top: 6px;
  width: 12px; height: 12px;
  border-radius: 4px;
  background: var(--badge-color);
  border: 2px solid var(--bg-surface);
}
.timeline-time {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--badge-color);
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.timeline-item h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.timeline-item p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* ---------- 编号列表（步骤） ---------- */
.step-list {
  counter-reset: step;
}
.step-item {
  counter-increment: step;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 0;
}
.step-num {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  font-size: 0.9rem;
  border-radius: 8px;
}
.step-item h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.step-item p {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

/* ---------- 表格 ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(31, 21, 35, 0.08);
}
.dark-surface .data-table th,
.dark-surface .data-table td {
  border-bottom-color: rgba(246, 243, 247, 0.08);
}
.data-table th {
  font-weight: 700;
  color: var(--text-primary);
  width: 40%;
}
.data-table td {
  color: var(--text-secondary);
}

/* ---------- FAQ ---------- */
.faq-list details {
  border: var(--card-border);
  border-radius: var(--radius-card);
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--bg-surface);
}
.faq-list summary {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background 0.15s ease;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "";
  flex-shrink: 0;
  width: 16px; height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  transition: transform 0.2s ease;
}
.faq-list details[open] summary::after { transform: rotate(180deg); }
.faq-list details > div {
  padding: 0 20px 16px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* ---------- 新闻卡片 ---------- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--gap);
}
.news-card {
  background: var(--bg-surface);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
}
.news-card time {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.news-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.35;
}
.news-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  flex: 1;
}

/* ---------- 安全清单 ---------- */
.security-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--gap);
}
.security-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.security-item .sec-icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  color: var(--badge-color);
  margin-top: 2px;
}
.security-item h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.security-item p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.65;
}

/* ---------- 页脚 ---------- */
.site-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: 64px var(--gap) 32px;
}
.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(246, 243, 247, 0.1);
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-brand img { height: 28px; width: auto; }
.footer-brand span { font-weight: 700; font-size: 1rem; }
.footer-nav { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-nav a {
  color: rgba(246, 243, 247, 0.65);
  text-decoration: none;
  font-size: 0.88rem;
}
.footer-nav a:hover { color: var(--color-paper); }
.footer-bottom {
  padding-top: 24px;
  font-size: 0.82rem;
  color: rgba(246, 243, 247, 0.4);
  text-align: center;
}

/* ============================================================
   SVG 动效 — @keyframes
   ============================================================ */

/* 星点明灭 */
@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
.anim-star { animation: twinkle 4s ease-in-out infinite; }
.anim-star:nth-child(odd) { animation-delay: -1.5s; }
.anim-star:nth-child(3n) { animation-delay: -3s; }

/* 连线流动 */
@keyframes dash-flow {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
.anim-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dash-flow 6s linear infinite;
}

/* 气泡浮现后漂浮 */
@keyframes bubble-float {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50% { transform: translateY(-6px); opacity: 1; }
}
.anim-bubble { animation: bubble-float 5s ease-in-out infinite; }
.anim-bubble:nth-child(even) { animation-delay: -2s; }

/* 通知滑入 */
@keyframes notify-slide {
  0%, 100% { transform: translateX(0); opacity: 0.9; }
  10% { transform: translateX(8px); opacity: 1; }
  90% { transform: translateX(8px); opacity: 1; }
}
.anim-notify { animation: notify-slide 7s ease-in-out infinite; }

/* 输入呼吸点 */
@keyframes dot-breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
.anim-dot { animation: dot-breathe 2.4s ease-in-out infinite; }
.anim-dot:nth-child(2) { animation-delay: -0.8s; }
.anim-dot:nth-child(3) { animation-delay: -1.6s; }

/* 设置面板开关摆动 */
@keyframes toggle-swing {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(12px); }
}
.anim-toggle { animation: toggle-swing 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

/* 消息列表项淡入 */
@keyframes msg-fade {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
.anim-msg { animation: msg-fade 5s ease-in-out infinite; }
.anim-msg:nth-child(2) { animation-delay: -1.5s; }
.anim-msg:nth-child(3) { animation-delay: -3s; }

/* 文件列表高亮闪烁 */
@keyframes file-highlight {
  0%, 100% { opacity: 0.5; }
  30% { opacity: 1; }
  70% { opacity: 1; }
}
.anim-file { animation: file-highlight 8s ease-in-out infinite; }

/* 扫码框脉冲 */
@keyframes scan-pulse {
  0%, 100% { opacity: 0.4; stroke-dashoffset: 0.5; }
  50% { opacity: 1; stroke-dashoffset: 0; }
}
.anim-scan {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: scan-pulse 4s ease-in-out infinite;
}

/* 群组徽标旋转 */
@keyframes badge-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.anim-spin { animation: badge-spin 12s linear infinite; transform-box: fill-box; transform-origin: center; }

/* 状态点跳动 */
@keyframes status-pulse {
  0%, 100% { r: 3; opacity: 1; }
  50% { r: 5; opacity: 0.6; }
}
.anim-status { animation: status-pulse 3s ease-in-out infinite; }

/* 连接线持续流动 */
@keyframes flow-line {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
.anim-flow {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: flow-line 8s linear infinite;
}

/* 窗口元素依次出现循环 */
@keyframes win-pop {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  15% { transform: scale(1.02); opacity: 1; }
  85% { transform: scale(1.02); opacity: 1; }
}
.anim-winpop { animation: win-pop 10s ease-in-out infinite; }
.anim-winpop:nth-child(2) { animation-delay: -3s; }
.anim-winpop:nth-child(3) { animation-delay: -6s; }

/* 面板切换动画 */
@keyframes panel-switch {
  0%, 100% { opacity: 0.5; }
  25% { opacity: 1; }
  50% { opacity: 0.5; }
  75% { opacity: 1; }
}
.anim-panel { animation: panel-switch 12s ease-in-out infinite; }

/* 数据流上下移动 */
@keyframes data-drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.anim-drift { animation: data-drift 6s ease-in-out infinite; }

/* 同步图标旋转 */
@keyframes sync-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.anim-sync { animation: sync-rotate 8s linear infinite; transform-box: fill-box; transform-origin: center; }

/* 列表项逐条显隐 */
@keyframes list-reveal {
  0%, 100% { opacity: 0.4; }
  20% { opacity: 1; }
  80% { opacity: 1; }
}
.anim-list { animation: list-reveal 8s ease-in-out infinite; }
.anim-list:nth-child(2) { animation-delay: -2s; }
.anim-list:nth-child(3) { animation-delay: -4s; }
.anim-list:nth-child(4) { animation-delay: -6s; }

/* 二维码扫描线 */
@keyframes scan-line-move {
  0%, 100% { transform: translateY(0); opacity: 0.3; }
  50% { transform: translateY(20px); opacity: 1; }
}
.anim-scanline { animation: scan-line-move 3s ease-in-out infinite; }

/* 对话气泡弹出 */
@keyframes chat-pop {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.7; }
  10% { transform: translateY(-8px) scale(1.03); opacity: 1; }
  90% { transform: translateY(-8px) scale(1.03); opacity: 1; }
}
.anim-chatpop { animation: chat-pop 6s ease-in-out infinite; }
.anim-chatpop:nth-child(2) { animation-delay: -2s; }
.anim-chatpop:nth-child(3) { animation-delay: -4s; }

/* 全屏模式：隐藏所有 SVG 动画 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: -0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .feature-grid,
  .news-grid,
  .security-list {
    grid-template-columns: 1fr;
  }
  .footer-top {
    flex-direction: column;
  }
  .visual-panel {
    padding: 20px;
    min-height: 240px;
  }
}
