/* ========================================
   1H币研 / 1H Crypto — 全局样式
   ======================================== */

/* --- CSS 变量系统（暗色默认）--- */
:root {
  /* 背景 */
  --bg-primary:   #020617;
  --bg-secondary:  #0f172a;
  --bg-card:       #1e293b;
  --bg-nav:        rgba(2, 6, 23, 0.85);

  /* 文字 */
  --text-primary:  #f1f5f9;
  --text-secondary:#94a3b8;
  --text-muted:    #64748b;

  /* 品牌色 */
  --primary:       #0ea5e9;
  --primary-rgb:   14, 165, 233;
  --primary-light: #38bdf8;
  --accent:        #f59e0b;
  --accent-light:  #fbbf24;

  /* 边框 & 阴影 */
  --border:        #1e293b;
  --shadow:        0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-lg:     0 10px 25px rgba(0,0,0,0.4);

  /* 圆角 */
  --radius:        12px;
  --radius-sm:     8px;
}

[data-theme="light"] {
  --bg-primary:   #ffffff;
  --bg-secondary:  #f8fafc;
  --bg-card:       #ffffff;
  --bg-nav:        rgba(255,255,255,0.85);
  --text-primary:  #0f172a;
  --text-secondary:#475569;
  --text-muted:    #94a3b8;
  --border:        #e2e8f0;
  --shadow:        0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg:     0 10px 25px rgba(0,0,0,0.08);
}

/* --- 导航高亮（绕过 Tailwind CSS 变量透明度限制） --- */
.nav-active {
  color: var(--primary) !important;
  background-color: rgba(14, 165, 233, 0.15) !important;
  font-weight: 600 !important;
}
[data-theme="light"] .nav-active {
  color: #0284c7 !important;
  background-color: rgba(2, 132, 199, 0.10) !important;
}

/* --- 全局重置 & 基础 --- */
html {
  scroll-behavior: smooth;
  background-color: #020617;
}
body {
  background-color: var(--bg-primary);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
               'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialised;
  -moz-osx-font-smoothing: grayscale;
}

/* --- 选中文字颜色 --- */
::selection {
  background-color: rgba(14, 165, 233, 0.3);
  color: #f1f5f9;
}

