:root {
  /* 敦煌扁平主题（r51）：莫高窟色系 */
  --bg: #f3ead9;            /* 沙岩底 */
  --panel: #fdfaf3;         /* 宣纸白 */
  --line: #e2d3b6;          /* 沙线 */
  --text: #3d2b1a;          /* 深褐 */
  --muted: #8c7a5f;         /* 土黄灰 */
  --primary: #a8402f;       /* 莫高窟赭红 */
  --primary-deep: #7f2d20;
  --primary-weak: #f6e3d8;  /* 赭红淡染 */
  --accent: #2e5e7e;        /* 石青 */
  --green: #4f7f5f;         /* 石绿 */
  --red: #b03a2e;
  --orange: #c07b1a;        /* 沙金 */
  --gold: #c9a34e;          /* 泥金 */
  --radius: 6px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card {
  width: 380px; background: var(--panel); border-radius: 16px; padding: 36px 32px;
  box-shadow: 0 10px 40px rgba(31,39,51,.08); text-align: center;
}
.login-logo { font-size: 40px; }
.login-card h1 { font-size: 20px; margin-top: 8px; }
.login-sub { color: var(--muted); margin: 6px 0 20px; }
.login-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.ltab {
  flex: 1; padding: 8px; border: 1px solid var(--line); background: #fff;
  border-radius: 8px; cursor: pointer; color: var(--muted);
}
.ltab.active { background: var(--primary-weak); color: var(--primary); border-color: var(--primary); font-weight: 600; }
.login-form { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.login-form input {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px;
}
.otp-row { display: flex; gap: 8px; }
.otp-row input { flex: 1; }
.form-msg { color: var(--red); min-height: 18px; font-size: 13px; }
.login-hint { color: var(--muted); font-size: 12px; line-height: 1.6; margin-top: 4px; }

/* ---------- 通用 ---------- */
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.warn { background: #fff7ed; border-color: var(--orange); color: var(--orange); }
.btn.danger { background: #fef2f2; border-color: var(--red); color: var(--red); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn-row.right { justify-content: flex-end; }

.topbar {
  height: 52px; background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; padding: 0 20px; gap: 24px; position: sticky; top: 0; z-index: 10;
}
.topbar-brand { font-weight: 700; }
.topbar-nav { display: flex; gap: 4px; flex: 1; }
.nav-btn {
  border: 0; background: transparent; padding: 8px 14px; border-radius: 8px;
  cursor: pointer; color: var(--muted); font-size: 14px;
}
.nav-btn.active { background: var(--primary-weak); color: var(--primary); font-weight: 600; }
.me-label { color: var(--muted); margin-right: 8px; font-size: 13px; }

.view { padding: 16px 20px; }

/* ---------- 监管总览 ---------- */
.monitor-grid {
  display: grid; grid-template-columns: 250px 300px 1fr; gap: 14px; height: calc(100vh - 100px);
}
.pane { background: var(--panel); border-radius: var(--radius); border: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
.pane-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.pane-head h3 { font-size: 14px; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.badge.green { background: #ecfdf5; color: var(--green); }
.badge.gray { background: #f1f5f9; color: var(--muted); }
.badge.red { background: #fef2f2; color: var(--red); }
.badge.blue { background: var(--primary-weak); color: var(--primary); }
.badge.orange { background: #fff7ed; color: var(--orange); }

.device-list, .conv-list { overflow-y: auto; flex: 1; }
.device-item {
  padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.device-item:hover { background: #f8fafc; }
.device-item .d-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.device-item .d-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(22,163,74,.15); }
.dot.off { background: #cbd5e1; }

/* r41 会话列表重设计：头像 + 双行信息 + 选中高亮条 */
.conv-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 10px 14px; border-bottom: 1px solid #f1f5f9; cursor: pointer;
  position: relative; transition: background .12s ease;
}
.conv-item:hover { background: #f8fafc; }
.conv-item.active { background: var(--primary-weak); }
.conv-item.active::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  border-radius: 3px; background: var(--primary);
}
.conv-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
}
.conv-main { flex: 1; min-width: 0; }
.conv-item .c-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.conv-item .c-name {
  font-weight: 600; font-size: 13.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.conv-item .c-time { color: var(--muted); font-size: 11px; flex-shrink: 0; }
.conv-item .c-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 3px; }
.conv-item .c-last { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.conv-item .c-tags { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.conv-item .c-sub { color: #a0aec0; font-size: 11px; margin-top: 2px; }

.pane-sub { padding: 0 14px 8px; display: flex; gap: 8px; }
.pane-sub .sm-input { flex: 1; min-width: 0; }

/* ---------- 会话面板工具区（搜索 + 筛选，r42 UI 优化） ---------- */
.conv-tools {
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  background: #fbfcfe; display: flex; flex-direction: column; gap: 8px;
}
.conv-search { position: relative; }
.conv-search svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; stroke: var(--muted); pointer-events: none;
}
.conv-search input {
  width: 100%; padding: 7px 12px 7px 32px; font-size: 13px; color: var(--text);
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.conv-search input::placeholder { color: #a3adbd; }
.conv-search input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47,111,237,.12);
}
.conv-filters { display: flex; gap: 8px; }
.conv-select { position: relative; flex: 1; min-width: 0; }
.conv-select::after {
  content: ""; position: absolute; right: 11px; top: 50%;
  width: 7px; height: 7px;
  border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.conv-select select {
  width: 100%; appearance: none; -webkit-appearance: none;
  padding: 7px 26px 7px 10px; font-size: 12px; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer;
  text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.conv-select select:hover { border-color: #c7d2e4; }
.conv-select select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47,111,237,.12);
}
.unread { background: var(--red); color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.tag-ai { font-size: 10px; background: var(--primary-weak); color: var(--primary); border-radius: 4px; padding: 1px 5px; }
.tag-manual { font-size: 10px; background: #fff7ed; color: var(--orange); border-radius: 4px; padding: 1px 5px; }
.tag-done { font-size: 10px; background: #ecfdf5; color: #047857; border-radius: 4px; padding: 1px 5px; }
.tag-pending { font-size: 10px; background: #fff7ed; color: #b45309; border-radius: 4px; padding: 1px 5px; }
.tag-recv { font-size: 10px; background: #f1f5f9; color: #64748b; border-radius: 4px; padding: 1px 5px; }
.src-official { font-size: 10px; background: #eef2ff; color: #4338ca; border-radius: 4px; padding: 1px 5px; }
.src-stranger { font-size: 10px; background: #e2e8f0; color: #475569; border-radius: 4px; padding: 1px 5px; }
.no-reply-note { margin-top: 4px; font-size: 11px; color: #64748b; background: #f1f5f9; border-radius: 4px; padding: 3px 8px; display: inline-block; }

.chat-pane { display: flex; }
.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); gap: 10px; }
.empty-icon { font-size: 44px; }
.chat-main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.chat-title { font-weight: 700; font-size: 15px; }
.chat-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.msg-list { flex: 1; min-height: 0; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: #f6f8fb; }
.msg-row { display: flex; }
.msg-row.out { justify-content: flex-end; }
.msg-bubble {
  max-width: 68%; padding: 9px 13px; border-radius: 14px; background: #fff;
  border: 1px solid var(--line); line-height: 1.55; word-break: break-word;
  box-shadow: 0 1px 2px rgba(31,39,51,.05);
}
.msg-row.in .msg-bubble { border-top-left-radius: 4px; }
.msg-row.out .msg-bubble {
  background: linear-gradient(135deg, #3b82f6, #2f6fed);
  border-color: transparent; color: #fff; border-top-right-radius: 4px;
  box-shadow: 0 2px 6px rgba(47,111,237,.25);
}
.msg-meta { font-size: 11px; color: var(--muted); margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; }
.msg-row.out .msg-meta { color: rgba(255,255,255,.75); }
.ai-chip { font-size: 11px; background: #ecfdf5; color: var(--green); border-radius: 4px; padding: 1px 6px; }
.msg-row.out .ai-chip { background: rgba(255,255,255,.2); color: #fff; }
/* ---------- 图片取证（r32） ---------- */
.msg-media { margin: 0 0 6px; }
.msg-media img {
  max-width: 200px; max-height: 260px; display: block;
  border-radius: 8px; border: 1px solid var(--border); cursor: zoom-in; background: #fff;
}
.msg-media.pending, .msg-media.failed {
  font-size: 11px; color: var(--muted); background: #f6f7f9;
  border-radius: 6px; padding: 3px 7px; display: inline-block; margin-bottom: 4px;
}
.msg-media.failed { color: var(--orange); background: #fff7ed; }
.media-tip { font-size: 11px; color: var(--muted); }
.lightbox {
  position: fixed; inset: 0; z-index: 9999; background: rgba(15, 18, 25, .82);
  display: flex; align-items: center; justify-content: center; cursor: zoom-out;
}
.lightbox img {
  max-width: 92vw; max-height: 92vh; border-radius: 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, .4);
}
.lightbox-tip { position: absolute; bottom: 24px; font-size: 12px; color: rgba(255, 255, 255, .72); }

.pending-chip { font-size: 11px; background: #fff7ed; color: var(--orange); border-radius: 4px; padding: 1px 6px; }
.chat-input { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); }
.chat-input input { flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }

/* ---------- 监管大屏 ---------- */
#view-dashboard { display: flex; flex-direction: column; min-height: calc(100vh - 84px); }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.dash-title { font-size: 18px; font-weight: 700; }
.dash-head .muted { font-size: 12px; margin-left: 10px; }
/* r41：六个 KPI 改两行三列，配合下面面板自适应，整屏不再空一大块 */
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.kpi-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; min-height: 96px; display: flex; flex-direction: column; justify-content: center;
  transition: box-shadow .15s ease;
}
.kpi-card:hover { box-shadow: 0 4px 16px rgba(31,39,51,.07); }
.kpi-label { color: var(--muted); font-size: 12px; }
.kpi-value { font-size: 26px; font-weight: 700; margin-top: 6px; line-height: 1.1; }
.kpi-sub { color: var(--muted); font-size: 11px; margin-top: 6px; }
.kpi-value.good { color: var(--green); }
.kpi-value.warn { color: var(--orange); }
.kpi-value.bad { color: var(--red); }

.dash-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; flex: 1; min-height: 320px; }
.dash-panels .pane { min-height: 0; }
.pane-head-right { display: flex; align-items: center; gap: 8px; }
.dash-feed, .dash-risk { overflow-y: auto; flex: 1; padding: 6px 0; }

.feed-item { display: flex; gap: 10px; padding: 8px 14px; border-bottom: 1px solid #f1f5f9; }
.feed-item:last-child { border-bottom: 0; }
.feed-dir { font-size: 11px; padding: 1px 6px; border-radius: 4px; height: 18px; white-space: nowrap; }
.feed-dir.in { background: #e8effd; color: var(--primary); }
.feed-dir.out { background: #ecfdf5; color: var(--green); }
.feed-item.out { background: #fcfdff; }
.feed-body { flex: 1; min-width: 0; }
.feed-top { display: flex; justify-content: space-between; gap: 8px; }
.feed-name { font-weight: 600; font-size: 13px; }
.feed-time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.feed-text { color: #475569; font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.risk-item { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.risk-item:last-child { border-bottom: 0; }
.risk-item:not(.read):hover { background: #f8fafc; }
.risk-item.read { opacity: .45; cursor: default; }
.risk-item.read .risk-dot { background: #cbd5e1 !important; }
.risk-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.risk-high .risk-dot { background: var(--red); }
.risk-mid .risk-dot { background: var(--orange); }
.risk-low .risk-dot { background: var(--muted); }
.risk-body { flex: 1; min-width: 0; }
.risk-title { font-size: 13px; font-weight: 600; }
.risk-desc { color: var(--muted); font-size: 12px; margin-top: 2px; line-height: 1.5; }
.risk-empty { padding: 24px; text-align: center; color: var(--muted); }
.risk-read-btn {
  flex-shrink: 0; font-size: 11px; color: var(--primary); background: var(--primary-weak);
  border-radius: 999px; padding: 2px 10px; white-space: nowrap;
}
.risk-read-mark { flex-shrink: 0; font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ---------- 个人中心 ---------- */
.profile-row { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.profile-avatar {
  width: 52px; height: 52px; border-radius: 50%; background: var(--primary-weak);
  display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.profile-name { font-size: 16px; font-weight: 700; }
.profile-level { margin-top: 4px; }
.perm-list { margin: 10px 0 4px 18px; color: var(--muted); font-size: 13px; line-height: 1.9; }
input[readonly] { background: #f8fafc; color: var(--muted); }

@media (max-width: 1400px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
  .dash-panels { grid-template-columns: 1fr; }
}

/* ---------- 工具栏/表格 ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.toolbar input, .toolbar select {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; min-width: 220px; background: #fff;
}
.toolbar .filter-input { min-width: 160px; }
.toolbar .filter-date { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.toolbar .filter-date input { min-width: 140px; padding: 8px 10px; }
.flex-spacer { flex: 1; }
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; }
.tbl th { background: #f8fafc; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tbl tr:hover td { background: #fafbfd; }
.tbl td.order-remark { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-confirm { background: #16a34a; color: #fff; border: none; border-radius: 6px; padding: 4px 12px; font-size: 13px; cursor: pointer; }
.btn-confirm:hover { background: #15803d; }

.help-card {
  margin-top: 16px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 20px; line-height: 1.8;
}
.help-card h4 { margin-bottom: 6px; }
.help-card code { background: #f1f5f9; padding: 1px 6px; border-radius: 4px; }
.warn-text { color: var(--orange); margin-top: 8px; }

/* ---------- 设置 ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 1100px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card h3 { font-size: 15px; margin-bottom: 12px; }
.switch-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; }
.switch-row input { width: 40px; height: 22px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.field span { color: var(--muted); font-size: 13px; }
.field input, .field textarea, .field select {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px;
  font-family: inherit; width: 100%; background: #fff;
}
.field textarea { resize: vertical; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.selftest {
  margin-top: 12px; background: #0f172a; color: #a5f3a5; padding: 12px;
  border-radius: 8px; font-size: 12px; white-space: pre-wrap; max-height: 260px; overflow: auto;
}

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex;
  align-items: center; justify-content: center; z-index: 100;
}
.modal-card {
  width: 460px; max-height: 84vh; overflow: auto; background: #fff; border-radius: 14px; padding: 22px 24px;
}
.modal-card h3 { margin-bottom: 14px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%);
  background: #0f172a; color: #fff; padding: 9px 18px; border-radius: 999px; z-index: 200; font-size: 13px;
}
.toast.err { background: var(--red); }

@media (max-width: 1100px) {
  .monitor-grid { grid-template-columns: 200px 240px 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

/* ---------- 话术库（r41） ---------- */
.kw-chip {
  display: inline-block; font-size: 12px; background: var(--primary-weak); color: var(--primary);
  border-radius: 6px; padding: 2px 8px; margin: 1px 2px 1px 0;
}

/* ============================================================
   敦煌扁平化主题覆盖（r51）
   原则：无阴影、无渐变、色块分明；敦煌元素用「藻井边饰条 +
   联珠纹 + 祥云暗纹」三种扁平几何纹样表达
   ============================================================ */

/* 沙底 + 祥云暗纹（扁平 SVG 重复平铺） */
body {
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23a8402f' stroke-opacity='.055' stroke-width='2'%3E%3Cpath d='M10 40q10-16 20 0t20 0'/%3E%3Cpath d='M70 90q10-16 20 0t20 0'/%3E%3Ccircle cx='95' cy='25' r='7'/%3E%3Ccircle cx='95' cy='25' r='3'/%3E%3Cpath d='M15 100q8-12 16 0'/%3E%3C/g%3E%3C/svg%3E");
}
* { text-shadow: none !important; box-shadow: none !important; }

/* 顶栏：赭红色块 + 泥金/石青藻井边饰条 */
.topbar { background: var(--primary); border-bottom: none; }
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -5px; height: 5px;
  background: repeating-linear-gradient(90deg, var(--gold) 0 14px, var(--accent) 14px 28px, var(--panel) 28px 30px);
}
.topbar-brand { color: #fdf3e0; }
.topbar-brand::before { content: '◈ '; color: var(--gold); }
.topbar-nav .nav-btn { color: #e8cfa8; border-radius: 0; }
.topbar-nav .nav-btn:hover { color: #fff; }
.topbar-nav .nav-btn.active { background: rgba(253,243,224,.16); color: #fff; font-weight: 600; }
.topbar .btn, .topbar .me-label, .topbar .muted { color: #f3e2c2; }
.topbar input { border-color: rgba(253,243,224,.4); }

/* 登录卡：顶部藻井边饰 + 去阴影 */
.login-card { box-shadow: none; border: 1px solid var(--line); padding-top: 0; overflow: hidden; }
.login-card::before {
  content: ''; display: block; height: 8px; margin: 0 0 24px;
  background: repeating-linear-gradient(90deg, var(--primary) 0 18px, var(--gold) 18px 36px, var(--accent) 36px 54px);
}
.login-logo { filter: none; }
.login-card h1 { letter-spacing: 2px; }
.ltab.active { background: var(--primary-weak); }

/* 按钮扁平化 */
.btn { border-radius: 4px; border-width: 1px; }
.btn.primary:hover { filter: none; background: var(--primary-deep); }
.btn.warn { background: #faf0da; }
.btn.danger { background: #f7e2dd; }
.btn-confirm { background: var(--green); border-radius: 4px; }
.btn-confirm:hover { background: #3f6b4d; }

/* 面板/卡片：细沙线、直角感 */
.pane, .card, .table-wrap, .kpi-card, .help-card, .modal-card { border: 1px solid var(--line); box-shadow: none; }
.pane-head { background: var(--panel); }
.pane-head h3::before { content: '❖ '; color: var(--primary); font-size: 12px; }
.kpi-card:hover { box-shadow: none !important; border-color: var(--gold); }
.kpi-value { letter-spacing: .5px; }
.kpi-value.good { color: var(--green); }
.kpi-value.warn { color: var(--orange); }
.kpi-value.bad { color: var(--red); }

/* 徽标/标签改敦煌土色系 */
.badge.blue { background: #e2ebf2; color: var(--accent); }
.badge.green { background: #e4eee6; color: var(--green); }
.badge.red { background: #f7e2dd; color: var(--red); }
.badge.orange { background: #faf0da; color: var(--orange); }
.tag-ai { background: var(--primary-weak); }
.tag-manual, .tag-pending { background: #faf0da; }
.tag-done { background: #e4eee6; }
.tag-recv { background: #efe8d8; color: var(--muted); }
.src-official { background: #e2ebf2; color: var(--accent); }
.src-stranger { background: #efe8d8; color: var(--muted); }
.ai-chip { background: #e4eee6; color: var(--green); }
.kw-chip { background: var(--primary-weak); }

/* 会话列表 */
.conv-item.active { background: var(--primary-weak); }
.conv-item.active::before { background: var(--primary); border-radius: 0; }
.conv-item:hover { background: #f5eddc; }
.device-item:hover { background: #f5eddc; }
.dot.on { box-shadow: none !important; }
.conv-tools { background: #f8f1e1; }
.conv-search input:focus, .conv-select select:focus { box-shadow: none !important; border-color: var(--primary); }
.unread { background: var(--red); }

/* 聊天气泡：出站改石青实色（扁平无渐变） */
.msg-list { background: #f6efdf; }
.msg-bubble { box-shadow: none !important; }
.msg-row.out .msg-bubble {
  background: var(--accent); box-shadow: none !important;
}
.msg-row.out .ai-chip { background: rgba(253,250,243,.22); color: #fff; }

/* 表格 */
.tbl th { background: #f3ecdb; color: var(--muted); border-bottom: 2px solid var(--gold); }
.tbl tr:hover td { background: #f8f2e3; }

/* 联珠纹分隔：feed 列表行线改点线 */
.feed-item, .risk-item { border-bottom: 1px dashed #d9c9a6; }
.feed-dir.in { background: #e2ebf2; color: var(--accent); }
.feed-dir.out { background: #e4eee6; color: var(--green); }
.feed-item.out { background: #faf6ea; }

/* 弹窗/Toast 扁平 */
.modal { background: rgba(61,43,26,.5); }
.toast { border-radius: 4px; }
.selftest { border-radius: 4px; background: #3d2b1a; color: #d9c9a6; }

/* 登录页顶部装饰带 */
.login-wrap { padding-top: 0; }
