/* ============================================================
   v2.1.0-modern 现代版UI基础结构
   global.css — 全局样式（CSS变量、基础重置、通用组件）
   对应 Tailwind 暗色主题体系，纯 CSS 实现
   ============================================================ */

/* ---------- CSS 变量（颜色体系） ---------- */
:root {
  /* 主色调 */
  --color-primary: #6366f1;
  --color-primary-hover: #4f46e5;
  --color-primary-light: rgba(99, 102, 241, 0.1);
  --color-primary-glow: rgba(99, 102, 241, 0.3);

  --color-secondary: #8b5cf6;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;

  /* 暗色主题（默认） */
  --color-dark: #0f172a;
  --color-dark-light: #1e293b;
  --color-dark-lighter: #334155;
  --color-dark-border: rgba(255, 255, 255, 0.1);

  /* 文字 */
  --color-text: #e2e8f0;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;

  /* 间距 */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  /* 圆角 */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;

  /* 阴影 */
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-card-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px var(--color-primary-glow);
  --shadow-primary: 0 4px 14px 0 rgba(99, 102, 241, 0.35);

  /* 过渡 */
  --transition-base: all 0.3s ease;
  --transition-fast: all 0.15s ease;
}

/* ---------- 基础重置 ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--color-dark);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--color-primary-hover);
}

img {
  max-width: 100%;
  height: auto;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  color: inherit;
  outline: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  outline: none;
}

/* 容器 */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* ---------- 渐变背景 ---------- */
.gradient-bg {
  background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-dark-light) 50%, var(--color-dark-lighter) 100%);
}

/* ---------- 玻璃态效果 ---------- */
.glass-effect {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--color-dark-border);
}

/* ---------- 发光效果 ---------- */
.glow-effect {
  box-shadow: 0 0 20px var(--color-primary-glow);
}

/* ---------- 输入框聚焦效果 ---------- */
.input-focus:focus {
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

/* ---------- 动画 ---------- */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.float-animation {
  animation: float 6s ease-in-out infinite;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- 卡片悬停过渡 ---------- */
.card-transition {
  transition: var(--transition-base);
}

.card-transition:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

/* ---------- 自定义滚动条 ---------- */
.scrollbar-thin {
  scrollbar-width: thin;
  scrollbar-color: var(--color-dark-lighter) transparent;
}

.scrollbar-thin::-webkit-scrollbar {
  width: 4px;
}

.scrollbar-thin::-webkit-scrollbar-track {
  background: transparent;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background-color: var(--color-dark-lighter);
  border-radius: 2px;
}

/* ---------- 弹窗动画 ---------- */
.modal-enter {
  animation: modalFadeIn 0.3s ease forwards;
}

/* ---------- 通知红点 ---------- */
.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: var(--color-danger);
  border-radius: 50%;
}

/* ---------- flex / grid 工具 ---------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

/* ---------- spacing 工具 ---------- */
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.mt-16 { margin-top: 4rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.ml-2 { margin-left: 0.5rem; }
.space-x-1 > * + * { margin-left: 0.25rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-x-6 > * + * { margin-left: 1.5rem; }

/* ---------- text 工具 ---------- */
.text-center { text-align: center; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.tracking-tight { letter-spacing: -0.025em; }
.leading-relaxed { line-height: 1.625; }

/* ---------- width 工具 ---------- */
.w-full { width: 100%; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-20 { width: 5rem; }
.h-2 { height: 0.5rem; }
.h-5 { height: 1.25rem; }
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-20 { height: 5rem; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-7xl { max-width: 80rem; }

/* ---------- position / display ---------- */
.fixed { position: fixed; }
.absolute { position: absolute; }
.relative { position: relative; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.top-4 { top: 1rem; }
.right-4 { right: 1rem; }
.left-4 { left: 1rem; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.hidden { display: none; }
.block { display: block; }
.inline-flex { display: inline-flex; }
.sticky { position: sticky; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }

/* ---------- border / radius ---------- */
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: 50%; }
.border { border: 1px solid var(--color-dark-lighter); }
.border-0 { border: none; }
.border-t { border-top: 1px solid var(--color-dark-lighter); }
.border-b { border-bottom: 1px solid var(--color-dark-lighter); }
.border-l-2 { border-left-width: 2px; }

/* ---------- shadow ---------- */
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }
.shadow-lg { box-shadow: var(--shadow-card); }

/* ---------- color ---------- */
.text-white { color: #fff; }
.text-dark { color: #0f172a; }
.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-indigo-400 { color: #818cf8; }
.text-purple-400 { color: #a78bfa; }
.text-emerald-400 { color: #34d399; }
.text-cyan-400 { color: #22d3ee; }
.text-amber-400 { color: #fbbf24; }
.text-gray-300 { color: #cbd5e1; }
.text-gray-400 { color: #94a3b8; }
.bg-dark { background-color: var(--color-dark); }
.bg-dark-light { background-color: var(--color-dark-light); }
.bg-dark-lighter { background-color: var(--color-dark-lighter); }
.bg-primary { background-color: var(--color-primary); }
.bg-primary-hover { background-color: var(--color-primary-hover); }
.bg-emerald-500 { background-color: #10b981; }
.bg-red-500 { background-color: #ef4444; }
.bg-yellow-500 { background-color: #f59e0b; }
.bg-blue-500 { background-color: #3b82f6; }

/* ---------- 转换 ---------- */
.-translate-y-1\/2 { transform: translateY(-50%); }
.translate-x-full { transform: translateX(100%); }

/* ---------- 过渡 ---------- */
.transition-all { transition: var(--transition-base); }
.transition-colors { transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease; }
.duration-300 { transition-duration: 0.3s; }

/* ---------- 杂项 ---------- */
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-70 { opacity: 0.7; }
.antialiased { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.min-h-screen { min-height: 100vh; }
.max-h-\[80vh\] { max-height: 80vh; }
.flex-col-reverse { flex-direction: column-reverse; }
.object-cover { object-fit: cover; }
.whitespace-nowrap { white-space: nowrap; }