/* ============== 主题系统 ============== */
/* 默认 = 科技蓝（深色） */
:root, [data-theme="tech-blue"] {
  --ink-900: #0a1020;  --ink-800: #0e1729;  --ink-700: #142039;
  --ink-600: #1b2c4a;  --ink-500: #243b5e;
  --tech-300: #7dd3fc; --tech-400: #38bdf8; --tech-500: #0ea5e9; --tech-600: #0284c7;
  --ok-400: #34d399;   --ok-500: #10b981;
  --warn-400: #fbbf24; --warn-500: #f59e0b;
  --danger-400: #f87171; --danger-500: #ef4444;
  --text-primary: #f1f5f9; --text-secondary: #94a3b8; --text-tertiary: #64748b;
  --glow: 0 0 24px rgba(56,189,248,.25);
  color-scheme: dark;
}
/* 碳中和绿（深色） */
[data-theme="carbon-green"] {
  --ink-900: #0b1410;  --ink-800: #0f1a14;  --ink-700: #14241c;
  --ink-600: #1d3327;  --ink-500: #264532;
  --tech-300: #6ee7b7; --tech-400: #34d399; --tech-500: #10b981; --tech-600: #059669;
  --ok-400: #4ade80;   --ok-500: #22c55e;
  --warn-400: #fbbf24; --warn-500: #f59e0b;
  --danger-400: #f87171; --danger-500: #ef4444;
  --text-primary: #f1f5f9; --text-secondary: #94a3b8; --text-tertiary: #64748b;
  --glow: 0 0 24px rgba(52,211,153,.25);
  color-scheme: dark;
}
/* 紫罗兰（深色） */
[data-theme="violet"] {
  --ink-900: #0e0a1f;  --ink-800: #16102d;  --ink-700: #1f1842;
  --ink-600: #2e2453;  --ink-500: #3d3170;
  --tech-300: #c4b5fd; --tech-400: #a78bfa; --tech-500: #8b5cf6; --tech-600: #7c3aed;
  --ok-400: #34d399;   --ok-500: #10b981;
  --warn-400: #fbbf24; --warn-500: #f59e0b;
  --danger-400: #fb7185; --danger-500: #f43f5e;
  --text-primary: #f1f5f9; --text-secondary: #a8a4c2; --text-tertiary: #6b6483;
  --glow: 0 0 24px rgba(167,139,250,.25);
  color-scheme: dark;
}
/* 明亮商务（浅色） */
[data-theme="light"] {
  --ink-900: #f7f8fb;  --ink-800: #ffffff;  --ink-700: #f1f5f9;
  --ink-600: #e2e8f0;  --ink-500: #cbd5e1;
  --tech-300: #0284c7; --tech-400: #0284c7; --tech-500: #0369a1; --tech-600: #075985;
  --ok-400: #16a34a;   --ok-500: #15803d;
  --warn-400: #d97706; --warn-500: #b45309;
  --danger-400: #dc2626; --danger-500: #b91c1c;
  --text-primary: #0f172a; --text-secondary: #475569; --text-tertiary: #64748b;
  --glow: 0 0 0 transparent;
  color-scheme: light;
}
[data-theme="light"] body { color: var(--text-primary); }
[data-theme="light"] .text-slate-100 { color: #0f172a !important; }
[data-theme="light"] .text-slate-200,
[data-theme="light"] .text-slate-300 { color: #334155 !important; }
[data-theme="light"] .text-slate-400 { color: #64748b !important; }
[data-theme="light"] .text-slate-500 { color: #94a3b8 !important; }
[data-theme="light"] ::-webkit-scrollbar-track { background: #f1f5f9; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #cbd5e1; }
[data-theme="light"] .form-input,
[data-theme="light"] .form-select,
[data-theme="light"] .form-textarea { background: #fff; border-color: #cbd5e1; color: #0f172a; }
[data-theme="light"] .form-input:focus { border-color: #0284c7; }

/* 高对比车间大屏（黑底荧光） */
[data-theme="contrast"] {
  --ink-900: #000000;  --ink-800: #0a0a0a;  --ink-700: #141414;
  --ink-600: #2a2a2a;  --ink-500: #3a3a3a;
  --tech-300: #00f5ff; --tech-400: #00e5ff; --tech-500: #00bcd4; --tech-600: #0097a7;
  --ok-400: #00ff88;   --ok-500: #00cc6a;
  --warn-400: #ffd700; --warn-500: #ffaa00;
  --danger-400: #ff4444; --danger-500: #ff0000;
  --text-primary: #ffffff; --text-secondary: #aaa; --text-tertiary: #777;
  --glow: 0 0 30px rgba(0,229,255,.6);
  color-scheme: dark;
}
[data-theme="contrast"] .card,
[data-theme="contrast"] .kpi { border-width: 2px; }
[data-theme="contrast"] .kpi-value { text-shadow: 0 0 12px currentColor; }

/* 全局样式 */
* { box-sizing: border-box; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0e1729; }
::-webkit-scrollbar-thumb { background: #1b2c4a; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #243b5e; }

/* 侧栏菜单项 */
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 6px;
  color: #94a3b8; cursor: pointer;
  transition: all .15s;
}
.nav-item:hover { background: #142039; color: #e2e8f0; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(14,165,233,.2), rgba(16,185,129,.05));
  color: #38bdf8;
  border-left: 2px solid #38bdf8;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-section { padding: 10px 12px 4px; font-size: 11px; color: #475569; text-transform: uppercase; letter-spacing: .05em; }

/* 卡片 */
.card {
  background: #0e1729;
  border: 1px solid #1b2c4a;
  border-radius: 10px;
  padding: 18px;
}
.card-title {
  font-size: 14px; font-weight: 600; color: #e2e8f0;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}

/* 表格 */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th { text-align: left; padding: 10px 12px; background: #142039; color: #94a3b8; font-weight: 500; font-size: 12px; }
.tbl td { padding: 10px 12px; border-top: 1px solid #1b2c4a; color: #e2e8f0; }
.tbl tr:hover td { background: rgba(30,41,59,.4); }

/* 状态徽章 */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; font-size: 11px;
  border: 1px solid;
}
.badge-running   { color: #34d399; border-color: rgba(52,211,153,.4); background: rgba(16,185,129,.1); }
.badge-standby   { color: #94a3b8; border-color: rgba(148,163,184,.4); background: rgba(148,163,184,.1); }
.badge-maintaining { color: #fbbf24; border-color: rgba(251,191,36,.4); background: rgba(245,158,11,.1); }
.badge-fault     { color: #f87171; border-color: rgba(248,113,113,.4); background: rgba(239,68,68,.1); }
.badge-overdue   { color: #f87171; border-color: rgba(248,113,113,.4); background: rgba(239,68,68,.1); }
.badge-due       { color: #fbbf24; border-color: rgba(251,191,36,.4); background: rgba(245,158,11,.1); }
.badge-upcoming  { color: #38bdf8; border-color: rgba(56,189,248,.4); background: rgba(14,165,233,.1); }
.badge-normal    { color: #34d399; border-color: rgba(52,211,153,.4); background: rgba(16,185,129,.1); }
.badge-pending   { color: #fbbf24; border-color: rgba(251,191,36,.4); background: rgba(245,158,11,.1); }
.badge-in_progress { color: #38bdf8; border-color: rgba(56,189,248,.4); background: rgba(14,165,233,.1); }
.badge-completed { color: #34d399; border-color: rgba(52,211,153,.4); background: rgba(16,185,129,.1); }
.badge-open      { color: #f87171; border-color: rgba(248,113,113,.4); background: rgba(239,68,68,.1); }
.badge-closed    { color: #94a3b8; border-color: rgba(148,163,184,.4); background: rgba(148,163,184,.1); }
.badge-high      { color: #f87171; border-color: rgba(248,113,113,.4); background: rgba(239,68,68,.1); }
.badge-medium    { color: #fbbf24; border-color: rgba(251,191,36,.4); background: rgba(245,158,11,.1); }
.badge-low       { color: #38bdf8; border-color: rgba(56,189,248,.4); background: rgba(14,165,233,.1); }
.badge-critical  { color: #fff; border-color: #ef4444; background: #ef4444; }

/* 按钮 */
.btn {
  padding: 6px 12px; border-radius: 6px; font-size: 12px;
  border: 1px solid #1b2c4a; cursor: pointer;
  transition: all .15s; display: inline-flex; align-items: center; gap: 4px;
}
.btn:hover { border-color: #38bdf8; color: #38bdf8; }
.btn-primary {
  background: linear-gradient(90deg,#0ea5e9,#10b981);
  color: white; border: none;
}
.btn-primary:hover { opacity: .9; color: white; }
.btn-danger { background: rgba(239,68,68,.1); color: #f87171; border-color: rgba(248,113,113,.4); }
.btn-warn { background: rgba(245,158,11,.1); color: #fbbf24; border-color: rgba(251,191,36,.4); }
.btn-sm { padding: 4px 8px; font-size: 11px; }

/* 表单 */
.form-input,
.form-select,
.form-textarea {
  width: 100%; padding: 8px 10px; border-radius: 6px;
  background: #0a1020; border: 1px solid #1b2c4a;
  color: #e2e8f0; font-size: 13px; outline: none;
  transition: border-color .15s;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus { border-color: #38bdf8; }
.form-label { font-size: 12px; color: #94a3b8; margin-bottom: 4px; display: block; }

/* KPI 卡片 */
.kpi {
  background: linear-gradient(145deg,#0e1729,#142039);
  border: 1px solid #1b2c4a;
  border-radius: 10px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.kpi-label { font-size: 12px; color: #94a3b8; }
.kpi-value { font-size: 28px; font-weight: 700; margin-top: 6px; }
.kpi-sub { font-size: 11px; color: #64748b; margin-top: 6px; }
.kpi::before {
  content: ''; position: absolute; top: 0; right: 0;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(56,189,248,.15), transparent 60%);
  pointer-events: none;
}

/* IoT 实时指示 */
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: pulse 1.5s infinite;
  display: inline-block;
}
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: .4; }
  100% { opacity: 1; }
}

/* QR 码居中 */
.qr-canvas-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 12px; background: white; border-radius: 8px;
}
