/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* 基础重置与变量 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* 色板 */
  --color-dark: #17203F;
  --color-paper: #FCFCFD;
  --color-text: #151823;
  --color-brand: #1441EB;
  --color-accent: #6EEDBD;
  --color-text-on-dark: #FCFCFD;
  --color-accent-on-dark: #6EEDBD;

  /* 结构 Token */
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 1px solid rgba(21, 24, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;

  /* 排版 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --line-height-body: 1.65;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--line-height-body);
  color: var(--color-text);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* 容器与布局 */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}

.section {
  padding-block: var(--section-y);
}

.surface-dark {
  background: var(--color-dark);
  color: var(--color-text-on-dark);
}

.surface-paper {
  background: var(--color-paper);
  color: var(--color-text);
}

.grid {
  display: grid;
  gap: var(--gap);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

/* 排版层级 */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  margin-bottom: var(--gap);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: calc(var(--gap) * 1.5);
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  margin-bottom: calc(var(--gap) * 0.8);
}

p {
  margin-bottom: var(--gap);
  max-width: 38em;
}

hl {
  font-weight: 600;
}

.surface-paper hl {
  color: var(--color-brand);
}

.surface-dark hl {
  color: var(--color-accent);
}

.label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}

.surface-paper .label {
  color: var(--color-brand);
}

.surface-dark .label {
  color: var(--color-accent);
}

/* 页头与页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-paper);
  border-bottom: 1px solid rgba(21, 24, 35, 0.08);
  backdrop-filter: blur(8px);
  transition: box-shadow 0.2s ease;
}

.site-header.scrolled {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.1rem;
}

.brand img {
  height: 32px;
  width: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: calc(var(--gap) * 1.2);
}

.nav a {
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.4rem 0;
  position: relative;
}

.nav a:hover, .nav a:focus-visible {
  color: var(--color-brand);
}

.nav a[aria-current="page"] {
  color: var(--color-brand);
  font-weight: 600;
}

.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-brand);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  height: 52px;
  padding: 0 1.4rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: 3px solid var(--color-brand);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}

.btn-primary:hover {
  background: #5DE0B0;
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid currentColor;
}

.surface-dark .btn-secondary {
  color: var(--color-text-on-dark);
}

.btn-secondary:hover {
  opacity: 0.85;
}

/* 卡片与面板 */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: calc(var(--gap) * 1.2);
  box-shadow: var(--card-shadow);
}

.panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: calc(var(--gap) * 1.5);
  overflow: hidden;
  position: relative;
}

.surface-dark .panel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 表格 */
.data-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  table-layout: fixed;
  min-width: 600px; /* 保证在小屏幕上出现横向滚动，而不是挤压撑破布局 */
}

.data-table th, .data-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(21, 24, 35, 0.1);
  text-align: left;
  min-width: 0;
  word-wrap: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table th {
  font-weight: 600;
  width: 35%;
}

.surface-dark .data-table th, .surface-dark .data-table td {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* FAQ */
.faq-item {
  border-bottom: 1px solid rgba(21, 24, 35, 0.1);
}

.faq-item summary {
  padding: 1.2rem 0;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 2rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 1.2rem;
  font-weight: 400;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  margin-top: 0.6rem;
  margin-bottom: 1.2rem;
  color: var(--color-text);
  opacity: 0.85;
}

.surface-dark .faq-item p {
  color: var(--color-text-on-dark);
}

/* 步骤条 */
.steps-row {
  display: flex;
  gap: var(--gap);
  flex-wrap: wrap;
}

.step-card {
  flex: 1 1 200px;
  counter-increment: step;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  border-radius: 6px;
  margin-bottom: 0.8rem;
}

/* 新闻卡片 */
.news-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-card time {
  font-size: 0.8rem;
  color: var(--color-brand);
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.surface-dark .news-card time {
  color: var(--color-accent);
}

.news-card p {
  flex-grow: 1;
  font-size: 0.95rem;
}

/* 流程条 */
.flow-chart {
  display: flex;
  align-items: center;
  gap: var(--gap);
  flex-wrap: wrap;
  justify-content: center;
}

.flow-node {
  flex: 1 1 180px;
  text-align: center;
  padding: 1rem;
  border-radius: var(--radius-card);
  background: rgba(21, 24, 35, 0.04);
  border: 1px solid rgba(21, 24, 35, 0.08);
}

.surface-dark .flow-node {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.flow-arrow {
  font-size: 1.5rem;
  color: var(--color-brand);
}

.surface-dark .flow-arrow {
  color: var(--color-accent);
}

/* SVG 通用约束 */
.svg-container {
  width: 100%;
  height: auto;
  max-width: 100%;
}

.svg-container svg {
  width: 100%;
  height: auto;
}

/* =========================================
   SVG 动效 Keyframes & 类名
   ========================================= */

/* 同心轨道呼吸 */
@keyframes orbit-breathe {
  0%, 100% { transform: scale(0.96); opacity: 0.6; }
  50% { transform: scale(1.02); opacity: 1; }
}

@keyframes orbit-breathe-alt {
  0%, 100% { transform: scale(0.98); opacity: 0.8; }
  50% { transform: scale(1.04); opacity: 0.5; }
}

.svg-orbit-ring {
  animation: orbit-breathe 6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.svg-orbit-ring-alt {
  animation: orbit-breathe-alt 8s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

/* 气泡浮动 */
@keyframes float-up {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.svg-bubble-1 { animation: float-up 4.5s ease-in-out infinite; }
.svg-bubble-2 { animation: float-up 5.2s ease-in-out infinite 0.8s; }
.svg-bubble-3 { animation: float-up 4.8s ease-in-out infinite 1.5s; }

/* 输入三点呼吸 */
@keyframes dot-pulse {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

.svg-input-dot {
  animation: dot-pulse 2.4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.svg-input-dot:nth-child(2) { animation-delay: 0.3s; }
.svg-input-dot:nth-child(3) { animation-delay: 0.6s; }

/* 路径描边流动 */
@keyframes path-draw {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

.svg-path-flow {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: path-draw 3s ease forwards;
}

/* 通知卡片滑入 */
@keyframes slide-in {
  0% { transform: translateX(20px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

.svg-notification {
  animation: slide-in 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* 减少动态效果 */
@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 { display: none; } /* 简化移动端，实际项目可加汉堡菜单 */
  .steps-row { flex-direction: column; }
  .flow-chart { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); margin: 0.5rem 0; }
  h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

@media (min-width: 769px) {
  .row-reverse { flex-direction: row-reverse; }
  .feature-row {
    display: flex;
    gap: var(--gap);
    align-items: center;
  }
  .feature-text { flex: 1; min-width: 0; }
  .feature-panel { flex: 1; min-width: 0; }
}

/* 兜底：裁掉横向溢出 */
div {
  overflow-x: clip;
}
