:root {
  --bg: #0b0f16;
  --bg-soft: #111825;
  --panel: #151d2b;
  --panel-2: #1a2435;
  --line: rgba(255, 255, 255, 0.09);
  --text: #edf2f9;
  --muted: #8d9bb0;
  --accent: #31d3ff;
  --accent-2: #7c6bff;
  --green: #3ce0a1;
  --amber: #ffbf5e;
  --red: #ff6b7a;
  --radius: 16px;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(49, 211, 255, 0.12), transparent 60%),
    radial-gradient(800px 500px at 95% 0%, rgba(124, 107, 255, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
}
h1, h2, h3, p { margin-top: 0; }
.muted { color: var(--muted); line-height: 1.75; }
.hint { color: var(--muted); font-size: 12px; }
code {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  color: #cfefff;
}

/* ---------------- login ---------------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px;
}
.login-card {
  width: min(430px, 100%);
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  text-align: center;
}
.brand-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #071018;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.05em;
  box-shadow: 0 12px 35px rgba(49, 211, 255, 0.25);
}
.brand-mark.small { width: 42px; height: 42px; font-size: 15px; margin: 0; border-radius: 11px; }
.login-card h1 { margin: 0 0 10px; font-size: 27px; letter-spacing: 0.01em; }
.login-desc { color: var(--muted); line-height: 1.7; margin-bottom: 26px; font-size: 14px; }
.login-card label {
  display: block;
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 7px 2px;
}
.login-card input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(6, 10, 16, 0.7);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-card input:focus {
  border-color: rgba(49, 211, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(49, 211, 255, 0.1);
}
.login-card .primary { width: 100%; margin-top: 14px; height: 46px; }
.form-error { min-height: 18px; margin: 12px 0 0; color: var(--red); font-size: 13px; }
.login-foot { margin: 24px 0 0; color: #5d6a7e; font-size: 12px; }

.primary {
  border: 0;
  border-radius: 11px;
  padding: 0 18px;
  color: #051018;
  background: linear-gradient(135deg, var(--accent), #78e2ff);
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 26px rgba(49, 211, 255, 0.2);
  transition: transform 0.15s, filter 0.15s, opacity 0.15s;
}
.primary:hover { transform: translateY(-1px); filter: brightness(1.06); }
.primary:disabled { opacity: 0.5; cursor: default; transform: none; }
.ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  transition: background 0.15s, border-color 0.15s;
}
.ghost:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.18); }
.danger-text { color: var(--red); }
.tiny { padding: 7px 10px; font-size: 12px; border-radius: 8px; }

/* ---------------- console ---------------- */
.console { min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 15, 22, 0.82);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand strong { display: block; font-size: 15px; }
.brand small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.top-actions { display: flex; gap: 9px; }
.page { max-width: 1180px; margin: 0 auto; padding: 34px 32px 70px; }
.intro-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 22px;
}
.intro-row h2 { font-size: 30px; margin: 0 0 8px; letter-spacing: -0.02em; }
.intro-row p { margin-bottom: 0; max-width: 640px; font-size: 13px; }
.add-btn { height: 44px; white-space: nowrap; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.stat {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  padding: 16px 18px;
}
.stat span { color: var(--muted); font-size: 12px; }
.stat strong { display: block; font-size: 26px; margin-top: 8px; letter-spacing: -0.02em; }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
  padding: 20px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-head h3 { margin: 0; font-size: 16px; }
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }

