﻿/* =========================================================
   FSSC AI_TaskCenter — Design System v3 (Premium)
   深色侧边栏 · 专业后台管理风格
   ========================================================= */

/* 1920px→16px(100%)，1680px以下→14px，超过1920px保持16px */
html {
  font-size: clamp(14px, 0.833vw, 16px);
}

/* ==================== CSS Custom Properties ==================== */
:root {
  /* Sidebar */
  --sidebar-bg: #0f0f23;
  --sidebar-surface: #1a1a35;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: rgba(99, 102, 241, 0.2);
  --sidebar-width: 240px;
  --sidebar-collapsed: 0px;
  --topbar-height: 56px;

  /* Brand — Deep Indigo */
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --primary-deeper: #3730a3;
  --primary-bg: rgba(99, 102, 241, 0.1);
  --primary-glow: rgba(99, 102, 241, 0.25);

  /* Accent — Emerald */
  --accent: #10b981;
  --accent-light: #34d399;
  --accent-bg: rgba(16, 185, 129, 0.1);
  --accent-glow: rgba(16, 185, 129, 0.2);

  /* Status Colors */
  --success: #059669;
  --success-light: #10b981;
  --success-bg: rgba(5, 150, 105, 0.1);
  --warning: #d97706;
  --warning-light: #f59e0b;
  --warning-bg: rgba(217, 119, 6, 0.1);
  --danger: #dc2626;
  --danger-light: #ef4444;
  --danger-bg: rgba(220, 38, 38, 0.1);
  --info: #3b82f6;
  --info-light: #60a5fa;
  --info-bg: rgba(59, 130, 246, 0.1);

  --orange: #f97316;
  --orange-bg: rgba(249, 115, 22, 0.1);

  /* Surface — Full Slate Hierarchy */
  --surface: #ffffff;
  --surface-secondary: #f8fafc;
  --surface-tertiary: #f1f5f9;
  --surface-hover: #eef2f7;
  --surface-hover: #eef2f7;
  --surface-elevated: #ffffff;

  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #f8fafc;

  /* Border */
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --border-focus: #6366f1;

  /* Radius */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;

  /* Shadow — Color-tinted for depth */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.06), 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 40px rgba(15, 23, 42, 0.08), 0 4px 16px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 60px rgba(15, 23, 42, 0.10), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 4px 20px rgba(99, 102, 241, 0.25);

  /* Transition */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;

  /* Card accent colors (top border stripe) */
  --card-accent-primary: linear-gradient(90deg, #6366f1, #818cf8);
  --card-accent-success: linear-gradient(90deg, #059669, #10b981);
  --card-accent-warning: linear-gradient(90deg, #d97706, #f59e0b);
  --card-accent-danger: linear-gradient(90deg, #dc2626, #ef4444);
  --card-accent-info: linear-gradient(90deg, #3b82f6, #60a5fa);
}

/* ==================== Base Reset ==================== */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--surface-secondary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--primary-dark);
}

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==================== Layout: Sidebar + Content ==================== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: rgba(255, 255, 255, 0.85);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  overflow: hidden;
}

.sidebar-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  position: relative;
}
.sidebar-brand:hover {
  color: #fff;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #4f6ef7, #7c3aed);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79, 110, 247, 0.4);
  position: relative;
  z-index: 1;
}

.sidebar-logo-glow {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: radial-gradient(circle, rgba(79, 110, 247, 0.3), transparent 70%);
  animation: pulse 3s ease-in-out infinite;
  pointer-events: none;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.sidebar-brand-title {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #fff, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sidebar-brand-sub {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.4);
  -webkit-text-fill-color: rgba(255, 255, 255, 0.4);
}

/* ---- Nav Section ---- */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
}
.sidebar-nav::-webkit-scrollbar {
  width: 3px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.sidebar-section-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.2);
  padding: 20px 14px 6px;
}

/* ---- 侧边栏可折叠分组 ---- */
.sidebar-section-group {
  margin-bottom: 2px;
}

.sidebar-section-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

.sidebar-section-toggle i.section-icon {
  font-size: 0.75rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.25);
}

.sidebar-section-toggle:hover {
  color: rgba(255, 255, 255, 0.65);
}

.sidebar-section-toggle:hover i.section-icon {
  color: rgba(255, 255, 255, 0.45);
}

.sidebar-chevron {
  font-size: 0.7rem;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.sidebar-chevron.collapsed {
  transform: rotate(-90deg);
}

.sidebar-collapse-content {
  overflow: hidden;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 2px;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.sidebar-item i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  transition: var(--transition);
}
.sidebar-item:hover {
  background: var(--sidebar-hover);
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}
.sidebar-item:hover i {
  color: var(--primary-light);
}
.sidebar-item.active {
  background: var(--sidebar-active);
  color: #fff;
}
.sidebar-item.active i {
  color: var(--primary-light);
}
.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--primary-light);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
}

