/* ============================================
   SafeW 全站共享样式
   设计变量、排版、组件、SVG 动效
   ============================================ */

/* ---- 设计变量 ---- */
:root {
  /* 色板 */
  --color-dark: #2D1438;
  --color-paper: #F6F3F7;
  --color-body: #1F1523;
  --color-brand: #9E13DD;
  --color-accent: #6EEDA8;

  /* 圆角 */
  --radius-card: 20px;
  --radius-btn: 12px;

  /* 卡片 */
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(31, 21, 35, 0.3);

  /* 节奏 */
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);

  /* 宽度 */
  --content-max: 1280px;

  /* 字体 */
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-condensed: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;

  /* 行高 */
  --line-height-body: 1.55;
}

/* ---- 深色面取色覆盖 ---- */
.dark-surface {
  --text-primary: var(--color-paper);
  --text-secondary: rgba(246, 243, 247, 0.75);
  --accent-for-section: var(--color-accent);
  --brand-for-section: var(--color-accent);
  --bg-card: #3A1D4A;
  --border-card: rgba(246, 243, 247, 0.1);
}

/* ---- 浅色纸面取色（默认） ---- */
.light-surface {
  --text-primary: var(--color-body);
  --text-secondary: rgba(31, 21, 35, 0.65);
  --accent-for-section: var(--color-brand);
  --brand-for-section: var(--color-brand);
  --bg-card: var(--color-paper);
  --border-card: rgba(31, 21, 35, 0.08);
}

/* ---- 基础重置 ---- */
*, *::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-body);
  color: var(--text-primary);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--brand-for-section);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  opacity: 0.85;
}

ul, ol {
  list-style: none;
}

/* ---- 容器 ---- */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section-wrapper {
  padding: var(--section-y) 0;
}

/* ---- 眉标 ---- */
.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-for-section);
  margin-bottom: 0.75rem;
}

/* ---- 标题 ---- */
.section-title {
  font-family: var(--font-condensed);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-wrap: balance;
}

.section-title .hl {
  color: var(--accent-for-section);
}

.hero-title {
  font-family: var(--font-condensed);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-paper);
  text-wrap: balance;
  margin-bottom: 1.5rem;
}

.hero-title .hl {
  color: #ffffff;
}

/* ---- 正文段落 ---- */
.body-text {
  font-size: 16px;
  line-height: var(--line-height-body);
  color: var(--text-secondary);
  max-width: 38em;
}

.body-text p {
  margin-bottom: 1rem;
}

.body-text p:last-child {
  margin-bottom: 0;
}

/* ---- 按钮 ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  background-color: var(--color-accent);
  color: var(--color-dark);
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  text-decoration: none;
  line-height: 1;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(110, 237, 168, 0.3);
  opacity: 1;
}

.btn-primary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  background: transparent;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  border: 1px solid var(--text-primary);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
  text-decoration: none;
  line-height: 1;
}

.btn-secondary:hover {
  transform: translateY(-1px);
  background-color: rgba(31, 21, 35, 0.06);
}

.dark-surface .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

.dark-surface .btn-secondary:hover {
  background-color: rgba(246, 243, 247, 0.08);
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---- 页头 ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-paper);
  border-bottom: 1px solid rgba(31, 21, 35, 0.08);
  transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 2px 12px 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);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo img {
  height: 32px;
  width: auto;
}

.header-logo span {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-body);
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 0.9rem;
  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-color: var(--color-brand);
  border-radius: 1px;
}

.header-cta {
  height: 36px;
  padding: 0 16px;
  font-size: 0.85rem;
}

/* ---- 页脚 ---- */
.site-footer {
  background-color: var(--color-dark);
  color: var(--color-paper);
  padding: 48px 0 32px;
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  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-size: 1.05rem;
  font-weight: 700;
  color: var(--color-paper);
}

