/* ============================================================
   南象 AI 会务后台 · 样式
   与小程序同一套品牌色：墨蓝 #1E2A5A / 品牌橙 #FF6B35
   ============================================================ */

:root {
  --ink: #1e2a5a;
  --ink-2: #5b6472;
  --ink-3: #737d95;
  --line: #e6eaf4;
  --line-2: #eff2f9;
  --bg: #f6f7fb;
  --card: #ffffff;
  --orange: #ff6b35;
  --orange-soft: #fff0e9;
  --green: #1b8a5a;
  --green-soft: #e8f8f0;
  --red: #c43c2b;
  --red-soft: #fdecea;
  --pink: #ff4d8d;

  /* 与小程序共用同一套比例（1px = 2rpx） */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 10px;
  --r-xl: 12px;
  --sh-sm: 0 1px 4px rgba(30, 42, 90, 0.04);
  --sh-md: 0 4px 12px rgba(30, 42, 90, 0.06);
  --sh-lg: 0 8px 20px rgba(30, 42, 90, 0.12);
  --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
  --shadow: 0 4px 12px rgba(30, 42, 90, 0.06);
}

* {
  box-sizing: border-box;
}

/* 关键：.login / .console / .boot 都设了 display:flex，
   会覆盖 hidden 属性的 UA 样式，必须显式兜底 */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--orange);
  text-decoration: none;
  cursor: pointer;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- 通用 ---------- */
.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid #e3e8f5;
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.boot {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--ink-3);
  font-size: 13px;
}

.btn {
  height: 40px;
  padding: 0 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn.primary {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.24);
}

.btn.primary:hover {
  background: #f25f28;
}

.btn.ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn.ghost:hover {
  border-color: #cfd8ea;
}

.btn.danger {
  background: #fff;
  border: 1px solid #f0c4bb;
  color: var(--red);
}

.btn.sm {
  height: 30px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 6px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* ---------- 登录态 ---------- */
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px 32px;
  box-shadow: 0 16px 48px rgba(30, 42, 90, 0.1);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-sub {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 1.6px;
}

.login-card h1 {
  font-size: 24px;
  margin: 0 0 6px;
  letter-spacing: 0.5px;
}

.login-card .sub {
  margin: 0 0 28px;
  font-size: 13px;
  color: var(--ink-3);
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink);
  background: #fbfcfe;
  outline: none;
  transition: border-color 0.15s ease;
}

.field input:focus {
  border-color: #ffb99e;
  background: #fff;
}

.login-card .btn {
  width: 100%;
  margin-top: 8px;
}

.login-foot {
  margin: 20px 0 0;
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
}

.msg {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.6;
  padding: 10px 12px;
  border-radius: 8px;
  display: none;
}

.msg.show {
  display: block;
}

.msg.err {
  background: var(--red-soft);
  color: var(--red);
}

.msg.ok {
  background: var(--green-soft);
  color: var(--green);
}

.msg.info {
  background: var(--orange-soft);
  color: #b1521f;
}

/* ---------- 工作台骨架 ---------- */
.console {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 216px;
  flex: none;
  background: #fff;
  border-right: 1px solid var(--line-2);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 22px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
  border: none;
  background: none;
  text-align: left;
  width: 100%;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: #f7f9fd;
}

.nav-item.active {
  background: var(--orange-soft);
  color: #c2451a;
  font-weight: 600;
}

.nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
  flex: none;
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--orange);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
}

.nav-badge.show {
  display: inline-flex;
}

.side-foot {
  margin-top: auto;
  padding: 16px 10px 0;
  border-top: 1px solid var(--line-2);
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.7;
}

.side-foot .who {
  color: var(--ink-2);
  word-break: break-all;
  margin-bottom: 8px;
}

