/* =============================================================================
   国科智算 · 客户 BI 屏（bi.gkctgroup.com）
   -----------------------------------------------------------------------------
   与后台 admin.css 刻意分开：客户屏没有侧栏、没有筛选器，视觉更克制。
   同一套深空蓝 + 霓虹青语言，品牌一致但更"展示型"。
   ⚠ 涨跌配色遵循中国习惯：涨=红，跌=绿。
   ============================================================================= */

:root {
  --bg-deep: #04080f;
  --bg: #070d1a;
  --surface: #0d1626;
  --surface-alt: #13203a;
  --border: #1a2942;
  --border-soft: #121d31;

  --neon: #00e5ff;
  --neon-dim: #00a5bd;
  --blue: #3b82f6;

  --text-hi: #e9f4ff;
  --text-mid: #8fa8c8;
  --text-low: #56698a;

  --up: #ff4d5e;
  --down: #00d68f;
  --flat: #8fa8c8;

  --radius: 14px;
  --radius-sm: 9px;
}

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

body.cbi-body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(0, 229, 255, .07), transparent 60%),
    radial-gradient(900px 500px at 95% 0%, rgba(59, 130, 246, .08), transparent 55%),
    var(--bg);
  color: var(--text-hi);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.cbi-num { font-variant-numeric: tabular-nums; }

/* ── 顶部栏 ─────────────────────────────────────────────────────────── */

.cbi-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(7, 13, 26, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}

.cbi-top__brand { display: flex; align-items: center; gap: 12px; }

.cbi-top__mark {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--neon), var(--blue));
  color: #04121a; font-weight: 800; font-size: 14px; letter-spacing: .5px;
}

.cbi-top__title { font-size: 15.5px; font-weight: 600; letter-spacing: .2px; }
.cbi-top__sub { font-size: 11.5px; color: var(--text-low); }

.cbi-top__right { display: flex; align-items: center; gap: 12px; }
.cbi-top__time { font-size: 11.5px; color: var(--text-low); }

/* ── 按钮 ───────────────────────────────────────────────────────────── */

.cbi-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-mid);
  font-size: 13px; font-family: inherit; cursor: pointer;
  transition: all .15s;
}
.cbi-btn:hover { border-color: var(--neon-dim); color: var(--neon); }
.cbi-btn--sm { height: 26px; padding: 0 9px; border-radius: 6px; font-size: 13px; }
.cbi-btn--ghost { background: transparent; }
.cbi-btn--primary {
  border: none; height: 42px; width: 100%;
  background: linear-gradient(92deg, var(--neon), #22b8d8);
  color: #04121a; font-weight: 700; font-size: 14.5px;
}
.cbi-btn--primary:hover { filter: brightness(1.06); color: #04121a; }
.cbi-btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ── 卡片墙 ─────────────────────────────────────────────────────────── */

.cbi-main { padding: 22px 24px 40px; }

.cbi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(302px, 1fr));
  gap: 16px;
}

