/* =========================================
   SafeW 全站共享样式
   ========================================= */

:root {
  /* 色板 */
  --color-dark: #1B1231;
  --color-paper: #F4F3F7;
  --color-body: #191523;
  --color-brand: #5214EB;
  --color-accent: #9977EE;

  /* 卡片与分层底色（不覆盖变量，仅用于容器内区分） */
  --surface-card-dark: #241942;
  --surface-card-paper: #E8E6ED;

  /* 结构 Token */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 960px;

  /* 排版 */
  --font-main: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --lh-body: 1.55;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: var(--lh-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 {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* 页面区块 */
.section {
  padding: var(--section-y) 0;
}
.section--dark {
  background-color: var(--color-dark);
  color: var(--color-paper);
}
.section--paper {
  background-color: var(--color-paper);
  color: var(--color-body);
}

/* 眉标 */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: var(--gap);
}
.section--paper .eyebrow { color: var(--color-brand); }
.section--dark .eyebrow { color: var(--color-accent); }
.eyebrow::before {
  content: "";
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

/* 标题 */
h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: var(--gap);
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: var(--gap);
}
h3 {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: calc(var(--gap) / 1.5);
}
.hl {
  color: var(--color-brand);
}
.section--dark .hl {
  color: var(--color-accent);
}

/* 文本段落 */
.text-lg {
  font-size: clamp(1.05rem, 1.2vw, 1.15rem);
  max-width: 38em;
}
.text-muted {
  opacity: 0.85;
  font-size: 0.9rem;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  border: none;
}
.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.btn--primary:hover { background-color: #8A66E8; }
.btn--secondary {
  background: transparent;
  border: 1.5px solid var(--color-body);
  color: var(--color-body);
}
.section--dark .btn--secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}
.section--dark .btn--secondary:hover { background-color: rgba(255,255,255,0.08); }

/* 卡片（无描边无阴影，靠底色区分） */
.card {
  background-color: var(--surface-card-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
}
.section--dark .card {
  background-color: var(--surface-card-dark);
}

/* 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.section--dark .data-table th, .section--dark .data-table td {
  border-bottom-color: rgba(255,255,255,0.1);
}
.data-table th { font-weight: 600; width: 40%; }
.data-table tr:last-child td { border-bottom: none; }

/* FAQ */
.faq-item {
  border-bottom: 1px solid rgba(0,0,0,0.1);
  padding: 16px 0;
}
.section--dark .faq-item { border-bottom-color: rgba(255,255,255,0.1); }
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.2rem;
  font-weight: 400;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p {
  margin-top: 12px;
  line-height: var(--lh-body);
  opacity: 0.9;
}

/* 新闻卡片 */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--gap);
}
.news-card {
  background-color: var(--surface-card-paper);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.section--dark .news-card { background-color: var(--surface-card-dark); }
.news-card time {
  font-size: 0.8rem;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

/* 步骤列表 */
.step-list {
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
.step-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background-color: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 0.9rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
}
.step-content { padding-top: 4px; }

/* 页头 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(244, 243, 247, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.section--dark .site-header {
  background-color: rgba(27, 18, 49, 0.92);
  border-bottom-color: rgba(255,255,255,0.08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
}
.logo img { height: 28px; width: auto; }
.nav-links {
  display: flex;
  gap: 24px;
  font-size: 0.95rem;
}
.nav-links a { opacity: 0.85; transition: opacity 0.2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { opacity: 1; color: var(--color-brand); }
.section--dark .nav-links a { color: var(--color-paper); }
.section--dark .nav-links a:hover, .section--dark .nav-links a[aria-current="page"] { color: var(--color-accent); }

/* 页脚 */
.site-footer {
  padding: 48px 0 32px;
  border-top: 1px solid rgba(0,0,0,0.08);
  font-size: 0.9rem;
  opacity: 0.9;
}
.section--dark .site-footer { border-top-color: rgba(255,255,255,0.1); }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}
.footer-col h4 { font-size: 0.85rem; font-weight: 700; margin-bottom: 12px; opacity: 0.8; }
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col a:hover { text-decoration: underline; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid rgba(0,0,0,0.06);
  font-size: 0.8rem;
  opacity: 0.7;
}
.section--dark .footer-bottom { border-top-color: rgba(255,255,255,0.06); }

/* 响应式适配 */
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 12px 0; }
  .nav-links { order: 3; width: 100%; justify-content: center; margin-top: 8px; }
  .hero-layout { flex-direction: column; }
  .text-image-row { flex-direction: column; }
  .visual-panel { order: -1; }
}

/* =========================================
   SVG 动效体系
   ========================================= */
.svg-visual {
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* 连线流动 */
@keyframes dash-flow {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dash-flow 3s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

/* 气泡浮现与漂浮 */
@keyframes bubble-in {
  0% { opacity: 0; transform: translateY(8px); }
  20% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-6px); }
}
.anim-bubble {
  animation: bubble-in 5s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.anim-bubble:nth-child(2) { animation-delay: 1.2s; }
.anim-bubble:nth-child(3) { animation-delay: 2.4s; }

/* 输入呼吸点 */
@keyframes breath-dot {
  0%, 100% { opacity: 0.3; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}
.anim-breathe {
  animation: breath-dot 2.4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.anim-breathe:nth-child(2) { animation-delay: 0.4s; }
.anim-breathe:nth-child(3) { animation-delay: 0.8s; }

/* 通知滑入 */
@keyframes slide-in {
  0% { opacity: 0; transform: translateX(12px); }
  15% { opacity: 1; transform: translateX(0); }
  85% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(12px); }
}
.anim-slide {
  animation: slide-in 6s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  transform-box: fill-box;
  transform-origin: center;
}

/* 星点明灭 */
@keyframes twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.9; }
}
.anim-star {
  animation: twinkle 4s ease-in-out infinite;
}
.anim-star:nth-child(odd) { animation-delay: 1s; }

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  [class*="anim-"] {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .svg-visual { height: auto; }
}
