:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --border: #e4e6ea;
  --border-strong: #d3d6dc;
  --text: #1c1e21;
  --text-2: #6b7280;
  --text-3: #9aa1ab;
  --accent: #2563eb;
  --accent-weak: #eef3fe;
  --ok: #0f8a5f;
  --ok-weak: #e8f6f0;
  --bad: #c9362b;
  --bad-weak: #fdecea;
  --warn: #a86a00;
  --warn-weak: #fdf3e2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 4px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
}

/* ---------------- 通用控件 ---------------- */

.btn {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #1d4fd8; border-color: #1d4fd8; }
.btn-ghost { background: transparent; border-color: var(--border-strong); }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  text-align: left;
}
.link-btn:hover { text-decoration: underline; }

input[type="text"], input[type="number"], input[type="email"], input[type="password"], select, textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
textarea { resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }

.field { display: block; margin-bottom: 12px; }
.field > span {
  display: block;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 5px;
  font-weight: 500;
}
.field .opt { color: var(--text-3); font-weight: 400; margin-left: 6px; }
.field.compact { margin-bottom: 0; min-width: 140px; }
.field.compact.grow { flex: 1; min-width: 180px; }

.row-inline { display: flex; gap: 8px; align-items: center; }
.row-inline.center { justify-content: center; margin-top: 12px; }
.row-inline .btn { flex-shrink: 0; }

.check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 12px;
  cursor: pointer;
}
.check input { margin-top: 3px; flex-shrink: 0; }

.radio-row { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.radio {
  flex: 1 1 180px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.radio:has(input:checked) { border-color: var(--accent); background: var(--accent-weak); }
.radio input { margin-top: 3px; }
.radio b { display: block; font-size: 13px; font-weight: 500; }
.radio i { display: block; font-style: normal; font-size: 12px; color: var(--text-2); }

.seg {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
  margin-bottom: 14px;
}
.seg-item {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-2);
  cursor: pointer;
}
.seg-item.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 500; }
.seg-sm .seg-item { padding: 4px 10px; font-size: 12px; }

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.pill-ok { background: var(--ok-weak); border-color: #bfe3d4; color: var(--ok); }
.pill-bad { background: var(--bad-weak); border-color: #f4c9c4; color: var(--bad); }

.hint { font-size: 12px; color: var(--text-3); margin: 8px 0 0; line-height: 1.6; }
.hint.inline { margin: 0; }
.hint.error { color: var(--bad); }
.hint.success { color: var(--ok); }

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

.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, #f7f8fa 0%, #eef0f4 100%);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 8px 30px rgba(16, 24, 40, 0.08);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand h1 { font-size: 17px; margin: 0; font-weight: 500; }
.auth-sub { margin: 2px 0 0; font-size: 12px; color: var(--text-3); }
.logo {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 500;
  flex-shrink: 0;
}
.auth-msg { font-size: 12px; margin: 12px 0 0; min-height: 16px; color: var(--bad); }
.auth-msg.success { color: var(--ok); }
.auth-divider { margin: 16px 0 14px; padding-top: 14px; border-top: 1px dashed var(--border-strong); text-align: center; }

/* ---------------- 主框架（侧边栏） ---------------- */

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

/* 侧边栏 */
.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.side-brand {
  height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
}
.side-brand .logo { width: 32px; height: 32px; border-radius: 9px; font-size: 15px; }
.side-brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.side-brand-text strong { font-size: 14px; font-weight: 500; color: var(--text); }
.side-brand-text small { font-size: 11px; color: var(--text-3); }

.side-nav { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-weak); color: var(--accent); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }

/* 折叠父级（企业微信）：点击展开子菜单 */
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-head { justify-content: space-between; cursor: pointer; }
.nav-caret { margin-left: auto; font-size: 10px; line-height: 1; color: var(--text-3); transition: transform .15s ease; }
.nav-group.expanded .nav-caret { transform: rotate(90deg); }
.nav-group-head:hover .nav-caret { color: var(--text-2); }
.nav-sub { display: none; flex-direction: column; gap: 2px; }
.nav-group.expanded .nav-sub { display: flex; }
.nav-sub .nav-item { padding-left: 40px; font-size: 12.5px; }
.nav-sub .nav-item .nav-ico { width: 16px; height: 16px; }
.nav-ico { width: 18px; height: 18px; flex-shrink: 0; }

.side-foot { flex-shrink: 0; padding: 12px; border-top: 1px solid var(--border); }
.side-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.side-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 500; flex-shrink: 0;
}
.side-user-meta { display: flex; flex-direction: column; min-width: 0; }
.side-user-email { font-size: 13px; color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-role { font-size: 11px; color: var(--text-3); }
.side-actions { display: flex; gap: 8px; }
.side-actions .btn { flex: 1; }

/* 右侧内容区 */
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 22px;
  gap: 16px;
}
.page-title { font-size: 16px; font-weight: 500; margin: 0; color: var(--text); }
.page-head { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.page-sub { margin: 0; font-size: 12px; color: var(--text-3); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.main { flex: 1; overflow-y: auto; padding: 22px; }
.pane { display: block; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; margin-bottom: 18px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.card h2 {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin: 0 0 12px;
  letter-spacing: 0.02em;
}
.card h2:not(:first-child) { margin-top: 22px; }

.rule-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }

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

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--text-2);
  background: var(--surface-2);
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface-2); }
.ta-r { text-align: right; }

