/* ============================================================
   机器学习教学平台 —— 统一样式
   整体深色。登录页配数据洪流背景 + 毛玻璃卡片;主页为深色数据看板。

   注意:此文件最后加载,负责覆盖 style.min.css 与其他自定义样式。
   ============================================================ */

/* ============================================================
   1. 设计变量
   ============================================================ */
:root {
  --bg:          #06070d;   /* 页面底 */
  --bg-2:        #0d1018;   /* 次级面 */
  --surface:     rgba(16, 20, 30, .72);
  --surface-2:   rgba(22, 27, 40, .60);
  --line:        rgba(120, 150, 255, .14);
  --line-2:      rgba(120, 150, 255, .09);
  --ink:         #eef1f8;
  --ink-2:       #a3adc4;
  --ink-3:       #6d7796;
  --accent:      #5b8cff;
  --accent-2:    #7fa8ff;
  --accent-soft: rgba(91, 140, 255, .14);
  --radius:      14px;
  --shadow:      0 1px 0 rgba(255,255,255,.04) inset,
                 0 20px 56px rgba(0,0,0,.55);

  /* 同步覆盖 Bootstrap 变量,让内置组件跟随 */
  --bs-body-bg: #06070d;
  --bs-body-color: #eef1f8;
  --bs-border-color: rgba(120,150,255,.14);
}

/* ============================================================
   2. 页面基底
   ============================================================ */
html, body {
  background: var(--bg) !important;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   3. 数据洪流背景(仅登录页挂载 #tech-bg)
   ============================================================ */
#tech-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg,
      rgba(0,0,0,.35) 0%, #000 14%, #000 86%, rgba(0,0,0,.55) 100%);
  mask-image: linear-gradient(180deg,
      rgba(0,0,0,.35) 0%, #000 14%, #000 86%, rgba(0,0,0,.55) 100%);
}

/* ============================================================
   4. 登录页
   ============================================================ */
/* 关键:内置样式 `#login-main{display:table;height:80vh}` 是 ID 选择器,
   优先级高于 class,必须用组合选择器 + !important 覆盖。 */
html #login-main.ml-wrap {
  position: fixed !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 32px 20px !important;
  overflow-y: auto !important;
  z-index: 4 !important;
  background: transparent;
}

.ml-card {
  position: relative;
  width: 100%;
  max-width: 408px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
}
.ml-card-inner {
  padding: 40px 36px 30px;
  text-align: center;
  color: var(--ink);
}

.ml-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.ml-brand svg { width: 48px !important; height: 48px !important; }

.ml-title {
  margin: 0 0 8px;
  font-size: 1.36rem;
  font-weight: 700;
  letter-spacing: -.015em;
  color: #f4f7ff;
}
.ml-grad { color: var(--accent-2); }
.ml-sub {
  margin: 0 0 30px;
  font-size: .85rem;
  color: var(--ink-3);
}

.ml-form { text-align: left; }
.ml-field { margin-bottom: 16px; }
.ml-field label {
  display: block;
  margin-bottom: 7px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink-2);
}

.ml-input-wrap { position: relative; display: flex; align-items: center; }
.ml-icon {
  position: absolute;
  left: 14px;
  font-size: .82rem;
  color: var(--ink-3);
  pointer-events: none;
  z-index: 2;
  transition: color .15s;
}

