/* 工具 · 管理后台样式 —— 与 App 保持同一套配色 */
:root {
  --cyan: #06b6d4;
  --yellow: #facc15;
  --green: #22c55e;
  --bg: #0f172a;
  --panel: #16223a;
  --panel2: #1c2a45;
  --line: #24344f;
  --text: #e6edf7;
  --dim: #93a4bd;
  --red: #ef4444;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  min-height: 100vh;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, select {
  font-family: inherit; font-size: 14px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 11px; outline: none;
}
input:focus, select:focus { border-color: var(--cyan); }

/* ---------- 按钮 ---------- */
.btn-convert {
  background: var(--green); color: #fff; border: 0;
  border-radius: 8px; padding: 10px 18px; font-weight: 600;
}
.btn-convert:active { transform: translateY(1px); }
.btn-convert[disabled] { opacity: .55; cursor: not-allowed; }
.btn-mini {
  background: var(--yellow); color: #2a2408; border: 0;
  border-radius: 6px; padding: 5px 11px; font-weight: 600; font-size: 13px;
}
.btn-mini[disabled] { opacity: .5; cursor: not-allowed; }
.btn-ghost {
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45);
  border-radius: 6px; padding: 5px 11px; font-size: 13px;
}

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 360px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 16px; padding: 28px 24px;
  display: flex; flex-direction: column; gap: 14px; text-align: center;
}
.logo { display: flex; justify-content: center; }
.ring {
  width: 54px; height: 54px; border-radius: 50%;
  border: 6px solid #fff; background: #000; display: block;
  box-shadow: 0 0 0 6px #000;
}
.login-card h1 { font-size: 19px; margin: 0; }
.login-card .sub { margin: 0; color: var(--dim); font-size: 12.5px; line-height: 1.5; }
.login-card input { text-align: center; }
.msg { min-height: 18px; margin: 0; font-size: 13px; color: var(--red); }
.msg.ok { color: var(--green); }

/* ---------- 顶栏 ---------- */
.topbar {
  background: var(--cyan); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; padding-top: calc(12px + env(safe-area-inset-top, 0px));
}
.topbar h1 { font-size: 16px; margin: 0; }
.topbar .right { display: flex; align-items: center; gap: 10px; }
.who { font-size: 12.5px; opacity: .92; }

.page { max-width: 1180px; margin: 0 auto; padding: 18px 16px 60px; }

/* ---------- 概览 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px;
}
.stat .k { color: var(--dim); font-size: 12.5px; }
.stat .v { font-size: 24px; font-weight: 700; color: var(--cyan); margin-top: 2px; }

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab {
  background: var(--panel); color: var(--dim); border: 1px solid var(--line);
  border-radius: 9px; padding: 9px 20px; font-weight: 600;
}
.tab.active { background: var(--cyan); color: #fff; border-color: var(--cyan); }

/* ---------- 卡片 ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.card-hd {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px; font-weight: 600;
}
.hd-actions { display: flex; gap: 8px; }
.row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { color: var(--dim); font-size: 12.5px; }

/* ---------- 卡密网格 ---------- */
.code-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.code-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px;
}
.code-item .c { font-family: ui-monospace, Consolas, "Courier New", monospace; letter-spacing: .5px; font-size: 13.5px; }
.code-item button { flex: 0 0 auto; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th { color: var(--dim); font-weight: 600; font-size: 12.5px; background: var(--panel2); }
.tbl tbody tr:hover { background: var(--panel2); }
.tbl .mono { font-family: ui-monospace, Consolas, "Courier New", monospace; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.used { background: rgba(34,197,94,.18); color: var(--green); }
.badge.unused { background: rgba(250,204,21,.18); color: var(--yellow); }
.badge.t-月卡 { background: rgba(6,182,212,.18); color: var(--cyan); }
.badge.t-季卡 { background: rgba(99,102,241,.22); color: #a5b4fc; }
.badge.t-年卡 { background: rgba(236,72,153,.2); color: #f9a8d4; }
.dev { max-width: 240px; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; }

/* ---------- 安全审计徽章 ---------- */
.badge.ok { background: rgba(34,197,94,.18); color: var(--green); }
.badge.bad { background: rgba(239,68,68,.2); color: var(--red); }
.badge.rooted { background: rgba(250,204,21,.18); color: var(--yellow); }
.badge.clean { background: rgba(148,163,184,.16); color: var(--dim); }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
.pager span { color: var(--dim); font-size: 13px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 20px);
  background: #22304a; color: #fff; border: 1px solid var(--line);
  padding: 10px 18px; border-radius: 10px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 99; max-width: 88vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { border-color: var(--green); }
.toast.err { border-color: var(--red); }

/* ============================================================
   v1.3.0 新增
   ============================================================ */

/* 顶栏版本号 */
.ver {
  font-size: 11.5px; font-weight: 500; opacity: .85;
  background: rgba(255,255,255,.18); border-radius: 999px; padding: 1px 8px;
  vertical-align: middle; margin-left: 4px;
}

/* 危险按钮（封禁 / 解绑 / 作废） */
.btn-mini.danger {
  background: var(--red); color: #fff;
}
.btn-mini.danger[disabled] { opacity: .5; }

/* 数据看板的数字卡：比概览卡更紧凑 */
.dash-stats { margin-bottom: 6px; }
.dash-stats .stat { padding: 12px 14px; }
.dash-stats .stat .v { font-size: 22px; }

/* 卡片内的小标题（如「未来 7 天内即将到期」） */
.sub-hd {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 14px 0 8px; color: var(--dim);
  font-size: 12.5px; font-weight: 600;
}

/* 说明文字行 */
.hint-line {
  margin: 10px 0 0; color: var(--dim); font-size: 12.5px; line-height: 1.55;
}

/* 让输入框在 flex 行里吃掉剩余宽度 */
.grow { flex: 1 1 auto; }
.grow > input { width: 100%; }

/* 表格里的操作按钮组：不换行、留间距 */
.op-cell { white-space: nowrap; }
.op-cell > button { margin-right: 4px; }
.op-cell > button:last-child { margin-right: 0; }

/* 已作废 / 定向 / 从未激活 徽章 */
.badge.void { background: rgba(148,163,184,.16); color: var(--dim); text-decoration: line-through; }
.badge.target { background: rgba(99,102,241,.22); color: #a5b4fc; }
.badge.never { background: rgba(148,163,184,.16); color: var(--dim); }
.badge.t-福利码 { background: rgba(250,204,21,.18); color: var(--yellow); }

/* 窄屏：表格横向滚更顺一点，操作列按钮变小 */
@media (max-width: 720px) {
  .page { padding: 14px 10px 60px; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); }
  .stat .v { font-size: 20px; }
  .tabs { flex-wrap: wrap; }
  .tab { padding: 8px 14px; }
  .op-cell > button { padding: 4px 8px; font-size: 12px; }
}