/* ---- Sidebar Footer ---- */
.sidebar-footer {
  padding: 10px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  transition: var(--transition);
}
.sidebar-user:hover {
  background: var(--sidebar-hover);
}

.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f6ef7, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}
.sidebar-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-code {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
}

/* ---- Main Content ---- */
.app-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background-image:
    radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.015) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(16, 185, 129, 0.01) 0%, transparent 50%);
}

/* ---- Top Bar ---- */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--topbar-height);
  background: rgba(255, 255, 255, 0.80);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.topbar-toggle:hover {
  background: var(--surface-tertiary);
  color: var(--text-primary);
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-bg);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid rgba(79, 110, 247, 0.15);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}
.topbar-user:hover {
  background: var(--surface-tertiary);
}
.topbar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f6ef7, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
}
.topbar-user-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
}
.topbar-chevron {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ---- Content Area ---- */
.app-content {
  flex: 1;
  padding: 20px 24px;
  width: 100%;
  background-image: radial-gradient(circle at 25% 0%, rgba(99, 102, 241, 0.02) 0%, transparent 50%);
}

/* ==================== Page Header ==================== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-title i {
  color: var(--primary);
}

.page-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.page-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==================== Stats Cards ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  border: 1px solid var(--border);
  transition: var(--transition-spring);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.stat-card:hover {
  border-color: transparent;
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.stat-card:hover::before {
  opacity: 1;
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 14px;
  transition: var(--transition-spring);
}
.stat-card:hover .stat-card-icon {
  transform: scale(1.1) rotate(-3deg);
}
.stat-card-icon.blue { background: var(--primary-bg); color: var(--primary); }
.stat-card-icon.green { background: var(--success-bg); color: var(--success); }
.stat-card-icon.amber { background: var(--warning-bg); color: var(--warning); }
.stat-card-icon.red { background: var(--danger-bg); color: var(--danger); }
.stat-card-icon.teal { background: var(--accent-bg); color: var(--accent); }

/* Accent top bars for stat cards */
.stat-card:nth-child(1)::before { background: var(--card-accent-primary); }
.stat-card:nth-child(2)::before { background: var(--card-accent-success); }
.stat-card:nth-child(3)::before { background: var(--card-accent-info); }
.stat-card:nth-child(4)::before { background: var(--card-accent-danger); }

.stat-card-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.stat-card-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* ==================== Cards ==================== */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-spring);
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-accent-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: transparent;
}
.card:hover::before {
  opacity: 1;
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  font-weight: 600;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 20px;
}

/* ==================== Tables ==================== */
.table-responsive {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table {
  margin-bottom: 0;
  font-size: 0.85rem;
  border-collapse: separate;
  border-spacing: 0;
}
.table > :not(caption) > * > * {
  padding: 12px 14px;
  border-bottom-color: var(--border);
  vertical-align: middle;
}

.table > thead {
  background: var(--surface-tertiary);
}
.table > thead > tr > th {
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--surface-tertiary);
  z-index: 5;
}

.table > tbody > tr {
  transition: var(--transition);
}
.table > tbody > tr:hover {
  background: var(--surface-hover) !important;
}
.table > tbody > tr:hover > td,
.table > tbody > tr:hover > th {
  color: inherit !important;
  --bs-table-color-state: inherit;
}
.table > tbody > tr.selected {
  background: var(--surface-hover) !important;
  border-left: 3px solid var(--primary);
}
.table > tbody > tr.selected > td,
.table > tbody > tr.selected > th {
  color: inherit !important;
  --bs-table-color-state: inherit;
}

.table > tbody > tr:last-child td {
  border-bottom: none;
}

/* Striped variant */
.table-striped > tbody > tr:nth-of-type(odd) {
  background: var(--surface-secondary);
}


.table-bordered {
  border-color: var(--border);
}

/* Table cell truncation */
.table-cell-truncate {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==================== Table: flat rows with ellipsis (鎾戞弧+鎵佸钩琛? ==================== */
/* Both task tables: fixed layout so remaining width fills container */
#taskTable, #adminTaskTable {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
}
/* Data cells: single line, ellipsis on overflow */
#taskTable td, #adminTaskTable td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Header cells: no ellipsis, but also never wrap */
#taskTable th, #adminTaskTable th {
  white-space: nowrap;
}
/* Action buttons column: prevent clipping */
#taskTable td:last-child,
#adminTaskTable td:last-child {
  overflow: visible;
  min-width: 120px;
  padding-right: 14px;
  text-align: center;
}
/* Action buttons inside last cell: normal spacing */
#taskTable td:last-child .btn,
#adminTaskTable td:last-child .btn {
  margin: 0 1px;
}
/* Icon centered columns (override inline style) */
#taskTable th:nth-child(7),
#taskTable th:nth-child(8),
#taskTable th:nth-child(10),
#taskTable th:nth-child(11),
#adminTaskTable th:nth-child(8),
#adminTaskTable th:nth-child(9),
#adminTaskTable th:nth-child(11),
#adminTaskTable th:nth-child(12) {
  width: 56px !important;
  text-align: center;
}
/* 浠诲姟绫诲瀷 columns */
#taskTable th:nth-child(6),
#adminTaskTable th:nth-child(7) {
  width: 70px !important;
}
/* Cron 鈥?width controlled by inline style */
/* Date columns 鈥?width controlled by inline style */
/* Admin user badge */
#adminTaskTable th:nth-child(1) {
  width: 140px !important;
}
/* Operation column: override inline style */
#taskTable th:last-child,
#adminTaskTable th:last-child {
  width: 120px !important;
}
/* Also override inline width on the operation column in thead */
#taskTable thead tr th:last-child,
#adminTaskTable thead tr th:last-child {
  width: 120px !important;
}

