/* ========================================
   SafeW 全站共享样式
   ======================================== */

/* --- 设计 Token / 色板 --- */
:root {
  /* 颜色 */
  --color-dark: #19102D;
  --color-paper: #FCFCFD;
  --color-body-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #D66EED;

  /* 圆角 */
  --radius-card: 0;
  --radius-btn: 0;

  /* 卡片边界 */
  --card-border: 0;
  --card-shadow: none;

  /* 节奏与密度 */
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --line-height-body: 1.65;

  /* 内容最大宽度 */
  --content-max: 1120px;

  /* 字体 */
  --font-sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

/* --- 重置与基础 --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--line-height-body);
  color: var(--color-body-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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);
}

/* --- 页头 --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(252, 252, 253, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.site-header.scrolled {
  border-bottom-color: rgba(25, 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);
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-group img {
  height: 32px;
  width: auto;
}

.logo-text {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-body-text);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.main-nav a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-body-text);
  transition: color 0.2s;
  position: relative;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--color-brand);
}

.main-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--color-brand);
}

.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: 0.9375rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  background-color: #c45bd8;
}

.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(214, 110, 237, 0.4);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  background-color: transparent;
  color: var(--color-body-text);
  border: 1.5px solid var(--color-body-text);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s, color 0.2s;
}

.btn-secondary:hover {
  transform: translateY(-1px);
  background-color: rgba(25, 21, 35, 0.05);
}

.btn-secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(25, 21, 35, 0.2);
}

/* --- 页脚 --- */
.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);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: start;
}

.footer-brand p {
  margin-top: 8px;
  font-size: 0.875rem;
  opacity: 0.7;
  max-width: 320px;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  gap: 32px;
}

.footer-links a {
  font-size: 0.875rem;
  opacity: 0.7;
  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: 16px var(--gap) 0;
  border-top: 1px solid rgba(252, 252, 253, 0.1);
  font-size: 0.8125rem;
  opacity: 0.5;
  text-align: center;
}

/* --- 眉标 --- */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: 16px;
}

.section-label::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 2px;
  background-color: var(--color-brand);
}

.dark-section .section-label {
  color: var(--color-accent);
}

.dark-section .section-label::before {
  background-color: var(--color-accent);
}

/* --- 标题 --- */
h1, h2, h3 {
  font-weight: 500;
  line-height: 1.15;
  color: var(--color-body-text);
}

.dark-section h1,
.dark-section h2,
.dark-section h3 {
  color: var(--color-paper);
}

.hero-h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.section-h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.25;
  margin-bottom: var(--gap);
}

.h3-title {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.3;
  margin-bottom: 12px;
}

.hl {
  color: var(--color-brand);
}

.dark-section .hl {
  color: var(--color-accent);
}

/* --- 正文排版 --- */
.body-text {
  font-size: 1rem;
  line-height: var(--line-height-body);
  max-width: 38em;
}

.dark-section .body-text {
  color: var(--color-paper);
  opacity: 0.85;
}

.intro-text {
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
  line-height: 1.7;
  max-width: 42em;
  color: var(--color-body-text);
}

.dark-section .intro-text {
  color: var(--color-paper);
  opacity: 0.8;
}

/* --- 区块 --- */
.section {
  padding: var(--section-y) 0;
}

.dark-section {
  background-color: var(--color-dark);
  color: var(--color-paper);
}

.dark-section h1,
.dark-section h2,
.dark-section h3,
.dark-section p,
.dark-section li,
.dark-section td,
.dark-section th {
  color: var(--color-paper);
}

.dark-section p,
.dark-section li,
.dark-section td,
.dark-section th {
  opacity: 0.85;
}

/* 深色区块内的浅色卡片 */
.light-card {
  background-color: var(--color-paper);
  color: var(--color-body-text);
  padding: 32px;
  border: 1px solid rgba(25, 21, 35, 0.06);
}

.light-card h1,
.light-card h2,
.light-card h3,
.light-card p,
.light-card li,
.light-card td,
.light-card th {
  color: var(--color-body-text);
}

.light-card .section-label {
  color: var(--color-brand);
}

.light-card .section-label::before {
  background-color: var(--color-brand);
}

/* --- 按钮组 --- */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.fact-line {
  margin-top: 16px;
  font-size: 0.8125rem;
  opacity: 0.6;
}

