/* ===== SafeW 全站共享样式 ===== */

/* ── 设计变量 ── */
:root {
  /* 色板 */
  --color-dark: #141838;
  --color-paper: #F7F5F3;
  --color-body: #151723;
  --color-brand: #142CEB;
  --color-accent: #6EAFED;

  /* 圆角 */
  --radius-card: 8px;
  --radius-btn: 6px;

  /* 卡片边界 */
  --card-border: 2px solid var(--color-body);
  --card-shadow: 4px 4px 0 var(--color-body);

  /* 节奏与密度 */
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --line-height-body: 1.65;

  /* 内容最大宽度 */
  --content-max: 1280px;

  /* 字体 */
  --font-sans: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

/* ── 基础重置 ── */
*, *::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: var(--font-sans);
  font-size: 16px;
  line-height: var(--line-height-body);
  color: var(--color-body);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* ── 容器 ── */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* ── 面色类 ── */
.surface-dark {
  background: var(--color-dark);
  color: var(--color-paper);
}
.surface-dark .hl { color: var(--color-accent); }
.surface-dark .label-tag { color: var(--color-accent); }
.surface-dark a:not(.btn):not(.btn-outline) { color: var(--color-accent); }

.surface-paper {
  background: var(--color-paper);
  color: var(--color-body);
}
.surface-paper .hl { color: var(--color-brand); }
.surface-paper .label-tag { color: var(--color-brand); }
.surface-paper a:not(.btn):not(.btn-outline) { color: var(--color-brand); }

/* 深色区块内的浅色卡片恢复纸面取色 */
.dark-card {
  background: var(--color-paper);
  color: var(--color-body);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
}
.dark-card .hl { color: var(--color-brand); }
.dark-card .label-tag { color: var(--color-brand); }
.dark-card a:not(.btn):not(.btn-outline) { color: var(--color-brand); }

/* ── 眉标 ── */
.label-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

/* ── 标题 ── */
h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-wrap: balance;
}

h3 {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

p { max-width: 38em; }

/* ── 按钮 ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 48px;
  padding: 0 1.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-btn);
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { transform: translateY(-2px); background: #5A9BD4; }
.btn-primary:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

.btn-outline {
  border: 2px solid;
  height: 44px;
  padding: 0 1.1rem;
}
.surface-paper .btn-outline { border-color: var(--color-body); color: var(--color-body); }
.surface-dark .btn-outline { border-color: var(--color-paper); color: var(--color-paper); }
.btn-outline:hover { transform: translateY(-2px); }
.btn-outline:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

/* ── 图标 SVG ── */
.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.icon-lg { width: 28px; height: 28px; }

/* ── 卡片 ── */
.card {
  background: var(--color-paper);
  color: var(--color-body);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
}

/* ── 表格 ── */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.spec-table th,
.spec-table td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(21, 23, 35, 0.12);
}
.spec-table th { font-weight: 700; white-space: nowrap; min-width: 120px; }
.surface-dark .spec-table th,
.surface-dark .spec-table td { border-color: rgba(247, 245, 243, 0.12); }

/* ── FAQ ── */
.faq-item {
  border: var(--card-border);
  border-radius: var(--radius-card);
  margin-bottom: var(--gap);
  overflow: hidden;
}
.faq-item summary {
  padding: 1rem var(--gap);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::marker { display: none; }
.faq-item summary::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background: var(--color-accent);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center / contain no-repeat;
}
.faq-item[open] summary::before {
  background: var(--color-brand);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E") center / contain no-repeat;
}
.faq-item .faq-answer {
  padding: 0 var(--gap) 1rem;
  line-height: var(--line-height-body);
}

