/* =========================================
   SafeW 全站共享样式 (style.css)
   ========================================= */

/* --- 设计 Token 与变量 --- */
:root {
  /* 色板 */
  --color-dark-bg: #10112D;
  --color-paper: #F5F0E5;
  --color-text-main: #151523;
  --color-brand: #1416EB;
  --color-accent: #89ED6E;

  /* 派生颜色 */
  --color-white-for-dark: var(--color-paper);
  --color-shadow-body: rgba(21, 21, 35, 0.3);

  /* 圆角 */
  --radius-card: 24px;
  --radius-btn: 999px;

  /* 卡片边界与阴影 */
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px var(--color-shadow-body);

  /* 节奏与密度 */
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --line-height-base: 1.75;

  /* 内容最大宽度 */
  --content-max: 1280px;

  /* 字体 */
  --font-sans: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* --- 基础重置与排版 --- */
*, *::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: var(--line-height-base);
  color: var(--color-text-main);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 4px;
  border-radius: 4px;
}

/* --- 布局容器 --- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}

.section-divider {
  width: 100%;
  height: 1px;
  background-color: rgba(21, 21, 35, 0.1);
  border: none;
}

.dark-section {
  background-color: var(--color-dark-bg);
  color: var(--color-white-for-dark);
}

/* --- 页头与页脚 --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(245, 240, 229, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(21, 21, 35, 0.05);
  padding-block: 16px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.brand-logo img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 24px;
}

.main-nav a {
  font-weight: 500;
  font-size: 0.95rem;
  padding-block: 4px;
}

.main-nav a[aria-current="page"] {
  color: var(--color-brand);
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-footer {
  background-color: var(--color-dark-bg);
  color: var(--color-paper);
  padding-block: 64px;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
  margin-bottom: 48px;
}

.footer-col h4 {
  color: var(--color-accent);
  margin-bottom: 16px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a:hover {
  color: var(--color-accent);
}

.footer-bottom {
  border-top: 1px solid rgba(245, 240, 229, 0.1);
  padding-top: 32px;
  text-align: center;
  color: rgba(245, 240, 229, 0.5);
}

/* --- 组件：按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding-inline: 24px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  border: none;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark-bg);
}

.btn-primary:hover {
  background-color: #7be05d;
}

.btn-secondary {
  background-color: transparent;
  border: 1px solid var(--color-text-main);
  color: var(--color-text-main);
}

.btn-secondary:hover {
  background-color: rgba(21, 21, 35, 0.05);
}

.dark-section .btn-secondary {
  border-color: var(--color-white-for-dark);
  color: var(--color-white-for-dark);
}

.dark-section .btn-secondary:hover {
  background-color: rgba(245, 240, 229, 0.1);
}

/* --- 组件：卡片 --- */
.card {
  background-color: #FFFFFF;
  border-radius: var(--radius-card);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
  box-shadow: 0 14px 32px -12px var(--color-shadow-body);
  transform: translateY(-2px);
}

.dark-section .card {
  background-color: var(--color-paper);
  color: var(--color-text-main);
}

/* --- 组件：表格 --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid rgba(21, 21, 35, 0.1);
}

.data-table th {
  font-weight: 700;
  color: var(--color-brand);
}

.dark-section .data-table th {
  color: var(--color-accent);
}

.dark-section .data-table td,
.dark-section .data-table th {
  border-bottom-color: rgba(245, 240, 229, 0.1);
}

/* --- 组件：FAQ --- */
.faq-item {
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(21, 21, 35, 0.1);
  padding-bottom: 16px;
}

.dark-section .faq-item {
  border-bottom-color: rgba(245, 240, 229, 0.1);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.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;
  color: rgba(21, 21, 35, 0.8);
  line-height: 1.7;
}

.dark-section .faq-item p {
  color: rgba(245, 240, 229, 0.8);
}

/* --- 组件：眉标 --- */
.section-eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: 16px;
  white-space: nowrap;
}

.dark-section .section-eyebrow {
  color: var(--color-accent);
}

/* --- 组件：标题 --- */
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
  margin-bottom: 32px;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.highlight {
  color: var(--color-brand);
}

.dark-section .highlight {
  color: var(--color-accent);
}

/* --- 布局辅助 --- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--gap);
}

.flex-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  align-items: center;
}

.text-center {
  text-align: center;
}

.mt-lg {
  margin-top: var(--gap);
}

.mb-md {
  margin-bottom: 24px;
}

.max-w-prose {
  max-width: 38em;
}

/* --- 功能带横向滚动 --- */
.feature-scroll-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-brand) transparent;
}

.feature-scroll-wrapper::-webkit-scrollbar {
  height: 6px;
}

.feature-scroll-wrapper::-webkit-scrollbar-thumb {
  background-color: var(--color-brand);
  border-radius: 4px;
}

.feature-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background-color: rgba(20, 22, 235, 0.08);
  border-radius: var(--radius-btn);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-text-main);
  white-space: nowrap;
}

.dark-section .feature-pill {
  background-color: rgba(137, 237, 110, 0.1);
  color: var(--color-white-for-dark);
}

/* --- SVG 动效系统 --- */
.hero-svg {
  width: 100%;
  height: auto;
  max-width: 600px;
  margin-inline: auto;
}

@keyframes float-slow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes float-fast {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes draw-line {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

@keyframes bubble-pop {
  0% { opacity: 0; transform: scale(0.9) translateY(4px); }
  15% { opacity: 1; transform: scale(1) translateY(0); }
  85% { opacity: 1; transform: scale(1) translateY(0); }
  100% { opacity: 0; transform: scale(0.9) translateY(4px); }
}

@keyframes input-breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.float-slow {
  animation: float-slow 6s ease-in-out infinite;
}

.float-fast {
  animation: float-fast 4.5s ease-in-out infinite;
  animation-delay: 1s;
}

.draw-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-line 3s ease forwards;
}

.bubble-pop {
  animation: bubble-pop 4s ease-in-out infinite;
}

.bubble-pop.delay-1 { animation-delay: 1.3s; }
.bubble-pop.delay-2 { animation-delay: 2.6s; }

.input-breathe {
  animation: input-breathe 2s ease-in-out infinite;
}

/* --- 减少动态效果 --- */
@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;
  }
  
  .hero-svg {
    animation: none !important;
  }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
