/**
 * Element Plus Glass Dark UI — BugTeam Cyber Glass Theme
 * Plain CSS (no SCSS build). Load after element-plus + styles.css.
 */

/* =========================
   1. 全局变量
========================= */
:root {
  --bg-main: #020617;
  --bg-panel: rgba(15, 23, 42, 0.72);
  --bg-panel-hover: rgba(30, 41, 59, 0.8);
  --border-glass: rgba(148, 163, 184, 0.18);
  --primary: #6366f1;
  --primary-light: #818cf8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text-main: #f8fafc;
  --text-normal: #cbd5e1;
  --text-muted: #94a3b8;
  --glass-blur: 20px;
  --radius: 14px;

  /* Align legacy BugTeam tokens + Element Plus primary */
  --bt-bg: var(--bg-main);
  --bt-accent: var(--primary);
  --el-color-primary: #6366f1;
  --el-color-primary-light-3: #818cf8;
  --el-color-primary-light-5: #a5b4fc;
  --el-color-primary-light-7: #c7d2fe;
  --el-color-primary-light-9: rgba(99, 102, 241, 0.15);
  --el-color-primary-dark-2: #4f46e5;
  --el-bg-color: #0f172a;
  --el-bg-color-overlay: rgba(15, 23, 42, 0.95);
  --el-text-color-primary: #f8fafc;
  --el-text-color-regular: #cbd5e1;
  --el-text-color-secondary: #94a3b8;
  --el-text-color-placeholder: #64748b;
  --el-border-color: rgba(148, 163, 184, 0.22);
  --el-border-color-light: rgba(148, 163, 184, 0.14);
  --el-border-color-lighter: rgba(148, 163, 184, 0.1);
  --el-fill-color: rgba(30, 41, 59, 0.85);
  --el-fill-color-light: rgba(30, 41, 59, 0.75);
  --el-fill-color-lighter: rgba(15, 23, 42, 0.65);
  --el-fill-color-extra-light: rgba(15, 23, 42, 0.45);
  --el-fill-color-dark: rgba(15, 23, 42, 0.9);
  --el-fill-color-blank: rgba(15, 23, 42, 0.75);
  --el-mask-color: rgba(2, 6, 23, 0.65);
  --el-disabled-bg-color: rgba(15, 23, 42, 0.55);
  --el-disabled-text-color: #64748b;
  --el-color-info: #64748b;
  --el-color-info-light-3: #94a3b8;
  --el-color-info-light-5: #64748b;
  --el-color-info-light-7: rgba(100, 116, 139, 0.45);
  --el-color-info-light-8: rgba(100, 116, 139, 0.28);
  --el-color-info-light-9: rgba(30, 41, 59, 0.78);
  --el-color-success-light-9: rgba(16, 185, 129, 0.16);
  --el-color-warning-light-9: rgba(245, 158, 11, 0.16);
  --el-color-danger-light-9: rgba(239, 68, 68, 0.16);
  --el-color-error-light-9: rgba(239, 68, 68, 0.16);
  --el-color-primary-light-9: rgba(99, 102, 241, 0.16);
}

/* =========================
   2. 页面背景
========================= */
body,
#app {
  background: radial-gradient(circle at top, #1e1b4b, #020617 60%);
  color: var(--text-main);
}

/* =========================
   3. Card
========================= */
.el-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.75), rgba(15, 23, 42, 0.65)) !important;
  border: 1px solid var(--border-glass) !important;
  border-radius: var(--radius) !important;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color: white;
}

.el-card__header {
  border-bottom: 1px solid var(--border-glass) !important;
  color: var(--text-main);
}

.el-card__body {
  color: var(--text-normal);
}

/* =========================
   4. Button
========================= */
.el-button {
  border-radius: 10px !important;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: 0.25s;
}

.el-button:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.45);
  color: #fff;
}

