/* ========================================
   SafeW 全站共享样式
   ======================================== */

/* ---------- 设计变量 ---------- */
:root {
  /* 色板 */
  --color-dark: #140E25;
  --color-paper: #F5F0E5;
  --color-body: #191523;
  --color-brand: #5214EB;
  --color-accent: #C8ED6E;

  /* 圆角 */
  --radius-card: 8px;
  --radius-btn: 6px;

  /* 卡片边界与阴影 */
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);

  /* 节奏与密度 */
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --line-height-body: 1.55;

  /* 内容最大宽度 */
  --content-max: 1280px;

  /* 标题处理 */
  --heading-weight: 600;
  --heading-letter-spacing: 0;
  --heading-line-height: 1.25;

  /* 分节方式 */
  --divider-thickness: 1px;

  /* 字体栈 */
  --font-sans: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;

  /* 页面布局 */
  --header-height: 64px;
}

/* ---------- 基础重置 ---------- */
*, *::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(--color-body);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

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: var(--color-paper);
  border-bottom: var(--divider-thickness) solid rgba(25, 21, 35, 0.08);
  transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 2px 12px rgba(25, 21, 35, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  width: 32px;
  height: 32px;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-body);
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-body);
  padding: 6px 0;
  position: relative;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--color-brand);
}

.nav-links a[aria-current="page"] {
  color: var(--color-brand);
  font-weight: 700;
}

.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-brand);
  border-radius: 1px;
}

.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: all 0.2s ease;
}

/* ---------- 按钮 ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-dark);
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(200, 237, 110, 0.35);
  background: #d5f582;
}

.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(200, 237, 110, 0.6);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-body);
  background: transparent;
  border: 1.5px solid var(--color-body);
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s, border-color 0.2s;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: var(--color-brand);
  color: var(--color-brand);
}

.btn-secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(25, 21, 35, 0.15);
}

/* 深色面上的按钮变体 */
.dark-surface .btn-primary {
  color: var(--color-dark);
  background: var(--color-accent);
}

.dark-surface .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

.dark-surface .btn-secondary:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* ---------- 眉标 ---------- */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.paper-surface .section-label {
  color: var(--color-brand);
}

.dark-surface .section-label {
  color: var(--color-accent);
}

/* ---------- 标题 ---------- */
h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: var(--gap);
}

h3 {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 12px;
}

p {
  margin-bottom: var(--gap);
}

.hl {
  font-weight: 800;
}

.paper-surface .hl {
  color: var(--color-brand);
}

.dark-surface .hl {
  color: var(--color-accent);
}

/* ---------- 区块通用 ---------- */
.section {
  padding: var(--section-y) 0;
}

.section + .section {
  border-top: var(--divider-thickness) solid rgba(25, 21, 35, 0.06);
}

.dark-surface {
  background: var(--color-dark);
  color: var(--color-paper);
}

.dark-surface h2,
.dark-surface h3,
.dark-surface p {
  color: var(--color-paper);
}

.dark-surface a {
  color: var(--color-accent);
}

.paper-surface h2,
.paper-surface h3,
.paper-surface p {
  color: var(--color-body);
}

.paper-surface a {
  color: var(--color-brand);
}

/* 深色面内的浅色卡片 */
.paper-card {
  background: var(--color-paper);
  border-radius: var(--radius-card);
  padding: 32px;
  box-shadow: var(--card-shadow);
  color: var(--color-body);
}

.paper-card h2,
.paper-card h3,
.paper-card p,
.paper-card .section-label {
  color: var(--color-body);
}

.paper-card a {
  color: var(--color-brand);
}

/* ---------- 特性胶囊 ---------- */
.feature-capsules {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.capsule {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-paper);
}

.capsule svg {
  width: 18px;
  height: 18px;
  stroke: var(--color-accent);
}

/* ---------- 两栏布局 ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4vw, 3rem);
  align-items: start;
}

@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

/* ---------- 视觉面板 ---------- */
.visual-panel {
  background: var(--color-dark);
  border-radius: 16px;
  padding: 32px;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.visual-panel svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
}

