/* 酿酒之星 · 电脑端控制台
   颜色沿用门户那套（深底 + 青色点缀），这样从首页点进控制台不会有割裂感。
   纯静态、零依赖，没有构建步骤：改完传上去就是所见即所得。 */

:root {
  --bg: #0a0d10;
  --bg2: #0e141a;
  --card: #101820;
  --line: rgba(24, 224, 255, 0.14);
  --line-strong: rgba(24, 224, 255, 0.32);
  --cyan: #18e0ff;
  --cyan-dim: #7fe6f7;
  --amber: #ffb242;
  --green: #07c160;
  --red: #ff6b6b;
  --text: #e7eef3;
  --muted: #8d9aa5;
  --radius: 14px;
}

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

/* hidden 属性必须真的能藏住东西。
   这条不能省：下面给 .login-mask / .layout / .chart-empty / .qr-state 都写了 display，
   作者样式优先级高于浏览器默认的 [hidden]{display:none} —— 少了这条，
   el.hidden = true 完全不生效，登录遮罩会一直盖在控制台上（实测踩过）。 */
[hidden] { display: none !important; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}
a { color: inherit; text-decoration: none; }
b, strong { color: #fff; font-weight: 600; }

.link {
  background: none; border: 0; padding: 0;
  color: var(--cyan-dim); font-size: 13px; cursor: pointer; font-family: inherit;
}
.link:hover { color: #fff; text-decoration: underline; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(24, 224, 255, 0.9), rgba(24, 224, 255, 0.35));
  color: #04202a; font-weight: 800; font-size: 17px;
  box-shadow: 0 0 20px rgba(24, 224, 255, 0.32);
}
.brand-text { font-size: 16px; font-weight: 700; letter-spacing: 0.4px; }
.brand-text em { font-style: normal; font-size: 12px; color: var(--muted); margin-left: 6px; font-weight: 400; }

/* ============ 登录层 ============ */
.login-mask {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(820px 520px at 50% 26%, rgba(24, 224, 255, 0.14), transparent 64%),
    radial-gradient(600px 420px at 20% 90%, rgba(255, 178, 66, 0.08), transparent 60%),
    var(--bg);
}
.login-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px 30px 26px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.login-card .brand { justify-content: center; margin-bottom: 22px; }
.login-card h2 { font-size: 21px; letter-spacing: 0.5px; }
.login-sub { color: var(--muted); font-size: 13px; margin-top: 8px; }

.qr-box {
  width: 216px; height: 216px; margin: 22px auto 0;
  border-radius: 16px; background: #fff;
  display: grid; place-items: center; overflow: hidden;
  position: relative;
}
.qr-box img { width: 100%; height: 100%; display: block; }
.qr-state {
  color: #4a5561; font-size: 13px; line-height: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0 18px;
  width: 100%; height: 100%;
}
.qr-state .link { color: #0a7c93; }

.login-foot {
  margin-top: 16px; min-height: 20px;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  font-size: 13px; color: var(--muted);
}
.login-note { margin-top: 18px; font-size: 12px; color: #6f7c86; }
.login-note a { color: var(--cyan-dim); }

/* ============ 布局 ============ */
.layout { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }

.side {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #0c1218, #0a0d10);
  padding: 20px 16px 16px;
  display: flex; flex-direction: column; gap: 14px;
  position: sticky; top: 0; height: 100vh;
}
.side-title { font-size: 12px; color: var(--muted); letter-spacing: 1px; margin-top: 6px; }
.dev-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.side-empty { flex: 1; color: #6f7c86; font-size: 13px; line-height: 1.9; text-align: center; padding-top: 40px; }

.dev {
  width: 100%; text-align: left; cursor: pointer; font-family: inherit;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent; border-radius: 12px;
  padding: 11px 13px; color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}
.dev:hover { border-color: var(--line); }
.dev.on { border-color: var(--line-strong); background: rgba(24, 224, 255, 0.07); }
.dev-top { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; }
.dev-top .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-bot { margin-top: 5px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.dev-bot .val { color: var(--cyan-dim); }

.side-foot {
  border-top: 1px solid var(--line); padding-top: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.me { display: flex; align-items: center; gap: 8px; min-width: 0; }
.me-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  border: 1px solid var(--line);
}
.avatar-fallback {
  display: grid; place-items: center;
  background: rgba(24, 224, 255, 0.12); color: var(--cyan-dim);
  font-size: 13px; font-weight: 600;
}

.main { padding: 24px 30px 44px; min-width: 0; }

.topbar {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  margin-bottom: 20px;
}
.topbar h1 { font-size: 24px; letter-spacing: 0.5px; }
.dev-meta { margin-top: 6px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--line);
  color: var(--cyan-dim); font-size: 12px;
}

.conn { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; padding-top: 6px; }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: #5b6771; }
.conn.on i { background: var(--green); box-shadow: 0 0 8px rgba(7, 193, 96, 0.8); }
.conn.off i { background: var(--red); box-shadow: 0 0 8px rgba(255, 107, 107, 0.7); }

/* ============ KPI 卡片 ============ */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px;
}
.kpi-label { font-size: 12px; color: var(--muted); letter-spacing: 0.5px; }
.kpi-value {
  margin-top: 8px; font-size: 26px; font-weight: 700; line-height: 1.15;
  font-variant-numeric: tabular-nums; letter-spacing: 0.5px;
}
.kpi-value em { font-style: normal; font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 5px; }
.kpi-value.sm { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.kpi-sub { margin-top: 6px; font-size: 12px; color: var(--muted); }
.kpi-sub.warn { color: var(--amber); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: #5b6771; flex: 0 0 auto; }
.dot.on { background: var(--green); box-shadow: 0 0 8px rgba(7, 193, 96, 0.75); }
.dot.off { background: #5b6771; }

/* ============ 曲线 ============ */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 12px; }

.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  font-family: inherit; cursor: pointer; font-size: 13px;
  padding: 6px 13px; border-radius: 999px;
  border: 1px solid transparent; background: rgba(255, 255, 255, 0.03);
  color: #c4ced6; transition: all 0.18s;
}
.tab:hover { border-color: var(--line); }
.tab.on { border-color: var(--line-strong); background: rgba(24, 224, 255, 0.1); color: #fff; }
.tabs-sm .tab { font-size: 12px; padding: 4px 10px; }

.chart-wrap { position: relative; height: 320px; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; }
.chart-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #6f7c86; font-size: 13px; pointer-events: none;
}
.chart-foot { margin-top: 8px; font-size: 12px; color: var(--muted); min-height: 18px; }

.foot-note { margin-top: 18px; font-size: 12px; color: #6f7c86; line-height: 1.9; }
.foot-note a { color: var(--cyan-dim); }

/* ============ 窄屏 ============ */
@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .side {
    position: static; height: auto;
    border-right: 0; border-bottom: 1px solid var(--line);
    padding: 16px;
  }
  .dev-list { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .dev { min-width: 200px; }
  .side-empty { padding: 12px 0; }
  .main { padding: 18px 16px 36px; }
  .topbar h1 { font-size: 20px; }
  .chart-wrap { height: 240px; }
}