.el-button.is-link,
.el-button.is-text {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.el-button.is-link:hover,
.el-button.is-text:hover {
  transform: none;
  box-shadow: none !important;
}

.el-button--primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
  border: none !important;
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.5);
  color: #fff !important;
}

.el-button--success {
  background: linear-gradient(135deg, #059669, #10b981) !important;
  border: none !important;
  color: #fff !important;
}

.el-button--warning {
  background: linear-gradient(135deg, #d97706, #f59e0b) !important;
  border: none !important;
  color: #fff !important;
}

.el-button--danger {
  background: linear-gradient(135deg, #dc2626, #ef4444) !important;
  border: none !important;
  color: #fff !important;
}

.el-button--info {
  background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
  border: none !important;
  color: #fff !important;
}

.el-button.is-disabled,
.el-button.is-disabled:hover {
  transform: none;
  opacity: 0.45;
  box-shadow: none !important;
}

/* =========================
   5. Input
========================= */
.el-input__wrapper {
  background: rgba(15, 23, 42, 0.75) !important;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.2) inset !important;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  transition: 0.3s;
}

.el-input__wrapper:hover {
  box-shadow: 0 0 0 1px var(--primary) inset !important;
}

.el-input__wrapper.is-focus {
  box-shadow: 0 0 0 1px var(--primary-light) inset, 0 0 20px rgba(99, 102, 241, 0.5) !important;
}

.el-input__inner,
.el-textarea__inner {
  color: white !important;
  background: transparent !important;
}

.el-textarea__inner {
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.2) inset !important;
  border-radius: 10px !important;
  background: rgba(15, 23, 42, 0.75) !important;
}

.el-input__inner::placeholder,
.el-textarea__inner::placeholder {
  color: var(--text-muted) !important;
}

.el-input-number {
  --el-fill-color-blank: rgba(15, 23, 42, 0.75);
  --el-fill-color-light: rgba(30, 41, 59, 0.85);
  width: 150px;
}

.el-input-number .el-input__wrapper {
  background: rgba(15, 23, 42, 0.75) !important;
}

.el-input-number .el-input__inner {
  color: #f8fafc !important;
}

.el-input-number__increase,
.el-input-number__decrease {
  background: rgba(30, 41, 59, 0.9) !important;
  color: #cbd5e1 !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
}

.el-input-number__increase:hover,
.el-input-number__decrease:hover {
  color: #fff !important;
  background: rgba(99, 102, 241, 0.35) !important;
}

.el-input-number.is-controls-right .el-input-number__increase,
.el-input-number.is-controls-right .el-input-number__decrease {
  border-left: 1px solid rgba(148, 163, 184, 0.22) !important;
}

.el-input-number.is-controls-right .el-input-number__increase {
  border-bottom: 1px solid rgba(148, 163, 184, 0.22) !important;
}

.el-input-number.is-disabled .el-input-number__increase,
.el-input-number.is-disabled .el-input-number__decrease,
.el-input-number__increase.is-disabled,
.el-input-number__decrease.is-disabled {
  background: rgba(15, 23, 42, 0.55) !important;
  color: #64748b !important;
}

/* Alert 说明条（操作中心灰底提示等） */
.el-alert {
  border: 1px solid var(--border-glass) !important;
  border-radius: 12px !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.el-alert.is-light {
  background: rgba(15, 23, 42, 0.72) !important;
}

.el-alert--info.is-light,
.el-alert--info {
  background: rgba(30, 41, 59, 0.78) !important;
  --el-alert-bg-color: rgba(30, 41, 59, 0.78);
  color: #e2e8f0 !important;
}

.el-alert--info.is-light .el-alert__description,
.el-alert--info .el-alert__description,
.el-alert--info.is-light .el-alert__title,
.el-alert--info .el-alert__title {
  color: #cbd5e1 !important;
}

.el-alert--success.is-light,
.el-alert--success {
  background: rgba(16, 185, 129, 0.14) !important;
  color: #a7f3d0 !important;
}

.el-alert--success.is-light .el-alert__description,
.el-alert--success .el-alert__description,
.el-alert--success.is-light .el-alert__title,
.el-alert--success .el-alert__title {
  color: #d1fae5 !important;
}

.el-alert--warning.is-light,
.el-alert--warning {
  background: rgba(245, 158, 11, 0.14) !important;
  color: #fde68a !important;
}

.el-alert--danger.is-light,
.el-alert--error.is-light,
.el-alert--danger,
.el-alert--error {
  background: rgba(239, 68, 68, 0.14) !important;
  color: #fecaca !important;
}

.el-alert__content {
  color: inherit;
}

/* =========================
   6. Select
========================= */
.el-select__wrapper {
  background: rgba(15, 23, 42, 0.75) !important;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.2) inset !important;
}

.el-select__placeholder,
.el-select__selected-item {
  color: var(--text-normal) !important;
}

.el-select-dropdown {
  background: rgba(15, 23, 42, 0.95) !important;
  border: 1px solid var(--border-glass) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px !important;
}

.el-select-dropdown__item {
  color: #cbd5e1;
}

.el-select-dropdown__item.is-hovering,
.el-select-dropdown__item:hover {
  background: rgba(99, 102, 241, 0.25) !important;
}

.el-select-dropdown__item.is-selected {
  color: #fff !important;
  font-weight: 600;
}

/* =========================
   7. Dialog
========================= */
/* 避免弹窗锁滚动时页面宽度跳动，看起来像「内容区被挤窄」 */
html {
  scrollbar-gutter: stable;
}

.el-overlay {
  background: rgba(2, 6, 23, 0.65) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* 居中承载；超高时滚 overlay，不把主内容区撑出怪滚动条 */
.el-overlay-dialog {
  display: flex !important;
  align-items: center;
  justify-content: center;
  overflow: auto !important;
  padding: 16px !important;
  box-sizing: border-box;
}

.el-dialog {
  --el-dialog-margin-top: 0;
  margin: 0 auto !important;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  display: flex !important;
  flex-direction: column;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.88)) !important;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 20px !important;
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.el-dialog__header {
  flex: 0 0 auto;
  margin-right: 0;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.el-dialog__title {
  color: white !important;
  font-size: 18px;
  font-weight: 700;
}

.el-dialog__headerbtn .el-dialog__close {
  color: var(--text-muted);
}

.el-dialog__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  color: #cbd5e1;
  padding: 18px 22px;
}

.el-dialog__footer {
  flex: 0 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 22px;
}

.el-message-box {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.92)) !important;
  border: 1px solid var(--border-glass) !important;
  border-radius: 20px !important;
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}