/* ---- Action Buttons in Table ---- */
.action-btns {
  white-space: nowrap;
}
.action-btns .btn {
  padding: 4px 8px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
  opacity: 0.7;
  transition: var(--transition);
}
.action-btns .btn:hover {
  opacity: 1;
  transform: translateY(-1px);
}
.action-btns .btn + .btn {
  margin-left: 4px;
}

/* ==================== Forms ==================== */
.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-control, .form-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  padding: 8px 12px;
  transition: var(--transition);
  color: var(--text-primary);
  background: var(--surface);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.12);
  outline: none;
}
.form-control::placeholder {
  color: var(--text-muted);
}
.form-control-sm {
  padding: 6px 10px;
  font-size: 0.8rem;
}

.form-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}
.form-check-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.12);
}

/* Floating label effect on focus */
.form-group {
  position: relative;
}

/* Filter bars */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}
.filter-bar .filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.filter-bar label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==================== Buttons ==================== */
.btn {
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 8px 16px;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.btn:active {
  transform: translateY(0);
}
.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.78rem;
}
.btn-lg {
  padding: 12px 24px;
  font-size: 1rem;
}
.btn-xs {
  padding: 2px 8px;
  font-size: 0.7rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #fff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(135deg, var(--success-light), var(--success));
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}
.btn-success:hover {
  color: #fff;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger-light), var(--danger));
  color: #fff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}
.btn-danger:hover {
  color: #fff;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
  transform: translateY(-2px);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning-light), var(--warning));
  color: #fff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}
.btn-warning:hover {
  color: #fff;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
  transform: translateY(-2px);
}

.btn-info {
  background: linear-gradient(135deg, var(--info-light), var(--info));
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}
.btn-info:hover {
  color: #fff;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--surface-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-outline-primary {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
}

.btn-outline-secondary {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline-secondary:hover {
  background: var(--surface-tertiary);
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.btn-outline-danger {
  background: transparent;
  border: 1.5px solid var(--danger);
  color: var(--danger);
}
.btn-outline-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-outline-warning {
  background: transparent;
  border: 1.5px solid #f0ad4e;
  color: #f0ad4e;
}
.btn-outline-warning:hover {
  background: #f0ad4e;
  color: #fff;
}

/* ==================== Badges ==================== */
.badge {
  font-weight: 500;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.2px;
}
.badge.bg-success {
  background: var(--success) !important;
}
.badge.bg-danger {
  background: var(--danger) !important;
}
.badge.bg-warning {
  background: var(--warning) !important;
}
.badge.bg-info {
  background: var(--info) !important;
}
.badge.bg-secondary {
  background: #94a3b8 !important;
}
.badge.bg-primary {
  background: var(--primary) !important;
}

/* ==================== Pagination ==================== */
.pagination {
  margin-bottom: 0;
  gap: 2px;
}
.pagination .page-link {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) !important;
  padding: 6px 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: var(--transition);
  background: var(--surface);
}
.pagination .page-link:hover {
  background: var(--surface-tertiary);
  border-color: var(--primary);
  color: var(--primary);
}
.page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(79, 110, 247, 0.3);
}
.page-item.disabled .page-link {
  opacity: 0.4;
  pointer-events: none;
}

/* ==================== Dropdown ==================== */
.dropdown-menu {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  margin-top: 6px;
}
.dropdown-item {
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.85rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dropdown-item:hover {
  background: var(--primary-bg);
  color: var(--primary);
}
.dropdown-item.text-danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
}
.dropdown-divider {
  margin: 4px 0;
  border-color: var(--border);
}

/* ==================== Modal ==================== */
.modal-content {
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  background: var(--surface);
}
.modal-header .modal-title {
  font-size: 1rem;
  font-weight: 600;
}
.modal-body {
  padding: 20px;
}
.modal-footer {
  border-top: 1px solid var(--border);
  padding: 14px 20px;
}

.modal.fade .modal-dialog {
  transition: transform 0.25s ease-out, opacity 0.25s ease-out;
}