.account-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  padding: 17px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.account-card:hover { border-color: rgba(49, 211, 255, 0.28); transform: translateY(-1px); }
.account-card.is-off { opacity: 0.6; }
.account-card.is-expired { border-color: rgba(255, 107, 122, 0.35); }
.card-top { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, #27354a, #182338);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #9fe9ff;
  border: 1px solid var(--line);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.identity { min-width: 0; flex: 1; }
.identity h4 { margin: 0 0 4px; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.identity small { color: var(--muted); font-size: 11px; word-break: break-all; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}
.badge.vip { color: #ffd27a; border-color: rgba(255, 191, 94, 0.3); background: rgba(255, 191, 94, 0.08); }
.badge.ok { color: var(--green); border-color: rgba(60, 224, 161, 0.26); background: rgba(60, 224, 161, 0.07); }
.badge.err { color: var(--red); border-color: rgba(255, 107, 122, 0.28); background: rgba(255, 107, 122, 0.07); }
.badge.off { color: var(--amber); border-color: rgba(255, 191, 94, 0.24); }
.card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 14px;
  margin: 14px 0;
  font-size: 12px;
  color: var(--muted);
}
.card-meta b { color: #d9e3f2; font-weight: 500; }
.note-row { display: flex; gap: 6px; margin-bottom: 12px; }
.note-row input {
  flex: 1;
  min-width: 0;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(5, 9, 15, 0.55);
  color: var(--text);
  padding: 0 9px;
  font-size: 12px;
  outline: none;
}
.note-row input:focus { border-color: rgba(49, 211, 255, 0.45); }
.card-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.empty { text-align: center; padding: 52px 20px 46px; }
.empty-icon { font-size: 52px; color: rgba(49, 211, 255, 0.45); margin-bottom: 10px; }
.empty h3 { margin: 0 0 8px; }
.empty p { max-width: 470px; margin: 0 auto 20px; color: var(--muted); font-size: 13px; line-height: 1.8; }

.tips { margin-top: 18px; }
.tips h3 { font-size: 15px; margin-bottom: 12px; }
.tips ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 2; }

/* ---------------- modal ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(3, 6, 10, 0.75);
  backdrop-filter: blur(8px);
}
.modal-card {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: linear-gradient(165deg, #182233, #111826);
  box-shadow: var(--shadow);
  padding: 28px;
}
.modal-card h3 { font-size: 19px; margin: 0 0 7px; }
.modal-card .muted { font-size: 13px; margin-bottom: 18px; }
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}
.modal-close:hover { color: #fff; background: rgba(255, 255, 255, 0.09); }
.qr-card { text-align: center; }
.qr-box {
  position: relative;
  width: 236px;
  height: 236px;
  margin: 0 auto;
  border-radius: 18px;
  background: #fff;
  padding: 10px;
  display: grid;
  place-items: center;
}
.qr-box img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
.qr-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #fff;
  color: #445;
  font-size: 13px;
}
.qr-status { margin: 16px 0 2px; font-size: 14px; color: var(--accent); }
.qr-countdown { margin: 0; font-size: 12px; color: var(--muted); min-height: 18px; }
.qr-actions { display: flex; justify-content: center; gap: 9px; margin-top: 18px; }
.player-card { width: min(860px, 100%); }
.player-card video {
  width: 100%;
  max-height: 62vh;
  border-radius: 13px;
  background: #000;
  margin: 4px 0 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 80;
  max-width: min(560px, calc(100vw - 32px));
  padding: 12px 18px;
  border: 1px solid rgba(49, 211, 255, 0.28);
  border-radius: 999px;
  background: rgba(14, 24, 36, 0.95);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
  color: var(--text);
  font-size: 13px;
  text-align: center;
}
.toast.error { border-color: rgba(255, 107, 122, 0.45); color: #ffc2c8; }

@media (max-width: 860px) {
  .account-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 13px 18px; }
  .page { padding: 26px 16px 60px; }
  .intro-row { flex-direction: column; align-items: stretch; }
  .add-btn { width: 100%; }
  .brand small { display: none; }
}
@media (max-width: 480px) {
  .login-card { padding: 28px 22px; }
  .modal-card { padding: 22px 18px; }
  .qr-box { width: 200px; height: 200px; }
  .card-meta { grid-template-columns: 1fr; }
  .top-actions .ghost { padding: 8px 10px; }
}