.el-message-box__title,
.el-message-box__content {
  color: var(--text-main) !important;
}

/* =========================
   8. Table
========================= */
.el-table {
  background: transparent !important;
  color: white;
  --el-table-bg-color: transparent;
  --el-table-tr-bg-color: transparent;
  --el-table-header-bg-color: rgba(15, 23, 42, 0.8);
  --el-table-row-hover-bg-color: rgba(99, 102, 241, 0.15);
  --el-table-border-color: rgba(255, 255, 255, 0.06);
  --el-table-text-color: #e2e8f0;
  --el-table-header-text-color: #94a3b8;
}

.el-table tr,
.el-table th.el-table__cell,
.el-table td.el-table__cell {
  background: transparent !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.el-table th.el-table__cell {
  background: rgba(15, 23, 42, 0.8) !important;
  color: #94a3b8;
}

.el-table__row:hover > td.el-table__cell {
  background: rgba(99, 102, 241, 0.15) !important;
}

.el-table__empty-text {
  color: var(--text-muted);
}

.el-table--border::before,
.el-table--border::after,
.el-table__inner-wrapper::before {
  background-color: rgba(255, 255, 255, 0.06) !important;
}

/* TableV2 */
.el-table-v2 {
  --el-table-bg-color: transparent;
  --el-table-header-bg-color: rgba(15, 23, 42, 0.85);
  --el-table-row-hover-bg-color: rgba(99, 102, 241, 0.15);
  --el-table-border: 1px solid rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  background: transparent !important;
}

.el-table-v2__header-cell {
  background: rgba(15, 23, 42, 0.85) !important;
  color: #94a3b8 !important;
}

.el-table-v2__row:hover {
  background: rgba(99, 102, 241, 0.15) !important;
}

/* =========================
   9. Pagination
========================= */
.el-pagination button,
.el-pagination .el-pager li {
  background: rgba(30, 41, 59, 0.7) !important;
  color: white !important;
  border-radius: 8px;
}

.el-pagination .el-pager li.is-active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
}