.cbi-card {
  position: relative;
  background: linear-gradient(180deg, rgba(19, 32, 58, .55), rgba(13, 22, 38, .92));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px 13px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .16s, transform .16s, box-shadow .16s;
}
.cbi-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--flat); opacity: .8;
}
.cbi-card:hover {
  border-color: var(--neon-dim);
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
}
.cbi-card--online::before { background: #00e5a0; }
.cbi-card--paused::before { background: #6b7c99; }
.cbi-card--disconnected::before { background: #ffb020; }
.cbi-card--offline::before { background: #ff3b4e; }

.cbi-card__head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cbi-card__login { font-size: 13px; color: var(--text-mid); letter-spacing: .3px; }
.cbi-card__label {
  font-size: 13px; color: var(--text-hi); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.cbi-card__chip {
  flex: none; font-size: 11px; padding: 1px 8px; border-radius: 20px;
  border: 1px solid var(--border); color: var(--text-mid);
}
.cbi-card__chip--online { color: #00e5a0; border-color: rgba(0, 229, 160, .3); background: rgba(0, 229, 160, .08); }
.cbi-card__chip--paused { color: #9fb2cc; }
.cbi-card__chip--disconnected { color: #ffb020; border-color: rgba(255, 176, 32, .3); background: rgba(255, 176, 32, .08); }
.cbi-card__chip--offline { color: #ff3b4e; border-color: rgba(255, 59, 78, .3); background: rgba(255, 59, 78, .08); }

.cbi-card__hero { margin-bottom: 12px; }
.cbi-card__hero-label { display: block; font-size: 11.5px; color: var(--text-low); margin-bottom: 2px; }
.cbi-card__hero-value { font-size: 27px; font-weight: 700; letter-spacing: .4px; line-height: 1.15; }

.cbi-card__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.cbi-card__pair > div {
  background: rgba(255, 255, 255, .02);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
}
.cbi-card__pair span { display: block; font-size: 11.5px; color: var(--text-low); }
.cbi-card__pair b { font-size: 14.5px; font-weight: 600; }

.cbi-card__metrics {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  font-size: 12px; color: var(--text-mid);
  margin-bottom: 8px;
}
.cbi-card__metrics span { color: var(--text-low); margin-right: 4px; }
.cbi-card__metrics--io { grid-template-columns: repeat(2, 1fr); }

.cbi-card__foot {
  border-top: 1px solid var(--border-soft);
  padding-top: 7px;
  font-size: 11.5px; color: var(--text-low);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.cbi-empty {
  grid-column: 1 / -1;
  padding: 70px 0; text-align: center;
  color: var(--text-low); font-size: 13.5px;
}

/* 涨跌配色（中国习惯：涨红跌绿） */
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--flat); }

/* ── 日历弹窗 ───────────────────────────────────────────────────────── */

.cbi-mask {
  position: fixed; inset: 0; z-index: 60;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(3, 7, 14, .72);
  backdrop-filter: blur(3px);
}
.cbi-mask.is-open { display: flex; }

.cbi-modal {
  width: 100%; max-width: 560px;
  max-height: 88vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .65);
  overflow: hidden;
}

.cbi-modal__head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 14.5px; font-weight: 600;
}
.cbi-modal__nav { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.cbi-modal__close { margin-left: 6px; cursor: pointer; color: var(--text-low); font-size: 20px; line-height: 1; }
.cbi-modal__close:hover { color: var(--text-hi); }

.cbi-modal__body { padding: 16px 18px 18px; overflow-y: auto; }

.cbi-sum {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin: 0 0 14px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.cbi-sum > div {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  background: rgba(255, 255, 255, .02);
}
.cbi-sum span { display: block; font-size: 11px; color: var(--text-low); }
.cbi-sum b { font-size: 14px; font-weight: 600; }

.cbi-sk {
  height: 46px; border-radius: var(--radius-sm);
  background: rgba(143, 168, 200, .12);
}

.cbi-cal__week, .cbi-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cbi-cal__week { margin-bottom: 4px; }
.cbi-cal__week span { text-align: center; font-size: 11.5px; color: var(--text-low); padding: 3px 0; }

.cbi-cal__d {
  position: relative;
  min-height: 52px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 4px 6px;
  background: rgba(255, 255, 255, .015);
  display: flex; flex-direction: column; gap: 2px;
  overflow: hidden;
}
.cbi-cal__d i { font-style: normal; font-size: 11px; color: var(--text-low); line-height: 1.2; }
.cbi-cal__d b { font-size: 12px; font-weight: 600; white-space: nowrap; }
.cbi-cal__d--has { cursor: pointer; transition: all .13s; }
.cbi-cal__d--has:hover { border-color: var(--neon-dim); }
.cbi-cal__d--today { box-shadow: 0 0 0 1.5px var(--neon) inset; }
.cbi-cal__d--today i { color: var(--neon); }
.cbi-cal__d--sel { border-color: var(--neon); background: rgba(0, 229, 255, .07); }
.cbi-cal__d--pad { border-color: transparent; background: transparent; }
.cbi-cal__d--skeleton i { display: block; height: 8px; border-radius: 4px; background: rgba(143, 168, 200, .15); }

.cbi-cal__dots { position: absolute; top: 5px; right: 5px; display: flex; gap: 3px; }
.cbi-cal__dot { display: block; width: 6px; height: 6px; border-radius: 50%; }
.cbi-cal__dot--dep { background: var(--down); box-shadow: 0 0 5px var(--down); }
.cbi-cal__dot--wd  { background: var(--up);   box-shadow: 0 0 5px var(--up); }

.cbi-detail {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .02);
  font-size: 12.5px; color: var(--text-mid);
  min-height: 41px;
}
.cbi-detail b { color: var(--text-hi); }

/* ── 登录页 ─────────────────────────────────────────────────────────── */

.cbi-body--login { display: grid; place-items: center; padding: 24px; }

.cbi-login {
  width: 100%; max-width: 360px;
  padding: 32px 28px 24px;
  background: linear-gradient(180deg, rgba(19, 32, 58, .7), rgba(13, 22, 38, .96));
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .55);
}

.cbi-login__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.cbi-login__mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--neon), var(--blue));
  color: #04121a; font-weight: 800; font-size: 13px;
}
.cbi-login__name { font-size: 13.5px; color: var(--text-mid); letter-spacing: .6px; }

.cbi-login__title { font-size: 21px; font-weight: 600; letter-spacing: .4px; }
.cbi-login__sub { font-size: 12.5px; color: var(--text-low); margin-bottom: 20px; }

.cbi-login__err {
  margin-bottom: 14px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 59, 78, .3);
  background: rgba(255, 59, 78, .08);
  border-radius: var(--radius-sm);
  color: #ff8a95; font-size: 12.5px; line-height: 1.5;
}

.cbi-login__form { display: flex; flex-direction: column; gap: 10px; }

.cbi-input {
  height: 42px; padding: 0 13px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-hi);
  font-size: 14px; font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.cbi-input:focus { border-color: var(--neon-dim); box-shadow: 0 0 0 3px rgba(0, 229, 255, .1); }
.cbi-input::placeholder { color: var(--text-low); }

.cbi-login__foot { margin-top: 20px; font-size: 11.5px; color: var(--text-low); text-align: center; }

@media (max-width: 560px) {
  .cbi-top { padding: 12px 14px; }
  .cbi-top__sub { display: none; }
  .cbi-main { padding: 16px 14px 32px; }
  .cbi-grid { grid-template-columns: 1fr; gap: 12px; }
  .cbi-sum { grid-template-columns: repeat(2, 1fr); }
}
