/* ========================================
   SafeW — 全站共享样式
   ======================================== */

/* ---------- 设计变量 ---------- */
:root {
  /* 色板 */
  --color-dark: #10112D;
  --color-paper: #F5F0E5;
  --color-body: #151523;
  --color-brand: #1416EB;
  --color-accent: #89ED6E;

  /* 结构 token */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(21, 21, 35, 0.3);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 960px;
  --header-h: 64px;

  /* 标题 */
  --h1-size: clamp(2rem, 4.6vw, 3.4rem);
  --h2-size: clamp(1.6rem, 3vw, 2.4rem);
  --body-size: 1rem;
}

/* ---------- 基础重置 ---------- */
*, *::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", "Noto Sans SC", system-ui, sans-serif;
  font-size: var(--body-size);
  line-height: 1.75;
  color: var(--color-body);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

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 {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

/* ---------- 眉标 ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.paper-surface .eyebrow {
  color: var(--color-brand);
}

.dark-surface .eyebrow {
  color: var(--color-accent);
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 2px;
  border-radius: 1px;
  background-color: currentColor;
}

/* ---------- 标题 ---------- */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  text-wrap: balance;
}

h1 {
  font-size: var(--h1-size);
}

h2 {
  font-size: var(--h2-size);
  margin-bottom: calc(var(--gap) * 0.75);
}

h3 {
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  margin-bottom: 0.6rem;
}

/* 高亮关键词 */
.hl {
  color: var(--color-brand);
}

.dark-surface .hl {
  color: var(--color-accent);
}

/* ---------- 正文段落 ---------- */
p {
  margin-bottom: 1em;
  max-width: 38em;
}

p:last-child {
  margin-bottom: 0;
}

/* ---------- 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background-color: var(--color-paper);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.site-header.scrolled {
  border-bottom-color: rgba(21, 21, 35, 0.08);
  box-shadow: 0 1px 8px rgba(21, 21, 35, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-body);
}

.brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-body);
  transition: color 0.2s;
  position: relative;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--color-brand);
}

.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--color-brand);
  border-radius: 1px;
}

.nav-cta {
  margin-left: 8px;
}

/* ---------- 页脚 ---------- */
.site-footer {
  background-color: var(--color-dark);
  color: var(--color-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;
  margin-bottom: 12px;
}

.footer-brand img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  color: var(--color-paper);
  opacity: 0.7;
  font-size: 0.9rem;
  transition: opacity 0.2s;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  opacity: 1;
}

.footer-bottom {
  max-width: var(--content-max);
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(245, 240, 229, 0.12);
  font-size: 0.8rem;
  opacity: 0.5;
  text-align: center;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 28px;
  border-radius: var(--radius-btn);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-accent), 0 0 0 5px var(--color-dark);
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}

.btn-primary:hover {
  background-color: #7AD95F;
}

.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--color-body);
  color: var(--color-body);
}

.dark-surface .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}

.btn-secondary:hover {
  background-color: rgba(21, 21, 35, 0.06);
}

.dark-surface .btn-secondary:hover {
  background-color: rgba(245, 240, 229, 0.08);
}

.btn-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- 卡片 ---------- */
.card {
  background-color: var(--color-paper);
  border-radius: var(--radius-card);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: 28px;
  transition: box-shadow 0.3s;
}

.card:hover {
  box-shadow: 0 14px 36px -12px rgba(21, 21, 35, 0.35);
}

.dark-surface .card {
  background-color: var(--color-paper);
  color: var(--color-body);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

/* ---------- 面板（视觉展示区） ---------- */
.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;
  position: relative;
}

.panel svg {
  width: 100%;
  height: auto;
}

/* ---------- 图文交错行 ---------- */
.split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}

.split-row.reverse {
  direction: rtl;
}

.split-row.reverse > * {
  direction: ltr;
}

/* ---------- 列表 ---------- */
.list-check {
  padding-left: 0;
}

.list-check li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
  line-height: 1.6;
}

.list-check li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background-color: var(--color-brand);
  transform: rotate(45deg);
}

.dark-surface .list-check li::before {
  background-color: var(--color-accent);
}

/* ---------- 编号步骤徽标 ---------- */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background-color: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.step-item {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
}

.step-item p {
  margin-bottom: 0;
}

/* ---------- 表格 ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(21, 21, 35, 0.1);
}

th {
  font-weight: 700;
  white-space: nowrap;
}

td:first-child {
  font-weight: 600;
}

.dark-surface th,
.dark-surface td {
  border-bottom-color: rgba(245, 240, 229, 0.1);
}

/* ---------- FAQ ---------- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.faq-item {
  border-bottom: 1px solid rgba(21, 21, 35, 0.08);
}

.faq-item summary {
  padding: 18px 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.05rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  margin-left: auto;
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--color-brand);
  transition: transform 0.25s;
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
  color: var(--color-accent);
}

.faq-item .answer {
  padding-bottom: 20px;
  line-height: 1.7;
  color: var(--color-body);
  opacity: 0.85;
}

.dark-surface .faq-item summary::after {
  color: var(--color-paper);
}

.dark-surface .faq-item[open] summary::after {
  color: var(--color-accent);
}

.dark-surface .faq-item .answer {
  color: var(--color-paper);
  opacity: 0.8;
}

/* ---------- 场景卡片 ---------- */
.scenario-card {
  border-left: 4px solid var(--color-brand);
  padding: 24px 28px;
  margin-bottom: 24px;
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  background-color: rgba(20, 22, 235, 0.04);
}