.footer-nav {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-nav a {
  font-size: 0.9rem;
  color: rgba(246, 243, 247, 0.7);
  transition: color 0.2s ease;
}

.footer-nav a:hover {
  color: var(--color-accent);
}

.footer-bottom {
  padding-top: 24px;
  font-size: 0.8rem;
  color: rgba(246, 243, 247, 0.4);
  text-align: center;
}

/* ---- 卡片 ---- */
.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-card);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: 24px;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
  box-shadow: 0 14px 36px -12px rgba(31, 21, 35, 0.35);
  transform: translateY(-2px);
}

/* ---- 表格 ---- */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.spec-table th,
.spec-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-card);
}

.spec-table th {
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.spec-table td {
  color: var(--text-secondary);
}

.spec-table tr:last-child th,
.spec-table tr:last-child td {
  border-bottom: none;
}

/* ---- FAQ ---- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  overflow: hidden;
  background-color: var(--bg-card);
}

.faq-item summary {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background-color 0.2s ease;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  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'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.3s ease;
}

.faq-item[open] summary::before {
  transform: rotate(180deg);
}

.faq-item summary:hover {
  background-color: rgba(31, 21, 35, 0.03);
}

.faq-item .faq-answer {
  padding: 0 20px 16px 52px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ---- 提示框 ---- */
.info-box {
  border-left: 3px solid var(--accent-for-section);
  background-color: rgba(31, 21, 35, 0.03);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  padding: 16px 20px;
  margin: 16px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.dark-surface .info-box {
  background-color: rgba(246, 243, 247, 0.06);
}

/* ---- 时间轴 ---- */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-for-section), rgba(31, 21, 35, 0.1));
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  padding-bottom: 28px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--accent-for-section);
  border: 2px solid var(--color-paper);
  z-index: 1;
}

.dark-surface .timeline-item::before {
  border-color: var(--color-dark);
}

.timeline-time {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-for-section);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.timeline-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.timeline-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ---- 步骤编号徽标 ---- */
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: var(--color-accent);
  color: var(--color-dark);
  font-size: 0.9rem;
  font-weight: 800;
  border-radius: 8px;
  flex-shrink: 0;
}

.step-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.step-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.step-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ---- 新闻卡片 ---- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
}

.news-card {
  display: flex;
  flex-direction: column;
}

.news-card time {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-for-section);
  margin-bottom: 8px;
}

.news-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.45;
}

.news-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.65;
  flex-grow: 1;
}

/* ---- 功能图文交错 ---- */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.feature-row.reverse {
  direction: rtl;
}

.feature-row.reverse > * {
  direction: ltr;
}

.feature-visual {
  background-color: var(--color-dark);
  border-radius: var(--radius-card);
  padding: 32px;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.feature-visual svg {
  width: 100%;
  height: 100%;
}

.feature-info h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.35;
}

.feature-info p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 8px;
}

.feature-info ul {
  padding-left: 0;
  margin-top: 12px;
}

.feature-info li {
  position: relative;
  padding-left: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 6px;
}

.feature-info li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-for-section);
}

/* ---- 安全要点 ---- */
.security-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

.security-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.security-icon {
  width: 40px;
  height: 40px;
  background-color: rgba(110, 237, 168, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.security-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--color-accent);
}

.security-item h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.security-item p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---- 网格节点动画面板 ---- */
.node-panel {
  background-color: var(--color-dark);
  border-radius: var(--radius-card);
  padding: 32px;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ---- 分隔线 ---- */
.section-divider {
  width: 100%;
  height: 1px;
  background-color: var(--border-card);
  border: none;
}

/* ---- 两列布局 ---- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.two-col > * {
  min-width: 0;
}

/* ---- SVG 通用 ---- */
.svg-visual {
  width: 100%;
  height: auto;
}

/* ---- 焦点可见 ---- */
*:focus-visible {
  outline: 2px solid var(--accent-for-section);
  outline-offset: 2px;
}

a:focus-visible {
  outline-offset: 4px;
}

/* ============================================
   SVG 动效 — @keyframes
   ============================================ */

/* 气泡依次浮现 + 漂浮 */
@keyframes bubble-float {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-6px); opacity: 0.85; }
}