/* --- 特性胶囊 --- */
.capsule-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.capsule {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: rgba(82, 20, 235, 0.06);
  border: 1px solid rgba(82, 20, 235, 0.12);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-brand);
}

.dark-section .capsule {
  background-color: rgba(214, 110, 237, 0.1);
  border-color: rgba(214, 110, 237, 0.2);
  color: var(--color-accent);
}

.capsule svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* --- 图文交错行 --- */
.text-image-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}

.text-image-row.reverse .text-side {
  order: 2;
}

.text-image-row.reverse .visual-side {
  order: 1;
}

.visual-panel {
  background-color: var(--color-dark);
  border-radius: var(--radius-card);
  padding: 32px;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dark-section .visual-panel {
  background-color: rgba(252, 252, 253, 0.06);
}

/* --- 列表 --- */
.feature-list {
  margin-top: 16px;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.feature-list li::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--color-brand);
  border-radius: 0;
  margin-top: 8px;
  flex-shrink: 0;
}

.dark-section .feature-list li::before {
  background-color: var(--color-accent);
}

/* --- 步骤时间线 --- */
.step-timeline {
  position: relative;
  padding-left: 48px;
}

.step-timeline::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background-color: rgba(82, 20, 235, 0.2);
}

.dark-section .step-timeline::before {
  background-color: rgba(214, 110, 237, 0.2);
}

.step-item {
  position: relative;
  margin-bottom: 32px;
}

.step-item:last-child {
  margin-bottom: 0;
}

.step-number {
  position: absolute;
  left: -48px;
  top: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-accent);
  color: var(--color-dark);
  font-size: 0.875rem;
  font-weight: 700;
}

.step-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-body-text);
}

.dark-section .step-title {
  color: var(--color-paper);
}

.step-desc {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--color-body-text);
  opacity: 0.75;
}

.dark-section .step-desc {
  color: var(--color-paper);
}

/* --- 小贴士 --- */
.tip-grid {
  display: grid;
  gap: 16px;
}

.tip-item {
  display: flex;
  gap: 16px;
  padding: 20px;
  background-color: rgba(82, 20, 235, 0.04);
  border-left: 3px solid var(--color-brand);
}

.dark-section .tip-item {
  background-color: rgba(214, 110, 237, 0.06);
  border-left-color: var(--color-accent);
}

.tip-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-accent);
  color: var(--color-dark);
  font-size: 0.8125rem;
  font-weight: 700;
}

.tip-content h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--color-body-text);
}

.dark-section .tip-content h4 {
  color: var(--color-paper);
}

.tip-content p {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-body-text);
  opacity: 0.75;
}

.dark-section .tip-content p {
  color: var(--color-paper);
}

/* --- FAQ --- */
.faq-list {
  display: grid;
  gap: 8px;
}

.faq-item {
  border: 1px solid rgba(25, 21, 35, 0.08);
}

.dark-section .faq-item {
  border-color: rgba(252, 252, 253, 0.1);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  color: var(--color-body-text);
  transition: background-color 0.2s;
}

.dark-section .faq-item summary {
  color: var(--color-paper);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  flex-shrink: 0;
  margin-left: 16px;
  transition: transform 0.2s;
}

.faq-item[open] summary::after {
  transform: rotate(-135deg);
}

.faq-item summary:hover {
  background-color: rgba(82, 20, 235, 0.04);
}

.dark-section .faq-item summary:hover {
  background-color: rgba(214, 110, 237, 0.06);
}

.faq-item summary:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--color-brand);
}

.dark-section .faq-item summary:focus-visible {
  box-shadow: inset 0 0 0 2px var(--color-accent);
}

.faq-answer {
  padding: 0 20px 18px;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--color-body-text);
  opacity: 0.8;
}

.dark-section .faq-answer {
  color: var(--color-paper);
}

/* --- 场景走查 --- */
.scene-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

.scene-card {
  padding: 32px;
  background-color: rgba(82, 20, 235, 0.03);
  border: 1px solid rgba(82, 20, 235, 0.08);
}

.dark-section .scene-card {
  background-color: rgba(214, 110, 237, 0.05);
  border-color: rgba(214, 110, 237, 0.1);
}

.scene-role {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--color-brand);
  margin-bottom: 8px;
}

