/* =========================================================
   学员服务中枢 · 视觉体系
   清新亮丽 / 橙 × 深蓝
   ========================================================= */

:root {
  --navy-900: #0B1D3C;
  --navy-800: #102A55;
  --navy-700: #17376B;
  --navy-600: #1F4A88;
  --navy-500: #2A5FA8;

  --orange-600: #EE6A08;
  --orange-500: #FF7A1A;
  --orange-400: #FF9A4D;
  --orange-200: #FFD9BC;
  --orange-050: #FFF3E8;

  --mint: #10B39A;
  --mint-050: #E6F8F5;
  --red: #E23E32;
  --red-050: #FDECEA;
  --blue: #3A7BEA;
  --blue-050: #EBF2FE;
  --gold: #EEA61C;
  --gold-050: #FEF5E3;

  --bg: #F2F6FB;
  --panel: #FFFFFF;
  --panel-2: #F8FBFF;
  --line: #E6EEF8;
  --line-strong: #D5E1F0;
  --ink: #132440;
  --ink-2: #55698C;
  --ink-3: #8DA0BC;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --sh-1: 0 2px 8px rgba(16, 42, 85, .05);
  --sh-2: 0 8px 24px rgba(16, 42, 85, .07);
  --sh-3: 0 18px 44px rgba(16, 42, 85, .14);
  --sh-orange: 0 8px 20px rgba(255, 122, 26, .28);

  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 480px at 8% -12%, rgba(255, 154, 77, .16), transparent 62%),
    radial-gradient(820px 560px at 102% 4%, rgba(42, 95, 168, .13), transparent 66%),
    radial-gradient(700px 500px at 60% 110%, rgba(16, 179, 154, .07), transparent 70%);
}

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
h2, h3, p { margin: 0; }
svg { display: block; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #CBD9EC; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #B3C6E0; }
::-webkit-scrollbar-track { background: transparent; }

.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

/* =========================================================
   顶栏
   ========================================================= */
.topbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 66px;
  padding: 0 20px;
  flex: 0 0 66px;
  background: linear-gradient(118deg, var(--navy-900) 0%, var(--navy-800) 42%, var(--navy-600) 100%);
  overflow: hidden;
}

.topbar::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -110px;
  width: 340px;
  height: 260px;
  background: radial-gradient(closest-side, rgba(255, 122, 26, .34), transparent 72%);
  pointer-events: none;
}

.topbar::before {
  content: "";
  position: absolute;
  left: 240px;
  bottom: -80px;
  width: 260px;
  height: 160px;
  background: radial-gradient(closest-side, rgba(63, 128, 214, .28), transparent 72%);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(140deg, var(--orange-400), var(--orange-600));
  box-shadow: 0 6px 16px rgba(255, 122, 26, .38);
}

.brand-mark svg { width: 21px; height: 21px; }

.brand-name {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .4px;
}

.brand-sub {
  color: rgba(255, 255, 255, .58);
  font-size: 11px;
  letter-spacing: .2px;
  margin-top: 1px;
}

.account-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .1);
  position: relative;
  z-index: 1;
}

.acc-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, .74);
  font-size: 12.5px;
  font-weight: 600;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.acc-tab:hover { color: #fff; background: rgba(255, 255, 255, .1); }

.acc-tab.is-active {
  background: #fff;
  color: var(--navy-800);
  box-shadow: 0 4px 14px rgba(4, 14, 32, .22);
}

.acc-tab .acc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .5);
}

.acc-tab.is-active .acc-dot { background: var(--orange-500); }
.acc-tab[data-kind="wecom"] .acc-dot { background: var(--mint); }

.acc-tab .acc-unread {
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--orange-500);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}

.acc-tab.is-active .acc-unread { background: var(--orange-600); }
.acc-tab .acc-unread[hidden] { display: none; }

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  position: relative;
  z-index: 1;
}

.btn-sim {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 9px;
  background: rgba(255, 255, 255, .09);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  transition: background .18s, border-color .18s, transform .18s;
}

