/* ============================================================
   站点管理后台 · 样式
   ============================================================ */

:root {
  /* 对齐 geo-console 参考设计体系：
     画布 #F5F7FB / 卡片白 + 1px #E8EDF5 边框 / 主色 #1A73E8 / 软色徽章 / Inter 数字 */
  --brand: #1a73e8;
  --brand-2: #4c93f0;
  --brand-soft: #eaf1fe;
  --brand-line: #c6dbfa;
  --brand-ink: #1257a8;          /* 软色底上的深色文字 */

  --ink: #171a1f;
  --ink-2: #5a6472;
  --ink-3: #98a2b3;

  --line: #e8edf5;
  --bg: #f5f7fb;
  --card: #fff;

  /* 输入控件边框专用色：与白底对比 ≥3:1（WCAG 2.1 SC 1.4.11 非文本对比度） */
  --input-line: #8591a3;        /* 默认态，对白底约 3.2:1 */
  --input-line-hover: #6b7688;  /* 悬停态，约 4.7:1 */
  --input-placeholder: #667085; /* 占位文字，约 4.8:1 */

  --ok: #12a150;
  --ok-soft: #e9f7ef;
  --warn: #c77e1b;
  --warn-soft: #fdf4e4;
  --danger: #d93a3f;
  --danger-soft: #fdecec;
  --info: #1a73e8;
  --info-soft: #eaf1fe;
  --neutral-soft: #f1f3f8;
  --head-bg: #f7f9fc;

  --radius: 10px;
  --radius-sm: 8px;
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei",
          -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-num: "Inter", "Noto Sans SC", -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 1px 2px rgba(23, 26, 31, .04), 0 8px 24px -14px rgba(23, 26, 31, .14);
  --shadow-lg: 0 24px 60px -20px rgba(23, 26, 31, .3);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }

/* ==================== 通用控件 ==================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: .16s;
  white-space: nowrap;
}

.btn:hover { border-color: var(--brand-line); color: var(--brand); background: #fbfdff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(26, 115, 232, .55);
}
.btn-primary:hover { background: #1557b0; color: #fff; border-color: #1557b0; }

.btn-warn { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn-warn:hover { background: #c97a06; border-color: #c97a06; color: #fff; }

.btn-danger { color: var(--danger); border-color: #f5c9c5; background: #fff; }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); border-color: #eeb3ae; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; border-color: transparent; }

.btn-sm { height: 30px; padding: 0 11px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; }

.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}
.field .hint { font-weight: 400; color: var(--ink-3); font-size: 12px; margin-left: 6px; }

/* 统一输入基线：按 class 与 type 双重命中，覆盖 <input class="ipt"> 未写 type 的写法 */
input[type=text], input[type=password], input[type=number], input[type=search], input[type=datetime-local],
input.ipt, select, select.ipt, textarea, textarea.ipt {
  width: 100%;
  box-sizing: border-box;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--input-line);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 13px;
  line-height: 1.5;
  outline: none;
  transition: .16s;
}
textarea, textarea.ipt { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; line-height: 1.6; }

/* 悬停进一步加深边框，聚焦时用品牌色 + 双重描边，确保键盘/弱视用户清晰定位 */
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) {
  border-color: var(--input-line-hover);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(26, 115, 232, .28);
}
input::placeholder, textarea::placeholder { color: var(--input-placeholder); opacity: 1; }
select { cursor: pointer; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2398a2b3'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 18px;
  padding-right: 30px;
}

/* ==================== 登录页（参考 geo-console 浅色体系） ==================== */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(820px 460px at 10% -8%, rgba(26, 115, 232, .07), transparent 60%),
    radial-gradient(680px 420px at 96% 108%, rgba(76, 147, 240, .08), transparent 60%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 396px;
  padding: 36px 34px 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: pop .32s cubic-bezier(.2, .9, .3, 1.2);
}

@keyframes pop {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.login-head { text-align: center; margin-bottom: 26px; }

.login-logo {
  width: 48px; height: 48px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--brand-2), var(--brand));
  color: #fff; font-weight: 800; font-size: 16px; letter-spacing: .5px;
  white-space: nowrap; overflow: hidden;
  box-shadow: 0 10px 22px -10px rgba(26, 115, 232, .7);
}

.login-head h1 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: .3px; color: var(--ink); }
.login-sub { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-3); }

.captcha-row { display: flex; gap: 10px; }
.captcha-row input { flex: 1; min-width: 0; }
.captcha-row img {
  width: 116px; height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  object-fit: cover;
  background: #f7f9fc;
  flex: none;
}

.login-err {
  min-height: 20px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--danger);
  text-align: center;
}

.login-foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
}

/* ==================== 布局 ==================== */

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-right: 1px solid var(--line);
  color: var(--ink-2);
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid var(--line);
}

.brand-logo {
  width: 36px; height: 36px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--brand-2), var(--brand));
  color: #fff; font-size: 12.5px; font-weight: 800;
  white-space: nowrap; overflow: hidden;
}

.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text b { color: var(--ink); font-size: 14px; }
.brand-text span {
  font-size: 11.5px; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.nav { flex: 1; padding: 8px 10px; overflow-y: auto; }
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 35px;
  padding: 0 11px;
  margin-bottom: 2px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--ink-2);
  transition: .15s;
}
.nav a svg { width: 17px; height: 17px; fill: currentColor; opacity: .8; flex: none; }
.nav a:hover { background: #f2f5fa; color: var(--ink); }
.nav a.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 500;
}