/* --- 自定义滚动条（Webkit）--- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* --- 渐变文字工具类 --- */
.gradient-text {
  background: linear-gradient(135deg, #0ea5e9, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- 入场动画 --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulseSlow {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

.fade-in      { animation: fadeIn 0.5s ease-out both; }
.fade-in-up   { animation: fadeInUp 0.6s ease-out both; }
.pulse-slow   { animation: pulseSlow 3s ease-in-out infinite; }

/* --- 导航毛玻璃 --- */
.nav-glass {
  background: var(--bg-nav);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

/* --- Hero 光晕背景 --- */
.hero-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(245,158,11,0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* --- 卡片基础样式（覆盖 Tailwind 默认）--- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s ease;
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: rgba(14, 165, 233, 0.3);
}

/* --- 数据指标数字 --- */
.metric-value {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* --- 代码块 --- */
code, pre {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* --- 平滑过渡（主题切换）--- */
*,
*::before,
*::after {
  transition-property: background-color, border-color, color;
  transition-duration: 0.2s;
  transition-timing-function: ease;
}

/* 排除动画元素和 transform */
.fade-in,
.fade-in-up,
.pulse-slow,
.card:hover {
  transition: none;
}

/* --- 响应式容器 --- */
.container-narrow {
  max-width: 896px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- 徽章（Badge）--- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge-blue   { background: rgba(14,165,233,0.15); color: #38bdf8; }
.badge-green  { background: rgba(34,197,94,0.15);  color: #4ade80; }
.badge-amber  { background: rgba(245,158,11,0.15); color: #fbbf24; }
.badge-purple { background: rgba(139,92,246,0.15); color: #a78bfa; }
.badge-red    { background: rgba(239,68,68,0.15);  color: #f87171; }

/* --- 表格语义色 --- */
.text-bullish { color: #22c55e; }
.text-bearish { color: #ef4444; }
.text-neutral  { color: #f59e0b; }

/* --- 移动端导航面板 --- */
.mobile-nav-panel {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--bg-nav);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 99;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ========== 新增特效样式 ========== */

/* --- 顶部滚动进度条 --- */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #0ea5e9, #f59e0b, #0ea5e9);
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
  z-index: 9999;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.5);
}

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

/* --- 滚动触发入场（默认隐藏）--- */
.fade-in-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- 卡片 3D 倾斜容器 --- */
.card-3d {
  perspective: 1000px;
  transition: transform 0.1s ease-out;
  transform-style: preserve-3d;
}
.card-3d-inner {
  transition: transform 0.15s ease-out;
  transform-style: preserve-3d;
}

/* --- Hero 动态网格背景 --- */
.hero-grid-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.hero-grid-bg canvas {
  width: 100%;
  height: 100%;
  opacity: 0.4;
}

/* --- 鼠标跟随光晕 --- */
.cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
}

/* --- 数字跳动动画 --- */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.metric-animate {
  animation: countUp 0.8s ease-out both;
}

/* --- 文字打字机光标 --- */
.typing-cursor::after {
  content: '|';
  animation: blink 1s step-end infinite;
  color: #0ea5e9;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* --- 背景浮动粒子（纯CSS）--- */
.bg-particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #0ea5e9;
  border-radius: 50%;
  opacity: 0;
  animation: floatUp 8s ease-in-out infinite;
}
.particle:nth-child(1)  { left: 10%; animation-delay: 0s; }
.particle:nth-child(2)  { left: 20%; animation-delay: 1s; background: #f59e0b; }
.particle:nth-child(3)  { left: 30%; animation-delay: 2s; }
.particle:nth-child(4)  { left: 40%; animation-delay: 3s; background: #f59e0b; }
.particle:nth-child(5)  { left: 50%; animation-delay: 4s; }
.particle:nth-child(6)  { left: 60%; animation-delay: 5s; background: #f59e0b; }
.particle:nth-child(7)  { left: 70%; animation-delay: 6s; }
.particle:nth-child(8)  { left: 80%; animation-delay: 7s; background: #f59e0b; }
.particle:nth-child(9)  { left: 90%; animation-delay: 0.5s; }
.particle:nth-child(10) { left: 15%; animation-delay: 1.5s; background: #f59e0b; }
.particle:nth-child(11) { left: 35%; animation-delay: 2.5s; }
.particle:nth-child(12) { left: 55%; animation-delay: 3.5s; background: #f59e0b; }
.particle:nth-child(13) { left: 75%; animation-delay: 4.5s; }
.particle:nth-child(14) { left: 95%; animation-delay: 5.5s; background: #f59e0b; }
.particle:nth-child(15) { left: 5%;  animation-delay: 6.5s; }

@keyframes floatUp {
  0%   { opacity: 0; transform: translateY(100vh) scale(0); }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.1; }
  100% { opacity: 0; transform: translateY(-10vh) scale(1); }
}

/* --- 按钮脉冲光晕 --- */
.btn-glow {
  position: relative;
  overflow: hidden;
}
.btn-glow::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(45deg, #0ea5e9, transparent, #f59e0b, transparent, #0ea5e9);
  background-size: 400% 400%;
  border-radius: inherit;
  z-index: -1;
  animation: btnGlow 3s ease-in-out infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.btn-glow:hover::after {
  opacity: 1;
}
@keyframes btnGlow {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* --- OG 图片尺寸修复（Astro 默认）--- */
og-image,
[property="og:image"] {
  max-width: 1200px;
}

.typing-effect { display: inline; }
.typing-cursor::after {
  content: "|"; animation: blink 1s step-end infinite; color: #0ea5e9;
}
@keyframes blink { 0%%,100%% { opacity: 1; } 50%% { opacity: 0; } }