.btn-sim:hover {
  background: rgba(255, 122, 26, .22);
  border-color: rgba(255, 154, 77, .55);
}

.btn-sim:active { transform: scale(.97); }

.dot-live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4AE0C0;
  box-shadow: 0 0 0 0 rgba(74, 224, 192, .55);
  animation: pulse-live 2s infinite;
}

@keyframes pulse-live {
  0% { box-shadow: 0 0 0 0 rgba(74, 224, 192, .5); }
  70% { box-shadow: 0 0 0 7px rgba(74, 224, 192, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 224, 192, 0); }
}

.icon-btn {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 9px;
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .86);
  transition: background .18s, color .18s;
}

.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.icon-btn.is-on { background: rgba(255, 122, 26, .26); color: #FFD9BC; border-color: rgba(255,154,77,.5); }

.bell-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--orange-500);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid var(--navy-800);
  line-height: 1;
}

.bell-count[hidden] { display: none; }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #FFF, #DCE8F7);
  color: var(--navy-800);
  font-size: 12.5px;
  font-weight: 700;
  margin-left: 2px;
}

/* =========================================================
   视图标签
   ========================================================= */
.viewtabs {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 48px;
  flex: 0 0 48px;
  padding: 0 20px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.vt {
  position: relative;
  height: 48px;
  padding: 0 15px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .2px;
  transition: color .18s;
}

.vt::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 2.5px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, var(--orange-500), var(--orange-400));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .22s cubic-bezier(.4, 0, .2, 1);
}

.vt:hover { color: var(--navy-700); }
.vt.is-active { color: var(--navy-800); }
.vt.is-active::after { transform: scaleX(1); }

.vt-badge {
  display: none;
  margin-left: 6px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--orange-050);
  color: var(--orange-600);
  font-size: 10.5px;
  font-weight: 700;
  vertical-align: 1px;
}

.vt-badge.is-on { display: inline-grid; place-items: center; }

.vt-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.guard-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--mint-050);
  color: #0A8C79;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid #C9EFE8;
}

.source-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--orange-050);
  color: var(--orange-600);
  border: 1px solid var(--orange-200);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background .16s, color .16s, border-color .16s, transform .16s;
}

.source-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.source-pill:hover { transform: translateY(-1px); }
.source-pill:active { transform: translateY(0); }

.source-pill.is-live {
  background: var(--mint-050);
  color: #0A8C79;
  border-color: #C9EFE8;
}

.source-pill.is-warn {
  background: var(--gold-050);
  color: #A87608;
  border-color: #F5E3BC;
}

.guard-pill svg { width: 14px; height: 14px; }

/* =========================================================
   主内容区
   ========================================================= */
.main {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}

.view { display: none; height: 100%; }
.view.is-active { display: block; }

.console-grid {
  display: grid;
  grid-template-columns: 318px minmax(420px, 1fr) 336px;
  height: 100%;
  min-height: 0;
}

/* ---------- 会话列表 ---------- */
.conv-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(8px);
  border-right: 1px solid var(--line);
}

.pane-head { padding: 14px 14px 10px; flex: 0 0 auto; }

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 11px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  transition: border-color .18s, box-shadow .18s;
}

.search-box:focus-within {
  border-color: var(--orange-400);
  box-shadow: 0 0 0 3px rgba(255, 154, 77, .16);
}

.search-box svg { width: 16px; height: 16px; color: var(--ink-3); flex: 0 0 auto; }

.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12.5px;
  color: var(--ink);
}

.search-box input::placeholder { color: var(--ink-3); }
.search-box input::-webkit-search-cancel-button { display: none; }

.filters { display: flex; gap: 6px; margin-top: 10px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 27px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  transition: all .16s;
}

.chip b {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-3);
  background: var(--panel-2);
  border-radius: 5px;
  padding: 1px 5px;
}

.chip:hover { border-color: var(--line-strong); color: var(--navy-700); }

.chip.is-active {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
}

.chip.is-active b { background: rgba(255, 255, 255, .18); color: #fff; }

.conv-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 2px 10px 10px;
  min-height: 0;
}

