/* ─────────────────────────────────────────────────────────────
   吉听工作手机 · 后台
   设计取向：内部审查工具，信息密度优先。
   列表页保持一行一句（同样高度能看到三倍内容）；
   聊天记录单独用微信式气泡框（本人在右、他人在左）——
   2026-11-19 用户明确要求与手机上的观感对齐，读聊天时人脑按左右分辨
   「谁说的」比读文字块快一个数量级，这时密度要让位给可读性。
   ───────────────────────────────────────────────────────────── */

:root {
  --bg: #fbfbfa;
  --panel: #ffffff;
  --side: #f7f7f6;
  --line: #e7e5e4;
  --line-soft: #f0efed;
  --ink: #1c1917;
  --ink-2: #57534e;
  --ink-3: #8a857f;
  --accent: #0f766e;
  --accent-ink: #115e59;
  --accent-soft: #f0fdfa;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --ok-soft: #f0fdf4;
  --warn-soft: #fffbeb;
  --danger-soft: #fef2f2;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(28 25 23 / 6%), 0 4px 16px -8px rgb(28 25 23 / 10%);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

/* ── 登录 ─────────────────────────────────────────────────── */

.gate {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(60% 50% at 50% -10%, #e6f4f1 0%, transparent 70%),
    var(--bg);
}

.gate-card {
  width: 100%;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 24px 20px;
  box-shadow: var(--shadow);
}

.gate-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
}

.brand-mark {
  color: var(--accent);
  display: grid;
  place-items: center;
  flex: none;
}

.gate-brand h1 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.gate-brand p {
  font-size: 12px;
  color: var(--ink-3);
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field > span {
  display: block;
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(15 118 110 / 12%);
}

.gate-err {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12px;
}

.gate-foot {
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--ink-3);
  text-align: center;
  line-height: 1.5;
}

/* ── 按钮 ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, opacity 0.14s;
  white-space: nowrap;
}

.btn:hover {
  background: #fafaf9;
}

.btn:active {
  background: #f5f5f4;
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 500;
}

.btn-primary:hover {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
}

.btn-block {
  width: 100%;
  height: 38px;
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
}

.btn-ghost:hover {
  background: #efefed;
}

.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

/* ── 外壳 ─────────────────────────────────────────────────── */

.shell {
  height: 100%;
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
}

.sidebar {
  background: var(--side);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.side-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 16px 16px 14px;
}

.brand-mark.small {
  color: var(--accent);
}

.side-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.nav {
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 13px;
  transition: background 0.14s, color 0.14s;
}

.nav-item svg {
  opacity: 0.72;
  flex: none;
}

.nav-item:hover {
  background: #efefed;
  color: var(--ink);
}

.nav-item.on {
  background: #fff;
  color: var(--ink);
  font-weight: 500;
  box-shadow: 0 1px 2px rgb(28 25 23 / 5%);
}

.nav-item.on svg {
  opacity: 1;
  color: var(--accent);
}

.side-foot {
  border-top: 1px solid var(--line);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.who {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.who-name {
  font-size: 12.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.who-org {
  font-size: 11px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgb(251 251 250 / 86%);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar-title h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.topbar-title p {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 1px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px 20px 32px;
}

/* ── 通用块 ───────────────────────────────────────────────── */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card-pad {
  padding: 14px 16px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.muted {
  color: var(--ink-3);
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
}

.search {
  position: relative;
  flex: 1;
  max-width: 320px;
}

.search input {
  width: 100%;
  height: 32px;
  padding: 0 10px 0 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 12.5px;
}

.search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(15 118 110 / 10%);
}

.search svg {
  position: absolute;
  left: 9px;
  top: 8px;
  color: var(--ink-3);
}

select {
  height: 32px;
  padding: 0 26px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%238a857f' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
}

select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── 统计卡 ───────────────────────────────────────────────── */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.stat-k {
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.2px;
}

.stat-v {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2px;
  letter-spacing: -0.4px;
}

.stat-v small {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-3);
  margin-left: 3px;
}

.stat.hot .stat-v {
  color: var(--danger);
}

.stat.cool .stat-v {
  color: var(--accent-ink);
}

/* ── 表格 ─────────────────────────────────────────────────── */

.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  /* 横向可滚：通话表 9 列（时间/号码/联系人/类型/时长/录音/转写/状态/操作），
     窄屏塞不下时宁可让人拖一下，也不能把最右边的「操作」整列裁掉 ——
     裁掉的表现就是「详细按钮不见了」，用户会以为转写功能坏了。
     `overflow: hidden` 原来是为了裁圆角，auto 同样裁，不影响外观。 */
  overflow-x: auto;
  overflow-y: hidden;
}

/* 窄屏下表格允许横向滚动：裁掉「近 7 天」这列等于让人看不到最重要的一列，
   而挤成两行又会把每行撑到 60px 高。横滚是这里唯一不丢信息的做法。 */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll table {
  min-width: 560px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.2px;
  padding: 9px 14px;
  background: #fcfcfb;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr.clickable {
  cursor: pointer;
}

tbody tr.clickable:hover {
  background: #fbfbfa;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── 徽标 / 状态 ──────────────────────────────────────────── */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px;
  line-height: 1;
  background: #f5f5f4;
  color: var(--ink-2);
  white-space: nowrap;
}

.chip.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.chip.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.chip.bad {
  background: var(--danger-soft);
  color: var(--danger);
}

.chip.accent {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

/* 会话分类里「服务通知」「其它」两档。
   服务通知是系统号（微信团队 / 服务通知 / 文件传输助手），用冷灰蓝：看得出是另一类，但不是人；
   其它（陌生人、已删好友、企微互通）用几乎与背景同色的低对比灰 —— 它确实不重要，
   压到最弱才不会跟「单聊（好友）」抢注意力。 */
.chip.soft {
  background: #eef1f6;
  color: #4a5568;
}

/* 会话分类里的「企微」。单列一档低饱和紫：它不是微信好友（不走好友口径），
   但也不是系统号 —— 是真人、是一对一对话，只不过身份在企业微信那套体系里。
   用 soft 那种冷灰会被读成「通知」，用 accent 又和群聊撞色。 */
.chip.corp {
  background: #f3eefc;
  color: #6a4b9e;
}

.chip.quiet {
  background: #f7f7f6;
  color: #a1a1aa;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-3);
  flex: none;
}

.dot.ok {
  background: var(--ok);
}

.dot.warn {
  background: var(--warn);
}

.dot.bad {
  background: var(--danger);
}

/* ── 空态 ─────────────────────────────────────────────────── */

.empty {
  padding: 44px 24px;
  text-align: center;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.7;
}

.empty strong {
  display: block;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
}

.empty ul {
  margin: 8px auto 0;
  padding: 0;
  list-style: none;
  max-width: 380px;
  text-align: left;
}

.empty li {
  padding: 5px 0 5px 14px;
  position: relative;
}

.empty li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line);
}

/* ── 抽屉（设备详情） ─────────────────────────────────────── */

.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgb(28 25 23 / 24%);
  z-index: 40;
  animation: fade 0.16s ease-out;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(520px, 92vw);
  background: var(--panel);
  border-left: 1px solid var(--line);
  z-index: 41;
  display: flex;
  flex-direction: column;
  animation: slide 0.2s cubic-bezier(0.22, 0.8, 0.3, 1);
}

@keyframes slide {
  from {
    transform: translateX(16px);
    opacity: 0.6;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.drawer-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer-body {
  flex: 1;
  overflow: auto;
  padding: 16px 18px 28px;
}

.kv {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 6px 12px;
  font-size: 12.5px;
}

.kv dt {
  color: var(--ink-3);
}

.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.3px;
  margin: 18px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

/* ── 会话页 ───────────────────────────────────────────────── */

.chat-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  height: calc(100vh - 118px);
  min-height: 420px;
}

.chat-list {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-list-head {
  padding: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.chat-scroll {
  flex: 1;
  overflow: auto;
  min-height: 0;
}

.chat-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: background 0.12s;
}

.chat-item:hover {
  background: #fbfbfa;
}

.chat-item.on {
  background: var(--accent-soft);
}

.chat-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.chat-name {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-time {
  font-size: 11px;
  color: var(--ink-3);
  flex: none;
}

.chat-preview {
  font-size: 12px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge {
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  line-height: 17px;
  text-align: center;
  flex: none;
}

.chat-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.chat-main-head {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.msg-scroll {
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding: 4px 0 16px;
}

.msg-more {
  padding: 10px;
  text-align: center;
}

.msg {
  display: grid;
  grid-template-columns: 62px 108px minmax(0, 1fr);
  gap: 10px;
  padding: 7px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}

.msg:hover {
  background: #fcfcfb;
}

.msg-time {
  color: var(--ink-3);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

.msg-who {
  color: var(--ink-2);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-top: 1px;
}

.msg-self .msg-who {
  color: var(--accent-ink);
  font-weight: 500;
}

.msg-body {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  line-height: 1.55;
}

.msg-body .tag {
  color: var(--ink-3);
  font-style: normal;
}

.msg-body img {
  max-width: 220px;
  border-radius: 8px;
  display: block;
}

.msg-body audio {
  height: 32px;
  vertical-align: middle;
  max-width: 280px;
}

.msg-sys {
  color: var(--ink-3);
  font-size: 12px;
}

/* ── 语音页 ───────────────────────────────────────────────── */

.voice-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.voice-row:last-child {
  border-bottom: none;
}

.voice-play {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--accent);
  flex: none;
}

.voice-play:disabled {
  color: var(--ink-3);
  cursor: default;
  opacity: 0.6;
}

.voice-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}

.voice-title {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 转写正文：一条语音可能有几百字，最多显示三行。
   不用 white-space:nowrap —— 截断成一行就失去了「读一眼知道说了什么」的意义。 */
.voice-text {
  font-size: 13px;
  line-height: 1.5;
  margin-top: 3px;
  color: var(--ink-1);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.voice-text.muted {
  color: var(--ink-3);
  font-style: normal;
  font-size: 12.5px;
}

/* 通话转写（2026-11-23）：文字 / 状态 / 操作分三列，文字只露一行，全文进「详细」弹框。
   一行是刻意压的 —— 一次 10 分钟的通话能转出几千字，按行铺开会把整张表
   撑成十几屏，用户滚三下还看不到下一条通话。列表负责「挑」，弹框负责「读」。 */
.asr-clamp {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-1);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 通话表 9 列，必须钉死列宽。
   auto 布局下「转写文字」那格会被 300 字的内容撑开（`text-overflow: ellipsis`
   不会阻止 auto 布局按内容算宽），结果是整张表比容器宽，
   最右边的「状态」「操作」被推到视口外面 —— 用户看到的就是「详细按钮不见了」。
   fixed 布局只认 th 上的 width，剩下的全给唯一没定宽的「转写文字」列。
   min-width 兜住窄屏：宁可横向滚一下（.table-wrap 已经 auto），也不压扁正文。 */
.table-calls {
  table-layout: fixed;
  min-width: 880px;
}

/* 9 列 × 左右各 14px 的默认内边距 = 252px，全花在留白上。
   这张表列多，收到 10px，省下来的 72px 全归转写正文。 */
.table-calls th,
.table-calls td {
  padding-left: 10px;
  padding-right: 10px;
}

/* 弹框里的全文：一行一句（识别本身按句分行），行高放宽到 1.85 ——
   几百字的连续中文按 1.5 排，读三行就串行了。 */
.asr-full {
  font-size: 13px;
  line-height: 1.85;
  color: var(--ink-1);
  white-space: pre-wrap;
  word-break: break-word;
}

.asr-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
}

/* ── 质量页 ───────────────────────────────────────────────── */

.dev-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 14px 16px;
}

.dev-card + .dev-card {
  margin-top: 10px;
}

.reasons {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── 弹窗 ─────────────────────────────────────────────────── */
/*
 * 全站只有这一套弹框。2026-11-19 用户明确要求「其它任何地方要弹框，都用一个样式」，
 * 所以这里做的是**骨架**：头部（标题/副标题/右上关闭）+ 可滚动主体 + 可选底栏。
 * 尺寸只给四档，不允许调用方随手写 width —— 一旦允许，两天后就有五个宽度。
 *
 * .modal 是 flex 列而不是普通块：聊天记录那种「头部固定、正文自己滚」的场景
 * 如果让整个 .modal 滚动，标题栏会被滚出屏幕，关不掉。
 */

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, 92vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 20px 48px -16px rgb(28 25 23 / 32%);
  z-index: 41;
  animation: pop 0.18s cubic-bezier(0.22, 0.8, 0.3, 1);
}

.modal-sm {
  width: min(420px, 92vw);
}

.modal-lg {
  width: min(820px, 94vw);
  max-height: 88vh;
}

/* 聊天记录用这一档：固定高度，正文内部滚动，头部筛选栏永远可见 */
.modal-xl {
  width: min(1040px, 96vw);
  height: 88vh;
  max-height: 88vh;
}

@keyframes pop {
  from {
    transform: translate(-50%, -48%);
    opacity: 0.6;
  }
}

.modal-head {
  padding: 15px 52px 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  flex: none;
}

.modal-head h3 {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-head p {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 3px;
  line-height: 1.55;
}

/* 关闭按钮固定在右上角，不参与头部内容的宽度计算 ——
   标题很长时它被挤下去，用户就只能按 Esc，而 Esc 在输入框里会被输入法吃掉。 */
.modal-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.modal-x:hover {
  background: #efefed;
  color: var(--ink);
}

.modal-body {
  padding: 14px 18px 18px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}

/* 弹框式聊天记录：正文贴边，内边距交给内部容器 */
.modal-body.flush {
  padding: 0;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line-soft);
  flex: none;
}

.codes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  background: #fcfcfb;
}

.code-val {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--accent-ink);
}

.code-meta {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 1px;
}

.notice {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 11.5px;
  line-height: 1.55;
}

/* ── 提示条 ───────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #1c1917;
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  z-index: 90;
  box-shadow: 0 8px 24px -8px rgb(28 25 23 / 40%);
  animation: fade 0.16s ease-out;
}

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

/* ── 窄屏 ─────────────────────────────────────────────────── */

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 0 8px;
    overflow-x: auto;
  }

  .side-head,
  .who {
    display: none;
  }

  .nav {
    flex-direction: row;
    padding: 6px 0;
    gap: 2px;
    overflow-x: auto;
  }

  .nav-item {
    height: 30px;
    padding: 0 9px;
  }

  .side-foot {
    border-top: none;
    padding: 0;
  }

  .view {
    padding: 12px;
  }

  .chat-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .chat-list {
    border-right: none;
    border-bottom: 1px solid var(--line);
    max-height: 40vh;
  }

  .msg {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .msg-body {
    grid-column: 1 / -1;
  }
}

/* ── 内容页（媒体识别结果） ──────────────────────────────────
   网格卡片而不是表格：这一页是"用眼睛找东西"，缩略图比一列列文字快得多。
   表格适合"比对数值"，不适合"认出哪张是订单"。 */

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.media-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.media-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* 缩略图固定高度 + cover：不同比例的截图混排时不会把网格撑成瀑布流 */
.media-thumb {
  width: 100%;
  height: 150px;
  object-fit: cover;
  object-position: top center;
  background: var(--bg-soft, rgba(0, 0, 0, 0.04));
  display: block;
  border-bottom: 1px solid var(--line);
}

.media-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.media-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.media-sub {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  /* 两行截断：标题可能很长（公众号文章标题），不限高会破坏网格对齐 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.media-meta {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-note {
  font-size: 11px;
  color: var(--muted);
}
.media-note.hot {
  color: var(--bad, #d9534f);
}

.media-detail-img {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin-bottom: 12px;
  background: var(--bg-soft, rgba(0, 0, 0, 0.04));
}

/* markdown 原文用 pre：保留换行与表格对齐，不做富文本渲染（内容来自第三方，渲染即风险） */
.media-md {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg-soft, rgba(0, 0, 0, 0.03));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 0;
  max-height: 50vh;
  overflow: auto;
}

.media-ocr {
  margin-top: 12px;
  font-size: 12px;
}
.media-ocr summary {
  cursor: pointer;
  color: var(--muted);
  margin-bottom: 8px;
}
.media-ocr pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg-soft, rgba(0, 0, 0, 0.03));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 0;
  max-height: 40vh;
  overflow: auto;
}