/* ==================== Console / Log Viewer ==================== */
.console-viewer, .log-viewer {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  background: #1a1b2e;
  color: #cdd6f4;
  padding: 16px;
  border-radius: var(--radius);
  overflow: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  word-break: break-all;
  overflow-wrap: anywhere;
  max-height: 60vh;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.console-viewer .text-muted {
  color: #6c7086 !important;
}

/* ==================== Welcome Banner ==================== */
.welcome-banner {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 35%, #3730a3 65%, #4338ca 100%);
  padding: 24px 28px;
  border-radius: var(--radius-xl);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.2);
}
.welcome-banner::before {
  content: '';
  position: absolute;
  top: -60%;
  right: -10%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.1), transparent 70%);
  pointer-events: none;
}
.welcome-banner::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -5%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.06), transparent 70%);
  pointer-events: none;
}
.welcome-banner h4 {
  color: #fff !important;
  font-weight: 700;
  margin: 0;
  font-size: 1.15rem;
  position: relative;
  z-index: 1;
}
.welcome-banner p {
  margin: 6px 0 0;
  opacity: 0.7;
  font-size: 0.82rem;
  position: relative;
  z-index: 1;
}
.welcome-icon {
  height: 52px;
  opacity: 0.25;
  position: relative;
  z-index: 1;
}

/* ==================== Spinner / Loading ==================== */
.spinner-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* ==================== Alerts ==================== */
.alert {
  border: none;
  border-radius: var(--radius);
  font-size: 0.85rem;
}
.alert-dismissible .btn-close {
  padding: 1rem;
}

/* ==================== System Config Menu Cards ==================== */
.sys-menu-card {
  transition: var(--transition-spring);
  border: 1.5px solid var(--border);
  cursor: pointer;
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.sys-menu-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.3s ease;
}
.sys-menu-card:hover::before {
  opacity: 1;
}
.sys-menu-card:hover {
  border-color: transparent;
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
}
.sys-menu-card i {
  transition: var(--transition-spring);
}
.sys-menu-card:hover i {
  transform: scale(1.2) rotate(-5deg);
}

/* ==================== Login Page ==================== */
/* ==================== Login — Tech-Style ==================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #07060f;
  position: relative;
  overflow: hidden;
}

/* Animated gradient orbs — tech glow */
.login-page::before {
  content: '';
  position: absolute;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.10) 0%, rgba(99, 102, 241, 0.08) 40%, transparent 70%);
  top: -250px;
  right: -200px;
  animation: loginOrbA 12s ease-in-out infinite alternate;
  filter: blur(40px);
}
.login-page::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 45, 85, 0.08) 0%, rgba(139, 92, 246, 0.05) 40%, transparent 70%);
  bottom: -200px;
  left: -150px;
  animation: loginOrbB 14s ease-in-out infinite alternate;
  filter: blur(50px);
}

@keyframes loginOrbA {
  0% { transform: translate(0, 0) scale(1); opacity: 0.6; }
  100% { transform: translate(80px, 60px) scale(1.2); opacity: 1; }
}
@keyframes loginOrbB {
  0% { transform: translate(0, 0) scale(1); opacity: 0.5; }
  100% { transform: translate(-60px, -50px) scale(1.3); opacity: 1; }
}

/* Login card — enhanced glass with animated border */
.login-card {
  background: rgba(18, 18, 40, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(99, 102, 241, 0.06);
  position: relative;
  z-index: 1;
  border: 1px solid rgba(99, 102, 241, 0.15);
  animation-duration: 0.5s;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.login-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(99,102,241,0.3), rgba(124,58,237,0.1), rgba(0,212,170,0.2), rgba(99,102,241,0.3));
  background-size: 300% 300%;
  z-index: -1;
  animation: loginBorderGlow 6s ease-in-out infinite;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  padding: 2px;
}
@keyframes loginBorderGlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Dots pattern — primary color */
.login-dots {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(99, 102, 241, 0.10) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Tech grid overlay */
.tech-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: techGridScroll 20s linear infinite;
}
@keyframes techGridScroll {
  0% { transform: translate(0, 0); }
  100% { transform: translate(60px, 60px); }
}

/* Scan line overlay */
.scan-line {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(99, 102, 241, 0.015) 2px,
    rgba(99, 102, 241, 0.015) 4px
  );
}

/* Particle canvas */
#particleCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Login logo */
.login-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  box-shadow: 0 8px 24px rgba(79, 110, 247, 0.35);
  transition: var(--transition);
  position: relative;
}
.login-logo::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: calc(var(--radius-lg) + 4px);
  background: linear-gradient(135deg, rgba(99,102,241,0.2), transparent, rgba(0,212,170,0.15));
  z-index: -1;
  animation: loginLogoPulse 3s ease-in-out infinite;
}
@keyframes loginLogoPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}
.login-logo:hover {
  transform: scale(1.05) rotate(-3deg);
  box-shadow: 0 12px 32px rgba(79, 110, 247, 0.45);
}