.conv-item {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 11px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .16s, border-color .16s, transform .16s;
  animation: item-in .28s cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes item-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.conv-item:hover { background: #fff; border-color: var(--line); }

.conv-item.is-active {
  background: #fff;
  border-color: var(--orange-200);
  box-shadow: 0 6px 18px rgba(255, 122, 26, .1);
}

.conv-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--orange-500), var(--orange-400));
}

.conv-ava {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .5px;
}

.conv-body { flex: 1; min-width: 0; }

.conv-row1 {
  display: flex;
  align-items: center;
  gap: 6px;
}

.conv-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 116px;
}

.conv-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-3);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}

.conv-time {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--ink-3);
  flex: 0 0 auto;
}

.conv-row2 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.conv-preview {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-unread {
  flex: 0 0 auto;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--orange-500);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}

.lvl {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  height: 17px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .3px;
}

.lvl-p0 { background: var(--red-050); color: var(--red); }
.lvl-p1 { background: var(--orange-050); color: var(--orange-600); }
.lvl-p2 { background: var(--blue-050); color: var(--blue); }
.lvl-p3 { background: #F0F4FA; color: var(--ink-3); }

.pane-foot {
  flex: 0 0 auto;
  padding: 8px 16px 11px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
}

.empty-list {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-3);
  font-size: 12.5px;
}

/* ---------- 聊天区 ---------- */
.chat-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: transparent;
}

.chat-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.ch-ava {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  flex: 0 0 auto;
}

.ch-main { min-width: 0; flex: 1; }

.ch-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
}

.ch-title .lvl { height: 18px; font-size: 10px; }

.ch-meta {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ch-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); opacity: .6; }

.ch-actions { display: flex; gap: 7px; flex: 0 0 auto; }

.btn-ghost {
  height: 31px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  transition: all .16s;
}

.btn-ghost:hover { border-color: var(--navy-600); color: var(--navy-700); background: var(--panel-2); }
.btn-ghost:active { transform: scale(.98); }

.btn-primary {
  height: 34px;
  padding: 0 16px;
  border-radius: 9px;
  border: 0;
  background: linear-gradient(135deg, var(--orange-400), var(--orange-600));
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .2px;
  box-shadow: var(--sh-orange);
  transition: transform .16s, box-shadow .16s, filter .16s;
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(255, 122, 26, .36); }
.btn-primary:active { transform: translateY(0) scale(.985); }
.btn-primary:disabled { filter: grayscale(.5); opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-navy {
  height: 34px;
  padding: 0 16px;
  border-radius: 9px;
  border: 0;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(16, 42, 85, .22);
  transition: transform .16s, box-shadow .16s;
}

.btn-navy:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(16, 42, 85, .3); }
.btn-navy:active { transform: translateY(0) scale(.985); }

.msg-stream {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  padding: 18px 24px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 消息较少时贴底显示，更像真实的聊天工具 */
.msg-stream::before {
  content: "";
  margin-top: auto;
}

.day-divider {
  align-self: center;
  font-size: 10.5px;
  color: var(--ink-3);
  background: rgba(255, 255, 255, .8);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
}

.msg-row { display: flex; gap: 9px; align-items: flex-start; animation: msg-in .26s cubic-bezier(.2, .8, .3, 1) both; }
.msg-row.from-me { flex-direction: row-reverse; }

@keyframes msg-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-ava {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex: 0 0 auto;
}

.msg-col { max-width: min(74%, 560px); display: flex; flex-direction: column; gap: 4px; }
.msg-row.from-me .msg-col { align-items: flex-end; }

.bubble {
  padding: 9px 13px;
  border-radius: 14px 14px 14px 5px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.62;
  box-shadow: var(--sh-1);
  word-break: break-word;
  white-space: pre-wrap;
}

.msg-row.from-me .bubble {
  border-radius: 14px 14px 5px 14px;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-600));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(23, 55, 107, .24);
}

.bubble .bubble-img {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--ink-2);
  background: var(--panel-2);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 5px 8px;
}

