/* =========================================
   SafeW 全站共享样式 (style.css)
   ========================================= */

/* --- 1. 设计变量与重置 --- */
:root {
  /* 品牌色板 */
  --color-dark: #21163C;       /* 深色面底色 */
  --color-paper: #E9E8EA;      /* 浅色纸面底色 */
  --color-text: #191523;       /* 正文文字颜色 */
  --color-brand: #5214EB;      /* 品牌强调色（链接、图标） */
  --color-accent: #ED926E;     /* 行动点颜色（按钮、徽标） */

  /* 结构变量 */
  --content-max: 1120px;       /* 内容最大宽度 */
  --gap: clamp(1rem, 2vw, 1.75rem);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  
  /* 圆角与阴影 */
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.15);
  --card-shadow-hover: 0 14px 32px -12px rgba(25, 21, 35, 0.25);

  /* 字体 */
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  font-size: 17px;
  line-height: 1.7;
  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;
}

/* --- 2. 排版系统 --- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

.section-dark {
  background-color: var(--color-dark);
  color: var(--color-paper);
}

.section-paper {
  background-color: var(--color-paper);
  color: var(--color-text);
}

/* 眉标 */
.breadcrumb-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

.section-paper .breadcrumb-label {
  color: var(--color-brand);
}

.section-dark .breadcrumb-label {
  color: var(--color-accent);
}

/* 标题 */
h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  margin-bottom: 1.5rem;
}

h3 {
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  margin-bottom: 0.75rem;
}

.highlight {
  color: var(--color-brand);
}

.section-dark .highlight {
  color: var(--color-accent);
}

p {
  margin-bottom: 1.5rem;
  max-width: 38em;
}

/* --- 3. 组件：按钮 --- */
.btn-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.8rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  cursor: pointer;
  min-height: 48px;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
  border: none;
}

.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);
  border: 2px solid var(--color-text);
}

.section-dark .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

.btn-secondary:hover {
  background-color: rgba(25, 21, 35, 0.05);
  transform: translateY(-2px);
}

.section-dark .btn-secondary:hover {
  background-color: rgba(233, 232, 234, 0.1);
}

.btn-icon {
  width: 20px;
  height: 20px;
  margin-right: 0.6rem;
  stroke-width: 2;
}

/* --- 4. 组件：卡片 --- */
.card {
  background-color: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 2rem;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.section-dark .card {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-4px);
}

/* --- 5. 布局网格 --- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

.flex-row {
  display: flex;
  gap: var(--gap);
  align-items: center;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

/* --- 6. 导航与页脚 --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding: 1rem 0;
}

.section-dark ~ .site-header {
  background-color: rgba(33, 22, 60, 0.95);
  border-bottom-color: rgba(255,255,255,0.1);
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo img {
  height: 32px;
  width: auto;
}

.main-nav ul {
  display: flex;
  gap: 2rem;
}

.main-nav a {
  font-weight: 500;
  font-size: 0.95rem;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.main-nav a:hover, .main-nav a[aria-current="page"] {
  opacity: 1;
  color: var(--color-brand);
}

.section-dark .main-nav a {
  color: var(--color-paper);
}

.section-dark .main-nav a:hover, .section-dark .main-nav a[aria-current="page"] {
  color: var(--color-accent);
}

.site-footer {
  padding: 3rem 0;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.7;
  border-top: 1px solid rgba(0,0,0,0.05);
}

.section-dark .site-footer {
  border-top-color: rgba(255,255,255,0.1);
}

/* --- 7. 特殊区块组件 --- */

/* 时间轴 */
.timeline-item {
  display: flex;
  gap: 2rem;
  margin-bottom: 3rem;
  position: relative;
}

.timeline-marker {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  background-color: var(--color-accent);
  color: var(--color-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  z-index: 2;
}

.timeline-content h3 {
  margin-bottom: 0.5rem;
}

/* 表格 */
.table-wrapper {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.platform-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  margin-top: 1.5rem;
  font-size: 0.95rem;
}

.platform-table th, .platform-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  white-space: nowrap;
}

.section-dark .platform-table th, 
.section-dark .platform-table td {
  border-bottom-color: rgba(255,255,255,0.1);
}

.platform-table th {
  font-weight: 700;
  color: var(--color-brand);
}

.section-dark .platform-table th {
  color: var(--color-accent);
}

/* FAQ */
details {
  background-color: rgba(255,255,255,0.05);
  border-radius: var(--radius-card);
  margin-bottom: 1rem;
  overflow: hidden;
}

.summary {
  padding: 1.2rem;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary::-webkit-details-marker {
  display: none;
}

.summary::after {
  content: "+";
  font-size: 1.5rem;
  font-weight: 300;
}

details[open] .summary::after {
  content: "-";
}

.details-content {
  padding: 0 1.2rem 1.2rem;
  opacity: 0.9;
  line-height: 1.6;
}

/* --- 8. SVG 动效定义 --- */

/* 绘制线条动画 */
@keyframes draw-line {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

.anim-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-line 4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* 浮动动画 */
@keyframes float-up {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.anim-float {
  animation: float-up 6s ease-in-out infinite;
}

/* 呼吸动画 */
@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.anim-breathe {
  animation: breathe 4s ease-in-out infinite;
}

/* 旋转拼合动画 */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.anim-spin {
  transform-box: fill-box;
  transform-origin: center;
  animation: spin-slow 20s linear infinite;
}

.anim-spin-reverse {
  transform-box: fill-box;
  transform-origin: center;
  animation: spin-slow 25s linear infinite reverse;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .flex-row {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .timeline-item {
    flex-direction: column;
    gap: 1rem;
  }
  
  .nav-inner {
    flex-direction: column;
    gap: 1rem;
  }
  
  .main-nav ul {
    gap: 1rem;
  }
}

/* 减少动态效果偏好设置 */
@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;
  }
}

/* 兜底：裁掉横向溢出 */
div.container,
div.card {
  overflow-x: clip;
}