/* 可点的 chip（筛选按钮）。用 button 而不是 a：它不是导航，不该进 history */
button.chip {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}
button.chip:hover {
  border-color: var(--accent);
  color: var(--text);
}
button.chip.accent {
  border-color: var(--accent);
  color: var(--accent);
}

.chip-x {
  margin-left: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}

.more-btn {
  grid-column: 1 / -1;
  padding: 10px;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}
.more-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* 内容页的搜索框：复用 .search 的视觉，但不带图标 */
.media-grid ~ * .input,
.row > .input {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}
.row > .input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════
   侧边栏：两级结构（2026-11-19）
   「设备」是管理对象，「会话/通话/…」是设备下的数据集，
   原先 8 项平铺让二者看起来同级，用户要挨个点才知道区别。
   ═══════════════════════════════════════════════════════════ */

.nav-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: var(--ink-3);
  padding: 10px 10px 4px;
  text-transform: none;
}

.nav-label:first-child {
  padding-top: 4px;
}

.nav-device {
  margin: 0 2px 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.35;
  min-height: 38px;
  display: flex;
  align-items: center;
}

.nav-device .nd-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-device .nd-sub {
  font-size: 11px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-device.empty {
  background: transparent;
  border-style: dashed;
  color: var(--ink-3);
  font-size: 12px;
}

.nav-sub {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* 二级项缩进 10px + 左侧一道竖线：视觉上明确「归属上一级」 */
.nav-sub .nav-item {
  height: 31px;
  font-size: 12.5px;
  padding-left: 16px;
  position: relative;
}

.nav-sub .nav-item::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--line);
}