.msg-row.from-me .bubble .bubble-img { color: rgba(255,255,255,.8); background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); }

.msg-time { font-size: 10px; color: var(--ink-3); padding: 0 3px; }

/* 发送失败：接口成功但客户没收到，必须是红得刺眼的状态，不能只差一个词 */
.msg-row.from-me .bubble-failed {
  background: linear-gradient(140deg, #C6303A, #96303A);
  box-shadow: 0 6px 16px rgba(150, 48, 58, .28);
}

.msg-fail { color: #C6303A; font-weight: 700; }
.msg-row.from-me .msg-fail { color: #C6303A; }

.sys-note {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--ink-3);
  background: rgba(255, 255, 255, .7);
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  padding: 3px 10px;
}

/* ---------- 审核面板 ---------- */
.audit-zone {
  flex: 0 0 auto;
  padding: 0 20px 16px;
}

.audit {
  border-radius: var(--r-lg);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--sh-2);
  overflow: hidden;
}

.audit-top {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  background: linear-gradient(90deg, #FFF8F2, #FFFDFB);
  border-bottom: 1px solid #FDEEE2;
  flex-wrap: wrap;
}

.audit-mode {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .2px;
}

.audit-mode.mode-wecom { background: var(--mint-050); color: #0A8C79; border: 1px solid #C9EFE8; }
.audit-mode.mode-personal { background: var(--gold-050); color: #A87608; border: 1px solid #F5E3BC; }
.audit-mode svg { width: 12px; height: 12px; }

.audit-kb {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: #0A8C79;
}

.audit-kb.is-miss { color: var(--red); }
.audit-kb svg { width: 13px; height: 13px; }

.audit-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 8px 14px 0;
}

.atab {
  position: relative;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 700;
  transition: color .16s;
}

.atab::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--orange-500);
  transform: scaleX(0);
  transition: transform .2s cubic-bezier(.4,0,.2,1);
}

.atab.is-active { color: var(--navy-800); }
.atab.is-active::after { transform: scaleX(1); }

.atab .tab-spark {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--orange-500);
  margin-right: 5px;
  vertical-align: 2px;
}

.audit-tabs .tab-hint {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--ink-3);
}

.audit-input {
  display: block;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 12px 14px;
  min-height: 88px;
  max-height: 150px;
  resize: vertical;
  outline: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink);
  background: #fff;
  transition: background .16s;
}

.audit-input:focus { background: #FFFDFB; }
.audit-input::placeholder { color: var(--ink-3); }

.audit-foot {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--panel-2);
  flex-wrap: wrap;
}

.foot-hint {
  flex: 1;
  min-width: 160px;
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.5;
}

.foot-hint b { color: var(--navy-700); }

.char-count { font-size: 10.5px; color: var(--ink-3); margin-right: 2px; }

.audit-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-radius: var(--r-lg);
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, .6);
  color: var(--ink-3);
  font-size: 12px;
}

.empty-state {
  margin: auto;
  padding: 24px;
  text-align: center;
  max-width: 340px;
}

.empty-art {
  width: 66px;
  height: 66px;
  margin: 0 auto 14px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: var(--orange-500);
  background: linear-gradient(140deg, #FFF3E8, #FFFDFA);
  border: 1px solid var(--orange-200);
}

.empty-art svg { width: 34px; height: 34px; }

.empty-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy-800);
}

.empty-desc {
  margin-top: 5px;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.6;
}

.panel-hint {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.65;
}

/* ---------- AI 右栏 ---------- */
.ai-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 14px 18px;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(8px);
  border-left: 1px solid var(--line);
}

.ai-card {
  border-radius: var(--r-md);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--sh-1);
  padding: 13px 14px;
}

