/* ==========================================================================
   QQ飞车道具代码查询系统 · 后台样式
   ========================================================================== */
* { box-sizing: border-box; }
:root {
  --abg: #f5f6fa;
  --acard: #ffffff;
  --atext: #111827;
  --asub: #6b7280;
  --amute: #9aa1ad;
  --aline: #e8eaef;
  --aline2: #f1f3f7;
  --abrand: #4d6bfe;
  --abrand2: #3a56e0;
  --abrand-soft: rgba(77, 107, 254, .09);
  --aok: #10b981;
  --awarn: #f59e0b;
  --aerr: #ef4444;
  --nav: #ffffff;
  --nav-act: #eef1ff;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 10px 30px rgba(16, 24, 40, .08);
  --r: 12px;
}
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--abg);
  color: var(--atext);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, select, textarea, button { font-family: inherit; font-size: 14px; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d3d8e2; border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: #bcc3d0; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.side {
  width: 226px; flex: none; background: var(--nav); border-right: 1px solid var(--aline);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-hd {
  height: 62px; display: flex; align-items: center; gap: 10px; padding: 0 16px;
  border-bottom: 1px solid var(--aline); flex: none;
}
.side-hd .mark {
  width: 32px; height: 32px; border-radius: 10px; flex: none; color: #fff;
  background: linear-gradient(135deg, var(--abrand), #8ba1ff);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; box-shadow: 0 5px 14px rgba(77, 107, 254, .3);
}
.side-hd .side-logo-img { height: 32px; max-width: 132px; object-fit: contain; flex: none; border-radius: 7px; }
.side-hd .tx { min-width: 0; }
.side-hd b { display: block; font-size: 14px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-hd small { color: var(--amute); font-size: 11.5px; }
.nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav-group { font-size: 11.5px; color: var(--amute); padding: 12px 12px 6px; letter-spacing: .4px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  color: #4b5563; font-size: 13.5px; margin-bottom: 2px; transition: .14s; font-weight: 500;
}
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .8; }
.nav a:hover { background: var(--aline2); color: var(--atext); }
.nav a.on { background: var(--nav-act); color: var(--abrand); }
.nav a.on svg { opacity: 1; }
.side-ft { padding: 12px; border-top: 1px solid var(--aline); display: flex; flex-direction: column; gap: 6px; flex: none; }
.side-ft a {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 9px;
  font-size: 13px; color: var(--asub); transition: .14s;
}
.side-ft a:hover { background: var(--aline2); color: var(--atext); }
.side-ft a.danger:hover { background: rgba(239, 68, 68, .08); color: var(--aerr); }
.side-ft svg { width: 16px; height: 16px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; background: rgba(255, 255, 255, .86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--aline); display: flex; align-items: center; gap: 14px;
  padding: 0 22px; position: sticky; top: 0; z-index: 40;
}
.topbar h1 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.2px; }
.topbar .crumb { color: var(--amute); font-size: 12.5px; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--asub); }
.topbar .who {
  display: flex; align-items: center; gap: 8px; background: var(--aline2); border-radius: 999px;
  padding: 5px 13px 5px 5px;
}
.topbar .who i {
  width: 26px; height: 26px; border-radius: 50%; background: var(--abrand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-style: normal; font-weight: 600;
}
.menu-toggle {
  display: none; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--aline);
  background: #fff; align-items: center; justify-content: center; cursor: pointer;
}
.content { padding: 22px 26px 40px; flex: 1; width: 100%; max-width: none; }

/* ---------- 分区（按功能类别成组展示，铺满页面） ---------- */
.sec-h {
  display: flex; align-items: center; gap: 10px; margin: 26px 0 14px;
  font-size: 14.5px; font-weight: 600; color: var(--atext); letter-spacing: -.2px;
}
.content > .sec-h:first-child { margin-top: 0; }
.sec-h::before { content: ""; width: 4px; height: 15px; border-radius: 3px; background: var(--abrand); flex: none; }
.sec-h .desc { color: var(--amute); font-size: 12.5px; font-weight: 400; }
.sec-block { margin-bottom: 30px; }
.sec-block > .card:last-child { margin-bottom: 0; }