.nav-item.disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

.nav-item .nav-badge {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--ink-3);
}

/* ═══════════════════════════════════════════════════════════
   设备详情
   ═══════════════════════════════════════════════════════════ */

.dev-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.dev-head h3 {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dev-head .dev-id {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 3px;
}

/* 属性表：标签窄、值宽，可编辑的值的右侧留出铅笔的位置 */
.attr-grid {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.attr-k,
.attr-v {
  padding: 9px 12px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--line-soft);
}

.attr-k {
  color: var(--ink-3);
  background: #fcfcfb;
}

.attr-v {
  overflow-wrap: anywhere;
}

.attr-grid > .attr-k:nth-last-child(2),
.attr-grid > .attr-v:last-child {
  border-bottom: none;
}

/* 可编辑值：默认像普通文本，hover 才显出「能点」 */
.attr-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 1px 5px;
  margin: -1px -5px;
  border-radius: 6px;
  cursor: text;
  border: 1px dashed transparent;
}

.attr-edit:hover {
  border-color: var(--line);
  background: #fbfbfa;
}

.attr-edit .pen {
  font-size: 10.5px;
  color: var(--ink-3);
  opacity: 0;
}

.attr-edit:hover .pen {
  opacity: 1;
}

.attr-edit .placeholder {
  color: var(--ink-3);
  font-style: normal;
}