.el-pagination .el-select__wrapper {
  background: rgba(15, 23, 42, 0.75) !important;
}

/* =========================
   10. Menu
========================= */
.el-menu {
  background: transparent !important;
  border: none !important;
}

.el-menu-item {
  border-radius: 12px;
  margin: 5px;
  color: #94a3b8 !important;
}

.el-menu-item:hover {
  background: rgba(99, 102, 241, 0.15) !important;
  color: white !important;
}

.el-menu-item.is-active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.4), rgba(139, 92, 246, 0.2)) !important;
  color: white !important;
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.35);
}

.el-menu--horizontal {
  border-bottom: none !important;
}

.el-menu--horizontal > .el-menu-item {
  margin: 4px 2px;
  border-bottom: none !important;
}

.el-menu--horizontal > .el-menu-item.is-active {
  border-bottom: none !important;
}

/* 顶栏专用：小胶囊选中态，去掉大 margin / 大光晕，并垂直居中 */
.top-menu.el-menu--horizontal {
  --el-menu-horizontal-height: 34px;
  height: 34px !important;
  display: flex !important;
  align-items: center !important;
}

.top-menu.el-menu--horizontal > .el-menu-item,
.top-menu .el-menu-item {
  margin: 0 2px !important;
  border-radius: 8px !important;
  height: 34px !important;
  line-height: 34px !important;
  padding: 0 12px !important;
  display: inline-flex !important;
  align-items: center !important;
}

.top-menu.el-menu--horizontal > .el-menu-item.is-active,
.top-menu .el-menu-item.is-active {
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.28) !important;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.45), rgba(139, 92, 246, 0.28)) !important;
}

/* =========================
   11. Message / Notification
========================= */
.el-message {
  left: auto !important;
  right: 24px !important;
  transform: none !important;
  max-width: min(720px, calc(100vw - 48px));
  background: rgba(15, 23, 42, 0.9) !important;
  border: 1px solid var(--border-glass) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  color: white !important;
}

.el-message .el-message__content {
  white-space: normal;
  word-break: break-word;
  line-height: 1.45;
}

.el-notification {
  background: rgba(15, 23, 42, 0.9) !important;
  border: 1px solid var(--border-glass) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 14px;
  color: white !important;
}

.el-notification__title {
  color: white !important;
}

.el-notification__content {
  color: var(--text-normal) !important;
}

/* =========================
   12. Dropdown / Popover / Tooltip
========================= */
.el-dropdown-menu {
  background: rgba(15, 23, 42, 0.95) !important;
  border: 1px solid var(--border-glass) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
}

.el-dropdown-menu__item {
  color: #cbd5e1;
}

.el-dropdown-menu__item:hover {
  background: rgba(99, 102, 241, 0.2) !important;
  color: white !important;
}

.el-popper.is-light,
.el-popover.el-popper {
  background: rgba(15, 23, 42, 0.95) !important;
  border: 1px solid var(--border-glass) !important;
  color: var(--text-normal) !important;
}

.el-popper.is-dark {
  background: rgba(15, 23, 42, 0.98) !important;
}

/* =========================
   13. Form / Checkbox / Tag / Switch
========================= */
.el-form-item__label {
  color: #cbd5e1 !important;
}