.sidebar-foot { padding: 10px 14px; border-top: 1px solid var(--line); }
.side-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar {
  width: 33px; height: 33px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--brand-2), var(--brand));
  color: #fff; font-size: 13px; font-weight: 700;
}
.side-user-info { min-width: 0; display: flex; flex-direction: column; }
.side-user-info b {
  color: var(--ink); font-size: 13px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-user-info span { font-size: 11.5px; color: var(--ink-3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 26px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-left h2 { margin: 0; font-size: 17px; font-weight: 700; }
.page-desc { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-3); }

.site-picker { display: flex; align-items: center; gap: 9px; }
  .sp-label { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
  .sp-tag {
    font-size: 11.5px;
    color: #fff;
    background: var(--brand);
    padding: 2px 8px;
    border-radius: 9px;
    letter-spacing: .3px;
    white-space: nowrap;
  }
  .sp-tag[hidden] { display: none !important; }
  .site-picker select { width: auto; min-width: 224px; max-width: 320px; height: 34px; }

  /* 站点板块右上端「当前客户」可点击标签 */
  .sp-tag-clickable {
    cursor: pointer;
    user-select: none;
    outline: none;
    transition: filter .15s ease, transform .12s ease;
  }
  .sp-tag-clickable:hover { filter: brightness(1.08); }
  .sp-tag-clickable:active { transform: scale(0.97); }
  .sp-tag-clickable:focus-visible { box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.25); }
  .sp-tag.muted {
    background: transparent;
    color: #94a3b8;
    border: 1px dashed #cbd5e1;
  }
  .sp-tag.muted:hover { color: #475569; border-color: #94a3b8; }

  /* 客户切换弹层 */
  .cust-popover {
    position: fixed;
    z-index: 1000;
    width: 320px;
    max-width: calc(100vw - 24px);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.06);
    padding: 6px;
    animation: pop .18s ease-out;
  }
  .cust-popover[hidden] { display: none !important; }
  @keyframes pop {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .cust-popover-head {
    font-size: 11.5px;
    color: #64748b;
    padding: 6px 10px 4px;
    letter-spacing: .3px;
    text-transform: uppercase;
  }
  .cust-popover-list {
    max-height: 320px;
    overflow-y: auto;
  }
  .cust-popover-item {
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: background .12s ease, color .12s ease;
  }
  .cust-popover-item:hover { background: #f1f5f9; }
  .cust-popover-item.on {
    background: var(--brand-soft);
    color: var(--brand);
  }
  .cust-popover-item b {
    font-size: 13.5px;
    font-weight: 600;
    color: inherit;
  }
  .cust-popover-item span {
    font-size: 12px;
    color: #64748b;
  }
  .cust-popover-item.on span { color: var(--brand-2); }
  .cust-popover-empty {
    padding: 18px 12px;
    color: #94a3b8;
    text-align: center;
    font-size: 12.5px;
  }
  .cust-search {
    width: 100%;
    margin-top: 6px;
    height: 30px;
    font-size: 12.5px;
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-transform: none;
    letter-spacing: normal;
  }
  .cust-popover-foot {
    padding: 6px 10px 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid #f1f5f9;
  }
  .cust-foot-total { font-size: 12px; color: #94a3b8; }
  .cust-foot-more { font-size: 12px; padding: 3px 10px; }
  .cust-foot-load { font-size: 12px; color: #94a3b8; padding: 2px 0; }
  .cust-pop-foot { padding: 4px 2px 2px; text-align: center; }

  /* 新建分站：客户可搜索 combobox */
  .combo { position: relative; }
  .combo-pop {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.06);
    max-height: 300px;
    overflow-y: auto;
    z-index: 60;
    padding: 6px;
  }
  .combo-pop[hidden] { display: none !important; }
  .combo-pop .cust-popover-item { padding: 8px 10px; }

.pwd-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 26px 0;
  padding: 11px 16px;
  border: 1px solid #f2ddb6;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: #8a5a09;
  font-size: 13px;
}

.page { flex: 1; padding: 22px 26px 40px; }

/* ==================== 卡片 / 栅格 ==================== */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.card-head,
.card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  font-size: 14.5px;
  font-weight: 650;
  color: var(--ink);
}
.card-head h3,
.card-h h3 { margin: 0; font-size: 14.5px; font-weight: 650; }
.card-head .sub,
.card-h .sub { font-size: 12.5px; color: var(--ink-3); font-weight: 400; margin-left: 8px; }
.card-body,
.card-b { padding: 16px 18px 18px; }

/* ============ KPI 卡片组（概览看板） ============ */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.kpis.small { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 0; }
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  position: relative;
  transition: transform .15s, box-shadow .15s;
  cursor: default;
}
.kpi[data-kpi] { cursor: pointer; }
.kpi[data-kpi]:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(15, 23, 42, .08); }
.kpi.kpi-sm { padding: 10px 12px; }
.kpi .label { font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; }
.kpi .value { font-family: var(--font-num); font-size: 22px; font-weight: 650; color: var(--ink); line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi.kpi-sm .value { font-size: 18px; }
.kpi .sub { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }
.kpi .sub b { color: var(--ink-2); font-weight: 600; }

/* 通用 KPI 子样式（供其他模块引用） */
.kpi-sm { padding: 10px 12px; }
.label { font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; }
.value { font-size: 22px; font-weight: 650; color: var(--ink); line-height: 1.15; font-variant-numeric: tabular-nums; }
.sub { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }
.sub b { color: var(--ink-2); font-weight: 600; }

/* ============ 概览网格 ============ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
@media (max-width: 980px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ============ 时间筛选工具栏 ============ */
.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.days { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); }
.days .day {
  padding: 6px 12px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  font-size: 12.5px;
  border-right: 1px solid var(--line);
  transition: background .15s, color .15s;
}
.days .day:last-child { border-right: 0; }
.days .day:hover { background: #f5f8fc; color: var(--brand); }
.days .day.on { background: var(--brand-soft); color: var(--brand); font-weight: 500; }
.days .day.on:hover { background: #dce9fd; color: var(--brand); }

/* ============ 图例 ============ */
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; font-size: 12.5px; color: var(--ink-2); }
.legend i {
  display: inline-block;
  width: 12px;
  height: 4px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}

/* ============ 图表 ============ */
.chart-wrap { padding: 4px 2px 0; }
.chart { display: block; width: 100%; height: 220px; }
.chart .grid { stroke: #eef1f6; stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 10.5px; font-family: inherit; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt { stroke: #fff; stroke-width: 1.5; }

/* ============ AI 渠道 pill ============ */
.ai-pill {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 12px;
}
.ai-pill b { font-weight: 650; margin-left: 4px; }

/* ============ 简洁表格（看板内部用） ============ */
.tb-clean {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tb-clean th, .tb-clean td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.tb-clean th { font-weight: 550; color: var(--ink-3); font-size: 12px; }
.tb-clean tr:last-child td { border-bottom: 0; }

/* ============ 空数据 ============ */
.empty { padding: 28px 12px; text-align: center; color: var(--ink-3); font-size: 13px; }
.empty p { margin: 0; }
.empty a { color: var(--brand); text-decoration: none; }
.empty a:hover { text-decoration: underline; }

/* ============ 分区提示 ============ */
.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  margin-bottom: 12px;
  border-bottom: 1px dashed var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
}
.section-bar .text-muted { color: var(--ink-3); }

/* ============ KV 定义列表 ============ */
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 16px; margin: 0; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ============ 文本辅助 ============ */
.text-muted { color: var(--ink-3); }
.text-c { text-align: center; }

/* ============ 表格包裹 / 过滤栏 / 搜索 / 行内链接按钮 / 对话框 ============ */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: var(--shadow);
}
.filter-bar .search-input {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  min-width: 200px;
}
.filter-bar .search-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, .12);
}
.filter-bar select,
.filter-bar input[type="number"] {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
  color: var(--ink);
}
.filter-bar label { font-size: 12.5px; color: var(--ink-3); }
.filter-bar .spacer { flex: 1; }
.tb .link,
.link {
  display: inline-block;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 4px;
  margin: 0 2px;
  border-radius: 4px;
  transition: background .15s, color .15s;
  font-family: inherit;
}
.tb .link:hover,
.link:hover { background: rgba(26, 115, 232, .08); color: var(--brand-2); }
.tb .link.danger,
.link.danger { color: var(--danger); }
.tb .link.danger:hover,
.link.danger:hover { background: rgba(220, 38, 38, .08); }
.tb .link.warn,
.link.warn { color: var(--warn); }
.tb .link.warn:hover,
.link.warn:hover { background: rgba(224, 135, 10, .1); }