.attr-input {
  width: 100%;
  height: 28px;
  padding: 0 8px;
  font: inherit;
  font-size: 12.5px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 0 0 3px rgb(15 118 110 / 12%);
  outline: none;
}

/* 近 7 天：四个数字卡并排 */
.week-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.week-cell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 11px 13px;
}

.week-cell .wk-k {
  font-size: 11.5px;
  color: var(--ink-3);
}

.week-cell .wk-v {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-top: 2px;
}

.week-cell .wk-u {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 400;
  margin-left: 3px;
}

/* 微信那一格的分解行（单聊 / 群 / 其它）。比 .wk-u 再弱一档：
   它是「主数字怎么来的」，不是第二个指标，不该和上面的 20px 抢注意力。 */
.week-cell .wk-sub {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 累计数据量里的同款分解行。卡片比周格窄，允许换行。 */
.stat .stat-sub {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════
   设备配置（抽屉里的「配置」栏）
   ═══════════════════════════════════════════════════════════ */

.cfg-wrap {
  padding: 4px 2px 20px;
}

.cfg-head {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.cfg-ver {
  font-size: 13px;
  font-weight: 500;
}

.cfg-slots {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.7;
}

.cfg-list {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.cfg-group-title {
  padding: 9px 14px;
  background: var(--bg-soft, #fafafa);
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.2px;
}

.cfg-list .cfg-group-title:first-child {
  border-top: 0;
}

.cfg-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-top: 1px solid var(--line-soft);
  cursor: pointer;
  font-size: 13px;
}

.cfg-row:hover {
  background: var(--hover, #f7f7f8);
}

.cfg-row input[type='checkbox'] {
  width: 15px;
  height: 15px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent);
}

.cfg-name {
  min-width: 96px;
}

/* 来源标记。「默认」压到最弱（大多数都是它），「机构」用中性灰蓝，
   本机覆盖才给一点强调 —— 它才是「为什么这台机和别人不一样」的答案。 */
.cfg-src {
  flex: none;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  background: #f4f4f3;
  color: var(--ink-3);
}

.cfg-src.own {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.cfg-hint {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  color: var(--ink-3);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cfg-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.cfg-dirty {
  font-size: 12px;
  color: var(--warn, #b45309);
}

/* ---- 采集时间三档（2026-11-20 改版：配置页主体）---- */

.cfg-section-title {
  margin: 16px 0 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

/* 卡片而不是下拉框：三个选项要「同时看见」，用户比较的是节奏（一天几次、分别几点），
   下拉框一次只能看一个，选错一次就是整批机器的采集时间不对。 */
.plan-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.plan-card:hover {
  border-color: #d6d3d0;
  background: #fcfcfb;
}

.plan-card.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.plan-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
}

.plan-dot {
  width: 13px;
  height: 13px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: #fff;
  flex: none;
}

.plan-card.on .plan-dot {
  border-color: var(--accent);
  background: radial-gradient(circle, var(--accent) 0 4px, #fff 4.5px);
}

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

.plan-times {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.6;
  word-break: break-word;
}

.cfg-note {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  background: var(--bg-soft, #fafafa);
  border: 1px solid var(--line-soft);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-3);
}

.cfg-adv {
  margin-top: 16px;
}

.cfg-adv > summary {
  cursor: pointer;
  padding: 9px 2px;
  font-size: 12px;
  color: var(--ink-2);
  list-style: none;
}

.cfg-adv > summary::-webkit-details-marker {
  display: none;
}

.cfg-adv > summary::before {
  content: '▸ ';
  color: var(--ink-3);
}

.cfg-adv[open] > summary::before {
  content: '▾ ';
}

.cfg-adv .cfg-list {
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════
   聊天记录（微信式气泡）
   ═══════════════════════════════════════════════════════════ */

.chat-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: #fcfcfb;
  flex: none;
}

.chat-toolbar input[type="date"] {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font: inherit;
  font-size: 12px;
  color: var(--ink);
}

.chat-toolbar .sep {
  color: var(--ink-3);
  font-size: 12px;
}

.chat-toolbar select {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font: inherit;
  font-size: 12px;
  color: var(--ink);
  padding: 0 6px;
}

.chat-stream {
  background: #f2f1ef;
  padding: 14px 18px 24px;
  flex: 1;
  overflow: auto;
  min-height: 0;
}

.chat-day {
  text-align: center;
  margin: 10px 0 14px;
}

.chat-day span {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  background: rgb(0 0 0 / 5%);
  color: #8a857f;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.chat-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 15px;
}

.chat-row.self {
  flex-direction: row-reverse;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
  flex: none;
  user-select: none;
  overflow: hidden;
}

.avatar.img {
  padding: 0;
  background: #ddd;
}

.avatar.img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: min(72%, 620px);
  min-width: 0;
}

.chat-row.self .chat-col {
  align-items: flex-end;
}

.chat-who {
  font-size: 11px;
  color: #8a857f;
  padding: 0 2px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 「已在手机端删除」标记。用低饱和的琥珀色而不是红色：
   它是「我们有额外信息」，不是「出错了」—— 标成红色会让人以为采集有故障。 */
.chat-del {
  margin-top: 3px;
  font-size: 10.5px;
  color: #9a6a12;
  background: #fdf6e7;
  border: 1px solid #f0e0bd;
  border-radius: 3px;
  padding: 1px 5px;
  display: inline-block;
}

.bubble {
  position: relative;
  padding: 8px 11px;
  border-radius: 6px;
  background: #fff;
  font-size: 13.5px;
  line-height: 1.62;
  color: #1c1917;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  box-shadow: 0 1px 1px rgb(0 0 0 / 4%);
}

/* 本人的气泡用淡绿：截图里两侧都是白底，光靠左右在小屏上容易看错行 */
.chat-row.self .bubble {
  background: #d7f0c4;
}

/* 气泡尖角：用 border 三角，不用 ::after + transform，避免 RTL/缩放下的错位 */
.bubble::before {
  content: "";
  position: absolute;
  top: 11px;
  left: -5px;
  border: 5px solid transparent;
  border-left: 0;
  border-right-color: #fff;
}

.chat-row.self .bubble::before {
  left: auto;
  right: -5px;
  border-right: 0;
  border-left: 5px solid #d7f0c4;
  border-right-color: transparent;
}

.bubble.plain {
  background: none;
  box-shadow: none;
  padding: 0;
}

.bubble.plain::before {
  display: none;
}

.bubble img {
  display: block;
  max-width: 240px;
  max-height: 260px;
  border-radius: 4px;
  cursor: zoom-in;
}

.bubble .b-tag {
  color: #6b6560;
  font-size: 12.5px;
}

/* ── 语音：时长徽标 + 转写正文 ──────────────────────────────
   转写文字不做折叠。这条链路的意义就是「后台一眼看到说了什么」，
   多一次点击等于没人看。徽标只在有 wav 时可点，否则别做成可点状。 */
.b-voice {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgb(0 0 0 / 5%);
  color: #57534e;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.b-voice.playable {
  cursor: pointer;
  background: #eef4ff;
  color: #2f5aa8;
}

.b-voice.playable:hover {
  background: #e2ecff;
}

.b-voice.playing {
  background: #dbe8ff;
  box-shadow: 0 0 0 2px rgb(47 90 168 / 18%);
}

.b-voice-ico {
  font-size: 11px;
  line-height: 1;
}

.b-transcript {
  margin-top: 5px;
  color: #292524;
  white-space: pre-wrap;
}

.b-sub {
  margin-top: 4px;
  color: #a8a29e;
  font-size: 11.5px;
}

/* ── 搜索命中出处：这条消息为什么在结果里 ───────────────────── */
/* 搜「NO2026…」命中的是图片，气泡里只有「[图片]」。不给出处，用户会以为搜索坏了。 */
.b-hit {
  margin-top: 6px;
  padding: 4px 7px;
  background: #fffbeb;
  border-left: 2px solid #f59e0b;
  border-radius: 3px;
  font-size: 11.5px;
  line-height: 1.55;
  color: #57534e;
  /* 气泡是 pre-wrap，这里要改回 normal，否则 OCR 片段里的换行会撑出空行 */
  white-space: normal;
  word-break: break-word;
}

.b-hit-tag {
  margin-right: 5px;
  color: #b45309;
  font-weight: 600;
}

.b-hit-kw {
  padding: 0 1px;
  border-radius: 2px;
  background: #fde68a;
  color: #78350f;
}

/* ── 识别结果：图片/文章/小程序的 markdown，默认收起 ────────── */
.b-md {
  margin-top: 6px;
  border-top: 1px dashed rgb(0 0 0 / 8%);
  padding-top: 5px;
}

.b-md > summary {
  cursor: pointer;
  color: #7c6f5f;
  font-size: 12px;
  list-style: none;
  user-select: none;
}

.b-md > summary::-webkit-details-marker {
  display: none;
}

.b-md > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 4px;
  transition: transform 0.12s;
}

.b-md[open] > summary::before {
  transform: rotate(90deg);
}

.b-md > summary:hover {
  color: #57534e;
}

/* 气泡本身是 `white-space: pre-wrap`，markdown 结构必须改回 normal，
   否则每个 <li> 之间的换行会变成一串空行 */
.b-md-body {
  margin-top: 6px;
  white-space: normal;
  font-size: 12.5px;
  line-height: 1.6;
  color: #44403c;
}

.b-md-body .b-md-h {
  font-weight: 600;
  color: #1c1917;
  margin: 2px 0 4px;
}

.b-md-body .b-md-h1 {
  font-size: 13.5px;
}

.b-md-body .b-md-h2,
.b-md-body .b-md-h3 {
  font-size: 12.5px;
}

.b-md-body .b-md-p {
  margin: 0 0 3px;
}

.b-md-body .b-md-ul,
.b-md-body .b-md-ol {
  margin: 0 0 4px;
  padding-left: 18px;
}

.b-md-body .b-md-ul {
  list-style: disc;
}

.b-md-body .b-md-ol {
  list-style: decimal;
}

.b-md-body li {
  margin: 1px 0;
}

.b-md-body strong {
  font-weight: 600;
  color: #1c1917;
}

/* 系统消息：整行居中灰字，无头像无气泡 */
.chat-sys {
  text-align: center;
  margin: 8px 0 14px;
}

.chat-sys span {
  display: inline-block;
  max-width: 76%;
  padding: 4px 10px;
  border-radius: 5px;
  background: rgb(0 0 0 / 4%);
  color: #7a756f;
  font-size: 12px;
  line-height: 1.5;
}

.chat-empty {
  text-align: center;
  color: #8a857f;
  font-size: 12.5px;
  padding: 40px 10px;
}

.chat-loadmore {
  text-align: center;
  padding: 6px 0 14px;
}

/* 图片预览层：点气泡里的图放大，用固定的遮罩而不是新标签页 */
.img-viewer {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgb(0 0 0 / 78%);
  display: grid;
  place-items: center;
  padding: 28px;
  cursor: zoom-out;
}

.img-viewer img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════
   会话列表（点行开聊天记录弹框）
   ═══════════════════════════════════════════════════════════ */

.chat-rowline {
  cursor: pointer;
}

.chat-rowline:hover td {
  background: #fbfbfa;
}

/* ═══════════════════════════════════════════════════════════
   同步记录（一轮一行）
   2026-11-21：原「客户端事件」列表撤掉，换成这一栏。旧的 .ev / .ev-list
   样式一并删除，只留 .ev-legend（用量弹框还在用）。
   ═══════════════════════════════════════════════════════════ */

/* 顶部那条「最近一次同步：14 分钟前」——它比下面 30 行表格更重要，
   用户扫一眼就够了，所以做成一条独立的横幅而不是表头。 */
.rg-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.rg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.rg-dot.ok {
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
}

.rg-dot.warn {
  background: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-soft);
}

.rg-head > div {
  flex: 1 1 auto;
  min-width: 0;
}

.rg-title {
  font-size: 13px;
  font-weight: 500;
}

.rg-sub {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 2px;
}

/* 数字列右对齐 + 等宽数字：一列数字上下对齐才扫得动。 */
.rg-table th.rg-th-n,
.rg-table td.rg-n {
  text-align: right;
  font-variant-numeric: tabular-nums;
  width: 56px;
}

.rg-table td.rg-n {
  color: var(--ink-3);
}

/* 有数的那些才加重。整列 0 的时候颜色一致，眼睛可以直接跳过 —— 这正是
   「这一轮什么都没新增」的正确观感，不该看起来像坏了。 */
.rg-table td.rg-n.on {
  color: var(--ink);
  font-weight: 500;
}

.rg-table td.rg-up {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  width: 72px;
}

.rg-at {
  font-variant-numeric: tabular-nums;
}

.rg-meta {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
}

.rg-trouble {
  margin-left: 6px;
  font-size: 11px;
  color: var(--danger);
}

/* 横幅右侧的「展开 N 轮无新增」——它是这一页唯一的选择项，别被 flex 压扁 */
.rg-head > .chip,
.rg-head > .btn {
  flex: 0 0 auto;
}

/* 连续的空转轮折成一行。设备每小时看一眼有没有新数据，没有就 1 秒结束 ——
   一天二十来轮都是这样，逐行摆出来会把真正有数据的那几轮淹掉。
   折叠不等于删除：点开还是原始每一行，横幅上的「最近一次同步」也照旧，
   「设备活着」这件事从来没丢。 */
.rg-quiet-sum {
  cursor: pointer;
}

.rg-quiet-sum td {
  padding: 7px 14px;
  background: #fcfcfb;
}

.rg-quiet-sum:hover td {
  background: #f7f7f6;
}

.rg-quiet-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-3);
}

.rg-quiet-at {
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

.rg-quiet-more {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--accent);
}

/* 收起状态用属性选择器，展开时只改 data-open，不用重建整张表 */
.rg-qd[data-open='0'] {
  display: none;
}

.ev-legend {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.6;
  margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════
   右侧抽屉 + 设备列表行内入口
   2026-11-20 用户改版：数据类目不再走侧边栏二级菜单，
   改成「列表里点链接 → 右侧抽屉」。理由：
   - 二级菜单要求先选设备再看数据，选完还得回列表换设备，来回跳；
   - 抽屉能在列表上方叠出来，换一台机只要关掉再点下一行。
   ═══════════════════════════════════════════════════════════ */

/* 抽屉复用 .modal 的骨架（同一套头部/关闭/Esc 行为），只改定位与动画。
   不做成第二套组件：分开做就会出现「一种框 Esc 能关、另一种关不掉」。 */
.modal.modal-side {
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  transform: none;
  height: 100vh;
  max-height: 100vh;
  width: min(1020px, 96vw);
  border-radius: 14px 0 0 14px;
  animation: side-in 0.22s cubic-bezier(0.22, 0.8, 0.3, 1);
}

@keyframes side-in {
  from {
    transform: translateX(56px);
    opacity: 0.5;
  }
}

/* 抽屉里再套一层视图时，表格不要顶到边缘 */
.modal-side .modal-body {
  padding: 0;
}

.modal-side .drawer-view {
  padding: 16px 18px 24px;
}

.modal-side .modal-head {
  padding: 14px 52px 12px 18px;
}

/* 设备列表里的「概览 / 会话 / 通话 / 短信 / 内容」 */
.row-links {
  display: flex;
  gap: 2px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.row-links a {
  font-size: 12px;
  color: var(--ink-3);
  padding: 2px 7px;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
}

.row-links a:hover {
  background: #efefed;
  color: var(--accent-ink);
}

/* 列表里的 ID / 系统这类窄列：一行放得下就不换行 */
.dev-table td.nowrap,
.dev-table th.nowrap {
  white-space: nowrap;
}

.dev-table .dev-id-cell {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}

/* 概览抽屉：数字区在前，基本信息在后 */
.ov-block {
  margin-bottom: 18px;
}

.ov-block > h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}

.ov-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.ov-head h3 {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ov-head .ov-id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 3px;
}

/* 用量明细弹框里的按月表格 */
.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.mini-table th,
.mini-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line-soft);
  text-align: right;
  white-space: nowrap;
}

.mini-table th:first-child,
.mini-table td:first-child {
  text-align: left;
}

.mini-table thead th {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
}

.mini-table tbody tr:last-child td {
  border-bottom: none;
}

/* 抽屉里的类目切换条：属于「这台设备」，不属于正文 —— 所以固定在头部下方，
   不随正文滚动。用 button 而不是 <a>：切 tab 不跳路由，只换正文。 */
.drawer-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line-soft);
  overflow-x: auto;
  flex: none;
  background: var(--panel);
}

.drawer-tab {
  border: none;
  background: transparent;
  font-size: 12.5px;
  color: var(--ink-3);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.drawer-tab:hover {
  background: #f2f1ef;
  color: var(--ink);
}

.drawer-tab.on {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 500;
}

/* 设备列表：名称列吃掉省下来的宽度（2026-11-20 去掉型号/系统/近 7 天后）。
   九成时间人在列表里找「哪一台」，名称是唯一被逐行读的字段，给它最多的横向空间。
   min-width 而不是固定 width：设备名短的时候不要把整表撑出横向滚动。 */
.dev-table .col-name {
  min-width: 220px;
}

.dev-table .col-name > .row > span:first-child {
  font-weight: 500;
  font-size: 13px;
}

/* ID 是无意义的长串，只用来跟运维对话时核身份 —— 给它最少的宽度，
   但别折行（折了会把行高撑成两倍，整张表就不好扫了）。 */
.dev-table th:first-child,
.dev-table td:first-child {
  width: 1%;
}

/* 口径说明。用中性灰：它是「解释为什么这个数长这样」，不是告警，
   避免每次打开概览都看到一片红。 */
.ov-note {
  margin-top: 10px;
  color: var(--muted, #6b7280);
  font-size: 11.5px;
  line-height: 1.6;
}

/* 五个格子：近 7 天现在多了「通话录音」，四列会掉到第二行只剩一个，很难看 */
.week-grid {
  grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 640px) {
  .week-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .plan-grid {
    grid-template-columns: 1fr;
  }
}