/* ── 页头 ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 245, 243, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.site-header.scrolled {
  border-bottom-color: rgba(21, 23, 35, 0.1);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.15rem;
}
.brand img { height: 32px; width: auto; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.nav-links a {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.25rem 0;
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-brand);
  transition: width 0.25s ease;
}
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after { width: 100%; }
.nav-links a[aria-current="page"] { color: var(--color-brand); }

.header-actions { display: flex; align-items: center; gap: 0.75rem; }

/* ── 页脚 ── */
.site-footer {
  padding: 2rem 0;
  text-align: center;
  font-size: 0.85rem;
  border-top: 1px solid rgba(21, 23, 35, 0.08);
}
.surface-dark .site-footer { border-top-color: rgba(247, 245, 243, 0.08); }
.footer-links { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 0.75rem; }
.footer-links a { font-weight: 600; }

/* ── 网格布局工具 ── */
.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); }
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }

/* ── Tab 切换（纯 CSS） ── */
.tab-group { position: relative; }
.tab-input { display: none; }
.tab-labels {
  display: flex;
  gap: 0;
  border-bottom: 2px solid rgba(21, 23, 35, 0.12);
  overflow-x: auto;
}
.surface-dark .tab-labels { border-color: rgba(247, 245, 243, 0.12); }
.tab-labels label {
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: color 0.2s ease;
}
.tab-labels label::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-brand);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}
.tab-labels label:hover { color: var(--color-brand); }
.tab-content { display: none; padding-top: var(--gap); }
.tab-input:checked + .tab-labels label[for] { color: var(--color-brand); }
.tab-input:nth-of-type(1):checked ~ .tab-panel:nth-child(1) { display: block; }
.tab-input:nth-of-type(2):checked ~ .tab-panel:nth-child(2) { display: block; }
.tab-input:nth-of-type(3):checked ~ .tab-panel:nth-child(3) { display: block; }
.tab-input:nth-of-type(4):checked ~ .tab-panel:nth-child(4) { display: block; }
.tab-input:nth-of-type(5):checked ~ .tab-panel:nth-child(5) { display: block; }

/* 默认显示第一个 tab */
.tab-content:first-child { display: block; }
.tab-input:not(:checked) + .tab-labels label:first-child::after { transform: scaleX(1); }

/* ── 步骤编号徽标 ── */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.surface-paper .step-badge { background: var(--color-brand); color: var(--color-paper); }

/* ── 提示框 ── */
.note-box {
  border-left: 4px solid var(--color-brand);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  background: rgba(20, 44, 235, 0.04);
  font-size: 0.95rem;
}
.surface-dark .note-box {
  border-color: var(--color-accent);
  background: rgba(110, 175, 237, 0.08);
}

/* ── 场景走查面板 ── */
.scene-panel {
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: var(--gap);
  background: var(--color-paper);
}
.surface-dark .scene-panel {
  background: var(--color-dark);
  border-color: rgba(247, 245, 243, 0.15);
  box-shadow: none;
}

/* ── 新闻卡片 ── */
.news-card {
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: var(--gap);
  background: var(--color-paper);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
}
.news-card time {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(21, 23, 35, 0.5);
  margin-bottom: 0.5rem;
}
.surface-dark .news-card {
  background: var(--color-dark);
  border-color: rgba(247, 245, 243, 0.15);
  box-shadow: none;
}
.surface-dark .news-card time { color: rgba(247, 245, 243, 0.4); }

