/* ============================================================
   运营中心 · 设计系统  (HUD Console)
   ------------------------------------------------------------
   语言：精密仪表盘。少用大色块，靠 1px 发丝线、刻度、等宽数字、
   局部发光建立层次。所有间距走 4px 栅格。
   ============================================================ */

:root {
  /* 面：从近黑起，逐层提亮，不做纯灰 */
  --void:    #05080e;
  --slate:   #070b12;
  --panel:   #0b111a;
  --panel-2: #0f1722;
  --panel-3: #141e2c;

  /* 线：深色界面靠发丝线分层，不用投影 */
  --line:    rgba(255, 255, 255, .078);
  --line-2:  rgba(255, 255, 255, .042);
  --line-3:  rgba(255, 255, 255, .10);
  --edge:    rgba(140, 180, 255, .18);

  /* 字：四级，最弱一级仍高于 4.5:1 */
  --ink:     #e9eff9;
  --ink-2:   #bac8dc;
  --ink-3:   #8598b0;
  --ink-4:   #62748d;

  /* 品牌：蓝为主，青作数据色，紫点缀 */
  --blue:    #4c8dff;
  --blue-d:  #2563eb;
  --cyan:    #2ee6d6;
  --violet:  #9b8cff;

  --blue-soft: rgba(76, 141, 255, .12);
  --blue-line: rgba(76, 141, 255, .30);
  --cyan-soft: rgba(46, 230, 214, .11);

  --ok:      #2ee6a0;
  --ok-soft: rgba(46, 230, 160, .11);
  --warn:    #ffb43d;
  --warn-soft: rgba(255, 180, 61, .12);
  --danger:  #ff6b81;
  --danger-soft: rgba(255, 107, 129, .12);

  --grad: linear-gradient(90deg, var(--blue), var(--cyan));
  --grad-v: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .012));

  /* 4px 栅格 */
  --s1: 4px;  --s2: 8px;  --s3: 12px;
  --s4: 16px; --s5: 20px; --s6: 24px;

  --r-xs: 3px; --r-sm: 5px; --r: 7px; --r-lg: 9px;

  /* 发光（深色下比投影有效） */
  --glow-blue: 0 0 0 1px rgba(76, 141, 255, .32),
               0 0 22px -6px rgba(76, 141, 255, .55);
  --hi: inset 0 1px 0 rgba(255, 255, 255, .045);

  --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
          "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  /* 统一缓动 */
  --ease: cubic-bezier(.32, .72, .28, 1);

  /* ---------- 向后兼容别名 ----------
     admin.html 等旧页面仍引用这批名字，映射到新令牌，
     保证任何页面都不会拿到未定义变量而掉样式。 */
  --bg: var(--void);
  --bg-2: var(--slate);
  --rail: var(--slate);
  --brand: var(--blue);
  --brand-2: #5d99ff;
  --brand-soft: var(--blue-soft);
  --brand-ring: rgba(76, 141, 255, .30);
  --sh-1: var(--hi);
  --sh-2: var(--hi);
  --sh-3: 0 20px 50px -20px rgba(0, 0, 0, .85);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--void);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv05" 1, "ss01" 1;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.004em; }
img { max-width: 100%; }
input, select, textarea { color-scheme: dark; }

::selection { background: rgba(76, 141, 255, .34); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 3px; }

/* ---------- 排版工具 ---------- */
.num, .mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.mono { font-family: var(--mono); }

/* 极小号全大写标签：仪表盘的语言，比中文小字更有秩序感 */
.lbl {
  font-size: 9.5px; font-weight: 500; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-4); line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.idx {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em;
  color: var(--ink-4); font-variant-numeric: tabular-nums;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; padding: 0 13px; border-radius: var(--r-sm);
  border: 1px solid transparent; background: var(--blue); color: #fff;
  font-size: 12.5px; font-weight: 500;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 4px 14px -6px rgba(76, 141, 255, .7);
  transition: background .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease);
}
.btn:hover { background: #5d99ff; }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn.ghost {
  background: var(--panel-2); border-color: var(--line); color: var(--ink-2); box-shadow: var(--hi);
}
.btn.ghost:hover { background: var(--panel-3); border-color: var(--line-3); color: var(--ink); }