.login-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #e8e8f0;
  text-align: center;
}
.login-title span {
  color: var(--primary);
}

/* Tech-style subtitle */
.login-subtitle {
  text-align: center;
  color: rgba(180, 180, 210, 0.8);
  font-size: 0.85rem;
  margin: -4px 0 24px;
  letter-spacing: 0.05em;
}

/* ==================== Login — Tech Inputs ==================== */
.login-card .form-label {
  color: rgba(200, 200, 230, 0.9);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.login-card .form-control {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 10px;
  color: #e0e0f0;
  padding: 12px 16px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.login-card .form-control:focus {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12), inset 0 2px 4px rgba(0, 0, 0, 0.2);
  color: #f0f0ff;
  outline: none;
}

.login-card .form-control::placeholder {
  color: rgba(180, 180, 210, 0.35);
  font-size: 0.85rem;
}

.login-card .form-control:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

/* ==================== Login — Tech Button ==================== */
.login-card .btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5, #7c3aed);
  background-size: 200% 200%;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.25);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.login-card .btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,0.08), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.login-card .btn-primary:hover::before {
  transform: translateX(100%);
}

.login-card .btn-primary:hover {
  background-position: 100% 0;
  box-shadow: 0 6px 30px rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
}

.login-card .btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

/* ==================== Login — Links ==================== */
.login-card .text-decoration-none {
  color: rgba(99, 102, 241, 0.8) !important;
  transition: color 0.3s;
}
.login-card .text-decoration-none:hover {
  color: rgba(129, 140, 248, 1) !important;
}

.login-card .text-muted {
  color: rgba(180, 180, 210, 0.6) !important;
}

/* ==================== Login — Corner Brackets ==================== */
.login-card::after {
  content: '';
  position: absolute;
  inset: 10px;
  pointer-events: none;
  z-index: 2;
  border: 1px solid transparent;
  border-image: linear-gradient(135deg, rgba(99,102,241,0.25) 0%, transparent 30%, transparent 70%, rgba(0,212,170,0.15) 100%);
  border-image-slice: 1;
  border-radius: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.login-card:hover::after {
  opacity: 1;
}

/* ==================== Login — Input Glow Underline ==================== */
.login-card .form-control {
  position: relative;
}
.login-card .form-control::after {
  display: none;
}
@keyframes inputGlowFlow {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.login-card .form-control:focus {
  border-bottom: 1px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12), inset 0 2px 4px rgba(0, 0, 0, 0.2);
}
.login-card .input-glow-wrap {
  position: relative;
}
.login-card .input-glow-wrap::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #6366f1, #7c3aed, #00d4aa, transparent);
  background-size: 200% 100%;
  border-radius: 0 0 10px 10px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.login-card .input-glow-wrap:focus-within::after {
  opacity: 1;
  animation: inputGlowFlow 1.5s linear infinite;
}

/* ==================== Login — Button Ripple ==================== */
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: btnRippleAnim 0.6s ease-out forwards;
  pointer-events: none;
}
@keyframes btnRippleAnim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ==================== Login — Status Bar ==================== */
.status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(99, 102, 241, 0.12);
  padding: 6px 0;
}
.status-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 0 24px;
}
.status-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: rgba(180, 180, 210, 0.7);
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot-green {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
  animation: statusDotPulse 2s ease-in-out infinite;
}
.status-dot-blue {
  background: #3b82f6;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.6);
  animation: statusDotPulse 2s ease-in-out infinite 0.5s;
}
@keyframes statusDotPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}
.status-secure i {
  color: rgba(16, 185, 129, 0.7);
  font-size: 0.75rem;
}
.status-time i {
  color: rgba(99, 102, 241, 0.6);
  font-size: 0.75rem;
}
.status-label {
  white-space: nowrap;
}

/* ==================== Login — Orbit Rings ==================== */
.orbit-ring {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  border: 1px solid transparent;
  opacity: 0.4;
}
.orbit-ring-1 {
  width: 500px;
  height: 500px;
  top: 50%;
  left: 50%;
  margin: -250px 0 0 -250px;
  border-color: rgba(99, 102, 241, 0.06);
  animation: orbitSpin 25s linear infinite;
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.02), inset 0 0 40px rgba(99, 102, 241, 0.02);
}
.orbit-ring-1::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.3);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}
.orbit-ring-2 {
  width: 350px;
  height: 350px;
  top: 50%;
  left: 50%;
  margin: -175px 0 0 -175px;
  border-color: rgba(0, 212, 170, 0.04);
  animation: orbitSpin 35s linear infinite reverse;
  box-shadow: 0 0 30px rgba(0, 212, 170, 0.015), inset 0 0 30px rgba(0, 212, 170, 0.015);
}
.orbit-ring-2::before {
  content: '';
  position: absolute;
  top: 50%;
  right: -2px;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: rgba(0, 212, 170, 0.25);
  box-shadow: 0 0 8px rgba(0, 212, 170, 0.35);
}
@keyframes orbitSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==================== 赛博朋克 — Matrix 雨 ==================== */
#matrixCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.12;
}