.side-foot a {
  font-size: 12px;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 64px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid var(--line-2);
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.page-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.page-title small {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 400;
  margin-left: 10px;
  letter-spacing: 0;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.content {
  padding: 24px 28px 48px;
  flex: 1;
}

.view[hidden] {
  display: none;
}

/* ---------- 统计卡 ---------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.stat {
  background: #fff;
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.stat .num {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat .label {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 8px;
  letter-spacing: 1px;
}

.stat.warn .num {
  color: #b87333;
}

.stat.ok .num {
  color: var(--green);
}

.stat.accent {
  background: var(--ink);
  box-shadow: var(--sh-lg);
}

.stat.accent .num {
  color: #ffffff;
}

.stat.accent .label {
  color: rgba(255, 255, 255, 0.62);
}

/* ---------- 卡片 ---------- */
.card {
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
}

.card-body {
  padding: 20px 22px;
}

/* ---------- 工具栏 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tabs {
  display: flex;
  gap: 6px;
  background: #f4f6fc;
  border-radius: 8px;
  padding: 3px;
}

.tab {
  height: 30px;
  padding: 0 14px;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink-2);
}

.tab.active {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(30, 42, 90, 0.08);
}

.search {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  width: 220px;
  outline: none;
  color: var(--ink);
}

.search:focus {
  border-color: #ffb99e;
}

/* ---------- 表格 ---------- */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 12px 22px;
  background: #fafbfe;
  color: var(--ink-3);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  border-bottom: 1px solid var(--line-2);
}

tbody td {
  padding: 14px 22px;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr.clickable {
  cursor: pointer;
}

tbody tr.clickable:hover td {
  background: #fbfcff;
}

.cell-company {
  font-weight: 600;
}

.cell-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}

.num-cell {
  font-variant-numeric: tabular-nums;
}

/* ---------- 徽章 ---------- */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge.pending {
  background: #fff3e8;
  color: #b87333;
}

.badge.approved {
  background: var(--green-soft);
  color: var(--green);
}

.badge.rejected {
  background: var(--red-soft);
  color: var(--red);
}

.badge.checked {
  background: #eef1fb;
  color: #3b4b8f;
}

/* ---------- 分页 ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-top: 1px solid var(--line-2);
  font-size: 13px;
  color: var(--ink-3);
  gap: 12px;
  flex-wrap: wrap;
}

.pager-info b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pager-btns {
  display: flex;
  gap: 8px;
}

/* ---------- 导出面板 ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(30, 42, 90, 0.38);
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(30, 42, 90, 0.22);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line-2);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
}

.modal-body {
  padding: 20px 24px 8px;
}

.seg {
  display: flex;
  gap: 6px;
  background: #f4f6fc;
  border-radius: 8px;
  padding: 3px;
}

.seg-item {
  flex: 1;
  height: 32px;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink-2);
  transition: all 0.15s ease;
}

.seg-item.active {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(30, 42, 90, 0.08);
}

.date-row {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.date-row label {
  flex: 1;
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-row input {
  flex: 1;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink);
  background: #fbfcfe;
  outline: none;
}

.estimate {
  margin-top: 16px;
  font-size: 13px;
  color: var(--ink-2);
}

.estimate b {
  color: var(--orange);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.export-hint {
  margin: 10px 0 4px;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.7;
}

.export-hint.warn {
  color: #b1521f;
}

.modal-foot {
  display: flex;
  gap: 10px;
  padding: 16px 24px 16px;
  justify-content: flex-end;
}

.modal-foot .btn {
  height: 38px;
  padding: 0 18px;
  font-size: 13px;
}

.modal-progress {
  padding: 14px 24px 20px;
  border-top: 1px solid var(--line-2);
}

.bar {
  height: 6px;
  border-radius: 3px;
  background: #eef1f8;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ff8a5c, #ff6b35);
  transition: width 0.2s ease;
}

.progress-text {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-3);
}

/* ---------- 空态 ---------- */
.empty {
  padding: 64px 20px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.9;
}

/* ---------- 抽屉 ---------- */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(30, 42, 90, 0.35);
  z-index: 90;
  display: none;
}

.mask.show {
  display: block;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: 92vw;
  background: #fff;
  z-index: 91;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.22s ease;
  box-shadow: -16px 0 48px rgba(30, 42, 90, 0.14);
}

.drawer.show {
  transform: translateX(0);
}

.drawer-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line-2);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
}

.drawer-close {
  border: none;
  background: none;
  font-size: 20px;
  color: var(--ink-3);
  line-height: 1;
  padding: 0 4px;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 24px 24px;
}

.drawer-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--line-2);
  display: flex;
  gap: 10px;
}

.drawer-foot .btn {
  flex: 1;
}

.kv {
  display: flex;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
}

.kv:last-child {
  border-bottom: none;
}

.kv .k {
  width: 96px;
  flex: none;
  color: var(--ink-3);
}

.kv .v {
  flex: 1;
  word-break: break-all;
}

.group-title {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--ink-3);
  margin: 22px 0 4px;
  font-weight: 600;
}

/* ---------- 核销 ---------- */
.checkin-box {
  max-width: 720px;
}

.checkin-row {
  display: flex;
  gap: 10px;
}