.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--text-2); }
.url-cell { max-width: 320px; }
.smallnote { font-size: 12px; white-space: normal; }
.smallnote .sub { margin-top: 4px; color: var(--warn, #b26a00); font-family: inherit; }
.url-cell a { color: var(--accent); text-decoration: none; word-break: break-all; font-size: 12px; }
.url-cell a:hover { text-decoration: underline; }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; }

.empty { text-align: center; padding: 40px; color: var(--text-3); font-size: 13px; }

/* 空态但账已经记下了：上面三个数 + 下面一个渠道排行（不是干巴巴一句「还没有」） */
.lk-empty { max-width: 620px; margin: 0 auto; text-align: left; }
.lk-empty-lead { margin: 0 0 12px; color: var(--text-2); text-align: center; }
.lk-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.lk-sum-cell {
  display: flex; flex-direction: column; align-items: center;
  background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 8px;
}
.lk-sum-num { font-size: 24px; font-weight: 600; line-height: 1.2; color: var(--text); font-variant-numeric: tabular-nums; }
.lk-sum-cap { font-size: 12px; color: var(--text-3); }
.lk-rank { display: grid; gap: 7px; }
.lk-rank-row { display: grid; grid-template-columns: 84px 1fr 44px 38px; align-items: center; gap: 9px; font-size: 13px; }
.lk-rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.lk-rank-bar { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.lk-rank-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.lk-rank-num { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.lk-rank-pct { text-align: right; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ---------------- 加好友数据 ---------------- */

.stats-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 12px 16px;
  margin: 10px 0 14px;
}
.stat-cell { display: flex; flex-direction: column; min-width: 108px; }
.stat-num { font-size: 22px; font-weight: 600; color: var(--text); line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--text-3); }
.stat-note { margin-left: auto; font-size: 12px; color: var(--text-3); }

.th-sub { font-weight: 400; color: var(--text-3); font-size: 11px; }
.stat-nums { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text-2); white-space: nowrap; cursor: default; }
.stat-nums b { color: var(--accent); font-weight: 600; }
.stat-fail { font-size: 12px; color: var(--bad); cursor: help; }


/* ---------------- 数据查看：主体一排打勾 ---------------- */

.lk-corps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 10px 0 0; }
.lk-corps-k { font-size: 12px; color: var(--text-3); }
.lk-corp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lk-corp {
  display: inline-flex; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  font-size: 12px; color: var(--text-2); user-select: none; overflow: hidden;
}
.lk-corp:hover { border-color: var(--border-strong); }
.lk-corp.on { background: var(--accent-weak); border-color: var(--accent); color: var(--accent); }
.lk-corp-main { display: inline-flex; align-items: center; gap: 5px; padding: 3px 4px 3px 11px; cursor: pointer; }
.lk-corp.on .lk-corp-main { padding-right: 6px; }
.lk-corp input { margin: 0; cursor: pointer; }
/* 删主体：平时藏着，鼠标放上去（或已勾中）才露出来，免得一排 × 太吵 */
.lk-corp-del {
  display: none; border: 0; background: none; cursor: pointer;
  font-family: inherit; font-size: 14px; line-height: 1;
  color: var(--text-3); padding: 2px 9px 3px 3px;
}
.lk-corp:hover .lk-corp-del, .lk-corp.on .lk-corp-del { display: inline-block; }
.lk-corp-del:hover { color: var(--bad); }
.lk-corp-id { font-size: 11px; color: var(--text-3); }
.lk-corp.on .lk-corp-id { color: var(--accent); }
.lk-corps .hint { font-size: 12px; margin: 0; }
/* ⭐ 别人分享给我的主体：虚线边 + 一个「共享」小牌，跟自己的区分开（而且没有 ×） */
.lk-corp.shared { border-style: dashed; }
.lk-corp-tag {
  font-size: 10px; line-height: 1; padding: 2px 5px; border-radius: 999px;
  background: var(--accent-weak); color: var(--accent); border: 1px solid var(--border);
}
.lk-corp.on .lk-corp-tag { background: transparent; color: var(--accent); border-color: var(--accent); }

/* ---------------- 数据查看：存档（导入的表按「客户添加日期」，一天一份） ---------------- */

.lk-arch { margin: 12px 0 0; padding-top: 10px; border-top: 1px dashed var(--border); }
.lk-arch-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.lk-arch-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; min-width: 0; }
.lk-arch .hint { font-size: 12px; margin: 0; }
.arch-chip {
  display: inline-flex; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  font-size: 12px; color: var(--text-2); user-select: none; overflow: hidden;
}
.arch-chip:hover { border-color: var(--border-strong); }
.arch-chip.on { background: var(--accent-weak); border-color: var(--accent); color: var(--accent); }
.arch-main { display: inline-flex; align-items: center; gap: 5px; padding: 3px 4px 3px 11px; cursor: pointer; }
.arch-chip.on .arch-main { padding-right: 6px; }
.arch-main input { margin: 0; cursor: pointer; }
.arch-day { font-variant-numeric: tabular-nums; }
.arch-c { font-weight: 600; font-variant-numeric: tabular-nums; }
/* 快过期的（还剩不到一周）人数标个暖色：提醒客户要么导出、要么放宽保留时间 */
.arch-chip.soon .arch-c { color: var(--warn); }
.arch-del {
  display: none; border: 0; background: none; cursor: pointer;
  font-family: inherit; font-size: 14px; line-height: 1;
  color: var(--text-3); padding: 2px 9px 3px 3px;
}
.arch-chip:hover .arch-del, .arch-chip.on .arch-del { display: inline-block; }
.arch-del:hover { color: var(--bad); }
/* 保留时间：贴着存档那一行的最右边 */
.lk-keep {
  display: inline-flex; align-items: center; gap: 5px; flex: none; margin-left: auto;
  font-size: 12px; color: var(--text-3); white-space: nowrap; cursor: pointer;
}
.lk-keep select { width: auto; min-width: 74px; padding: 3px 6px; font-size: 12px; }
@media (max-width: 640px) {
  .lk-keep { margin-left: 0; width: 100%; justify-content: flex-end; }
}

/* ---------------- 数据查看：渠道卡片墙（一张卡一个渠道，底下带小渠道） ---------------- */

.lk-chans { margin: 14px 0 0; }
.chan-bar-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.chan-bar-row .hint { font-size: 12px; margin: 0; }
/* ⭐「选择渠道」入口按钮：贴在这一行最右（提示语后面），margin-left:auto 顶过去。
   角标是里面的小圆牌，显示勾了几个。 */
.chan-pick-open { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.chan-pick-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 600;
  line-height: 1; font-variant-numeric: tabular-nums;
}
/* 弹窗里按主体分组的渠道勾选。
   ⭐ 2026-10-09 用户报「这个拉太长了，改成一排 2 个或者 4 个稍微小一点的」——
   原来 minmax(168px, 1fr) 在 520px 的弹窗里只塞得下 1 列，16 个渠道拉了一长条。
   现在按「明确列数」排：宽屏 4 列、窄一点 3 列、手机 2 列，每一项再收小一圈。 */
