/* ==========================================================================
   微积分-OPC · 设计令牌与响应式基线 v1（2026-11-13）
   适用范围：/admin（机构端）、/platform（平台总后台）、/b（品牌方）、三端登录页
   品牌 V2.0：唯一信号色 #22D3EE，极黑 #070708。
   绿/黄/红为功能语义色（成功/警告/错误），不作为品牌信号色。
   约束：本文件不新增任何「必需」class，四端 JS 模板零改动；旧类名全部保留。
   ========================================================================== */

:root {
  /* 品牌 */
  --brand: #070708;
  --brand-2: #141a20;
  --signal: #22d3ee;
  --signal-deep: #0e7490;   /* 浅底上的可读强调色（链接/文字） */
  --signal-ink: #04222a;    /* 青底上的文字 */
  /* 中性 */
  --ink: #131a24;
  --ink-soft: #5f6b7d;
  --ink-faint: #8d98a8;
  --bg: #f4f7fa;
  --card: #ffffff;
  --line: #e3e9f1;
  --line-soft: #eef2f7;
  /* 功能语义色 */
  --ok: #15803d;
  --warn: #b45309;
  --danger: #b3261e;
  /* 形制 */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(7, 7, 8, .04);
  --shadow-pop: 0 12px 32px rgba(7, 7, 8, .18);
  /* 兼容旧变量名：历史内联样式可能引用 */
  --teal: var(--signal);
  --amber: var(--warn);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* 全局可访问性：键盘焦点统一用信号色 */
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   应用壳：桌面 = 左侧深色固定侧栏；≤900px = 顶部横向可滚动导航条
   -------------------------------------------------------------------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: var(--brand);
  color: #e8edf8;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  min-width: 0;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--signal); color: var(--signal-ink);
  display: grid; place-items: center; font-weight: 700; flex: 0 0 auto;
}
.brand strong { display: block; font-size: 15px; letter-spacing: .5px; white-space: nowrap; }
.brand small { color: #94a4bd; font-size: 11px; white-space: nowrap; }

.nav { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: #c4cfe0; text-decoration: none; font-size: 14px; white-space: nowrap;
}
.nav-item .dot { width: 5px; height: 5px; border-radius: 50%; background: #4c5f88; flex: 0 0 auto; }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active { background: rgba(34, 211, 238, .16); color: #fff; }
.nav-item.active .dot { background: var(--signal); }

.sidebar-foot {
  margin-top: auto; padding: 14px 10px 2px;
  border-top: 1px solid rgba(255, 255, 255, .09);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px; color: #94a4bd;
}
.link-btn { background: none; border: 0; color: #94a4bd; cursor: pointer; font-size: 12px; padding: 4px; }
.link-btn:hover { color: #fff; }

.main { flex: 1; min-width: 0; padding: 24px 28px 40px; }
.topbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 20px;
}
.topbar h1 { margin: 0 0 4px; font-size: 22px; line-height: 1.3; }
.sub { margin: 0; color: var(--ink-soft); font-size: 13px; }
.chip {
  background: var(--card); border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 999px; font-size: 12px; color: var(--ink-soft);
  white-space: nowrap;
}

.view { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.view > * { min-width: 0; }

/* --------------------------------------------------------------------------
   卡片 / 指标 / 栅格
   -------------------------------------------------------------------------- */
.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.metric {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--shadow); min-width: 0;
}
.metric span { color: var(--ink-soft); font-size: 12px; }
.metric strong { font-size: 24px; font-weight: 600; line-height: 1.2; }

.grid-2 { display: grid; grid-template-columns: 1.05fr .95fr; gap: 16px; align-items: start; min-width: 0; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow);
  /* 关键：宽表格在卡片内横向滚动，而不是把单元格压成一字一行 */
  overflow-x: auto;
}
.card header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
}
.card h2 { margin: 0; font-size: 15px; line-height: 1.4; }
.hint { color: var(--ink-soft); font-size: 12px; margin: 0; overflow-wrap: anywhere; }

.todo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.todo {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--line); border-left: 3px solid var(--warn);
  border-radius: var(--radius-sm); padding: 10px 12px; flex-wrap: wrap;
}
.todo strong { display: block; font-size: 13px; margin-bottom: 3px; }
.todo span { color: var(--ink-soft); font-size: 12px; }
.todo.done { border-left-color: var(--ok); }

