/* ========== 全局重置 & 基础样式 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* 背景色 */
  --bg-primary: #0a0e27;
  --bg-secondary: #0f1535;
  --bg-card: rgba(15, 21, 53, 0.85);
  --bg-card-hover: rgba(20, 28, 70, 0.9);
  --bg-overlay: rgba(10, 14, 39, 0.9);

  /* 边框 */
  --border-color: rgba(64, 169, 255, 0.25);
  --border-glow: rgba(64, 169, 255, 0.5);

  /* 文字 */
  --text-primary: #e0e8ff;
  --text-secondary: rgba(160, 180, 255, 0.7);
  --text-muted: rgba(160, 180, 255, 0.4);

  /* 语义色 (shadcn 风格) */
  --color-primary: #40a9ff;
  --color-primary-foreground: #ffffff;
  --color-secondary: #b37feb;
  --color-secondary-foreground: #ffffff;
  --color-destructive: #ff4d4f;
  --color-destructive-foreground: #ffffff;
  --color-success: #52c41a;
  --color-warning: #fa8c16;

  /* 强调色 */
  --accent-blue: #40a9ff;
  --accent-cyan: #36d6e7;
  --accent-green: #52c41a;
  --accent-orange: #fa8c16;
  --accent-purple: #b37feb;
  --accent-red: #ff4d4f;
  --accent-yellow: #ffd666;

  /* 渐变 */
  --gradient-blue: linear-gradient(135deg, #40a9ff, #36d6e7);
  --gradient-purple: linear-gradient(135deg, #b37feb, #40a9ff);
  --gradient-gold: linear-gradient(135deg, #ffd666, #fa8c16);
  --gradient-cyber: linear-gradient(135deg, #40a9ff, #36d6e7, #b37feb);

  /* 阴影 */
  --shadow-blue: 0 0 20px rgba(64, 169, 255, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px rgba(64, 169, 255, 0.15);

  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;

  /* 字体 */
  --font-family: 'Microsoft YaHei', 'PingFang SC', -apple-system, sans-serif;
  --font-mono: 'Cascadia Code', 'JetBrains Mono', 'Fira Code', monospace;
}

html,
body {
  width: 100%;
  height: 100%;
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
}

body {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(64, 169, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(179, 127, 235, 0.05) 0%, transparent 50%), var(--bg-primary);
}

/* 科技网格背景（全局） */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(64, 169, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(64, 169, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* 全局扫描线 */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(64, 169, 255, 0.012) 2px,
    rgba(64, 169, 255, 0.012) 4px
  );
  pointer-events: none;
  z-index: 1;
  animation: scanline-move 8s linear infinite;
}

@keyframes scanline-move {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(4px);
  }
}

/* 浮动粒子（页面内使用 data-particle 属性定位） */
.particle {
  position: fixed;
  width: 2px;
  height: 2px;
  background: var(--accent-blue);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  box-shadow: 0 0 6px var(--accent-blue);
}

@keyframes float-particle {
  0%,
  100% {
    opacity: 0;
    transform: translate(0, 0) scale(1);
  }
  20% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.7;
    transform: translate(24px, -36px) scale(1.5);
  }
  80% {
    opacity: 0.2;
    transform: translate(-12px, -12px) scale(0.8);
  }
}

/* ===== 卡片科技角标 ===== */
.card-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--accent-blue);
  border-style: solid;
  opacity: 0.3;
  transition:
    opacity 0.4s,
    border-color 0.4s;
  z-index: 1;
  pointer-events: none;
}
.card-corner.tl {
  top: 5px;
  left: 5px;
  border-width: 1px 0 0 1px;
}
.card-corner.tr {
  top: 5px;
  right: 5px;
  border-width: 1px 1px 0 0;
}
.card-corner.bl {
  bottom: 5px;
  left: 5px;
  border-width: 0 0 1px 1px;
}
.card-corner.br {
  bottom: 5px;
  right: 5px;
  border-width: 0 1px 1px 0;
}

/* 卡片 hover 时角标高亮 */
.card:hover .card-corner,
.chart-card:hover .card-corner,
.mini-model-card:hover .card-corner {
  opacity: 0.8;
  border-color: var(--accent-cyan);
}