/* 通用间距工具 */
.mb-16 { margin-bottom: 16px; }

/* ============ 字体图标（占位，引用现有 iconfont） ============ */
[class^="i-"], [class*=" i-"] {
  display: inline-block;
  font-family: 'iconfont', sans-serif;
  font-style: normal;
  font-size: 14px;
  line-height: 1;
  vertical-align: middle;
}
.i-search::before { content: '\e8ef'; }
.i-add::before { content: '\e8fe'; }
.i-del::before { content: '\e8da'; }
.i-edit::before { content: '\e820'; }
.i-eye::before { content: '\e8ea'; }
.i-up::before { content: '\e8d6'; }
.i-down::before { content: '\e8d7'; }

/* ============ 行操作 ============ */
.row-actions { display: inline-flex; gap: 2px; flex-wrap: wrap; }
.row-actions .link { padding: 2px 6px; }

/* ============ 分页 ============ */
.pg {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px; padding: 6px 4px;
  font-size: 12.5px; color: var(--ink-3);
}
.pg .pg-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 28px; min-width: 28px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--ink-2);
  cursor: pointer; font-size: 12px; font-family: inherit;
  transition: border-color .15s, color .15s, background .15s;
}
.pg .pg-btn:hover { border-color: var(--brand-line); color: var(--brand); }
.pg .pg-btn.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.pg .pg-btn:disabled { opacity: .5; cursor: not-allowed; }
.pg .pg-jump input {
  width: 50px; height: 28px; padding: 0 6px;
  border: 1px solid var(--line); border-radius: 6px; font-size: 12px; text-align: center;
}

/* ============ 表单 ============ */
.form { display: grid; grid-template-columns: 1fr; gap: 14px; }
.form-lbl {
  display: block;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-bottom: 6px;
  font-weight: 550;
}
.req { color: var(--danger); margin-left: 2px; }
.form .narrow { display: inline-block; min-width: 80px; }

/* ============ 模板预览卡片 ============ */
.tpl-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.tpl-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(15, 23, 42, .08); border-color: var(--brand-line); }
.tpl-cover {
  height: 100px;
  background: linear-gradient(135deg, #eaf1fe, #f1f5fb);
  display: flex; align-items: center; justify-content: center;
  color: #6b7280; font-size: 12.5px; letter-spacing: .5px;
  border-bottom: 1px solid var(--line);
}
.tpl-sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* ============ 站点行内 ============ */
.site-name { font-weight: 550; color: var(--ink); }
.site-domain { font-size: 11.5px; color: var(--ink-3); }

/* ============ 下拉 / 选择 ============ */
.sel, .m-sel {
  width: 100%; height: 34px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 7px;
  background: #fff; font-size: 13px; color: var(--ink);
  outline: none;
}
.sel:focus, .m-sel:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(26, 115, 232, .12); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat {
  position: relative;
  padding: 17px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--brand-2);
  opacity: .9;
}
.stat.is-ok::after { background: var(--ok); }
.stat.is-warn::after { background: var(--warn); }
.stat.is-info::after { background: var(--info); }

.stat-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px;
}
.stat-value { font-family: var(--font-num); font-size: 26px; font-weight: 650; letter-spacing: -.4px; line-height: 1.15; }
.stat-value small { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 3px; }
.stat-foot { margin-top: 7px; font-size: 12px; color: var(--ink-3); }

.cols-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 18px;
}

/* ==================== 表格 ==================== */

.table-scroll { overflow-x: auto; }

.tb { font-size: 13px; }
.tb th {
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--head-bg);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tb td {
  padding: 13px 14px;
  border-bottom: 1px solid #f0f3f8;
  vertical-align: middle;
}
.tb tbody tr:last-child td { border-bottom: 0; }
.tb tbody tr:hover { background: #fafcff; }
.tb .num { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.tb .actions { display: flex; gap: 6px; flex-wrap: wrap; }

.site-cell { display: flex; flex-direction: column; gap: 2px; min-width: 190px; }
.site-cell b { font-weight: 600; }
.site-cell span {
  font-size: 11.5px; color: var(--ink-3);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ==================== 徽标 ==================== */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.tag::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor;
}
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-off { background: #f0f2f6; color: var(--ink-2); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-danger { background: var(--danger-soft); color: var(--danger); }
.tag-info { background: var(--info-soft); color: var(--info); }

.chip {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 6px;
  background: #f2f5fa;
  color: var(--ink-2);
  font-size: 12px;
}

/* ==================== 工具条 / 分页 ==================== */

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.toolbar .grow { flex: 1; }
.toolbar .search { position: relative; width: 250px; }
.toolbar .search input { height: 34px; }
.toolbar select { height: 34px; width: auto; min-width: 118px; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
  flex-wrap: wrap;
}
.pager { display: flex; align-items: center; gap: 6px; }
.pager button {
  min-width: 31px; height: 31px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 12.5px;
  cursor: pointer;
  transition: .16s;
}
.pager button:hover:not(:disabled) { border-color: var(--brand-line); color: var(--brand); }
.pager button.active {
  background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600;
}
.pager button:disabled { opacity: .45; cursor: not-allowed; }

/* ==================== 创建站点 ==================== */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0 18px;
}
.form-grid .span-all { grid-column: 1 / -1; }

.cascade { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 860px) { .cascade { grid-template-columns: 1fr; } }

.tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(216px, 1fr));
  gap: 12px;
}

/* ================ 模板可视化预览 ================ */
.tpl-preview-link { font-size: 12px; padding: 0; vertical-align: 1px; }
.tpl-preview-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.tpl-preview-group { display: flex; gap: 6px; flex-wrap: wrap; }
.tpl-preview-group .btn.on {
  border-color: var(--brand);
  color: var(--brand);
  background: rgba(26, 115, 232, .06);
}
.tpl-preview-frame {
  position: relative;
  height: 68vh;
  background: #eef1f6;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.tpl-preview-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #fff;
}
.tpl-preview-frame.mobile .tpl-preview-iframe {
  width: 390px;
  margin: 0 auto;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .12);
}


.tpl {
  position: relative;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: .16s;
  background: #fff;
}
.tpl:hover { border-color: var(--brand-line); transform: translateY(-1px); box-shadow: var(--shadow); }
.tpl.on { border-color: var(--brand-2); background: #f7fbff; box-shadow: 0 0 0 3px rgba(26, 115, 232, .1); }
.tpl.on::after {
  content: "✓";
  position: absolute; top: 9px; right: 11px;
  color: var(--brand-2); font-weight: 800; font-size: 13px;
}
.tpl-name { font-weight: 650; font-size: 13.5px; margin-bottom: 4px; padding-right: 20px; }
.tpl-desc { font-size: 11.5px; color: var(--ink-3); line-height: 1.5; min-height: 34px; }
.tpl-swatches { display: flex; gap: 5px; margin-top: 9px; align-items: center; }
.swatch { width: 15px; height: 15px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, .08); }
.tpl-meta { margin-left: auto; font-size: 11px; color: var(--ink-3); }

