/* 现代化UI界面样式系统 - ccLoad代理管理界面 */

/* ===== CSS 变量和设计令牌 ===== */
:root {
  /* 品牌色彩系统 */
  --primary-50: #f0f7ff;
  --primary-100: #e0efff;
  --primary-200: #b8dcff;
  --primary-300: #7cc3ff;
  --primary-400: #3ca3ff;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;

  /* 中性色彩 */
  --neutral-50: #f9fafb;
  --neutral-100: #f3f4f6;
  --neutral-200: #e5e7eb;
  --neutral-300: #d1d5db;
  --neutral-400: #9ca3af;
  --neutral-500: #6b7280;
  --neutral-600: #4b5563;
  --neutral-700: #374151;
  --neutral-800: #1f2937;
  --neutral-900: #111827;

  /* 功能色彩 */
  --success-50: #ecfdf5;
  --success-500: #10b981;
  --success-600: #059669;
  --warning-50: #fffbeb;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --error-50: #fef2f2;
  --error-500: #ef4444;
  --error-600: #dc2626;
  --info-50: #f0f9ff;
  --info-500: #06b6d4;
  --info-600: #0891b2;

  /* 玻璃态效果 */
  --glass-bg: rgba(255, 255, 255, 0.95);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --glass-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.15);

  /* 新拟态效果 */
  --neumorphism-light: #ffffff;
  --neumorphism-dark: #d1d5db;
  --neumorphism-shadow-1: 8px 8px 16px var(--neumorphism-dark);
  --neumorphism-shadow-2: -8px -8px 16px var(--neumorphism-light);

  /* 字体系统 */
  --font-family-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-family-mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'Roboto Mono', Consolas, monospace;

  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */

  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* 间距系统 */
  --space-1: 0.25rem;    /* 4px */
  --space-2: 0.5rem;     /* 8px */
  --space-3: 0.75rem;    /* 12px */
  --space-4: 1rem;       /* 16px */
  --space-5: 1.25rem;    /* 20px */
  --space-6: 1.5rem;     /* 24px */
  --space-8: 2rem;       /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */

  /* 圆角系统 */
  --radius-sm: 0.375rem;   /* 6px */
  --radius-base: 0.5rem;   /* 8px */
  --radius-lg: 0.75rem;    /* 12px */
  --radius-xl: 1rem;       /* 16px */
  --radius-2xl: 1.5rem;    /* 24px */
  --radius-full: 9999px;

  /* 阴影系统 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-base: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);

  /* 动画时间 */
  --duration-fast: 0.15s;
  --duration-normal: 0.3s;
  --duration-slow: 0.5s;
  --timing-function: cubic-bezier(0.4, 0, 0.2, 1);

  /* 布局 */
  --topbar-height: 64px;
  --container-max-width: 100%;

  /* Topbar 前景色（提高对比度） */
  --topbar-fg: var(--neutral-900);
  --topbar-fg-muted: var(--neutral-700);
}


/* ===== 基础重置和全局样式 ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

*:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

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

body {
  font-family: var(--font-family-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--neutral-800);
  background: radial-gradient(1200px 600px at -10% -10%, rgba(99,102,241,0.35), transparent 60%),
              radial-gradient(900px 600px at 110% -10%, rgba(236,72,153,0.25), transparent 60%),
              linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* 选择文本颜色 */
::selection {
  background-color: var(--primary-200);
  color: var(--primary-800);
}

/* ===== 动画和关键帧 ===== */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

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

/* 动画类 */
.animate-slide-up {
  animation: slideInUp 0.6s var(--timing-function);
}

.animate-slide-right {
  animation: slideInRight 0.6s var(--timing-function);
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* ===== 布局组件 ===== */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

.main-content {
  flex: 1;
  margin-left: 0;
  min-height: 100vh;
  padding: var(--space-6);
  transition: margin-left var(--duration-normal) var(--timing-function);
}

.content-area {
  max-width: var(--container-max-width);
  margin: 0 auto;
}

/* ===== 顶部导航（Topbar） ===== */
.top-layout .main-content { margin-left: 0 !important; padding-top: var(--topbar-height); }

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-height);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--space-6);
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--glass-border);
  z-index: 300;
}
.topbar-left { display: flex; align-items: center; gap: var(--space-4); }
.brand { display: flex; align-items: center; gap: var(--space-3); }
.brand-icon {
  width: 36px; height: 36px; border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  color: white; font-weight: var(--font-bold);
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
}
.brand-text { color: var(--topbar-fg); font-weight: var(--font-semibold); letter-spacing: .2px; }