/* --------------------------------------------------------------------------
   表格：窄屏设最小宽度 + 卡片内滚动（见 @media ≤900px）
   -------------------------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-weight: 500; color: var(--ink-soft);
  padding: 8px 6px; border-bottom: 1px solid var(--line); font-size: 12px;
}
.table td { padding: 10px 6px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }

.tag {
  background: rgba(34, 211, 238, .15); color: var(--signal-deep);
  padding: 2px 8px; border-radius: 999px; font-size: 12px;
  display: inline-block; white-space: nowrap;
}

/* --------------------------------------------------------------------------
   按钮 / 表单
   -------------------------------------------------------------------------- */
.btn {
  border: 0; border-radius: var(--radius-sm); padding: 9px 16px;
  font-size: 13px; cursor: pointer; font-family: inherit; line-height: 1.4;
}
.btn-primary { background: var(--signal); color: var(--signal-ink); font-weight: 500; }
.btn-primary:disabled { background: #bfeaf2; color: #4a6b74; cursor: not-allowed; }
.btn-ghost { background: var(--card); border: 1px solid var(--line); color: var(--ink); font-size: 12px; }
.btn:hover:not(:disabled) { filter: brightness(.96); }

.form-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.form-inline label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--ink-soft); min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--ink-soft); min-width: 0; }
.form-grid .full { grid-column: 1 / -1; min-width: 0; }
.form-grid .btn { width: auto; }
textarea {
  font-family: inherit; font-size: 13px; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px;
  background: var(--card); resize: vertical; max-width: 100%;
}

input, select {
  font-family: inherit; font-size: 13px; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px;
  background: var(--card); min-width: 0; max-width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(34, 211, 238, .35); border-color: var(--signal);
}

/* --------------------------------------------------------------------------
   交付与验收
   -------------------------------------------------------------------------- */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 20px; margin: 12px 0; }