.checkin-row input {
  flex: 1;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  letter-spacing: 1px;
  outline: none;
  color: var(--ink);
}

.checkin-row input:focus {
  border-color: #ffb99e;
}

.result {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.8;
  display: none;
}

.result.show {
  display: block;
}

.result.ok {
  background: var(--green-soft);
  color: #166b46;
}

.result.err {
  background: var(--red-soft);
  color: #9c3323;
}

.result .who {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.history {
  margin-top: 28px;
}

.history h3 {
  font-size: 13px;
  color: var(--ink-3);
  margin: 0 0 10px;
  font-weight: 600;
}

/* ---------- 表单 ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.form-item label {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.form-item input,
.form-item textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink);
  background: #fbfcfe;
  outline: none;
  font-family: inherit;
}

.form-item textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.7;
}

.form-item input:focus,
.form-item textarea:focus {
  border-color: #ffb99e;
  background: #fff;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .sidebar {
    width: 64px;
    padding: 16px 8px;
  }

  .side-brand .brand-name,
  .side-brand .brand-sub,
  .nav-item span:not(.nav-dot),
  .nav-badge,
  .side-foot {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
  }

  .stat-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .content {
    padding: 18px 16px 40px;
  }

  .topbar {
    padding: 0 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   v1.2 运营模块：活动 / 邀请码 / 课程 / 订单 / 会员
   ============================================================ */

.nav-group {
  padding: 18px 18px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #a3abc0;
  text-transform: uppercase;
}

.card-note {
  font-size: 12px;
  color: var(--ink-3);
}

.snapshot {
  margin-top: 18px;
}

.snapshot .card-body {
  padding: 20px 22px 24px;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.mini-stat {
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  background: #fbfcff;
  padding: 16px 18px;
}

.mini-stat.accent {
  background: var(--orange-soft);
  border-color: #ffdcc9;
}

.mini-num {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
  line-height: 1.25;
}

.mini-stat.accent .mini-num {
  color: var(--orange);
}

.mini-label {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 4px;
}

.module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.module-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.module-lead {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 2px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  border: 1px solid #ffdfc7;
  background: #fff8f2;
  border-radius: var(--r-lg);
}

.notice-icon {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  text-align: center;
  line-height: 22px;
  font-size: 13px;
}

.notice-title {
  font-weight: 700;
  font-size: 13.5px;
}

.notice-sub {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 3px;
  line-height: 1.65;
}

.notice code,
.advanced-box code {
  background: #f0f2f8;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 12px;
  color: var(--ink);
}

.head-ops {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.ops {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.link-btn {
  border: none;
  background: transparent;
  padding: 2px 0;
  color: var(--orange);
  font-size: 12.5px;
  font-weight: 600;
}

.link-btn:hover {
  text-decoration: underline;
}

.link-btn.danger {
  color: var(--red);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  letter-spacing: 0.2px;
}

/* 编辑面板 */
.modal-card.wide {
  width: min(760px, calc(100vw - 48px));
  max-height: min(86vh, 860px);
  display: flex;
  flex-direction: column;
}

.modal-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}

.editor-body {
  overflow-y: auto;
}

.form-item select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 9px 11px;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.form-item select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-item .req {
  color: var(--orange);
  font-style: normal;
}

.check-row {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  font-size: 13px;
  font-weight: 400 !important;
  color: var(--ink-2) !important;
  cursor: pointer;
}

.check-row input {
  width: 16px !important;
  height: 16px;
  accent-color: var(--orange);
}

.field-hint {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 4px;
  line-height: 1.5;
}

.advanced-box {
  margin-top: 8px;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}

.advanced-toggle {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
}

.advanced-toggle:hover {
  color: var(--orange);
}

#editor-advanced-body p {
  font-size: 12px;
  line-height: 1.75;
  color: var(--ink-3);
  margin: 8px 0 0;
}

.inline-error {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--red-soft);
  color: var(--red);
  font-size: 12.5px;
  line-height: 1.6;
}

.code-box {
  margin: 0;
  padding: 14px 16px;
  background: #f7f8fc;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.9;
  letter-spacing: 0.6px;
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.module-toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translate(-50%, 14px);
  z-index: 200;
  padding: 11px 22px;
  border-radius: 22px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  box-shadow: var(--sh-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease-out), transform 0.22s var(--ease-out);
}

.module-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ============================================================
   v1.3 · 系统配置中心
   ============================================================ */
.set-source {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid #1d45e1;
  border-radius: var(--r-lg);
  background: #f7f9ff;
  margin-bottom: 22px;
}

.set-source-icon {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: #e8edfd;
  color: #1d45e1;
  font-size: 15px;
  font-weight: 700;
}

.set-source-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 5px;
}