.topnav { display: flex; align-items: center; gap: var(--space-2); flex: 1; justify-content: center; }
.topnav-link {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem .75rem; border-radius: var(--radius-lg);
  color: var(--topbar-fg); text-decoration: none; font-weight: var(--font-medium);
  transition: background var(--duration-fast) var(--timing-function), color var(--duration-fast);
}
.topnav-link:hover { background: rgba(17,24,39,0.06); color: var(--topbar-fg); }
.topnav-link.active { background: rgba(17,24,39,0.10); color: var(--topbar-fg); border: 1px solid rgba(17,24,39,0.12); }
.topbar-right { display: flex; align-items: center; gap: var(--space-3); }

/* 顶部背景（静态渐变，无动画） */
.bg-anim {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(550px 300px at 20% 10%, rgba(59,130,246,0.14), transparent 60%),
    radial-gradient(650px 320px at 80% 5%, rgba(236,72,153,0.12), transparent 60%),
    radial-gradient(420px 260px at 70% 60%, rgba(16,185,129,0.10), transparent 60%);
}

/* ===== 卡片组件 ===== */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--glass-shadow);
  padding: var(--space-4);
  transition: all var(--duration-normal) var(--timing-function);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  opacity: 0;
  transition: opacity var(--duration-normal);
}

.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--glass-shadow-hover);
  border-color: rgba(255, 255, 255, 0.3);
}

.glass-card:hover::before {
  opacity: 1;
}

/* ===== 英雄标题 ===== */
.hero-header {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.95));
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  position: relative;
  overflow: hidden;
}

.hero-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
}

.hero-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
  flex-shrink: 0;
}

.hero-title {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--neutral-900);
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: var(--text-base);
  color: var(--neutral-600);
  margin: var(--space-1) 0 0 0;
  font-weight: var(--font-medium);
}

/* ===== 渠道卡片 ===== */
.channel-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.95));
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
  transition: all var(--duration-normal) var(--timing-function);
  position: relative;
  overflow: hidden;
}

.channel-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);
  border-color: rgba(255, 255, 255, 0.4);
}

.channel-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

.channel-card-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--neutral-800);
}

.channel-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.channel-cost {
  text-align: right;
}

.cost-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--neutral-500);
  margin-bottom: 2px;
  font-weight: var(--font-medium);
}

.cost-value {
  display: block;
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--warning-600);
  font-family: var(--font-family-mono);
}

.channel-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

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

.metric-value {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  line-height: 1.2;
  margin-bottom: var(--space-1);
}

.metric-label {
  font-size: var(--text-xs);
  color: var(--neutral-600);
  font-weight: var(--font-medium);
}

.token-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.token-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.token-label {
  font-size: 11px;
  color: var(--neutral-500);
  font-weight: var(--font-medium);
}

.token-value {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--neutral-700);
  font-family: var(--font-family-mono);
}

.token-cache {
  color: var(--success-600);
}

/* ===== 总览卡片 ===== */
.summary-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.95));
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
  transition: all var(--duration-normal) var(--timing-function);
  position: relative;
  overflow: hidden;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: currentColor;
  opacity: 0.8;
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);
}

.summary-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.04);
  color: currentColor;
}

.summary-content {
  flex: 1;
}

.summary-value {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  line-height: 1.2;
  margin-bottom: 4px;
}

.summary-label {
  font-size: var(--text-sm);
  color: var(--neutral-600);
  font-weight: var(--font-medium);
}

.summary-card-primary {
  color: var(--primary-600);
}

.summary-card-success {
  color: var(--success-600);
}

.summary-card-error {
  color: var(--error-600);
}

.summary-card-rate {
  color: var(--primary-600);
}

.metric-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all var(--duration-normal) var(--timing-function);
}