/* ===== 卡片顶部流光 ===== */
.card::before,
.chart-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-blue), var(--accent-cyan), transparent);
  opacity: 0;
  transition: opacity 0.4s;
  z-index: 2;
  pointer-events: none;
}
.card:hover::before,
.chart-card:hover::before {
  opacity: 0.8;
  animation: card-sweep 1.5s ease-in-out infinite;
}
@keyframes card-sweep {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* ===== 数据数值呼吸光效 ===== */
@keyframes value-glow {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.15);
  }
}

/* ===== 科技文字闪烁（用于标题装饰） ===== */
@keyframes text-flicker {
  0%,
  100% {
    opacity: 1;
  }
  41% {
    opacity: 1;
  }
  42% {
    opacity: 0.6;
  }
  43% {
    opacity: 1;
  }
  45% {
    opacity: 0.3;
  }
  46% {
    opacity: 1;
  }
}
.tech-flicker {
  animation: text-flicker 4s linear infinite;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ========== 顶部导航栏 (shadcn 风格) ========== */
.top-nav {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(10, 14, 39, 0.95);
  border-bottom: 1px solid var(--border-color);
  position: relative;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.top-nav .logo {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  letter-spacing: 2px;
}

.top-nav .logo .logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--gradient-cyber);
  border-radius: 6px;
  position: relative;
}

.top-nav .logo .logo-icon svg {
  width: 16px;
  height: 16px;
  color: #fff;
}

.top-nav .nav-list {
  display: flex;
  gap: 2px;
  list-style: none;
}

.top-nav .nav-list a {
  padding: 7px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.25s ease;
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.5px;
}

.top-nav .nav-list a .nav-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  opacity: 0.4;
  transition: opacity 0.25s;
}

.top-nav .nav-list a:hover {
  color: var(--text-primary);
  background: rgba(64, 169, 255, 0.08);
}

.top-nav .nav-list a.active {
  color: var(--accent-blue);
  background: rgba(64, 169, 255, 0.12);
}

.top-nav .nav-list a.active .nav-dot {
  opacity: 1;
}

.top-nav .clock {
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  font-family: var(--font-mono);
}

.top-nav .clock .clock-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  vertical-align: middle;
  margin-right: 6px;
  color: var(--accent-cyan);
}

/* ========== 页面容器 ========== */
.page-container {
  width: 100%;
  height: calc(100vh - 64px);
  padding: 16px 24px;
  display: grid;
  gap: 16px;
  overflow: hidden;
}

/* ========== 卡片 ========== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 20px;
  backdrop-filter: blur(10px);
  transition: border-color 0.3s;
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--border-glow);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-blue);
  opacity: 0.6;
}

.card-title {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 1px;
}

.card-title .icon {
  font-size: 16px;
}

.card-title .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse-dot 2s infinite;
}

.dot.blue {
  background: var(--accent-blue);
}
.dot.green {
  background: var(--accent-green);
}
.dot.orange {
  background: var(--accent-orange);
}
.dot.purple {
  background: var(--accent-purple);
}
.dot.cyan {
  background: var(--accent-cyan);
}
.dot.red {
  background: var(--accent-red);
}
.dot.yellow {
  background: var(--accent-yellow);
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* ========== 数据数值展示 ========== */
.stat-value {
  font-size: 28px;
  font-weight: 700;
  background: var(--gradient-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.stat-value.gold {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
}

.stat-value.purple {
  background: var(--gradient-purple);
  -webkit-background-clip: text;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.stat-change {
  font-size: 12px;
  margin-top: 2px;
}

.stat-change.up {
  color: var(--accent-green);
}
.stat-change.down {
  color: var(--accent-red);
}

/* ========== 统计数字卡片（大数字） ========== */
.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
}

.stat-card .stat-value {
  font-size: 36px;
}

/* ========== 工具类 ========== */
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.flex-1 {
  flex: 1;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-8 {
  gap: 8px;
}
.gap-12 {
  gap: 12px;
}
.gap-16 {
  gap: 16px;
}
.text-center {
  text-align: center;
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(64, 169, 255, 0.3);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(64, 169, 255, 0.5);
}

/* ========== 标签 / Badge (shadcn 风格) ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 100px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.badge-default {
  background: rgba(64, 169, 255, 0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(64, 169, 255, 0.2);
}

.badge-secondary {
  background: rgba(160, 180, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid rgba(160, 180, 255, 0.12);
}

.badge-success {
  background: rgba(82, 196, 26, 0.12);
  color: var(--accent-green);
  border: 1px solid rgba(82, 196, 26, 0.2);
}

.badge-warning {
  background: rgba(250, 140, 22, 0.12);
  color: var(--accent-orange);
  border: 1px solid rgba(250, 140, 22, 0.2);
}

.badge-destructive {
  background: rgba(255, 77, 79, 0.12);
  color: var(--accent-red);
  border: 1px solid rgba(255, 77, 79, 0.2);
}

/* ========== 实时标签 ========== */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--accent-green);
  padding: 2px 10px;
  border: 1px solid rgba(82, 196, 26, 0.3);
  border-radius: 100px;
  font-weight: 500;
}

.live-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite;
}

