/* PhantomBox 计费中心 · 用户端 + 总后台 共用样式 */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
:root {
  --bg: #070a12;
  --bg-soft: #0c1019;
  --panel: #10141f;
  --panel-2: #151a26;
  --line: #1f2735;
  --line-soft: #171d29;
  --text: #e9edf6;
  --dim: #8b96ab;
  --dim-2: #5d6879;
  --brand: #3d7bff;
  --brand-2: #6ea1ff;
  --ok: #2ecc8f;
  --warn: #f5a623;
  --bad: #ff5c5c;
  --radius: 12px;
}
body {
  background: radial-gradient(1200px 600px at 80% -10%, #16234a 0%, transparent 60%),
              radial-gradient(900px 500px at 0% 0%, #12203d 0%, transparent 55%),
              var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}
a { color: var(--brand-2); text-decoration: none; }
button { font-family: inherit; }
.hide { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; gap: 22px;
  padding: 0 26px; height: 62px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(8, 11, 18, .82); backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; letter-spacing: .3px; }
.brand .dot { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, var(--brand), #8f5cff); box-shadow: 0 0 18px rgba(61,123,255,.55); }
.brand small { color: var(--dim-2); font-weight: 500; font-size: 11px; margin-left: 2px; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--dim); padding: 7px 13px; border-radius: 9px; font-size: 13px; }
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a.on { color: #fff; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.spacer { flex: 1; }
.who { color: var(--dim); font-size: 12.5px; }

/* ---------- 通用 ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 26px; }
.card { background: linear-gradient(180deg, rgba(21,26,38,.72), rgba(13,17,26,.9)); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 20px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 14px; }
h3 { font-size: 14px; margin: 0 0 10px; color: var(--text); }
.sub { color: var(--dim); font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.grid { display: grid; gap: 14px; }
.muted { color: var(--dim); }
.tiny { font-size: 12px; }
.sec-title { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 12px; }
.sec-title h2 { margin: 0; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font-size: 13px; cursor: pointer;
  transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #2b3648; background: #1a2130; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, #3d7bff, #5d63ff); border-color: transparent; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn.danger { color: #ffb3b3; border-color: #48222a; background: #241318; }
.btn.danger:hover { background: #2e171d; }
.btn.ok { color: #9df0cc; border-color: #1e4638; background: #10241d; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; color: var(--dim); }
.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 9px;
  background: #0a0e16; border: 1px solid var(--line); color: var(--text);
  font-size: 13.5px; outline: none; transition: .15s;
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(61,123,255,.14); }
.input::placeholder { color: var(--dim-2); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #6a7791 50%), linear-gradient(135deg, #6a7791 50%, transparent 50%); background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
.hint { font-size: 12px; color: var(--dim-2); }
.err { color: #ff9b9b; font-size: 12.5px; min-height: 18px; }
.ok-txt { color: #7ee2bd; font-size: 12.5px; }

/* ---------- 登录 ---------- */
.auth-wrap { min-height: calc(100vh - 62px); display: grid; place-items: center; padding: 30px; }
.auth { width: 100%; max-width: 400px; padding: 28px; }
.auth h1 { font-size: 20px; margin-bottom: 4px; }
.auth .tabs { display: flex; gap: 6px; background: #0a0e16; padding: 4px; border-radius: 10px; border: 1px solid var(--line); margin: 18px 0 20px; }
.auth .tabs button { flex: 1; height: 32px; border: none; background: transparent; color: var(--dim); border-radius: 7px; font-size: 13px; cursor: pointer; }
.auth .tabs button.on { background: var(--panel-2); color: #fff; }
.auth .btn { width: 100%; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { padding: 16px 18px; }
.kpi .k { font-size: 12px; color: var(--dim); }
.kpi .v { font-size: 24px; font-weight: 700; margin-top: 6px; letter-spacing: .5px; }
.kpi .d { font-size: 11.5px; color: var(--dim-2); margin-top: 2px; }
.kpi.accent .v { background: linear-gradient(135deg, #6ea1ff, #b18cff); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- 套餐卡 ---------- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.plan { padding: 22px; position: relative; overflow: hidden; }
.plan.hot { border-color: #2b4a95; box-shadow: 0 0 0 1px rgba(61,123,255,.25), 0 18px 50px -30px rgba(61,123,255,.8); }
.plan .badge { position: absolute; top: 14px; right: -30px; transform: rotate(38deg); background: linear-gradient(135deg, #3d7bff, #7a5cff); color: #fff; font-size: 11px; padding: 3px 34px; }
.plan .pname { font-size: 15px; font-weight: 600; }
.plan .price { font-size: 30px; font-weight: 700; margin: 10px 0 2px; }
.plan .price span { font-size: 13px; color: var(--dim); font-weight: 400; margin-left: 2px; }
.plan ul { list-style: none; padding: 0; margin: 16px 0 18px; display: grid; gap: 8px; }
.plan li { font-size: 12.8px; color: var(--dim); padding-left: 18px; position: relative; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-size: 12px; }
.plan .btn { width: 100%; }

/* ---------- 表格 ---------- */
.table-wrap { overflow: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
th { color: var(--dim); font-weight: 500; font-size: 12px; background: #0c111a; position: sticky; top: 0; }
tbody tr:hover td { background: rgba(255,255,255,.02); }
td.ell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 40px; text-align: center; color: var(--dim-2); font-size: 13px; }

/* ---------- 状态徽标 ---------- */
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; border: 1px solid transparent; }
.chip.paid { color: #86ebc4; background: #0f2a21; border-color: #1d4437; }
.chip.pending { color: #ffd48a; background: #2a2110; border-color: #4a3a18; }
.chip.expired, .chip.canceled, .chip.failed { color: #9aa4b5; background: #171c26; border-color: #232b39; }
.chip.on { color: #86ebc4; background: #0f2a21; border-color: #1d4437; }
.chip.off { color: #9aa4b5; background: #171c26; border-color: #232b39; }
.chip.ban { color: #ffc0c0; background: #2a1518; border-color: #482229; }

/* ---------- 弹层 ---------- */
.mask { position: fixed; inset: 0; background: rgba(3,6,11,.72); backdrop-filter: blur(4px); z-index: 60; display: grid; place-items: center; padding: 24px; }
.modal { width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 40px 90px -40px #000; }
.modal.wide { max-width: 720px; }
.modal .head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal .head h2 { margin: 0; }
.x { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--dim); cursor: pointer; font-size: 15px; line-height: 1; }
.x:hover { color: #fff; background: var(--panel-2); }

/* ---------- 支付方式 ---------- */
.chans { display: grid; gap: 10px; }
.chan { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: .15s; background: #0b0f17; }
.chan:hover { border-color: #2b3648; }
.chan.on { border-color: var(--brand); background: rgba(61,123,255,.08); box-shadow: 0 0 0 1px rgba(61,123,255,.25); }
.chan .icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; background: var(--panel-2); border: 1px solid var(--line); }
.chan .nm { font-size: 13.5px; }
.chan .ds { font-size: 11.5px; color: var(--dim-2); }

/* ---------- 收款区 ---------- */
.paybox { display: grid; gap: 14px; }
.qr-box { display: grid; place-items: center; padding: 14px; background: #fff; border-radius: 12px; width: 208px; height: 208px; margin: 0 auto; }
.qr-box canvas { display: block; }
.amount { text-align: center; font-size: 26px; font-weight: 700; letter-spacing: .5px; }
.amount small { font-size: 12px; color: var(--dim); font-weight: 400; }
.copyline { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #0a0e16; border: 1px solid var(--line); border-radius: 9px; }
.copyline .v { flex: 1; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.copyline .btn { height: 28px; padding: 0 9px; font-size: 11.5px; }
.steps-hint { font-size: 12.5px; color: var(--dim); line-height: 1.9; }
.steps-hint b { color: var(--text); font-weight: 600; }
.countdown { text-align: center; font-size: 12.5px; color: var(--warn); }

/* ---------- 后台布局 ---------- */
.admin-shell { display: grid; grid-template-columns: 212px 1fr; min-height: calc(100vh - 62px); }
.side { border-right: 1px solid var(--line-soft); padding: 16px 12px; background: rgba(9,12,19,.6); }
.side .grp { font-size: 11px; color: var(--dim-2); padding: 14px 10px 6px; letter-spacing: .6px; }
.side a { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 9px; color: var(--dim); font-size: 13px; margin-bottom: 2px; }
.side a:hover { background: var(--panel); color: var(--text); }
.side a.on { background: linear-gradient(90deg, rgba(61,123,255,.18), rgba(61,123,255,.04)); color: #fff; box-shadow: inset 0 0 0 1px rgba(61,123,255,.22); }
.side a i { width: 16px; text-align: center; font-style: normal; font-size: 13px; opacity: .9; }
.admin-main { padding: 24px 28px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }

/* ---------- 图表 ---------- */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 132px; padding: 10px 2px 0; }
.chart .bar { flex: 1; background: linear-gradient(180deg, #4d86ff, #23407c); border-radius: 4px 4px 0 0; min-height: 3px; position: relative; transition: .2s; }
.chart .bar:hover { filter: brightness(1.25); }
.chart .bar span { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--dim-2); white-space: nowrap; }
.chart-wrap { padding-bottom: 22px; }

/* ---------- 通道卡 ---------- */
.ch-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.ch-card { padding: 18px; }
.ch-card .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.ch-card .nm { font-size: 14.5px; font-weight: 600; }
.ch-card .note { font-size: 11.8px; color: var(--dim-2); line-height: 1.6; min-height: 34px; }
.ch-card .cfg { display: grid; gap: 10px; margin: 12px 0 0; }
.ch-card .cfg .field { margin: 0; }
.ch-card .cfg label { font-size: 11.5px; }
.ch-card .cfg .input { height: 34px; font-size: 12.5px; }
.switch { width: 42px; height: 24px; border-radius: 999px; background: #232c3c; border: 1px solid var(--line); position: relative; cursor: pointer; transition: .18s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #7d8798; transition: .18s; }
.switch.on { background: rgba(46,204,143,.22); border-color: #2a6b53; }
.switch.on::after { left: 21px; background: #46e2a6; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 10px 14px; font-size: 12.8px; }
.kv .k { color: var(--dim); }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(20px); background: #101a2c; border: 1px solid #274067; color: #dbe7ff; padding: 11px 18px; border-radius: 10px; font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 99; max-width: 90vw; }
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.bad { background: #2a1418; border-color: #512630; color: #ffc7c7; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .plans { grid-template-columns: 1fr; }
  .ch-cards { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .side { display: flex; overflow-x: auto; gap: 4px; border-right: none; border-bottom: 1px solid var(--line-soft); padding: 10px; }
  .side .grp { display: none; }
  .side a { white-space: nowrap; }
  .admin-main { padding: 18px 14px 50px; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 14px; gap: 10px; height: 56px; }
  .brand small { display: none; }
  .nav a { padding: 6px 9px; font-size: 12.5px; }
  .wrap { padding: 16px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi .v { font-size: 19px; }
  .modal { padding: 18px; }
  table { font-size: 12px; }
  th, td { padding: 9px 10px; }
}

/* 激活码 */
.lic-card{border:1px solid rgba(61,123,255,.35);background:linear-gradient(180deg,rgba(61,123,255,.09),rgba(61,123,255,.02))}
.lic-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.lic-code{flex:1;min-width:220px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:16px;
  letter-spacing:.06em;padding:11px 14px;border-radius:10px;background:var(--bg-soft);
  border:1px solid var(--line);color:var(--brand-2);word-break:break-all;user-select:all}