.metric-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--duration-normal);
}

.metric-card:hover::after {
  opacity: 1;
}

.metric-number {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--primary-600);
  margin-bottom: var(--space-2);
  display: block;
}

.metric-label {
  font-size: var(--text-sm);
  color: var(--neutral-600);
  font-weight: var(--font-medium);
}

/* ===== 按钮系统 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast) var(--timing-function);
  position: relative;
  overflow: hidden;
  user-select: none;
  white-space: nowrap;
  min-width: fit-content;
}

/* 切换按钮组（趋势页复用） - Apple UI 风格 (可用性优先) */
.toggle-group {
  display: inline-flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.25);
  padding: 2px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(30px) saturate(1.8);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
.toggle-btn {
  padding: 7px 14px;
  border-radius: 7px;
  color: rgba(0, 0, 0, 0.7);
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  border: none;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  letter-spacing: -0.01em;
  text-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
}
.toggle-btn:hover { 
  color: rgba(0, 0, 0, 0.85);
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.02);
}
.toggle-btn.active { 
  background: rgba(255, 255, 255, 0.95);
  color: #4f46e5; 
  font-weight: 650;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
  transform: scale(1.02);
  text-shadow: none;
}


.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left var(--duration-slow);
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  color: var(--neutral-800);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-success {
  background: linear-gradient(135deg, var(--success-500), var(--success-600));
  color: white;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-danger {
  background: #ef4444;
  color: white;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
}

/* ===== 表单组件 ===== */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--neutral-700);
}

.form-input {
  width: 100%;
  padding: var(--space-2) var(--space-2);
  border: 2px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  transition: all var(--duration-fast) var(--timing-function);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
  background: white;
}

.form-input::placeholder {
  color: var(--neutral-400);
}

/* ===== 导航组件 ===== */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
  padding: var(--space-4);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
}

.logo-text {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--neutral-700);
}

.nav-list {
  list-style: none;
  margin-bottom: var(--space-8);
}

.nav-item {
  margin-bottom: var(--space-1);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--neutral-700);
  text-decoration: none;
  border-radius: var(--radius-lg);
  font-weight: var(--font-medium);
  transition: all var(--duration-fast) var(--timing-function);
  position: relative;
}

.nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--primary-600);
  border-radius: var(--radius-full);
  transition: height var(--duration-fast) var(--timing-function);
}

.nav-link:hover {
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary-700);
  transform: translateX(4px);
}

.nav-link:hover::before {
  height: 20px;
}

.nav-link.active {
  background: rgba(59, 130, 246, 0.25);
  color: var(--primary-700);
  box-shadow: inset 0 1px 0 rgba(59, 130, 246, 0.2);
}

.nav-link.active::before {
  height: 20px;
}

.nav-icon {
  width: 16px;
  height: 16px;
  opacity: 0.8;
  transition: opacity var(--duration-fast);
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
  opacity: 1;
}

/* ===== 状态指示器 ===== */
.status-online {
  color: var(--success-500);
}

.status-offline {
  color: var(--error-500);
}

.status-warning {
  color: var(--warning-500);
}

/* ===== 统计卡片语义化颜色 ===== */
.metric-total {
  color: var(--primary-600);
}

.metric-success {
  color: var(--success-500);
}

.metric-error {
  color: var(--error-500);
}

.metric-rate {
  color: var(--primary-600);
}

/* 成功率动态颜色 */
.metric-rate.high-performance {
  color: var(--success-500);
}

.metric-rate.medium-performance {
  color: var(--warning-500);
}

.metric-rate.low-performance {
  color: var(--error-500);
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  margin-right: var(--space-2);
}

.status-dot.online {
  background: var(--success-500);
  animation: pulse 2s infinite;
}

.status-dot.offline {
  background: var(--error-500);
}

.status-dot.warning {
  background: var(--warning-500);
  animation: pulse 2s infinite;
}

/* ===== 网格系统 ===== */
.grid {
  display: grid;
  gap: var(--space-4);
}

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