.el-checkbox__label,
.el-radio__label {
  color: var(--text-normal) !important;
}

.el-tag {
  border-color: rgba(148, 163, 184, 0.25);
  background: rgba(30, 41, 59, 0.7);
  color: var(--text-normal);
}

.el-tag--success {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.35);
}

.el-tag--warning {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.35);
}

.el-tag--danger {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
}

.el-tag--info {
  background: rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.35);
}

/* =========================
   14. Loading / Tabs
========================= */
.el-loading-mask {
  background: rgba(2, 6, 23, 0.7) !important;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.el-loading-spinner .path {
  stroke: #6366f1 !important;
}

.el-tabs__item {
  color: #94a3b8;
}

.el-tabs__item.is-active {
  color: white !important;
}

.el-tabs__active-bar {
  background: #6366f1;
}

.el-tabs__nav-wrap::after {
  background-color: rgba(255, 255, 255, 0.08) !important;
}

/* =========================
   15. Scrollbar
========================= */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #020617;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6366f1, #8b5cf6);
  border-radius: 20px;
}

/* =========================
   16. App shell overrides (原 styles.css 浅色壳)
========================= */
.login-page {
  background:
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.28), transparent 42%),
    radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.18), transparent 40%),
    radial-gradient(circle at top, #1e1b4b, #020617 60%) !important;
}

.login-card .brand-title {
  color: var(--text-main);
}

.login-card .brand-sub {
  color: var(--text-muted) !important;
}

.app-header {
  background: rgba(15, 23, 42, 0.72) !important;
  border-bottom: 1px solid var(--border-glass) !important;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.app-header-bar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.logo strong {
  color: var(--text-main) !important;
}

.logo span {
  color: var(--text-muted) !important;
}

.top-menu .el-menu-item.is-active {
  border-bottom-color: transparent !important;
  color: white !important;
}

.page-title h1 {
  color: var(--text-main);
}

.page-title .header-desc {
  color: var(--text-muted) !important;
}

.metric-card .metric-label {
  color: var(--text-muted) !important;
}

.metric-card .metric-value {
  color: var(--text-main) !important;
}

.virtual-table-wrap {
  border: 1px solid var(--border-glass) !important;
  border-radius: var(--radius) !important;
  background: rgba(15, 23, 42, 0.45) !important;
}

.job-logs li {
  background: rgba(15, 23, 42, 0.65) !important;
  border: 1px solid var(--border-glass) !important;
  color: var(--text-normal) !important;
}

.ops-label,
.ops-log-empty,
.mother-relogin-progress,
.mother-relogin-hint,
.mother-relogin-space-id {
  color: var(--text-muted) !important;
}

.ops-log-panel,
.mother-relogin-log-panel {
  border: 1px solid var(--border-glass) !important;
  background: rgba(2, 6, 23, 0.75) !important;
  color: #dbe7ff !important;
}

.mother-relogin-log-title,
.mother-relogin-meta {
  color: var(--text-normal) !important;
}

.mother-relogin-status {
  background: rgba(15, 23, 42, 0.65) !important;
  border: 1px solid var(--border-glass) !important;
  color: var(--text-main) !important;
}

.mother-relogin-dialog .el-loading-text {
  color: var(--text-main) !important;
}

.proxy-group-item {
  border: 1px solid var(--border-glass) !important;
  background: rgba(15, 23, 42, 0.55) !important;
  color: var(--text-normal);
}

.proxy-group-item:hover {
  border-color: var(--primary) !important;
}

.proxy-group-item.active {
  border-color: var(--primary) !important;
  background: rgba(99, 102, 241, 0.18) !important;
}

/* Inline muted hints commonly used in pages */
[style*="color:#64748b"],
[style*="color: #64748b"],
[style*="color:#94a3b8"],
[style*="color: #94a3b8"] {
  color: var(--text-muted) !important;
}
