/* ============================================
   APSPRE - 主样式表
   产科抗磷脂综合征免疫机制展示页面
   基于 iPhone 17e 风格设计
   ============================================ */

/* CSS 变量定义 */
:root {
  /* 背景色 */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a25;
  --bg-elevated: #252535;
  
  /* 强调色 */
  --accent-primary: #00d4ff;
  --accent-secondary: #00d9a3;
  --accent-tertiary: #7c3aed;
  
  /* 文字色 */
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-tertiary: #6b6b7b;
  --text-muted: #4a4a5a;
  
  /* 功能色 */
  --success: #00d9a3;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #00d4ff;
  
  /* 机制专属色 */
  --complement: #00d4ff;
  --nets: #f59e0b;
  --bcells: #7c3aed;
  --nkcells: #00d9a3;
  --macrophages: #ec4899;
  
  /* 字体 */
  --font-cn: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-en: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", "Fira Code", monospace;
  
  /* 间距 */
  --space-unit: 0.25rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-10: 4rem;
  --space-12: 6rem;
  --space-16: 8rem;
  --space-20: 10rem;
  --space-24: 12rem;
  
  /* 区块间距 */
  --section-padding-y: clamp(6rem, 10vh, 12rem);
  --section-padding-x: clamp(1.5rem, 5vw, 4rem);
  
  /* 容器 */
  --content-max-width: 1200px;
  --content-narrow: 800px;
  
  /* 网格 */
  --grid-gap: 2rem;
  --card-gap: 1.5rem;
}

/* 基础重置 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-cn), var(--font-en);
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  line-height: 1.8;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: opacity 0.3s ease;
}

a:hover {
  opacity: 0.8;
}

/* 容器 */
.container {
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--section-padding-x);
}

.container-narrow {
  max-width: var(--content-narrow);
}

/* ============================================
   排版
   ============================================ */

/* Hero 标题 */
.hero-title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-secondary);
  margin-top: var(--space-4);
}

.hero-tagline {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 500;
  color: var(--accent-primary);
  margin-top: var(--space-6);
}

/* 章节标题 */
.section-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  text-align: center;
}

.section-subtitle {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-secondary);
  text-align: center;
  margin-top: var(--space-4);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* 小节标题 */
.subsection-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

/* 正文 */
.body-text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.body-text-lg {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

/* 标签 */
.label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* 数据展示 */
.stat-number {
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: var(--space-2);
}

/* 分子高亮 */
.molecule {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(0, 212, 255, 0.15);
  color: var(--accent-primary);
  font-family: var(--font-mono);
  font-size: 0.9em;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid rgba(0, 212, 255, 0.3);
}

/* ============================================
   按钮
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-primary);
  color: var(--bg-primary);
}

.btn-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.4);
  opacity: 1;
}

.btn-secondary {
  background: transparent;
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
}

.btn-secondary:hover {
  background: rgba(0, 212, 255, 0.1);
  opacity: 1;
}

/* ============================================
   卡片
   ============================================ */

.card {
  background: var(--bg-tertiary);
  border-radius: 24px;
  padding: var(--space-6);
  border: 1px solid var(--bg-elevated);
  transition: all 0.3s ease;
}

.card:hover {
  background: var(--bg-elevated);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.card-text {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ============================================
   Tab 组件
   ============================================ */

.tab-list {
  display: flex;
  gap: var(--space-2);
  background: var(--bg-secondary);
  padding: var(--space-2);
  border-radius: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.tab {
  padding: var(--space-3) var(--space-5);
  border-radius: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  background: transparent;
  font-size: 1rem;
}

.tab:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.tab.active {
  background: var(--accent-primary);
  color: var(--bg-primary);
}

.tab-content {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;
}

.tab-content.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   徽章/标签
   ============================================ */

.badge {
  display: inline-flex;
  padding: 0.5rem 1rem;
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent-primary);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 100px;
  border: 1px solid rgba(0, 212, 255, 0.2);
}

/* 机制专属徽章 */
.badge-complement { background: rgba(0, 212, 255, 0.1); color: var(--complement); border-color: rgba(0, 212, 255, 0.2); }
.badge-nets { background: rgba(245, 158, 11, 0.1); color: var(--nets); border-color: rgba(245, 158, 11, 0.2); }
.badge-bcells { background: rgba(124, 58, 237, 0.1); color: var(--bcells); border-color: rgba(124, 58, 237, 0.2); }
.badge-nkcells { background: rgba(0, 217, 163, 0.1); color: var(--nkcells); border-color: rgba(0, 217, 163, 0.2); }
.badge-macrophages { background: rgba(236, 72, 153, 0.1); color: var(--macrophages); border-color: rgba(236, 72, 153, 0.2); }

/* ============================================
   网格布局
   ============================================ */

.grid {
  display: grid;
  gap: var(--grid-gap);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Flex 布局 */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.text-center {
  text-align: center;
}

.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ============================================
   区块样式
   ============================================ */

.section {
  padding: var(--section-padding-y) 0;
  position: relative;
}

.section-alt {
  background: var(--bg-secondary);
}

/* Hero 区块 */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
  position: relative;
  overflow: hidden;
}

.hero-content {
  text-align: center;
  max-width: 900px;
  padding: var(--space-8);
  position: relative;
  z-index: 2;
}

.hero-description {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 700px;
  margin: var(--space-8) auto;
}

.hero-buttons {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--space-8);
}

/* Highlights 区块 */
.highlights {
  background: var(--bg-secondary);
}

.highlights-tabs {
  margin-top: var(--space-12);
}

.highlights-content {
  margin-top: var(--space-10);
}

/* 内容区块 */
.content-section {
  padding: var(--section-padding-y) 0;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
  margin-top: var(--space-12);
}

@media (max-width: 768px) {
  .content-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

/* ============================================
   页脚
   ============================================ */

.footer {
  background: var(--bg-secondary);
  padding: var(--space-12) 0;
  border-top: 1px solid var(--bg-elevated);
}

.footer-content {
  text-align: center;
}

.footer-citation {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  font-style: italic;
  margin-bottom: var(--space-4);
}

.footer-links {
  display: flex;
  gap: var(--space-6);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--space-6);
}

.footer-link {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.footer-copyright {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-8);
}

/* ============================================
   动画
   ============================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.animate-fadeInUp {
  animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fadeIn {
  animation: fadeIn 0.6s ease-out forwards;
}

.animate-slideInLeft {
  animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slideInRight {
  animation: slideInRight 0.8s ease-out forwards;
}

/* 延迟类 */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }

/* 初始隐藏（用于滚动触发） */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   工具类
   ============================================ */

.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }

.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   响应式调整
   ============================================ */

@media (max-width: 640px) {
  :root {
    --section-padding-y: 4rem;
    --section-padding-x: 1rem;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.25rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .tab-list {
    flex-direction: column;
  }
  
  .tab {
    width: 100%;
    text-align: center;
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 280px;
  }
}

/* 减少动画（用户偏好） */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