/* ===== 加载状态 ===== */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmerBg 1.5s infinite;
  border-radius: var(--radius-base);
}

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

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--neutral-300);
  border-top: 2px solid var(--primary-500);
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
  .topbar { height: 64px; padding: 0 var(--space-4); }
  .topnav { justify-content: flex-start; overflow-x: auto; white-space: nowrap; gap: .25rem; }
  .topnav::-webkit-scrollbar { display: none; }

  .main-content {
    margin-left: 0;
    padding: var(--space-4);
  }

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

  .hero-header {
    padding: var(--space-4);
  }

  .hero-icon {
    width: 48px;
    height: 48px;
  }

  .hero-title {
    font-size: var(--text-2xl);
  }

  .channel-card {
    padding: var(--space-4);
  }

  .channel-metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
  }

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

  .summary-card {
    padding: var(--space-4);
  }

  .summary-icon {
    width: 40px;
    height: 40px;
  }

  .summary-value {
    font-size: var(--text-2xl);
  }
}

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

  .glass-card {
    padding: var(--space-4);
  }

  .metric-card {
    padding: var(--space-4);
  }

  .hero-header {
    flex-direction: column;
    text-align: center;
  }

  .hero-title {
    font-size: var(--text-xl);
  }

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

  .metric-value {
    font-size: var(--text-xl);
  }

  .summary-card {
    flex-direction: column;
    text-align: center;
  }

  .summary-card::before {
    width: 100%;
    height: 4px;
    top: 0;
    left: 0;
  }
}

/* ===== 可访问性 ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ===== 模态框组件 ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 16px;
  width: 70%;
  max-width: none;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--neutral-800);
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--neutral-500);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.close-btn:hover {
  background: var(--neutral-100);
  color: var(--neutral-700);
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.confirm-modal {
  text-align: center;
  width: auto !important;
  max-width: 460px !important;
  min-width: 300px;
}

.confirm-modal p {
  margin: 20px 0;
  color: var(--neutral-600);
}

.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

/* ===== 筛选器组件 ===== */
.filter-bar {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: var(--space-4);
  margin-bottom: var(--space-6);
}

.filter-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-group {
  flex: 1;
  /* min-width: 200px; */
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-input,
.filter-select {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-base);
  font-size: var(--text-sm);
  background: rgba(255, 255, 255, 0.9);
  transition: all var(--duration-fast);
}

.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-label {
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--neutral-600);
  white-space: nowrap;
  margin-right: 4px;
}

.filter-info {
  margin-left: auto;
  font-size: var(--text-sm);
  color: var(--neutral-600);
  white-space: nowrap;
}

/* ===== 表格组件 ===== */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--neutral-200);
  background: rgba(255, 255, 255, 0.9);
}

.modern-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  color: var(--neutral-800);
}

.modern-table thead {
  background: var(--neutral-100);
}

.modern-table th {
  padding: var(--space-4);
  text-align: left;
  font-weight: var(--font-semibold);
  color: var(--neutral-800);
  border-bottom: 2px solid var(--neutral-200);
}

.modern-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--neutral-200);
  transition: background-color var(--duration-fast);
}

.modern-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

/* ===== 渠道管理专用样式 ===== */
.channel-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  background: white;
  border: 1px solid var(--neutral-300);
  color: var(--neutral-600);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--neutral-50);
  border-color: var(--neutral-400);
  color: var(--neutral-700);
}

.add-channel-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-500);
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.2s;
  z-index: 100;
}

.add-channel-btn:hover {
  background: var(--primary-600);
  transform: scale(1.1);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.models-input-wrapper {
  position: relative;
}

.models-hint {
  font-size: 0.75rem;
  color: var(--neutral-500);
  margin-top: 4px;
}

/* ===== 冷却状态样式 ===== */
.cooldown-badge {
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #dc2626;
  border: 1px solid #fca5a5;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.1);
  animation: cooldown-pulse 2s infinite;
}

.cooldown-icon {
  font-size: 0.875rem;
  animation: cooldown-spin 3s linear infinite;
}

.channel-card-cooldown {
  border-color: #fca5a5 !important;
  position: relative;
}

.channel-card-cooldown::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #dc2626, #ef4444, #dc2626);
  border-radius: 12px 12px 0 0;
  animation: cooldown-bar 2s ease-in-out infinite;
}