/* ==================== 赛博朋克 — 故障文字 ==================== */
.cyber-glitch {
  position: relative;
  display: inline-block;
}
.cyber-glitch::before,
.cyber-glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.cyber-glitch::before {
  color: #ff2d55;
  animation: glitch-shift-1 4s infinite linear alternate-reverse;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
  opacity: 0.8;
}
.cyber-glitch::after {
  color: #00f0ff;
  animation: glitch-shift-2 3s infinite linear alternate-reverse;
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
  opacity: 0.8;
}
@keyframes glitch-shift-1 {
  0%, 90%, 100% { transform: translate(0); }
  92% { transform: translate(-3px, 1px); }
  94% { transform: translate(2px, -1px); }
  96% { transform: translate(-1px, 2px); }
  98% { transform: translate(3px, 0); }
}
@keyframes glitch-shift-2 {
  0%, 88%, 100% { transform: translate(0); }
  90% { transform: translate(2px, -1px); }
  93% { transform: translate(-3px, 1px); }
  95% { transform: translate(1px, -2px); }
  97% { transform: translate(-2px, 1px); }
}

/* ==================== 赛博朋克 — HUD 角标 ==================== */
.hud-corners {
  position: absolute;
  inset: -1px;
  pointer-events: none;
  z-index: 2;
}
.hud-corners::before,
.hud-corners::after {
  content: '';
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: rgba(0, 240, 255, 0.6);
  border-style: solid;
  border-width: 0;
}
.hud-corners::before {
  top: -1px;
  left: -1px;
  border-top-width: 2px;
  border-left-width: 2px;
  border-top-left-radius: 4px;
}
.hud-corners::after {
  bottom: -1px;
  right: -1px;
  border-bottom-width: 2px;
  border-right-width: 2px;
  border-bottom-right-radius: 4px;
}
.hud-corners-extra {
  position: absolute;
  inset: -1px;
  pointer-events: none;
  z-index: 2;
}
.hud-corners-extra::before,
.hud-corners-extra::after {
  content: '';
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: rgba(0, 240, 255, 0.6);
  border-style: solid;
  border-width: 0;
}
.hud-corners-extra::before {
  top: -1px;
  right: -1px;
  border-top-width: 2px;
  border-right-width: 2px;
  border-top-right-radius: 4px;
}
.hud-corners-extra::after {
  bottom: -1px;
  left: -1px;
  border-bottom-width: 2px;
  border-left-width: 2px;
  border-bottom-left-radius: 4px;
}
/* HUD角标呼吸动画 */
.hud-corners::before,
.hud-corners::after,
.hud-corners-extra::before,
.hud-corners-extra::after {
  animation: hudCornerPulse 3s ease-in-out infinite;
}
@keyframes hudCornerPulse {
  0%, 100% { opacity: 0.6; border-color: rgba(0, 240, 255, 0.6); }
  50% { opacity: 1; border-color: rgba(0, 240, 255, 0.9); }
}

/* ==================== 赛博朋克 — HUD 装饰线 ==================== */
.hud-line-top {
  position: absolute;
  top: 12px;
  left: 40px;
  right: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.3), transparent);
  z-index: 2;
  pointer-events: none;
}
.hud-line-bottom {
  position: absolute;
  bottom: 12px;
  left: 40px;
  right: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.3), transparent);
  z-index: 2;
  pointer-events: none;
}
.hud-label {
  position: absolute;
  font-family: 'Courier New', monospace;
  font-size: 9px;
  letter-spacing: 0.15em;
  color: rgba(0, 240, 255, 0.4);
  z-index: 2;
  pointer-events: none;
  text-transform: uppercase;
}
.hud-label-tl { top: 16px; left: 16px; }
.hud-label-br { bottom: 16px; right: 16px; }

/* ==================== 赛博朋克 — 全息 Logo ==================== */
.login-logo {
  animation: holoLogoSpin 8s linear infinite;
}
@keyframes holoLogoSpin {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}
.login-logo::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(0, 240, 255, 0.3) 0%,
    transparent 40%,
    rgba(255, 45, 85, 0.2) 60%,
    transparent 100%
  );
  background-size: 200% 200%;
  animation: holoSheen 4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes holoSheen {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
}

