:root {
  --bg: #05070f;
  --bg2: #0a1020;
  --panel: rgba(16, 24, 44, 0.72);
  --panel-solid: #101828;
  --line: rgba(120, 170, 255, 0.14);
  --text: #e8f0ff;
  --muted: #8fa3c8;
  --cyan: #27e0ff;
  --violet: #8b7bff;
  --green: #37e6a4;
  --amber: #ffc857;
  --red: #ff5d73;
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(39, 224, 255, 0.10), transparent 60%),
    radial-gradient(1000px 600px at 95% 8%, rgba(139, 123, 255, 0.12), transparent 55%),
    linear-gradient(180deg, #05070f 0%, #070c18 55%, #05070f 100%);
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(120, 170, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 170, 255, 0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 78%);
}

#fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.page {
  position: relative;
  z-index: 2;
  max-width: 1560px;
  margin: 0 auto;
  padding: 26px 28px 60px;
}

header.top {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

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

.logo {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: conic-gradient(from 180deg, var(--cyan), var(--violet), var(--cyan));
  position: relative;
  box-shadow: 0 0 26px rgba(39, 224, 255, 0.35);
}

.logo::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 9px;
  background: #070c18;
}

.logo::before {
  content: "";
  position: absolute;
  inset: 15px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  z-index: 1;
}

h1 {
  margin: 0;
  font-size: 21px;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.sub {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.18em;
}

nav {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: 0.2s;
}

nav a:hover { color: var(--text); border-color: var(--line); }

nav a.active {
  color: #041018;
  background: linear-gradient(135deg, var(--cyan), #6fd7ff);
  font-weight: 700;
  box-shadow: 0 0 22px rgba(39, 224, 255, 0.35);
}

.clock {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 16, 32, 0.6);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 1.8s infinite;
}

.dot.warn { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.dot.bad { background: var(--red); box-shadow: 0 0 10px var(--red); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 16px;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.kpi::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(39, 224, 255, 0.65), transparent);
}

.kpi .label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}

.kpi .value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.kpi .unit {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  margin-left: 4px;
}

.kpi.glow-cyan .value { color: var(--cyan); text-shadow: 0 0 24px rgba(39, 224, 255, 0.35); }
.kpi.glow-violet .value { color: #b3a8ff; text-shadow: 0 0 24px rgba(139, 123, 255, 0.35); }
.kpi.glow-green .value { color: var(--green); text-shadow: 0 0 24px rgba(55, 230, 164, 0.30); }

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.16em;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 15px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--violet));
}

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

.card {
  position: relative;
  background: linear-gradient(165deg, rgba(22, 32, 56, 0.86), rgba(10, 16, 30, 0.80));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
  backdrop-filter: blur(8px);
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(39, 224, 255, 0.35);
}

.card.offline { opacity: 0.55; }

.card .topline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.machine {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.serial {
  font-size: 11px;
  color: #6f83a8;
  font-variant-numeric: tabular-nums;
}

.pill {
  margin-left: auto;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.pill.run { color: var(--green); border-color: rgba(55, 230, 164, 0.45); background: rgba(55, 230, 164, 0.08); }
.pill.idle { color: var(--muted); }
.pill.warn { color: var(--amber); border-color: rgba(255, 200, 87, 0.45); background: rgba(255, 200, 87, 0.08); }
.pill.bad { color: var(--red); border-color: rgba(255, 93, 115, 0.45); background: rgba(255, 93, 115, 0.08); }

.game-name {
  font-size: 20px;
  font-weight: 700;
  margin: 2px 0 14px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.metric {
  background: rgba(8, 14, 28, 0.7);
  border: 1px solid rgba(120, 170, 255, 0.10);
  border-radius: 12px;
  padding: 10px 12px;
}

.metric .m-label { color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.metric .m-value { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.metric .m-value.money { color: var(--cyan); }

.next {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px dashed rgba(120, 170, 255, 0.14);
  padding-top: 11px;
}

.next b { color: #cdd9f2; font-weight: 600; }

.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 54px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  font-size: 14px;
}

/* 总收益大屏 */
.hero {
  position: relative;
  background:
    radial-gradient(900px 320px at 20% 0%, rgba(39, 224, 255, 0.16), transparent 65%),
    radial-gradient(700px 300px at 90% 100%, rgba(139, 123, 255, 0.18), transparent 60%),
    linear-gradient(160deg, rgba(20, 30, 54, 0.92), rgba(8, 13, 26, 0.90));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 30px 34px 26px;
  margin-bottom: 20px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(90deg, rgba(120, 170, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 100%;
  pointer-events: none;
}

.hero .h-label {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.22em;
  margin-bottom: 6px;
}

.hero .h-value {
  font-size: clamp(48px, 7vw, 86px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #ffffff 0%, #7fe6ff 58%, #59a9ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 26px rgba(39, 224, 255, 0.28));
}

.hero .h-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.progress-wrap {
  margin-top: 22px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(120, 170, 255, 0.12);
  overflow: hidden;
}

.progress > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  box-shadow: 0 0 18px rgba(39, 224, 255, 0.5);
  transition: width 0.8s ease;
}

.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(8px);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.10em;
  font-size: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 16, 32, 0.5);
}

tbody td {
  padding: 13px 18px;
  border-bottom: 1px solid rgba(120, 170, 255, 0.07);
  font-variant-numeric: tabular-nums;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(39, 224, 255, 0.045); }

td.num { text-align: right; }
td.money { color: var(--cyan); font-weight: 600; }
td.money2 { color: #b3a8ff; }
td.ecpm-low { color: var(--red); }
td.ecpm-ok { color: var(--green); }

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}

footer.foot {
  margin-top: 22px;
  color: #5f7194;
  font-size: 12px;
  line-height: 1.8;
}

.toast {
  position: fixed;
  left: 50%;
  top: 22px;
  transform: translate(-50%, -18px);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: 0.45s;
  padding: 12px 26px;
  border-radius: 999px;
  border: 1px solid rgba(39, 224, 255, 0.5);
  background: rgba(8, 16, 32, 0.9);
  color: #bff4ff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow: 0 0 34px rgba(39, 224, 255, 0.28);
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 720px) {
  .page { padding: 18px 14px 44px; }
  header.top { flex-wrap: wrap; }
  nav { margin-left: 0; width: 100%; }
  .clock { margin-left: auto; }
  .hero { padding: 24px 20px; }
  .metrics { grid-template-columns: 1fr; }
}