@keyframes cooldown-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.02);
    opacity: 0.95;
  }
}

@keyframes cooldown-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes cooldown-bar {
  0%, 100% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.3);
  }
}

.channel-disabled {
  opacity: 0.6;
  filter: grayscale(20%);
}

/* ===== 测试模态框样式 ===== */
.test-modal-content {
  max-width: 600px;
}

.model-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--neutral-300);
  border-radius: 6px;
  font-size: 0.875rem;
  background: white;
  transition: all 0.2s;
  margin-bottom: 8px;
}

.model-select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.test-progress {
  display: none;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  padding: 12px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 6px;
}

.test-progress.show {
  display: flex;
}

.test-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e5e7eb;
  border-top: 2px solid var(--primary-500);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.test-result {
  margin: 16px 0;
  padding: 12px;
  border-radius: 6px;
  display: none;
}

.test-result.show {
  display: block;
}

.test-result.success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #059669;
}

.test-result.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #dc2626;
}

.test-details {
  margin-top: 8px;
  font-size: 0.75rem;
  opacity: 0.8;
}

.response-section {
  margin-top: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  max-height: 300px;
  overflow-y: auto;
}

.response-section h4 {
  margin: 0 0 8px 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--neutral-700);
}

.response-content {
  font-size: 0.8rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(0, 0, 0, 0.05);
  padding: 8px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}


/* ===== 日志和统计页面样式 ===== */
.status-error {
  color: var(--error-400);
  font-weight: var(--font-medium);
}

.status-success {
  color: var(--success-400);
  font-weight: var(--font-medium);
}

.config-info {
  font-family: var(--font-family-mono);
  font-size: var(--text-xs);
  background: var(--neutral-100);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--neutral-200);
}

.channel-link {
  color: var(--primary-600);
  text-decoration: none;
}

.channel-link:hover {
  text-decoration: underline;
}

.model-tag {
  display: inline-block;
  background: rgba(59, 130, 246, 0.2);
  color: var(--primary-400);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.stream-tag {
  display: inline-block;
  background: rgba(34, 197, 94, 0.2);
  color: var(--success-400);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.batch-tag {
  display: inline-block;
  background: rgba(156, 163, 175, 0.2);
  color: var(--neutral-500);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  border: 1px solid rgba(156, 163, 175, 0.3);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.pagination-info {
  font-weight: var(--font-medium);
  white-space: nowrap;
  color: var(--neutral-800);
}

.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--neutral-600);
}

.loading-state {
  text-align: center;
  padding: var(--space-8);
  color: var(--neutral-700);
}

/* ===== 统计页面专用样式 ===== */
.config-name {
  font-weight: var(--font-medium);
  color: var(--neutral-800);
}

.channel-id {
  color: var(--neutral-500);
  font-size: var(--text-xs);
  font-weight: var(--font-normal);
  margin-left: var(--space-2);
}

.success-count {
  color: var(--success-400);
  font-weight: var(--font-semibold);
}

.error-count {
  color: var(--error-400);
  font-weight: var(--font-semibold);
}

.success-rate {
  font-weight: var(--font-medium);
  color: var(--neutral-800);
}

.success-rate.high {
  color: var(--success-400);
}

.success-rate.low {
  color: var(--error-400);
}

/* ===== 排序功能样式 ===== */
.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background-color 0.2s ease;
}

.sortable:hover {
  background: rgba(0, 0, 0, 0.05) !important;
}

.sort-indicator {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--neutral-400);
  opacity: 0;
  transition: all 0.2s ease;
}

.sortable:hover .sort-indicator {
  opacity: 0.5;
}

.sortable.sorted .sort-indicator {
  opacity: 1;
  color: var(--primary-500);
}

.sortable.sorted:hover .sort-indicator {
  opacity: 1;
}

.sort-indicator::after {
  content: '⇅';
}

.sortable[data-sort-order="asc"] .sort-indicator::after {
  content: '↑';
}

.sortable[data-sort-order="desc"] .sort-indicator::after {
  content: '↓';
}

.progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: var(--space-1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success-400), var(--success-500));
  border-radius: var(--radius-full);
  transition: width var(--duration-normal);
}

