/* =========================================
   SafeW 全站共享样式
   ========================================= */

:root {
  /* 色板 */
  --color-dark: #13102D;
  --color-paper: #D6D4ED;
  --color-text: #171523;
  --color-brand: #2714EB;
  --color-accent: #89ED6E;

  /* 面取色变量 */
  --color-bg: var(--color-paper);
  --color-fg: var(--color-text);
  --color-link: var(--color-brand);
  --color-badge: var(--color-brand);
  --color-hl: var(--color-brand);

  /* 设计 Token */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(23, 21, 35, 0.3);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1280px;

  /* 排版 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --line-height-body: 1.55;
  --line-height-title: 1.1;
}

/* 深色面覆盖 */
.bg-dark {
  --color-bg: #13102D;
  --color-fg: #EAEAF5;
  --color-link: var(--color-accent);
  --color-badge: var(--color-accent);
  --color-hl: var(--color-accent);
  --card-shadow: 0 10px 28px -14px rgba(0, 0, 0, 0.5);
}

/* 基础重置 */
*, *::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-fg);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  opacity: 0.85;
}

ul, ol {
  list-style: none;
}

/* 布局容器 */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

/* 排版层级 */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--color-badge);
  margin-bottom: var(--gap);
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: var(--line-height-title);
  letter-spacing: -0.02em;
  margin-bottom: var(--gap);
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: var(--gap);
  text-wrap: balance;
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: calc(var(--gap) * 0.75);
}

p {
  margin-bottom: calc(var(--gap) * 0.75);
  max-width: 38em;
}

.hl {
  color: var(--color-hl);
}

/* 按钮组件 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  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;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(137, 237, 110, 0.4);
}

.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--color-fg);
  color: var(--color-fg);
}

.bg-dark .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}

.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* 卡片与面板 */
.card {
  background-color: var(--color-bg);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: calc(var(--gap) * 1.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px -12px rgba(23, 21, 35, 0.4);
}

.panel {
  background-color: var(--color-dark);
  border-radius: var(--radius-card);
  padding: calc(var(--gap) * 2);
  position: relative;
  overflow: hidden;
}

/* 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--gap);
  background: var(--color-bg);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.data-table th, .data-table td {
  padding: 16px 24px;
  text-align: left;
  border-bottom: 1px solid rgba(23, 21, 35, 0.1);
}

.bg-dark .data-table th, .bg-dark .data-table td {
  border-bottom-color: rgba(214, 212, 237, 0.15);
}

.data-table th {
  font-weight: 700;
  background-color: rgba(23, 21, 35, 0.05);
}

.bg-dark .data-table th {
  background-color: rgba(214, 212, 237, 0.1);
}

/* 步骤条 */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--gap);
}

.step-item {
  counter-increment: step-counter;
  position: relative;
  padding-left: 48px;
}

.step-num {
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  max-width: 720px;
}

.faq-item {
  background: rgba(23, 21, 35, 0.04);
  border-radius: 16px;
  overflow: hidden;
}

.bg-dark .faq-item {
  background: rgba(214, 212, 237, 0.08);
}

.faq-item summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-weight: 300;
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  padding: 0 20px 16px 20px;
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.9;
}

/* 页头页脚 */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid rgba(23, 21, 35, 0.1);
  backdrop-filter: blur(8px);
}

.bg-dark .header {
  border-bottom-color: rgba(214, 212, 237, 0.15);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--color-fg);
}

.logo img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: calc(var(--gap) * 1.5);
  align-items: center;
}

.nav-links a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-fg);
  opacity: 0.85;
}

.nav-links a:hover {
  opacity: 1;
}

.nav-links a[aria-current="page"] {
  opacity: 1;
  font-weight: 700;
  color: var(--color-hl);
}

.footer {
  border-top: 1px solid rgba(23, 21, 35, 0.1);
  padding: 48px 0;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.8;
}

.bg-dark .footer {
  border-top-color: rgba(214, 212, 237, 0.15);
}

/* SVG 动效系统 */
.svg-container {
  width: 100%;
  height: auto;
}

.orbit-ring {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.breathe-orbit {
  animation: breatheOrbit 6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.float-element {
  animation: floatUp 5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.draw-path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawStroke 4s ease-out forwards;
}

.pulse-dot {
  animation: pulseDot 3s ease-in-out infinite;
}

.slide-in {
  animation: slideIn 5s ease-out forwards;
}

@keyframes breatheOrbit {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.04); opacity: 0.9; }
}

@keyframes floatUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes drawStroke {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes slideIn {
  0% { transform: translateX(24px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
}

/* 响应式微调 */
@media (max-width: 768px) {
  .nav-links { gap: var(--gap); }
  .header-inner { flex-wrap: wrap; height: auto; padding: 12px 0; }
  h1 { font-size: clamp(2rem, 8vw, 3rem); }
  .steps-grid { grid-template-columns: 1fr; }
}
