:root {
  --bg: #eef1f0;
  --bg-ink: #dfe6e3;
  --ink: #15201c;
  --muted: #5f6d67;
  --line: #c9d2cd;
  --surface: #f7faf8;
  --surface-2: #e9efec;
  --accent: #0d6b56;
  --accent-hover: #0a5444;
  --accent-soft: #d3ebe3;
  --danger: #a12622;
  --danger-soft: #f8e6e4;
  --radius: 12px;
  --ctrl-h: 38px;
  --ctrl-h-sm: 32px;
  --ctrl-radius: 8px;
  --ctrl-pad-x: 14px;
  --ctrl-font: 13px;
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: "Syne", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, #cfe4db 0%, transparent 55%),
    radial-gradient(700px 360px at 100% 0%, #dce3e8 0%, transparent 50%),
    linear-gradient(180deg, #f4f7f5 0%, var(--bg) 40%, var(--bg-ink) 100%);
}

button:not(:disabled) { cursor: pointer; }
button:disabled { opacity: 0.42; cursor: not-allowed; }
input, select, textarea {
  font: inherit;
  font-size: var(--ctrl-font);
  color: inherit;
  border: 1px solid var(--line);
  border-radius: var(--ctrl-radius);
  background: rgba(255, 255, 255, 0.35);
  padding: 0 12px;
  width: 100%;
  height: var(--ctrl-h);
  line-height: 1.2;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
select {
  cursor: pointer;
  padding-right: 28px;
}
textarea {
  height: auto;
  min-height: 72px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.45;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 107, 86, 0.14);
}

/* ========== 页面壳 ========== */
.app {
  width: min(1360px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 36px;
  display: grid;
  gap: 12px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 20px;
  padding: 4px 2px 10px;
  border-bottom: 1px solid rgba(21, 32, 28, 0.1);
}
.brand { min-width: 200px; }
.brand-mark {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.brand-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(26px, 3.6vw, 36px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.topbar-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px 16px;
}
.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: stretch;
}
.metric {
  display: grid;
  gap: 2px;
  padding: 0 14px;
  border-right: 1px solid var(--line);
  min-width: 72px;
}
.metric:first-child { padding-left: 0; }
.metric:last-child { border-right: none; padding-right: 0; }
.metric-wide { min-width: 120px; max-width: 220px; }
.metric-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.metric-value {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.metric-text {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}
.user-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.cmd-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 2px 0;
}
.cmd-primary,
.cmd-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.stage {
  display: grid;
  gap: 12px;
  padding: 12px 0 0;
  border: none;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  border-top: 1px solid rgba(21, 32, 28, 0.1);
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.filter-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1 1 520px;
  min-width: 0;
}
.filter-fields .filter-q {
  flex: 1 1 180px;
  min-width: 160px;
  max-width: 280px;
}
.filter-fields select,
.filter-fields input[type="number"] {
  flex: 0 1 auto;
  width: auto;
  min-width: 104px;
  max-width: 140px;
}
.filter-fields input[type="number"] {
  min-width: 96px;
  max-width: 110px;
}
.filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: auto;
}
/* 兼容旧 class 名 */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.list-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.list-meta {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.list-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
.check-label {
  font-size: 13px;
  color: var(--muted);
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.check-label input { width: auto; height: auto; }

.pager {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pager select { width: auto; }

/* ========== 登录 ========== */
.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}
.login-card {
  width: min(400px, 100%);
  padding: 28px 26px 24px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(8px);
}
.login-card .eyebrow,
.login-card .brand-mark {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.login-card h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: -0.03em;
}
.login-card .lede {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.login-form {
  margin-top: 20px;
  display: grid;
  gap: 12px;
}
.login-form label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* ========== 表格 ========== */
.table-scroll {
  overflow: auto;
  max-height: min(62vh, 720px);
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.data-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.data-table th, .data-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  background: transparent;
}
.data-table th {
  position: sticky;
  top: 0;
  background: #e4ebe7;
  z-index: 3;
  font-weight: 600;
  color: #3d4a45;
  box-shadow: 0 1px 0 var(--line);
}
.data-table tbody tr { transition: background 0.12s ease; }
.data-table tbody tr:hover td { background: rgba(13, 107, 86, 0.05); }
.col-check { width: 40px; min-width: 40px; text-align: center; }
.col-check input { width: auto; height: auto; margin: 0; vertical-align: middle; }
.col-no { width: 52px; min-width: 52px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.col-time {
  width: 168px;
  min-width: 168px;
  max-width: none;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
}
.col-admin { min-width: 72px; }
.col-user { min-width: 120px; }
.col-pass { min-width: 88px; }
.col-fa { min-width: 72px; }
.col-email { min-width: 140px; }
.col-mailpass { min-width: 88px; }
.col-num {
  min-width: 64px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.col-country { min-width: 56px; }
.col-year {
  min-width: 52px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.col-mem { min-width: 56px; }
.col-status { min-width: 64px; text-align: center; }
.chip-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(21, 32, 28, 0.06);
}
.chip-status.ok {
  color: #0f5c4c;
  background: rgba(13, 107, 86, 0.12);
}
.chip-status.frozen {
  color: #9a5b12;
  background: rgba(154, 91, 18, 0.12);
}
.chip-status.dead {
  color: #8a3a2b;
  background: rgba(138, 58, 43, 0.12);
}
.detect-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(21, 32, 28, 0.08);
  overflow: hidden;
  margin: 14px 0 8px;
}
.detect-progress-bar {
  height: 100%;
  background: var(--accent, #0d6b56);
  border-radius: 999px;
  transition: width 0.25s ease;
}
.detect-summary {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(21, 32, 28, 0.04);
  border: 1px solid rgba(21, 32, 28, 0.08);
}
.detect-summary .hint {
  margin: 0;
  line-height: 1.55;
}
.extract-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.extract-tab {
  border: 1px solid rgba(21, 32, 28, 0.12);
  background: rgba(21, 32, 28, 0.04);
  color: var(--muted);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.extract-tab.is-active {
  background: rgba(13, 107, 86, 0.12);
  border-color: rgba(13, 107, 86, 0.35);
  color: #0f5c4c;
  font-weight: 600;
}
.col-token { min-width: 110px; max-width: 140px; }
.col-token .cell-clip-token {
  max-width: 128px;
}
.col-actions {
  min-width: 132px;
  padding-right: 12px;
  text-align: right;
  white-space: nowrap;
}
/* 必须用 .data-table td.sticky-*，否则会被 td{background:transparent} 盖掉，横向滚动时密码会透到账号上 */
.data-table td.sticky-l0,
.data-table td.sticky-l1,
.data-table td.sticky-l2,
.data-table td.sticky-r {
  position: sticky;
  z-index: 2;
  overflow: hidden;
  background: #f3f6f4;
  background-clip: padding-box;
}
.data-table td.sticky-l0 { left: 0; box-shadow: 1px 0 0 var(--line); }
.data-table td.sticky-l1 { left: 40px; box-shadow: 1px 0 0 var(--line); }
.data-table td.sticky-l2 {
  left: 92px;
  box-shadow: 6px 0 10px -8px rgba(21, 32, 28, 0.22);
}
.data-table td.sticky-r {
  right: 0;
  z-index: 3;
  box-shadow: -6px 0 10px -8px rgba(21, 32, 28, 0.22);
}
.data-table th.sticky-l0,
.data-table th.sticky-l1,
.data-table th.sticky-l2,
.data-table th.sticky-r {
  position: sticky;
  z-index: 5;
  background: #e4ebe7;
  background-clip: padding-box;
}
.data-table th.sticky-l0 { left: 0; }
.data-table th.sticky-l1 { left: 40px; }
.data-table th.sticky-l2 { left: 92px; box-shadow: 6px 0 10px -8px rgba(21, 32, 28, 0.18); }
.data-table th.sticky-r { right: 0; box-shadow: -6px 0 10px -8px rgba(21, 32, 28, 0.18); }
.data-table tbody tr:hover td.sticky-l0,
.data-table tbody tr:hover td.sticky-l1,
.data-table tbody tr:hover td.sticky-l2,
.data-table tbody tr:hover td.sticky-r {
  background: #e2ebe6;
}

.cell-clip,
.cell-clip-sm,
.cell-clip-token {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}
.cell-clip-sm { max-width: 96px; }
.cell-clip-token { max-width: 128px; }
.col-user .cell-clip { max-width: 148px; }
/* 主列表完整显示，不截断 */
.cell-full {
  display: inline-block;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  word-break: keep-all;
}
.cell-mono {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  letter-spacing: -0.01em;
}
.chip-mem {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(21, 32, 28, 0.06);
}
.chip-mem.vip {
  color: var(--accent);
  background: rgba(13, 107, 86, 0.12);
}
.check-inline {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
  grid-column: 1 / -1;
}
.check-inline input { width: auto; height: auto; }

/* ========== 按钮 ========== */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  height: var(--ctrl-h);
  padding: 0 var(--ctrl-pad-x);
  border: 1px solid transparent;
  border-radius: var(--ctrl-radius);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: var(--ctrl-font);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.btn:hover:not(:disabled) { background: var(--accent-hover); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 107, 86, 0.18);
}
.btn-soft {
  background: var(--accent-soft);
  color: var(--accent);
}
.btn-soft:hover:not(:disabled) {
  background: #c2e0d5;
  color: var(--accent-hover);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(13, 107, 86, 0.08);
  border-color: #b7c2bc;
}
.btn-text {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  padding: 0 10px;
}
.btn-text:hover:not(:disabled) {
  background: rgba(13, 107, 86, 0.08);
  color: var(--accent);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover:not(:disabled) { background: #861f1c; }
.btn-sm {
  height: var(--ctrl-h-sm);
  padding: 0 12px;
  font-size: 12px;
}
.btn-link {
  display: inline;
  height: auto;
  min-width: 0 !important;
  padding: 0 4px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  box-shadow: none;
  transform: none;
}
.btn-link:hover:not(:disabled) {
  background: transparent;
  color: var(--accent-hover);
  text-decoration: underline;
}
.btn-link:active:not(:disabled) { transform: none; }
.btn-link.danger { color: #a33; }

/* ========== Toast / Modal ========== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  z-index: 120;
  max-width: min(96vw, 860px);
  font-size: 14px;
  text-align: center;
  pointer-events: none;
  animation: toast-in 0.25s ease;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
  line-height: 1.5;
}
.toast.toast-long,
.toast.toast-progress {
  max-width: min(96vw, 860px);
  max-height: none;
  overflow: visible;
  text-align: center;
  white-space: normal;
  pointer-events: none;
}
.toast.toast-progress {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.01em;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.modal[hidden], .toast[hidden] { display: none !important; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}
.confirm-modal {
  z-index: 100;
}
/* 检测进度需盖过待重试/异常池等业务弹窗，但仍低于确认框 */
.modal-detect {
  z-index: 90;
}
.modal-confirm {
  width: min(400px, 100%);
  max-height: none;
  overflow: hidden;
  padding: 28px 24px 22px;
  text-align: center;
  background:
    linear-gradient(180deg, #f5f9f7 0%, #eef2f0 100%);
  animation: confirm-pop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes confirm-pop {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.confirm-visual {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--danger-soft);
  box-shadow: inset 0 0 0 1px rgba(161, 38, 34, 0.12);
}
.confirm-visual.is-warn {
  background: #f3ebe0;
  box-shadow: inset 0 0 0 1px rgba(154, 91, 18, 0.14);
}
.confirm-icon {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  color: var(--danger);
}
.confirm-visual.is-warn .confirm-icon {
  color: #9a5b12;
}
.modal-confirm h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.confirm-msg {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: min(50vh, 360px);
  overflow: auto;
  text-align: left;
}
.confirm-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}
.confirm-actions .btn {
  min-width: 104px;
}
.modal-password {
  text-align: left;
}
.modal-password h2,
.modal-password .confirm-msg,
.modal-password .confirm-visual {
  text-align: center;
}
.modal-password .confirm-icon {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.pwd-form {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}
.pwd-form label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.pwd-form input {
  background: rgba(255, 255, 255, 0.72);
}
.pwd-error {
  margin: 0;
  font-size: 13px;
  color: var(--danger);
  text-align: center;
}
.pwd-form .confirm-actions {
  margin-top: 6px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 32, 28, 0.45);
  backdrop-filter: blur(2px);
}
.modal-card {
  position: relative;
  width: min(640px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  background: #eef2f0;
  border: 1px solid rgba(21, 32, 28, 0.12);
  border-radius: 14px;
  box-shadow: 0 24px 56px rgba(21, 32, 28, 0.22);
  animation: rise 0.28s ease;
}
.modal-wide { width: min(920px, 100%); }
.modal-md { width: min(560px, 100%); }
.modal-xl { width: min(1080px, 100%); }
.modal-countries {
  width: min(980px, 100%);
  max-height: min(92vh, 880px);
}
.modal-recycle {
  width: min(1120px, 100%);
  max-height: min(92vh, 900px);
}
.modal-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: min(90vh, 900px);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.modal-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 18px;
}
.modal-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.icon-btn {
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  padding: 0 4px;
}
.modal-body { padding: 16px 18px 18px; }
.modal-body-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
}
.admin-create-bar {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 0 0 12px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  flex-shrink: 0;
}
.admin-create-bar[hidden] { display: none !important; }
.admin-create-bar label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.admin-create-bar .btn {
  height: 38px;
  align-self: end;
}
.panel-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  flex-shrink: 0;
  width: 100%;
}
.panel-search {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}
.panel-search input {
  flex: 1;
  max-width: none;
}
.panel-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.panel-meta {
  font-size: 13px;
  color: var(--muted);
}
.pager-compact {
  margin: 0;
  gap: 6px;
}
.pager-compact .btn {
  padding: 0 10px;
  height: 32px;
  font-size: 13px;
}
.panel-table {
  flex: 0 1 auto;
  width: 100%;
  max-width: 100%;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}
.panel-table-scroll {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: min(48vh, 420px);
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.panel-table .data-table,
.panel-table .table-recycle,
.panel-table .table-logs,
.panel-table .table-admins,
.panel-table .table-countries {
  width: max-content !important;
  min-width: 100% !important;
  max-width: none !important;
  table-layout: auto !important;
}
.panel-table .data-table th,
.panel-table .data-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 移入时间等必须完整显示，禁止省略号截断 */
.panel-table .col-time,
.panel-table td.col-time,
.panel-table th.col-time {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  min-width: 168px !important;
  width: 168px !important;
}
.panel-table .col-no,
.panel-table td.col-no {
  overflow: visible !important;
  text-overflow: clip !important;
  text-align: center;
}
.panel-table .data-table th { background: #e4ebe7; }
.panel-table .data-table td { background: transparent; }
.panel-empty {
  display: none;
  width: 100%;
  padding: 40px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
/* 空数据：不显示表头，只显示一行提示 */
.panel-table.is-empty {
  border: none;
  background: transparent;
  min-height: 0;
  display: block;
}
.panel-table.is-empty .panel-empty {
  display: block;
  padding: 36px 8px;
}
.panel-table.is-empty .panel-table-scroll {
  display: none !important;
}

.help-body {
  display: grid;
  gap: 16px;
  overflow: auto;
  max-height: min(70vh, 640px);
  padding-right: 4px;
}
.help-block h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
}
.help-list {
  margin: 0;
  display: grid;
  gap: 10px;
}
.help-list > div {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 8px 12px;
  align-items: start;
  padding: 10px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(21, 32, 28, 0.08);
  border-radius: 0;
}
.help-list > div:last-child { border-bottom: none; }
.help-list dt {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}
.help-list dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}
.help-foot { margin: 0; padding-top: 4px; }

.countries-body { gap: 14px; padding-top: 14px; }
.recycle-body { gap: 12px; padding-top: 12px; overflow: hidden; }
.recycle-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
.recycle-search {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}
.recycle-search input { flex: 1; max-width: none; }
.search-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.search-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.search-field-status {
  flex: 0 0 120px;
  width: 120px;
}
.search-field-status select {
  width: 100%;
  min-width: 0;
}
.search-field-grow {
  flex: 1 1 220px;
  min-width: 180px;
}
.search-field-grow input[type="search"] {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.search-field-grow input[type="search"]::placeholder {
  color: #8a9690;
  opacity: 1;
}
.search-field-grow input[type="search"]:focus {
  outline: none;
  border-color: rgba(13, 107, 86, 0.55);
  box-shadow: 0 0 0 3px rgba(13, 107, 86, 0.12);
}
.search-field-status select {
  min-height: 40px;
  border-radius: 8px;
}
.recycle-search > .btn {
  flex: 0 0 auto;
  min-height: 40px;
  padding-left: 18px;
  padding-right: 18px;
}
#abnormalSelectedHint {
  font-size: 13px;
  color: var(--muted);
  min-width: 4.5em;
}
.recycle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
}
.recycle-checkall { margin-right: 4px; }
#recycleSelectedHint {
  font-size: 13px;
  color: var(--muted);
  min-width: 4.5em;
}
.recycle-panel {
  flex: 1 1 auto;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.recycle-panel.is-empty .recycle-list-head,
.recycle-panel.is-empty .recycle-list { display: none !important; }
.recycle-panel.is-empty .panel-empty { display: block; }
.recycle-panel:not(.is-empty) .panel-empty { display: none; }
.recycle-list-head,
.recycle-row {
  display: grid;
  grid-template-columns: 36px 40px 168px minmax(140px, 1.4fr) minmax(150px, 1.3fr) 72px 100px;
  gap: 8px 12px;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}
.recycle-list-head {
  flex-shrink: 0;
  padding: 0 8px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.recycle-list {
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: min(58vh, 560px);
  padding: 0 4px 8px;
}
.recycle-row {
  padding: 11px 8px;
  border-bottom: 1px solid rgba(21, 32, 28, 0.06);
}
.recycle-row:hover { background: rgba(13, 107, 86, 0.05); }
.recycle-row:last-child { border-bottom: none; }
.rc-check { text-align: center; }
.rc-check input { width: auto; height: auto; margin: 0; }
.rc-no {
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.rc-time {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}
.rc-user {
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  min-width: 0;
}
.rc-user .rc-sub {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rc-meta {
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.rc-admin {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rc-act {
  text-align: right;
  white-space: nowrap;
}
.rc-act .btn-link { margin-left: 4px; }
#recyclePageSize {
  width: auto;
  height: 32px;
  padding: 0 8px;
  font-size: 13px;
}
@media (max-width: 900px) {
  .recycle-list-head,
  .recycle-row {
    grid-template-columns: 32px 32px minmax(110px, 1.2fr) minmax(110px, 1fr) 88px;
  }
  .rc-time, .rc-admin,
  .recycle-list-head .rc-time,
  .recycle-list-head .rc-admin { display: none; }
}
.dist-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 10px 16px;
  flex-shrink: 0;
}
.dist-stat {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 2px solid rgba(13, 107, 86, 0.18);
}
.dist-stat-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.dist-stat-value {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.dist-stat-wide .dist-stat-value {
  font-size: 18px;
  font-weight: 700;
}
.dist-range {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  flex-shrink: 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--line);
  border-radius: var(--ctrl-radius);
}
.dist-range label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  min-width: 120px;
  flex: 1 1 120px;
}
.dist-range .btn {
  flex: 0 0 auto;
}
.dist-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.dist-toolbar input {
  flex: 1;
  max-width: 360px;
}
.dist-toolbar-hint {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.dist-panel {
  flex: 1 1 auto;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dist-panel.is-empty .dist-list-head,
.dist-panel.is-empty .dist-list { display: none !important; }
.dist-panel.is-empty .panel-empty { display: block; }
.dist-panel:not(.is-empty) .panel-empty { display: none; }
.dist-list-head,
.dist-row {
  display: grid;
  grid-template-columns: 44px minmax(120px, 1.1fr) minmax(180px, 2.2fr) 88px 72px;
  gap: 10px 14px;
  align-items: center;
}
.dist-list-head {
  flex-shrink: 0;
  padding: 0 4px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.dist-list {
  flex: 1 1 auto;
  overflow: auto;
  max-height: min(52vh, 480px);
  padding: 4px 0 8px;
}
.dist-row {
  padding: 11px 4px;
  border-bottom: 1px solid rgba(21, 32, 28, 0.06);
  cursor: pointer;
  transition: background 0.12s ease;
}
.dist-row:hover { background: rgba(13, 107, 86, 0.06); }
.dist-row:last-child { border-bottom: none; }
.dist-col-rank {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.dist-row .dist-col-rank { font-weight: 700; color: #3d4a45; }
.dist-col-name {
  font-weight: 700;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dist-col-bar {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  align-items: center;
  min-width: 0;
}
.dist-pct {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}
.dist-bar {
  display: block;
  height: 10px;
  background: rgba(21, 32, 28, 0.08);
  border-radius: 99px;
  overflow: hidden;
  min-width: 0;
}
.dist-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0d6b56, #1a9a7a);
  border-radius: 99px;
}
.dist-col-cnt {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 15px;
  text-align: right;
}
.dist-col-act { text-align: right; }
.dist-row .btn-link { font-size: 13px; }
@media (max-width: 720px) {
  .dist-stats { grid-template-columns: 1fr 1fr; }
  .dist-stat-wide { grid-column: 1 / -1; }
  .dist-list-head,
  .dist-row {
    grid-template-columns: 36px minmax(90px, 1fr) minmax(100px, 1.4fr) 64px;
  }
  .dist-col-act { display: none; }
  .dist-toolbar { flex-wrap: wrap; }
  .dist-toolbar input { max-width: none; }
  .dist-range .btn { width: 100%; }
}
.admin-name { font-weight: 600; }
.chip-self {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(13, 107, 86, 0.1);
  border-radius: 6px;
  vertical-align: middle;
}
.cell-muted { color: var(--muted); font-size: 13px; }
.cell-nowrap { white-space: nowrap; }
.num-extract {
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}
.tag-warn {
  color: #9a5b12;
  font-weight: 600;
  font-size: 13px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-grid label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.form-grid .full { grid-column: 1 / -1; }
#exMatched {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  background: var(--accent-soft);
  border-color: transparent;
  cursor: default;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}
.import-country-block {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2, #f7f6f3);
}
.import-country-label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.import-country-label span {
  font-weight: 400;
  color: var(--muted);
  margin-left: 6px;
}
.import-country-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  max-height: 120px;
  overflow: auto;
}
.import-country-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.3;
  color: var(--ink);
}
.import-country-chip b {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #0f5c4c;
}
.import-preview { max-height: 420px; }
.tag-new { color: #0f5c4c; font-weight: 600; }
.tag-update { color: #9a5b12; font-weight: 600; }
.tag-recycle { color: #8a3a2b; font-weight: 600; }
.tag-skip { color: var(--muted); }
.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 12px;
}
.empty p { margin: 0 0 6px; font-size: 15px; color: var(--ink); }
.empty-sub {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.45;
}
.secret-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}
.secret-cell.inline { display: inline-flex; }
.secret-cell .secret-toggle {
  flex-shrink: 0;
  font-size: 12px;
  padding: 0;
}
.secret-mask, .secret-plain {
  min-width: 0;
}
.health-result {
  margin: 0;
  padding: 12px 14px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(21, 32, 28, 0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  max-height: 280px;
  overflow: auto;
  color: var(--ink);
}
.muted { color: var(--muted); font-size: 13px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .filter-bar { align-items: stretch; }
  .filter-fields {
    flex: 1 1 100%;
  }
  .filter-fields .filter-q {
    flex: 1 1 100%;
    max-width: none;
  }
  .filter-fields select,
  .filter-fields input[type="number"] {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    max-width: none;
  }
  .filter-actions {
    width: 100%;
    margin-left: 0;
  }
  .filter-actions .btn {
    flex: 1;
  }
}
@media (max-width: 640px) {
  .app { width: calc(100% - 20px); }
  .topbar-side { width: 100%; justify-content: flex-start; }
  .metrics { width: 100%; }
  .cmd-bar { flex-direction: column; align-items: stretch; }
  .cmd-primary, .cmd-secondary { width: 100%; }
  .filter-fields select,
  .filter-fields input[type="number"] {
    flex: 1 1 100%;
  }
  .form-grid { grid-template-columns: 1fr; }
  .admin-create-bar { grid-template-columns: 1fr; }
  .help-list > div { grid-template-columns: 1fr; }
  .stage { padding: 10px 0 0; }
}
