/* =========================================
   SafeW 全站共享样式
   ========================================= */

/* 0. 基础重置与变量 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
  color: var(--surface-text);
  background-color: var(--surface-bg);
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--surface-link);
  text-decoration: none;
  transition: opacity 0.2s ease;
}
a:hover { opacity: 0.85; }
a:focus-visible { outline: 2px solid var(--surface-accent); outline-offset: 4px; border-radius: 2px; }

ul, ol { list-style: none; }

/* 设计 Token */
:root {
  --color-dark: #13102D;
  --color-paper: #F7F5F3;
  --color-text: #171523;
  --color-brand: #2714EB;
  --color-accent: #89ED6E;
  
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(23, 21, 35, 0.3);
  
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;
  
  /* 默认纸面取色 */
  --surface-bg: var(--color-paper);
  --surface-text: var(--color-text);
  --surface-heading: var(--color-text);
  --surface-accent: var(--color-brand);
  --surface-link: var(--color-brand);
}

[data-surface="dark"] {
  --surface-bg: var(--color-dark);
  --surface-text: var(--color-paper);
  --surface-heading: var(--color-paper);
  --surface-accent: var(--color-accent);
  --surface-link: var(--color-accent);
}

.card-light {
  background: var(--color-paper);
  color: var(--color-text);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  border: var(--card-border);
}

/* 1. 排版系统 */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section-wrapper {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

.label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--surface-accent);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--surface-heading);
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.25;
  color: var(--surface-heading);
  margin-bottom: 1.2rem;
  text-wrap: balance;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--surface-heading);
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
  color: var(--surface-text);
}

.hl {
  color: var(--surface-accent);
}

/* 2. 布局网格 */
.module-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}
.module-grid.reverse .grid-text { order: 2; }
.module-grid.reverse .grid-visual { order: 1; }

@media (max-width: 900px) {
  .module-grid, .module-grid.reverse {
    grid-template-columns: 1fr;
  }
  .module-grid.reverse .grid-text { order: 1; }
  .module-grid.reverse .grid-visual { order: 2; }
}

/* 3. 组件：按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 52px;
  padding: 0 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  border: none;
  text-decoration: none;
}
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(137, 237, 110, 0.35);
}
.btn-secondary {
  background: transparent;
  color: var(--surface-text);
  border: 1.5px solid currentColor;
}
.btn-secondary:hover {
  background: rgba(128,128,128,0.08);
}
.btn-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

/* 4. 组件：卡片与面板 */
.visual-panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.panel-inner {
  width: 100%;
  height: 100%;
}

.feature-card {
  background: var(--surface-bg);
  border: 1px solid rgba(128,128,128,0.15);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  margin-bottom: var(--gap);
}

/* 5. 组件：表格 */
.platform-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  color: var(--surface-text);
}
.platform-table th, .platform-table td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(128,128,128,0.2);
}
.platform-table th {
  font-weight: 600;
  color: var(--surface-heading);
}

/* 6. 组件：FAQ */
.faq-item {
  border-bottom: 1px solid rgba(128,128,128,0.2);
  margin-bottom: 0.5rem;
}
.faq-item summary {
  padding: 1rem 0;
  cursor: pointer;
  font-weight: 600;
  color: var(--surface-heading);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--surface-accent);
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p {
  padding-bottom: 1rem;
  color: var(--surface-text);
  line-height: 1.7;
}

/* 7. SVG 动效核心 */
svg.anim-svg {
  width: 100%;
  height: auto;
}

/* 描边绘制 */
@keyframes drawLine {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}
.draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* 几何旋转拼合 */
@keyframes geoRotate {
  0%, 100% { transform: rotate(0deg) translateX(0); }
  50% { transform: rotate(12deg) translateX(4px); }
}
.geo-shape {
  transform-box: fill-box;
  transform-origin: center;
  animation: geoRotate 6s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

/* 气泡漂浮 */
@keyframes floatBubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.float { animation: floatBubble 4s ease-in-out infinite; }

/* 呼吸点 */
@keyframes breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
.breathe { animation: breathe 2s ease-in-out infinite; }
.breathe-delay-1 { animation-delay: 0.4s; }
.breathe-delay-2 { animation-delay: 0.8s; }

/* 滑入 */
@keyframes slideIn {
  0%, 100% { transform: translateX(0); opacity: 0.8; }
  50% { transform: translateX(8px); opacity: 1; }
}
.slide { animation: slideIn 5s 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;
  }
  .draw, .geo-shape, .float, .breathe, .slide {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* 8. 响应式微调 */
@media (max-width: 600px) {
  h1 { font-size: clamp(2rem, 8vw, 3rem); }
  .btn { width: 100%; }
  .platform-table { font-size: 0.85rem; }
}
