:root {
  --brand: #2f5cff;
  --brand-dark: #1f47d6;
  --brand-soft: #eef3ff;
  --ink: #131a2b;
  --ink-2: #4a5568;
  --ink-3: #8a93a6;
  --line: #e5e9f2;
  --bg: #f4f6fb;
  --card: #ffffff;
  --ok: #10a37f;
  --warn: #e8a33d;
  --danger: #e5484d;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 60, .05), 0 8px 24px rgba(20, 30, 60, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  height: 60px;
  background: linear-gradient(90deg, #1b2a5e, #2f5cff);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .logo { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.topbar .logo span { opacity: .72; font-weight: 400; font-size: 12px; margin-left: 8px; }
.topbar .spacer { flex: 1; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a {
  color: rgba(255, 255, 255, .85); padding: 7px 14px; border-radius: 8px;
  font-size: 13px; text-decoration: none;
}
.topbar nav a.active, .topbar nav a:hover { background: rgba(255, 255, 255, .16); color: #fff; text-decoration: none; }
.topbar .user { font-size: 13px; opacity: .9; }
.topbar button {
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28);
  color: #fff; padding: 6px 14px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.topbar button:hover { background: rgba(255, 255, 255, .26); }

.wrap { max-width: 1500px; margin: 0 auto; padding: 20px 24px 60px; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 18px;
}
.card-head {
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
.card-head h3 { margin: 0; font-size: 15px; }
.card-head .sub { color: var(--ink-3); font-size: 12px; }
.card-body { padding: 16px 18px; }

/* ---------------- 筛选区 ---------------- */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  padding: 7px 16px; border-radius: 999px; cursor: pointer; font-size: 13px;
}
.tabs button.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; color: var(--ink-3); }
.field.wide { grid-column: span 2; }

input, select {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; font-size: 13px; color: var(--ink); outline: none;
  font-family: inherit;
}
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 92, 255, .12); }

.price-range { display: flex; align-items: center; gap: 6px; }
.price-range span { color: var(--ink-3); }

.actions { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  padding: 8px 16px; border-radius: 9px; cursor: pointer; font-size: 13px; font-family: inherit;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--brand-dark); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.sm { padding: 5px 11px; font-size: 12px; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
thead th {
  background: #f8faff; color: var(--ink-2); font-weight: 600; text-align: left;
  padding: 11px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0;
}
tbody td { padding: 11px 12px; border-bottom: 1px solid #f0f3f9; vertical-align: middle; }
tbody tr:hover { background: #fafbff; }
.mname { font-weight: 600; color: var(--ink); white-space: normal; min-width: 150px; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px;
  line-height: 18px; font-weight: 600;
}
.badge.official { background: #fff1ef; color: #d4380d; }
.badge.self { background: #eef3ff; color: #2f5cff; }
.badge.on { background: #e8f8f2; color: var(--ok); }
.badge.off { background: #fdecec; color: var(--danger); }
.badge.ask { background: #fdf4e6; color: #b3760f; }

.weight { font-weight: 700; font-variant-numeric: tabular-nums; }
.weight.hi { color: var(--ok); }
.weight.mid { color: var(--brand); }
.weight.lo { color: var(--ink-3); }
.price { font-weight: 800; color: #d4380d; font-variant-numeric: tabular-nums; }
.price small { font-weight: 400; color: var(--ink-3); font-size: 11px; }
.yes { color: var(--ok); font-weight: 700; }
.no { color: var(--ink-3); }

/* ---------------- 分页 ---------------- */
.pager { display: flex; align-items: center; gap: 8px; padding: 14px 18px; flex-wrap: wrap; }
.pager .info { color: var(--ink-3); font-size: 13px; margin-right: auto; }
.pager button {
  min-width: 34px; height: 34px; border: 1px solid var(--line); background: #fff;
  border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--ink-2);
}
.pager button.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 22, 45, .5);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 460px;
  box-shadow: 0 24px 60px rgba(10, 20, 50, .3); overflow: hidden;
}
.modal.wide { max-width: 860px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 700; }
.modal-body { padding: 18px 20px; max-height: 70vh; overflow: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

/* ---------------- 登录 ---------------- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1000px 500px at 50% -10%, #dbe6ff, #f4f6fb 60%);
}
.login-box {
  width: 380px; background: #fff; border-radius: 16px; padding: 34px 32px;
  box-shadow: 0 20px 50px rgba(20, 40, 90, .14);
}
.login-box h1 { margin: 0 0 6px; font-size: 21px; }
.login-box p.sub { margin: 0 0 22px; color: var(--ink-3); font-size: 13px; }
.login-box .field { margin-bottom: 14px; }
.login-box .btn { width: 100%; padding: 11px; font-size: 14px; }
.login-hint {
  margin-top: 18px; padding: 12px; background: var(--brand-soft); border-radius: 10px;
  font-size: 12px; color: #3550a8; line-height: 1.9;
}
.err { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 8px; }

/* ---------------- 统计条 ---------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.stat .n { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--ink-3); font-size: 13px; margin-top: 4px; }

.empty { padding: 50px; text-align: center; color: var(--ink-3); }
.pill { background: var(--brand-soft); color: #3550a8; border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.muted { color: var(--ink-3); font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 4px 12px; font-size: 12px; cursor: pointer;
}
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
