
:root {
  --accent: #3d8bfd;
  --accent-hover: #2f7bf0;
  --accent-ring: rgba(61, 139, 253, .12);
  --accent-deco: rgba(61, 139, 253, .07);

  --ink: #333;
  --ink-2: #666;
  --ink-3: #8a8f99;
  --ink-4: #b0b3b8;
  --line: #eef0f3;
  --border: #dcdfe6;
  --bg: #f4f6f9;
  --danger: #e34d59;
  --warn: #e6a23c;
  --ok: #17a673;
}


* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  font-size: 13px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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


.app { display: flex; height: 100vh; overflow: hidden; }


.sidebar {
  flex: none;
  width: 208px;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: width .18s;
}

.sidebar.is-collapsed { width: 60px; }

.brand {
  flex: none;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.brand-mark {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-text { line-height: 1.25; white-space: nowrap; }

.brand-name { font-size: 13.5px; font-weight: 600; }

.brand-sub { font-size: 11px; color: var(--accent); letter-spacing: .5px; }

.menu {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
}

.menu-group-title {
  padding: 12px 10px 6px;
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: .5px;
  white-space: nowrap;
}

.sidebar.is-collapsed .menu-group-title { visibility: hidden; }

.menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  transition: background .14s, color .14s;
}

.menu-item:hover { background: var(--accent-deco); color: var(--accent); }

.menu-item.is-active {
  background: var(--accent-deco);
  color: var(--accent);
  font-weight: 600;
}

.menu-item svg { flex: none; }

.menu-item .arrow {
  margin-left: auto;
  flex: none;
  color: var(--ink-4);
  transition: transform .16s;
}

.menu-item.is-open .arrow { transform: rotate(90deg); }

.menu-sub { overflow: hidden; }

.menu-sub.is-hidden {
  max-height: 0;
  pointer-events: none;
}

.menu-sub .menu-item {
  height: 34px;
  padding-left: 33px;
  font-size: 12.5px;
}

.sidebar-foot {
  flex: none;
  border-top: 1px solid var(--line);
  padding: 10px;
}

.collapse-btn {
  width: 100%;
  height: 30px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 5px;
  color: var(--ink-3);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.collapse-btn:hover { color: var(--accent); border-color: var(--accent); }


.body-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.console-top {
  flex: none;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.crumb { font-size: 14px; font-weight: 600; }

.crumb small {
  font-weight: 400;
  font-size: 12px;
  color: var(--ink-3);
  margin-left: 8px;
}

.top-right { display: flex; align-items: center; gap: 14px; }

.who { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-deco);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.role-tag {
  font-size: 11px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-deco);
  border: 1px solid var(--accent-ring);
}

.link-btn {
  border: none;
  background: none;
  color: var(--ink-2);
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  padding: 4px 2px;
}

.link-btn:hover { color: var(--accent); }

.frame-wrap { flex: 1; min-height: 0; background: var(--bg); }

.frame-wrap iframe { width: 100%; height: 100%; border: none; display: block; }


.page { padding: 16px; }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.page-title { font-size: 16px; font-weight: 600; }

.page-desc {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 5px;
  line-height: 1.7;
  max-width: 720px;
}

.page-actions { flex: none; display: flex; align-items: center; gap: 8px; }


.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
}

.card-head {
  height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title {
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-no {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-deco);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.card-head .spacer { flex: 1; }

.card-body { padding: 16px; }

.card-body.is-flush { padding: 0; }


.btn {
  height: 30px;
  padding: 0 24px;
  border-radius: 15px;
  border: 1px solid var(--accent);
  background: #fff;
  color: var(--accent);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .14s;
  white-space: nowrap;
}

.btn:hover:not(:disabled) { background: #f5f9ff; }

.btn:disabled { cursor: not-allowed; opacity: .55; }

.btn-primary {
  background: linear-gradient(135deg, #4d9bff, #2f7bf0);
  border: none;
  color: #fff;
  box-shadow: 0 3px 10px rgba(61, 139, 253, .30);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #3d8bfd, #2569d8);
  box-shadow: 0 5px 14px rgba(61, 139, 253, .40);
  transform: translateY(-1px);
}

.btn-danger { color: var(--danger); border-color: #f3c9cd; }

.btn-danger:hover:not(:disabled) { background: var(--danger); border-color: var(--danger); color: #fff; }

.btn-sm { height: 26px; padding: 0 10px; font-size: 12px; }

.btn-link {
  border: none;
  background: none;
  padding: 0;
  height: auto;
  color: var(--accent);
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
}

.btn-link:hover:not(:disabled) { text-decoration: underline; color: var(--accent-hover); }

.btn-link.is-muted { color: var(--ink-3); }

.op-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: #fff;
  color: var(--accent);
  font-size: 12px;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  user-select: none;
}

.op-btn:hover:not(:disabled) { background: #f0f6ff; text-decoration: none; }

.op-btn.danger { border-color: #e88; color: #d94a4a; }

.op-btn.danger:hover:not(:disabled) { border-color: #d94a4a; color: #c0342f; background: #fdeeee; }

.op-btn[disabled] { opacity: .55; cursor: not-allowed; }

.btn .spin {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, .5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.btn:not(.btn-primary) .spin { border-color: var(--accent-ring); border-top-color: var(--accent); }

@keyframes spin { to { transform: rotate(360deg); } }


.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.filter-item { display: flex; flex-direction: column; gap: 5px; }

.filter-item label { font-size: 12px; color: var(--ink-3); }

.filter-actions { margin-left: auto; display: flex; gap: 8px; }


.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px 18px;
}

.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: span 3; }
.form-grid .span-full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.field > label { font-size: 12.5px; color: var(--ink-2); }

.field > label .req { color: var(--danger); margin-left: 3px; }

.field-hint { font-size: 11.5px; color: var(--ink-4); line-height: 1.6; }

.field-error { font-size: 11.5px; color: var(--danger); line-height: 1.6; }

/* input:not([type]) 兜底：漏写 type 的 input 默认就是 text，不加这条会退回浏览器默认样式 */
input:not([type]),
input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="datetime-local"], input[type="email"], select, textarea {
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

textarea { min-height: 72px; resize: vertical; line-height: 1.6; }

input::placeholder, textarea::placeholder { color: var(--ink-4); opacity: 1; }
input::-webkit-input-placeholder, textarea::-webkit-input-placeholder { color: var(--ink-4); }
input::-moz-placeholder, textarea::-moz-placeholder { color: var(--ink-4); opacity: 1; }
input:-ms-input-placeholder, textarea:-ms-input-placeholder { color: var(--ink-4); }

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

input:disabled, select:disabled, textarea:disabled {
  background: #fafbfc;
  color: var(--ink-3);
  cursor: not-allowed;
}

.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea {
  border-color: var(--danger);
}

.field.is-invalid > label { color: var(--danger); }

select { cursor: pointer; }

.cascade { display: flex; gap: 8px; }
.cascade > * { flex: 1; min-width: 0; }


.radio-row { display: flex; flex-wrap: wrap; gap: 16px; min-height: 34px; align-items: center; }

.radio-row label, .check-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
}

.radio-row input, .check-row input { accent-color: var(--accent); cursor: pointer; }

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fcfdfe;
}


.rate-table { width: 100%; border-collapse: collapse; }

.rate-table th, .rate-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  font-size: 12.5px;
}

.rate-table th { background: #fafbfc; color: var(--ink-2); font-weight: 600; }

.rate-table tr:last-child td { border-bottom: none; }

.rate-table input { min-height: 30px; }

.rate-table .col-pay { width: 160px; }
.rate-table .col-card { width: 130px; }
.rate-table .col-rate { width: 150px; }
.rate-table .col-cap { width: 150px; }


.attach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 14px;
}

.attach-tile {
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #fcfdfe;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color .15s;
}

.attach-tile:hover { border-color: var(--accent); }

.attach-tile.is-required { border-color: #f0d3d5; background: #fffafa; }

.attach-tile.has-file { border-style: solid; border-color: var(--line); background: #fff; }

.attach-label { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 5px; }

.attach-label .req { color: var(--danger); }

.attach-thumb {
  position: relative;
  width: 100%;
  height: 104px;
  border-radius: 6px;
  overflow: hidden;
  background: #f1f3f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.attach-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.attach-thumb .empty {
  font-size: 11.5px;
  color: var(--ink-4);
  text-align: center;
  line-height: 1.7;
  padding: 0 10px;
}

.attach-thumb .mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .42);
  color: #fff;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  transition: opacity .15s;
}

.attach-thumb:hover .mask { opacity: 1; }

.attach-thumb .mask span { cursor: pointer; }

.attach-thumb .mask span:hover { text-decoration: underline; }

.attach-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.attach-pick {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
}

.attach-pick:hover { text-decoration: underline; }

.sync-tag { font-size: 11px; }
.sync-tag.ok { color: var(--ok); }
.sync-tag.wait { color: var(--warn); }
.sync-tag.skip { color: var(--ink-4); }

input[type="file"] { display: none; }


.table-wrap { overflow-x: auto; }

table.data { width: 100%; border-collapse: collapse; min-width: 760px; }

table.data th, table.data td {
  padding: 11px 12px;
  text-align: left;
  font-size: 12.5px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.data th {
  background: #fafbfc;
  color: var(--ink-2);
  font-weight: 600;
  white-space: nowrap;
}

table.data tbody tr:hover { background: #fbfcfd; }

table.data td.nowrap { white-space: nowrap; }

table.data .mono { font-family: Consolas, Monaco, monospace; font-size: 12px; }

table.data .row-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }


.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  line-height: 1;
  white-space: nowrap;
  background: #f2f3f5;
  color: var(--ink-2);
  border: 1px solid transparent;
}

.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.badge.b-draft { background: #f2f3f5; color: #7d828b; }
.badge.b-process { background: #eef5ff; color: #2e7be6; border-color: #d8e6fb; }
.badge.b-success { background: #e9f8f2; color: var(--ok); border-color: #cdeee1; }
.badge.b-reject { background: #fdeef0; color: var(--danger); border-color: #f7d6da; }
.badge.b-fail { background: #fdf5e9; color: var(--warn); border-color: #f7e3c6; }

.tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 11.5px;
  background: #f2f3f5;
  color: var(--ink-2);
}



.empty {
  padding: 54px 20px;
  text-align: center;
  color: var(--ink-4);
  font-size: 12.5px;
  line-height: 1.9;
}

.empty .empty-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #f4f6f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-4);
}

.loading-mask {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-3);
  font-size: 12.5px;
}


.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.pager .total { margin-right: auto; color: var(--ink-3); }

.pager button {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 4px;
  color: var(--ink-2);
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
}

.pager button:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }

.pager button:disabled { opacity: .5; cursor: not-allowed; }

.pager button.is-current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* 统一分页组件：信息条 + 页码按钮，与服务商端同一套结构和尺寸 */
.pager .pager-info { color: var(--ink-3); margin-right: auto; }
.pager .pager-btns { display: flex; align-items: center; gap: 6px; }
.pager .pg-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.pager .pg-btn:hover:not(:disabled):not(.active) { border-color: var(--accent); color: var(--accent); }
.pager .pg-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager .pg-btn:disabled { color: var(--ink-4); cursor: not-allowed; opacity: 1; }
.pager .pg-ellipsis { color: var(--ink-4); padding: 0 2px; }


.desc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px 18px;
}

.desc-item { min-width: 0; }

.desc-item .k { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }

.desc-item .v {
  font-size: 13px;
  color: var(--ink);
  word-break: break-all;
  line-height: 1.6;
}

.desc-item .v.is-empty { color: var(--ink-4); }

.desc-item.span-full { grid-column: 1 / -1; }


.notice {
  border-radius: 6px;
  padding: 11px 14px;
  font-size: 12.5px;
  line-height: 1.75;
  margin-bottom: 14px;
  border: 1px solid transparent;
}

.notice.n-info { background: #eef5ff; border-color: #d8e6fb; color: #2b5fa8; }
.notice.n-warn { background: #fdf5e9; border-color: #f7e3c6; color: #96631a; }
.notice.n-danger { background: #fdeef0; border-color: #f7d6da; color: #a52f38; }
.notice.n-ok { background: #e9f8f2; border-color: #cdeee1; color: #12775a; }

.notice strong { font-weight: 600; }


.log-item {
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}

.log-item:last-child { border-bottom: none; }

.log-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
}

.log-api { font-family: Consolas, Monaco, monospace; font-weight: 600; }

.log-time { color: var(--ink-3); margin-left: auto; }

.log-cost { color: var(--ink-3); }

.log-msg { margin-top: 6px; color: var(--ink-2); line-height: 1.7; word-break: break-all; }

.log-detail { margin-top: 8px; }

.log-detail summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--accent);
  outline: none;
}

.log-detail pre {
  margin-top: 8px;
  padding: 10px;
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: Consolas, Monaco, monospace;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 260px;
  overflow: auto;
}


.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 45, .38);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-mask[hidden] { display: none; }

.modal {
  background: #fff;
  border-radius: 10px;
  width: 460px;
  max-width: 100%;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 46px rgba(20, 30, 45, .2);
}

.modal-head {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-close {
  border: none;
  background: none;
  font-size: 17px;
  line-height: 1;
  color: var(--ink-3);
  cursor: pointer;
  padding: 2px 4px;
}

.modal-close:hover { color: var(--danger); }

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--ink-2);
}

.modal-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-body .err-list { margin: 0; padding-left: 18px; }

.modal-body .err-list li { margin-bottom: 5px; color: var(--danger); }

.modal-body .kv { display: flex; gap: 10px; margin-bottom: 8px; }

.modal-body .kv .k { flex: none; width: 84px; color: var(--ink-3); }

.modal-body .kv .v { flex: 1; word-break: break-all; color: var(--ink); }


.toast-area {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: #333;
  color: #fff;
  font-size: 12.5px;
  line-height: 1.6;
  padding: 9px 16px;
  border-radius: 5px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
  max-width: 560px;
  animation: toastIn .18s ease-out;
}

.toast.t-ok { background: #14795b; }
.toast.t-err { background: #b8353f; }
.toast.t-warn { background: #a5711c; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}


.check-list { margin: 0; padding: 0; list-style: none; }

.check-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 12.5px;
}

.check-list li:last-child { border-bottom: none; }

.check-list .mark { flex: none; width: 15px; text-align: center; }

.check-list li.ok .mark { color: var(--ok); }
.check-list li.bad .mark { color: var(--danger); }
.check-list li.bad .txt { color: var(--danger); }


/* ===== 列表筛选卡片（与 agent 端 merchant-list.html 同一套：标签左置、按钮单独一行） ===== */
.card.filter-card { padding: 14px 16px 16px; }

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 94px 150px);
  align-items: center;
  column-gap: 0;
  row-gap: 12px;
  margin-top: 12px;
}

/* 单元格摊平，让标签和控件各自占一格，省掉一层无意义的 div */
.f-item, .time-range { display: contents; }

.f-label {
  width: 94px;
  padding-right: 6px;
  text-align: right;
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
  box-sizing: border-box;
}

.f-input, .f-select {
  width: 150px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
  min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}

.f-input:hover, .f-select:hover { border-color: #a9c9f7; }

.f-input:focus, .f-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.f-input::placeholder { color: var(--ink-4); }

/* 日期区间：两个日期框中间夹「至」 */
.time-range input { width: 150px; }
.date-sep { flex: none; margin: 0 4px; font-size: 12.5px; color: var(--ink-3); }

.dtp { position: relative; width: 150px; }

.dtp .dtp-input {
  width: 150px;
  padding: 0 23px 0 7px;
  font-size: 12px;
  cursor: pointer;
  background: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.2px;
}

.dtp .dtp-input::placeholder { color: var(--ink-4); font-size: 12px; }

.dtp .dtp-icon {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  color: #a8abb2;
  pointer-events: none;
}

.dtp-open .dtp-input { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-ring); }

/* 日期面板由 dtp.js 动态插入 body */
.dtp-panel {
  position: fixed;
  z-index: 80;
  width: 252px;
  padding: 8px;
  background: #fff;
  border: 1px solid #e4e7ed;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .13);
  font-size: 13px;
  user-select: none;
}

.dtp-head { display: flex; align-items: center; justify-content: space-between; height: 26px; }

.dtp-title { font-size: 13px; font-weight: 600; color: var(--ink); }

.dtp-nav {
  width: 22px;
  height: 22px;
  line-height: 1;
  border: none;
  background: transparent;
  color: var(--ink-3);
  font-size: 15px;
  cursor: pointer;
  border-radius: 4px;
}

.dtp-nav:hover { background: #f2f4f7; color: var(--accent); }

.dtp-weeks, .dtp-days { display: grid; grid-template-columns: repeat(7, 1fr); }

.dtp-weeks span { text-align: center; color: #98a0ab; font-size: 12px; padding: 4px 0; }

.dtp-days { row-gap: 2px; margin-bottom: 6px; }

.dtp-day {
  height: 26px;
  line-height: 26px;
  text-align: center;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  border-radius: 4px;
}

.dtp-day:hover { background: #f0f6ff; color: var(--accent); }
.dtp-day.other { color: #c8ccd4; }
.dtp-day.today { color: var(--accent); font-weight: 600; }
.dtp-day.sel { background: var(--accent); color: #fff; font-weight: 600; }
.dtp-day.sel:hover { background: var(--accent); color: #fff; }

.dtp-time {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-top: 1px solid var(--line);
  padding-top: 7px;
}

.dtp-sel {
  height: 24px;
  padding: 0 2px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.dtp-sel:focus { outline: none; border-color: var(--accent); }

.dtp-colon { color: #98a0ab; }

.dtp-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }

.dtp-link {
  padding: 0;
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
}

.dtp-link:hover { text-decoration: underline; }

.dtp-spacer { flex: 1; }

.dtp-ok {
  height: 24px;
  padding: 0 12px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}

.dtp-ok:hover { background: var(--accent-hover); }

/* 筛选区按钮行：查询/重置在左，新增等动作靠右 */
.filter-btns { display: flex; align-items: center; gap: 10px; margin-top: 12px; }

.btn-query, .btn-reset {
  height: 30px;
  padding: 0 24px;
  font-size: 13px;
  font-family: inherit;
  border-radius: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}

.btn-query {
  background: linear-gradient(135deg, #4d9bff, #2f7bf0);
  color: #fff;
  border: none;
  box-shadow: 0 3px 10px rgba(61, 139, 253, .30);
}

.btn-query:hover {
  background: linear-gradient(135deg, #3d8bfd, #2569d8);
  box-shadow: 0 5px 14px rgba(61, 139, 253, .40);
  transform: translateY(-1px);
}

.btn-reset { background: #fff; color: var(--accent); border: 1px solid var(--accent); }

.btn-reset:hover { background: #f5f9ff; }


@media (max-width: 1100px) {
  .form-grid .span-3 { grid-column: span 2; }
}

@media (max-width: 900px) {
  .sidebar { width: 60px; }
  .sidebar .brand-text, .sidebar .menu-group-title, .sidebar .menu-item span.t,
  .sidebar .menu-item .arrow { display: none; }
  .sidebar .menu-item { justify-content: center; padding: 0; }
  .sidebar .menu-sub .menu-item { padding-left: 0; }
  .form-grid .span-2, .form-grid .span-3 { grid-column: span 1; }
  .filters { flex-direction: column; align-items: stretch; }
  .filter-actions { margin-left: 0; }
}

/* [hidden] 属性兜底：作者样式（如 .pager 的 display:flex）会覆盖 UA 的 [hidden]{display:none}，导致 JS 里 node.hidden = true 静默失效 */
[hidden] { display: none !important; }