/* 自适应卡片网格：宽屏自动多列铺满 */
.grid-auto { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.grid-auto > .card { margin-bottom: 0; }
.grid-auto.wide { grid-template-columns: repeat(auto-fit, minmax(480px, 1fr)); }
@media (max-width: 760px) { .grid-auto, .grid-auto.wide { grid-template-columns: 1fr; gap: 14px; } }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--acard); border: 1px solid var(--aline); border-radius: var(--r);
  box-shadow: var(--shadow); margin-bottom: 18px;
}
.card-hd {
  padding: 15px 20px; border-bottom: 1px solid var(--aline2); display: flex;
  align-items: center; gap: 12px; flex-wrap: wrap;
}
.card-hd h2 { margin: 0; font-size: 15px; font-weight: 650; }
.card-hd .desc { color: var(--amute); font-size: 12.5px; }
.card-hd .right { margin-left: auto; display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.card-bd { padding: 20px; }
.card-bd.tight { padding: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  background: var(--abrand); color: #fff; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { background: var(--abrand2); }
.btn:active { transform: scale(.985); }
.btn svg { width: 16px; height: 16px; }
.btn.ghost { background: #fff; color: var(--atext); border-color: var(--aline); }
.btn.ghost:hover { border-color: var(--abrand); color: var(--abrand); background: var(--abrand-soft); }
.btn.gray { background: var(--aline2); color: #4b5563; }
.btn.gray:hover { background: #e7eaf1; }
.btn.danger { background: var(--aerr); }
.btn.danger:hover { background: #d93b3b; }
.btn.danger-ghost { background: #fff; color: var(--aerr); border-color: #f6c9c9; }
.btn.danger-ghost:hover { background: rgba(239, 68, 68, .07); }
.btn.sm { height: 32px; padding: 0 13px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 500; color: #374151; }
.field label .req { color: var(--aerr); }
.field .hint { font-size: 12px; color: var(--amute); line-height: 1.55; }
.input, .textarea, .select {
  width: 100%; border: 1px solid var(--aline); border-radius: 10px; padding: 9px 12px;
  background: #fff; color: var(--atext); outline: none; transition: .15s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--abrand); box-shadow: 0 0 0 3px var(--abrand-soft);
}
.textarea { resize: vertical; min-height: 92px; line-height: 1.65; font-family: inherit; }
.textarea.mono { font-family: Consolas, Monaco, "Courier New", monospace; font-size: 12.5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
@media (max-width: 860px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* ---------- 表格 ---------- */
.tw { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th {
  text-align: left; padding: 11px 14px; background: #fafbfd; color: var(--asub);
  font-weight: 600; font-size: 12.5px; white-space: nowrap; border-bottom: 1px solid var(--aline);
  position: sticky; top: 0; z-index: 2;
}
table.tb td { padding: 11px 14px; border-bottom: 1px solid var(--aline2); vertical-align: middle; }
table.tb tr:hover td { background: #fafbff; }
table.tb td.nm { font-weight: 600; max-width: 240px; }
table.tb td .clamp {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; color: var(--asub); font-size: 12.5px; max-width: 320px;
}
table.tb .ops { display: flex; gap: 7px; white-space: nowrap; }
.idm { font-family: Consolas, Monaco, monospace; font-weight: 600; color: var(--abrand); }
.tag {
  display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 6px;
  background: var(--aline2); color: #4b5563; margin: 1px 3px 1px 0; white-space: nowrap;
}
.pill { display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.pill.male { background: rgba(47, 128, 237, .12); color: #1f6ed4; }
.pill.female { background: rgba(235, 75, 138, .12); color: #cf3d76; }
.pill.none { background: var(--aline2); color: var(--asub); }
.pill.ok { background: rgba(16, 185, 129, .12); color: #0b8f6a; }
.pill.warn { background: rgba(245, 158, 11, .14); color: #a5680a; }
.pill.err { background: rgba(239, 68, 68, .12); color: #c93535; }

.empty-row { text-align: center; padding: 46px 20px; color: var(--amute); }
.empty-row .ico { font-size: 34px; margin-bottom: 8px; opacity: .7; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; gap: 7px; padding: 15px 20px; flex-wrap: wrap; }
.pager .info { color: var(--amute); font-size: 12.5px; margin-right: auto; }
.pager a, .pager span.pg {
  min-width: 34px; height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--aline);
  background: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; color: #4b5563; transition: .14s;
}
.pager a:hover { border-color: var(--abrand); color: var(--abrand); }
.pager .cur { background: var(--abrand); border-color: var(--abrand); color: #fff; font-weight: 600; }
.pager .dis { opacity: .45; }

/* ---------- 筛选条 ---------- */
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filters .input, .filters .select { width: auto; min-width: 130px; height: 38px; padding: 0 12px; }
.filters .input.kw { min-width: 210px; }

/* ---------- 统计卡 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 15px; margin-bottom: 18px; }
.stat {
  background: var(--acard); border: 1px solid var(--aline); border-radius: var(--r);
  padding: 17px 18px; box-shadow: var(--shadow);
}
.stat .lb { color: var(--asub); font-size: 12.5px; display: flex; align-items: center; gap: 7px; }
.stat .lb svg { width: 15px; height: 15px; color: var(--abrand); }
.stat .vl { font-size: 25px; font-weight: 700; letter-spacing: -.6px; margin-top: 7px; line-height: 1.2; }
.stat .sub { color: var(--amute); font-size: 12px; margin-top: 3px; }

/* ---------- 列表项 ---------- */
.rows { border: 1px solid var(--aline); border-radius: 10px; overflow: hidden; }
.rows .r { display: flex; gap: 14px; padding: 11px 15px; border-bottom: 1px solid var(--aline2); font-size: 13px; align-items: center; }
.rows .r:last-child { border-bottom: 0; }
.rows .r .k { flex: none; width: 200px; color: var(--asub); }
.rows .r .v { flex: 1; word-break: break-all; }
.rows .r:nth-child(odd) { background: #fbfcfe; }

.bar-wrap { background: var(--aline2); border-radius: 99px; height: 8px; overflow: hidden; min-width: 90px; }
.bar { height: 100%; background: linear-gradient(90deg, var(--abrand), #8ba1ff); border-radius: 99px; }

/* ---------- 提示 ---------- */
.alert {
  border-radius: 10px; padding: 11px 15px; font-size: 13px; margin-bottom: 16px;
  display: flex; gap: 9px; align-items: flex-start; line-height: 1.65;
}
.alert.ok { background: rgba(16, 185, 129, .09); color: #0b7a5b; border: 1px solid rgba(16, 185, 129, .22); }
.alert.err { background: rgba(239, 68, 68, .08); color: #b91c1c; border: 1px solid rgba(239, 68, 68, .2); }
.alert.warn { background: rgba(245, 158, 11, .1); color: #8a6100; border: 1px solid rgba(245, 158, 11, .25); }
.alert.info { background: var(--abrand-soft); color: #33499b; border: 1px solid rgba(77, 107, 254, .2); }

.toast {
  position: fixed; left: 50%; bottom: 36px; transform: translate(-50%, 16px); z-index: 300;
  background: #111827; color: #fff; padding: 11px 22px; border-radius: 999px; font-size: 13.5px;
  opacity: 0; transition: .22s; pointer-events: none; box-shadow: var(--shadow-md); max-width: 88vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 模态框 ---------- */
.mask { position: fixed; inset: 0; background: rgba(15, 20, 30, .5); backdrop-filter: blur(3px); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 22px; }
.dlg {
  background: #fff; border-radius: 16px; width: 100%; max-width: 560px; max-height: 88vh;
  overflow: auto; box-shadow: var(--shadow-md); animation: pop .18s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.99) } to { opacity: 1; transform: none } }
.dlg-hd { padding: 16px 20px; border-bottom: 1px solid var(--aline2); display: flex; align-items: center; }
.dlg-hd h3 { margin: 0; font-size: 15px; font-weight: 650; }
.dlg-hd .x { margin-left: auto; border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--amute); cursor: pointer; }
.dlg-hd .x:hover { color: var(--atext); }
.dlg-bd { padding: 20px; }
.dlg-ft { padding: 14px 20px; border-top: 1px solid var(--aline2); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: var(--abg);
  background-image: radial-gradient(760px 380px at 50% -80px, rgba(77, 107, 254, .13), transparent 70%);
}
.login-card {
  width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--aline);
  border-radius: 18px; padding: 34px 32px 30px; box-shadow: var(--shadow-md);
}
.login-card .brand { display: flex; align-items: center; gap: 11px; justify-content: center; margin-bottom: 6px; }
.login-card .brand .mark {
  width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--abrand), #8ba1ff);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px;
  box-shadow: 0 6px 18px rgba(77, 107, 254, .3);
}
.login-card h1 { font-size: 18px; margin: 0; font-weight: 700; letter-spacing: -.3px; }
.login-card .sub { text-align: center; color: var(--amute); font-size: 12.5px; margin: 4px 0 26px; }
.login-card .btn { width: 100%; height: 42px; margin-top: 6px; }
.login-card .back { text-align: center; margin-top: 18px; font-size: 12.5px; }
.login-card .back a { color: var(--asub); }
.login-card .back a:hover { color: var(--abrand); }

/* ---------- 批量导入 ---------- */
.steps-num { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 4px; }
.steps-num .s { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--asub); }
.steps-num .s b {
  width: 20px; height: 20px; border-radius: 50%; background: var(--abrand-soft); color: var(--abrand);
  display: flex; align-items: center; justify-content: center; font-size: 11.5px; flex: none;
}
.prog { height: 8px; background: var(--aline2); border-radius: 99px; overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--abrand), #8ba1ff); transition: width .2s; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .side {
    position: fixed; left: 0; top: 0; z-index: 120; height: 100vh;
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-md);
  }
  body.nav-open .side { transform: none; }
  body.nav-open .nav-mask { opacity: 1; visibility: visible; }
  .nav-mask {
    position: fixed; inset: 0; background: rgba(15, 20, 30, .42); z-index: 110;
    opacity: 0; visibility: hidden; transition: .2s;
  }
  .menu-toggle { display: flex; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .topbar .crumb { display: none; }
}
@media (max-width: 640px) {
  .topbar .right .who span { display: none; }
  .card-bd { padding: 15px; }
  .rows .r { flex-direction: column; gap: 3px; }
  .rows .r .k { width: auto; font-size: 12px; }
  .stat .vl { font-size: 21px; }
}
