*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #00B8A5;
  --primary-light: #33c9b9;
  --primary-dark: #009e8f;
  --primary-bg: rgba(0,184,165,0.05);
  --secondary: #214BB5;
  --secondary-light: #3d63c7;
  --secondary-dark: #1a3d96;
  --dark: #0a2540;
  --dark-light: #1a3a5c;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --success: #52c41a;
  --warning: #faad14;
  --error: #ff4d4f;
  --info: #1890ff;
  --processing: #1677ff;
  --cyan: #13c2c2;
  --purple: #722ed1;
  --gold: #faad14;
  --sidebar-width: 220px;
  --sidebar-collapsed: 64px;
  --header-height: 64px;
  --border-radius: 6px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 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);
  --transition: all 0.3s ease;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color: var(--gray-800);
  background-color: var(--gray-100);
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }
button, input, select, textarea { font-family: inherit; font-size: inherit; line-height: inherit; }
ul, ol { list-style: none; }

/* Loading */
.app-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--gray-50);
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.app-loading p { margin-top: 12px; color: var(--gray-500); font-size: 13px; }

/* Fade in */
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Utility */
.fw-medium { font-weight: 500; }
.fw-semibold { font-weight: 600; }
.fw-bold { font-weight: 700; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-muted { color: var(--gray-500); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.p-16 { padding: 16px; }
.p-24 { padding: 24px; }

/* Grid */
.row { display: flex; flex-wrap: wrap; margin: -8px; }
.col-6 { flex: 0 0 50%; max-width: 50%; padding: 8px; }
.col-4 { flex: 0 0 33.333%; max-width: 33.333%; padding: 8px; }
.col-3 { flex: 0 0 25%; max-width: 25%; padding: 8px; }
@media (max-width: 768px) {
  .col-6, .col-4, .col-3 { flex: 0 0 100%; max-width: 100%; }
}

/* Space */
.space { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.space-sm { gap: 4px; }
.space-lg { gap: 16px; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* Login Page */
.login-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #f0f4f8 0%, #e8edf5 50%, #f0f8f7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-container {
  width: 100%;
  max-width: 1040px;
}
.login-card {
  display: flex;
  background: rgba(255,255,255,0.98);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  overflow: hidden;
  min-height: 580px;
}
.login-brand {
  flex: 1;
  background: linear-gradient(135deg, #0a2540 0%, #143a5e 50%, #214BB5 80%, #00B8A5 100%);
  color: #fff;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-brand::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0,184,165,0.15) 0%, transparent 70%);
  border-radius: 50%;
}
.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #00B8A5 0%, #214BB5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 4px 20px rgba(0,184,165,0.4);
}
.brand-name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1px;
}
.brand-sub {
  font-size: 11px;
  opacity: 0.7;
  letter-spacing: 2px;
  margin-top: 2px;
}
.brand-title {
  font-size: 30px;
  font-weight: 700;
  margin: 40px 0 12px;
  line-height: 1.3;
}
.brand-title-sub {
  font-size: 18px;
  font-weight: 400;
  opacity: 0.9;
}
.brand-desc {
  font-size: 13px;
  opacity: 0.85;
  line-height: 1.7;
  margin: 0;
}
.brand-features {
  margin-top: 32px;
}
.brand-feature {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
}
.feature-icon {
  font-size: 18px;
  margin-right: 10px;
}
.brand-footer {
  position: relative;
  z-index: 1;
}
.brand-stats {
  display: flex;
  gap: 28px;
  margin-bottom: 24px;
}
.brand-stats .stat-val {
  font-size: 22px;
  font-weight: 700;
}
.brand-stats .stat-label {
  font-size: 12px;
  opacity: 0.85;
}
.brand-copyright {
  font-size: 11px;
  opacity: 0.6;
}
.login-form-panel {
  width: 480px;
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.form-header {
  margin-bottom: 24px;
}
.form-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 8px;
}
.form-header h2 {
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 8px;
}
.form-header p {
  color: var(--gray-500);
  margin-bottom: 32px;
  font-size: 13px;
}
.input-wrapper {
  display: flex;
  align-items: center;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  background: var(--white);
  transition: var(--transition);
}
.input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-bg);
}
.input-icon {
  padding: 0 12px;
  color: var(--gray-400);
  font-size: 16px;
}
.input-wrapper .form-input {
  border: none;
  box-shadow: none;
  padding: 10px 12px 10px 0;
}
.input-wrapper .form-input:focus {
  box-shadow: none;
}
.captcha-code {
  padding: 0 12px;
  font-weight: 700;
  letter-spacing: 3px;
  background: linear-gradient(90deg, #00B8A5 0%, #214BB5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  user-select: none;
  font-size: 16px;
  cursor: pointer;
}
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 13px;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--gray-600);
}
.forgot-link {
  color: var(--primary);
}
.login-tab-pane {
  display: none;
}
.login-tab-pane.active {
  display: block;
}
.login-divider {
  margin-top: 24px;
  font-size: 12px;
  color: var(--gray-400);
  text-align: center;
  position: relative;
}
.login-divider::before,
.login-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: var(--gray-200);
}
.login-divider::before { left: 0; }
.login-divider::after { right: 0; }
.social-login {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
}
.social-icon {
  font-size: 22px;
  cursor: pointer;
  transition: var(--transition);
}
.social-icon:hover {
  transform: scale(1.1);
}
.demo-accounts {
  margin-top: 24px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(0,184,165,0.05) 0%, rgba(33,75,181,0.05) 100%);
  border-radius: 6px;
  font-size: 12px;
  color: var(--gray-600);
  border: 1px dashed rgba(0,184,165,0.3);
}
.demo-row {
  margin-bottom: 6px;
}
.demo-row:last-child {
  margin-bottom: 0;
}
.demo-icon {
  color: var(--primary);
  margin-right: 6px;
}
.phone-login,
.qr-login {
  text-align: center;
}
.qr-code {
  width: 180px;
  height: 180px;
  margin: 20px auto 16px;
  background: #fafafa;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-hint {
  color: var(--gray-500);
  font-size: 13px;
}

