/* =========================================
   SafeW 全站共享样式 (style.css)
   ========================================= */

/* --- 设计 Token & 变量 --- */
:root {
  /* 颜色体系 */
  --color-dark-surface: #21163C;
  --color-paper-surface: #E9E8EA;
  --color-text-primary: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED926E;

  /* 结构与尺寸 */
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
  --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, Arial, sans-serif;
  --lh-tight: 1.1;
  --lh-normal: 1.65;
}

/* --- 基础重置 --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-paper-surface);
  color: var(--color-text-primary);
  line-height: var(--lh-normal);
  font-size: 16px;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}

ul, ol {
  list-style: none;
}

/* --- 通用容器 --- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding-left: var(--gap);
  padding-right: var(--gap);
}

/* --- 区块结构 --- */
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  position: relative;
}

.section + .section {
  border-top: 1px solid rgba(25, 21, 35, 0.1);
}

/* 深色面区块 */
.section.dark {
  background-color: var(--color-dark-surface);
  color: var(--color-paper-surface);
}
.section.dark .section-title,
.section.dark .section-desc,
.section.dark h3,
.section.dark p {
  color: var(--color-paper-surface);
}
.section.dark .section-subtitle {
  color: var(--color-accent);
}
.section.dark .hl {
  color: var(--color-accent);
}
.section.dark .btn-secondary {
  color: var(--color-paper-surface);
  border-color: var(--color-paper-surface);
}
.section.dark .btn-secondary:hover {
  background-color: rgba(233, 232, 234, 0.1);
}
.section.dark .card {
  background-color: var(--color-paper-surface);
  color: var(--color-text-primary);
  box-shadow: var(--card-shadow);
}
.section.dark .card .section-subtitle {
  color: var(--color-brand);
}
.section.dark .card .hl {
  color: var(--color-brand);
}

/* --- 标题系统 --- */
.section-subtitle {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-subtitle::before {
  content: '';
  display: block;
  width: 16px;
  height: 2px;
  background-color: currentColor;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  color: var(--color-paper-surface);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  color: var(--color-text-primary);
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  color: inherit;
}

p {
  margin-bottom: 1rem;
  max-width: 38em;
}

.hl {
  color: var(--color-brand);
}

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark-surface);
  box-shadow: 0 4px 12px rgba(237, 146, 110, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(237, 146, 110, 0.4);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text-primary);
  border: 2px solid var(--color-text-primary);
}
.btn-secondary:hover {
  background-color: rgba(25, 21, 35, 0.05);
  transform: translateY(-2px);
}

/* --- 卡片 --- */
.card {
  background-color: #fff;
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 24px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px -12px rgba(25, 21, 35, 0.35);
}

/* --- 表格 --- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-card);
  border: 1px solid rgba(25, 21, 35, 0.1);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 500px;
}
th, td {
  padding: 16px 24px;
  text-align: left;
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
}
th {
  background-color: rgba(25, 21, 35, 0.03);
  font-weight: 700;
  color: var(--color-text-primary);
}
td {
  color: var(--color-text-primary);
}
tr:last-child th, tr:last-child td {
  border-bottom: none;
}

/* --- FAQ --- */
.faq-item {
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
  padding: 1.5rem 0;
}
details summary {
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-text-primary);
}
details summary::-webkit-details-marker {
  display: none;
}
details summary::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--color-brand);
  transition: transform 0.3s ease;
}
details[open] summary::after {
  transform: rotate(45deg);
}
details p {
  margin-top: 1rem;
  color: var(--color-text-primary);
  opacity: 0.9;
}

/* --- 页头页脚 --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(233, 232, 234, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
  padding: 16px 0;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--color-text-primary);
}
.brand-logo img {
  width: 32px;
  height: 32px;
}
.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}
.nav-link {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text-primary);
  opacity: 0.7;
  transition: opacity 0.2s;
}
.nav-link:hover, .nav-link[aria-current="page"] {
  opacity: 1;
  color: var(--color-brand);
}

.site-footer {
  background-color: var(--color-dark-surface);
  color: var(--color-paper-surface);
  padding: 64px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 48px;
  margin-bottom: 48px;
}
.footer-col h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--color-accent);
}
.footer-col ul li {
  margin-bottom: 0.75rem;
}
.footer-col a {
  opacity: 0.8;
  font-size: 0.9rem;
}
.footer-col a:hover {
  opacity: 1;
  color: var(--color-accent);
}
.footer-bottom {
  border-top: 1px solid rgba(233, 232, 234, 0.1);
  padding-top: 32px;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.6;
}

/* --- SVG 动效方向 --- */
.svg-icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* 气泡浮现 */
@keyframes bubble-float {
  0%, 100% { transform: translateY(0); opacity: 0.8; }
  50% { transform: translateY(-8px); opacity: 1; }
}
.anim-bubble-1 { animation: bubble-float 4s ease-in-out infinite; }
.anim-bubble-2 { animation: bubble-float 5s ease-in-out infinite 1s; }
.anim-bubble-3 { animation: bubble-float 4.5s ease-in-out infinite 2s; }

/* 输入点呼吸 */
@keyframes dot-breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
.anim-dot { animation: dot-breathe 1.5s ease-in-out infinite; }
.anim-dot:nth-child(2) { animation-delay: 0.2s; }
.anim-dot:nth-child(3) { animation-delay: 0.4s; }

/* 描边流动 */
@keyframes flow-line {
  to { stroke-dashoffset: -100; }
}
.anim-flow {
  stroke-dasharray: 10;
  animation: flow-line 2s linear infinite;
}

/* 卡片层叠漂浮 */
@keyframes card-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}
.anim-card-stack {
  animation: card-float 6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

/* 减少动态效果偏好 */
@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;
  }
}

/* --- 响应式 --- */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; gap: 16px; }
  .nav-links { gap: 16px; }
  h1 { font-size: clamp(2rem, 8vw, 3rem); }
  .two-col { grid-template-columns: 1fr !important; }
}