/* ==================== 赛博朋克 — 悬浮代码 ==================== */
.hex-float {
  position: fixed;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: rgba(0, 240, 255, 0.08);
  pointer-events: none;
  z-index: 0;
  white-space: nowrap;
  letter-spacing: 0.1em;
  animation: hexFloat 20s linear infinite;
}
.hex-float:nth-child(2) { animation-duration: 25s; animation-delay: -5s; left: 15%; font-size: 10px; color: rgba(99, 102, 241, 0.07); }
.hex-float:nth-child(3) { animation-duration: 22s; animation-delay: -10s; left: 35%; font-size: 9px; color: rgba(255, 45, 85, 0.06); }
.hex-float:nth-child(4) { animation-duration: 28s; animation-delay: -3s; left: 55%; font-size: 10px; color: rgba(0, 240, 255, 0.07); }
.hex-float:nth-child(5) { animation-duration: 24s; animation-delay: -8s; left: 75%; font-size: 11px; color: rgba(99, 102, 241, 0.06); }
.hex-float:nth-child(6) { animation-duration: 26s; animation-delay: -12s; left: 90%; font-size: 9px; color: rgba(0, 240, 255, 0.05); }
@keyframes hexFloat {
  0% { transform: translateY(100vh); opacity: 0; }
  5% { opacity: 1; }
  95% { opacity: 1; }
  100% { transform: translateY(-100vh); opacity: 0; }
}

/* ==================== 赛博朋克 — 输入框增强 ==================== */
.login-card .input-glow-wrap {
  position: relative;
}
.login-card .input-glow-wrap::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, rgba(0, 240, 255, 0.5), rgba(99, 102, 241, 0.5));
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.3s;
}
.login-card .input-glow-wrap:focus-within::before {
  opacity: 1;
  animation: inputSideGlow 2s ease-in-out infinite;
}
@keyframes inputSideGlow {
  0%, 100% { box-shadow: 0 0 6px rgba(0, 240, 255, 0.3); }
  50% { box-shadow: 0 0 12px rgba(0, 240, 255, 0.6); }
}