/* ========== 模型调用卡片 ========== */
.model-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 16px;
  transition: all 0.3s;
}

.model-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: var(--shadow-blue);
}

.model-card .model-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.model-card .model-calls {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.model-card .model-unit {
  font-size: 12px;
  color: var(--text-secondary);
}

.model-card .model-sparkline {
  width: 100%;
  height: 30px;
  margin-top: 6px;
}

/* ========== 闪烁动画 ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* ========== 导航首页特殊样式 ========== */
.index-page {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(64, 169, 255, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(179, 127, 235, 0.08) 0%, transparent 50%), var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  overflow: hidden;
}

.index-title {
  font-size: 48px;
  font-weight: 800;
  background: var(--gradient-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
  text-align: center;
}

.index-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 60px;
  text-align: center;
  letter-spacing: 4px;
}

.index-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 800px;
  width: 100%;
  padding: 0 40px;
}

.index-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 32px 28px;
  text-align: center;
  transition: all 0.4s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.index-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-blue);
  opacity: 0;
  transition: opacity 0.4s;
}

.index-card:hover::before {
  opacity: 1;
}

.index-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(64, 169, 255, 0.15);
}

.index-card .card-icon {
  font-size: 40px;
  margin-bottom: 16px;
}

.index-card .card-num {
  font-size: 13px;
  color: var(--accent-blue);
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.index-card .card-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.index-card .card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ========== 表格样式 ========== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 8px 12px;
  color: var(--text-secondary);
  font-weight: 500;
  border-bottom: 1px solid rgba(64, 169, 255, 0.15);
  font-size: 12px;
  letter-spacing: 1px;
}

.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(64, 169, 255, 0.08);
}

.data-table tr:hover td {
  background: rgba(64, 169, 255, 0.05);
}

/* ========== 设备标签 ========== */
.device-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.device-tag.pro3000 {
  background: rgba(64, 169, 255, 0.2);
  color: var(--accent-blue);
  border: 1px solid rgba(64, 169, 255, 0.3);
}

.device-tag.h100 {
  background: rgba(179, 127, 235, 0.2);
  color: var(--accent-purple);
  border: 1px solid rgba(179, 127, 235, 0.3);
}

.device-tag.h200 {
  background: rgba(250, 140, 22, 0.2);
  color: var(--accent-orange);
  border: 1px solid rgba(250, 140, 22, 0.3);
}

/* ========== 进度条 ========== */
.progress-bar {
  height: 4px;
  background: rgba(64, 169, 255, 0.15);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-bar .fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1s ease;
}

/* ========== 响应式 ========== */
@media (max-width: 1200px) {
  .page-container {
    padding: 12px 16px;
    gap: 12px;
  }
}

@media (max-width: 768px) {
  .top-nav {
    padding: 0 16px;
    height: 56px;
  }

  .top-nav .nav-list a {
    padding: 6px 12px;
    font-size: 12px;
  }

  .page-container {
    height: calc(100vh - 56px);
    padding: 8px 12px;
    gap: 8px;
  }

  .stat-value {
    font-size: 22px;
  }

  .index-title {
    font-size: 28px;
  }

  .index-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 20px;
  }
}
