/* ============================================================
   SafeW — 全站共享样式
   设计变量 · 排版 · 页头页脚 · 组件 · SVG 动效
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
  /* 色板 */
  --color-dark: #13102D;
  --color-paper: #F7F5F3;
  --color-body: #171523;
  --color-brand: #2714EB;
  --color-accent: #89ED6E;

  /* 圆角 */
  --radius-card: 24px;
  --radius-btn: 999px;

  /* 卡片边界 & 阴影 */
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(23, 21, 35, 0.3);
  --card-shadow-hover: 0 14px 32px -12px rgba(23, 21, 35, 0.38);

  /* 节奏与密度 */
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);

  /* 内容最大宽度 */
  --content-max: 1120px;

  /* 标题处理 */
  --heading-weight: 600;
  --heading-letter-spacing: 0;
  --heading-line-height: 1.25;

  /* 正文行高 */
  --body-line-height: 1.65;

  /* 表格 & 提示框圆角 */
  --table-radius: 16px;
  --notice-radius: 16px;
}

/* ---------- 页面取色层 ---------- */
.page-dark {
  --text-primary: var(--color-paper);
  --text-secondary: rgba(247, 245, 243, 0.78);
  --accent-for-surface: var(--color-accent);
  --label-color: var(--color-accent);
  --link-color: var(--color-accent);
}

.page-light {
  --text-primary: var(--color-body);
  --text-secondary: rgba(23, 21, 35, 0.65);
  --accent-for-surface: var(--color-brand);
  --label-color: var(--color-brand);
  --link-color: var(--color-brand);
}

.card-on-dark {
  --text-primary: var(--color-body);
  --text-secondary: rgba(23, 21, 35, 0.65);
  --accent-for-surface: var(--color-brand);
  --label-color: var(--color-brand);
  --link-color: var(--color-brand);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: var(--body-line-height);
  color: var(--text-primary);
  background: var(--color-paper);
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ---------- 容器 ---------- */
.container {
  width: 100%;
  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;
  color: var(--label-color);
  margin-bottom: 0.75rem;
}

/* ---------- 标题 ---------- */
h1, h2, h3 {
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-letter-spacing);
  line-height: var(--heading-line-height);
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

h3 {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-weight: 600;
}

/* 高亮关键词 */
.hl {
  color: var(--accent-for-surface);
}

/* ---------- 正文 ---------- */
.body-text {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: var(--body-line-height);
  max-width: 38em;
}

.hero-intro {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 36em;
  margin-top: 1rem;
}

/* ---------- 区块间距 ---------- */
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

.section + .section {
  margin-top: 0;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(137, 237, 110, 0.35);
}

.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--text-primary);
  color: var(--text-primary);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  opacity: 0.85;
}

/* ---------- 图标（内联 SVG） ---------- */
.icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--color-paper);
  border-radius: var(--radius-card);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: 24px;
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: var(--card-shadow-hover);
}

.card-on-dark {
  background: var(--color-paper);
  color: var(--text-primary);
}

/* ---------- 视觉面板 ---------- */
.visual-panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  overflow: hidden;
  padding: 24px;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-inner {
  width: 100%;
  max-width: 520px;
}

/* ---------- 两列布局 ---------- */
.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;
  }
}

/* ---------- 功能分组卡片 ---------- */
.feature-group-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
}

.feature-item {
  background: var(--color-paper);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.3s ease;
}

.feature-item:hover {
  box-shadow: var(--card-shadow-hover);
}

.feature-item h3 {
  margin-bottom: 0.5rem;
}

.feature-item p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ---------- 步骤编号徽标 ---------- */
.step-list {
  counter-reset: step;
}

.step-item {
  position: relative;
  padding-left: 3.2rem;
  margin-bottom: 1.5rem;
}