/* ===== 趋势页面样式 ===== */
.chart-container {
  position: relative;
  width: 100%;
  height: 500px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-lg);
  border: 1px solid var(--neutral-200);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chart-loading,
.chart-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--neutral-700);
  text-align: center;
}

.chart-error {
  color: var(--neutral-600);
}

.error-title {
  color: var(--error-400);
  font-weight: var(--font-medium);
  margin: var(--space-2) 0 var(--space-1) 0;
}

.error-message {
  font-size: var(--text-sm);
}

.chart-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--neutral-200);
  font-size: var(--text-sm);
  color: var(--neutral-700);
}

.info-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ===== 渠道筛选器样式 ===== */
.channel-filter-container {
  position: relative;
  display: inline-block;
}

.channel-filter-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 250px;
  max-width: 350px;
  background: white;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  margin-top: 4px;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--neutral-200);
  font-weight: var(--font-medium);
  color: var(--neutral-800);
}

.filter-actions {
  display: flex;
  gap: var(--space-2);
}

.filter-action {
  background: none;
  border: none;
  color: var(--primary-600);
  cursor: pointer;
  font-size: var(--text-sm);
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s;
}

.filter-action:hover {
  background-color: var(--primary-50);
}

.filter-content {
  max-height: 300px;
  overflow-y: auto;
  padding: var(--space-2);
}

.channel-filter-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.2s;
}

.channel-filter-item:hover {
  background-color: var(--neutral-50);
}

.channel-checkbox {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--neutral-300);
  border-radius: 3px;
  background: white;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

.channel-checkbox.checked {
  background: var(--primary-500);
  border-color: var(--primary-500);
}

.channel-checkbox.checked::after {
  content: '✓';
  position: absolute;
  color: white;
  font-size: 12px;
  font-weight: bold;
  top: -1px;
  left: 2px;
}

.channel-color-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.channel-name {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--neutral-700);
}

/* ===== 登录页面样式 ===== */
.login-background {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(1200px 600px at -10% -10%, rgba(99,102,241,0.35), transparent 60%),
    radial-gradient(900px 600px at 110% -10%, rgba(236,72,153,0.25), transparent 60%),
    linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  z-index: -1;
}

.floating-shapes {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.shape {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  animation: float 6s ease-in-out infinite;
}

.shape-1 {
  width: 120px;
  height: 120px;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.shape-2 {
  width: 80px;
  height: 80px;
  top: 20%;
  right: 15%;
  animation-delay: -2s;
}

.shape-3 {
  width: 100px;
  height: 100px;
  bottom: 20%;
  left: 20%;
  animation-delay: -4s;
}

.shape-4 {
  width: 60px;
  height: 60px;
  bottom: 30%;
  right: 20%;
  animation-delay: -1s;
}

.shape-5 {
  width: 40px;
  height: 40px;
  top: 50%;
  left: 5%;
  animation-delay: -3s;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-12);
  padding: var(--space-6);
  position: relative;
}

.login-container {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-2xl);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  padding: var(--space-10);
  width: 100%;
  max-width: 420px;
  position: relative;
  overflow: hidden;
  color: var(--neutral-900);
}

.login-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-400), var(--primary-600), var(--primary-400));
}

.login-brand {
  text-align: center;
  margin-bottom: var(--space-10);
}

.brand-logo {
  margin-bottom: var(--space-4);
}

.logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  border-radius: var(--radius-xl);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3);
}

.brand-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--neutral-900);
  margin: var(--space-4) 0 var(--space-2) 0;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  color: var(--neutral-600);
  font-size: var(--text-sm);
  margin: 0;
  font-weight: var(--font-medium);
  letter-spacing: 0.01em;
}

.login-form-container {
  margin-bottom: var(--space-8);
}

.login-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.login-header h2 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--neutral-900);
  margin: 0 0 var(--space-2) 0;
}

.login-header p {
  color: var(--neutral-600);
  font-size: var(--text-sm);
  margin: 0;
}

.error-notification {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: #DC2626;
  border: 1px solid #B91C1C;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
  color: #FFFFFF;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  animation: slideInUp 0.3s ease-out;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.error-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #FFFFFF;
}