.cp-group { margin: 0 0 14px; }
.cp-group-head {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin: 0 0 7px; padding: 0 0 6px; border-bottom: 1px solid var(--border);
}
.cp-group-head strong { font-size: 13px; }
.cp-group-head .opt { font-size: 11px; color: var(--text-3); margin-left: auto; }
.cp-items { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.cp-item {
  display: flex; align-items: center; gap: 6px; min-width: 0; cursor: pointer;
  border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px;
  font-size: 12px; color: var(--text-2); background: var(--surface);
}
.cp-item:hover { border-color: var(--border-strong); color: var(--text); }
.cp-item.on { border-color: var(--accent); background: var(--accent-weak); color: var(--text); }
.cp-item input { margin: 0; flex: none; width: 13px; height: 13px; cursor: pointer; }
.cp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-num { flex: none; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
/* ⚠️ 三档都要写死列数（别用 auto-fill：弹窗宽度不定，auto-fill 会退回 1 列，又变成长条） */
@media (max-width: 900px) { .cp-items { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cp-items { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* ⭐「选择渠道」这个弹窗单独加宽 + 限高：
   ① 加宽到 760px —— 一排 4 个渠道，520px 下每项只剩 105px、名字全被截断；
   ② ⚠️⚠️ **必须限高**（`max-height: 90vh` + flex column）：它用的是 `.modal-card-lg`，
      而 `.modal-card-lg` 只有 max-width、**没有高度约束**（只有 `.modal-card-xl` 才有 90vh）。
      渠道一多（几十个 / 多个主体）弹窗就**无限变高、直接长过屏幕**，
      底下的「全部取消 / 完成」被顶到屏幕外，用户只能滚页面 —— 用户 2026-10-09 报的「弹窗很容易变得超长」。
      限高后靠中间那段 `.imp-form`（`flex:1 1 auto` / `min-height:0` / `overflow-y:auto`）自己滚。 */
.modal-card#chan-pick-card { max-width: 760px; display: flex; flex-direction: column; max-height: 90vh; }
.chan-list {
  /* ⭐ 2026-10-09 用户第二次改：「大卡片排盘尽量对齐」→ **每行等高**。
     走过一轮弯路：原来 grid 会把整行拉到同一高度，用户当时嫌「有分类和没分类的
     一样高太突兀」；改成多列后不再等高，用户又嫌「参差不齐、不对齐」。
     现在明确要**每行等高**，所以回到 grid —— 但这次是**有意的**，
     配下面 .chan-row 内部「内容靠上、空白留底」的排版，短卡不会显得空得离谱。

     ⚠️ 别再随手改回 column-count（那是不等高的瀑布流）；
        也别加 align-items: start（那又会退回参差不齐）。用户要的就是对齐。 */
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  /* 行内等高（grid 默认 stretch 就是），显式写出来提醒后来人这是刻意的 */
  align-items: stretch;
}
.chan-row {
  /* 卡内从上往下排：头 → 条 → 小分类。内容靠上，短卡多出来的高度留在底部
     （这就是「对齐」的代价：没小分类的卡底下会空一点，但整行是齐的）。 */
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 14px 16px 13px;
  /* ⭐ 2026-10-09：整张卡就是一个 <label>，点卡上任意位置都能打勾/取消（用户要求） */
  cursor: pointer;
  /* ⚠️ 小渠道区贴着卡底边会显得「和底部重叠」，底部多留一点呼吸空间 */
  padding-bottom: 14px;
}
.chan-row:hover { border-color: var(--border-strong); }
.chan-row.on { border-color: var(--accent); background: var(--accent-weak); }
.chan-head { display: flex; align-items: center; gap: 9px; }
.chan-head input { margin: 0; cursor: pointer; flex: none; width: 15px; height: 15px; }
.chan-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 600; }
.chan-share { flex: none; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.chan-num { flex: none; min-width: 44px; text-align: right; font-size: 24px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.chan-bar { margin-top: 9px; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.chan-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
/* 小渠道区：1~2 个**一行一个**（谁多少人一眼看清，也不占地方）；
   3 个以上切两列（⭐ 阈值是 3 不是 4 —— 3 个走两列 = 2 行，
   和 4 个的 2 行一样高，卡片高度才齐；若留 3 个走单列就是 3 行，
   反而比 4 个的卡还高，看着更乱） */
.chan-subs {
  display: flex; flex-direction: column; gap: 5px;
  margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--border);
}
/* 3 个以上：两列。
   ⚠️⚠️ 2026-10-09 用户报「丁的卡片底部还是和小渠道有重叠起来」——
   根因就是这里原来有 **`max-height: 154px; overflow: hidden`**：
   11 个细分双列 = 6 行 ≈ 175px > 154px → **最后一行被硬裁掉一半**，
   看起来就像小渠道和卡片底边糊在一起。
   去掉硬裁，让卡片按内容自然长高（.chan-list 是 grid 等高，同一行别的卡会跟着齐）。 */
.chan-subs-wide {
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px 7px;
}
/* 小渠道做成小方块：名字 + 人数，一眼扫完 */
.chan-sub {
  display: inline-flex; align-items: baseline; gap: 5px; min-width: 0;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 3px 8px; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums;
}
.chan-sub b { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan-sub-c { color: var(--text-3); flex: none; }
/* 两列时让名字自己截断，人数固定在右边，一行看起来是齐的 */
.chan-subs-wide .chan-sub { justify-content: space-between; }
/* 「没再往下分」：行内小字，**不再单独占一段**（原来带一条虚线上边距，等于给空卡也留了高度） */
.chan-none { display: inline-block; margin-top: 9px; font-size: 12px; color: var(--text-3); }
/* 渠道卡片墙的列数：宽屏 3 列；中等屏 2 列；窄屏 1 列（卡名会被截断就不好看了） */
@media (max-width: 1080px) { .chan-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .chan-list { grid-template-columns: minmax(0, 1fr); } }
/* 右下角那块合计：只勾了渠道才出现，靠右对齐 */
.chan-total-row { display: flex; justify-content: flex-end; margin-top: 12px; }
.chan-total {
  display: inline-flex; align-items: baseline; gap: 4px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 7px 14px; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums;
}
.chan-total b { font-size: 17px; font-weight: 600; color: var(--accent); }

/* ---------------- 导入的客户明细（企微后台导出） ---------------- */

/* 四个数：并排一行，窄了折成两行。（⚠️ 不能再用外面那套 .stat-cell —— 它按外层页面
   宽度算的，放进这个窄弹窗会被挤成一竖条，看着像坏了。） */
.imp-sum {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 4px 0 14px;
}
.imp-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 9px 6px;
}
.imp-num { font-size: 21px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.imp-cap { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.imp-sub { grid-column: 1 / -1; font-size: 12px; color: var(--text-3); text-align: center; margin-top: 2px; }

/* ⚠️ 导入弹窗里那四块小榜单（按渠道 / 按标签 / 按成员 / 按日期）已经全部按用户要求删掉，
   `.imp-grid` / `.imp-block` / `.imp-h3` 现在没有 HTML 用它了 —— 保留是为了 impPaint()
   万一在别处被调用还能成型，别再往导入弹窗里塞。 */
.imp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0 14px;
}
@media (max-width: 640px) {
  .imp-grid { grid-template-columns: 1fr; }
}
.imp-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 10px 12px 12px;
}
.imp-h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.imp-list { max-height: 260px; overflow-y: auto; }
.imp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.imp-row:hover { background: var(--surface-3, var(--surface-2)); }
.imp-row.off { cursor: default; }
.imp-row.off:hover { background: none; }
.imp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.imp-count { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--accent); }
.imp-bar { height: 4px; border-radius: 2px; background: var(--accent); opacity: .55; flex: none; }
.imp-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  margin: 0 0 10px;
}
.imp-filter b { color: var(--accent); }
/* 弹窗里那行「算到哪个主体名下」：输入框 + 右边一句解释 */
.imp-corp { display: flex; align-items: flex-end; gap: 10px; margin: 12px 0 4px; }
.imp-corp .opt { font-weight: 400; color: var(--text-3); font-size: 11px; }

/* 导入弹窗里那个「带后缀的再分小渠道」勾选框（一行字，勾不勾都看得清） */
.mini-check { display: inline-flex; align-items: flex-start; gap: 7px; cursor: pointer; font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.mini-check input { margin: 2px 0 0; flex: 0 0 auto; }
.mini-check:hover { color: var(--text-1); }

.modal-card-lg { max-width: 520px; text-align: left; }
.modal-card-lg .modal-head { margin-bottom: 12px; }
/* 地址比较长，可信企业/投诉页那个弹窗要给宽一点，不然框里只看得到前半截 */
.modal-card-xl { max-width: 680px; text-align: left; }
.modal-card-xl .modal-head { margin-bottom: 12px; }
/* 「新建链接」内容多：卡片限高、中间那段自己滚，保存按钮钉在底部（不用滚到底找按钮） */
.modal-card-xl { display: flex; flex-direction: column; max-height: 90vh; }
.pg-form { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 4px; }
/* 导入弹窗跟「新建链接」一个毛病：内容能长到一屏装不下，
   中间这段也得自己滚，否则底栏（开始导入）会被顶出卡片、跟下面的页面叠在一起。 */
.imp-form { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 4px; }
.modal-foot { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.edit-body .field > span { font-size: 12px; }

/* 生成的地址：输入框独占一行，按钮另起一行，复制出来才完整 */
.gen-url { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.gen-btns { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

.mini-note {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 10px 12px;
  margin: 4px 0 12px;
}
.mini-note p { margin: 0 0 6px; font-size: 12px; color: var(--text-2); line-height: 1.7; }
.mini-note p:last-child { margin-bottom: 0; }
.mini-note b { color: var(--text); font-weight: 500; }

.owner-tag { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* 链接库：勾选列 */
.sel-col { width: 40px; text-align: center; white-space: nowrap; }
.sel-col .checkbox-cell { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); cursor: pointer; }
.sel-link { width: 16px; height: 16px; cursor: pointer; vertical-align: middle; }

/* ---------------- 首页概览（仪表盘） ---------------- */

.dash { display: flex; flex-direction: column; gap: 18px; }

.dash-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
  background: linear-gradient(120deg, var(--accent) 0%, #3b6ef5 100%);
  color: #fff; border-radius: var(--radius); padding: 22px 24px;
  box-shadow: 0 8px 24px rgba(50, 99, 224, 0.18);
}
.dash-title { margin: 0 0 6px; font-size: 20px; font-weight: 600; }
.dash-sub { margin: 0; font-size: 13px; opacity: 0.92; line-height: 1.6; max-width: 720px; }
.dash-hero .btn-primary { background: #fff; color: var(--accent); border-color: #fff; }
.dash-hero .btn-primary:hover { background: rgba(255,255,255,0.9); }

.dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }

.stat-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(17,24,39,0.10); }
.stat-ico {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #fff;
}
.ico-corp { background: linear-gradient(135deg, #4f7cff, #3b6ef5); }
.ico-user { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.ico-link { background: linear-gradient(135deg, #19b8a6, #0fa391); }
.ico-today { background: linear-gradient(135deg, #ff8a4c, #ff6a3d); }
.ico-yest { background: linear-gradient(135deg, #8a7cff, #6a5cff); }
.ico-hist { background: linear-gradient(135deg, #ff5c8a, #f53d72); }
.ico-click { background: linear-gradient(135deg, #2bb1ff, #1890ff); }
.stat-body { min-width: 0; }
.stat-val { font-size: 26px; font-variant-numeric: tabular-nums; font-weight: 700; line-height: 1.1; color: var(--text); }
.stat-label { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

.dash-meta { display: flex; gap: 22px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.dash-meta b { color: var(--text); font-weight: 600; }

.dash-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------- 二维码工坊 ---------------- */

.qr-studio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: 16px;
  align-items: start;
}
.qra-ctrl { min-width: 0; }
.qra-preview { position: sticky; top: 12px; }

.qra-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.qra-tab {
  appearance: none;
  font-family: inherit;
  font-size: 13px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.qra-tab:hover { color: var(--text); border-color: var(--text-3); }
.qra-tab.active {
  background: var(--accent-weak);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.qra-panel { display: none; }
.qra-panel.active { display: block; }

.qra-group {
  margin: 18px 0 10px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-2);
}
.qra-group:first-child { border-top: 0; padding-top: 0; margin-top: 0; }

.qra-note { margin: 0 0 12px; font-size: 12.5px; color: var(--text-3); line-height: 1.65; }
.qra-hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; line-height: 1.5; }

.qra-row { margin: 10px 0; }
.qra-lab { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 5px; }
.qra-ctl { display: flex; align-items: center; gap: 8px; }
.qra-ctl > select,
.qra-ctl > input[type="text"] { width: 100%; }
.qra-ctl > textarea { width: 100%; }
.qra-ctl > input[type="range"] {
  flex: 1 1 auto;
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}
.qra-ctl > input[type="number"] { width: 100%; }
.qra-ctl > input[type="file"] { flex: 1 1 auto; width: auto; }

.qra-stat { font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

.qra-val {
  font-size: 12px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-width: 38px;
  text-align: right;
  flex: 0 0 auto;
}
.qra-unit { font-size: 11.5px; color: var(--text-3); flex: 0 0 auto; }

.qra-row.qra-check { display: flex; align-items: center; gap: 9px; }
.qra-row.qra-check .qra-lab { margin: 0; order: 2; font-size: 13px; color: var(--text-2); }
.qra-row.qra-check .qra-ctl { order: 1; flex: 0 0 auto; }
.qra-row.qra-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }

.qra-pal { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.qra-pal-i { display: inline-flex; align-items: center; gap: 2px; }
.qra-pal-i input[type="color"] {
  width: 34px;
  height: 30px;
  padding: 2px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}
.qra-pal-i .qra-x { width: 18px; height: 18px; font-size: 12px; border-radius: 4px; }
.qra-pal-add { padding: 4px 9px; font-size: 12px; }

.qra-stops { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.qra-stop { display: flex; align-items: center; gap: 8px; }
.qra-stop input[type="color"] {
  width: 38px;
  height: 28px;
  padding: 2px;
  flex: 0 0 auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}
.qra-stop input[type="range"] { flex: 1 1 auto; margin: 0; accent-color: var(--accent); }
.qra-stop .qra-val { min-width: 40px; }
.qra-x {
  appearance: none;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  line-height: 1;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-3);
  font-size: 14px;
  cursor: pointer;
}
.qra-x:hover { color: var(--bad); border-color: var(--bad); }

.qra-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.qra-btns .btn { flex: 1 1 auto; }

.qra-ctrl input[type="color"] {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  height: 34px;
  padding: 2px;
}
.qra-ctrl input[type="file"] { font-size: 12.5px; color: var(--text-2); }
.qra-ctrl input[type="file"]::file-selector-button {
  font-family: inherit;
  font-size: 12.5px;
  margin-right: 10px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}
.qra-ctrl input[type="file"]::file-selector-button:hover { border-color: var(--text-3); }

.qra-canvas-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #eef0f4 25%, transparent 25%),
    linear-gradient(-45deg, #eef0f4 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef0f4 75%),
    linear-gradient(-45deg, transparent 75%, #eef0f4 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
#qra-canvas {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
  border-radius: 4px;
}
.qra-canvas-wrap.qra-portrait #qra-canvas { max-width: 260px; width: auto; max-height: 520px; }
.qra-canvas-wrap.qra-drag { cursor: move; }
.qra-canvas-wrap.qra-drag #qra-canvas { cursor: move; }

.qra-preview .hint { text-align: center; font-variant-numeric: tabular-nums; }

@media (max-width: 1080px) {
  .qr-studio { grid-template-columns: 1fr; }
  .qra-preview { position: static; }
}

/* ---------------- 工具条 / 预览 ---------------- */

/* 数据查看那一条工具条：左边「我的/共享给我/全部用户」，右边一排按钮，**同一行**。
   ⚠️ 这里刻意不换行（用户要求「跟下面一排合并」）：
      seg 让它可以收缩（flex: 0 1 auto + min-width:0），按钮组保持自身宽度贴在右边，
      中间用 margin-left:auto 顶开。窗口实在窄到放不下才让 buttons 换到第二行，
      但那时候至少不是「压住上面那行」而是整块掉下去。 */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; row-gap: 8px; }
.toolbar-wrap { flex-wrap: wrap; }
/* 输入框默认 width:100%，不限制的话筛选区里每个控件都会独占一整行 */
.toolbar .field.compact { flex: 0 1 168px; }
.toolbar .field.compact.grow { flex: 1 1 220px; }
.toolbar .seg { margin-bottom: 0; }
.toolbar .field > span { white-space: nowrap; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
/* 数据查看那条：seg 能缩，按钮保持不缩，两者永远并排 */
.toolbar .seg { flex: 0 1 auto; min-width: 0; overflow: hidden; }
.toolbar .seg .seg-item { white-space: nowrap; }

.preview-box { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin: 14px 0; }
.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.preview-head h2 { margin: 0; }
.preview-list { max-height: 190px; overflow-y: auto; padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.preview-list .tag {
  background: var(--accent-weak);
  color: #1d4fd8;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.preview-list .more { color: var(--text-3); font-size: 12px; padding: 3px 8px; }

.actions { margin-top: 14px; }

/* ---------------- 主体列表 ---------------- */

.corp-list { display: flex; flex-direction: column; gap: 10px; }
.corp-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.corp-item .ci-main { flex: 1; min-width: 0; }
.corp-item .ci-name { font-weight: 500; font-size: 13px; }
.corp-item .ci-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; word-break: break-all; }
.corp-item .ci-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* 可信企业 / 投诉页弹窗里的一小块内容，浅底 + 细边框，跟普通表单区分开 */
.block-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 12px; background: var(--surface-2); }
.block-card .bc-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.block-card .bc-head strong { font-size: 13px; }
.block-card .bc-head .opt { color: var(--text-3); font-size: 12px; }
.block-card input[readonly] { background: #f1f3f7; color: var(--text-2); }

/* 可信企业页的工商信息：两列排，窄屏落回一列 */
.ent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.ent-grid .field { margin-bottom: 10px; }
#ent-scope { font-family: inherit; font-size: 13px; line-height: 1.6; min-height: 68px; }
@media (max-width: 640px) { .ent-grid { grid-template-columns: 1fr; } }

/* 「我想用自己的地址」默认折叠，别一打开就让人以为要填 */
.adv-block { border-top: 1px dashed var(--border); padding-top: 12px; margin-top: 4px; }
.adv-block > summary { cursor: pointer; font-size: 13px; color: var(--text-2); user-select: none; }
.adv-block > summary:hover { color: var(--accent); }
.adv-block[open] > summary { margin-bottom: 4px; }

/* 「可信企业 / 投诉页」整页：一个主体一张卡，卡里两行地址 + 可折叠的工商信息 */
.pg-line { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.pg-line .pg-tag { flex: 0 0 76px; font-size: 12.5px; color: var(--text-2); }
.pg-line .gen-url { flex: 1 1 auto; min-width: 0; }
.pg-ent { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 10px; }
.pg-ent > summary { cursor: pointer; font-size: 12.5px; color: var(--text-2); user-select: none; list-style: none; }
.pg-ent > summary::-webkit-details-marker { display: none; }
.pg-ent > summary::before { content: '▸ '; color: var(--text-3); }
.pg-ent[open] > summary::before { content: '▾ '; }
.pg-ent > summary:hover { color: var(--accent); }
.pg-ent textarea { font-family: inherit; font-size: 13px; line-height: 1.6; min-height: 68px; }
.pg-ent .ent-grid { margin-top: 10px; }
/* 弹窗里「资料名称」那一行：下拉能缩，别把右边「存进信息库」挤出去 */
.lic-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.lic-pick .pg-tag { flex: 0 0 auto; font-size: 12.5px; color: var(--text-2); }
.lic-pick select { flex: 1 1 160px; min-width: 0; max-width: 300px; }
/* 营业执照信息库：一套一条，右侧改名 / 删除 */
.lic-box > summary { cursor: pointer; font-size: 13px; color: var(--text-2); user-select: none; list-style: none; }
.lic-box > summary::-webkit-details-marker { display: none; }
.lic-box > summary::before { content: '▸ '; color: var(--text-3); }
.lic-box[open] > summary::before { content: '▾ '; }
.lic-box > summary:hover { color: var(--accent); }
.lic-box > summary .opt { color: var(--text-3); font-size: 12px; margin-left: 8px; }
.lic-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--border); }
.lic-item:first-child { border-top: 0; padding-top: 2px; }
.lic-main { flex: 1 1 auto; min-width: 0; }
.lic-name { font-size: 13px; }
.lic-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; word-break: break-all; }
.lic-actions { flex: 0 0 auto; display: flex; gap: 6px; }
@media (max-width: 640px) {
  .pg-line { flex-wrap: wrap; gap: 4px; }
  .pg-line .pg-tag { flex: 0 0 100%; }
  .lic-pick select { max-width: none; }
}

/* 刚生成出来的卡密：就地列出来，点一下就复制 */
.card-out-head { font-size: 12.5px; color: var(--text-3); margin: 8px 0 6px; }
.card-out-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--border); }
.card-out-row:first-of-type { border-top: 0; }
.card-out-code { flex: 1 1 auto; min-width: 0; font-size: 14px; letter-spacing: .5px; word-break: break-all; }
.card-out-row .hint { flex: 0 0 auto; font-size: 12px; }

/* 「可信企业 / 投诉页」板块顶上合成一行：左边营业执照信息库，右边添加信息 + 两个新增按钮 */
.pg-pane-head { align-items: flex-start; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
/* ⚠️ 原来这里提到 `.lic-box` 只剩「我的域名」折叠块在用 —— 「我的域名」已删
   （2026-10-09 第三十四轮），`.lic-box` 现在**没有任何元素在用**了（样式本身留着，
   以后再有折叠块可以直接套）。 */
.pg-acts { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* 弹窗顶部那句说明 */
.pg-modal-hint { margin: 0 0 12px; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
/* 新建链接：类型二选一做成两张卡，一眼看清是干嘛的 */
.pg-kind-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* ⚠️ 「这条是哪种链接」两张选项卡：**鼠标放上去不许位移**。
   原来 :hover 上有 transform / translateY，鼠标一划过去整张卡往上蹿一下，
   用户反馈「选项卡会上移」。这里一律不做 transform，只换边框色。
   另外和 .pg-kind-pick 间距拉开，点的时候不会蹭到上面「起名字」那一栏。 */
.pg-kind {
  display: flex; flex-direction: column; gap: 3px; align-items: flex-start; text-align: left;
  padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; font: inherit; color: var(--text); line-height: 1.5;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.pg-kind b { font-size: 13.5px; }
.pg-kind span { font-size: 12px; color: var(--text-3); }
.pg-kind:hover { border-color: var(--accent); }
.pg-kind.on { border-color: var(--accent); background: var(--accent-weak); box-shadow: inset 0 0 0 1px var(--accent); }
.pg-kind.on b { color: var(--accent); }
@media (max-width: 640px) { .pg-kind-pick { grid-template-columns: 1fr; } }

/* 工商信息那 6 栏：三列铺开，弹窗短一半（新建可信企业页时不用往下滚那么久） */
.ent-grid.g3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .ent-grid.g3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .ent-grid.g3 { grid-template-columns: 1fr; } }
/* 列表按「可信企业页 / 投诉页」分组，各带一个小标题 */
.pg-group { margin-bottom: 6px; }
.pg-group-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.pg-group-head .pill { font-weight: 400; }
.pg-group-empty { color: var(--text-3); font-size: 12.5px; margin: 0 0 8px; }

/* ⭐⭐「我的域名」那块样式整段删了（2026-10-09 第三十四轮）：
   .dom-box / .dom-title / .dom-steps / .dom-step / .dom-host / .dom-row / .dom-seg-row。
   绑自己域名功能已取消，页面上再没有这些元素了。 */

/* 投诉记录：客户写的那段可能很长，给它一个宽一点的列 + 换行 */
#cmp-table .cell-note { max-width: 380px; white-space: pre-wrap; word-break: break-word; line-height: 1.55; }
#cmp-table .sub { margin-top: 4px; font-size: 12px; color: var(--text-3); }

/* 客户提交的图片证据：列表里只给缩略图，点开铺满屏幕看 */
.cmp-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cmp-thumb {
  width: 52px; height: 52px; object-fit: cover;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface-2); cursor: zoom-in;
}
.cmp-thumb:hover { border-color: var(--accent); }

.img-view {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  background: rgba(12, 15, 22, .88); padding: 24px; cursor: zoom-out;
}
.img-view img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 14px 44px rgba(0, 0, 0, .5); }

/* ---------------- 选择器 ---------------- */

.picker {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 10px;
  max-height: 165px;
  overflow-y: auto;
  background: var(--surface-2);
}
.picker .pick-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 4px 0;
  cursor: pointer;
}
.picker .pick-item:hover { color: var(--accent); }
.picker .pick-item .muted { color: var(--text-3); font-size: 12px; }
.picker-group { font-size: 12px; color: var(--text-3); margin: 8px 0 2px; font-weight: 500; }
.picker-block + .picker-block { margin-top: 8px; border-top: 1px dashed var(--border); padding-top: 4px; }

/* ---------------- 弹窗 / 提示 ---------------- */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 20px;
}
.modal-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  max-width: 340px;
  text-align: center;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.qr-body { background: var(--surface-2); border-radius: var(--radius-sm); padding: 16px; }
.qr-body img { width: 200px; height: 200px; display: block; margin: 0 auto; }
.qr-url { font-size: 12px; color: var(--text-3); word-break: break-all; margin: 12px 0 0; }

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 999px;
  z-index: 80;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  max-width: 80vw;
}
.toast.bad { background: var(--bad); }
.toast.ok { background: var(--ok); }

/* 预览模式提示条 */
.preview-banner {
  background: var(--warn-weak);
  border-bottom: 1px solid #f0dcb4;
  color: var(--warn);
  font-size: 12px;
  text-align: center;
  padding: 7px 16px;
  line-height: 1.5;
}

/* 顶部到期提示条 */
.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--warn);
  background: var(--warn-weak);
  border-bottom: 1px solid #f0dcb4;
  line-height: 1.5;
}
.banner.banner-bad { color: var(--bad); background: var(--bad-weak); border-bottom-color: #f4c9c4; }
.banner .banner-act { margin-left: auto; }
.banner .btn { padding: 4px 10px; font-size: 12px; }

/* ---------------- 短网址 ---------------- */

.su-form { padding-bottom: 14px; border-bottom: 1px dashed var(--border); margin-bottom: 14px; }
/* 卡上「地址域名」那一行：下拉能缩，别把右边那句说明挤出去 */
.pg-domain { margin-top: 10px; }
.pg-domain select { flex: 0 1 auto; min-width: 0; max-width: 240px; }
/* 短链地址比一般单元格长：允许断行，别把表格撑出横向滚动条 */
.su-link { font-size: 13px; word-break: break-all; line-height: 1.45; }
.su-link a { color: var(--accent); text-decoration: none; }
.su-link a:hover { text-decoration: underline; }
#su-table .sub { margin-top: 4px; font-size: 12px; color: var(--text-3); }
#su-table .cell-note { max-width: 320px; word-break: break-all; line-height: 1.5; color: var(--text-2); }
/* 展开的「修改」行：底色压一下，一眼看出在改哪一条 */
.su-edit-row > td { background: var(--surface-2); }
@media (max-width: 640px) {
  .su-form .row-inline { flex-direction: column; align-items: stretch; }
  .su-form .row-inline .field { flex: 1 1 auto !important; }
  .su-form .row-inline .btn { width: 100%; }
}

/* ---------------- 抖音卡片 ---------------- */

.dy-form { padding-bottom: 16px; border-bottom: 1px dashed var(--border); }
.dy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .dy-grid { grid-template-columns: 1fr; } }

.dy-note {
  display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 16px;
  font-size: 12.5px; line-height: 1.7; color: var(--text-2);
}
.dy-note b { color: var(--text); flex: 0 0 auto; }
.dy-note span { flex: 1 1 300px; min-width: 0; }

/* 封面 / 二维码：左边一个方形预览框，右边按钮和说明 */
.dy-cover-row { display: flex; gap: 14px; align-items: flex-start; margin-top: 16px; flex-wrap: wrap; }
.dy-cover-box {
  flex: 0 0 104px; width: 104px; height: 104px; border-radius: var(--radius-sm);
  border: 1px dashed var(--border); background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  cursor: pointer; position: relative;
}
.dy-cover-box:hover { border-color: var(--accent); }
.dy-cover-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dy-cover-box .dy-cover-ph {
  font-size: 12px; color: var(--text-3); text-align: center; line-height: 1.5; padding: 0 6px;
}
.dy-cover-side { flex: 1 1 260px; min-width: 0; }
.dy-cover-label { font-size: 12.5px; font-weight: 500; margin-bottom: 8px; }
.dy-cover-label .opt { color: var(--text-3); font-weight: 400; margin-left: 6px; }
.dy-lib-sel { max-width: 240px; min-width: 0; }

/* 跳转类型 / 企微类型：一排按钮，选中高亮 */
.dy-picks { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.dy-pick {
  font-family: inherit; font-size: 13px; padding: 7px 14px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  border-radius: var(--radius-sm); transition: none;
}
.dy-pick:hover { border-color: var(--accent); color: var(--accent); }
.dy-pick.active {
  background: var(--accent-weak, var(--surface-2)); border-color: var(--accent);
  color: var(--accent); font-weight: 500;
}

#dy-table .dy-thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; display: block; border: 1px solid var(--border); }
#dy-table .dy-thumb-ph {
  width: 44px; height: 44px; border-radius: 6px; background: var(--surface-2);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-3);
}
/* 文字卡的缩略图：白底两行字的迷你版，比一个「无」字有用 */
#dy-table .dy-thumb-tap {
  width: 44px; height: 44px; border-radius: 6px; background: #fff;
  border: 1px solid var(--border); overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 3px; gap: 2px; text-align: center;
}
#dy-table .dy-thumb-tap span {
  font-size: 8px; line-height: 1.1; color: #333; word-break: break-all;
  max-height: 17px; overflow: hidden;
}
#dy-table .dy-thumb-tap b { font-size: 8px; line-height: 1.1; color: #1a73e8; font-weight: 400; word-break: break-all; max-height: 17px; overflow: hidden; }
#dy-table .dy-t { font-weight: 500; word-break: break-word; line-height: 1.45; }
#dy-table .dy-d { font-size: 12px; color: var(--text-3); margin-top: 3px; word-break: break-word; line-height: 1.5; }
#dy-table .dy-jump { font-size: 12.5px; color: var(--text-2); line-height: 1.5; word-break: break-word; max-width: 260px; }
#dy-table .dy-jump .sub { margin-top: 4px; font-size: 12px; color: var(--text-3); }
.dy-edit-row > td { background: var(--surface-2); }

/* 「蓝色文字链接」的实时预览：白底两行字，上面黑的、下面蓝的。
   版式跟服务端 dyTapPage 渲染出来的一致，让人填字时就看到手机上的样子。 */
.dy-tap-prev { margin-top: 14px; }
.dy-tap-prev-label { font-size: 12.5px; color: var(--text-3); margin-bottom: 8px; }
.dy-tap-prev-box {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 26px 18px; text-align: center; max-width: 320px;
}
.dy-tap-prev-box p { margin: 0 0 18px; font-size: 16px; line-height: 1.5; color: #222; word-break: break-word; }
.dy-tap-prev-box a { font-size: 17px; line-height: 1.5; color: #1a73e8; text-decoration: none; word-break: break-word; }

/* 生成卡片地址之后那块「怎么把它变成卡片」面板。
   只给一条链接是不够的 —— 链接发出去还是链接，必须拿苹果手机去抖音里转一次。
   所以这里摆一个可扫的码 + 四步说明，让人扫完就知道下一步干什么。 */
.dy-done {
  margin-top: 16px; padding: 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-soft);
}
.dy-done-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.dy-done-head b { font-size: 14px; }
.dy-done-body { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.dy-done-qr { flex: 0 0 auto; text-align: center; }
.dy-done-qr img {
  width: 148px; height: 148px; border-radius: 8px;
  background: #fff; padding: 6px; border: 1px solid var(--border); display: block;
}
.dy-done-qr-tip { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.dy-done-steps { flex: 1 1 240px; margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.85; color: var(--text-2); }
.dy-done-steps li { margin-bottom: 2px; }
.dy-done-url {
  flex: 1 1 240px; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px; padding: 7px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg); color: var(--text-2);
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .rule-grid { grid-template-columns: repeat(2, 1fr); }
  .sidebar { width: 64px; padding: 0; }
  .side-brand { padding: 0; justify-content: center; height: 60px; }
  .side-brand-text, .nav-label, .side-user-meta, .side-brand small { display: none; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .side-foot { padding: 10px 8px; }
  .side-user { justify-content: center; margin-bottom: 8px; }
  .side-actions { flex-direction: column; gap: 6px; }
  .side-actions .btn { font-size: 11px; padding: 5px 2px; }
  .topbar { padding: 0 14px; gap: 12px; }
  .main { padding: 14px; }
  /* 窄屏（≤900px）实在并排放不下，就让按钮整排掉到第二行、靠右 —— 至少不是「压住上面那排」 */
  .toolbar { flex-wrap: wrap; }
  .toolbar-actions { margin-left: 0; width: 100%; justify-content: flex-end; }
}

/* ---------- 可信企业 / 投诉页：自己新建链接（2026-10-08 改版） ---------- */
.tp-card { margin-bottom: 12px; }
.tp-card .bc-head { align-items: center; gap: 8px; flex-wrap: wrap; }
.tp-url { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.tp-url .gen-url { flex: 1 1 auto; min-width: 0; }
.tp-url .btn { flex: 0 0 auto; }
.tp-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.tp-meta .opt { color: var(--text-3); font-size: 12px; }
/* ⭐ 备注（仅自己可见，用户 2026-10-09）：用淡黄底区分开 —— 一眼看出它不是对外内容，
   「改信息」那颗按钮取消后，备注在列表里更要显眼（不然写了也看不见）。 */
.tp-note {
  margin-top: 8px; padding: 8px 10px; border-radius: 8px;
  background: var(--warn-weak); border: 1px solid rgba(168, 106, 0, .22);
  color: var(--text-2); font-size: 12px; line-height: 1.6; word-break: break-word;
}
.tp-note b { color: var(--text-1); font-weight: 600; }
/* ⭐ 标题点一下 = 改信息（那颗按钮取消了）。给个手型 + hover 变蓝，不然没人知道能点。 */
.tp-card .tp-title { cursor: pointer; }
.tp-card .tp-title:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.pg-paste { margin: 4px 0 12px; border: 1px dashed var(--border); border-radius: 8px; padding: 0 12px; }
.pg-paste > summary { cursor: pointer; font-size: 13px; color: var(--text-2); user-select: none; list-style: none; padding: 9px 0; }
.pg-paste > summary::-webkit-details-marker { display: none; }
.pg-paste > summary::before { content: '▸ '; color: var(--text-3); }
.pg-paste[open] > summary::before { content: '▾ '; }
.pg-paste > summary:hover { color: var(--accent); }
.pg-paste textarea { width: 100%; box-sizing: border-box; font-family: inherit; font-size: 13px; line-height: 1.6; margin-bottom: 2px; }
.pg-paste .row-inline { margin-bottom: 12px; }
/* ⚠️ `.pg-check` 原来给「用自己的域名发这条链接」那个勾选框用 —— 整块已删
   （2026-10-09 第三十四轮），HTML 里再没有这个 class 了，样式一并删掉。 */
#pg-ent-grid { margin-top: 4px; }
