:root {
  --bg: #0d0a1a;
  --panel: #171130;
  --panel2: #1e1740;
  --line: #332a5e;
  --gold: #e8c96a;
  --gold2: #b89a4a;
  --purple: #8b7cf7;
  --text: #ece9f7;
  --muted: #9a92b8;
  --ok: #4ade80;
  --bad: #f87171;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #2a1b5e 0%, var(--bg) 55%);
  color: var(--text); min-height: 100vh;
}
.stars { position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, #fff8 50%, transparent 50%),
    radial-gradient(1px 1px at 60% 70%, #fff6 50%, transparent 50%),
    radial-gradient(2px 2px at 35% 80%, #e8c96a66 50%, transparent 50%),
    radial-gradient(1px 1px at 80% 40%, #fff5 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 90% 85%, #8b7cf766 50%, transparent 50%);
}
header { display: flex; align-items: center; gap: 24px; padding: 14px 28px;
  border-bottom: 1px solid var(--line); background: #120c26cc; position: sticky; top: 0; z-index: 5; backdrop-filter: blur(8px); }
.brand { font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.brand .star { color: var(--gold); }
.brand small { color: var(--muted); font-weight: 400; margin-left: 8px; }
nav { display: flex; gap: 8px; flex: 1; }
.tab { background: transparent; border: 1px solid transparent; color: var(--muted);
  padding: 8px 18px; border-radius: 8px; cursor: pointer; font-size: 15px; }
.tab.active { color: var(--gold); border-color: var(--gold2); background: #e8c96a12; }
.user-box { color: var(--muted); font-size: 13px; }
main { position: relative; z-index: 1; max-width: 1280px; margin: 24px auto; padding: 0 24px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 16px; }
.auth-card { max-width: 420px; margin: 10vh auto; }
h2 { font-size: 17px; margin-bottom: 10px; color: var(--gold); }
.muted { color: var(--muted); font-size: 13px; line-height: 1.7; }
.small { font-size: 12px; }
code { background: #00000040; padding: 1px 6px; border-radius: 4px; color: var(--gold); }

input, select, fieldset { background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 9px 12px; font-size: 14px; outline: none; }
input:focus, select:focus { border-color: var(--gold2); }
form label { display: block; margin-bottom: 12px; }
form label > input, form label > select { width: 100%; margin-top: 6px; }
fieldset { margin: 12px 0; border-radius: 10px; padding: 12px; }
fieldset legend { color: var(--muted); font-size: 13px; padding: 0 6px; }
fieldset input, fieldset select { margin: 4px 4px 4px 0; }
.btn-row { display: flex; gap: 10px; margin-top: 6px; }
button { background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 14px; transition: all .15s; }
button:hover { border-color: var(--gold2); color: var(--gold); }
button.primary { background: linear-gradient(135deg, #6d5ae0, #8b7cf7); border: none; font-weight: 600; }
button.primary:hover { filter: brightness(1.15); color: #fff; }
button.ghost { background: transparent; }
button.danger:hover { border-color: var(--bad); color: var(--bad); }
button.mini { padding: 4px 10px; font-size: 12.5px; }
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }

table.grid { width: 100%; border-collapse: collapse; background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.grid th { text-align: left; font-size: 12.5px; color: var(--muted); padding: 12px 14px;
  background: #00000030; border-bottom: 1px solid var(--line); }
.grid td { padding: 12px 14px; border-bottom: 1px solid #00000022; font-size: 13.5px; vertical-align: top; }
.grid tr:last-child td { border-bottom: none; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.off { background: #555; }
.fp-main { font-weight: 600; }
.fp-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.ip-ok { color: var(--ok); }
.ip-bad { color: var(--bad); }

.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 14px; }
.device-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.device-card img { width: 100%; border-radius: 8px; border: 1px solid var(--line); margin: 10px 0; background: #000; min-height: 90px; }
.device-title { font-weight: 600; }
.device-serial { color: var(--muted); font-size: 12px; }

.wallet-box { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.wallet-balance { font-size: 38px; font-weight: 900; color: var(--gold); line-height: 1.1; }
.wallet-balance small { font-size: 13px; color: var(--muted); font-weight: 400; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 14px; }
.plan { border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; position: relative; }
.plan.best { border-color: var(--gold); background: #e8c96a14; box-shadow: 0 0 18px #e8c96a22; }
.plan .pr { font-size: 24px; font-weight: 900; color: var(--gold); }
.plan .pr small { font-size: 12px; color: var(--muted); font-weight: 400; }
.plan .was { text-decoration: line-through; color: var(--muted); font-size: 12px; }
.plan .lb { font-size: 13.5px; margin-bottom: 4px; }
.plan .save { color: var(--ok); font-size: 12px; }
.lic-badge { display: inline-block; padding: 3px 12px; border-radius: 8px; font-size: 12.5px; margin-right: 8px; border: 1px solid var(--line); }
.lic-badge.on { border-color: var(--ok); color: var(--ok); }
.lic-badge.off { color: var(--muted); }
.modal { position: fixed; inset: 0; background: #000a; display: flex; align-items: center; justify-content: center; z-index: 20; }

.modal-body { background: var(--panel); border: 1px solid var(--gold2); border-radius: 16px; padding: 24px; width: min(560px, 92vw); max-height: 88vh; overflow: auto; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--panel2); border: 1px solid var(--gold2); color: var(--text); border-radius: 10px;
  padding: 10px 22px; font-size: 14px; opacity: 0; transition: all .25s; z-index: 30; pointer-events: none; max-width: 80vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: var(--bad); }