.detail-grid div { display: flex; gap: 10px; font-size: 13px; min-width: 0; }
.detail-grid dt { color: var(--ink-soft); min-width: 64px; flex: 0 0 auto; }
.detail-grid dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.checklist-edit { list-style: none; margin: 10px 0; padding: 0; }
.checklist-edit li { padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.checklist-edit li:last-child { border-bottom: 0; }
.checklist-edit label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.checklist-edit input { margin-top: 3px; }
.review-summary { display: block; margin-top: 12px; font-size: 12px; color: var(--ink-soft); }
.review-summary textarea { width: 100%; margin-top: 6px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.form-actions .btn { width: auto; }
.versions { margin-top: 6px; }
.version { border-top: 1px solid var(--line-soft); padding: 12px 0; }
.version:first-child { border-top: 0; }
.version-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.version-head strong { font-size: 13px; }
.version-head span { font-size: 12px; color: var(--ink-soft); }
.version-summary { font-size: 13px; line-height: 1.7; margin: 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.work-link { font-size: 12px; color: var(--signal-deep); word-break: break-all; }
.review-box { margin-top: 10px; border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12px; }
.review-box.ok { background: #e9f8f0; color: var(--ok); }
.review-box.bad { background: #fdecec; color: var(--danger); }
.review-box p { margin: 6px 0; color: #3c4657; line-height: 1.6; }
.review-box .reviewer { color: var(--ink-soft); }
.checklist { list-style: none; margin: 6px 0 0; padding: 0; }
.checklist li { font-size: 12px; line-height: 1.8; }
.checklist .pass { color: var(--ok); }
.checklist .fail { color: var(--danger); }
.log-list { list-style: none; margin: 6px 0 0; padding: 0; }
.log-list li { padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.log-list li:last-child { border-bottom: 0; }
.log-to { font-weight: 600; margin-right: 8px; }
.log-meta { color: var(--ink-soft); }
.log-note { display: block; color: #55617a; margin-top: 4px; overflow-wrap: anywhere; }

/* --------------------------------------------------------------------------
   空状态 / 提示 / 标签 / 反馈
   -------------------------------------------------------------------------- */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 28px 12px; color: var(--ink-soft); text-align: center;
  border: 1px dashed var(--line); border-radius: var(--radius-sm);
}
.empty strong { color: var(--ink); font-size: 13px; }
.empty span { font-size: 12px; }

.notice {
  display: flex; flex-direction: column; gap: 4px;
  background: #fffbf4; border: 1px solid #f5e2c6; border-left: 3px solid var(--warn);
  border-radius: var(--radius-sm); padding: 12px 14px;
}
.notice strong { font-size: 13px; }
.notice span { color: var(--ink-soft); font-size: 12px; overflow-wrap: anywhere; }
.notice.err { background: #fff5f5; border-color: #ffd0d0; border-left-color: var(--danger); }

.muted { color: var(--ink-faint); }
.bad-text { color: var(--danger); font-weight: 600; }
.muted-text { color: var(--ink-faint); }

/* v16：派单回收倒计时（表格内秒级刷新） */
.cd { font-variant-numeric: tabular-nums; font-size: 12px; white-space: nowrap; }
.cd.live { color: var(--warn); font-weight: 500; }
.cd.urgent { color: var(--danger); font-weight: 600; }
.cd.over { color: var(--danger); }

.tabs-inline { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tab-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
  padding: 6px 14px; border-radius: 999px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.tab-btn.active { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--brand); color: #fff; padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: 13px; z-index: 80; max-width: calc(100% - 32px);
  box-shadow: var(--shadow-pop); text-align: center;
}
.toast.ok { background: #0f7a5f; }
.toast.err { background: var(--danger); }

/* --------------------------------------------------------------------------
   登录页
   -------------------------------------------------------------------------- */
.login-body { display: grid; place-items: center; min-height: 100vh; background: var(--brand); padding: 20px; }
.login-card {
  width: min(360px, calc(100% - 32px)); background: var(--card); border-radius: var(--radius-lg); padding: 28px 26px;
  display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-pop);
}
.brand-login { padding: 0 0 6px; }
.brand-login .brand-mark { background: var(--signal); color: var(--signal-ink); }
.login-card h1 { margin: 6px 0 0; font-size: 20px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--ink-soft); min-width: 0; }
.login-card input { width: 100%; }
.login-card .btn { margin-top: 6px; }
.error { color: var(--danger); font-size: 12px; margin: 4px 0 0; }

/* --------------------------------------------------------------------------
   版本增量：v13 / v14 / v15 的新类名（全部保留）
   -------------------------------------------------------------------------- */
.tag.ok { background: #e7f7ee; color: var(--ok); }
.tag.payment { background: #eaf1ff; color: #2f6bff; }
.tag.sms { background: #fff0f6; color: #d6336c; }
.tag.vod { background: #e6f7fb; color: var(--signal-deep); }
.tag.bad { background: #fdecec; color: var(--danger); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.form-grid label.chk { flex-direction: row; align-items: center; gap: 8px; }
.f-field { width: 100%; }
code { background: var(--bg); padding: 1px 6px; border-radius: 6px; font-size: 12px; color: #34435c; overflow-wrap: anywhere; }

.cell-sub { display: block; color: var(--ink-soft); font-size: 11px; margin-top: 3px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrap-code { display: inline-block; max-width: 100%; word-break: break-all; white-space: normal; line-height: 1.7; }
.file-id { display: inline-block; max-width: 220px; word-break: break-all; }
.add-video { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.admin-video-table td:last-child { width: 50%; }
.v-upload-feedback { display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; row-gap: 3px; margin-top: 5px; font-size: 12px; color: var(--ink-soft); }
.v-upload-message { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.v-progress { width: 100%; max-width: 260px; height: 8px; flex-basis: 100%; accent-color: var(--signal); }
#play-card { min-width: 0; }
#player-host { width: min(100%, 720px); }
.mc-player { display: block; width: 100%; max-height: 65vh; aspect-ratio: 16 / 9; background: var(--brand); border-radius: var(--radius-sm); }
.mc-player[hidden] { display: none; }
.code-block { margin: 12px 0 0; padding: 12px; border-radius: var(--radius-sm); background: var(--bg); color: #34435c; font-size: 11px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; max-height: 260px; overflow: auto; }
.form-grid textarea { width: 100%; min-height: 60px; resize: vertical; }
.vod-steps { margin: 6px 0 14px; padding-left: 20px; font-size: 13px; line-height: 1.9; color: var(--ink); }
.vod-steps li { padding-left: 4px; overflow-wrap: anywhere; }
.vod-urls { background: var(--bg); border-radius: var(--radius-sm); padding: 10px 14px; }
.vod-urls p { margin: 6px 0; font-size: 12px; overflow-wrap: anywhere; }

/* --------------------------------------------------------------------------
   响应式断点
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .sidebar { width: 208px; flex-basis: 208px; }
  .main { padding: 20px 20px 36px; }
}

/* 侧栏从「左侧竖排」切到「顶部横向滚动条」，内容区拿回整屏宽度 */
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; flex: 0 0 auto;
    flex-direction: row; align-items: center; gap: 10px;
    padding: 8px 12px; position: sticky; top: 0; z-index: 40;
    box-shadow: 0 2px 12px rgba(7, 7, 8, .18);
  }
  .brand { padding: 0; flex: 0 0 auto; }
  .brand-mark { width: 28px; height: 28px; border-radius: 8px; font-size: 13px; }
  .brand strong { font-size: 13px; }
  .brand small { display: none; }
  .nav {
    flex: 1 1 auto; min-width: 0;
    flex-direction: row; flex-wrap: nowrap; gap: 2px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { flex: 0 0 auto; padding: 7px 9px; font-size: 12px; }
  .sidebar-foot { margin: 0; padding: 0; border-top: 0; flex: 0 0 auto; }
  .sidebar-foot .user-label { display: none; }

  .main { padding: 16px 16px 36px; }
  .topbar h1 { font-size: 20px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 14px 14px; }

  /* 表格：给足最小宽度 + 单元格不换行，宽表在卡片内横向滚动 */
  .table { min-width: 600px; }
  .table th, .table td { white-space: nowrap; }
  .table .wrap-code, .table .file-id, .table .cell-sub { white-space: normal; }
}

@media (max-width: 600px) {
  .main { padding: 12px 12px 32px; }
  .topbar { gap: 6px; }
  .topbar h1 { font-size: 18px; }
  .card { padding: 12px 12px; border-radius: var(--radius-sm); }
  .metrics { gap: 8px; }
  .metric { padding: 10px 12px; }
  .metric strong { font-size: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-inline label { flex: 1 1 100%; }
  .form-inline .btn, .form-actions .btn { flex: 1 1 auto; }
  .tag { font-size: 11px; }
  .btn { padding: 9px 12px; }
  .row-actions { gap: 4px; }
  .code-block { font-size: 11px; }
  .toast { bottom: 16px; }
}

@media (max-width: 380px) {
  .metrics { grid-template-columns: 1fr; }
  .brand strong { font-size: 12px; }
  .nav-item { padding: 6px 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   v17：认证闭环（过程考核 / 认证推荐 / 平台发证）
   ========================================================================== */
.warn-text { color: var(--danger); }
.cert-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.cert-block:first-of-type { border-top: 0; padding-top: 0; margin-top: 12px; }
.cert-block h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--ink); }
.cert-block summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink); }
.rubric-list { margin: 8px 0 0; padding-left: 18px; font-size: 12px; color: var(--ink-soft); }
.rubric-list li { margin: 3px 0; }

/* ==========================================================================
   v18：履约信任闭环（任务沟通 / 附件 / 争议仲裁）
   ========================================================================== */
.chat-list {
  list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
}
.chat-item {
  background: var(--bg); border-radius: 10px; padding: 9px 12px; max-width: 78%;
  align-self: flex-start; min-width: 0;
}
.chat-item.mine { align-self: flex-end; background: rgba(34, 211, 238, .12); }
.chat-item.system {
  align-self: center; max-width: 100%; background: transparent;
  border: 1px dashed var(--line); color: var(--ink-faint);
}
.chat-meta {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 11px; color: var(--ink-faint); margin-bottom: 3px;
}
.chat-body { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink); overflow-wrap: anywhere; }
.chat-item.system .chat-body { font-size: 12px; color: var(--ink-faint); }
.chat-form { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.chat-form input { flex: 1 1 auto; min-width: 0; }
.chat-form .btn { flex: 0 0 auto; width: auto; padding-inline: 18px; }

.file-list { list-style: none; margin: 8px 0 0; padding: 0; }
.file-list li {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 12px;
}
.file-list li:last-child { border-bottom: 0; }
.file-list a { color: var(--signal-deep); text-decoration: none; overflow-wrap: anywhere; min-width: 0; }
.file-list a:hover { text-decoration: underline; }
.file-size { color: var(--ink-faint); font-size: 11px; white-space: nowrap; }
.file-queue { list-style: none; margin: 6px 0 0; padding: 0; font-size: 12px; color: var(--ink-soft); }
.file-queue li { padding: 3px 0; overflow-wrap: anywhere; }
.block-title { font-size: 13px; margin: 16px 0 6px; color: var(--ink); }
.card.dispute { border-left: 3px solid var(--signal); }
.empty-line { padding: 18px 0; text-align: center; font-size: 13px; color: var(--ink-faint); }
.evidence-pick {
  display: block; margin-top: 10px; font-size: 12px; color: var(--ink-soft);
}
.evidence-pick input[type="file"] { margin-top: 6px; font-size: 12px; }

/* ==========================================================================
   v19：派单引擎 V2 / 人工补派 / 告警（平台总后台）
   ========================================================================== */
.btn-sm { font-size: 12px; padding: 3px 10px; border-radius: 7px; line-height: 1.5; }
td.ops { white-space: nowrap; }
td.ops .btn + .btn { margin-left: 6px; }

.dot-badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--danger, #b3261e); color: #fff; font-size: 11px; line-height: 1;
  border-radius: 9px; margin-left: 6px; vertical-align: middle;
}

.card.alert-card { border-left: 3px solid var(--danger, #b3261e); }
.alert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.alert-item {
  display: flex; gap: 12px; align-items: flex-start; justify-content: space-between;
  background: #fff8f7; border: 1px solid #f2d3cf; border-radius: 10px; padding: 10px 12px;
  flex-wrap: wrap;
}
.alert-main { display: grid; gap: 3px; min-width: 0; flex: 1 1 320px; }
.alert-main strong { font-size: 13px; }
.alert-main span { font-size: 12px; color: var(--ink-soft, #66717f); overflow-wrap: anywhere; }
.alert-ops { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* 人工补派 / 派单依据 抽屉 */
.msheet-mask {
  position: fixed; inset: 0; z-index: 90; background: rgba(7, 7, 8, .48);
  display: flex; align-items: flex-start; justify-content: center; padding: 30px 16px; overflow: auto;
}
.msheet {
  width: min(980px, 100%); background: var(--card, #fff); color: var(--ink, #161c24);
  border-radius: 16px; box-shadow: 0 24px 60px rgba(7, 7, 8, .3);
  display: flex; flex-direction: column; max-height: calc(100vh - 60px);
}
.msheet-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--line, #e3e8f0);
}
.msheet-head h3 { margin: 0 0 3px; font-size: 16px; }
.msheet-head p { margin: 0; font-size: 12px; color: var(--ink-soft, #66717f); }
.msheet-body { padding: 14px 18px; overflow: auto; }
.msheet-foot {
  display: flex; gap: 10px; align-items: center; justify-content: flex-end;
  padding: 12px 18px; border-top: 1px solid var(--line, #e3e8f0); flex-wrap: wrap;
}
.msheet-foot .grow { margin-right: auto; font-size: 12px; color: var(--ink-soft, #66717f); }

.cand-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.cand-table th, .cand-table td { padding: 7px 8px; border-bottom: 1px solid var(--line-soft, #f0f2f6); text-align: left; }
.cand-table th { font-size: 11px; color: var(--ink-faint, #8a94a6); font-weight: 600; white-space: nowrap; }
.cand-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.cand-table tr.picked { background: rgba(34, 211, 238, .09); }
.cand-table tr.blocked { color: var(--ink-faint, #8a94a6); }
.score-pill {
  display: inline-block; min-width: 46px; text-align: center; padding: 1px 7px;
  border-radius: 8px; background: rgba(34, 211, 238, .16); color: #0e7490; font-weight: 600;
}
.score-pill.low { background: #f2f4f7; color: #66717f; }
.bd-bar { display: flex; gap: 2px; height: 6px; border-radius: 3px; overflow: hidden; background: #eef1f6; margin-top: 4px; }
.bd-bar i { display: block; height: 100%; }
.bd-legend { font-size: 10px; color: var(--ink-faint, #8a94a6); margin-top: 3px; }
.radios { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.radios label { display: inline-flex; gap: 5px; align-items: center; }
.block-reason { font-size: 11px; color: #b3261e; }

/* 带操作列的宽表：窄屏保留最小宽度，让卡片内横向滚动，避免列被压成一字一行 */
.table-ops { min-width: 920px; }
.table-ops td.ops { white-space: nowrap; }
/* 补派抽屉里候选表最小宽度，避免窄屏把列压成一字一行 */
.cand-table { min-width: 760px; }

/* ==========================================================================
   v20：经营看板 / 审核 / 风控 / 财务 / 服务 / 卡券 / 工单 / 审计 新增组件
   ========================================================================== */

/* 指标卡按数量自适应（4 列时不留空位） */
.metrics.m1 { grid-template-columns: 1fr; }
.metrics.m2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metrics.m3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metrics.m4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric small { color: var(--ink-faint); font-size: 11px; display: block; margin-top: 4px; }

/* 横向柱状图（月度需求量） */
.bar-list { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 62px 1fr 46px; gap: 10px; align-items: center; font-size: 12px; }
.bar-label { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.bar-track { display: block; height: 8px; border-radius: 4px; background: #eef1f6; overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 4px; background: var(--signal); min-width: 2px; }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }

/* 表格数字列统一右对齐 */
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 行内表单 / 筛选条 */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filter-bar input, .filter-bar select { margin: 0; }
.filter-bar input { flex: 1 1 180px; min-width: 140px; }

/* 详情抽屉/弹层里的字段表 */
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* 风控等级 / 状态标记 */
.tag { display: inline-block; padding: 1px 8px; border-radius: 8px; font-size: 11px; background: #f2f4f7; color: #4b5563; }
.tag.high { background: #fdecec; color: #b3261e; }
.tag.mid { background: #fff4e5; color: #a45c00; }
.tag.low { background: #eef7f0; color: #1f7a45; }
.tag.ok { background: #e8f7f1; color: #0f7a5f; }
.tag.dim { background: #f2f4f7; color: #7b8698; }

/* 工单会话气泡 */
.thread { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding: 4px; }
.msg { max-width: 78%; padding: 8px 12px; border-radius: 12px; font-size: 13px; background: #f4f6fa; }
.msg.me { align-self: flex-end; background: rgba(34, 211, 238, .14); }
.msg .meta { display: block; font-size: 10px; color: var(--ink-faint); margin-top: 4px; }

@media (max-width: 900px) {
  .metrics.m3, .metrics.m4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bar-row { grid-template-columns: 52px 1fr 38px; }
}
@media (max-width: 600px) {
  .metrics, .metrics.m1, .metrics.m2, .metrics.m3, .metrics.m4 { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 76px 1fr; }
}

/* 危险操作按钮（卡券作废、强制结单等） */
.btn-danger { background: #b3261e; color: #fff; font-weight: 500; border-color: #b3261e; }
.btn-danger:hover { background: #971d17; }

/* Course, cohort and schedule management */
.admin-list { min-width: 0; }
.admin-list .admin-list-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.admin-list-header .hint { margin-top: 4px; }
.admin-list-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 8px; }
.admin-list-filters input { flex: 1 1 210px; width: auto; max-width: 330px; }
.admin-list-filters select { width: auto; }
.admin-list-filters [data-filter-count] { margin-inline-start: auto; }
.admin-table-wrap { max-width: 100%; overflow-x: auto; }
.admin-table-wrap .table { min-width: 580px; }
.admin-list .table td { padding-block: 8px; }
.admin-course-table td:first-child { width: 28%; }
.admin-row-title { display: block; font-weight: 700; color: var(--ink); text-decoration: none; }
.admin-row-title:hover { text-decoration: underline; }
.admin-row-summary { display: block; color: var(--ink-soft); font-size: 12px; max-width: min(28vw, 360px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.admin-row-actions .btn { white-space: nowrap; }
.admin-row-actions .admin-danger { color: #a22929; }
.admin-action-note { font-size: 11px; color: var(--ink-soft); }
.admin-list-empty { margin: 12px 0 0; padding: 12px 0; color: var(--ink-soft); }
.admin-secondary > summary, .admin-vod-status > summary { cursor: pointer; font-weight: 650; }
.admin-secondary[open] > summary, .admin-vod-status[open] > summary { margin-bottom: 12px; }
.admin-vod-status > summary { padding-inline: 6px; }
.admin-vod-status .tag { margin-inline-start: 5px; }
.admin-list .admin-detail-title { font-size: 21px; margin: 6px 0 2px; }
.admin-detail-nav { display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.admin-detail-nav button { border: 1px solid transparent; border-radius: 8px; background: none; color: var(--ink-soft); cursor: pointer; padding: 6px 12px; font: inherit; }
.admin-detail-nav button[aria-pressed="true"] { color: #13463b; background: #e6f1eb; border-color: #c8ded3; font-weight: 650; }
.admin-course-description { white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-editor { width: min(620px, calc(100% - 24px)); max-height: calc(100% - 24px); border: 1px solid var(--line-soft); border-radius: 14px; padding: 0; color: var(--ink); background: #fff; }
.admin-editor::backdrop { background: rgb(20 39 33 / 46%); }
.admin-editor form { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100dvh - 30px); }
.admin-editor header, .admin-editor footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 18px; }
.admin-editor header { border-bottom: 1px solid var(--line-soft); }
.admin-editor h2 { margin: 0; font-size: 17px; }
.admin-editor footer { justify-content: flex-end; border-top: 1px solid var(--line-soft); }
.admin-editor-fields { padding: 16px 18px; overflow: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-editor-fields > p { margin: 0; }
.admin-editor [hidden], .admin-list [hidden], [data-course-panel][hidden] { display: none !important; }
.admin-editor-error { color: #8b2424; background: #fdf0ee; border-radius: 8px; padding: 9px 11px; }
.admin-editor .admin-danger-button { background: #a22929; border-color: #a22929; color: #fff; }
@media (max-width: 580px) {
  .admin-editor-fields { grid-template-columns: 1fr; }
  .admin-list-filters input { flex-basis: 100%; max-width: none; }
  .admin-row-summary { max-width: 185px; }
}

.console.admin-teaching-view { min-width: 0; }
@media (max-width: 1100px) {
  .admin-teaching-view .top-search { display: none; }
  .admin-teaching-view .top-user { margin-inline-start: auto; }
}
@media (max-width: 760px) {
  .admin-teaching-view .rail { width: 54px; }
  .admin-teaching-view .rail-top { justify-content: center; padding-inline: 0; }
  .admin-teaching-view .rail-name, .admin-teaching-view .nav-label, .admin-teaching-view .nav-item span,
  .admin-teaching-view .rail-user > .av, .admin-teaching-view .rail-user > .grow { display: none; }
  .admin-teaching-view .rail-scroll { padding-inline: 5px; }
  .admin-teaching-view .nav-item { justify-content: center; padding-inline: 0; }
  .admin-teaching-view .rail-foot { padding-inline: 2px; }
  .admin-teaching-view .page { padding: 16px 10px 30px; }
  .admin-teaching-view .topbar { padding-inline: 10px; gap: 8px; }
  .admin-teaching-view .top-user > div { display: none; }
  .admin-teaching-view .crumb { min-width: 0; }
  .admin-teaching-view .crumb span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .admin-table-wrap .admin-stack-table { min-width: 0; }
  .admin-stack-table thead { display: none; }
  .admin-stack-table, .admin-stack-table tbody { display: block; }
  .admin-stack-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 8px; padding-block: 7px; border-top: 1px solid var(--line-soft); }
  .admin-list .admin-stack-table td { white-space: normal; overflow-wrap: anywhere; padding: 3px 0; border: 0; }
  .admin-stack-table td:first-child, .admin-stack-table td:last-child { grid-column: 1 / -1; width: auto; }
  .admin-video-table td:last-child { width: auto; }
  .admin-row-summary { max-width: none; }
}