.step-item::before {
  counter-increment: step;
  content: "" step "";
  position: absolute;
  left: 0;
  top: 0;
  width: 2.4rem;
  height: 2.4rem;
  background: var(--color-accent);
  color: var(--color-dark);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.step-item p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ---------- 表格 ---------- */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--table-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.spec-table th,
.spec-table td {
  padding: 14px 20px;
  text-align: left;
  font-size: 0.95rem;
}

.spec-table thead th {
  background: var(--color-dark);
  color: var(--color-paper);
  font-weight: 700;
}

.spec-table tbody tr {
  background: var(--color-paper);
}

.spec-table tbody tr:nth-child(even) {
  background: rgba(247, 245, 243, 0.7);
}

.spec-table td:first-child {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.spec-table td:last-child {
  color: var(--text-secondary);
}

/* ---------- FAQ ---------- */
.faq-list details {
  background: var(--color-paper);
  border-radius: var(--radius-card);
  margin-bottom: 12px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.faq-list summary {
  padding: 18px 24px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232714EB' stroke-width='2'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") no-repeat center;
  background-size: 18px;
  transition: transform 0.25s ease;
}

.faq-list details[open] summary::before {
  transform: rotate(45deg);
}

.faq-list summary:hover {
  background: rgba(39, 20, 235, 0.04);
}

.faq-list .faq-answer {
  padding: 0 24px 18px 44px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.75;
}

/* ---------- 场景对照 ---------- */
.scenario-card {
  background: var(--color-paper);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.scenario-header {
  padding: 16px 24px;
  background: var(--color-dark);
  color: var(--color-paper);
  font-weight: 700;
  font-size: 1rem;
}

.scenario-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.scenario-situation,
.scenario-action {
  padding: 20px 24px;
}

.scenario-situation {
  background: rgba(19, 16, 45, 0.04);
  border-right: 1px solid rgba(19, 16, 45, 0.08);
}

.scenario-situation strong,
.scenario-action strong {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--label-color);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.scenario-situation p,
.scenario-action p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

.scenario-action ol {
  padding-left: 1.2rem;
  list-style: decimal;
}

.scenario-action ol li {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 0.4rem;
}

@media (max-width: 768px) {
  .scenario-body {
    grid-template-columns: 1fr;
  }
  .scenario-situation {
    border-right: none;
    border-bottom: 1px solid rgba(19, 16, 45, 0.08);
  }
}

/* ---------- 资讯卡片 ---------- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--gap);
}

.news-card {
  background: var(--color-paper);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 24px;
  transition: box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  box-shadow: var(--card-shadow-hover);
}

.news-card time {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--label-color);
  margin-bottom: 0.5rem;
  display: block;
}

.news-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.news-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  flex: 1;
}

/* ---------- 提示框 ---------- */
.notice {
  background: rgba(39, 20, 235, 0.06);
  border-left: 4px solid var(--color-brand);
  border-radius: var(--notice-radius);
  padding: 16px 20px;
  margin: 1.5rem 0;
}

.notice p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ---------- 胶囊标签 ---------- */
.capsule-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.capsule {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 6px 14px;
  background: rgba(39, 20, 235, 0.06);
  border-radius: var(--radius-btn);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ---------- 列表标记 ---------- */
.check-list {
  padding-left: 0;
}

.check-list li {
  position: relative;
  padding-left: 1.8rem;
  margin-bottom: 0.6rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2389ED6E' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") no-repeat center;
  background-size: 16px;
}

/* ---------- 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-paper);
  border-bottom: 1px solid rgba(19, 16, 45, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.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: 32px;
  width: auto;
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text-primary);
}

.nav-links a[aria-current="page"] {
  font-weight: 700;
}

.nav-links .btn-primary {
  height: 40px;
  padding: 0 18px;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
}

/* ---------- 页脚 ---------- */
.site-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: 48px 0 32px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--gap);
}

.footer-brand p {
  color: rgba(247, 245, 243, 0.6);
  font-size: 0.9rem;
  margin-top: 0.75rem;
  max-width: 28em;
  line-height: 1.7;
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.footer-col ul li {
  margin-bottom: 0.5rem;
}

.footer-col ul li a {
  color: rgba(247, 245, 243, 0.6);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-col ul li a:hover {
  color: var(--color-paper);
}

.footer-bottom {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(247, 245, 243, 0.1);
  text-align: center;
  color: rgba(247, 245, 243, 0.4);
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   SVG 动效 —— @keyframes 与动效类
   ============================================================ */

/* 线条自绘描边 */
@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

.line-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 6s ease-in-out infinite;
}

/* 消息气泡依次浮现后漂浮 */
@keyframes bubbleIn {
  0%, 10% { opacity: 0; transform: translateY(8px); }
  15% { opacity: 1; transform: translateY(0); }
  85% { opacity: 1; transform: translateY(0); }
  95%, 100% { opacity: 0; transform: translateY(8px); }
}

.bubble-1 { animation: bubbleIn 8s ease-in-out infinite 0s; }
.bubble-2 { animation: bubbleIn 8s ease-in-out infinite 1.5s; }
.bubble-3 { animation: bubbleIn 8s ease-in-out infinite 3s; }

/* 呼吸效果 */
@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.breathing {
  animation: breathe 3s ease-in-out infinite;
}

/* 通知卡片滑入 */
@keyframes slideIn {
  0%, 10% { opacity: 0; transform: translateX(20px); }
  15% { opacity: 1; transform: translateX(0); }
  85% { opacity: 1; transform: translateX(0); }
  95%, 100% { opacity: 0; transform: translateX(20px); }
}

.notification-slide {
  animation: slideIn 10s ease-in-out infinite;
}

/* 连接线流动 */
@keyframes flowDash {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

.flow-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: flowDash 5s linear infinite;
}

/* 缓慢呼吸轮廓 */
@keyframes softBreathe {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.soft-breathe {
  animation: softBreathe 6s ease-in-out infinite;
}

/* 输入三点呼吸 */
@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.3; }
  40% { opacity: 1; }
}

.dot-1 { animation: dotPulse 2.4s ease-in-out infinite 0s; }
.dot-2 { animation: dotPulse 2.4s ease-in-out infinite 0.4s; }
.dot-3 { animation: dotPulse 2.4s ease-in-out infinite 0.8s; }

/* 轻微浮动 */
@keyframes floatGentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.float-gentle {
  animation: floatGentle 6s ease-in-out infinite;
}

/* 旋转（用于小图标装饰） */
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin-slow {
  animation: spinSlow 20s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}

/* 缩放脉冲 */
@keyframes pulseScale {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.pulse-scale {
  animation: pulseScale 5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

/* ---------- 减少动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