/* ---------- 功能 Tab（纯 CSS） ---------- */
.func-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.func-tab-label {
  display: inline-block;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  border: 1.5px solid rgba(25, 21, 35, 0.12);
  background: transparent;
  color: var(--color-body);
  transition: all 0.2s;
}

.func-tab-label:hover {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

.func-tab-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.func-tab-input:checked + .func-tab-label {
  background: var(--color-brand);
  color: #fff;
  border-color: var(--color-brand);
}

.func-tab-panel {
  display: none;
}

.func-tab-input:checked ~ .func-tab-panel[data-for] {
  display: block;
}

/* ---------- 流程条 ---------- */
.flow-bar {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  margin: 24px 0;
}

.flow-node {
  flex: 1;
  min-width: 140px;
  text-align: center;
  padding: 16px;
  position: relative;
}

.flow-node-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.flow-node-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-body);
  margin-bottom: 4px;
}

.flow-node-desc {
  font-size: 0.8rem;
  color: var(--color-body);
  opacity: 0.7;
}

.flow-arrow {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-brand);
  opacity: 0.5;
}

@media (max-width: 640px) {
  .flow-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .flow-arrow {
    transform: rotate(90deg);
    margin: 4px 0;
  }
}

/* ---------- 编号步骤 ---------- */
.step-list {
  counter-reset: step-counter;
}

.step-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 0;
  counter-increment: step-counter;
}

.step-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-size: 0.95rem;
  font-weight: 800;
}

.step-content h3 {
  margin-bottom: 4px;
  font-size: 1.05rem;
}

.step-content p {
  margin-bottom: 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* ---------- 表格 ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
}

.data-table th {
  font-weight: 700;
  color: var(--color-body);
  background: rgba(25, 21, 35, 0.03);
}

.dark-surface .data-table th,
.dark-surface .data-table td {
  color: var(--color-paper);
  border-bottom-color: rgba(245, 240, 229, 0.08);
  background: rgba(245, 240, 229, 0.04);
}

.dark-surface .data-table th {
  background: rgba(245, 240, 229, 0.08);
}

/* ---------- FAQ ---------- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item details {
  border: 1px solid rgba(25, 21, 35, 0.08);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.faq-item details[open] {
  box-shadow: 0 4px 16px rgba(25, 21, 35, 0.06);
}

.faq-item summary {
  padding: 16px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background 0.2s;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "";
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235214EB' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.2s;
}

.faq-item details[open] summary::after {
  transform: rotate(180deg);
}

.faq-item summary:hover {
  background: rgba(82, 20, 235, 0.04);
}

.faq-item summary:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--color-brand);
}

.faq-item .faq-answer {
  padding: 0 20px 16px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--color-body);
  opacity: 0.8;
}

.dark-surface .faq-item details {
  border-color: rgba(245, 240, 229, 0.1);
}

.dark-surface .faq-item summary {
  color: var(--color-paper);
}

.dark-surface .faq-item summary::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C8ED6E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

.dark-surface .faq-item summary:hover {
  background: rgba(200, 237, 110, 0.06);
}

.dark-surface .faq-item summary:focus-visible {
  box-shadow: inset 0 0 0 2px var(--color-accent);
}

.dark-surface .faq-item .faq-answer {
  color: var(--color-paper);
}

/* ---------- 新闻卡片 ---------- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
}

.news-card {
  border: 1px solid rgba(25, 21, 35, 0.06);
  border-radius: var(--radius-card);
  padding: 24px;
  transition: box-shadow 0.2s, transform 0.2s;
  background: #fff;
}

.news-card:hover {
  box-shadow: var(--card-shadow);
  transform: translateY(-2px);
}

.news-card time {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-brand);
  margin-bottom: 8px;
}

.news-card h3 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
}

.news-card p {
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 0;
  opacity: 0.75;
}

/* ---------- 提示框 ---------- */
.callout {
  border-left: 3px solid var(--color-brand);
  padding: 16px 20px;
  margin: 16px 0;
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  background: rgba(82, 20, 235, 0.04);
  font-size: 0.9rem;
  line-height: 1.7;
}

