/* ============================================================
 * 后台 / 编辑器
 * ============================================================ */
.crumb { font-size: 13px; color: var(--faint); display: flex; align-items: center; gap: 7px; }
.crumb b { color: var(--ink); font-weight: 600; }

.editor-side { position: sticky; top: 22px; }
.preview-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin-bottom: 10px; padding: 0 4px; }
.preview-head span:first-child { font-weight: 600; }
.preview-tip { text-align: center; font-size: 11px; color: var(--faint); margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 5px; }

/* 内容块类型选择 */
.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.type-card {
  text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 12px; display: flex; flex-direction: column; gap: 5px; transition: all .18s var(--ease);
}
.type-card:hover { border-color: #d6c5fb; background: #fbf8ff; transform: translateY(-2px); box-shadow: 0 10px 24px -18px rgba(70,40,140,.4); }
.type-card .t-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; }
.type-card b { font-size: 12.5px; font-weight: 600; }
.type-card > span { font-size: 10.5px; color: var(--faint); line-height: 1.5; }

/* 上传 */
.upload-box {
  border: 1px dashed #d8d2e4; border-radius: 12px; height: 110px; display: grid; place-items: center;
  cursor: pointer; overflow: hidden; background: #fbfafd; color: var(--faint); transition: border-color .2s;
}
.upload-box:hover { border-color: var(--violet); }
.upload-box img { width: 100%; height: 100%; object-fit: cover; }
.upload-box div { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; }

.avatar-edit {
  width: 84px; height: 84px; border-radius: 50%; position: relative; cursor: pointer;
  background: var(--violet-soft); color: var(--violet-deep); display: grid; place-items: center;
  font-size: 24px; font-weight: 700; overflow: hidden; flex: none;
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--line);
}
.avatar-edit img { width: 100%; height: 100%; object-fit: cover; }
.avatar-edit i {
  position: absolute; inset: auto 0 0; height: 26px; background: rgba(15,10,25,.65); color: #fff;
  display: grid; place-items: center;
}

.img-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.img-cell { position: relative; aspect-ratio: 1; border-radius: 9px; overflow: hidden; }
.img-cell img { width: 100%; height: 100%; object-fit: cover; }
.img-cell button { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border: 0; border-radius: 50%; background: rgba(15,10,25,.7); color: #fff; font-size: 10px; }
.img-add {
  aspect-ratio: 1; border: 1px dashed #d8d2e4; border-radius: 9px; background: #fbfafd;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--faint); font-size: 10.5px;
}
.img-add:hover { border-color: var(--violet); color: var(--violet); }

.qr-thumb {
  width: 64px; height: 64px; border-radius: 10px; border: 1px dashed #d8d2e4; background: #fbfafd;
  display: grid; place-items: center; overflow: hidden; cursor: pointer; color: var(--faint);
}
.qr-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* 社交图标 */
.social-grid { display: flex; flex-direction: column; gap: 2px; }
.social-row { display: flex; align-items: center; gap: 11px; padding: 7px 0; border-bottom: 1px solid #f2effa; }
.social-row:last-child { border-bottom: 0; }
.social-dot { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; }
.social-dot img { width: 16px; height: 16px; filter: brightness(0) invert(1); }
.social-row label { width: 96px; font-size: 12px; color: var(--muted); flex: none; }
.social-row input { flex: 1; height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font-size: 12.5px; background: #fff; }
.social-row input:focus { outline: none; border-color: #cbb2ff; box-shadow: 0 0 0 3px rgba(124,58,237,.08); }

/* 开关列表 */
.switch-list { margin-top: 6px; border-top: 1px solid var(--line); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid #f2effa; }
.switch-row b { display: block; font-size: 12.5px; font-weight: 600; }
.switch-row span { font-size: 11px; color: var(--faint); }

/* 渠道 */
.channel-card { border: 1px solid var(--line); border-radius: 13px; padding: 14px; margin-bottom: 12px; background: #fcfbfe; }
.channel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.channel-head b { font-size: 12.5px; }

/* 数据 */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-card { background: #faf8ff; border: 1px solid #efe9fa; border-radius: 13px; padding: 14px; }
.stat-card span { font-size: 11px; color: var(--faint); display: block; }
.stat-card b { font-size: 26px; font-weight: 700; letter-spacing: -.8px; display: block; margin: 5px 0 2px; }
.stat-card i { font-size: 10.5px; font-style: normal; color: var(--faint); }

.chart-bars { display: flex; align-items: flex-end; gap: 5px; height: 150px; padding-top: 10px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart-stack { width: 100%; height: 100%; display: flex; align-items: flex-end; gap: 2px; }
.chart-stack i { flex: 1; border-radius: 3px 3px 0 0; min-height: 2px; transition: height .4s; }
.chart-stack .pv { background: #7c3aed; }
.chart-stack .cl { background: #c4b5fd; }
.chart-col span { font-size: 9.5px; color: var(--faint); writing-mode: horizontal-tb; }

.rank-list { display: flex; flex-direction: column; gap: 2px; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f4f1fa; }
.rank-no { width: 20px; height: 20px; border-radius: 5px; background: var(--paper-2); color: var(--faint); font-size: 10.5px; display: grid; place-items: center; flex: none; }
.rank-no.top { background: var(--violet-soft); color: var(--violet-deep); font-weight: 700; }
.rank-name { width: 150px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-bar { flex: 1; height: 5px; background: #f3effa; border-radius: 4px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: linear-gradient(90deg,#a855f7,#7c3aed); border-radius: 4px; }
.rank-row b { font-size: 12px; width: 40px; text-align: right; }

.msg-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: #fcfbfe; }
.msg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.msg-head b { font-size: 12px; }
.msg-head span { font-size: 10.5px; color: var(--faint); }
.msg-line { display: flex; gap: 10px; font-size: 11.5px; padding: 3px 0; }
.msg-line span { color: var(--faint); width: 78px; flex: none; }
.msg-line b { font-weight: 500; color: var(--ink-2); word-break: break-word; }

/* 杂项 */
.empty { text-align: center; }
.empty-ic { width: 48px; height: 48px; border-radius: 14px; background: var(--violet-soft); color: var(--violet); display: grid; place-items: center; margin: 0 auto 12px; }
.empty p { font-size: 12.5px; color: var(--faint); margin: 0 0 14px; }
.icon-btn { width: 28px; height: 28px; border: 0; background: transparent; border-radius: 6px; color: var(--faint); display: grid; place-items: center; }
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
.mini-check { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.mini-check input { accent-color: var(--violet); }
.field-editor { display: grid; grid-template-columns: 1.2fr .8fr auto auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.field-editor input, .field-editor select { height: 34px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; font-size: 12px; background: #fff; }
.field-editor input:focus, .field-editor select:focus { outline: none; border-color: #cbb2ff; }

.l3-field input[type=range] { width: 100%; accent-color: var(--violet); height: 22px; padding: 0; }
.l3-field input[type=color] { width: 100%; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.l3-field select { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; font-size: 13px; background: #fff; }
.l3-field small { font-size: 10.5px; color: var(--faint); display: block; text-align: right; margin-top: 4px; }

@media (max-width: 900px) {
  .editor-side { position: static; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .type-grid { grid-template-columns: 1fr 1fr; }
  .img-grid { grid-template-columns: repeat(3, 1fr); }
  .social-row label { width: 74px; }
}