.ai-card > h4 {
  margin: 0 0 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-card > h4::before {
  content: "";
  width: 3px; height: 11px;
  border-radius: 2px;
  background: var(--orange-500);
}

.grade-card {
  background: linear-gradient(140deg, #FFF9F4, #fff 62%);
  border-color: #FBE3D2;
}

.grade-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.grade-badge {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.3px;
  color: #fff;
  flex: 0 0 auto;
}

.grade-badge.p0 { background: linear-gradient(140deg, #F2604F, var(--red)); box-shadow: 0 8px 18px rgba(226, 62, 50, .28); }
.grade-badge.p1 { background: linear-gradient(140deg, var(--orange-400), var(--orange-600)); box-shadow: 0 8px 18px rgba(255, 122, 26, .3); }
.grade-badge.p2 { background: linear-gradient(140deg, #5B91F0, var(--blue)); box-shadow: 0 8px 18px rgba(58, 123, 234, .26); }
.grade-badge.p3 { background: linear-gradient(140deg, #A9B9D0, #8195B4); box-shadow: 0 8px 18px rgba(129, 149, 180, .24); }

.grade-name { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.grade-sla { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

.grade-reason {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.6;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
}

.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.kv {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 9px;
  background: var(--panel-2);
}

.kv .k { font-size: 10.5px; color: var(--ink-3); }
.kv .v { font-size: 12px; font-weight: 700; color: var(--ink); margin-top: 1px; }
.kv .v.em-mint { color: #0A8C79; }
.kv .v.em-red { color: var(--red); }
.kv .v.em-orange { color: var(--orange-600); }

.hit-item {
  display: flex;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--mint-050);
  border: 1px solid #D2F1EB;
}

.hit-item .hi-icon { color: #0A8C79; flex: 0 0 auto; margin-top: 1px; }
.hit-item .hi-icon svg { width: 14px; height: 14px; }
.hit-item .hi-title { font-size: 12px; font-weight: 700; color: #0A6B5C; }
.hit-item .hi-desc { font-size: 11px; color: #3E7F74; margin-top: 2px; line-height: 1.5; }

.miss-item {
  display: flex;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--red-050);
  border: 1px solid #F8D7D3;
}

.miss-item .hi-title { font-size: 12px; font-weight: 700; color: #A72B21; }
.miss-item .hi-desc { font-size: 11px; color: #9A5B55; margin-top: 2px; line-height: 1.5; }

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--blue-050);
  color: var(--blue);
}

.tag.warn { background: var(--orange-050); color: var(--orange-600); }
.tag.ok { background: var(--mint-050); color: #0A8C79; }
.tag.gray { background: #F1F5FA; color: var(--ink-2); }

.timeline { display: flex; flex-direction: column; gap: 9px; }

.tl-item { display: flex; gap: 8px; font-size: 11.5px; }

.tl-dot {
  flex: 0 0 auto;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-top: 5px;
  background: var(--line-strong);
}

.tl-dot.p0 { background: var(--red); }
.tl-dot.p1 { background: var(--orange-500); }
.tl-dot.p2 { background: var(--blue); }
.tl-dot.ok { background: var(--mint); }

.tl-body { min-width: 0; }
.tl-text { color: var(--ink-2); line-height: 1.5; }
.tl-time { font-size: 10px; color: var(--ink-3); margin-top: 1px; }

/* =========================================================
   通用页面
   ========================================================= */
.page {
  height: 100%;
  overflow-y: auto;
  padding: 22px 26px 40px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.page-head h2 { font-size: 18px; font-weight: 700; letter-spacing: .3px; }
.page-head p { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.page-head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.date-chip {
  font-size: 11.5px;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 10px;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.mini-stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  box-shadow: var(--sh-1);
}

.mini-stat .ms-label { font-size: 11px; color: var(--ink-3); }
.mini-stat .ms-value { font-size: 20px; font-weight: 800; color: var(--navy-800); margin-top: 2px; letter-spacing: -.4px; }
.mini-stat .ms-value.accent { color: var(--orange-600); }

/* ---------- 提醒中心 ---------- */
.alert-list { display: flex; flex-direction: column; gap: 9px; }

.alert-row {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--sh-1);
  animation: item-in .26s both;
}

.alert-row.is-unread { border-left: 3px solid var(--orange-500); }

.al-rail {
  flex: 0 0 4px;
  border-radius: 999px;
  background: var(--line);
}

.al-main { flex: 1; min-width: 0; }

.al-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.al-name { font-size: 13px; font-weight: 700; }

.al-src {
  font-size: 10.5px;
  color: var(--ink-2);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 6px;
}

.al-summary { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.55; }
.al-action { font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.al-time { margin-left: auto; font-size: 10.5px; color: var(--ink-3); }

/* ---------- 知识库 ---------- */
.kb-form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--sh-2);
  animation: item-in .24s both;
}

.kb-form-row { display: flex; gap: 12px; }

.kb-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  flex: 1;
}

.kb-form-body { margin-top: 10px; }

.kb-form input, .kb-form select, .kb-form textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  outline: 0;
  font-size: 12.5px;
  background: var(--panel-2);
  transition: border-color .16s, box-shadow .16s;
  font-weight: 400;
  color: var(--ink);
}

.kb-form input:focus, .kb-form select:focus, .kb-form textarea:focus {
  border-color: var(--orange-400);
  box-shadow: 0 0 0 3px rgba(255, 154, 77, .14);
  background: #fff;
}

.kb-form textarea { resize: vertical; line-height: 1.6; }

.kb-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.switch-line {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--ink-2);
  cursor: pointer;
}

.switch-line input { width: 14px; height: 14px; accent-color: var(--orange-500); }

.kb-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.kb-toolbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }

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

.kb-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 13px 15px;
  box-shadow: var(--sh-1);
  transition: border-color .16s, box-shadow .16s, transform .16s;
}

.kb-card:hover { border-color: var(--line-strong); box-shadow: var(--sh-2); transform: translateY(-1px); }

.kb-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kb-title { font-size: 13.5px; font-weight: 700; }

.kb-cat {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--navy-600);
  background: var(--blue-050);
  border-radius: 5px;
  padding: 1px 7px;
}

.kb-auto {
  font-size: 10px;
  font-weight: 700;
  color: #0A8C79;
  background: var(--mint-050);
  border: 1px solid #C9EFE8;
  border-radius: 5px;
  padding: 1px 6px;
}

.kb-hits { margin-left: auto; font-size: 10.5px; color: var(--ink-3); }
.kb-content { font-size: 12px; color: var(--ink-2); margin-top: 7px; line-height: 1.65; }

.kb-side {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 15px;
  box-shadow: var(--sh-1);
  position: sticky;
  top: 0;
}

.kb-side h3 { font-size: 12.5px; font-weight: 700; }
.side-desc { font-size: 11px; color: var(--ink-3); margin: 3px 0 11px; }

.gap-item {
  display: flex;
  gap: 9px;
  padding: 9px 0;
  border-top: 1px dashed var(--line);
}

.gap-item:first-child { border-top: 0; }

.gap-idx {
  flex: 0 0 18px;
  height: 18px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  background: var(--orange-050);
  color: var(--orange-600);
  margin-top: 1px;
}

.gap-text { font-size: 11.5px; color: var(--ink-2); line-height: 1.5; }
.gap-count { font-size: 10px; color: var(--ink-3); margin-top: 2px; }

/* ---------- 数据复盘 ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 15px 16px;
  box-shadow: var(--sh-1);
  overflow: hidden;
}

.kpi::after {
  content: "";
  position: absolute;
  right: -24px; top: -24px;
  width: 84px; height: 84px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 154, 77, .16), transparent 72%);
}

.kpi-label { font-size: 11.5px; color: var(--ink-3); }
.kpi-value { font-size: 26px; font-weight: 800; color: var(--navy-800); letter-spacing: -.8px; margin-top: 3px; }
.kpi-sub { font-size: 10.5px; color: var(--ink-3); margin-top: 3px; }
.kpi-value small { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-left: 2px; }

.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--sh-1);
}

.card h3 { font-size: 12.5px; font-weight: 700; margin-bottom: 14px; }
.card.full { margin-top: 0; }

.bar-chart { display: flex; flex-direction: column; gap: 11px; }

.bar-row { display: flex; align-items: center; gap: 10px; }

.bar-label {
  flex: 0 0 92px;
  font-size: 11.5px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  flex: 1;
  height: 9px;
  border-radius: 999px;
  background: #F0F5FB;
  overflow: hidden;
  display: block;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--orange-400), var(--orange-600));
  transform-origin: left;
  animation: bar-grow .7s cubic-bezier(.25, .8, .3, 1) both;
}

.bar-fill.navy { background: linear-gradient(90deg, var(--navy-600), var(--navy-800)); }
.bar-fill.mint { background: linear-gradient(90deg, #3FD3BC, var(--mint)); }
.bar-fill.red { background: linear-gradient(90deg, #F2705F, var(--red)); }
.bar-fill.blue { background: linear-gradient(90deg, #6A9DF2, var(--blue)); }
.bar-fill.gray { background: linear-gradient(90deg, #C3D0E2, #A6B6CC); }

@keyframes bar-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.bar-value {
  flex: 0 0 38px;
  text-align: right;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pending-table { display: flex; flex-direction: column; }

.pt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.pt-row:first-child { border-top: 0; }
.pt-name { font-weight: 700; width: 110px; flex: 0 0 auto; }
.pt-issue { flex: 1; color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-time { font-size: 10.5px; color: var(--ink-3); flex: 0 0 auto; }

/* =========================================================
   Toast
   ========================================================= */
.toast-stack {
  position: fixed;
  top: 78px;
  right: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 340px;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  gap: 10px;
  padding: 11px 12px 11px 14px;
  border-radius: var(--r-md);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--sh-3);
  cursor: pointer;
  overflow: hidden;
  animation: toast-in .32s cubic-bezier(.2, .9, .3, 1.02) both;
}

.toast.is-out { animation: toast-out .24s ease forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translate3d(26px, -6px, 0) scale(.97); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translate3d(20px, 0, 0) scale(.98); }
}

.toast::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3.5px;
  background: var(--line-strong);
}

.toast.t-p0::before { background: var(--red); }
.toast.t-p1::before { background: var(--orange-500); }
.toast.t-p2::before { background: var(--blue); }
.toast.t-ok::before { background: var(--mint); }
.toast.t-info::before { background: var(--navy-600); }

.toast-icon {
  flex: 0 0 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: var(--navy-700);
}

.toast.t-p0 .toast-icon { background: linear-gradient(140deg, #F2604F, var(--red)); }
.toast.t-p1 .toast-icon { background: linear-gradient(140deg, var(--orange-400), var(--orange-600)); }
.toast.t-p2 .toast-icon { background: linear-gradient(140deg, #5B91F0, var(--blue)); }
.toast.t-ok .toast-icon { background: linear-gradient(140deg, #3FD3BC, var(--mint)); }
.toast.t-info .toast-icon { background: linear-gradient(140deg, var(--navy-600), var(--navy-900)); }

.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: 12.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.toast-desc { font-size: 11.5px; color: var(--ink-2); margin-top: 2px; line-height: 1.5; word-break: break-word; }

.toast-close {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.toast-close:hover { background: var(--panel-2); color: var(--ink); }

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1280px) {
  .console-grid { grid-template-columns: 292px minmax(380px, 1fr) 300px; }
  .conv-name { max-width: 96px; }
}

@media (max-width: 1080px) {
  .console-grid { grid-template-columns: 280px minmax(0, 1fr); }
  .ai-pane { display: none; }
  .kb-layout { grid-template-columns: 1fr; }
  .kb-side { position: static; }
  .guard-pill { display: none; }
}

@media (max-width: 820px) {
  .brand-sub { display: none; }
  .btn-sim span:not(.dot-live) { display: none; }
  .console-grid { grid-template-columns: 1fr; }
  .conv-pane { display: none; }
  .chart-grid { grid-template-columns: 1fr; }
  .toast-stack { top: auto; bottom: 16px; right: 16px; left: 16px; width: auto; }
  .page { padding: 16px 14px 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
