/* SafeW 全站共享样式 */

/* === 基础变量与重置 === */
:root {
  /* 色板 */
  --color-dark: #13102D;
  --color-paper: #F7F5F3;
  --color-text: #171523;
  --color-brand: #2714EB;
  --color-accent: #89ED6E;

  /* 设计 Token */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 1px solid rgba(23, 21, 35, 0.16);
  --card-shadow: none;
  
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  
  --content-max: 960px;
  
  /* 字体 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  --font-condensed: "Inter", var(--font-sans);
}

*, *::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: 1.55;
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}

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: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-block: var(--section-y);
  position: relative;
}

.section + .section {
  border-top: 1px solid rgba(23, 21, 35, 0.1);
}

/* 面定义：深色面与浅色面 */
.dark-surface {
  background-color: var(--color-dark);
  color: var(--color-paper);
}

.paper-surface {
  background-color: var(--color-paper);
  color: var(--color-text);
}

/* 取色系统：通过类名覆盖默认颜色变量 */
.theme-dark {
  --bg: var(--color-dark);
  --text: var(--color-paper);
  --accent: var(--color-accent);
  --brand: var(--color-accent); /* 深色面上用强调色作为品牌替代 */
}

.theme-paper {
  --bg: var(--color-paper);
  --text: var(--color-text);
  --accent: var(--color-brand); /* 纸面上用品牌色作为强调 */
  --brand: var(--color-brand);
}

/* 卡片内部恢复纸面取色（如果在深色区块内） */
.card-light {
  background-color: var(--color-paper);
  color: var(--color-text);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
}

/* === 排版 === */
.mega-label {
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: var(--gap);
  display: block;
}

.section-title {
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.25;
  letter-spacing: 0.02em;
  margin-bottom: calc(var(--gap) * 1.5);
  color: var(--text);
}

.section-title .hl {
  color: var(--accent);
}

.hero-title {
  font-family: var(--font-condensed);
  font-weight: 800;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--gap);
  color: var(--text);
}

.text-body {
  font-size: 1rem;
  line-height: 1.7;
  max-width: 38em;
  color: var(--text);
  opacity: 0.9;
}

.text-small {
  font-size: 0.875rem;
  opacity: 0.8;
}

/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}

.btn-secondary {
  background: transparent;
  border: 1px solid currentColor;
  color: var(--text);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* === 导航栏 === */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-paper);
  border-bottom: 1px solid rgba(23, 21, 35, 0.1);
  backdrop-filter: blur(8px);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 1.25rem;
}

.brand img {
  height: 32px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-text);
  opacity: 0.8;
  transition: opacity 0.2s;
}

.nav-link:hover, .nav-link[aria-current="page"] {
  opacity: 1;
  color: var(--color-brand);
}

/* === 页脚 === */
.footer {
  background-color: var(--color-dark);
  color: var(--color-paper);
  padding-block: 48px;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}

.footer-col h4 {
  font-family: var(--font-condensed);
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--color-accent);
}

.footer a {
  display: block;
  margin-bottom: 8px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.footer a:hover {
  opacity: 1;
}

/* === 组件：功能交错行 === */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 64px;
}

.feature-row.reverse {
  direction: rtl;
}

.feature-row.reverse > * {
  direction: ltr;
}

.feature-panel {
  background-color: var(--color-dark);
  border-radius: var(--radius-card);
  padding: 32px;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* === 组件：步骤条 === */
.steps-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

.step-item {
  position: relative;
  padding: 24px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.step-number {
  position: absolute;
  top: -12px;
  left: 24px;
  background-color: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
}

/* === 组件：新闻卡片 === */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.news-card {
  background-color: var(--color-paper);
  color: var(--color-text);
  border-radius: var(--radius-card);
  padding: 24px;
  border: var(--card-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s;
}

.news-card:hover {
  transform: translateY(-4px);
}

.news-date {
  font-size: 0.8rem;
  color: var(--color-brand);
  font-weight: 600;
  margin-bottom: 8px;
}

.news-title {
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 8px;
  line-height: 1.3;
}

/* === 组件：FAQ === */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

details {
  background-color: rgba(255, 255, 255, 0.5);
  border: var(--card-border);
  border-radius: 16px;
  padding: 16px 24px;
  transition: background-color 0.2s;
}

details[open] {
  background-color: #fff;
}

summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: '+';
  font-weight: 300;
  font-size: 1.5rem;
  line-height: 0;
}

details[open] summary::after {
  content: '−';
}

/* === 组件：表格 === */
.table-wrapper {
  overflow-x: auto;
  border: var(--card-border);
  border-radius: var(--radius-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(23, 21, 35, 0.08);
}

th {
  background-color: rgba(23, 21, 35, 0.03);
  font-weight: 700;
  font-family: var(--font-condensed);
}

tr:last-child th, tr:last-child td {
  border-bottom: none;
}

/* === SVG 动效 === */
.svg-anim-group {
  position: relative;
}

/* 数据点流动动画 */
@keyframes flowDash {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

.flow-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: flowDash 2s linear infinite;
}

/* 气泡浮现与漂浮 */
@keyframes bubbleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.bubble-float {
  animation: bubbleFloat 4s ease-in-out infinite;
}

@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.bubble-in {
  animation: bubbleIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* 输入中呼吸点 */
@keyframes breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.dot-breathe {
  animation: breathe 1.5s ease-in-out infinite;
}

/* 通知滑入 */
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.slide-in {
  animation: slideIn 1s 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;
    scroll-behavior: auto !important;
  }
  .flow-line, .bubble-float, .bubble-in, .dot-breathe, .slide-in {
    animation: none;
  }
}

/* === 响应式调整 === */
@media (max-width: 768px) {
  .feature-row {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .feature-row.reverse {
    direction: ltr;
  }
  .hero-title {
    font-size: 2rem;
  }
  .nav-links {
    display: none; /* 简化处理，移动端暂不展开复杂菜单 */
  }
}
