/* 极算云 - 全局样式 */
:root {
  --primary: #1E40AF;
  --primary-light: #3B82F6;
  --accent: #7C3AED;
  --gradient-main: linear-gradient(135deg, #3B82F6 0%, #7C3AED 100%);
  --gradient-hero: linear-gradient(135deg, #0F172A 0%, #1E3A8A 50%, #4C1D95 100%);
  --sidebar-bg: #0F172A;
  --sidebar-hover: #1E293B;
  --content-bg: #F8FAFC;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.1);
  --card-shadow-hover: 0 10px 25px -5px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; }

html, body {
  font-family: 'Noto Sans SC', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

body { background: var(--content-bg); color: #0F172A; }

.font-display { font-family: 'JetBrains Mono', 'Noto Sans SC', monospace; letter-spacing: -0.02em; }

/* ===== 通用按钮 ===== */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.625rem 1.25rem; border-radius: 0.625rem;
  background: var(--gradient-main); color: white; font-weight: 600;
  transition: all 0.2s; box-shadow: 0 4px 14px rgba(59,130,246,0.35);
  border: none; cursor: pointer; text-decoration: none;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(124,58,237,0.4); }
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.625rem 1.25rem; border-radius: 0.625rem;
  background: white; color: #1E40AF; font-weight: 600;
  border: 1.5px solid #BFDBFE; transition: all 0.2s; cursor: pointer; text-decoration: none;
}
.btn-secondary:hover { background: #EFF6FF; border-color: #3B82F6; }
.btn-ghost {
  padding: 0.5rem 1rem; border-radius: 0.5rem; color: #475569;
  background: transparent; border: 1px solid #E2E8F0; cursor: pointer;
  transition: all 0.15s; font-weight: 500;
}
.btn-ghost:hover { background: #F1F5F9; color: #0F172A; }

/* ===== 卡片 ===== */
.card {
  background: white; border-radius: 12px; box-shadow: var(--card-shadow);
  transition: box-shadow 0.25s, transform 0.25s;
}
.card-hover:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-2px); }

/* ===== 状态标签 ===== */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.status-running { background: #DCFCE7; color: #15803D; }
.status-stopped { background: #F1F5F9; color: #475569; }
.status-creating { background: #DBEAFE; color: #1E40AF; }
.status-error, .status-failed { background: #FEE2E2; color: #B91C1C; }
.status-pending { background: #FEF3C7; color: #B45309; }
.status-completed { background: #DCFCE7; color: #15803D; }
.status-paid { background: #DCFCE7; color: #15803D; }
.status-cancelled { background: #F1F5F9; color: #475569; }
.status-verified { background: #DCFCE7; color: #15803D; }
.status-unverified { background: #F1F5F9; color: #64748B; }
.status-rejected { background: #FEE2E2; color: #B91C1C; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ===== Hero 背景 ===== */
.hero-bg { background: var(--gradient-hero); position: relative; overflow: hidden; }
.grid-bg {
  position: absolute; inset: 0; opacity: 0.15;
  background-image:
    linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}
.glow {
  position: absolute; width: 500px; height: 500px; border-radius: 50%;
  filter: blur(120px); opacity: 0.45; pointer-events: none;
  animation: glow-pulse 8s ease-in-out infinite alternate;
}
@keyframes glow-pulse {
  0% { transform: scale(0.95); opacity: 0.35; }
  100% { transform: scale(1.15); opacity: 0.55; }
}

/* 粒子/星点 */
.particles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.particle {
  position: absolute; width: 2px; height: 2px; background: white; border-radius: 50%;
  opacity: 0; animation: particle-float linear infinite;
}
@keyframes particle-float {
  0% { transform: translateY(100vh) translateX(0); opacity: 0; }
  10% { opacity: 0.8; }
  90% { opacity: 0.8; }
  100% { transform: translateY(-10vh) translateX(50px); opacity: 0; }
}

/* ===== 入场动画 ===== */
.fade-in { animation: fadeIn 0.8s ease-out both; }
.fade-in-d1 { animation: fadeIn 0.8s 0.15s ease-out both; }
.fade-in-d2 { animation: fadeIn 0.8s 0.3s ease-out both; }
.fade-in-d3 { animation: fadeIn 0.8s 0.45s ease-out both; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 玻璃态卡片 ===== */
.glass {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.15);
}

/* ===== 控制台布局 ===== */
.console-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: var(--sidebar-bg); color: white;
  position: fixed; left: 0; top: 0; bottom: 0;
  display: flex; flex-direction: column; z-index: 40;
  transition: transform 0.25s;
}
.sidebar-brand {
  padding: 20px 22px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-section {
  padding: 12px 22px 6px; font-size: 11px; font-weight: 600;
  color: #64748B; text-transform: uppercase; letter-spacing: 0.08em;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 22px; color: #CBD5E1; cursor: pointer;
  font-size: 14px; transition: all 0.15s; text-decoration: none;
  border-left: 3px solid transparent;
}
.sidebar-link:hover { background: var(--sidebar-hover); color: white; }
.sidebar-link.active {
  background: linear-gradient(90deg, rgba(59,130,246,0.18), transparent);
  color: white; border-left-color: var(--primary-light);
}
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-footer { padding: 14px 22px; border-top: 1px solid rgba(255,255,255,0.06); }

.main-area {
  margin-left: 240px; flex: 1;
  display: flex; flex-direction: column; min-height: 100vh;
}
.topbar {
  height: 60px; background: white; border-bottom: 1px solid #E2E8F0;
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; padding: 0 24px;
}
.content-wrap { padding: 24px; flex: 1; }

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,0.3); }
  .main-area { margin-left: 0; }
}

/* ===== 表格 ===== */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; padding: 12px 14px; font-size: 12px; font-weight: 600;
  color: #64748B; text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid #E2E8F0; background: #F8FAFC;
}
.tbl td { padding: 14px; font-size: 14px; color: #1E293B; border-bottom: 1px solid #F1F5F9; }
.tbl tr:hover td { background: #F8FAFC; }

/* ===== 输入控件 ===== */
.field {
  width: 100%; padding: 0.625rem 0.875rem; border: 1px solid #CBD5E1;
  border-radius: 0.5rem; font-size: 14px; transition: all 0.15s;
  background: white; outline: none;
}
.field:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.field-label { display: block; font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 6px; }

/* ===== 模态框 ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.55);
  backdrop-filter: blur(4px); z-index: 50;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.show { display: flex; animation: fadeIn 0.2s ease-out; }
.modal-card {
  background: white; border-radius: 16px; max-width: 540px; width: 100%;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.35);
  animation: slideUp 0.25s ease-out;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== 进度条 ===== */
.progress-bar { width: 100%; height: 6px; background: #E2E8F0; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--gradient-main); border-radius: 999px; transition: width 0.4s; }

/* ===== Hero 标题 ===== */
.hero-title { font-family: 'JetBrains Mono', sans-serif; font-weight: 800; line-height: 1.05; letter-spacing: -0.03em; }

/* ===== 标签 ===== */
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.tag-blue { background: #DBEAFE; color: #1E40AF; }
.tag-purple { background: #EDE9FE; color: #6D28D9; }
.tag-green { background: #DCFCE7; color: #15803D; }
.tag-orange { background: #FFEDD5; color: #C2410C; }

/* ===== 滚动条美化 ===== */
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* ===== Toast ===== */
.toast {
  position: fixed; top: 80px; right: 24px; z-index: 9999;
  background: white; padding: 14px 20px; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  border-left: 4px solid var(--primary-light);
  animation: slideInRight 0.3s ease-out;
  max-width: 380px;
}
.toast.toast-error { border-left-color: #EF4444; }
.toast.toast-success { border-left-color: #10B981; }
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== 仪表盘渐变文字 ===== */
.gradient-text {
  background: var(--gradient-main); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}

/* ===== 卡片图标 ===== */
.icon-circle {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}

/* ===== 移动端遮罩 ===== */
.mobile-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 35; display: none; }
.mobile-mask.show { display: block; }

/* ===== Filter 按钮 ===== */
.filter-pill {
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: white; color: #475569; border: 1px solid #E2E8F0; cursor: pointer;
  transition: all 0.15s;
}
.filter-pill.active { background: var(--gradient-main); color: white; border-color: transparent; }
.filter-pill:hover:not(.active) { background: #F1F5F9; }

/* ===== 工作台步骤 ===== */
.workflow-step {
  display: flex; align-items: center; gap: 14px; padding: 18px;
  background: white; border-radius: 12px; border: 1px solid #E2E8F0;
  transition: all 0.2s;
}
.workflow-step:hover { border-color: var(--primary-light); transform: translateX(4px); }
.workflow-num {
  width: 36px; height: 36px; border-radius: 50%; background: var(--gradient-main);
  color: white; font-weight: 700; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
