:root {
  --bg: #07070c;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-2: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #f2f3f7;
  --text-2: #9ba1b0;
  --text-3: #6b7280;
  --cyan: #22d3ee;
  --violet: #a855f7;
  --pink: #ff3d71;
  --gold: #ffc93c;
  --green: #34d399;
  --blue: #60a5fa;
  --radius: 20px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- 背景光斑 ---------- */
.bg-glow { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-glow::before, .bg-glow::after, .bg-glow i {
  content: ""; position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5;
}
.bg-glow::before {
  width: 520px; height: 520px; top: -180px; left: -140px;
  background: radial-gradient(circle, #7c3aed 0%, transparent 70%);
  animation: drift1 18s ease-in-out infinite alternate;
}
.bg-glow::after {
  width: 460px; height: 460px; top: 30%; right: -180px;
  background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
  animation: drift2 22s ease-in-out infinite alternate;
}
.bg-glow i {
  width: 420px; height: 420px; bottom: -160px; left: 30%;
  background: radial-gradient(circle, #e935c1 0%, transparent 70%);
  opacity: .32; animation: drift3 26s ease-in-out infinite alternate;
}
@keyframes drift1 { to { transform: translate(90px, 70px) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-80px, 60px) scale(1.1); } }
@keyframes drift3 { to { transform: translate(60px, -80px) scale(1.2); } }

/* 细网格底纹 */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

.wrap, .topbar, .tabbar, .login-box { position: relative; z-index: 2; }

.wrap { max-width: 720px; margin: 0 auto; padding: 20px 16px 110px; }

/* ---------- 顶部 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(7, 7, 12, 0.72);
  backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}
.topbar h1 {
  margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.02em;
  background: linear-gradient(92deg, #fff 0%, #c7d2fe 60%, #67e8f9 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.topbar .sub { font-size: 12px; color: var(--text-3); margin-top: 3px; letter-spacing: .02em; }

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
  animation: rise .5s cubic-bezier(.2, .8, .2, 1) both;
}
.card:nth-child(2) { animation-delay: .05s; }
.card:nth-child(3) { animation-delay: .1s; }
.card:nth-child(4) { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* 顶部霓虹描边 */
.card.accent { overflow: hidden; }
.card.accent::before {
  content: ""; position: absolute; top: 0; left: 12%; right: 12%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--violet), transparent);
  opacity: .9;
}
.card.tight { padding: 16px; }
.card-title {
  font-size: 11px; color: var(--text-2); font-weight: 600; margin: 0 0 12px;
  text-transform: uppercase; letter-spacing: .12em;
}

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* ---------- 数字 ---------- */
.big {
  font-size: 46px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff 0%, #ffd977 55%, #f59e0b 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 18px rgba(255, 201, 60, .28));
}
.big .unit { font-size: 14px; font-weight: 500; -webkit-text-fill-color: var(--text-2); filter: none; margin-left: 8px; letter-spacing: 0; }
.num {
  font-size: 28px; font-weight: 700; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; color: #fff;
}
.num.cyan { background: linear-gradient(180deg, #a5f3fc, #22d3ee); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.num.violet { background: linear-gradient(180deg, #ddd6fe, #a855f7); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.label { font-size: 12px; color: var(--text-2); }
.muted { color: var(--text-2); }
.tiny { font-size: 12px; color: var(--text-3); }

/* ---------- 进度条 ---------- */
.bar {
  height: 10px; background: rgba(255, 255, 255, .07);
  border-radius: 999px; overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4);
}
.bar > i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #22d3ee, #a855f7);
  box-shadow: 0 0 14px rgba(168, 85, 247, .55);
  transition: width .9s cubic-bezier(.2, .8, .2, 1);
  position: relative;
}
.bar > i::after {
  content: ""; position: absolute; inset: 0; border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  animation: sheen 2.4s linear infinite;
}
@keyframes sheen { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.bar.gold > i { background: linear-gradient(90deg, #fbbf24, #f59e0b); box-shadow: 0 0 14px rgba(251, 191, 36, .5); }
.bar.green > i { background: linear-gradient(90deg, #34d399, #10b981); box-shadow: 0 0 14px rgba(52, 211, 153, .5); }
.bar.orange > i { background: linear-gradient(90deg, #fb7185, #f43f5e); box-shadow: 0 0 14px rgba(251, 113, 133, .5); }
.bar.violet > i { background: linear-gradient(90deg, #a855f7, #6366f1); box-shadow: 0 0 14px rgba(168, 85, 247, .5); }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  background: rgba(96, 165, 250, .16); color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, .3);
}
.badge.green { background: rgba(52, 211, 153, .14); color: #6ee7b7; border-color: rgba(52, 211, 153, .3); }
.badge.orange { background: rgba(251, 113, 133, .14); color: #fda4af; border-color: rgba(251, 113, 133, .3); }
.badge.gray { background: rgba(255, 255, 255, .06); color: var(--text-2); border-color: var(--line); }
.badge.violet { background: rgba(167, 139, 250, .14); color: #ddd6fe; border-color: rgba(167, 139, 250, .3); }
.badge.gold {
  background: linear-gradient(135deg, rgba(255, 201, 60, .22), rgba(245, 158, 11, .12));
  color: #fcd34d; border-color: rgba(255, 201, 60, .35);
}
.badge.live { background: rgba(255, 61, 113, .16); color: #fb7185; border-color: rgba(255, 61, 113, .35); }

/* 呼吸点 */
.dot-live {
  width: 7px; height: 7px; border-radius: 50%; background: #ff3d71;
  box-shadow: 0 0 0 0 rgba(255, 61, 113, .7); animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 61, 113, .6); }
  70% { box-shadow: 0 0 0 8px rgba(255, 61, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 61, 113, 0); }
}

/* ---------- 头像 ---------- */
.avatar {
  width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: #fff;
  background: linear-gradient(140deg, #a855f7, #22d3ee);
  position: relative;
}
.avatar::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  background: linear-gradient(140deg, #a855f7, #22d3ee, #ff3d71);
  z-index: -1; filter: blur(6px); opacity: .75;
}
.avatar.sm { width: 36px; height: 36px; font-size: 14px; }

/* ---------- 表单 ---------- */
input, textarea, select, button { font-family: inherit; font-size: 15px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=month], textarea, select {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line-2); border-radius: 14px;
  background: rgba(255, 255, 255, .045); color: var(--text); outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input::placeholder, textarea::placeholder { color: #5b6172; }
input:focus, textarea:focus, select:focus {
  border-color: rgba(168, 85, 247, .65);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, .15);
  background: rgba(255, 255, 255, .07);
}
textarea { min-height: 150px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.6; resize: vertical; }
label { display: block; font-size: 11px; color: var(--text-2); margin: 0 0 6px; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.field { margin-bottom: 14px; }
select option { background: #12121a; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 18px; border: none; border-radius: 14px;
  font-weight: 600; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, #7c3aed, #22d3ee);
  box-shadow: 0 6px 20px rgba(124, 58, 237, .35);
  transition: transform .15s, box-shadow .2s, opacity .15s;
}
button:hover, .btn:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(124, 58, 237, .45); }
button:active, .btn:active { transform: translateY(0); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.ghost {
  background: rgba(255, 255, 255, .06); color: var(--text);
  border: 1px solid var(--line-2); box-shadow: none;
}
.btn.ghost:hover { background: rgba(255, 255, 255, .1); box-shadow: none; }
.btn.sm { padding: 7px 13px; font-size: 12.5px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn.danger { background: linear-gradient(135deg, #f43f5e, #fb7185); box-shadow: 0 6px 20px rgba(244, 63, 94, .35); }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
th { font-size: 10.5px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
td { font-variant-numeric: tabular-nums; }
tbody tr { transition: background .18s; }
tbody tr:hover { background: rgba(255, 255, 255, .035); }
tr:last-child td { border-bottom: none; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; gap: 4px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(10, 10, 16, .82);
  backdrop-filter: saturate(180%) blur(24px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; text-align: center; text-decoration: none; color: var(--text-3);
  font-size: 11px; padding: 7px 0; border-radius: 14px; transition: color .2s, background .2s;
}
.tabbar a .dot {
  display: block; width: 24px; height: 24px; margin: 0 auto 4px; border-radius: 8px;
  background: rgba(255, 255, 255, .08); transition: background .2s, transform .2s;
}
.tabbar a.on { color: #fff; background: rgba(255, 255, 255, .06); }
.tabbar a.on .dot { background: linear-gradient(135deg, #a855f7, #22d3ee); transform: translateY(-1px); }

/* ---------- 登录 ---------- */
.login-box { max-width: 380px; margin: 12vh auto; padding: 0 20px; }
.login-box .brand {
  font-size: 32px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 8px;
  background: linear-gradient(95deg, #fff 10%, #a5f3fc 55%, #c4b5fd 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.login-box .brand-sub { color: var(--text-2); font-size: 13px; margin-bottom: 28px; }
.login-tag { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 18px; }

/* ---------- 提示 ---------- */
.msg { padding: 11px 15px; border-radius: 14px; font-size: 13px; margin-bottom: 14px; border: 1px solid; }
.msg.err { background: rgba(244, 63, 94, .12); color: #fda4af; border-color: rgba(244, 63, 94, .3); }
.msg.ok { background: rgba(52, 211, 153, .12); color: #6ee7b7; border-color: rgba(52, 211, 153, .3); }
.empty { text-align: center; color: var(--text-3); font-size: 13px; padding: 30px 0; }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs button {
  padding: 9px 16px; font-size: 13px; border-radius: 999px;
  background: rgba(255, 255, 255, .05); color: var(--text-2);
  border: 1px solid var(--line); box-shadow: none;
}
.tabs button:hover { transform: none; background: rgba(255, 255, 255, .09); }
.tabs button.on {
  background: linear-gradient(135deg, #7c3aed, #22d3ee); color: #fff; border-color: transparent;
  box-shadow: 0 6px 18px rgba(124, 58, 237, .35);
}

.hint {
  background: rgba(96, 165, 250, .07); border: 1px solid rgba(96, 165, 250, .2);
  border-left: 3px solid var(--blue); border-radius: 14px; padding: 12px 14px;
  font-size: 12.5px; color: var(--text-2); margin-bottom: 14px; line-height: 1.7;
}
code { background: rgba(255, 255, 255, .08); padding: 2px 6px; border-radius: 6px; font-size: 12px; font-family: ui-monospace, Menlo, monospace; color: #a5f3fc; }

/* ---------- 迷你柱状图 ---------- */
.spark-bar { background: linear-gradient(180deg, #22d3ee, rgba(34, 211, 238, .25)); box-shadow: 0 0 12px rgba(34, 211, 238, .35); }
.spark-bar.off { background: rgba(255, 255, 255, .12); box-shadow: none; }
.spark-val {
  font-size: 10.5px; color: var(--text-2); font-variant-numeric: tabular-nums;
  letter-spacing: 0; line-height: 1.2; white-space: nowrap;
}

/* ---------- 统计小卡 ---------- */
.stat { text-align: left; }
.stat .card-title { margin-bottom: 8px; }

/* ---------- 手机端适配 ---------- */
@media (max-width: 768px) {
  .wrap { padding: 14px 12px 104px; }
  .topbar { padding: 12px 14px; }
  .topbar h1 { font-size: 17px; }
  .card { padding: 16px; border-radius: 16px; }
  .card.tight { padding: 13px; }
  .grid2 { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .num { font-size: 21px; }
  .big { font-size: 34px; }
  /* 表格横向滑动，不挤压布局 */
  table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  th, td { padding: 10px 10px; }
  /* 顶部分类横滑 */
  .tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: 0 0 auto; }
  .row { flex-wrap: wrap; }
  input, textarea, select { font-size: 16px; } /* 防 iOS 聚焦自动放大 */
  .login-box { margin-top: 8vh; }
}

@media (max-width: 420px) {
  .big { font-size: 30px; }
  .num { font-size: 19px; }
  .btn { padding: 11px 15px; }
  .btn.sm { padding: 7px 11px; font-size: 12px; }
}