.dark-surface .scenario-card {
  border-left-color: var(--color-accent);
  background-color: rgba(137, 237, 110, 0.06);
}

.scenario-card h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.scenario-card ol {
  padding-left: 20px;
  list-style: decimal;
}

.scenario-card ol li {
  margin-bottom: 8px;
  line-height: 1.6;
}

/* ---------- 提示框 ---------- */
.callout {
  border-left: 4px solid var(--color-accent);
  background-color: rgba(137, 237, 110, 0.08);
  padding: 16px 20px;
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  margin: 20px 0;
  font-size: 0.95rem;
}

.dark-surface .callout {
  background-color: rgba(137, 237, 110, 0.1);
}

/* ---------- 焦点可见 ---------- */
*:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.btn-primary:focus-visible {
  outline-color: var(--color-accent);
}

/* ---------- SVG 动效：网格节点依次点亮 ---------- */
@keyframes gridNode {
  0%, 100% {
    opacity: 0.15;
    r: 3;
  }
  50% {
    opacity: 1;
    r: 5;
  }
}

.grid-node {
  animation: gridNode 6s ease-in-out infinite;
}

.grid-node:nth-child(1)  { animation-delay: 0.0s; }
.grid-node:nth-child(2)  { animation-delay: 0.3s; }
.grid-node:nth-child(3)  { animation-delay: 0.6s; }
.grid-node:nth-child(4)  { animation-delay: 0.9s; }
.grid-node:nth-child(5)  { animation-delay: 1.2s; }
.grid-node:nth-child(6)  { animation-delay: 1.5s; }
.grid-node:nth-child(7)  { animation-delay: 1.8s; }
.grid-node:nth-child(8)  { animation-delay: 2.1s; }
.grid-node:nth-child(9)  { animation-delay: 2.4s; }
.grid-node:nth-child(10) { animation-delay: 2.7s; }
.grid-node:nth-child(11) { animation-delay: 3.0s; }
.grid-node:nth-child(12) { animation-delay: 3.3s; }
.grid-node:nth-child(13) { animation-delay: 3.6s; }
.grid-node:nth-child(14) { animation-delay: 3.9s; }
.grid-node:nth-child(15) { animation-delay: 4.2s; }
.grid-node:nth-child(16) { animation-delay: 4.5s; }

/* ---------- SVG 动效：气泡浮现 ---------- */
@keyframes bubbleIn {
  0%, 100% {
    opacity: 0.2;
    transform: translateY(6px);
  }
  50% {
    opacity: 1;
    transform: translateY(0);
  }
}

.bubble {
  animation: bubbleIn 5s ease-in-out infinite;
}

.bubble:nth-child(odd)  { animation-delay: 0.5s; }
.bubble:nth-child(even) { animation-delay: 1.5s; }

/* ---------- SVG 动效：输入点呼吸 ---------- */
@keyframes breathe {
  0%, 100% { opacity: 0.2; }
  50%      { opacity: 1; }
}

.breath-dot {
  animation: breathe 2s ease-in-out infinite;
}

.breath-dot:nth-child(1) { animation-delay: 0s; }
.breath-dot:nth-child(2) { animation-delay: 0.3s; }
.breath-dot:nth-child(3) { animation-delay: 0.6s; }

/* ---------- SVG 动效：通知滑入 ---------- */
@keyframes slideIn {
  0%, 100% {
    opacity: 0.1;
    transform: translateX(12px);
  }
  50% {
    opacity: 1;
    transform: translateX(0);
  }
}

.notification-card {
  animation: slideIn 7s ease-in-out infinite;
}

/* ---------- SVG 动效：连接线流动 ---------- */
@keyframes flowLine {
  from { stroke-dashoffset: 1; }
  to   { stroke-dashoffset: 0; }
}

.flow-line {
  stroke-dasharray: 1;
  animation: flowLine 3s linear infinite;
}

/* ---------- SVG 动效：设备漂浮 ---------- */
@keyframes floatDevice {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.float-device {
  animation: floatDevice 6s ease-in-out infinite;
}

/* ---------- SVG 动效：数据脉冲 ---------- */
@keyframes dataPulse {
  0%, 100% { opacity: 0.3; stroke-width: 1; }
  50%      { opacity: 1; stroke-width: 2; }
}

.data-pulse {
  animation: dataPulse 4s 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;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .split-row {
    grid-template-columns: 1fr;
  }

  .split-row.reverse {
    direction: ltr;
  }

  .nav {
    gap: 16px;
  }

  .footer-inner {
    flex-direction: column;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .btn-group {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}