/* ==================== 赛博朋克 — 按钮增强 ==================== */
.login-card .btn-primary {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0, 240, 255, 0.2);
}
.login-card .btn-primary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    rgba(0, 240, 255, 0.1) 10%,
    transparent 20%
  );
  animation: btnSweep 3s linear infinite;
  pointer-events: none;
}
@keyframes btnSweep {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==================== 赛博朋克 — 标题增强 ==================== */
.login-title {
  font-family: 'Courier New', 'Consolas', monospace !important;
  letter-spacing: 0.08em;
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}
.login-title span {
  background: linear-gradient(90deg, #00f0ff, #6366f1, #ff2d55);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: cyberGradient 4s ease-in-out infinite;
}
@keyframes cyberGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.login-subtitle {
  font-family: 'Courier New', monospace;
  letter-spacing: 0.2em;
  color: rgba(0, 240, 255, 0.45);
  font-size: 0.75rem !important;
}

/* ==================== 赛博朋克 — 卡片扫描光效 ==================== */
.login-card .card-scan {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.6), transparent);
  z-index: 3;
  pointer-events: none;
  animation: cardScan 4s ease-in-out infinite;
}
@keyframes cardScan {
  0% { top: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ==================== 赛博朋克 — 状态栏增强 ==================== */
.status-bar {
  border-top: 1px solid rgba(0, 240, 255, 0.15) !important;
}
.status-secure i {
  color: rgba(0, 240, 255, 0.6);
  animation: shieldPulse 2s ease-in-out infinite;
}
@keyframes shieldPulse {
  0%, 100% { text-shadow: 0 0 4px rgba(0, 240, 255, 0.3); }
  50% { text-shadow: 0 0 10px rgba(0, 240, 255, 0.6); }
}

/* ==================== 风格切换按钮 ==================== */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(18, 18, 40, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 24px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}
.theme-toggle:hover {
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.15);
}
.theme-toggle-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: transform 0.4s ease;
}
.theme-toggle:hover .theme-toggle-icon {
  transform: rotate(180deg);
}
.theme-toggle-label {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

/* ==================== 经典模式 — 隐藏赛博朋克元素 ==================== */
body[data-theme="classic"] #matrixCanvas,
body[data-theme="classic"] .hex-float,
body[data-theme="classic"] .hud-corners,
body[data-theme="classic"] .hud-corners-extra,
body[data-theme="classic"] .card-scan,
body[data-theme="classic"] .hud-line-top,
body[data-theme="classic"] .hud-line-bottom,
body[data-theme="classic"] .hud-label {
  display: none !important;
}

/* 经典模式 — 还原标题 */
body[data-theme="classic"] .login-title {
  font-family: inherit !important;
  text-shadow: none !important;
  letter-spacing: normal;
}
body[data-theme="classic"] .login-title .cyber-glitch::before,
body[data-theme="classic"] .login-title .cyber-glitch::after {
  display: none !important;
}
body[data-theme="classic"] .login-title .cyber-glitch span {
  background: none !important;
  -webkit-text-fill-color: var(--primary) !important;
  animation: none !important;
}

/* 经典模式 — 还原副标题 */
body[data-theme="classic"] .login-subtitle {
  font-family: inherit !important;
  letter-spacing: normal !important;
  color: inherit !important;
}

/* 经典模式 — 还原 Logo */
body[data-theme="classic"] .login-logo {
  animation: none !important;
}
body[data-theme="classic"] .login-logo::before {
  display: none !important;
}

/* 经典模式 — 还原输入框 */
body[data-theme="classic"] .login-card .input-glow-wrap::before {
  display: none !important;
}

/* 经典模式 — 还原按钮 */
body[data-theme="classic"] .login-card .btn-primary {
  border: none !important;
}
body[data-theme="classic"] .login-card .btn-primary::after {
  display: none !important;
}

/* 经典模式 — 还原背景渐变球 */
body[data-theme="classic"] .login-page::before {
  background: radial-gradient(circle, rgba(99, 102, 241, 0.10) 0%, rgba(124, 58, 237, 0.06) 40%, transparent 70%) !important;
}
body[data-theme="classic"] .login-page::after {
  background: radial-gradient(circle, rgba(0, 212, 170, 0.07) 0%, rgba(56, 189, 248, 0.04) 40%, transparent 70%) !important;
}

/* 经典模式 — 还原状态栏 */
body[data-theme="classic"] .status-bar {
  border-top: 1px solid rgba(99, 102, 241, 0.15) !important;
}
body[data-theme="classic"] .status-secure i {
  color: inherit;
  animation: none;
  text-shadow: none;
}

/* ==================== Pagination Size Select ==================== */
.page-size-select {
  display: flex;
  align-items: center;
  gap: 6px;
}
.page-size-select label {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.page-size-select select {
  width: 70px;
}

/* ==================== Responsive ==================== */
@media (max-width: 991.98px) {
  .app-sidebar {
    transform: translateX(-100%);
  }
  .app-sidebar.show {
    transform: translateX(0);
  }
  .app-main {
    margin-left: 0;
  }
  .topbar-toggle {
    display: block;
  }
  .sidebar-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1039;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  .sidebar-backdrop.show {
    opacity: 1;
    pointer-events: auto;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .app-content {
    padding: 16px;
  }
  .filter-bar {
    flex-direction: column;
  }
}

@media (max-width: 575.98px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .app-content {
    padding: 12px;
  }
  .login-card {
    margin: 16px;
    padding: 24px;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==================== Animations ==================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeInUp 0.4s ease forwards;
}

.animate-fade-in-delay-1 { animation-delay: 0.05s; }
.animate-fade-in-delay-2 { animation-delay: 0.10s; }
.animate-fade-in-delay-3 { animation-delay: 0.15s; }
.animate-fade-in-delay-4 { animation-delay: 0.20s; }

/* ==================== Utility Classes ==================== */
.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-soft-primary { background: var(--primary-bg); }
.bg-soft-success { background: var(--success-bg); }
.bg-soft-danger { background: var(--danger-bg); }
.bg-soft-warning { background: var(--warning-bg); }
.bg-soft-info { background: var(--info-bg); }

.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

/* ==================== Footer ==================== */
.app-footer {
  border-top: 1px solid var(--border);
  padding: 12px 24px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  background: var(--surface);
  flex-shrink: 0;
}
.app-footer strong {
  color: var(--text-secondary);
}
.app-footer .footer-divider {
  margin: 0 8px;
  color: var(--border);
}
.app-footer .footer-status {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ==================== Hover Card for Last Run ==================== */
.last-exec-cell {
  cursor: pointer;
  transition: opacity 0.15s;
}
.last-exec-cell:hover {
  opacity: 0.8;
}

/* ==================== Loading skeleton placeholder ==================== */
.skeleton {
  background: linear-gradient(90deg, var(--surface-tertiary) 25%, #e8ecf1 50%, var(--surface-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==================== Nav tabs in config ==================== */
.nav-tabs .nav-link {
  border: none;
  color: var(--text-secondary);
  font-weight: 500;
  padding: 10px 16px;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: var(--transition);
}
.nav-tabs .nav-link:hover {
  color: var(--text-primary);
  background: var(--surface-tertiary);
}
.nav-tabs .nav-link.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  background: transparent;
}

/* ==================== Model Badge ==================== */
.model-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-bg);
  border: 1px solid rgba(79, 110, 247, 0.15);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 500;
}
.model-badge strong {
  font-weight: 700;
}

/* ==================== Instance form ==================== */

/* ==================== 系统配置 - 防抖动 ==================== */
#menuGroupTableBody {
  min-height: 120px;
}

#menuGroupTableBody tr td:first-child {
  white-space: nowrap;
}

#menuGroupTableBody .btn-group-vertical {
  line-height: 1;
}

#menuGroupTableBody .btn-group-vertical .btn {
  min-width: 28px;
}