/* ── 视觉面板 ── */
.visual-panel {
  border-radius: var(--radius-card);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* ── 响应式 ── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  h1 { font-size: clamp(1.8rem, 7vw, 2.8rem); }
  h2 { font-size: clamp(1.3rem, 5vw, 2rem); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .flex-row { flex-direction: column; align-items: flex-start; }
}

/* ── SVG 动效 Keyframes ── */

/* 网格节点依次点亮 */
@keyframes gridPulse {
  0%, 100% { opacity: 0.25; }
  15% { opacity: 1; }
  30% { opacity: 0.25; }
}

.anim-grid-pulse-1 { animation: gridPulse 8s ease-in-out 0s infinite; }
.anim-grid-pulse-2 { animation: gridPulse 8s ease-in-out 0.4s infinite; }
.anim-grid-pulse-3 { animation: gridPulse 8s ease-in-out 0.8s infinite; }
.anim-grid-pulse-4 { animation: gridPulse 8s ease-in-out 1.2s infinite; }
.anim-grid-pulse-5 { animation: gridPulse 8s ease-in-out 1.6s infinite; }
.anim-grid-pulse-6 { animation: gridPulse 8s ease-in-out 2.0s infinite; }
.anim-grid-pulse-7 { animation: gridPulse 8s ease-in-out 2.4s infinite; }
.anim-grid-pulse-8 { animation: gridPulse 8s ease-in-out 2.8s infinite; }
.anim-grid-pulse-9 { animation: gridPulse 8s ease-in-out 3.2s infinite; }
.anim-grid-pulse-10 { animation: gridPulse 8s ease-in-out 3.6s infinite; }
.anim-grid-pulse-11 { animation: gridPulse 8s ease-in-out 4.0s infinite; }
.anim-grid-pulse-12 { animation: gridPulse 8s ease-in-out 4.4s infinite; }

/* 消息气泡依次浮现后漂浮 */
@keyframes bubbleFloatIn {
  0%, 100% { opacity: 0.3; transform: translateY(8px); }
  20%, 80% { opacity: 1; transform: translateY(0); }
}
@keyframes bubbleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.anim-bubble-in { animation: bubbleFloatIn 6s ease-in-out infinite; }
.anim-bubble-float { animation: bubbleFloat 4s ease-in-out infinite; }
.bf-delay-1 { animation-delay: 0s; }
.bf-delay-2 { animation-delay: 1.5s; }
.bf-delay-3 { animation-delay: 3s; }

/* 输入中三点呼吸 */
@keyframes dotBreathe {
  0%, 60%, 100% { opacity: 0.25; transform: scale(0.85); }
  30% { opacity: 1; transform: scale(1); }
}
.anim-dot { animation: dotBreathe 2.4s ease-in-out infinite; }
.dot-delay-1 { animation-delay: 0s; }
.dot-delay-2 { animation-delay: 0.3s; }
.dot-delay-3 { animation-delay: 0.6s; }

/* 通知卡片滑入 */
@keyframes notifSlide {
  0%, 100% { opacity: 0.15; transform: translateX(12px); }
  15%, 75% { opacity: 1; transform: translateX(0); }
}
.anim-notif { animation: notifSlide 10s ease-in-out infinite; }

/* 连接线流动 */
@keyframes dashFlow {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
.anim-flow {
  stroke-dasharray: 1;
  animation: dashFlow 4s linear infinite;
}

/* 设置面板开关拨动 */
@keyframes toggleSwitch {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(8px); }
}
.anim-toggle {
  transform-box: fill-box;
  transform-origin: center;
  animation: toggleSwitch 3s ease-in-out infinite;
}

/* 文件列表项高亮 */
@keyframes fileHighlight {
  0%, 100% { opacity: 0.3; }
  25% { opacity: 1; }
  50% { opacity: 0.3; }
}
.anim-file { animation: fileHighlight 12s ease-in-out infinite; }
.file-delay-1 { animation-delay: 0s; }
.file-delay-2 { animation-delay: 2s; }
.file-delay-3 { animation-delay: 4s; }

/* ── 减少动态效果 ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  .anim-grid-pulse-1, .anim-grid-pulse-2, .anim-grid-pulse-3,
  .anim-grid-pulse-4, .anim-grid-pulse-5, .anim-grid-pulse-6,
  .anim-grid-pulse-7, .anim-grid-pulse-8, .anim-grid-pulse-9,
  .anim-grid-pulse-10, .anim-grid-pulse-11, .anim-grid-pulse-12,
  .anim-bubble-in, .anim-bubble-float, .anim-dot,
  .anim-notif, .anim-flow, .anim-toggle, .anim-file {
    animation: none !important;
  }
  .dot-delay-1, .dot-delay-2, .dot-delay-3 { opacity: 1 !important; }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