.login-form {
  margin-bottom: var(--space-8);
}

.label-icon {
  width: 16px;
  height: 16px;
  margin-right: var(--space-2);
}

.input-container {
  position: relative;
}

.input-decoration {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-400), var(--primary-600));
  transform: scaleX(0);
  transition: transform var(--duration-normal) var(--timing-function);
  border-radius: var(--radius-full);
}

.form-input:focus + .input-decoration {
  transform: scaleX(1);
}

.login-button {
  width: 100%;
  padding: var(--space-4) var(--space-6);
  background: linear-gradient(135deg, #0A84FF, #0060DF);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-xl);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: all var(--duration-normal) var(--timing-function);
  position: relative;
  overflow: hidden;
  margin-top: var(--space-6);
  box-shadow: 0 10px 28px rgba(10, 132, 255, 0.32);
}

.login-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left var(--duration-slow);
}

.login-button:hover::before {
  left: 100%;
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(10, 132, 255, 0.35);
}

.login-button:active {
  transform: translateY(0);
}

.login-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

.button-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  transition: opacity var(--duration-normal);
}

.button-icon {
  width: 18px;
  height: 18px;
}

.button-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity var(--duration-normal);
}

.login-button.loading .button-content {
  opacity: 0;
}

.login-button.loading .button-loader {
  opacity: 1;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top: 2px solid #fff;
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
}

.security-notice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
  border-radius: var(--radius-lg);
  color: var(--neutral-800);
}

.notice-icon {
  width: 20px;
  height: 20px;
  color: #0284C7;
  flex-shrink: 0;
  margin-top: 2px;
}

.notice-title {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  margin-bottom: var(--space-1);
  color: var(--neutral-900);
}

.notice-desc {
  font-size: var(--text-xs);
  color: var(--neutral-600);
}

.features-showcase {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  width: 100%;
  max-width: 380px;
  height: fit-content;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  color: var(--neutral-900);
}

.features-showcase h3 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--neutral-900);
  margin: 0 0 var(--space-6) 0;
  text-align: center;
}

.features-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.feature-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.12), rgba(10, 132, 255, 0.08));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0A84FF;
  flex-shrink: 0;
}

.feature-icon svg {
  width: 20px;
  height: 20px;
}

.feature-content h4 {
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--neutral-900);
  margin: 0 0 var(--space-1) 0;
}

.feature-content p {
  font-size: var(--text-sm);
  color: var(--neutral-600);
  margin: 0;
  line-height: var(--leading-relaxed);
  font-weight: var(--font-normal);
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
  .filter-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    min-width: 100%;
  }

  .filter-info {
    margin-left: 0;
    text-align: center;
    margin-top: var(--space-2);
  }

  .chart-container {
    height: 400px;
  }

  .chart-info {
    flex-direction: column;
    gap: var(--space-2);
    align-items: flex-start;
  }

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

  .pagination-controls {
    flex-direction: column;
    gap: var(--space-2);
  }

  .login-page {
    flex-direction: column;
    gap: var(--space-8);
    padding: var(--space-4);
  }

  .features-showcase {
    max-width: 420px;
    order: -1;
    padding: var(--space-6);
  }

  .login-container {
    padding: var(--space-6);
  }

  .features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .feature-item {
    gap: var(--space-3);
  }

  .feature-icon {
    width: 36px;
    height: 36px;
  }

  .modal-content {
    width: 100%;
    padding: var(--space-2);
  }
}

@media (max-width: 480px) {
  .chart-container {
    height: 320px;
  }

  .login-container {
    padding: var(--space-5);
  }

  .brand-title {
    font-size: var(--text-xl);
  }

  .logo-icon {
    width: 56px;
    height: 56px;
  }

  .modal-content {
    width: 90%;
    padding: var(--space-3);
  }
}

@media (max-width: 1024px) {
  .login-page {
    flex-direction: column;
    gap: var(--space-8);
  }

  .features-showcase {
    max-width: 420px;
  }
}