/* ---------- 输入 ---------- */
.inp {
  height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: rgba(0, 0, 0, .32); font-size: 12.5px; color: var(--ink); outline: none;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.inp::placeholder { color: var(--ink-4); }
.inp:focus { border-color: var(--blue-line); box-shadow: 0 0 0 3px rgba(76, 141, 255, .16); }
select.inp { padding-right: 26px; }

/* ---------- 徽标：1px 边框 + 10% 填充，不用实心块 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 18px; padding: 0 6px; border-radius: var(--r-xs);
  font-size: 10.5px; font-weight: 500; line-height: 1; white-space: nowrap;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--ink-3);
  letter-spacing: .01em;
}
.b-gray  { border-color: var(--line); color: var(--ink-3); }
.b-blue  { border-color: var(--blue-line); background: var(--blue-soft); color: #a9c6ff; }
.b-green { border-color: rgba(46, 230, 160, .3); background: var(--ok-soft); color: var(--ok); }
.b-red   { border-color: rgba(255, 107, 129, .3); background: var(--danger-soft); color: var(--danger); }
.b-amber { border-color: rgba(255, 180, 61, .3); background: var(--warn-soft); color: var(--warn); }
.b-violet{ border-color: rgba(155, 140, 255, .3); background: rgba(155, 140, 255, .1); color: var(--violet); }

.dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }

/* 活体状态灯：扩散脉冲，只给"真的在跑"的东西用 */
.live {
  width: 6px; height: 6px; flex: none; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 8px var(--ok);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 230, 160, .5), 0 0 8px var(--ok); }
  50%      { box-shadow: 0 0 0 3px rgba(46, 230, 160, 0), 0 0 8px var(--ok); }
}

/* ---------- 面 ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--hi);
}
.card-h {
  display: flex; align-items: center; gap: var(--s2);
  height: 36px; padding: 0 var(--s3);
  border-bottom: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(255, 255, 255, .022), transparent);
}
.card-h > h3 {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em; color: var(--ink);
}
.card-h > h3::before {
  content: ''; width: 2px; height: 10px; border-radius: 1px;
  background: var(--grad); flex: none;
}
.card-h .h-r { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
.card-b { padding: var(--s3); }

/* 切角：工业 HUD 的标志性细节，用在品牌块与主按钮 */
.cut { clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%); }

/* ---------- 分段控件 ---------- */
.seg {
  display: inline-flex; gap: 2px; padding: 2px;
  border-radius: var(--r-sm); background: rgba(0, 0, 0, .3); border: 1px solid var(--line-2);
}
.seg button {
  height: 22px; padding: 0 10px; border-radius: 3px;
  font-size: 11.5px; color: var(--ink-3);
  transition: color .14s var(--ease), background .14s var(--ease);
}
.seg button:hover { color: var(--ink); background: rgba(255, 255, 255, .05); }
.seg button.on {
  background: rgba(76, 141, 255, .16); color: #cfdfff; font-weight: 500;
  box-shadow: inset 0 0 0 1px rgba(76, 141, 255, .3);
}

/* ---------- 表格 ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th, .tbl td { text-align: left; border-bottom: 1px solid var(--line-2); }
.tbl th {
  padding: 8px 12px; font-size: 9.5px; font-weight: 500; color: var(--ink-4);
  letter-spacing: .12em; text-transform: uppercase;
  background: rgba(0, 0, 0, .22); white-space: nowrap;
}
.tbl td { padding: 9px 12px; color: var(--ink-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: rgba(76, 141, 255, .045); }

/* ---------- 骨架屏 ---------- */
.sk {
  background: linear-gradient(90deg, #111a26 25%, #172334 37%, #111a26 63%);
  background-size: 400% 100%; animation: sk 1.4s ease infinite;
  border-radius: 3px; color: transparent !important; user-select: none;
}
@keyframes sk { 0% { background-position: 100% 50% } 100% { background-position: 0 50% } }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .11); border-radius: 99px;
  border: 2.5px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .2); background-clip: padding-box; }

.hide { display: none !important; }

/* ---------- 底部状态条（各页共用） ---------- */
.statusbar {
  height: 23px; flex: none; display: flex; align-items: center; gap: 11px; padding: 0 16px;
  border-top: 1px solid var(--line); background: rgba(0, 0, 0, .4);
  font-size: 10px; color: var(--ink-4); white-space: nowrap; overflow: hidden;
  font-family: var(--mono); letter-spacing: .03em;
}
.statusbar > span { display: inline-flex; align-items: center; gap: 5px; }
.statusbar i {
  width: 4px; height: 4px; border-radius: 50%; background: var(--ok); flex: none;
  box-shadow: 0 0 6px rgba(46, 230, 160, .8);
}
.statusbar .sl { width: 1px; height: 10px; background: var(--line-2); flex: none; }
.sb-r { margin-left: auto; display: flex; align-items: center; gap: 11px; }

/* hidden 必须压过页面里的 display:flex，否则切模块遮不住 */
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