html .ml-input {
  width: 100%;
  height: 44px;
  padding: 0 44px 0 38px;
  border-radius: 10px;
  font-size: .92rem;
  color: #f4f7ff !important;
  background: rgba(255,255,255,.05) !important;
  border: 1px solid var(--line) !important;
  box-shadow: none !important;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
html .ml-input::placeholder { color: #5a6379; }
html .ml-input:focus {
  background: rgba(255,255,255,.075) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(91,140,255,.20),
              0 0 22px rgba(91,140,255,.18) !important;
}
.ml-input-wrap:focus-within .ml-icon { color: var(--accent-2); }

.ml-eye {
  position: absolute;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  transition: color .15s, background .15s;
}
.ml-eye:hover { color: var(--ink); background: rgba(255,255,255,.07); }

html .ml-submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 46px;
  margin-top: 6px;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: #fff !important;
  background: linear-gradient(135deg, #3f6fe8, #5b8cff);
  box-shadow: 0 6px 22px rgba(80,130,255,.32);
  transition: background .15s, box-shadow .15s, transform .1s;
}
html .ml-submit::after { content: none; }
html .ml-submit:hover {
  background: linear-gradient(135deg, #4a7bf0, #6d9aff);
  box-shadow: 0 10px 30px rgba(80,130,255,.46);
}
html .ml-submit:active { transform: translateY(1px); }

.ml-error {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 13px; margin-bottom: 16px;
  border-radius: 9px; font-size: .85rem;
  color: #ffb3ba;
  background: rgba(240,62,62,.14);
  border: 1px solid rgba(240,62,62,.32);
}
html .ml-warn {
  padding: 9px 12px; margin-bottom: 15px;
  border-radius: 9px; font-size: .78rem;
  text-align: left;
  color: #ffd8a0;
  background: rgba(247,167,7,.12);
  border: 1px solid rgba(247,167,7,.28);
}

.ml-foot {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line-2);
  font-size: .75rem;
  color: var(--ink-3);
}

/* ============================================================
   5. 顶部导航
   ============================================================ */
.navbar {
  background: rgba(10, 12, 20, .86) !important;
  border-bottom: 1px solid var(--line) !important;
  box-shadow: none !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: relative;
  z-index: 3;
}
.navbar .nav-link { color: var(--ink-2) !important; font-weight: 500; }
.navbar .nav-link:hover { color: var(--accent-2) !important; }
.ec-brand-text { color: var(--ink) !important; font-weight: 700; letter-spacing: -.01em; }
.navbar .ec-logo-mark svg { width: 26px !important; height: 26px !important; }
.navbar-toggler { border-color: var(--line) !important; }

/* ============================================================
   6. 主页:数据看板
   ============================================================ */
.ec-home {
  max-width: 1080px;
  padding: 28px 0 44px;
  position: relative;
  z-index: 2;
}

/* 顶部:身份 + 操作 */
.db-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 24px 26px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.db-id { display: flex; align-items: center; gap: 15px; }
.db-avatar {
  width: 50px; height: 50px;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  font-size: 1.3rem; font-weight: 700;
  color: #fff;
  background: linear-gradient(140deg, #3f6fe8, #7fa8ff);
  letter-spacing: -.02em;
}
.db-hello {
  margin: 0 0 4px;
  font-size: 1.18rem; font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
}
.db-sub {
  margin: 0;
  display: flex; align-items: center; gap: 8px;
  font-size: .83rem;
  color: var(--ink-3);
}
.db-dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--ink-3);
  opacity: .6;
}
.db-actions { display: flex; gap: 10px; }

/* 按钮 */
.db-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: .88rem; font-weight: 600;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.db-btn-primary {
  color: #fff !important;
  background: linear-gradient(135deg, #3f6fe8, #5b8cff);
  box-shadow: 0 4px 16px rgba(80,130,255,.28);
}
.db-btn-primary:hover {
  color: #fff !important;
  background: linear-gradient(135deg, #4a7bf0, #6d9aff);
  box-shadow: 0 8px 24px rgba(80,130,255,.42);
}
.db-btn-ghost {
  color: var(--ink-2) !important;
  background: transparent;
  border-color: var(--line);
}
.db-btn-ghost:hover {
  color: var(--ink) !important;
  border-color: rgba(120,150,255,.30);
  background: rgba(255,255,255,.04);
}

/* 指标条 */
.db-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.db-metric {
  padding: 17px 21px;
  border-right: 1px solid var(--line-2);
}
.db-metric:last-child { border-right: 0; }
.db-metric-label {
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 9px;
  font-size: .74rem; font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.db-metric-label i { font-size: .78rem; color: var(--accent); }
.db-metric-value {
  font-size: 1.02rem; font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
}

.db-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: .77rem; font-weight: 600;
}
.db-tag::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.db-tag-on  { color: #6ee7a8; background: rgba(55,178,77,.15); }
.db-tag-off { color: #9aa1b5; background: rgba(255,255,255,.07); }

/* 面板 */
.db-cols {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.db-panel {
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.db-panel-title {
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-2);
  font-size: .93rem; font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
}
.db-panel-desc {
  margin: -4px 0 15px;
  font-size: .84rem;
  color: var(--ink-3);
}

/* 能力列表 */
.db-list { list-style: none; margin: 0; padding: 0; }
.db-list li {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-2);
}
.db-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.db-list li > i {
  flex: 0 0 auto;
  width: 33px; height: 33px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px;
  font-size: .88rem;
  color: var(--accent-2);
  background: var(--accent-soft);
}
.db-list strong {
  display: block; margin-bottom: 3px;
  font-size: .89rem; font-weight: 600;
  color: var(--ink);
}
.db-list span {
  font-size: .81rem; line-height: 1.55;
  color: var(--ink-3);
}

/* 方向标签 */
.db-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.db-tagline {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px;
  border-radius: 9px;
  border: 1px solid var(--line);
  font-size: .83rem; font-weight: 500;
  color: var(--ink-2);
  background: var(--surface-2);
}
.db-tagline i { font-size: .78rem; color: var(--accent); }

/* 表格 */
.db-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.db-table { margin: 0; width: 100%; font-size: .87rem; }
.db-table thead th {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: .74rem; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-3);
  background: rgba(255,255,255,.02);
}
.db-table td {
  padding: 13px 16px;
  border-top: 1px solid var(--line-2);
  vertical-align: middle;
  color: var(--ink);
}
.db-table .btn-xs {
  height: 28px; padding: 0 12px;
  font-size: .77rem; margin-right: 6px;
}
.db-table .server-link { color: var(--accent-2); text-decoration: none; }
.db-table .server-link:hover { text-decoration: underline; }

.db-foot {
  margin-top: 6px;
  padding-top: 20px;
  border-top: 1px solid var(--line-2);
  text-align: center;
  font-size: .77rem;
  color: var(--ink-3);
}

/* ============================================================
   7. 通用组件
   ============================================================ */
.form-control {
  background: rgba(255,255,255,.05) !important;
  border: 1px solid var(--line) !important;
  color: var(--ink) !important;
  border-radius: 9px !important;
  box-shadow: none !important;
}
.form-control:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(91,140,255,.18) !important;
}
.form-control::placeholder { color: #5a6379; }

.alert {
  border-radius: 10px !important;
  border: 1px solid var(--line) !important;
  background: var(--surface-2) !important;
  color: var(--ink-2) !important;
  font-size: .86rem;
}
.alert-warning {
  background: rgba(247,167,7,.12) !important;
  border-color: rgba(247,167,7,.28) !important;
  color: #ffd8a0 !important;
}
.btn-primary { background: var(--accent) !important; border: 0 !important; }
.btn-default, .btn-secondary {
  background: var(--surface-2) !important;
  border: 1px solid var(--line) !important;
  color: var(--ink-2) !important;
}
.btn-danger {
  background: rgba(240,62,62,.16) !important;
  border: 1px solid rgba(240,62,62,.34) !important;
  color: #ffb3ba !important;
}
.btn-danger:hover { background: rgba(240,62,62,.26) !important; }

a { color: var(--accent-2); }
a:hover { color: #a3c0ff; }

code, pre, .monospace {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(120,150,255,.20);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(120,150,255,.36);
  background-clip: content-box;
}

/* ============================================================
   8. 响应式
   ============================================================ */
@media (max-width: 860px) {
  .db-cols { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  html #login-main.ml-wrap { padding: 20px 16px !important; align-items: flex-start !important; }
  .ml-card-inner { padding: 30px 22px 24px; }
  .ml-title { font-size: 1.2rem; }
  .ec-home { padding: 18px 0 32px; }
  .db-top { padding: 20px; }
  .db-actions { width: 100%; }
  .db-btn { flex: 1; }
  .db-metric { border-right: 0; border-bottom: 1px solid var(--line-2); }
  .db-metric:last-child { border-bottom: 0; }
  .db-panel { padding: 20px; }
}

/* ============================================================
   9. 降低动效
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