.set-source-text {
  font-size: 12px;
  line-height: 1.85;
  color: var(--ink-2);
}

.set-source-text code,
.notice-sub code {
  background: #eef1f9;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 11px;
  color: var(--ink);
}

.set-section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 24px 0 12px;
}

.set-section-title span {
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-3);
}

.set-ready {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ready-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  padding: 14px 16px 15px;
  box-shadow: var(--sh-sm);
  min-width: 0;
}

.ready-card.is-ok { border-color: #cdeedd; background: #fbfefc; }
.ready-card.is-wait { border-color: var(--line); }
.ready-card.blue   .ready-dot { background: #1d45e1; }
.ready-card.orange .ready-dot { background: var(--orange); }
.ready-card.green  .ready-dot { background: #2ecc8f; }
.ready-card.is-ok  .ready-dot { background: var(--green); }

.ready-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
}

.ready-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.ready-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.ready-bar {
  height: 5px;
  border-radius: 5px;
  background: var(--line-2);
  margin: 11px 0 9px;
  overflow: hidden;
}

.ready-bar i {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: var(--orange);
  transition: width 0.3s var(--ease-out);
}

.ready-card.is-ok .ready-bar i { background: var(--green); }

.ready-desc {
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.6;
  min-height: 34px;
}

.ready-list {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  font-size: 11px;
}

.ready-ok { color: var(--green); font-weight: 600; }
.ready-miss { color: var(--ink-2); }

.ready-chip {
  background: var(--line-2);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--ink-2);
}

.set-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.set-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.set-tab:hover { border-color: #c9d2ec; }

.set-tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: var(--sh-md);
}

.set-tab-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.set-tab-dot.blue { background: #1d45e1; }
.set-tab-dot.orange { background: var(--orange); }
.set-tab-dot.pink { background: var(--pink); }
.set-tab-dot.green { background: #2ecc8f; }
.set-tab-dot.purple { background: #8a63d2; }
.set-tab-dot.slate { background: #7c8aa5; }

.set-tab-num {
  font-size: 10px;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.set-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}

.set-card-head {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-2);
  background: #fcfdff;
}

.set-card-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.set-card-desc { font-size: 11px; color: var(--ink-3); margin-top: 4px; line-height: 1.6; }

.set-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 26px;
  padding: 8px 18px 18px;
}

.set-field { padding: 13px 0 8px; min-width: 0; }

.set-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

.set-tag {
  font-size: 10px;
  font-weight: 500;
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}

.set-tag.public { background: var(--green-soft); color: var(--green); }
.set-tag.internal { background: #eef1f9; color: var(--ink-2); }
.set-tag.secret { background: var(--orange-soft); color: #c9531f; }

.set-input {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.set-input:focus {
  border-color: #1d45e1;
  box-shadow: 0 0 0 3px rgba(29, 69, 225, 0.09);
}

.set-input::placeholder { color: #aab2c4; }
.set-textarea { height: auto; padding: 9px 11px; line-height: 1.6; resize: vertical; }
select.set-input { cursor: pointer; }

.set-hint {
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.6;
  margin-top: 6px;
}

.set-err {
  font-size: 11px;
  color: var(--red);
  margin-top: 5px;
}

.set-secret-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
}

.set-secret-state {
  flex: 1;
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 11px;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  background: #fafbfe;
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.5px;
}

.set-secret-state.is-set { color: var(--green); background: #fbfefc; border-style: solid; border-color: #cdeedd; }

.set-switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  height: 36px;
}

.set-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.set-switch-track {
  width: 38px;
  height: 22px;
  border-radius: 22px;
  background: #d8deec;
  position: relative;
  transition: background 0.2s var(--ease-out);
  flex: none;
}

.set-switch-track i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(30, 42, 90, 0.2);
  transition: transform 0.2s var(--ease-out);
}

.set-switch input:checked + .set-switch-track { background: #2ecc8f; }
.set-switch input:checked + .set-switch-track i { transform: translateX(16px); }
.set-switch-text { font-size: 12px; color: var(--ink-2); }

.set-loading {
  padding: 26px;
  text-align: center;
  color: var(--ink-3);
  font-size: 12px;
}

.set-audit {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  padding: 6px 16px;
  box-shadow: var(--sh-sm);
}

.set-audit-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-2);
  font-size: 12px;
  color: var(--ink-2);
}

.set-audit-row:last-child { border-bottom: none; }
.set-audit-time { color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 110px; }
.set-audit-row code { color: var(--ink); background: var(--line-2); border-radius: 3px; padding: 2px 6px; }
.set-audit-act { margin-left: auto; color: var(--ink-3); }
.set-audit-empty { padding: 18px 0; text-align: center; font-size: 12px; color: var(--ink-3); }

/* ============================================================
   v1.4 · 内容与模块
   ============================================================ */
.ct-chain {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: var(--sh-sm);
}
.ct-chain-icon {
  width: 30px; height: 30px; flex: none;
  border-radius: var(--r-md);
  background: var(--orange-soft);
  color: var(--orange);
  display: grid; place-items: center; font-size: 15px; font-weight: 700;
}
.ct-chain-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.ct-chain-text { font-size: 12px; color: var(--ink-2); line-height: 1.7; margin-top: 3px; }
.ct-chain-text code, .ct-block-hint code {
  background: var(--line-2); border-radius: 3px; padding: 1px 5px; color: var(--ink);
}

.ct-status { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.ct-status-card {
  border: 1px solid var(--line); background: var(--card);
  border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--sh-sm);
}
.ct-status-k { font-size: 11px; color: var(--ink-3); letter-spacing: .4px; }
.ct-status-v { font-size: 24px; font-weight: 700; color: var(--ink); margin: 5px 0 2px; font-variant-numeric: tabular-nums; }
.ct-status-s { font-size: 11px; color: var(--ink-3); }

.ct-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 16px; align-items: start; }
.ct-side {
  border: 1px solid var(--line); background: var(--card); border-radius: var(--r-lg);
  padding: 8px; box-shadow: var(--sh-sm); position: sticky; top: 16px;
}
.ct-group {
  width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer;
  padding: 10px 12px; border-radius: var(--r-md); color: var(--ink-2); font-size: 13px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.ct-group:hover { background: var(--line-2); }
.ct-group.active { background: var(--orange-soft); color: var(--ink); font-weight: 700; }
.ct-group-n { font-size: 11px; color: var(--ink-3); font-weight: 400; }
.ct-side-note { padding: 10px 12px; font-size: 11px; color: var(--ink-3); line-height: 1.6; border-top: 1px solid var(--line-2); margin-top: 6px; }
.ct-main { min-width: 0; }

.ct-search { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ct-search input {
  flex: 1; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 9px 12px; font-size: 13px; color: var(--ink); background: var(--card); outline: none;
}
.ct-search input:focus { border-color: var(--orange); }
.ct-search span { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.ct-loading { padding: 28px; text-align: center; color: var(--ink-3); font-size: 13px; }

.ct-block {
  border: 1px solid var(--line); background: var(--card);
  border-radius: var(--r-lg); box-shadow: var(--sh-sm); margin-bottom: 14px; overflow: hidden;
}
.ct-block-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line-2);
}
.ct-block-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.ct-block-title small { font-weight: 400; color: var(--ink-3); font-size: 11px; margin-left: 8px; }
.ct-block-hint { font-size: 11px; color: var(--ink-3); line-height: 1.65; margin-top: 4px; max-width: 720px; }
.ct-block-ops { display: flex; gap: 8px; flex: none; }
.ct-block-body { padding: 12px 16px 16px; }
.ct-dirty { display: inline-block; background: var(--orange-soft); color: var(--orange); font-size: 10px; border-radius: 10px; padding: 2px 7px; margin-left: 8px; }

.ct-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ct-table th {
  text-align: left; font-size: 11px; color: var(--ink-3); font-weight: 600;
  padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.ct-table td { padding: 6px 8px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.ct-table tr:last-child td { border-bottom: 0; }
.ct-table input[type="text"], .ct-table select, .ct-table textarea,
.ct-field input[type="text"], .ct-field select, .ct-field textarea {
  width: 100%; box-sizing: border-box; border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 6px 8px; font-size: 12px; color: var(--ink);
  background: #fff; outline: none; font-family: inherit;
}
.ct-table input:focus, .ct-table select:focus, .ct-table textarea:focus,
.ct-field input:focus, .ct-field select:focus, .ct-field textarea:focus { border-color: var(--orange); }
.ct-table textarea, .ct-field textarea { resize: vertical; min-height: 58px; line-height: 1.6; }
.ct-static { color: var(--ink-3); font-size: 11px; }
.ct-switch { width: 16px; height: 16px; accent-color: var(--orange); cursor: pointer; }
.ct-row-ops { display: flex; gap: 4px; white-space: nowrap; justify-content: flex-end; }
.ct-mini {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: var(--r-sm); padding: 3px 7px; cursor: pointer; font-size: 11px; line-height: 1.4;
}
.ct-mini:hover { border-color: var(--orange); color: var(--orange); }
.ct-mini.danger:hover { border-color: var(--red); color: var(--red); }
.ct-add { margin-top: 10px; }

.ct-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ct-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ct-field.full { grid-column: 1 / -1; }
.ct-field label { font-size: 11px; color: var(--ink-2); font-weight: 600; }
.ct-field .ct-orig { font-size: 10px; color: var(--ink-3); font-weight: 400; }
.ct-status-row { display: grid; grid-template-columns: 110px 1fr 150px; gap: 10px; align-items: center; padding: 5px 0; }
.ct-status-row > span { font-size: 12px; color: var(--ink-2); }
.ct-status-row input[type="text"], .ct-status-row select {
  width: 100%; box-sizing: border-box; border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 6px 8px; font-size: 12px; color: var(--ink); background: #fff; outline: none;
}
.ct-status-row input:focus, .ct-status-row select:focus { border-color: var(--orange); }

.ct-page { border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 10px; overflow: hidden; }
.ct-page-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: var(--line-2); border: 0; padding: 10px 14px; cursor: pointer;
  font-size: 13px; font-weight: 700; color: var(--ink); text-align: left;
}
.ct-page-head span { font-weight: 400; font-size: 11px; color: var(--ink-3); }
.ct-page-items { padding: 12px 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ct-copy-row { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ct-copy-row label { font-size: 11px; color: var(--ink-2); line-height: 1.5; }
.ct-copy-row label code { color: var(--ink-3); font-size: 10px; }
.ct-empty { padding: 22px; text-align: center; color: var(--ink-3); font-size: 12px; }

.ct-modal { position: fixed; inset: 0; z-index: 90; background: rgba(30, 42, 90, .42); display: grid; place-items: center; }
.ct-modal[hidden] { display: none !important; }
.ct-modal-card { width: min(680px, calc(100vw - 32px)); background: var(--card); border-radius: var(--r-xl); box-shadow: var(--sh-lg); }
.ct-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 700; color: var(--ink); }
.ct-modal-x { border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--ink-3); cursor: pointer; }
.ct-modal-body { padding: 16px 20px; }
.ct-modal-body p { font-size: 12px; color: var(--ink-2); line-height: 1.7; margin: 0 0 10px; }
.ct-modal-body textarea {
  width: 100%; box-sizing: border-box; min-height: 240px; resize: vertical;
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px;
  font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--ink); outline: none;
}
.ct-modal-body textarea:focus { border-color: var(--orange); }
.ct-import-msg { font-size: 12px; color: var(--red); margin-top: 8px; min-height: 16px; }
.ct-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }

@media (max-width: 1100px) {
  .ct-status { grid-template-columns: repeat(2, 1fr); }
  .ct-layout { grid-template-columns: 1fr; }
  .ct-side { position: static; display: flex; flex-wrap: wrap; }
  .ct-group { width: auto; }
  .ct-side-note { display: none; }
}
@media (max-width: 900px) {
  .mini-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-card.wide {
    width: calc(100vw - 24px);
  }

  .set-ready,
  .set-grid {
    grid-template-columns: 1fr;
  }

  .ready-desc { min-height: 0; }
}

/* 运行健康（006 可观测性） */
.health-list {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.health-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin: 8px 0 6px;
}

.health-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-size: 12px;
}

.health-msg {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
}

.health-count {
  flex: none;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 600;
}

/* 团队与权限（007） */
.staff-list { display: flex; flex-direction: column; gap: 8px; }
.staff-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 12px; background: #fff;
}
.staff-uid { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-family: ui-monospace, monospace; }
.staff-self { color: var(--orange); font-weight: 600; }
.staff-role { width: 110px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; background: #fff; }
.staff-del { border: none; background: none; color: var(--ink-3); font-size: 12px; cursor: pointer; }
.staff-del:hover { color: var(--red); }
.staff-tip { margin-top: 10px; font-size: 12px; line-height: 1.7; color: var(--ink-3); }

.health-actions { margin-top: 12px; }
