/* ===== 链接活码 · 样式 ===== */

/* 作者样式里的 display 会压掉 [hidden] 的默认 display:none，统一兜住 */
[hidden] {
  display: none !important;
}

:root {
  --ink: #16202b;
  --ink-soft: #5b6876;
  --ink-faint: #8a97a4;
  --line: #e2e8ef;
  --line-strong: #cfd8e2;
  --bg: #f2f5f9;
  --surface: #ffffff;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #eaf1ff;
  --danger: #d33b3b;
  --danger-soft: #fdecec;
  --ok: #0f9d58;
  --ok-soft: #e6f6ee;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 33, 56, .06);
  --shadow-md: 0 10px 28px rgba(16, 33, 56, .10);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

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

h1, h2, h3, p, ol, ul { margin: 0; }
button { font: inherit; }

/* ---- 布局 ---- */

.app-shell {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  grid-template-rows: 60px minmax(0, 1fr);
  grid-template-areas:
    "top top"
    "side main";
  min-height: 100vh;
}

.topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand-mark {
  width: 34px; height: 34px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #4f8ef7);
  color: #fff; font-weight: 700; font-size: 17px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .28);
}

.brand-mark-lg { width: 46px; height: 46px; border-radius: 13px; font-size: 22px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-size: 15px; }
.brand-text small { color: var(--ink-faint); font-size: 11.5px; }

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

.sync-chip {
  font-size: 12px; color: var(--ink-faint);
  padding: 3px 9px; border-radius: 999px; background: #f5f7fa;
  white-space: nowrap;
}

.sidebar {
  grid-area: side;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 60px; align-self: start;
  max-height: calc(100vh - 60px);
  overflow: auto;
}

.nav { display: flex; flex-direction: column; gap: 4px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px;
  color: var(--ink-soft); text-decoration: none; font-size: 14px;
}
.nav-item:hover { background: #f4f7fb; color: var(--ink); }
.nav-item-active { background: var(--accent); color: #fff; }
.nav-item-active:hover { background: var(--accent-dark); color: #fff; }
.nav-ico { width: 16px; text-align: center; opacity: .85; }

.sidebar-note {
  margin-top: auto;
  padding: 12px;
  border-radius: 10px;
  background: #f6f8fb;
  font-size: 12px; color: var(--ink-faint); line-height: 1.65;
}
.sidebar-note-title { color: var(--ink-soft); font-weight: 600; margin-bottom: 4px; }

.main {
  grid-area: main;
  padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
  min-width: 0;
}

/* ---- 页头 ---- */

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.page-title h1 { font-size: 21px; letter-spacing: -.2px; }
.page-sub { color: var(--ink-faint); font-size: 13px; margin-top: 3px; }
.page-actions { display: flex; gap: 8px; }

/* ---- 统计卡 ---- */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 2px;
}
.stat-label { color: var(--ink-faint); font-size: 12.5px; }
.stat-value { font-size: 22px; font-weight: 650; letter-spacing: -.4px; }
.stat-value-small { font-size: 14px; font-weight: 600; }

/* ---- 面板 ---- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.panel-title { font-weight: 650; font-size: 14.5px; }
.panel-tools { display: flex; gap: 8px; }

.bulk-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px; border-radius: 999px; background: var(--accent-soft);
}
.bulk-bar[hidden] { display: none; }
.bulk-count { font-size: 12.5px; color: var(--accent); font-weight: 600; }

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

/* ---- 表格 ---- */

.link-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.link-table th, .link-table td {
  padding: 10px 9px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.link-table thead th {
  font-weight: 600; font-size: 12.5px; color: var(--ink-faint);
  background: #fafbfd; position: sticky; top: 0; z-index: 1;
}

.link-table tbody tr:hover { background: #fafcff; }
.link-table tbody tr:last-child td { border-bottom: 0; }

.col-check { width: 38px; }
.col-today, .col-switch { text-align: center; }

.cell-id { font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.cell-name { font-weight: 600; white-space: normal; min-width: 84px; }
.cell-remark { color: var(--ink-faint); white-space: normal; max-width: 104px; font-size: 12.5px; }
.cell-time { color: var(--ink-faint); font-variant-numeric: tabular-nums; font-size: 12px; white-space: nowrap; }

.type-chip {
  display: inline-block; padding: 1px 8px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11.5px; font-weight: 600;
}

.link-cell { display: flex; align-items: center; gap: 8px; }
.link-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; color: var(--accent); text-decoration: none;
  max-width: 172px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.link-url:hover { text-decoration: underline; }

.stat-chip { color: var(--ink-soft); font-size: 12.5px; }
.stat-chip strong { color: var(--ink); }

/* 开关 */

.switch { position: relative; display: inline-flex; align-items: center; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-track {
  width: 40px; height: 22px; border-radius: 999px; background: #d6dee8;
  transition: background .16s ease; position: relative;
}
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .16s ease;
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 操作按钮 */

.ops { display: grid; grid-template-columns: repeat(2, auto); gap: 6px; justify-content: start; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 7px 13px; border-radius: 8px; border: 1px solid transparent;
  background: #fff; color: var(--ink); cursor: pointer;
  font-size: 13px; line-height: 1.2; white-space: nowrap;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.btn:hover { background: #f4f7fb; }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }

.btn-ghost { border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

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

.btn-soft-danger { color: var(--danger); border-color: #f2c9c9; background: var(--danger-soft); }
.btn-soft-danger:hover { background: #fbdcdc; border-color: var(--danger); color: var(--danger); }

.btn-icon { padding: 4px 8px; color: var(--ink-faint); background: transparent; border: 0; font-size: 15px; }
.btn-icon:hover { color: var(--ink); background: #f2f5f9; }

.btn-small { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; padding: 10px; }

.btn-mini { padding: 4px 8px; font-size: 12px; border-radius: 7px; }
.btn-mini-qr { background: #0ea5a4; color: #fff; }
.btn-mini-qr:hover { background: #0b8685; }
.btn-mini-stat { background: #7c5cf0; color: #fff; }
.btn-mini-stat:hover { background: #6a4bd8; }
.btn-mini-edit { background: var(--accent); color: #fff; }
.btn-mini-edit:hover { background: var(--accent-dark); }

/* ---- 输入 ---- */

.input {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--line-strong); border-radius: 9px;
  background: #fff; color: var(--ink); font: inherit; font-size: 13.5px;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14); }
.input::placeholder { color: #a8b3bf; }
.input-search { width: 260px; }

/* ---- 空状态 ---- */

.empty-state { padding: 48px 20px; text-align: center; }
.empty-title { font-weight: 600; }
.empty-sub { color: var(--ink-faint); font-size: 13px; margin-top: 6px; }

/* ---- 说明 ---- */

.panel-help { padding: 16px; }
.help-list { margin-top: 8px; padding-left: 20px; color: var(--ink-soft); font-size: 13px; line-height: 1.9; }

/* ---- 弹窗 ---- */

.dialog {
  border: 0; padding: 0; background: transparent;
  width: min(560px, calc(100vw - 24px));
  color: var(--ink);
}
.dialog::backdrop { background: rgba(16, 27, 42, .48); backdrop-filter: blur(2px); }
.dialog-wide { width: min(760px, calc(100vw - 24px)); }
.dialog-table { width: min(880px, calc(100vw - 24px)); }

.dialog-inner {
  background: var(--surface); border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow-md); display: flex; flex-direction: column;
  max-height: calc(100vh - 40px);
}

.dialog-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.dialog-head h2 { font-size: 16px; }

.dialog-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; overflow: auto; }

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

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; color: var(--ink-soft); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.field-hint { color: var(--ink-faint); font-size: 11.5px; }
.field-inline { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; }

.form-error {
  color: var(--danger); background: var(--danger-soft);
  border-radius: 8px; padding: 8px 12px; font-size: 12.5px;
}

/* URL 列表编辑 */

/* ---- 子码列表：表格式 ---- */

.sublist-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.sublist-current {
  font-size: 12.5px; color: var(--ink-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.sublist {
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; overflow: hidden;
}
.sublist-head,
.url-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.75fr) 58px 50px 118px 54px;
  gap: 8px; align-items: center;
}
.sublist-head {
  padding: 7px 10px;
  background: #f5f7fa; border-bottom: 1px solid var(--line);
  font-size: 11.5px; color: var(--ink-faint);
}
.url-list { display: flex; flex-direction: column; }
.url-row {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.url-row:last-child { border-bottom: 0; }
.url-row.is-off { background: #fafbfc; }
.url-row.is-off .url-input,
.url-row.is-off .url-label { color: var(--ink-faint); }
.url-row.is-pinned { background: #fdf3f3; box-shadow: inset 3px 0 0 var(--danger); }
/* 拖图片进来时的高亮 */
.url-row.is-drop {
  background: #eff5ff;
  box-shadow: inset 0 0 0 2px #2563eb;
}
.dialog.is-drop { box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }
.dialog.is-drop .url-input { border-color: #2563eb; background: #eff5ff; }

.url-cell { min-width: 0; display: flex; align-items: center; gap: 6px; }
.url-cell .input { font-size: 12.5px; padding: 6px 8px; min-width: 0; width: 100%; }
.url-idx {
  flex: 0 0 auto; width: 18px; text-align: center;
  font-size: 11.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums;
}
.url-cell-note .url-label { flex: 1 1 auto; }
.url-cell-weight .input { text-align: center; padding: 6px 2px; }
.url-cell-hits {
  font-size: 12.5px; color: var(--ink-soft);
  font-variant-numeric: tabular-nums; justify-content: flex-start;
}
.url-cell-state { flex-direction: column; align-items: flex-start; gap: 3px; }
.url-cell-state .url-toggle { font-size: 11px; }
.url-cell-ops { justify-content: flex-end; }
.url-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; cursor: pointer;
}
.url-toggle input { margin: 0; }
.url-pin {
  border: 1px solid var(--line-strong); background: #fff; border-radius: 6px;
  color: var(--ink-soft); cursor: pointer; font-size: 11.5px;
  padding: 3px 7px; white-space: nowrap;
}
.url-pin:hover { border-color: var(--accent); color: var(--accent); }
.url-state-chip {
  font-size: 11.5px; color: #fff; background: var(--danger);
  border-radius: 6px; padding: 3px 8px; white-space: nowrap;
}
.pin-chip {
  display: inline-block; margin-top: 3px;
  font-size: 11.5px; color: var(--accent);
  background: var(--accent-soft); border-radius: 6px; padding: 1px 6px;
}
.sub-labels {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: 4px; max-width: 190px;
}
.sub-label {
  font-size: 11px; line-height: 1.5;
  color: var(--ink-soft);
  background: #eef2f7; border-radius: 5px; padding: 0 5px;
  max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sub-label.is-off { opacity: .55; text-decoration: line-through; }
.sub-label.is-more { color: var(--ink-faint); background: transparent; padding: 0 2px; }
.url-remove {
  border: 1px solid var(--line-strong); background: #fff; border-radius: 6px;
  color: var(--ink-faint); cursor: pointer; font-size: 11.5px;
  padding: 3px 7px; line-height: 1.4; white-space: nowrap;
}
.url-remove:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }

/* ---- 二维码 ---- */

.qr-body { align-items: center; }
.qr-modes {
  display: inline-flex; gap: 4px; padding: 3px;
  border: 1px solid var(--line); border-radius: 999px; background: #f3f6fa;
}
.qr-mode {
  border: 0; background: transparent; cursor: pointer;
  padding: 5px 14px; border-radius: 999px;
  font-size: 13px; color: var(--ink-soft); white-space: nowrap;
}
.qr-mode.is-active {
  background: #ffffff; color: #1d4ed8; font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .12);
}
.qr-canvas-wrap {
  padding: 14px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-sm);
}
#qr-canvas { display: block; width: 280px; height: 280px; }
.qr-name { font-weight: 600; }
.copy-row { display: flex; gap: 8px; width: 100%; }
.copy-row .input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.qr-hint { color: var(--ink-faint); font-size: 12.5px; }

/* ---- 统计面板 ---- */

.stat-row-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.chart {
  display: flex; align-items: flex-end; gap: 4px;
  height: 120px; padding: 10px 12px;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 10px;
}
.chart-bar { flex: 1 1 0; min-width: 6px; background: var(--accent-soft); border-radius: 4px 4px 0 0; position: relative; }
.chart-bar-fill { position: absolute; inset: auto 0 0 0; background: var(--accent); border-radius: 4px 4px 0 0; }
.chart-bar:hover .chart-bar-fill { background: var(--accent-dark); }

.split-table { display: flex; flex-direction: column; gap: 6px; }
.split-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 60px 60px;
  gap: 10px; align-items: center; font-size: 13px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px;
}
.split-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.split-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.split-off { opacity: .5; }

.recent-block { border-top: 1px solid var(--line); padding-top: 10px; }
.recent-block summary { cursor: pointer; font-size: 13px; color: var(--ink-soft); }
.recent-list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; }
.recent-item { display: flex; gap: 10px; font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.recent-item span:first-child { flex: 0 0 auto; color: var(--ink-soft); }

/* ---- Toast ---- */

.copy-helper { position: fixed; top: -2000px; left: -2000px; opacity: 0; pointer-events: none; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(8px);
  background: #16202b; color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
  opacity: 0; transition: opacity .18s ease, transform .18s ease;
  z-index: 90; pointer-events: none; max-width: calc(100vw - 40px);
}
.toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-error { background: #b93131; }

/* ---- 登录页 ---- */

.login-body { display: grid; place-items: center; background: linear-gradient(160deg, #eef3fa, #e4ebf5); }
.login-shell { width: 100%; padding: 24px; }

.login-card {
  max-width: 380px; margin: 0 auto;
  background: var(--surface); border-radius: 18px;
  padding: 28px 26px; box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
}

.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-brand h1 { font-size: 19px; }
.login-sub { color: var(--ink-faint); font-size: 13px; }

.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-tip { margin-top: 14px; color: var(--ink-faint); font-size: 12px; line-height: 1.6; }

/* ===== 手机适配 ===== */

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "top"
      "side"
      "main";
  }
  .sidebar {
    position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line);
    padding: 10px 12px; flex-direction: row; align-items: center; gap: 10px;
  }
  .nav { flex-direction: row; }
  .sidebar-note { display: none; }
  .main { padding: 14px; }
  .topbar { padding: 0 14px; }
  .topbar-actions .sync-chip { display: none; }
}

@media (max-width: 760px) {
  .page-head { align-items: stretch; }
  .page-actions { width: 100%; }
  .page-actions .btn { width: 100%; justify-content: center; }
  .input-search { width: 100%; }
  .panel-tools { width: 100%; }

  /* 表格整体不横向滚动，改成一条活码一张卡 */
  .table-scroll { overflow-x: visible; }
  .link-table, .link-table tbody, .link-table tr, .link-table td { display: block; width: 100%; }
  .link-table thead { display: none; }

  .link-table tbody tr {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    grid-template-areas:
      "check name switch"
      "id id id"
      "type type type"
      "link link link"
      "stat stat stat"
      "remark remark remark"
      "time time time"
      "today today today"
      "ops ops ops";
    gap: 2px 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }

  .link-table tbody td { border: 0; padding: 0; white-space: normal; }

  .cell-check { grid-area: check; }
  .cell-name { grid-area: name; align-self: center; }
  .col-switch-cell { grid-area: switch; justify-self: end; }
  .cell-id { grid-area: id; }
  .cell-type { grid-area: type; }
  .cell-link { grid-area: link; }
  .cell-stat { grid-area: stat; }
  .cell-remark { grid-area: remark; max-width: none; }
  .cell-time { grid-area: time; }
  .cell-today { grid-area: today; }
  .cell-ops { grid-area: ops; margin-top: 6px; }

  /* 卡片内标签 */
  .cell-id::before { content: "ID "; color: var(--ink-faint); font-size: 11.5px; }
  .cell-link::before { content: "链接 "; color: var(--ink-faint); font-size: 11.5px; }
  .cell-stat::before { content: "统计 "; color: var(--ink-faint); font-size: 11.5px; }
  .cell-remark::before { content: "备注 "; color: var(--ink-faint); font-size: 11.5px; }
  .cell-time::before { content: "创建 "; color: var(--ink-faint); font-size: 11.5px; }
  .cell-today::before { content: "今日访问 "; color: var(--ink-faint); font-size: 11.5px; }

  .link-url { max-width: 100%; }
  .link-cell { flex-wrap: wrap; }
  .ops { grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
  .ops .btn { width: 100%; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-row-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split-row { grid-template-columns: minmax(0, 1fr) 48px 48px; font-size: 12.5px; }
  .dialog { width: calc(100vw - 16px); }
  .dialog-wide { width: calc(100vw - 16px); }
  #qr-canvas { width: 220px; height: 220px; }
}

@media (max-width: 620px) {
  .sublist-head { display: none; }
  .url-row {
    grid-template-columns: minmax(0, 1fr) 58px 96px 48px;
    grid-template-areas:
      "note note note note"
      "link link link link"
      "weight hits state ops";
    row-gap: 6px;
  }
  .url-cell-note { grid-area: note; }
  .url-cell-link { grid-area: link; }
  .url-cell-weight { grid-area: weight; }
  .url-cell-hits { grid-area: hits; }
  .url-cell-state { grid-area: state; }
  .url-cell-ops { grid-area: ops; }
}
@media (max-width: 420px) {
  .stat-value { font-size: 19px; }
  .brand-text small { display: none; }
  .sublist-toolbar { flex-wrap: wrap; }
  .sublist-current { flex: 1 1 100%; }
}

/* ---- 微信收款码子码 ---- */
.url-cell-link .url-input { flex: 1 1 auto; min-width: 0; }
.url-wx-file { display: none; }
.url-wx {
  flex: 0 0 auto; padding: 5px 8px; border-radius: 7px; cursor: pointer;
  border: 1px solid rgb(7 193 96 / 38%); background: #effaf3; color: #0a7a45;
  font-size: 12px; white-space: nowrap;
}
.url-wx:hover { background: #e2f6ea; }
.url-wx:disabled { opacity: .6; cursor: default; }
.url-wx-badge {
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 6px 9px; border-radius: 7px; background: #effaf3; color: #0a7a45;
  font-size: 12.5px; border: 1px dashed rgb(7 193 96 / 45%);
}
.url-row.is-wx .url-cell-note .url-label { background: #f6fffa; }

/* ---- 微信收款码落地页 ---- */
.wx-body {
  margin: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #eef2f6; color: var(--ink, #1f2a37);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.wx-shell { width: min(420px, calc(100vw - 32px)); padding: 24px 0 40px; text-align: center; }
.wx-title { margin: 0 0 4px; font-size: 20px; font-weight: 600; }
.wx-label { margin: 0 0 16px; font-size: 13.5px; color: #6b7280; }
.wx-card {
  background: #fff; border-radius: 18px; padding: 16px;
  box-shadow: 0 10px 30px rgb(15 23 42 / 10%);
}
.wx-image { display: block; width: 100%; height: auto; border-radius: 10px; }
.wx-tip { margin: 18px 0 6px; font-size: 14.5px; font-weight: 600; color: #0a7a45; }
.wx-note { margin: 0; font-size: 12.5px; line-height: 1.6; color: #6b7280; }

@media (max-width: 620px) {
  .url-cell-link { flex-wrap: wrap; }
  .url-wx-badge { flex: 1 1 100%; }
}