:root {
  --orange: #ff6a0d;
  --orange-dark: #e85c00;
  --text: #1f2329;
  --muted: #8a919c;
  --line: #eceef1;
  --soft: #f5f6f8;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  min-height: 100vh;
  background: #fff;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }

[hidden] { display: none !important; }

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

.shell { display: flex; min-height: 100vh; }

.side {
  flex: 0 0 212px;
  width: 212px;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  background: #fff;
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { font-size: 17px; font-weight: 700; letter-spacing: 1px; padding: 0 8px; }
.brand span { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: 0; }

.side-tenant {
  margin: 14px 6px 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff6ee;
  font-size: 12px;
  line-height: 1.5;
  color: #b25400;
  word-break: break-all;
}

.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; }
.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-size: 14px;
  color: #4a5058;
  text-align: left;
}
.nav-item:hover { background: var(--soft); }
.nav-item.active { background: #fff3e9; color: var(--orange-dark); font-weight: 600; }
.nav-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ff4d4f;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 6px; }
.side-user { font-size: 12px; color: var(--muted); word-break: break-all; }
.side-foot .row2 { display: flex; gap: 8px; }
.side-foot .row2 .mini { flex: 1; text-align: center; }

.main { flex: 1; min-width: 0; padding: 16px 20px 36px; }
.main-inner { width: 100%; }

/* ---------- 通用组件 ---------- */

