:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: rgba(12, 27, 48, .92);
  --panel-soft: #14233a;
  --line: rgba(157, 189, 221, .22);
  --text: #edf6ff;
  --muted: #9fb2ca;
  --cyan: #66d5ee;
  --mint: #67e0b5;
  --danger: #ff8da3;
  font-family: Inter, "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, rgba(64, 191, 207, .18), transparent 30%),
    radial-gradient(circle at 90% 20%, rgba(121, 92, 225, .18), transparent 32%),
    var(--bg);
}
a { color: inherit; }
button, input { font: inherit; }
.shell { width: min(1160px, calc(100% - 32px)); margin: 0 auto; padding: 20px 0 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: #06131c; font-weight: 900; background: linear-gradient(135deg, var(--cyan), var(--mint)); }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 10px; letter-spacing: .08em; }
nav { display: flex; gap: 10px; }
nav a { padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--muted); }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding: 52px 0 28px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(32px, 5vw, 54px); }
h2 { margin-bottom: 8px; }
.hero p, .card > p, .redeem-card p { color: var(--muted); }
.eyebrow { margin-bottom: 8px; color: var(--cyan) !important; font-size: 11px; font-weight: 900; letter-spacing: .16em; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(110px, 1fr)); gap: 10px; }
.metrics div { min-width: 120px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(17, 33, 56, .7); }
.metrics strong, .metrics span { display: block; }
.metrics strong { font-size: 25px; }
.metrics span { margin-top: 5px; color: var(--muted); font-size: 12px; }
.card { margin-top: 14px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: 0 18px 55px rgba(0, 0, 0, .2); }
.gate { max-width: 540px; margin: 13vh auto 0; }
.gate h1 { font-size: 30px; }
.gate-actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.redeem-card { display: grid; grid-template-columns: .75fr 1.25fr; gap: 36px; align-items: end; }
label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; font-weight: 700; }
.redeem-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
input { width: 100%; min-height: 48px; padding: 0 14px; color: var(--text); border: 1px solid var(--line); border-radius: 13px; outline: none; background: rgba(4, 12, 24, .72); }
input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(102, 213, 238, .14); }
.primary, .secondary, .danger { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 12px; cursor: pointer; font-weight: 800; text-decoration: none; }
.primary { color: #06131c; border: 0; background: linear-gradient(120deg, var(--cyan), var(--mint)); }
.secondary { color: var(--text); border: 1px solid var(--line); background: var(--panel-soft); }
.danger { color: #ffdce4; border: 1px solid rgba(255, 112, 143, .35); background: rgba(91, 25, 48, .42); }
.compact { min-height: 36px; padding: 0 14px; }
button:disabled { cursor: wait; opacity: .6; }
.alert { margin-top: 14px; padding: 13px 15px; border: 1px solid rgba(102, 213, 238, .32); border-radius: 13px; color: #c9f6ff; background: rgba(22, 99, 121, .24); }
.alert.error { border-color: rgba(255, 112, 143, .42); color: #ffd7df; background: rgba(109, 28, 52, .32); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.license-card, .device-row { padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: rgba(19, 37, 62, .64); }
.license-card header, .device-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.license-card h3, .device-row strong { margin: 0 0 5px; }
.license-card p, .license-card small, .device-row small { color: var(--muted); }
.pill { white-space: nowrap; padding: 5px 9px; border-radius: 999px; color: #7ef0c3; background: rgba(32, 141, 109, .2); font-size: 11px; font-weight: 800; }
.pill.inactive { color: #ffadbe; background: rgba(154, 45, 75, .2); }
.device-list { display: grid; gap: 10px; }
.device-meta { display: grid; gap: 4px; }
.empty { margin: 14px 0 0; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 11px; letter-spacing: .06em; }

@media (max-width: 760px) {
  .shell { width: min(100% - 20px, 1160px); }
  .topbar, .hero { align-items: flex-start; flex-direction: column; }
  nav { width: 100%; }
  nav a { flex: 1; text-align: center; }
  .metrics { width: 100%; grid-template-columns: repeat(3, 1fr); }
  .metrics div { min-width: 0; padding: 13px; }
  .redeem-card { grid-template-columns: 1fr; gap: 12px; }
  .redeem-row { grid-template-columns: 1fr; }
  .card { padding: 18px; }
}