.dark-surface .callout {
  border-left-color: var(--color-accent);
  background: rgba(200, 237, 110, 0.06);
}

/* ---------- 页脚 ---------- */
.site-footer {
  background: 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: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.footer-brand img {
  width: 28px;
  height: 28px;
}

.footer-brand span {
  font-weight: 700;
  font-size: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-links a {
  font-size: 0.85rem;
  color: rgba(245, 240, 229, 0.6);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--color-accent);
}

.footer-copy {
  width: 100%;
  text-align: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(245, 240, 229, 0.08);
  font-size: 0.8rem;
  color: rgba(245, 240, 229, 0.4);
}

/* ---------- SVG 动效 ---------- */
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes floatYSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes fadeInUp {
  0%, 100% { opacity: 0.3; transform: translateY(8px); }
  50%, 80% { opacity: 1; transform: translateY(0); }
}

@keyframes breatheDots {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

@keyframes slideInRight {
  0%, 100% { opacity: 0.3; transform: translateX(12px); }
  50%, 80% { opacity: 1; transform: translateX(0); }
}

@keyframes dashFlow {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

@keyframes rotateGeo {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes rotateGeoReverse {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(-360deg); }
}

@keyframes pulseRing {
  0%, 100% { opacity: 0.15; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.08); }
}

@keyframes staggerFade {
  0%, 100% { opacity: 0.2; transform: translateY(6px); }
  30%, 70% { opacity: 1; transform: translateY(0); }
}

.anim-float {
  animation: floatY 4s ease-in-out infinite;
}

.anim-float-slow {
  animation: floatYSlow 6s ease-in-out infinite;
}

.anim-fade-in-up {
  animation: fadeInUp 5s ease-in-out infinite;
}

.anim-breathe-1 {
  animation: breatheDots 2s ease-in-out infinite 0s;
}

.anim-breathe-2 {
  animation: breatheDots 2s ease-in-out infinite 0.6s;
}

.anim-breathe-3 {
  animation: breatheDots 2s ease-in-out infinite 1.2s;
}

.anim-slide-right {
  animation: slideInRight 5s ease-in-out infinite;
}

.anim-dash-flow {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dashFlow 3s ease-in-out infinite;
}

.anim-rotate-geo {
  transform-box: fill-box;
  transform-origin: center;
  animation: rotateGeo 12s linear infinite;
}

.anim-rotate-geo-reverse {
  transform-box: fill-box;
  transform-origin: center;
  animation: rotateGeoReverse 16s linear infinite;
}

.anim-pulse-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: pulseRing 4s ease-in-out infinite;
}

.anim-stagger-1 { animation: staggerFade 6s ease-in-out infinite 0s; }
.anim-stagger-2 { animation: staggerFade 6s ease-in-out infinite 1s; }
.anim-stagger-3 { animation: staggerFade 6s ease-in-out infinite 2s; }
.anim-stagger-4 { animation: staggerFade 6s ease-in-out infinite 3s; }

/* ---------- 减少动态效果 ---------- */
@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-float,
  .anim-float-slow,
  .anim-fade-in-up,
  .anim-breathe-1,
  .anim-breathe-2,
  .anim-breathe-3,
  .anim-slide-right,
  .anim-dash-flow,
  .anim-rotate-geo,
  .anim-rotate-geo-reverse,
  .anim-pulse-ring,
  .anim-stagger-1,
  .anim-stagger-2,
  .anim-stagger-3,
  .anim-stagger-4 {
    animation: none !important;
  }
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .nav-links {
    gap: 16px;
  }
  .header-btn {
    display: none;
  }
  .paper-card {
    padding: 20px;
  }
  .news-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .nav-links a:not(.nav-download-link) {
    display: none;
  }
  h1 {
    font-size: clamp(1.8rem, 7vw, 2.6rem);
  }
}