@keyframes bubble-enter {
  0% { transform: translateY(16px); opacity: 0; }
  15% { transform: translateY(0); opacity: 1; }
  85% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(16px); opacity: 0; }
}

/* 输入中三个点呼吸 */
@keyframes dot-breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* 通知卡片滑入 */
@keyframes notify-slide {
  0% { transform: translateX(20px); opacity: 0; }
  10% { transform: translateX(0); opacity: 1; }
  80% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(20px); opacity: 0; }
}

/* 连接线流动 */
@keyframes dash-flow {
  to { stroke-dashoffset: -1; }
}

/* 网格节点依次点亮 */
@keyframes node-glow {
  0%, 100% { fill: rgba(110, 237, 168, 0.15); }
  10%, 30% { fill: var(--color-accent); }
  20%, 40% { fill: rgba(110, 237, 168, 0.15); }
}

/* 窗口轻微悬浮 */
@keyframes window-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* 扫描线移动 */
@keyframes scan-line {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(300%); }
}

/* 旋转 */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ============================================
   SVG 动效 — 类名
   ============================================ */

.anim-bubble-1 { animation: bubble-enter 6s ease-in-out infinite; animation-delay: 0s; }
.anim-bubble-2 { animation: bubble-enter 6s ease-in-out infinite; animation-delay: 1.5s; }
.anim-bubble-3 { animation: bubble-enter 6s ease-in-out infinite; animation-delay: 3s; }

.anim-float { animation: bubble-float 4s ease-in-out infinite; }
.anim-float-delayed { animation: bubble-float 4s ease-in-out infinite; animation-delay: 1s; }

.anim-dot-1 { animation: dot-breathe 2s ease-in-out infinite; }
.anim-dot-2 { animation: dot-breathe 2s ease-in-out infinite; animation-delay: 0.3s; }
.anim-dot-3 { animation: dot-breathe 2s ease-in-out infinite; animation-delay: 0.6s; }

.anim-notify { animation: notify-slide 8s ease-in-out infinite; animation-delay: 2s; }

.anim-dash {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dash-flow 3s linear infinite;
}

.anim-node {
  animation: node-glow 6s ease-in-out infinite;
}

.anim-window {
  animation: window-float 6s ease-in-out infinite;
}

.anim-scan {
  animation: scan-line 4s linear infinite;
}

.anim-spin {
  animation: spin-slow 20s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}

/* ============================================
   prefers-reduced-motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .anim-bubble-1,
  .anim-bubble-2,
  .anim-bubble-3,
  .anim-float,
  .anim-float-delayed,
  .anim-dot-1,
  .anim-dot-2,
  .anim-dot-3,
  .anim-notify,
  .anim-dash,
  .anim-node,
  .anim-window,
  .anim-scan,
  .anim-spin {
    animation: none !important;
  }
}

/* ============================================
   响应式
   ============================================ */

@media (max-width: 960px) {
  .feature-row,
  .feature-row.reverse {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .feature-row.reverse {
    direction: ltr;
  }

  .security-list {
    grid-template-columns: 1fr;
  }

  .two-col {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .nav-links {
    gap: 20px;
  }
}

@media (max-width: 640px) {
  .header-inner {
    height: 56px;
  }

  .nav-links {
    gap: 16px;
  }

  .header-cta {
    display: none;
  }

  .hero-title {
    font-size: clamp(1.8rem, 7vw, 2.8rem);
  }

  .btn-group {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .footer-top {
    flex-direction: column;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }

  .spec-table {
    font-size: 0.85rem;
  }

  .spec-table th,
  .spec-table td {
    padding: 8px 10px;
  }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