.dark-section .scene-role {
  color: var(--color-accent);
}

.scene-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--color-body-text);
}

.dark-section .scene-card h3 {
  color: var(--color-paper);
}

.scene-steps {
  counter-reset: scene-step;
}

.scene-steps li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-body-text);
}

.dark-section .scene-steps li {
  color: var(--color-paper);
  opacity: 0.8;
}

.scene-steps li::before {
  counter-increment: scene-step;
  content: counter(scene-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background-color: var(--color-accent);
  color: var(--color-dark);
}

.scene-result {
  margin-top: 16px;
  padding: 12px 16px;
  background-color: rgba(214, 110, 237, 0.08);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-body-text);
}

.dark-section .scene-result {
  background-color: rgba(214, 110, 237, 0.12);
  color: var(--color-paper);
}

/* --- 资讯卡片 --- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
}

.news-card {
  padding: 24px;
  background-color: rgba(82, 20, 235, 0.03);
  border: 1px solid rgba(82, 20, 235, 0.08);
  transition: background-color 0.2s;
}

.news-card:hover {
  background-color: rgba(82, 20, 235, 0.06);
}

.dark-section .news-card {
  background-color: rgba(214, 110, 237, 0.05);
  border-color: rgba(214, 110, 237, 0.1);
}

.dark-section .news-card:hover {
  background-color: rgba(214, 110, 237, 0.08);
}

.news-card time {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-brand);
  margin-bottom: 8px;
}

.dark-section .news-card time {
  color: var(--color-accent);
}

.news-card h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--color-body-text);
}

.dark-section .news-card h3 {
  color: var(--color-paper);
}

.news-card p {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--color-body-text);
  opacity: 0.7;
}

.dark-section .news-card p {
  color: var(--color-paper);
}

/* --- 表格 --- */
.data-table {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border-collapse: collapse;
  font-size: 0.9375rem;
  overflow-x: auto;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
}

.dark-section .data-table th,
.dark-section .data-table td {
  border-bottom-color: rgba(252, 252, 253, 0.08);
}

.data-table th {
  font-weight: 600;
  color: var(--color-body-text);
  width: 40%;
}

.dark-section .data-table th {
  color: var(--color-paper);
}

.data-table td {
  color: var(--color-body-text);
  opacity: 0.8;
}

.dark-section .data-table td {
  color: var(--color-paper);
}

/* --- 提示框 --- */
.callout {
  padding: 16px 20px;
  margin: 16px 0;
  border-left: 3px solid var(--color-brand);
  background-color: rgba(82, 20, 235, 0.04);
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--color-body-text);
}

.dark-section .callout {
  border-left-color: var(--color-accent);
  background-color: rgba(214, 110, 237, 0.06);
  color: var(--color-paper);
}

/* --- SVG 通用 --- */
.svg-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.svg-large {
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* --- SVG 动效：星点明灭与连线 --- */
@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes twinkle-alt {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.9; }
}

.star-point {
  animation: twinkle 4s ease-in-out infinite;
}

.star-point-alt {
  animation: twinkle-alt 5s ease-in-out infinite 1.5s;
}

@keyframes dash-flow {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

.connection-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dash-flow 6s ease-in-out infinite;
}

@keyframes bubble-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.bubble-float {
  animation: bubble-float 5s ease-in-out infinite;
}

.bubble-float-delayed {
  animation: bubble-float 5s ease-in-out infinite 1.5s;
}

@keyframes notify-slide-in {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.notify-enter {
  animation: notify-slide-in 0.8s ease-out forwards;
}

@keyframes dot-breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.typing-dot {
  animation: dot-breathe 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* --- 减少动态效果 --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- 响应式 --- */
@media (max-width: 768px) {
  .text-image-row {
    grid-template-columns: 1fr;
  }

  .text-image-row.reverse .text-side {
    order: 1;
  }

  .text-image-row.reverse .visual-side {
    order: 2;
  }

  .scene-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .main-nav {
    gap: 16px;
  }

  .hero-h1 {
    font-size: clamp(2rem, 8vw, 3.2rem);
  }
}

@media (max-width: 480px) {
  .btn-group {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }
}

/* 兜底：裁掉横向溢出 */
div.container {
  overflow-x: clip;
}
