/* ========================================
   某某碳核算机构 - 主样式表
   主题: 数据驱动的可持续未来
   配色: 翠绿/森林绿/科技青
   ======================================== */

/* CSS 变量定义 */
:root {
  /* 主色调 - 森林绿系列 */
  --color-deep: #021C0E;
  --color-forest: #064E3B;
  --color-primary: #059669;
  --color-emerald: #10B981;
  --color-bright: #34D399;
  --color-mint: #6EE7B7;
  --color-pale: #A7F3D0;
  --color-bg-soft: #ECFDF5;
  --color-bg-pale: #F0FDF4;

  /* 强调色 */
  --color-cyan: #0891B2;
  --color-amber: #F59E0B;
  --color-coral: #FB7185;

  /* 中性色 */
  --color-white: #FFFFFF;
  --color-gray-50: #F8FAFC;
  --color-gray-100: #F1F5F9;
  --color-gray-200: #E2E8F0;
  --color-gray-300: #CBD5E1;
  --color-gray-400: #94A3B8;
  --color-gray-500: #64748B;
  --color-gray-600: #475569;
  --color-gray-700: #334155;
  --color-gray-800: #1E293B;
  --color-gray-900: #0F172A;

  /* 字体 */
  --font-display: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --radius-2xl: 48px;
  --radius-full: 9999px;

  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(5, 150, 105, 0.06);
  --shadow-md: 0 8px 24px rgba(5, 150, 105, 0.08);
  --shadow-lg: 0 20px 50px rgba(5, 150, 105, 0.12);
  --shadow-xl: 0 30px 80px rgba(5, 150, 105, 0.18);
  --shadow-glow: 0 0 40px rgba(16, 185, 129, 0.3);

  /* 过渡 */
  --t-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --t-base: 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  --t-bounce: 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* 容器 */
  --container-max: 1280px;
  --container-pad: 24px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-gray-800);
  background-color: var(--color-white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--t-fast);
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

ul, ol {
  list-style: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
}

/* 通用容器 */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  position: relative;
}

/* 文字基础 */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-forest);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.4rem, 2.5vw, 1.8rem); }
h4 { font-size: clamp(1.1rem, 1.8vw, 1.3rem); }

p {
  color: var(--color-gray-600);
  line-height: 1.7;
}

/* 通用按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: all var(--t-base);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-emerald) 100%);
  color: var(--color-white);
  box-shadow: 0 8px 24px rgba(5, 150, 105, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(5, 150, 105, 0.45);
}

.btn-secondary {
  background: var(--color-white);
  color: var(--color-forest);
  border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
  background: var(--color-primary);
  color: var(--color-white);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--color-white);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.6);
}

.btn-arrow::after {
  content: '→';
  transition: transform var(--t-base);
}

.btn-arrow:hover::after {
  transform: translateX(4px);
}

/* 文字渐变 */
.text-gradient {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.text-gradient-white {
  background: linear-gradient(135deg, #FFFFFF 0%, #A7F3D0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* 章节标题 */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--color-bg-soft);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-display);
  margin-bottom: 20px;
  border: 1px solid var(--color-pale);
}

.section-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--color-primary);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.section-title {
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--color-gray-600);
  max-width: 720px;
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-header .section-subtitle {
  margin: 0 auto;
}

/* 通用章节 */
.section {
  padding: 120px 0;
  position: relative;
}

.section-light {
  background: var(--color-bg-pale);
}

.section-dark {
  background: var(--color-forest);
  color: var(--color-white);
}

.section-dark h1, .section-dark h2, .section-dark h3, .section-dark h4 {
  color: var(--color-white);
}

.section-dark p {
  color: var(--color-pale);
}

/* 动画关键帧 */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}

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

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

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

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(2deg); }
}

@keyframes rotate360 {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes blob {
  0%, 100% { border-radius: 60% 40% 30% 70%/60% 30% 70% 40%; transform: rotate(0deg) scale(1); }
  33% { border-radius: 30% 60% 70% 40%/50% 60% 30% 60%; transform: rotate(120deg) scale(1.05); }
  66% { border-radius: 50% 60% 30% 60%/30% 60% 70% 40%; transform: rotate(240deg) scale(0.95); }
}

@keyframes moleculeFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(20px, -30px) rotate(90deg); }
  50% { transform: translate(-15px, -20px) rotate(180deg); }
  75% { transform: translate(-25px, 15px) rotate(270deg); }
}

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

/* 滚动触发动画 */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--t-base), transform 0.8s var(--t-base);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s var(--t-base), transform 0.8s var(--t-base);
}

.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s var(--t-base), transform 0.8s var(--t-base);
}

.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.8s var(--t-base), transform 0.8s var(--t-base);
}

.reveal-scale.active {
  opacity: 1;
  transform: scale(1);
}

/* 渐入延迟 */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }

/* 卡片 */
.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-gray-100);
  transition: all var(--t-base);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-pale);
}

.card-glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.card-dark {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-white);
}

.card-dark p {
  color: var(--color-pale);
}

/* 渐入加载 */
.fade-in {
  animation: fadeInUp 0.8s ease-out both;
}

/* 选择文字 */
::selection {
  background: var(--color-primary);
  color: var(--color-white);
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--color-primary), var(--color-emerald));
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-forest);
}

/* 焦点 */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

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