/* ===== 筛选器容器样式 ===== */
.filter-container {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.filter-container .form-group {
  flex: 1 1 auto;
  min-width: 140px;
}

.filter-container .form-group:first-child,
.filter-container .form-group:nth-child(2) {
  flex: 0 0 auto;
  min-width: 120px;
}

.filter-container .form-group:last-child {
  flex: 0 0 auto;
  min-width: 100px;
  display: flex;
  align-items: end;
}

.filter-container .form-input,
.filter-container .btn {
  width: 100%;
}

/* ===== 动画延迟工具类 ===== */
.animate-slide-up[style*="animation-delay: 0.1s"] { animation-delay: 0.1s; }
.animate-slide-up[style*="animation-delay: 0.2s"] { animation-delay: 0.2s; }
.animate-slide-up[style*="animation-delay: 0.3s"] { animation-delay: 0.3s; }
.animate-slide-up[style*="animation-delay: 0.4s"] { animation-delay: 0.4s; }

/* ===== 内联样式常用类 ===== */
.text-align-center { text-align: center; }
.text-align-right { text-align: right; }
.white-space-nowrap { white-space: nowrap; }
.word-break-break-word { word-break: break-word; }
.max-width-300 { max-width: 300px; }

.display-none { display: none; }
.display-flex { display: flex; }
.align-items-center { align-items: center; }
.align-items-end { align-items: end; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }

.margin-auto { margin: 0 auto var(--space-2); }
.margin-top-1 { margin-top: 4px; }
.margin-bottom-1 { margin-bottom: var(--space-1); }

.padding-right-36 { padding-right: 36px; }
.padding-right-45 { padding-right: 45px; }

.resize-vertical { resize: vertical; }
.min-height-80 { min-height: 80px; }

/* ===== 颜色工具类 ===== */
.color-error { color: var(--error-400); }
.color-success { color: var(--success-600); }
.color-neutral-500 { color: var(--neutral-500); }
.color-neutral-600 { color: var(--neutral-600); }
.color-neutral-700 { color: var(--neutral-700); }
.color-neutral-800 { color: var(--neutral-800); }
.color-primary-500 { color: var(--primary-500); }
.color-info-500 { color: var(--info-500); }

/* ===== 字体工具类 ===== */
.font-weight-medium { font-weight: var(--font-medium); }
.font-weight-semibold { font-weight: var(--font-semibold); }
.font-mono { font-family: var(--font-family-mono); }

/* ===== 尺寸工具类 ===== */
.font-size-14 { font-size: 14px; }
.font-size-18 { font-size: 18px; }

/* ===== 位置工具类 ===== */
.position-absolute { position: absolute; }
.position-relative { position: relative; }
.right-8 { right: 8px; }
.top-50 { top: 50%; }
.transform-translateY-50 { transform: translateY(-50%); }

/* ===== 背景工具类 ===== */
.background-none { background: none; }
.border-none { border: none; }

/* ===== JavaScript动态样式支持 ===== */
.js-inline-cooldown {
  color: #dc2626;
  font-size: 0.875rem;
  font-weight: 500;
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #fca5a5;
}

.js-test-success-icon {
  font-size: 18px;
}

.js-test-error-icon {
  font-size: 18px;
}

/* ===== 响应式筛选器修正 ===== */
@media (max-width: 768px) {
  .filter-container {
    flex-direction: column !important;
    gap: var(--space-3) !important;
  }

  .filter-container .form-group {
    flex: 1 1 100% !important;
    min-width: unset !important;
  }

  .table-container {
    font-size: var(--text-xs);
  }

  .modern-table th,
  .modern-table td {
    padding: var(--space-2) var(--space-3);
  }
}

/* ===== 工具类 ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.w-12 { width: 48px; } .h-12 { height: 48px; }
.w-5 { width: 20px; } .h-5 { height: 20px; }
.w-4 { width: 16px; } .h-4 { height: 16px; }

.page-title { font-size: var(--text-2xl); color: var(--neutral-900); font-weight: var(--font-bold); }
.page-subtitle { font-size: var(--text-base); color: var(--neutral-600); }
.section-title { font-size: var(--text-xl); color: var(--neutral-800); font-weight: var(--font-semibold); }


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

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

.hidden { display: none; }
.block { display: block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

/* stats.html page-specific styles */
    .stats-table th {
      text-align: center;
    }