.mini {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #1f2329;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
}
.mini:hover { border-color: #d9dde3; background: #fafbfc; }
.mini.danger { border-color: #e85050; color: #e85050; }
.mini.danger:hover { background: #fff1f1; border-color: #d23f3f; }

.primary-btn {
  height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: var(--orange);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
}
.primary-btn:hover { background: var(--orange-dark); }
.primary-btn:disabled { background: #ffb27a; }
.primary-btn.small { height: 34px; padding: 0 16px; font-size: 13px; border-radius: 8px; }

input[type="text"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 14px;
  color: var(--text);
  outline: none;
}
textarea { height: auto; padding: 10px 12px; line-height: 1.7; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--orange); }

/* ---------- 登录 / 权限提示 ---------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-color: #fff8f2;
  background-image:
    linear-gradient(rgba(214, 122, 44, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214, 122, 44, 0.06) 1px, transparent 1px),
    radial-gradient(560px 420px at 16% 8%, rgba(255, 152, 74, 0.22), transparent 70%),
    radial-gradient(520px 480px at 88% 94%, rgba(255, 190, 120, 0.18), transparent 70%),
    linear-gradient(165deg, #fffaf5 0%, #fff1e4 55%, #ffe6d2 100%);
  background-size: 36px 36px, 36px 36px, auto, auto, auto;
  background-repeat: repeat, repeat, no-repeat, no-repeat, no-repeat;
  background-position: center;
}
.login-wrap.has-bg {
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}
.login-card {
  width: min(380px, 100%);
  padding: 26px 22px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 12px 30px rgba(214, 122, 44, 0.14);
}
.login-logo { display: block; max-width: 160px; max-height: 64px; margin: 0 auto 10px; object-fit: contain; }
.login-brand { text-align: center; font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.login-tenant { margin: 2px 0 14px; font-size: 13px; font-weight: 600; color: #6b4a2f; }
.login-pwd { position: relative; margin-top: 10px; }
.login-pwd input { width: 100%; margin-top: 0; padding-right: 42px; }
.login-eye {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #9aa3ad;
  cursor: pointer;
}
.login-eye svg { width: 18px; height: 18px; }
.login-eye.active { color: var(--orange); }
.login-hint { margin: 12px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
.login-sub { margin: 6px 0 4px; text-align: center; font-size: 12px; color: var(--muted); }
.login-card input { margin-top: 10px; }
.login-card .primary-btn { width: 100%; margin-top: 14px; }
.login-link { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 14px; text-align: center; font-size: 12px; color: var(--muted); text-decoration: none; }
.login-link svg { width: 12px; height: 12px; flex: 0 0 12px; }
.login-link:hover { color: var(--orange); }

.form-error { min-height: 18px; margin-top: 8px; font-size: 12px; color: #e5484d; }

/* ---------- 内容区 ---------- */

.sec { display: none; }
.sec.active { display: block; }

.sec-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.sec-head h2 { margin: 0; font-size: 18px; line-height: 32px; padding-top: 0; }
.sec-head .muted { margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--muted); }
.sec-head .head-actions { display: flex; gap: 8px; }

.user-search {
  width: 100%;
  max-width: 340px;
  height: 36px;
  margin-bottom: 14px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
}
.user-search:focus { outline: none; border-color: var(--orange); }
.audit-list { max-height: 52vh; overflow-y: auto; }

.list { display: flex; flex-direction: column; gap: 10px; }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(31, 35, 41, 0.05);
}
.row:hover { border-color: #e2e5ea; }
.row.is-active { border-color: var(--orange); }
.row.is-active:hover { border-color: var(--orange); }
.row-main { min-width: 0; }
.row-title { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; font-size: 14px; font-weight: 600; line-height: 26px; overflow: hidden; }
.row-title .username-link { border: 0; background: none; padding: 0; margin: 0; font: inherit; font-weight: 600; color: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.row-title .username-link:hover { color: #e8590c; }
.row-title .mini { box-sizing: border-box; height: 28px; padding: 0 12px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.row-title .mini.solid { font-weight: 500; }
.row-meta { margin-top: 5px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.row-meta.clickable { cursor: pointer; }
.row-meta.clickable:hover { color: var(--text); text-decoration: underline; }
.ext-link { color: #e8590c; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.ext-link:hover { color: #c94f09; }
.inline-link { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.inline-link:hover { text-decoration: underline dotted; color: var(--text); }
button.inline-link { border: 0; background: none; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; }
.admin-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 14px; max-height: 260px; overflow: auto; }
.admin-list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; background: #f7f8fa; border-radius: 8px; font-size: 13px; }
.admin-list-name { font-weight: 600; color: var(--text); word-break: break-all; }
.admin-list-tag { flex: 0 0 auto; font-size: 11px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.row-actions .mini { box-sizing: border-box; height: 28px; line-height: 1; padding: 0 12px; border-radius: 8px; font-size: 12px; font-weight: 500; }
.row-actions .renew-btn { border-color: #cbd0d8; color: #171a1f; font-weight: 600; }
.script-row-actions {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  margin-top: 10px;
  border-top: 1px dashed var(--line);
}
.script-row-actions .script-foot-meta { margin-right: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.script-action-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
#appearance-dialog .dialog-actions { justify-content: flex-start; }
#appearance-dialog .appearance-actions { margin-top: 14px; }

/* 企业列表：桌面端双列卡片，移动端保持单列原样 */
@media (min-width: 861px) {
  #tenant-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
  #tenant-list .row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 18px 20px;
  }
  #tenant-list .row-title { font-size: 15px; }
  #tenant-list .row-actions { justify-content: flex-start; }
}
@media (min-width: 1280px) {
  #tenant-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
}

/* 全部用户：桌面端多列紧凑卡片，减少纵向占用 */
@media (min-width: 861px) {
  #all-user-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
  #all-user-list .row { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 16px; }
  #all-user-list .row-actions { justify-content: flex-start; }
  #all-user-list .row-meta { margin-top: 4px; }
}
@media (min-width: 1280px) {
  #all-user-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}

.badge { display: inline-flex; align-items: center; justify-content: center; height: 26px; padding: 0 10px; border-radius: 10px; background: #eef0f3; font-size: 11px; font-weight: 400; color: #5b6169; white-space: nowrap; }
.badge.admin { background: #fff1e6; color: #c45500; }
.badge.user { background: #e8edf5; color: #4a5a75; }
.badge.virtual { background: #eef0f3; color: #5b6169; }
.badge.real { background: #fff1e6; color: #c45500; }
.badge.status-none { background: #fff1e6; color: #c45500; }
.badge.status-pending { background: #fff5e0; color: #b76b00; }
.badge.status-approved { background: #e7f7ee; color: #17864a; }
.badge.status-expiring { background: #fff5e0; color: #b76b00; }
button, .mini, .primary-btn, .nav-item, .action-item { white-space: nowrap; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.filter-bar input,
.filter-bar select {
  flex: 1 1 140px;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 13px;
}
.filter-bar input { flex: 1 1 240px; }
.filter-bar select { flex: 0 0 150px; }
.filter-bar .mini {
  height: 40px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 13px;
}
.upload-row { display: flex; gap: 14px; align-items: flex-start; margin-top: 8px; }
.upload-preview {
  flex: 0 0 96px;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px dashed #dfe3e9;
  border-radius: 10px;
  background: #fafbfc;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}
.upload-preview.bg { flex-basis: 150px; width: 150px; height: 84px; }
.upload-preview img { width: 100%; height: 100%; object-fit: contain; }
.upload-preview.bg img { object-fit: cover; }
.upload-info { flex: 1; min-width: 0; }
.upload-actions { display: flex; gap: 8px; }
.upload-info .tip { margin-top: 6px; }

.dialog-card.appearance-card { width: min(940px, 100%); padding: 28px 30px; }
.appearance-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.appearance-form { min-width: 0; }
.appearance-card .upload-row { gap: 16px; }
.appearance-card .upload-preview { flex-basis: 128px; width: 128px; height: 128px; }
.appearance-card .upload-preview.bg { flex-basis: 220px; width: 220px; height: 124px; }
.appearance-card .upload-actions button { padding: 7px 14px; }
.appearance-card .field { margin-bottom: 18px; }

.appearance-preview { display: flex; justify-content: center; padding-top: 4px; }
.phone-mock {
  position: relative;
  width: 270px;
  height: 540px;
  padding: 12px;
  border-radius: 34px;
  background: #1c1f24;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}
.phone-notch {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 74px;
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.28);
  z-index: 3;
}
.phone-screen {
  position: relative;
  height: 100%;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: linear-gradient(150deg, #fffaf5 0%, #fff1e4 55%, #ffe6d2 100%);
  background-size: cover;
  background-position: center;
}
.phone-screen.has-bg { background-size: cover; background-position: center; }
.phone-auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 18px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(214, 120, 40, 0.18);
  text-align: center;
}
.phone-auth-logo { display: block; max-width: 116px; max-height: 52px; margin: 0 auto 6px; object-fit: contain; }
.phone-auth-tenant { margin-bottom: 12px; font-size: 12px; font-weight: 600; color: #6b4a2f; text-align: left; }
.phone-auth-input {
  margin-top: 9px;
  padding: 9px 10px;
  border: 1px solid #e7e0d8;
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
  color: #b6aca1;
  text-align: left;
}
.phone-auth-btn {
  margin-top: 12px;
  padding: 9px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff7a18, #ff5a00);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.phone-auth-hint { margin-top: 10px; font-size: 9px; line-height: 1.6; color: #9a8c7d; text-align: left; }
.phone-home {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 92px;
  height: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.5);
  z-index: 3;
}

.batch-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border: 1px dashed #e2e5ea;
  border-radius: 9px;
  background: #fafbfc;
  font-size: 12px;
  color: var(--muted);
}
.batch-bar[hidden] { display: none; }
.batch-check { display: inline-flex; align-items: center; gap: 6px; color: #41474f; cursor: pointer; }
.batch-check input, .row-check { cursor: pointer; }
.row-check { margin-right: 2px; }
.batch-bar .mini { margin-left: auto; height: 32px; padding: 0 14px; }
.user-batch-bar { flex-wrap: wrap; }
.user-batch-bar .batch-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.batch-bar .batch-actions .mini { margin-left: 0; }
.dialog-actions .mini {
  height: 38px;
  padding: 0 18px;
  border-radius: 9px;
  font-size: 13px;
}

.badge.status-rejected { background: #fdecec; color: #c03535; }
.badge.status-expired { background: #fff1e0; color: #b76b00; }
.badge.status-disabled { background: #f1f2f4; color: #8a919c; text-decoration: line-through; }
.badge.clickable { cursor: pointer; user-select: none; }
.badge.clickable:hover { box-shadow: inset 0 0 0 1px currentColor; }
.badge.clickable { border: 0; font-family: inherit; line-height: 1.5; }

.search-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}

.search-chip {
  padding: 6px 12px;
  border: 1px solid #ffd9c2;
  border-radius: 8px;
  background: #fff6f0;
  color: var(--accent);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.search-chip:hover { border-color: var(--accent); background: #ffece0; }

.empty-tip {
  padding: 40px 16px;
  border: 1px dashed #dfe3e8;
  border-radius: 12px;
  background: #fff;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- 采集记录 ---------- */

.log-row { align-items: flex-start; }
.log-keyword { font-size: 14px; font-weight: 600; }
.log-meta { margin-top: 5px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.log-count { flex: 0 0 auto; text-align: right; }
.log-count b { font-size: 18px; color: var(--orange); }
.log-count span { display: block; font-size: 11px; color: var(--muted); }

/* 获客记录：搜索筛选 + 美化 */
.log-toolbar { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.log-toolbar input[type="search"] { flex: 1; min-width: 0; height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; background: #fff; }
.log-toolbar input[type="search"]:focus { outline: none; border-color: var(--orange); }
.log-toolbar select { flex: 0 0 auto; width: auto; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; background: #fff; cursor: pointer; }

/* 总部搜索记录：时间/企业筛选自适应，搜索框变短 */
#sec-searches .filter-bar select { flex: 0 0 auto; width: auto; min-width: 0; }
#sec-searches .filter-bar input[type="search"] { flex: 1; min-width: 0; }
.log-stats { margin-bottom: 12px; padding: 10px 14px; background: #fff7f2; border: 1px solid #ffe0cc; border-radius: 10px; font-size: 13px; color: #c2410c; font-weight: 600; }
.log-top { display: flex; align-items: center; gap: 8px; }
.log-kw { font-size: 15px; font-weight: 700; color: #1f2329; }
.log-radius { font-size: 11px; color: var(--orange); background: #fff3ec; border: 1px solid #ffd9c2; padding: 1px 8px; border-radius: 6px; }
.log-badge { flex: 0 0 auto; display: flex; align-items: baseline; gap: 3px; align-self: center; }
.log-badge b { font-size: 24px; color: var(--orange); line-height: 1; }
.log-badge span { font-size: 12px; color: var(--muted); }
.log-addr { display: flex; gap: 2px; font-size: 12px; color: var(--muted); cursor: pointer; margin-top: 2px; }
.log-addr-label { flex: 0 0 auto; }
.log-addr-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-addr.expanded .log-addr-text { white-space: normal; word-break: break-all; }
.log-addr:hover .log-addr-text { color: var(--orange); }

/* 搜索记录：统计概览卡 */
.search-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.search-overview .ov-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}
.search-overview .ov-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--orange);
  line-height: 1.1;
}
.search-overview .ov-label {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* 操作记录：顶部统计卡（3 项） */
.oplog-overview { grid-template-columns: repeat(3, 1fr); }
.oplog-overview .overview-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  transition: border-color .15s, box-shadow .15s;
}
.oplog-overview .overview-card:hover {
  border-color: #d9dde3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
}
.oplog-overview .stat-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--orange);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.oplog-overview .stat-label {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* 搜索记录：热门关键词 TOP 5 */
.search-hot-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.search-hot-title {
  font-size: 13px;
  font-weight: 600;
  color: #4a5058;
  margin-bottom: 10px;
}
.search-hot-list {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 132px;
  padding: 2px 2px 0;
}
.search-hot-col {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}
.search-hot-col:hover { background: #fff7f2; }
.search-hot-count {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
  white-space: nowrap;
}
.search-hot-track {
  width: 100%;
  max-width: 58px;
  flex: 1;
  display: flex;
  align-items: flex-end;
  background: #f5f6f8;
  border-radius: 6px;
  overflow: hidden;
}
.search-hot-bar {
  width: 100%;
  background: linear-gradient(180deg, #ffb347, #ff6a0d);
  border-radius: 6px 6px 0 0;
  min-height: 4px;
  transition: height 0.4s ease;
}
.search-hot-label {
  margin-top: 8px;
  font-size: 12px;
  color: #1f2329;
  font-weight: 500;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 搜索记录：卡片关键词可点 */
.log-kw { cursor: pointer; user-select: none; transition: color 0.15s; }
.log-kw:hover { color: var(--orange); }

/* 搜索记录：卡片 hover 轻微上浮 */
.log-row { transition: box-shadow 0.15s, border-color 0.15s; }
.log-row:hover { border-color: #ffd9c2; box-shadow: 0 2px 8px rgba(255, 106, 13, 0.08); }

/* ---------- 设置 ---------- */

.settings-card {
  max-width: 620px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.settings-group + .settings-group { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line); }
.settings-group h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 15px; }
.settings-group h3 .muted { font-size: 12px; font-weight: 500; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 7px; font-size: 13px; color: #4a5058; }
.field .tip { margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.key-status {
  margin-bottom: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--soft);
  font-size: 12px;
  color: #5b6169;
}
.settings-card .primary-btn { margin-top: 4px; }
.hint-text { margin: 12px 0 0; font-size: 12px; color: var(--muted); line-height: 1.7; }
#sec-settings .settings-card,
#sec-announcements .settings-card { max-width: none; }
.announcement-tenant-picker { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafafa; }
.announcement-picker-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.announcement-picker-title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.announcement-picker-actions { display: flex; align-items: center; gap: 7px; }
.announcement-picker-actions span { font-size: 12px; color: var(--muted); }
.announcement-tenant-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; max-height: 180px; overflow: auto; }
.announcement-tenant-option { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 0; font-size: 13px; cursor: pointer; }
.announcement-tenant-option input { flex: none; margin: 0; }
.announcement-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.announcement-list-heading h3 { margin: 0; }
.announcement-list-filters { display: grid; grid-template-columns: minmax(160px, 1fr) 160px 210px auto; gap: 10px; margin-bottom: 12px; align-items: center; }
.announcement-batch-toggle { height: 38px; padding: 0 16px; box-sizing: border-box; }
.announcement-batch-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; font-size: 12.5px; color: var(--muted); }
.announcement-batch-actions { display: flex; gap: 8px; }
.announcement-batch-actions .mini { height: 30px; padding: 0 12px; font-size: 12px; }
.announcement-check { width: 15px; height: 15px; margin: 0 2px 0 0; accent-color: var(--orange); cursor: pointer; flex: 0 0 auto; }
.announcement-title { border: 0; background: none; padding: 0; margin: 0; font: inherit; font-weight: 600; color: inherit; text-align: left; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.announcement-title:hover { color: #e8590c; }
.announcement-list-filters input,
.announcement-list-filters select { width: 100%; min-width: 0; margin: 0; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 12.5px; }
.announcement-list-filters input:focus,
.announcement-list-filters select:focus { outline: none; border-color: var(--orange); }
.announcement-scope { margin-top: 5px; color: #b26b2d; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.announcement-row { display: block; }
.announcement-body {
  margin-top: 8px;
  color: #3f454e;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.announcement-body.expanded { display: block; -webkit-line-clamp: unset; overflow: visible; }
.announcement-toggle { margin-top: 6px; padding: 0; border: 0; background: none; color: #e8590c; font-size: 12.5px; cursor: pointer; }
.announcement-toggle:hover { color: #c94f09; text-decoration: underline; }
.announcement-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.announcement-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 12px; min-width: 0; }
.announcement-foot-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.announcement-scope-btn { border: 0; background: none; padding: 0; margin: 0; font: inherit; font-size: 12px; color: #b26b2d; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; text-align: left; overflow-wrap: anywhere; }
.announcement-scope-btn:hover { color: #8f4f16; }
.field-flash { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 106, 13, 0.18); transition: box-shadow .2s, border-color .2s; }
.announcement-meta .announcement-scope { margin-top: 0; }
.announcement-meta .row-meta { margin-top: 0; }
@media (max-width: 600px) {
  .announcement-tenant-options { grid-template-columns: 1fr; }
  .announcement-list-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .announcement-list-filters { grid-template-columns: 1fr; }
  .announcement-picker-actions { width: 100%; }
}
/* 获客参数：每个 Key 独立成卡片，左侧输入、右侧说明，避免整行超长输入框 */
#sec-settings .key-item {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(240px, 1fr);
  gap: 4px 28px;
  align-items: start;
  margin-bottom: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfc;
}
#sec-settings .key-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 9px; }
#sec-settings .key-head label { font-size: 13px; color: #4a5058; }
#sec-settings .key-head .key-status { margin: 0; padding: 3px 8px; border-radius: 6px; }
#sec-settings .key-main input { width: 100%; }
.key-tip { font-size: 12px; color: var(--muted); line-height: 1.7; }
.key-help { margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.key-help a { color: var(--orange); text-decoration: none; }
.key-help a:hover { text-decoration: underline; }
@media (max-width: 860px) {
  #sec-settings .key-item { grid-template-columns: 1fr; gap: 8px; }
}

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

.dialog {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.35);
}
.dialog-card {
  width: min(420px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  padding: 20px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}
.dialog-card h3 { margin: 0 0 8px; font-size: 16px; }
.dialog-card p { margin: 0 0 12px; font-size: 13px; line-height: 1.6; color: #5b6169; }
.dialog-card input { margin-top: 4px; }
.field-label { display: block; margin-top: 10px; font-size: 12px; color: var(--muted); }
.dialog-card .tip { margin-top: 8px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.create-help {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7f8fa;
  font-size: 12px;
  color: #5b6169;
}
.create-help summary {
  cursor: pointer;
  font-weight: 600;
  color: #343a42;
  list-style-position: inside;
}
.create-help[open] summary { margin-bottom: 4px; }
.create-help .field { margin-top: 8px; }
.create-help .field label { margin: 0 0 3px; font-size: 12px; }
.create-help .tip { margin-top: 0; font-size: 12px; line-height: 1.7; color: #6b7280; }
.create-help code { padding: 1px 4px; border-radius: 4px; background: #eceff3; font-size: 11px; word-break: break-all; }

.pwd-result {
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  background: #fff6ee;
  font-size: 13px;
  line-height: 1.8;
  word-break: break-all;
}
.pwd-result b { color: var(--orange-dark); }
.pwd-result .copy-line { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.pwd-once-tip { margin-top: 8px; font-size: 12px; line-height: 1.6; color: #a15b21; }

/* ---------- 提示 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 4000;
  max-width: min(460px, calc(100vw - 32px));
  padding: 10px 18px;
  border-radius: 8px;
  background: rgba(31, 35, 41, 0.9);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.loading { padding: 30px; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- 话术库 ---------- */

.script-row .row-main { flex: 1; }
.script-row .row-actions { flex: 0 0 auto; }
.script-content-preview { margin-top: 10px; color: #3f454e; font-size: 13px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.script-cat-select {
  height: 26px;
  padding: 0 16px 0 8px;
  border: 0;
  background: transparent url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2399a0a8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right center;
  color: inherit;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.script-cat-select:focus { outline: none; }
.script-edit-input {
  width: 100%;
  min-height: 84px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--orange);
  border-radius: 8px;
  outline: none;
  background: #fffdfb;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.75;
  resize: vertical;
}
.script-edit-input:focus { box-shadow: 0 0 0 2px rgba(255, 106, 13, .14); }
.script-foot-meta { margin-right: auto; color: #9aa1aa; font-size: 12px; }
.script-order-btn {
  padding: 0;
  border: 0;
  background: none;
  color: #8a919c;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.script-order-btn:hover { color: var(--orange-dark); }
.script-sort-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--orange);
  border-radius: 10px;
  background: #fff8f1;
}
.script-sort-bar > span { flex: 1; font-size: 13px; color: #b25400; }
.script-sort-bar .mini { margin-left: auto; }
.script-sort-bar .mini + .mini { margin-left: 0; }
.script-row-sort { cursor: grab; }
.script-row.dragging { opacity: .45; }

/* 卡片内 mini 按钮配色（保留兼容批量栏等场景） */
.mini.script-scope-btn { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-pick { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.scope-radio { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: #4a5058; cursor: pointer; }
.scope-summary { font-size: 12px; color: var(--muted); }
.scope-choice { display: flex; gap: 16px; margin-bottom: 12px; }
.tenant-check-items { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow-y: auto; padding: 6px 2px; }
.tenant-check-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #2b2f36; cursor: pointer; padding: 7px 10px; border-radius: 7px; }
.tenant-check-item:hover { background: #f5f6f8; }
.script-edit-card { width: min(560px, 100%); }
.script-content-input { min-height: 180px; }
.script-filter-bar {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfc;
}
.script-filter-bar input { flex: 1 1 220px; }
.script-filter-bar input:focus {
  border-color: var(--orange);
  outline: none;
}
.script-filter-bar select:focus {
  border-color: var(--orange);
  outline: 2px solid rgba(255, 106, 13, .18);
  outline-offset: -1px;
}

/* 话术卡片化 + 批量操作 */
.script-card-row {
  align-items: stretch;
  flex-direction: column;
  gap: 0;
  padding: 14px 16px;
  border: 1px solid #e9ebee;
  border-radius: 12px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.script-card-row:hover { border-color: #ffd9bf; box-shadow: 0 2px 8px rgba(255, 106, 13, .06); }
.script-card-row.is-selected { border-color: var(--orange); }
.script-card-left { flex: 0 0 auto; display: flex; align-items: flex-start; padding-top: 3px; }
.script-card-body { display: flex; gap: 12px; align-items: flex-start; }
.script-check { width: 16px; height: 16px; margin: 0; cursor: pointer; }
.script-drag-handle { font-size: 18px; line-height: 1; color: #c2c7cf; cursor: grab; user-select: none; }
.script-row-sort { cursor: grab; }
.script-row-sort.dragging { opacity: .4; }

.script-batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfc;
  transition: border-color .15s, background .15s;
}
.script-batch-bar.has-selection {
  border-color: #ffd9bf;
  background: linear-gradient(90deg, #fff8f1, #fff);
}
.script-batch-bar[hidden] { display: none; }
.script-batch-count { font-size: 12px; color: var(--muted); }
.script-batch-bar.has-selection .script-batch-count { font-size: 13px; font-weight: 600; color: #c45500; }
.script-batch-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.batch-bar-divider { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }

/* ---------- 操作记录 ---------- */
.oplog-overview { margin-bottom: 14px; }
.oplog-filter-bar { margin-bottom: 14px; }

.oplog-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.oplog-card:hover { border-color: #d9dde3; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }

.oplog-top { display: flex; align-items: center; gap: 10px; }
.oplog-action {
  display: inline-flex; align-items: center;
  height: 24px; padding: 0 10px;
  border-radius: 12px;
  font-size: 12px; font-weight: 600;
  background: #fff3e9; color: #c45500;
}
.oplog-action.op-red { background: #fff1f1; color: #c03535; }
.oplog-action.op-green { background: #f1faf5; color: #17864a; }
.oplog-action.op-orange { background: #fff3e9; color: #c45500; }
.oplog-action.op-gray { background: #f5f6f8; color: #5b6169; }

.oplog-actor {
  font-size: 13px; color: var(--muted);
  padding: 0 8px;
  background: var(--soft); border-radius: 10px;
  height: 22px; display: inline-flex; align-items: center;
}
.oplog-time { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }

.oplog-target { margin-top: 8px; font-size: 12px; color: var(--muted); }
.oplog-detail-summary {
  margin-top: 8px;
  font-size: 12px;
  color: #5b6169;
  background: var(--soft);
  border-radius: 6px;
  padding: 8px 10px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: none;
}
.oplog-detail-summary.oplog-detail-expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.operation-row .row-main { flex: 1; }
.operation-row .oplog-top { flex-wrap: wrap; }
.operation-row .oplog-detail-summary { display: block; overflow: visible; white-space: pre-wrap; overflow-wrap: anywhere; }
.announcement-card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(31, 35, 41, 0.05);
}
.announcement-title { margin: 0; font-size: 15px; line-height: 1.6; color: var(--text); }
.announcement-body { margin-top: 10px; font-size: 13px; line-height: 1.8; color: #4a5058; white-space: pre-wrap; overflow-wrap: anywhere; }
.announcement-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.announcement-toggle { flex: none; min-height: 28px; margin: 0; padding: 2px 0; border: 0; background: transparent; color: #c8752d; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.announcement-toggle:hover { text-decoration: underline; }
.announcement-time { display: block; margin: 0; font-size: 12px; color: var(--muted); }
/* ---------- 同步历史 ---------- */
.sync-summary-line {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.9;
}
.sync-summary-line b { color: var(--text); font-weight: 600; }

.dc-sync-history { border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.dc-sync-item {
  display: flex; gap: 12px; align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--soft);
  font-size: 13px;
}
.dc-sync-item:last-child { border-bottom: 0; }
.dc-sync-action {
  flex: 0 0 auto;
  padding: 2px 10px; height: 22px;
  border-radius: 10px;
  background: #fff3e9; color: #c45500;
  font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center;
}
.dc-sync-time { flex: 0 0 130px; font-size: 12px; color: var(--muted); }
.dc-sync-detail { flex: 0 1 auto; color: #5b6169; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-sync-result {
  flex: 1;
  min-width: 0;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-edit-card { width: min(620px, 100%); }
.category-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 44vh;
  margin-top: 10px;
  overflow-y: auto;
}
.category-row { display: flex; align-items: center; gap: 8px; }
.category-row input[type="text"] { flex: 1 1 auto; min-width: 0; margin-top: 0; }
.category-row input[type="number"] { flex: 0 0 88px; margin-top: 0; }
.category-row .category-count { flex: 0 0 auto; min-width: 46px; font-size: 12px; color: var(--muted); text-align: right; }
.category-add { display: flex; gap: 8px; margin-top: 12px; }
.category-add input[type="text"] { flex: 1 1 auto; min-width: 0; margin-top: 0; }
.category-add input[type="number"] { flex: 0 0 88px; margin-top: 0; }

/* ---------- 总部后台 ---------- */

.tenant-code { font-family: Consolas, Menlo, monospace; font-size: 13px; color: var(--orange-dark); }
.addr-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--soft);
  font-family: Consolas, Menlo, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #4a5058;
  cursor: pointer;
}
.addr-box:hover { background: #eceef1; }
.addr-url { flex: 1; min-width: 0; word-break: break-all; }
.addr-line { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.addr-line .addr-box { flex: 1; margin-top: 0; }
.addr-line > .label { flex: 0 0 auto; min-width: 84px; font-size: 12px; color: var(--muted); }
.addr-line > .label.wavy, .row-meta.wavy { text-decoration: underline dotted; text-underline-offset: 3px; }
.addr-line > .label.wavy:hover, .row-meta.wavy:hover { text-decoration: underline dotted; }

/* 企业二维码弹窗 */
.qr-card { width: min(640px, 94vw); padding: 26px 28px; }
.qr-preview { display: flex; align-items: center; justify-content: center; margin: 12px 0 16px; padding: 18px; background: #fff; border: 1px solid #eceef1; border-radius: 14px; }
.qr-preview-img { display: block; width: 100%; max-width: 240px; height: auto; image-rendering: pixelated; }
.qr-fail { margin: 0; color: #c0392b; text-align: center; font-size: 13px; }
.qr-field { margin-top: 22px; }
.qr-field > .label { display: block; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
.qr-field .addr-box { margin-top: 0; }
.qr-sizes { display: flex; flex-wrap: wrap; gap: 10px; }
.qr-sizes .mini { height: 34px; padding: 0 14px; border-radius: 8px; font-size: 12px; }
.qr-card .hint-text { margin-top: 16px; line-height: 1.85; }
code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--soft);
  font-family: Consolas, Menlo, monospace;
  font-size: 12px;
  color: #c45500;
}
/* ---------- 新建企业页 ---------- */

.nav a.nav-item { text-decoration: none; }
.create-head h1 { margin: 0; font-size: 22px; }
.create-head p { margin: 8px 0 20px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.create-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.create-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.create-card .grid2 .field { margin-bottom: 16px; }
.create-side .create-help { margin-top: 0; padding: 14px 16px; border: 1px solid var(--line); background: #fafbfc; }
.create-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.create-actions .mini { height: 38px; padding: 0 18px; border-radius: 9px; font-size: 13px; }
.create-actions .primary-btn {
  display: inline-flex;
  align-items: center;
  height: 38px;
  border-radius: 9px;
  font-size: 14px;
  text-decoration: none;
}
.create-done { max-width: 680px; margin: 0 auto; }
.create-done-card {
  padding: 22px;
  border: 1px solid #ffd9c2;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(255, 106, 13, 0.08);
}
.create-done-card h2 { margin: 0 0 6px; font-size: 18px; }
.create-done-sub { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.create-done-card .res-info {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 10px;
  background: #fff6ee;
  font-size: 13px;
  line-height: 1.8;
}
.create-done-card .res-info .label { color: #8a6b4d; }
.create-done-card .res-info b { color: var(--orange-dark); }
.create-done-card .addr-line { margin-top: 10px; }
.create-done-card .create-actions { justify-content: flex-start; flex-wrap: wrap; margin-top: 18px; }

/* ---------- 移动端 ---------- */

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side {
    flex: none;
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 900;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }
  .brand { flex: 0 0 auto; font-size: 15px; padding: 0; white-space: nowrap; }
  .brand span { display: none; }
  .side-tenant { display: none; }
  .nav { flex-direction: row; flex: 1; min-width: 0; margin: 0; gap: 2px; overflow-x: auto; }
  .nav-item { flex: 0 0 auto; height: 34px; padding: 0 10px; font-size: 13px; white-space: nowrap; gap: 5px; }
  .side-foot { margin: 0; flex-direction: row; align-items: center; gap: 6px; }
  .side-user { display: none; }
  .side-foot .row2 { gap: 6px; }

  .main { padding: 14px 12px 50px; }
  .sec-head h2 { font-size: 16px; }
  .row { flex-direction: column; align-items: stretch; gap: 10px; padding: 13px 14px; }
  .row-actions { justify-content: flex-start; }
  .appearance-body { grid-template-columns: 1fr; gap: 20px; }
  .appearance-preview { order: -1; }
  .phone-mock { width: 240px; height: 480px; }
  .log-row { flex-direction: row; }
  .grid2 { grid-template-columns: 1fr; }
  .dialog-actions { flex-wrap: wrap; }
  #sec-users .filter-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }
  #sec-users .filter-bar input {
    grid-column: 1 / -1;
    width: 100%;
    height: 38px;
  }
  #sec-users .filter-bar select { width: 100%; height: 38px; }
  #sec-users .user-batch-bar {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 10px;
    margin-bottom: 10px;
    padding: 8px 10px;
  }
  #sec-users .user-batch-bar #user-selected-count { align-self: center; justify-self: end; }
  #sec-users .user-batch-bar .batch-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    margin-left: 0;
  }
  #sec-users .user-batch-bar .batch-actions .mini {
    width: 100%;
    height: 32px;
    margin-left: 0;
    padding: 0 4px;
    font-size: 12px;
  }
  .operation-row .oplog-time { width: 100%; margin-left: 0; }

  .create-head h1 { font-size: 19px; }
  .create-layout { grid-template-columns: 1fr; }
  .create-card { padding: 16px; }
  .create-actions { flex-wrap: wrap; }
}

/* ---------- 数据中心 ---------- */
#sec-datacenter .settings-card { max-width: none; }
/* 卡片之间拉开呼吸感，避免上下挤在一起 */
#sec-datacenter .settings-card + .settings-card { margin-top: 22px; }
#sec-datacenter .settings-group h3 { margin: 0 0 18px; }
#sec-datacenter .field { margin-bottom: 18px; }
#sec-datacenter .field > label { margin-bottom: 9px; }
#sec-datacenter .grid3, #sec-datacenter .grid4 { gap: 18px; }
#sec-datacenter .grid2 { gap: 18px; }
#sec-datacenter .action-row { margin: 12px 0 14px; }
#sec-datacenter .grid3 + .grid4 { margin-top: 2px; }
#sec-datacenter .table-wrap { margin-top: 4px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.action-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 10px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 10px; }
.radio-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 13px; background: #fff; }
.radio-pill input { margin: 0; }
.radio-pill:has(input:checked) { border-color: var(--orange); font-weight: 600; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #4a5058; cursor: pointer; }
.check-line input { margin: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-card { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, #fffaf6, #fff); text-align: center; }
.stat-num { font-size: 26px; font-weight: 700; color: #ff6a2a; line-height: 1.2; }
.stat-label { margin-top: 4px; font-size: 12px; color: var(--muted); }
.stats-grid .stat-card.clickable { cursor: pointer; font-family: inherit; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.stats-grid .stat-card.clickable:hover { border-color: #ffc49f; box-shadow: 0 4px 14px rgba(255, 106, 13, .08); transform: translateY(-1px); }
.stats-grid .stat-card.clickable:focus-visible { outline: 2px solid rgba(255, 106, 13, .28); outline-offset: 2px; }

/* ---------- 总部经营看板 ---------- */
.dashboard-page { width: 100%; min-width: 0; }
.dashboard-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.overview-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.overview-stats .stat-card {
  min-width: 0;
  padding: 17px 16px 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.overview-stats .stat-card:hover { border-color: #ffc49f; box-shadow: 0 4px 14px rgba(255, 106, 13, .08); transform: translateY(-1px); }
.overview-stats .stat-card:focus-visible { outline: 2px solid rgba(255, 106, 13, .28); outline-offset: 2px; }
.overview-stats .stat-card.has-pending { border-color: #ffd0ad; background: #fffaf6; }
.overview-stats .stat-num { font-size: 29px; }
.overview-stats .stat-label { margin-top: 6px; color: #4a5058; }
.overview-stats .stat-foot { margin-top: 11px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 16px; margin-bottom: 16px; }
.dashboard-panel { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.dashboard-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.dashboard-panel-head h3 { margin: 0; font-size: 15px; }
.dashboard-panel-head > .muted { font-size: 11px; font-weight: 400; }
.text-btn { padding: 0; border: 0; background: none; color: var(--orange); font-size: 12px; cursor: pointer; }
.text-btn:hover { text-decoration: underline; }
.trend-legend { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11px; }
.trend-legend span { display: inline-flex; align-items: center; gap: 5px; }
.trend-legend i { width: 8px; height: 8px; border-radius: 2px; }
.trend-legend i.collect { background: #ffc7a5; }
.trend-legend i.lead { background: var(--orange); }
.trend-chart { min-height: 205px; }
.trend-columns { display: grid; grid-template-columns: repeat(14, minmax(16px, 1fr)); gap: 5px; height: 205px; padding: 8px 4px 0; }
.trend-day { display: grid; grid-template-rows: 148px 20px 18px; min-width: 0; text-align: center; }
.trend-bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 148px; border-bottom: 1px solid #edf0f3; }
.trend-bar { width: 8px; min-height: 2px; border-radius: 3px 3px 0 0; }
.trend-bar.collect { background: #ffc7a5; }
.trend-bar.lead { background: var(--orange); }
.trend-value { align-self: center; color: #5b6169; font-size: 10px; }
.trend-date { color: var(--muted); font-size: 10px; white-space: nowrap; }
.overview-recent { min-width: 0; }
.recent-item { display: block; width: 100%; padding: 10px 4px; border: 0; border-bottom: 1px solid #f0f1f4; background: none; color: inherit; font-family: inherit; text-align: left; cursor: pointer; }
.recent-item:last-child { border-bottom: 0; }
.recent-item:hover { background: #fffaf6; }
.recent-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.recent-keyword { flex: 1; min-width: 0; overflow: hidden; color: #252a31; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.recent-count { flex: 0 0 auto; color: var(--orange); font-size: 12px; font-weight: 600; }
.recent-meta { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.overview-table th button { padding: 0; border: 0; background: none; color: inherit; font: inherit; white-space: nowrap; cursor: pointer; }
.overview-table th button:hover, .overview-table th button.active { color: var(--orange); }
.table-link { padding: 0; border: 0; background: none; color: #c45500; font: inherit; cursor: pointer; }
.table-link:hover { text-decoration: underline; }
.overview-actions { display: flex; gap: 6px; white-space: nowrap; }
.overview-actions .mini { height: 28px; padding: 0 9px; font-size: 11px; }
.overview-tenant-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1280px) {
  .overview-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .dashboard-meta { align-items: flex-start; flex-direction: column; gap: 4px; }
  .overview-stats { gap: 9px; }
  .dashboard-panel { padding: 14px; }
  .dashboard-panel-head { align-items: flex-start; flex-wrap: wrap; }
  .trend-columns { gap: 3px; }
  .trend-bar { width: 6px; }
}
@media (max-width: 520px) {
  .overview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-stats .stat-card { padding: 13px 12px 11px; }
  .overview-stats .stat-num { font-size: 25px; }
  .trend-legend { width: 100%; }
  .trend-date { font-size: 9px; }
}

.dc-sync-status { padding: 10px 12px; border-radius: 8px; background: var(--soft); font-size: 12px; color: #5b6169; }
.dc-sync-status.running { background: #e8f4ff; color: #1769c2; }
.dc-sync-status.error { background: #ffecec; color: #c0392b; }

/* 调度器控件 */
.schedule-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; background: var(--soft); border-radius: 10px; border: 1px solid var(--line); }
.schedule-row select { padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; background: #fff; min-width: 140px; }
.schedule-time-row { display: inline-flex; align-items: center; gap: 4px; }
.schedule-time-row input { width: 50px; text-align: center; padding: 5px 6px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; }
.schedule-time-row .muted { font-size: 13px; }
.schedule-weekdays { display: inline-flex; gap: 6px; align-items: center; }
.schedule-weekdays .wd { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; }
.schedule-weekdays .wd input { width: 14px; height: 14px; }
.schedule-interval-row { display: inline-flex; align-items: center; gap: 6px; }
.schedule-interval-row input { width: 70px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; text-align: center; }
.schedule-interval-row .muted { font-size: 13px; }

/* 随机按钮 */
.mini.tiny { padding: 1px 8px; font-size: 11px; line-height: 1.8; border: 1px solid var(--line); border-radius: 6px; background: #faf7f4; color: #4a5058; cursor: pointer; }
.mini.tiny:hover { background: #fff0e6; border-color: var(--orange); color: var(--orange); }
.field label .mini.tiny { margin-left: 8px; vertical-align: middle; }

/* grid4 四列网格 */
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* 下拉筛选 select 样式统一 */
#sec-datacenter select { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: #fff; box-sizing: border-box; }
#sec-datacenter input[type="date"],
#sec-datacenter input[type="number"],
#sec-datacenter input[type="text"] { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }

/* 筛选区：不占上方标签，提示直接内联在输入框里 */
#sec-datacenter .prefix-field { position: relative; }
#sec-datacenter .prefix-field::before {
  content: attr(data-prefix);
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--muted);
  pointer-events: none;
  z-index: 1;
}
#sec-datacenter .prefix-field input[type="date"] { padding-left: 68px; }

/* 同步触发模式：同一行 + 所有控件高度强制一致（32px） */
#sec-datacenter .schedule-row { display: flex; flex-wrap: nowrap !important; align-items: center; gap: 12px; min-height: 32px; }
/* 关键：display 覆盖会让 hidden 属性失效，这里补回隐藏逻辑 */
#sec-datacenter .schedule-row [hidden] { display: none !important; }
#sec-datacenter .schedule-row select,
#sec-datacenter .schedule-row input[type="number"] {
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  box-sizing: border-box;
  font-size: 13px;
}
#sec-datacenter .schedule-row select { width: auto; min-width: 126px; padding-left: 10px !important; padding-right: 10px !important; line-height: 30px; }
#sec-datacenter .schedule-row input[type="number"] { width: 56px; padding-left: 6px !important; padding-right: 6px !important; text-align: center; }
#sec-datacenter .schedule-interval-row input[type="number"] { width: 72px; }
#sec-datacenter .schedule-time-row,
#sec-datacenter .schedule-interval-row {
  display: inline-flex;
  align-items: center;
  height: 32px;
  gap: 4px;
}
#sec-datacenter .schedule-weekdays { display: inline-flex; align-items: stretch; gap: 6px; height: 32px; flex-shrink: 0; }
#sec-datacenter .schedule-weekdays .wd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  align-self: center;
  margin: 0 !important;
  padding: 0 8px !important;
  line-height: 1;
  box-sizing: border-box;
  font-size: 12px;
  vertical-align: middle;
}
#sec-datacenter .schedule-weekdays .wd input {
  width: 14px !important;
  height: 14px !important;
  margin: 0 !important;
  top: 0;
  vertical-align: middle;
  flex: 0 0 auto;
}

@media (max-width: 720px) {
  /* 小屏幕也不换行，改为整行横向滚动，保证控件始终在同一行等高 */
  #sec-datacenter .schedule-row { flex-wrap: nowrap; overflow-x: auto; }
}

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th, .data-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table th { background: #faf7f4; color: #4a5058; white-space: nowrap; }
.data-table tbody tr:hover { background: #fffaf6; }
.data-table .empty-row { text-align: center; color: var(--muted); padding: 30px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; font-size: 12px; flex-wrap: wrap; }
.pager-total { color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.pager .mini { height: 32px; padding: 0 10px; border-radius: 6px; font-size: 12px; font-weight: 400; }
.pager-size { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.pager-size select {
  width: auto !important;
  min-width: 92px;
  flex: 0 0 auto;
  height: 32px !important; padding: 0 6px !important;
  border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--text);
  font-size: 12px; font-family: inherit; cursor: pointer;
}
.pager-jump { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.pager-input {
  width: 64px !important;
  flex: 0 0 auto;
  height: 32px !important; padding: 0 6px !important;
  border: 1px solid var(--line); border-radius: 6px;
  text-align: center; font-size: 12px; font-family: inherit;
  color: var(--text); box-sizing: border-box;
}
.pager-input:focus { outline: none; border-color: #c9cdd4; }
#sec-datacenter textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-family: inherit; resize: vertical; }
#dc-cities, #dc-keywords { min-height: 180px; }

@media (max-width: 720px) {
  .grid3, .stats-grid, .grid4 { grid-template-columns: 1fr 1fr; }
}

/* 全局复选框 / 单选框：仅橙色描边，不做实心填充 */
input[type="checkbox"], input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  width: 16px;
  height: 16px;
  background: #fff;
  border: 1.5px solid #cbd0d8;
  cursor: pointer;
  vertical-align: middle;
  position: relative;
  flex: 0 0 auto;
}
input[type="checkbox"] { border-radius: 4px; }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:checked, input[type="radio"]:checked { border-color: var(--orange); background: #fff; }
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid var(--orange);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  transform: translate(-50%, -50%);
}