.switch-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: .16s;
  background: #fff;
}
.switch-row:hover { border-color: var(--brand-line); }
.switch-row input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--brand); flex: none; cursor: pointer; }
.switch-text b { display: block; font-size: 13px; font-weight: 600; }
.switch-text span { font-size: 11.5px; color: var(--ink-3); }

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  background: #fafbfe;
  border-radius: 0 0 var(--radius) var(--radius);
}

.summary-box {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  font-size: 12.5px;
  color: #1257a8;
  line-height: 1.8;
}
.summary-box b { color: var(--brand); }

/* ==================== 空态 / 加载 ==================== */

.empty { padding: 56px 20px; text-align: center; color: var(--ink-3); }
.empty .big { font-size: 30px; opacity: .3; margin-bottom: 8px; }
.empty p { margin: 0 0 14px; font-size: 13px; }

.spinner {
  display: inline-block;
  width: 15px; height: 15px;
  border: 2px solid var(--brand-line);
  border-top-color: var(--brand-2);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-box { padding: 60px; text-align: center; color: var(--ink-3); }

.skeleton {
  height: 13px;
  border-radius: 6px;
  background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 37%, #eef1f6 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ==================== Toast ==================== */

.toast-host {
  position: fixed;
  top: 20px; left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: center;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 460px;
  padding: 10px 17px;
  border-radius: 10px;
  background: #1c2942;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 14px 34px -12px rgba(10, 20, 40, .7);
  animation: toastIn .24s ease;
}
.toast.out { animation: toastOut .2s ease forwards; }
.toast-ok { background: #0f7a3d; }
.toast-err { background: #b42318; }
.toast-warn { background: #a8690a; }

@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

/* ==================== Modal ==================== */

.modal-host {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(12, 22, 40, .5);
  backdrop-filter: blur(2px);
}
.modal-host.on { display: flex; }

.modal {
  width: 100%;
  max-width: 480px;
  max-height: 86vh;
  overflow: auto;
  background: #fff;
  border-radius: 15px;
  box-shadow: var(--shadow-lg);
  animation: pop .22s cubic-bezier(.2, .9, .3, 1.2);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 650; }
.modal-close {
  width: 28px; height: 28px;
  border: 0; border-radius: 7px;
  background: #f3f5f9; color: var(--ink-2);
  font-size: 17px; line-height: 1; cursor: pointer;
}
.modal-close:hover { background: #e7ebf2; color: var(--ink); }
.modal-body { padding: 20px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 9px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #fafbfe;
  border-radius: 0 0 15px 15px;
}

/* ---- 右侧全屏抽屉变体（客户编辑） ---- */

.modal-host.drawer {
  justify-content: flex-end;
  padding: 0;
}

.modal-host.drawer .modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  border-radius: 0;
  overflow: hidden;
  animation: drawerIn .26s cubic-bezier(.22, .8, .3, 1);
}
.modal-host.drawer .modal-head { flex: none; padding: 18px 28px; }
.modal-host.drawer .modal-body { flex: 1; min-height: 0; overflow: auto; padding: 22px 28px; }
.modal-host.drawer .modal-foot { flex: none; padding: 14px 28px; border-radius: 0; }
/* 表单类内容限制阅读宽度并居中，避免超宽屏下单列字段被拉得过长 */
.modal-host.drawer .modal-body > .form { max-width: 880px; margin: 0 auto; }
/* 抽屉内表单控件撑满所在列（.ipt 未带 type 属性，匹配不到 input[type=text] 的宽度规则） */
.modal-host.drawer .modal-body > .form .ipt { width: 100%; }

@keyframes drawerIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

@media (max-width: 720px) {
  .modal-host.drawer .modal-head,
  .modal-host.drawer .modal-body,
  .modal-host.drawer .modal-foot { padding-left: 16px; padding-right: 16px; }
}

/* ==================== 响应式 ==================== */

@media (max-width: 900px) {
  .sidebar { width: 68px; }
  .brand-text, .nav a span, .side-user-info { display: none; }
  .brand { justify-content: center; padding: 16px 0; }
  .nav a { justify-content: center; padding: 0; }
  .side-user { justify-content: center; }
  .topbar, .page { padding-left: 14px; padding-right: 14px; }
  .pwd-banner { margin-left: 14px; margin-right: 14px; }
  .site-picker select { min-width: 140px; }
}

.text-muted { color: var(--ink-3); }
.text-c { text-align: center; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.nowrap { white-space: nowrap; }

/* ==================== 图表 ==================== */
.chart-wrap { padding: 4px 2px 0; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #eef1f6; stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 11px; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: .10; stroke: none; }
.chart .pt { stroke: #fff; stroke-width: 1.5; }

.legend {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 2px 6px 10px; font-size: 12.5px; color: var(--ink-2);
}
.legend i {
  display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 6px; vertical-align: -1px;
}

/* ==================== 标签页 ==================== */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  height: 30px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 7px;
  background: #fff; color: var(--ink-2);
  font-size: 12.5px; cursor: pointer; transition: .16s;
}
.tab:hover { border-color: var(--brand-line); color: var(--brand); }
.tab.on { background: var(--brand-soft); border-color: transparent; color: var(--brand); font-weight: 600; }

/* ==================== 结果卡 ==================== */
.result { padding: 20px; }
.result-ok {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; font-size: 14.5px; font-weight: 650; color: var(--ok);
}
.result-ok .ic {
  width: 22px; height: 22px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--ok-soft); font-size: 13px;
}
.kv { display: grid; grid-template-columns: 84px 1fr; gap: 9px 14px; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; word-break: break-all; }

/* ==================== 排行条 ==================== */
.rank-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f3f5f9; }
.rank-row:last-child { border-bottom: 0; }
.rank-name { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-val { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bar { width: 96px; height: 6px; border-radius: 4px; background: #eef1f6; overflow: hidden; flex: none; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--brand-2), var(--brand)); }
.rank-row.clickable { cursor: pointer; border-radius: 6px; margin: 0 -6px; padding: 8px 6px; transition: background .12s; }
.rank-row.clickable:hover { background: var(--brand-soft, #eef4fc); }

/* ==================== 批量栏 / 复选框 ==================== */
.batch-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 18px;
  background: var(--brand-soft);
  border-bottom: 1px solid var(--brand-line);
  font-size: 13px; color: #1257a8;
}
.batch-bar b { font-variant-numeric: tabular-nums; }

/* ==================== 侧边栏分组与徽标 ==================== */
.nav-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-3);
  padding: 8px 14px 2px;
  letter-spacing: .05em;
}
.nav-group:first-child { padding-top: 4px; }
/* 分组维度提示，如「按客户 / 按站点 / 可汇总」 */
.nav-group i {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--neutral-soft);
  color: var(--ink-3);
}
.nav a .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 700;
  padding: 0 6px;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 9px;
}

/* ==================== Tabs (二级) ==================== */
.subtabs {
  display: flex; gap: 2px; flex-wrap: wrap;
  padding: 14px 18px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}
.subtabs .tab {
  height: 32px; padding: 0 14px;
  border: 0; border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px; font-weight: 500;
}
.subtabs .tab:hover { color: var(--brand); border-bottom-color: var(--brand-line); }
.subtabs .tab.on {
  color: var(--brand);
  border-bottom-color: var(--brand);
  background: transparent;
  font-weight: 700;
}

/* ==================== 两栏表单 ==================== */
.cols-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.cols-form .span-all { grid-column: 1 / -1; }
@media (max-width: 720px) { .cols-form { grid-template-columns: 1fr; } }

/* ==================== 编辑器 / 内容区 ==================== */
.editor {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}
.editor .ed-toolbar {
  display: flex; gap: 6px; padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #f8fafd;
}
.editor .ed-toolbar .btn { height: 28px; font-size: 12px; padding: 0 9px; }
.editor textarea {
  border: 0; border-radius: 0;
  min-height: 220px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.65;
}
.editor textarea:focus { box-shadow: none; }
.preview-html {
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: #fafbfe;
  max-height: 380px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.75;
}

/* ==================== 富文本编辑器 ==================== */
.rich-editor {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
}
.rich-editor .re-toolbar {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  background: #f8fafd;
}
.rich-editor .re-toolbar button {
  height: 26px; min-width: 28px;
  padding: 0 7px;
  font-size: 12px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  color: var(--ink-2);
}
.rich-editor .re-toolbar button:hover {
  background: #eef2f7;
  border-color: var(--line);
}
.rich-editor .re-toolbar button:disabled {
  cursor: not-allowed;
}
.rich-editor .re-toolbar .re-sep {
  width: 1px; height: 16px;
  background: var(--line);
  margin: 0 4px;
}
.rich-editor .re-toolbar [data-cmd="re-html-source"] {
  margin-left: auto;
}
.rich-editor .re-body {
  min-height: 220px;
  max-height: 460px;
  overflow: auto;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.7;
  outline: none;
}
.rich-editor .re-body img { max-width: 100%; border-radius: 4px; }
.rich-editor .re-body h2 { font-size: 18px; font-weight: 700; margin: 12px 0 8px; }
.rich-editor .re-body h3 { font-size: 15px; font-weight: 600; margin: 10px 0 6px; }
.rich-editor .re-body p  { margin: 0 0 8px; }
.rich-editor .re-body ul, .rich-editor .re-body ol { padding-left: 22px; margin: 6px 0 10px; }
.rich-editor .re-body.is-empty::before {
  content: attr(data-placeholder);
  color: #c0c4cc;
  pointer-events: none;
}
.rich-editor .re-source {
  width: 100%; min-height: 220px; max-height: 460px;
  border: 0;
  padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  resize: vertical;
  outline: none;
  background: #fafbfe;
}

/* ==================== 封面图上传 ==================== */
/* 封面图库点选缩略图（案例表单等） */
.cover-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cover-pick-item {
  width: 74px; height: 56px; padding: 0; overflow: hidden; cursor: pointer;
  border: 2px solid #e5e7eb; border-radius: 6px; background: #f8fafc;
}
.cover-pick-item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover-pick-item:hover { border-color: var(--brand-line); }
.cover-pick-item.is-active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15); }

.cover-uploader {
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
}
.cover-uploader .cu-preview {
  width: 150px; height: 100px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: #fafbfe;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.cover-uploader .cu-preview img { width: 100%; height: 100%; object-fit: cover; }
.cover-uploader .cu-ph { color: #c0c4cc; font-size: 12px; }
.cover-uploader .cu-actions { display: flex; gap: 8px; }

/* ==================== 字段摘要 ==================== */
.field-grid {
  display: grid; grid-template-columns: 120px 1fr; gap: 10px 14px;
  padding: 14px 18px;
  font-size: 13px;
}
.field-grid dt { color: var(--ink-3); }
.field-grid dd { margin: 0; word-break: break-all; }
.field-grid .chip-row { display: flex; flex-wrap: wrap; gap: 5px; }

/* ==================== AI 行 ==================== */
.ai-line {
  display: grid; grid-template-columns: 1fr 110px 90px 70px; gap: 8px; align-items: center;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}
.ai-line label { font-size: 12.5px; color: var(--ink-2); margin-bottom: 4px; display: block; }

/* ==================== 图库网格 ==================== */
.image-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px; padding: 14px 18px;
}
.image-card {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; overflow: hidden;
  display: flex; flex-direction: column;
  transition: .16s;
}
.image-card:hover { border-color: var(--brand-line); box-shadow: var(--shadow); }
.image-card .img {
  height: 110px;
  background: #f5f7fb center/cover no-repeat;
  position: relative;
}
.image-card .meta {
  padding: 8px 10px;
  font-size: 11.5px; color: var(--ink-2);
  display: flex; justify-content: space-between; gap: 6px;
}
.image-card .meta .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-card .act { display: flex; gap: 4px; padding: 0 10px 9px; }
.uploader {
  border: 1.5px dashed var(--brand-line);
  border-radius: var(--radius-sm);
  padding: 22px;
  text-align: center;
  background: var(--brand-soft);
  cursor: pointer;
  transition: .16s;
}
.uploader:hover { border-color: var(--brand-2); background: #dce9fd; }
.uploader input { display: none; }

/* ==================== 留言 / 内容详情 ==================== */
.detail-list { display: flex; flex-direction: column; }
.detail-list .row { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f1f4f9; font-size: 13px; }
.detail-list .row:last-child { border-bottom: 0; }
.detail-list .k { width: 78px; color: var(--ink-3); flex: none; }

/* ==================== TDK 单元格样式 ==================== */
.tdk-title { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tdk-desc  { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 340px; color: var(--ink-2); }
.tdk-kw    { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--ink-2); }

/* ==================== AI 生成记录 ==================== */
/* 提示词列：完整显示不截取，自动换行（长提示词约 2~4k 字符，行高随内容扩展） */
.ai-prompt-cell { white-space: pre-wrap; word-break: break-word; max-width: 760px; color: var(--ink-2); font-size: 12px; line-height: 1.7; }

/* ==================== 关键词矩阵 ==================== */
.kw-block { padding: 14px 18px; }
.kw-block + .kw-block { border-top: 1px solid var(--line); }
.kw-block h4 { margin: 0 0 8px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.kw-block .items { display: flex; flex-wrap: wrap; gap: 6px; }
.kw-block .chip-row { display: flex; flex-wrap: wrap; gap: 5px; }
.kw-block .chip-row .chip {
  background: var(--brand-soft);
  color: #1257a8;
  border: 1px solid var(--brand-line);
}

/* ==================== 状态条 ==================== */
.section-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.section-bar .grow { flex: 1; }
.section-bar select, .section-bar input { height: 34px; }
.section-bar .ipt { width: auto; min-width: 130px; }

/* ==================== 空 / 加载 ==================== */
.empty {
  padding: 56px 20px; text-align: center; color: var(--ink-3);
}
.empty .big { font-size: 30px; opacity: .3; margin-bottom: 8px; }
.empty p { margin: 0 0 14px; font-size: 13px; }

.spinner {
  display: inline-block;
  width: 15px; height: 15px;
  border: 2px solid var(--brand-line);
  border-top-color: var(--brand-2);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-box { padding: 60px; text-align: center; color: var(--ink-3); }

/* ==================== 状态点（SEO 收录） ==================== */
.dv-h {
  display: flex; align-items: center; gap: 6px;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.dot.is-ok { background: var(--ok); }
.dot.is-warn { background: var(--warn); }
.dot.is-err { background: var(--danger); }

/* ==================== 移动端遮罩 ==================== */
@media (max-width: 900px) {
  .sidebar { width: 68px; }
  .brand-text, .nav a span, .nav-group, .nav-badge, .side-user-info { display: none; }
  .nav a { justify-content: center; padding: 0; }
  .nav a svg { margin: 0 auto; }
  .side-user { justify-content: center; }
  .topbar, .page { padding-left: 14px; padding-right: 14px; }
  .pwd-banner { margin-left: 14px; margin-right: 14px; }
  .site-picker select { min-width: 140px; }
  .form-row, .toolbar, .section-bar, .kv, .field-grid { padding-left: 14px; padding-right: 14px; }
}

/* ==================== 客户级内容源：案例 / 图片库 ==================== */
.asset-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.asset-list { display: flex; flex-direction: column; gap: 10px; }

/* ==================== 批量建站：地区分级选择 ==================== */
.bc-customer-hint { padding: 6px 10px; border-radius: 6px; background: #f3f7fb; }
.bc-customer-hint.warn { background: #fff7e6; color: #b36200; border: 1px solid #ffd591; }
.bc-customer-hint b { color: inherit; }
.bc-region-list { background: #fbfcff; }
.bc-region-list .bc-section + .bc-section { margin-top: 12px; }
.bc-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.bc-section-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: linear-gradient(180deg, #f7faff 0%, #eef4fc 100%);
  border-bottom: 1px solid var(--line);
}
.bc-section-title {
  font-size: 13px; font-weight: 600; color: var(--brand);
}
.bc-section-meta {
  font-size: 11.5px; color: var(--ink-3);
  padding: 2px 8px;
  background: #fff;
  border: 1px solid var(--brand-line);
  border-radius: 999px;
}
.bc-section-actions { margin-left: auto; display: flex; gap: 6px; }
.bc-section-body { padding: 4px 6px; }

.bc-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.bc-row:hover { background: var(--brand-soft); }
.bc-row .bc-name { color: var(--ink); }

.bc-grp {
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 6px 4px;
  background: #fff;
  overflow: hidden;
}
.bc-grp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px;
  background: #fafbfd;
  border-bottom: 1px dashed var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.bc-grp-body { padding: 2px 4px; }

/* 关键词分组 */
.kw-group { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.kw-group-title { font-size: 12.5px; color: var(--ink-3); margin-bottom: 8px; font-weight: 600; }
.kw-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.kw-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; background: #f4f7fb; border: 1px solid #e6ebf3;
  border-radius: 16px; font-size: 12.5px; color: var(--ink);
}
.kw-tag .kw-x {
  cursor: pointer; color: var(--ink-3); font-style: normal; padding: 0 2px;
}
.kw-tag .kw-x:hover { color: var(--danger); }

/* 案例卡 */
.case-card {
  display: flex; gap: 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; padding: 12px;
}
.case-cover { width: 110px; height: 80px; flex: none; overflow: hidden; border-radius: 6px; background: #f3f5f9; }
.case-cover img { width: 100%; height: 100%; object-fit: cover; }
.case-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.case-title { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.case-summary { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; flex: 1; }
.case-actions { margin-top: 8px; display: flex; gap: 12px; }

/* 图片网格 */
.img-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px;
}
.img-card {
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  overflow: hidden; position: relative;
}
.img-thumb { width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: #f3f5f9; cursor: zoom-in; }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-name { font-size: 12px; padding: 6px 8px; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-del {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,.55); color: #fff; border: 0;
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 13px;
}
.img-del:hover { background: var(--danger); }

/* ==================== 客户内容源预览（建站表单内） ==================== */
.customer-preview {
  margin-top: 10px; padding: 12px 14px;
  background: linear-gradient(180deg, #f7faff 0%, #fbfcfe 100%);
  border: 1px solid var(--brand-line); border-radius: 10px;
  font-size: 12.5px; line-height: 1.6;
}
.cp-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.cp-name { font-size: 13px; color: var(--ink); }
.cp-stats { display: flex; gap: 12px; font-size: 12px; color: var(--ink-3); }
.cp-stats b { color: var(--brand); font-weight: 700; font-variant-numeric: tabular-nums; margin-right: 2px; }
.cp-slogan { color: var(--brand); font-weight: 600; margin: 4px 0; }
.cp-intro { color: var(--ink-2); margin-bottom: 6px; }
.cp-grp { margin-top: 4px; }
.cp-grp b { color: var(--ink-3); font-weight: 600; margin-right: 4px; }
.cp-chip {
  display: inline-block; padding: 2px 8px; margin: 2px 4px 2px 0;
  background: #fff; border: 1px solid var(--brand-line); border-radius: 12px;
  font-size: 11.5px; color: var(--ink);
}

/* ==================== 客户 → 站点「继承关系」横幅与来源标注 ==================== */
.banner {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border-radius: 10px; line-height: 1.55;
  font-size: 13px; margin-bottom: 0;
}
.banner-icon { font-size: 20px; line-height: 1.2; flex-shrink: 0; }
.banner-content { flex: 1; min-width: 0; }
.banner-content b { color: var(--ink); font-weight: 600; }
.banner-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }
.banner-actions .btn { white-space: nowrap; }

.banner-info {
  background: linear-gradient(180deg, #eef5ff 0%, #f5f9ff 100%);
  border: 1px solid var(--brand-line);
}
.banner-info .banner-content b { color: #1257a8; }

.banner-warn {
  background: linear-gradient(180deg, #fff7e6 0%, #fffbf0 100%);
  border: 1px solid #ffd591;
}
.banner-warn .banner-content b { color: #ad6800; }

.link-strong { color: var(--brand); font-weight: 600; text-decoration: none; }
.link-strong:hover { text-decoration: underline; }

.chip-info {
  display: inline-block; padding: 1px 7px; margin-left: 8px;
  background: var(--brand-soft); color: var(--brand-ink);
  border-radius: 10px; font-size: 11px; font-weight: 600;
  vertical-align: middle;
}

.kw-block h4 { margin: 10px 0 6px; font-size: 13px; color: var(--ink); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.kw-src {
  font-size: 11.5px; color: var(--ink-3); font-weight: 400;
  background: #f5f7fb; padding: 1px 8px; border-radius: 8px;
}

/* 内容页 tabs 与 banner 间距 */
.subtabs + #contentBody { margin-top: 14px; }
.subtabs { margin-top: 12px; }
@media (max-width: 900px) {
  .banner { flex-wrap: wrap; }
  .banner-actions { width: 100%; justify-content: flex-end; margin-top: 6px; }
}
/* ============== 关键词设置（产品词 / 后缀词矩阵 + AI 推理） ============== */
.kwset-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.kwset-title { font-size: 16px; font-weight: 600; color: #0f172a; }
.kwset-actions { display: flex; gap: 8px; }
.kwset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.kwset-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; min-height: 360px; }
.kwset-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfe; }
.kwset-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.kwset-name { font-weight: 600; color: #0f172a; flex: 1; }
.kwset-reset { border: 1px solid var(--line); background: #fff; color: #475569; padding: 3px 10px; border-radius: 14px; font-size: 12px; cursor: pointer; transition: all .15s; }
.kwset-reset:hover { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }
.kwset-ta { flex: 1; min-height: 260px; width: 100%; border: none; outline: none; resize: none; padding: 10px 14px; font-size: 13px; line-height: 1.7; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #0f172a; background: transparent; }
.kwset-ta:focus { background: #f8fafc; }
.kwset-ta.over { background: #fef2f2; }
.kwset-foot { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--line); background: #fafbfe; font-size: 12px; }
.kwset-foot > span:first-child { flex: 1; }
.kwset-note { color: #dc2626; }
.kwset-hint { color: #64748b; }
.kwset-count { color: #475569; font-variant-numeric: tabular-nums; }
.kwset-count.over { color: #dc2626; font-weight: 600; }
.kwset-ai { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 18px; padding: 18px 22px; border: none; border-radius: 12px; cursor: pointer; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; text-align: left; box-shadow: 0 8px 20px -10px rgba(26, 115, 232, .55); transition: transform .15s, box-shadow .15s; }
.kwset-ai:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 24px -10px rgba(26, 115, 232, .65); }
.kwset-ai:disabled { opacity: .7; cursor: progress; }
.kwset-ai-text { display: flex; flex-direction: column; gap: 2px; }
.kwset-ai-text b { font-size: 16px; font-weight: 600; }
.kwset-ai-text i { font-style: normal; font-size: 12.5px; opacity: .85; }
.kwset-ai-icon { font-style: normal; font-weight: 700; font-size: 13px; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .18); letter-spacing: 1px; }
.kwset-ai.busy .kwset-ai-icon::after { content: ' …'; }
.kwset-result { margin-top: 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.kwset-result-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfe; font-size: 13px; }
.kwset-result-head b { font-weight: 600; }
.kwset-result-sub { color: #64748b; font-size: 12px; flex: 1; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }

/* ---------------- JSON list 行编辑器（企业优势 / 核心卖点 / FAQ） ---------------- */
.json-row-editor { border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-bottom: 4px; }
.json-row-editor .jre-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfe; border-radius: 10px 10px 0 0; }
.json-row-editor .jre-title { font-weight: 600; font-size: 13px; }
.json-row-editor .jre-tools { display: flex; align-items: center; gap: 8px; }
.json-row-editor .jre-preview { font-size: 12px; color: #64748b; }
.json-row-editor .jre-preview summary { cursor: pointer; user-select: none; }
.json-row-editor .jre-pre { background: #0f172a; color: #e2e8f0; padding: 10px 12px; border-radius: 8px; font-size: 11.5px; max-height: 240px; overflow: auto; margin: 8px 0 0; white-space: pre-wrap; word-break: break-all; }
.json-row-editor .jre-schema { padding: 8px 14px; font-size: 12px; color: #64748b; border-bottom: 1px dashed var(--line); }
.json-row-editor .jre-rows { padding: 8px 14px 12px; display: flex; flex-direction: column; gap: 10px; }
.json-row-editor .jre-row { border: 1px solid var(--line); border-radius: 8px; background: #fafbfe; padding: 10px 12px; }
.json-row-editor .jre-row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.json-row-editor .jre-row-head b { color: #334155; font-size: 12.5px; }
.json-row-editor .jre-row-tools { display: flex; gap: 8px; }
.json-row-editor .jre-row-tools .link[disabled] { color: #cbd5e1; cursor: not-allowed; }
.json-row-editor .jre-row-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.json-row-editor .jre-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.json-row-editor .jre-field .jre-flbl { font-size: 12px; color: #475569; }
.json-row-editor .jre-field .ipt { font-size: 13px; }
.json-row-editor .jre-field textarea.ipt { min-height: 56px; resize: vertical; }

/* ==================== AI 一键填入脉冲提示 ==================== */
.ai-fill-pulse {
  box-shadow: 0 0 0 0 rgba(15, 122, 61, 0.55);
  animation: aiFillPulse 1.2s ease-out 2;
}
@keyframes aiFillPulse {
  0%   { box-shadow: 0 0 0 0   rgba(15, 122, 61, 0.55); }
  60%  { box-shadow: 0 0 0 6px rgba(15, 122, 61, 0);    }
  100% { box-shadow: 0 0 0 0   rgba(15, 122, 61, 0);    }
}

/* TagInput 多值输入控件（站点片区别名 / 关键词标签等） */
.tag-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  cursor: text;
}
.tag-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(26,115,232,.12); }
.tag-input .tag-chips { display: contents; }
.tag-input .tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 12px;
  background: var(--brand-soft); color: var(--brand-ink); font-size: 12.5px; line-height: 1.4;
  border: 1px solid var(--brand-line);
}
.tag-input .tag-chip-x {
  background: transparent; border: 0; cursor: pointer; padding: 0 2px;
  color: var(--ink-3); font-size: 14px; line-height: 1;
}
.tag-input .tag-chip-x:hover { color: #c0392b; }
.tag-input .tag-input-text {
  flex: 1; min-width: 120px; border: 0 !important; outline: 0 !important;
  box-shadow: none !important; padding: 4px 0 !important; height: auto !important;
  font-size: 13px;
}

/* ==================== 文章编辑器（分段卡片式，新增/编辑文章共用） ==================== */
.editor-shell { max-width: 1040px; margin: 0 auto; }
.editor-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 14px;
}
.editor-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--line);
}
.editor-card-head h4 { margin: 0; font-size: 13.5px; font-weight: 650; color: var(--ink); }
.editor-card-head .mh { font-size: 11.5px; color: var(--ink-3); }
.editor-card-body { padding: 16px 18px; }
.editor-card .ipt { width: 100%; box-sizing: border-box; }
.editor-card .form-row { margin-bottom: 14px; }
.editor-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.editor-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.editor-grid2 .form-row, .editor-grid3 .form-row { margin: 0; }
.editor-grid2 .ipt, .editor-grid3 .ipt { width: 100%; }
.editor-lbl { display: block; margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.editor-hint { font-weight: 400; color: var(--ink-3); font-size: 11.5px; margin-left: 5px; }
.editor-drop {
  border: 1.5px dashed var(--line); border-radius: 10px; background: var(--head-bg);
  min-height: 120px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 5px; color: var(--ink-3); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.editor-drop:hover { border-color: var(--brand); background: var(--brand-soft); }
.editor-drop img { max-height: 116px; max-width: 90%; border-radius: 8px; object-fit: contain; }
.editor-drop .t { font-size: 13px; color: var(--ink-2); }
.editor-drop .s { font-size: 11.5px; }
.editor-tip {
  background: var(--brand-soft); border: 1px solid var(--brand-line);
  border-radius: 10px; padding: 13px 18px; font-size: 12px; color: var(--brand-ink);
}
.editor-tip b { display: block; margin-bottom: 6px; font-size: 12.5px; }
.editor-tip ul { margin: 0; padding-left: 18px; columns: 2; column-gap: 28px; line-height: 1.9; }
.editor-wordcount { font-size: 11.5px; color: var(--ink-3); }
@media (max-width: 760px) {
  .editor-grid2, .editor-grid3 { grid-template-columns: 1fr; }
  .editor-tip ul { columns: 1; }
}

/* ============================================================
   输入区域统一规范（长度适配 + 风格一致）
   目标：同类字段在任何表单里长度、字体、间距、标签位置、提示样式完全一致，
        同时按内容长度差异自动适配，避免"标题框过短/留白过多/两列失衡"。
   ------------------------------------------------------------
   长度适配策略（按内容类型，不按具体页面）：
     · 长文本（标题 / 名称 / 关键词 / URL）：占满所在栅格列，随容器自适应
     · 中等文本（分类 / 作者 / 来源 / 摘要）：两列等分；摘要用 textarea 2~3 行
     · 短值（排序 / 数字 / 状态 / 开关）：固定 110~140px，不与长文本同列拉伸
     · 正文：富文本编辑器，最小高度 220px，随内容增高
     · 筛选栏 / 工具栏：宽度 auto + min-width，避免撑满整行
   栅格：.form-grid / .editor-grid2 / .editor-grid3 用等分 fr，窄屏自动折成单列
   ============================================================ */
:root {
  --form-gap: 14px;              /* 字段之间的统一间距 */
  --form-label-size: 12.5px;     /* 所有标签统一字号 */
  --form-input-size: 13px;       /* 所有输入文本统一字号 */
  --form-hint-size: 11.5px;      /* 所有提示文案统一字号 */
  --form-input-h: 38px;          /* 单行输入统一高度 */
  --form-textarea-min: 76px;     /* 多行输入最小高度 */
}

/* 1) 字体 / 行高 / 盒模型：所有输入元素一律统一 */
input, select, textarea { font-family: inherit; }
.form input, .form select, .form textarea,
.form-row input, .form-row select, .form-row textarea,
.editor-card input, .editor-card select, .editor-card textarea {
  font-size: var(--form-input-size);
  line-height: 1.5;
}

/* 2) 标签：统一左对齐、字号、字重、与输入框间距（标签恒在输入框上方） */
.form-lbl, .editor-lbl, .field > label, .jre-flbl {
  display: block;
  margin: 0 0 6px;
  font-size: var(--form-label-size);
  font-weight: 600;
  color: var(--ink);
}

/* 3) 提示文案：统一浅色小字，紧随标签，不与输入值混淆 */
.hint, .editor-hint, .field .hint, .form-lbl .hint {
  font-size: var(--form-hint-size);
  font-weight: 400;
  color: var(--ink-3);
}

/* 4) 行内等分栅格：两列 / 三列字段宽度一致，留白均匀 */
.editor-grid2, .editor-grid3, .form-grid { box-sizing: border-box; }
.editor-grid2 > *, .editor-grid3 > * { min-width: 0; }

/* 5) 长度适配：短值定宽、长文本自适应但设上限、正文最小高度 */
/* 单行长文本不超过 640px，避免宽屏下拉伸到 900px+ 造成视觉失衡 */
.modal input.ipt:not(.short):not([style*="flex"]),
.modal-host input.ipt:not(.short):not([style*="flex"]) { max-width: 640px; }
.form input[type="number"].ipt,
.form-row input[type="number"].ipt { width: 120px; }
.form .ipt.short, .form-row .ipt.short { width: 140px; }
textarea.ipt { min-height: var(--form-textarea-min); }
.modal-body .editor { min-height: 220px; }

/* 6) 筛选 / 工具栏输入维持紧凑，不被全局 100% 宽度拉伸 */
.filter-bar .ipt, .toolbar .ipt, .section-bar .ipt { width: auto; }

/* 7) 窄屏：所有等分栅格折为单列，输入始终占满可用宽度 */
@media (max-width: 760px) {
  .form-grid, .editor-grid2, .editor-grid3 { grid-template-columns: 1fr; }
}

/* ============================================================
   输入控件边框对比度统一提升（无障碍）
   ------------------------------------------------------------
   上面已把基础 input/select/textarea 边框改为 --input-line（≥3:1）。
   筛选栏、工具栏、富文本等控件各自声明过边框，这里统一覆盖为同一标准，
   保证「任何位置的可输入区域」在页面背景中都可清晰辨认。
   ============================================================ */
.filter-bar .search-input,
.filter-bar select,
.filter-bar input[type="number"],
.toolbar .search input,
.toolbar select,
.section-bar input,
.section-bar select,
.field input, .field select, .field textarea,
.json-row-editor .jre-field .ipt,
.rich-editor, .editor, .editor-drop,
.modal input, .modal select, .modal textarea {
  border-color: var(--input-line);
}
.filter-bar .search-input:hover, .filter-bar select:hover,
.toolbar select:hover, .section-bar input:hover, .section-bar select:hover,
.rich-editor:hover, .editor:hover, .editor-drop:hover {
  border-color: var(--input-line-hover);
}
.rich-editor .re-body.is-empty::before { color: var(--input-placeholder); }

/* 用户系统开启「高对比度」偏好时进一步加深，适配强光/低视力场景 */
@media (prefers-contrast: more) {
  :root { --input-line: #4b5563; --input-line-hover: #1f2937; --input-placeholder: #374151; }
  input, select, textarea { border-width: 1.5px; }
}
/* Windows 高对比度模式：交给系统色，保证任何主题下可见 */
@media (forced-colors: active) {
  input, select, textarea { border-color: FieldText; }
  input:focus, select:focus, textarea:focus { outline: 2px solid Highlight; outline-offset: 1px; }
}
