:root {
  --brand: #2563eb;
  --brand-soft: #eff5ff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #6b7a90;
  --line: #e6ecf4;
  --bg: #f6f8fc;
  --card: #fff;
  --ok: #059669;
  --warn: #d97706;
  --err: #dc2626;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 39, 80, .04), 0 8px 24px -18px rgba(15, 39, 80, .35);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
h1, h2, h3, h4 { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------------- 登录 ---------------- */
.login {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 15% 0%, #e6efff, transparent 60%),
    radial-gradient(700px 420px at 100% 100%, #ede9fe, transparent 62%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 28px 60px -28px rgba(15, 39, 80, .35), 0 1px 3px rgba(15, 39, 80, .06);
  border: 1px solid rgba(255, 255, 255, .8);
}
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.login-brand h1 { font-size: 19px; letter-spacing: -.01em; }
.login-brand p { margin: 3px 0 0; font-size: 12px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.logo-mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  color: #fff; font-weight: 800; font-size: 18px;
  flex: none;
}
.logo-mark.sm { width: 34px; height: 34px; border-radius: 11px; font-size: 15px; }
.lbl { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 7px; }
.login input {
  width: 100%; height: 46px; padding: 0 14px; margin-bottom: 16px;
  border: 1.5px solid var(--line); border-radius: 11px; background: #f9fbfe; outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.login input:focus { border-color: #93b4f8; background: #fff; box-shadow: 0 0 0 4px #eef4ff; }
.login-err {
  background: #fef2f2; color: #b91c1c; border: 1px solid #fee2e2;
  padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 14px;
}
.login-tip { margin: 16px 0 0; text-align: center; font-size: 12px; color: var(--muted); }

/* 登录验证码 */
.cap-row { display: grid; grid-template-columns: minmax(0, 1fr) 118px; gap: 10px; margin-bottom: 16px; }
.cap-row input { margin-bottom: 0; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.cap-img {
  height: 46px; padding: 0; border: 1.5px solid var(--line); border-radius: 11px;
  background: #f3f7ff; overflow: hidden; cursor: pointer; display: block;
  transition: border-color .16s, opacity .16s;
}
.cap-img img { width: 100%; height: 100%; display: block; object-fit: contain; }
.cap-img:active { border-color: #93b4f8; }
.cap-img.is-loading { opacity: .45; }

/* ---------------- 布局 ---------------- */
.layout { display: flex; min-height: 100vh; }

/* 移动端汉堡按钮与抽屉遮罩（桌面端隐藏） */
.menu-btn {
  display: none;
  width: 38px; height: 38px; flex: none;
  padding: 0; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; cursor: pointer; place-items: center; gap: 4px;
}
.menu-btn span { display: block; width: 15px; height: 2px; border-radius: 2px; background: var(--ink-2); }
.drawer-mask { display: none; }
.side-close { display: none; font-size: 24px; margin-left: auto; }
.topbar-title { min-width: 0; }

.sidebar {
  width: 224px;
  flex: none;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 18px; }
.side-brand strong { display: block; font-size: 14px; }
.side-brand small { color: var(--muted); font-size: 11.5px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  border: 0; background: transparent; color: var(--ink-2);
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  font-size: 13.5px; font-weight: 500; text-align: left; width: 100%;
  transition: background .15s, color .15s;
}
.nav-item .ico { width: 16px; text-align: center; color: #94a3b8; font-size: 13px; }
.nav-item:hover { background: #f4f7fc; }
.nav-item.is-active { background: #eef4ff; color: #1d4ed8; font-weight: 650; }
.nav-item.is-active .ico { color: #2563eb; }

.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.side-link {
  background: transparent; border: 0; text-align: left; padding: 9px 12px;
  border-radius: 9px; color: var(--ink-2); font-size: 13px; cursor: pointer; text-decoration: none;
  display: block; width: 100%;
}
.side-link:hover { background: #f4f7fc; }
.side-link.danger { color: #b91c1c; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px clamp(16px, 3vw, 32px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.topbar h2 { font-size: 17px; letter-spacing: -.01em; }
.topbar p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.who { font-size: 12.5px; color: var(--muted); }

.content { padding: clamp(16px, 3vw, 30px); max-width: 1320px; width: 100%; }

/* ---------------- 通用 ---------------- */
.card {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: 14px; font-weight: 650; }
.card-head .desc { font-size: 12px; color: var(--muted); margin-top: 3px; }

.grid { display: grid; gap: 14px; }
.grid > * { min-width: 0; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.stat .k { color: var(--muted); font-size: 12.5px; }
.stat .v { font-size: 27px; font-weight: 750; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.stat.accent { background: linear-gradient(135deg, #f5f9ff, #fff); border-color: #dbe8ff; }

.btn {
  height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-weight: 550; font-size: 13px; cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { background: #f8fafd; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, #2563eb, #4f46e5); border-color: transparent; color: #fff; }
.btn-primary:hover { filter: brightness(1.05); background: linear-gradient(135deg, #2563eb, #4f46e5); }
.btn-danger { color: #b91c1c; border-color: #fecaca; background: #fff5f5; }
.btn-danger:hover { background: #feecec; }
.btn-ghost { background: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; height: 46px; font-size: 15px; }

input[type=text], input[type=password], input[type=number], select, textarea {
  height: 36px; padding: 0 11px; border: 1.5px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--ink); outline: none; min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: #9dbcf9; box-shadow: 0 0 0 3px #eef4ff; }
input[type=color] { width: 42px; height: 36px; padding: 2px; border: 1.5px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; }
textarea { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.6; }
label.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
input[type=checkbox] { width: 15px; height: 15px; accent-color: #2563eb; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.switch input { display: none; }
.switch .track {
  width: 38px; height: 22px; border-radius: 999px; background: #dbe3ef; position: relative; transition: background .18s; flex: none;
}
.switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .18s;
}
.switch input:checked + .track { background: #2563eb; }
.switch input:checked + .track::after { transform: translateX(16px); }

.badge {
  display: inline-flex; align-items: center; height: 21px; padding: 0 8px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600; background: #f1f5f9; color: #475569;
}
.badge.ok { background: #ecfdf5; color: #047857; }
.badge.err { background: #fef2f2; color: #b91c1c; }
.badge.warn { background: #fffbeb; color: #b45309; }
.badge.info { background: #eef4ff; color: #1d4ed8; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; min-width: 0; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; font-weight: 600; color: var(--muted); background: #fbfcfe; position: sticky; top: 0; }
tbody tr:hover { background: #fafcff; }
td.num, th.num { font-variant-numeric: tabular-nums; }
.table-empty { padding: 44px 20px; text-align: center; color: var(--muted); font-size: 13px; }

.pager { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.pager button { height: 28px; min-width: 28px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ---------------- 导入 ---------------- */
.dropzone {
  border: 2px dashed #cbd8ea; border-radius: 14px; padding: 34px 20px; text-align: center;
  background: #fbfdff; cursor: pointer; transition: border-color .18s, background .18s;
}
.dropzone:hover, .dropzone.drag { border-color: #7ba3f0; background: #f5f9ff; }
.dropzone .big { font-size: 15px; font-weight: 600; color: var(--ink); }
.dropzone .hint { margin-top: 6px; color: var(--muted); font-size: 12.5px; }

.map-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.field-box label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field-box select, .field-box input { width: 100%; }

.sample-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: auto; min-width: 0; }
.mini-table th, .mini-table td { padding: 8px 12px; font-size: 12.5px; }

/* ---------------- 设计器 ---------------- */
.design { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; align-items: start; }
.design-preview { position: sticky; top: 84px; }
.preview-frame {
  width: 100%; height: 560px; border: 1px solid var(--line); border-radius: 14px; background: #fff;
}
.form-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; align-items: center; margin-bottom: 12px; }
.form-row > label { font-size: 13px; color: var(--ink-2); font-weight: 550; }
.form-row .full { display: flex; gap: 8px; align-items: center; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.field-list { display: flex; flex-direction: column; gap: 6px; }
.field-row {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) 130px 60px; gap: 8px; align-items: center;
  padding: 7px 9px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.field-row.is-off { opacity: .5; }
.field-row .name { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.field-row input { height: 30px; font-size: 12.5px; }
.order-btns { display: flex; gap: 4px; }
.order-btns button { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 11px; }

.qf-row { display: grid; grid-template-columns: 130px 110px 1fr 62px 30px; gap: 7px; align-items: center; margin-bottom: 7px; }
.qf-row input, .qf-row select { height: 32px; font-size: 12.5px; }

/* ---------------- 模态/提示 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  display: grid; place-items: center; padding: 20px; z-index: 100;
  backdrop-filter: blur(2px);
}
.modal {
  width: 100%; max-width: 560px; max-height: 86vh; background: #fff; border-radius: 18px;
  display: flex; flex-direction: column; box-shadow: 0 30px 70px -30px rgba(15, 39, 80, .5);
  animation: pop .2s ease;
}
@keyframes pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 15px; }
.icon-btn { border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #0f172a; color: #fff; padding: 11px 18px; border-radius: 11px;
  font-size: 13px; z-index: 200; box-shadow: 0 18px 40px -18px rgba(15, 39, 80, .7);
  animation: fade .2s ease;
}
.toast.err { background: #b91c1c; }
@keyframes fade { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .big { font-size: 15px; color: var(--ink-2); font-weight: 600; margin-bottom: 6px; }

.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding: 10px 4px 0; }
.bar-chart .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-chart .fill { width: 100%; max-width: 46px; background: linear-gradient(180deg, #60a5fa, #2563eb); border-radius: 6px 6px 3px 3px; min-height: 3px; transition: height .3s; }
.bar-chart .cap { font-size: 11px; color: var(--muted); }

@media (max-width: 1080px) {
  .design { grid-template-columns: minmax(0, 1fr); }
  .design-preview { position: static; }
  .preview-frame { height: 460px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------------- 移动端（≤820px）：抽屉导航 + 单列 + 底部弹层 ---------------- */
@media (max-width: 820px) {
  .menu-btn { display: grid; }

  .drawer-mask {
    display: block;
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 110;
    animation: maskIn .2s ease;
  }
  @keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }

  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 268px; max-width: 82vw; height: 100dvh;
    z-index: 120;
    transform: translateX(-102%);
    transition: transform .26s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 24px 60px -20px rgba(15, 39, 80, .55);
    padding: 16px 12px calc(14px + env(safe-area-inset-bottom));
    overflow-y: auto;
    flex-direction: column; align-items: stretch;
    will-change: transform;
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open { overflow: hidden; }

  .side-brand { padding: 0 4px 16px; }
  .side-brand div { display: block; }
  .side-close { display: block; }
  .nav { flex-direction: column; gap: 2px; }
  .nav-item { padding: 12px; font-size: 14.5px; border-radius: 11px; }
  .nav-item .ico { display: inline; }
  .side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; flex-direction: column; gap: 2px; }
  .side-link { padding: 12px; font-size: 14px; }

  .topbar { padding: 10px 14px; gap: 10px; position: sticky; top: 0; }
  .topbar-title { flex: 1; }
  .topbar p { display: none; }
  .topbar h2 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .who { display: none; }
  .content { padding: 14px 14px calc(20px + env(safe-area-inset-bottom)); }

  .grid-2, .form-row, .two-col { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat .k { font-size: 12px; }
  .stat .v { font-size: 22px; margin-top: 4px; }
  .stat .v small { font-size: 12px; }
  .card-head { padding: 14px; flex-wrap: wrap; }
  .card-pad { padding: 14px; }
  .bar-chart { height: 96px; }

  /* 触屏输入框统一 ≥16px，避免 iOS 聚焦时自动放大页面 */
  input[type=text], input[type=password], input[type=number], select, textarea { height: 42px; font-size: 16px; }
  textarea { height: auto; }
  .btn { height: 40px; }
  .btn-block { height: 48px; }
  .btn-sm { height: 34px; font-size: 13px; }

  /* 设计器：查询条件行折成两行 */
  .qf-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px;
    grid-template-areas: "key label del" "ph ph req";
    gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdff;
  }
  .qf-row > *:nth-child(1) { grid-area: key; }
  .qf-row > *:nth-child(2) { grid-area: label; }
  .qf-row > *:nth-child(3) { grid-area: ph; }
  .qf-row > *:nth-child(4) { grid-area: req; }
  .qf-row > *:nth-child(5) { grid-area: del; }

  /* 展示字段行：字段名与别名上下排布 */
  .field-row {
    grid-template-columns: 22px minmax(0, 1fr) 58px;
    grid-template-areas: "cb name ord" "cb input ord";
    row-gap: 5px;
  }
  .field-row > *:nth-child(1) { grid-area: cb; }
  .field-row > *:nth-child(2) { grid-area: name; }
  .field-row > *:nth-child(3) { grid-area: input; }
  .field-row > *:nth-child(4) { grid-area: ord; }
  .field-row input { height: 34px; }

  /* 表格横向滚动 + 首列冻结 */
  .table-wrap { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  table { font-size: 12.5px; }
  th, td { padding: 9px 11px; }
  .table-wrap table th:first-child,
  .table-wrap table td:first-child {
    position: sticky; left: 0; background: #fff; z-index: 2;
    box-shadow: 1px 0 0 var(--line);
  }
  .table-wrap table th:first-child { background: #fbfcfe; z-index: 3; }
  .pager { flex-wrap: wrap; padding: 10px 12px; }

  /* 模态改为底部弹层 */
  .modal-mask { padding: 0; place-items: end center; }
  .modal { max-width: none; width: 100%; max-height: 90dvh; border-radius: 18px 18px 0 0; }
  .modal-head { padding: 14px 16px; }
  .modal-body { padding: 14px 16px; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .modal-foot .btn { flex: 1; }

  .toast { max-width: calc(100vw - 28px); bottom: calc(16px + env(safe-area-inset-bottom)); }

  .login { padding: 16px; }
  .login-card { padding: 24px 20px; border-radius: 18px; }
  .login input { height: 48px; font-size: 16px; }
  .cap-img { height: 48px; }
  .login-brand { margin-bottom: 20px; }
}

@media (max-width: 380px) {
  .cap-row { grid-template-columns: minmax(0, 1fr) 100px; gap: 8px; }
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .qf-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px; }
}

@media (hover: none) {
  .btn:hover { background: #fff; }
  .btn-primary:hover { filter: none; background: linear-gradient(135deg, #2563eb, #4f46e5); }
  .nav-item:hover { background: transparent; }
  .nav-item.is-active:hover { background: #eef4ff; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------------- 查询页切换 / 导航分组 ---------------- */
.nav-group {
  margin: 14px 0 6px; padding: 0 10px; font-size: 11.5px; font-weight: 600;
  color: #94a3b8; letter-spacing: .08em; text-transform: uppercase;
}
.nav-item:disabled, .nav-item.is-disabled { opacity: .45; cursor: not-allowed; }

.picker { display: flex; align-items: center; gap: 6px; min-width: 0; }
.picker[hidden] { display: none; }
.picker-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.picker select {
  height: 34px; max-width: 220px; padding: 0 30px 0 10px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  font-size: 13px; font-weight: 550; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236b7a90' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.btn.is-on { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.row-tight { gap: 6px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ---------------- 概览里的查询页卡片 ---------------- */
.proj-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); }
.proj-card {
  display: flex; flex-direction: column; gap: 8px; padding: 14px; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  font-family: inherit; color: inherit;
}
.proj-card:hover { border-color: #bfdbfe; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.proj-card.is-current { border-color: #93c5fd; box-shadow: 0 0 0 3px #eff6ff; }
.proj-card.is-archived { opacity: .62; }
.proj-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.proj-top strong { font-size: 14px; }
.proj-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.proj-url { font-size: 11.5px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 820px) {
  .nav-group { display: none; }
  .picker-label { display: none; }
  .picker select { max-width: 150px; height: 32px; font-size: 12.5px; }
  .proj-grid { grid-template-columns: 1fr; }
}

/* ---------------- 宽表格：窄屏保持列宽、容器内横向滚动 ---------------- */
.wide-table table { min-width: 760px; }
.wide-table .row-tight { flex-wrap: nowrap; }
.wide-table td, .wide-table th { padding-top: 10px; padding-bottom: 10px; }