/* Error Pages */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f4f8 0%, #e8edf5 50%, #f0f8f7 100%);
  padding: 20px;
}
.error-content {
  text-align: center;
  max-width: 480px;
}
.error-code {
  font-size: 120px;
  font-weight: 800;
  background: linear-gradient(135deg, #00B8A5 0%, #214BB5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: 16px;
}
.error-icon {
  font-size: 64px;
  margin-bottom: 24px;
}
.error-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 12px;
}
.error-desc {
  font-size: 15px;
  color: var(--gray-500);
  margin-bottom: 32px;
}
.error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Settings tab panes */
.settings-tab-pane {
  display: none;
}
.settings-tab-pane.active {
  display: block;
}

/* Responsive */
@media (max-width: 900px) {
  .login-card {
    flex-direction: column;
  }
  .login-brand {
    padding: 32px;
  }
  .login-form-panel {
    width: 100%;
    padding: 32px 24px;
  }
  .brand-title {
    font-size: 24px;
  }
  .brand-stats {
    gap: 16px;
  }
  .brand-stats .stat-val {
    font-size: 18px;
  }
}
@media (max-width: 480px) {
  .login-bg {
    padding: 12px;
  }
  .login-brand {
    padding: 24px 20px;
  }
  .login-form-panel {
    padding: 24px 20px;
  }
  .brand-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .brand-title {
    font-size: 20px;
    margin: 24px 0 8px;
  }
  .brand-features {
    display: none;
  }
  .error-code {
    font-size: 80px;
  }
  .error-actions {
    flex-direction: column;
  }
  .error-actions .btn {
    width: 100%;
  }
}


/* Bigscreen styles */
.bigscreen-page {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0a1628 0%, #0a2540 50%, #143a5e 100%);
  color: #fff;
  overflow: hidden;
  z-index: 9999;
}
.bigscreen-header {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid rgba(0,184,165,0.3);
}
.bigscreen-title {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(90deg, #00B8A5, #214BB5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.bigscreen-back {
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  font-size: 14px;
  padding: 6px 16px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  transition: all 0.3s;
}
.bigscreen-back:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.bigscreen-content {
  padding: 16px;
  height: calc(100vh - 60px);
  overflow: auto;
}
.bigscreen-grid {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 16px;
  height: 100%;
}
.bigscreen-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(0,184,165,0.2);
  border-radius: 8px;
  padding: 16px;
}
.bigscreen-card-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.bigscreen-stat {
  text-align: center;
  padding: 12px;
}
.bigscreen-stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #00B8A5;
}
.bigscreen-stat-label {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
}
.bigscreen-chart {
  height: 200px;
  width: 100%;
}
.bigscreen-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 13px;
}
.bigscreen-list-item:last-child { border-bottom: none; }

/* Steps component */
.steps { display: flex; margin-bottom: 24px; }
.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.step::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 50%;
  right: -50%;
  height: 2px;
  background: var(--gray-200);
}
.step:last-child::before { display: none; }
.step.active::before, .step.done::before { background: var(--primary); }
.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}
.step.active .step-number { background: var(--primary); color: var(--white); }
.step.done .step-number { background: var(--success); color: var(--white); }
.step-label { font-size: 12px; color: var(--gray-500); margin-top: 6px; }
.step.active .step-label { color: var(--primary); font-weight: 500; }

/* Timeline */
.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gray-200);
}
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -17px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gray-300);
  border: 2px solid var(--white);
}
.timeline-item.success::before { background: var(--success); }
.timeline-item.error::before { background: var(--error); }
.timeline-item.warning::before { background: var(--warning); }

/* Descriptions */
.desc-row { display: flex; border-bottom: 1px solid var(--gray-100); }
.desc-label {
  width: 120px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--gray-500);
  flex-shrink: 0;
}
.desc-value {
  flex: 1;
  padding: 8px 0;
  font-size: 13px;
  color: var(--gray-800);
}

/* Code block */
.code-block {
  background: #1e1e1e;
  color: #d4d4d4;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 12px;
  padding: 16px;
  border-radius: var(--border-radius);
  overflow-x: auto;
  white-space: pre;
  line-height: 1.6;
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 768px) { .quick-actions { grid-template-columns: repeat(2, 1fr); } }
.quick-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  background: var(--gray-50);
}
.quick-action-card:hover { background: var(--primary-bg); transform: translateY(-2px); }
.quick-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 8px;
  color: var(--white);
}
.quick-action-label { font-size: 12px; color: var(--gray-600); }

/* Drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}
.drawer-overlay.show { opacity: 1; visibility: visible; }
.drawer {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}
.drawer.show { right: 0; }
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--gray-100);
}
.drawer-title { font-size: 16px; font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-400);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-text { font-size: 14px; }

/* Avatar */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--white);
  font-weight: 600;
  flex-shrink: 0;
}
.avatar-sm { width: 24px; height: 24px; font-size: 11px; }
.avatar-md { width: 32px; height: 32px; font-size: 13px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }

/* Badge */
.badge-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
}
.badge-dot.success { background: var(--success); }
.badge-dot.warning { background: var(--warning); }
.badge-dot.error { background: var(--error); }
.badge-dot.processing { background: var(--processing); }
.badge-dot.default { background: var(--gray-400); }

/* ECharts container */
.chart-container { height: 320px; width: 100%; }
.chart-container-sm { height: 240px; width: 100%; }

