/* ══ 控制台 ══════════════════════════════════════════ */

body { background: var(--bg); }

.shell { height: 100dvh; display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
body { overflow: hidden; }

/* ── 顶栏 ─────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px; flex-wrap: nowrap;
  padding: 8px clamp(10px, 2vw, 20px); min-height: 0;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { flex: none; }
.topbar .brand span { font-size: 14px; }
.topbar .grow { flex: 1; }
.topbar .who { font-size: 12.5px; color: var(--muted); }
.topbar .who b { color: var(--text-2); font-weight: 600; }

.live-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 11px 4px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 650;
  background: rgba(5,150,105,.10); border: 1px solid rgba(5,150,105,.28); color: var(--emerald);
}
.live-chip i {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  animation: pulse-dot 1.9s var(--ease-io) infinite;
}
.live-chip.stale { background: rgba(180,83,9,.10); border-color: rgba(180,83,9,.28); color: var(--amber); }
@keyframes pulse-dot { 50% { opacity: .3; transform: scale(.75); } }

/* ── 指标条 ───────────────────────────────── */
.statbar {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  padding: 16px clamp(14px, 3vw, 30px) 6px;
}
.stat {
  position: relative; overflow: hidden;
  padding: 13px 15px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border);
}
.stat::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120px 60px at 12% -10%, var(--tint, rgba(79,70,229,.08)), transparent 70%);
}
.stat .k { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; font-weight: 600; }
.stat .v {
  font-size: 26px; font-weight: 750; letter-spacing: -.03em; line-height: 1.15;
  font-variant-numeric: tabular-nums; margin-top: 2px;
}
.stat .v small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.stat.north { --tint: rgba(13,148,136,.14); border-color: rgba(13,148,136,.28); }
.stat.north .v { color: var(--teal); }

/* ── 工具条 ───────────────────────────────── */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px clamp(14px, 3vw, 30px) 4px;
}
.toolbar h2 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; margin-right: auto; }
.toolbar h2 em { font-style: normal; color: var(--muted); font-weight: 500; font-size: 13px; margin-left: 7px; }

.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.seg button {
  padding: 6px 13px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted);
  transition: background .18s, color .18s;
}
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }

/* ── 员工卡片墙 ───────────────────────────── */

@keyframes card-pop {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

@keyframes sweep { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── 截图画面 ─────────────────────────────── */

@keyframes scan { 0% { transform: translateY(-100%); } 100% { transform: translateY(100%); } }

/* ── 卡片正文 ─────────────────────────────── */

@keyframes ripple {
  0%   { transform: scale(1);   opacity: .8; }
  100% { transform: scale(2.7); opacity: 0; }
}

/* ── 左下思考区：显示它此刻在想什么 ───────── */

@keyframes think-pulse { 50% { opacity: .45; transform: scale(.92); } }

@keyframes shimmer { to { background-position: -200% 0; } }

@media (hover: none) { .card-actions { opacity: 1; transform: none; } }

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

/* ── 抽屉 / 弹窗 ──────────────────────────── */
.scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(16,28,48,.34); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.scrim.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; z-index: 61; top: 0; right: 0; bottom: 0;
  width: min(640px, 100vw);
  background: #ffffff;
  border-left: 1px solid var(--border-2);
  box-shadow: -24px 0 60px -24px rgba(16,32,64,.28);
  transform: translateX(100%);
  transition: transform .42s var(--ease);
  display: grid; grid-template-rows: auto 1fr;
  overflow: hidden;
}
.drawer.open { transform: none; }
.drawer-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.drawer-head h3 { font-size: 16px; font-weight: 700; flex: 1; }
.drawer-body { overflow-y: auto; padding: 18px 20px 40px; display: grid; gap: 22px; }

.sec h4 {
  font-size: 12px; font-weight: 700; color: var(--muted);
  letter-spacing: .07em; text-transform: uppercase; margin-bottom: 10px;
}

.filmstrip { display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.filmstrip figure { border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--bg-3); }
.filmstrip img { width: 100%; aspect-ratio: 16/10; object-fit: cover; object-position: top center; }
.filmstrip figcaption { padding: 6px 8px; font-size: 10.5px; color: var(--muted); }

.rows { display: grid; gap: 6px; }
.row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  padding: 9px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); font-size: 12.5px;
}
.row .t { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row .m { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.error { border-color: rgba(225,29,72,.25); background: rgba(225,29,72,.05); }
.row.warn { border-color: rgba(180,83,9,.22);   background: rgba(180,83,9,.05); }

.modal {
  position: fixed; z-index: 70; inset: 0; display: grid; place-items: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .28s;
}
.modal.open { opacity: 1; pointer-events: auto; }
.modal .box {
  width: min(460px, 100%); padding: 26px;
  background: #ffffff;
  border: 1px solid var(--border-2); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  transform: translateY(12px) scale(.97); transition: transform .32s var(--ease);
  display: grid; gap: 16px;
}
.modal.open .box { transform: none; }
.modal h3 { font-size: 18px; font-weight: 700; }
.modal .actions { display: flex; gap: 9px; justify-content: flex-end; }

.code-out {
  padding: 18px; border-radius: var(--r); text-align: center;
  background: rgba(13,148,136,.06); border: 1px dashed rgba(13,148,136,.40);
}
.code-out .c {
  font-family: var(--mono); font-size: 30px; font-weight: 700; letter-spacing: .14em;
  color: var(--teal);
}
.code-out .t { font-size: 12px; color: var(--muted); margin-top: 7px; }

.toast-host { position: fixed; z-index: 90; bottom: 22px; left: 50%; translate: -50% 0; display: grid; gap: 8px; }
.toast {
  padding: 11px 17px; border-radius: 11px; font-size: 13px; font-weight: 550;
  background: #ffffff; border: 1px solid var(--border-2);
  box-shadow: var(--shadow-lg); backdrop-filter: blur(14px);
  animation: toast-in .35s var(--ease) both;
}
.toast.ok { border-color: rgba(5,150,105,.45);  color: #047857; }
.toast.bad { border-color: rgba(225,29,72,.45);  color: #be123c; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.95); } to { opacity: 1; transform: none; } }

/* ── 响应式 ───────────────────────────────── */
@media (max-width: 640px) {
  .topbar .who, .topbar .brand span { display: none; }
  .statbar { grid-template-columns: repeat(2, 1fr); }
  .fleet { grid-template-columns: 1fr; }
  .drawer { width: 100vw; }
  /* 手机上左右各半就都看不清了，退回上下堆叠 */
  .card { grid-template-columns: minmax(0, 1fr); height: auto; }
  .card-main { border-right: none; }
  .screen { height: 168px; flex: none; }
  .card-log { overflow: visible; }
  .card-log > .wl-sec, .card-log > .wl-sec-plan { flex: none; }
  .wl-list { max-height: 92px; }
}
/* 容器查询原先在宽卡片上加大内边距，现在高度是固定的，加了就把截图挤没了 */

/* ── 上手向导步骤 ─────────────────────────── */
.steps { display: grid; gap: 15px; margin: 6px 0 10px; }
.step { display: grid; grid-template-columns: 30px 1fr; gap: 13px; align-items: start; }
.step-n {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; background: var(--grad); color: #fff;
}
.step-b b { font-size: 14px; }
.step-b p { font-size: 12.5px; color: var(--text-2); margin: 3px 0 9px; line-height: 1.65; }
code {
  font-family: var(--mono); font-size: .88em;
  background: var(--bg-3); padding: 1px 6px; border-radius: 5px; color: var(--teal);
}

/* ── API Key 小眼睛 ─────────────────────────── */
.key-wrap { position: relative; }
.key-wrap .input { padding-right: 42px; }
.key-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: grid; place-items: center;
  color: var(--muted); border-radius: 8px; background: transparent;
}
.key-eye:hover { color: var(--text); background: var(--bg-2); }

/* ── 对话抽屉 ─────────────────────────────── */

.chat-body {
  overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px;
  background: var(--bg);
}
.msg { max-width: 82%; display: flex; flex-direction: column; gap: 4px; }
.msg .bubble {
  padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.msg .t { font-size: 10.5px; color: var(--muted); padding: 0 4px; }

.msg.admin { align-self: flex-end; align-items: flex-end; }
.msg.admin .bubble {
  background: var(--grad); color: #fff;
  border-bottom-right-radius: 5px; font-weight: 500;
}
.msg.employee { align-self: flex-start; align-items: flex-start; }
.msg.employee .bubble {
  background: #fff; border: 1px solid var(--border);
  color: var(--text); border-bottom-left-radius: 5px;
}
.msg.system { align-self: center; max-width: 92%; }
.msg.system .bubble {
  background: transparent; color: var(--muted); font-size: 12px; padding: 3px 10px;
}

.chat-empty { margin: auto; text-align: center; color: var(--muted); font-size: 13px; padding: 40px 20px; }
.chat-empty svg { opacity: .3; margin-bottom: 12px; }

.chat-typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; }
.chat-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); animation: bounce 1.3s var(--ease-io) infinite; }
.chat-typing i:nth-child(2) { animation-delay: .17s; }
.chat-typing i:nth-child(3) { animation-delay: .34s; }

/* ── 对话里的工作画面 ─────────────────────── */
.msg .shots { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.msg .shot {
  display: block; width: 116px; border-radius: 9px; overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-3);
  transition: transform .2s var(--ease), border-color .2s;
}
.msg .shot:hover { transform: scale(1.04); border-color: var(--teal); }
.msg .shot img { width: 100%; aspect-ratio: 16/10; object-fit: cover; object-position: top center; display: block; }

/* ── 右侧吸附工作日志 ─────────────────────── */

.wl-badge {
  margin-left: auto; padding: 1px 7px; border-radius: 5px;
  font-size: 10px; font-weight: 650; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
}
.wl-badge.live { color: var(--teal); border-color: rgba(13,148,136,.35); background: rgba(13,148,136,.09); }
.wl-badge.live::before {
  content: '●'; margin-right: 3px; font-size: 8px;
  animation: wl-pulse 1.2s var(--ease-io) infinite;
}
.wl-badge.ok { color: var(--emerald); border-color: rgba(5,150,105,.32); background: rgba(5,150,105,.08); }
.wl-badge.bad { color: var(--rose);    border-color: rgba(225,29,72,.30); background: rgba(225,29,72,.07); }

.wl-row {
  display: grid; grid-template-columns: 13px 1fr auto; gap: 5px; align-items: center;
  padding: 3px 5px; border-radius: 6px; font-size: 11px; line-height: 1.45; flex: none;
}
.wl-row .wl-i { font-size: 9.5px; text-align: center; }
.wl-row .wl-s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-row .wl-t { font-size: 9.5px; color: var(--muted); font-variant-numeric: tabular-nums; opacity: .8; }

/* 已完成：整行绿色 + 绿勾，一眼看出"这步成了" */
.wl-row.done {
  color: #047857; background: rgba(5,150,105,.07);
  border-left: 2px solid var(--emerald); padding-left: 4px;
}
.wl-row.done .wl-i { color: var(--emerald); font-weight: 700; }
.wl-row.done .wl-t { color: #059669; opacity: .75; }

/* 进行中：青色高亮 + 呼吸 */
.wl-row.now {
  background: rgba(13,148,136,.13); color: #0f766e; font-weight: 650;
  border-left: 2px solid var(--teal); padding-left: 4px;
}
.wl-row.now .wl-i { color: var(--teal); animation: wl-pulse 1.2s var(--ease-io) infinite; }

/* 待办：淡灰，不抢注意力 */
.wl-row.todo { color: var(--muted); border-left: 2px solid transparent; padding-left: 4px; }
.wl-row.todo .wl-i { color: var(--border-2); }

/* 失败：红 */
.wl-row.bad {
  background: rgba(225,29,72,.08); color: #be123c;
  border-left: 2px solid var(--rose); padding-left: 4px; font-weight: 600;
}
.wl-row.bad .wl-i { color: var(--rose); font-weight: 700; }
@keyframes wl-pulse { 50% { opacity: .3; } }

.wl-empty { font-size: 11px; color: var(--muted); padding: 5px 4px; }

/* 窄屏：日志改为落到下方，不再吸附右侧 */

/* ── 画面放大按钮 / 大图查看 ───────────────── */

@media (hover: none) { .shot-zoom { opacity: 1; } }

.shotview {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px;
  background: rgba(16,28,48,.62); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.shotview.open { opacity: 1; pointer-events: auto; }
.sv-box {
  max-width: min(1200px, 96vw); max-height: 92vh; display: flex; flex-direction: column;
  background: #fff; border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-lg); transform: scale(.97); transition: transform .25s var(--ease);
}
.shotview.open .sv-box { transform: none; }
.sv-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--bg-2);
}
.sv-head .sv-name { font-size: 14px; }
.sv-head .sv-meta { font-size: 11.5px; color: var(--muted); flex: 1; }
.sv-box img { max-width: 100%; max-height: calc(92vh - 52px); object-fit: contain; background: #fff; }

/* ── 任务完成态：整块给出明确信号 ─────────── */

/* 子目标行：比动作行更醒目一点 */
.wl-row.wl-ms { padding-top: 4px; padding-bottom: 4px; font-size: 11.5px; }
.wl-row.wl-ms .wl-s { white-space: normal; line-height: 1.4; }
.wl-row.wl-ms .wl-t { align-self: flex-start; margin-top: 1px; }

/* ── 目标放大按钮 / 任务全文详情 ───────────── */

/* ── 「正在执行」标记 / 验收标准 ───────────── */
.wl-cur {
  display: inline-block; margin-right: 5px; padding: 0 5px;
  border-radius: 4px; font-size: 9.5px; font-weight: 700; letter-spacing: .04em;
  background: var(--teal); color: #fff; vertical-align: 1px;
}
.wl-cur.acc { background: var(--indigo); }
.wl-row.now.wl-ms { box-shadow: inset 0 0 0 1px rgba(13,148,136,.25); }

/* 子计划自带校验的小标 */
.wl-chk {
  display: inline-block; margin-left: 4px; font-style: normal;
  font-size: 9px; color: var(--indigo); opacity: .85;
}
.wl-row.done .wl-chk { color: var(--emerald); opacity: 1; }

/* 计划行的「正在执行」三角与「有校验」对勾：本地 SVG，禁用 emoji */
.wl-row .wl-i .ic.wl-play { vertical-align: -1px; }
.wl-chk { display: inline-flex; align-items: center; color: var(--ok, #16a34a); margin-left: 4px; }
.wl-chk .ic { stroke-width: 3; }

/* 顶栏的组织图标条。带字按钮太多会把顶栏撑高、把统计挤折行， */
/* 这些是低频入口，收成图标 + tooltip 就够。 */
.orgbar { display: inline-flex; align-items: center; gap: 4px; flex: none; }

/* 竖排的行。
   .row 是 grid 三列，给它写 flex-direction:column 一点用都没有 ——
   三个子元素会被摊成三列，中间那段文字挤成一根竖条（部门职能那块就这么塌的）。
   需要上下堆叠的行用这个类。 */
.rowv {
  display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  padding: 9px 12px; border-radius: 10px; font-size: 12.5px;
  background: var(--surface); border: 1px solid var(--border);
}
.rows { gap: 6px; }
.rows > .rowv + .rowv { margin-top: 0; }

/* ══ 自己的对话框（不用系统原生 alert/confirm/prompt）═══════ */

.dlg-host { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; }
.dlg-host[hidden] { display: none !important; }
.dlg-mask { position: absolute; inset: 0; background: rgba(16,26,48,.34); backdrop-filter: blur(2px); }
.dlg {
  position: relative; width: min(400px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 14px; box-shadow: 0 24px 60px -16px rgba(16,32,64,.4);
  padding: 18px 18px 14px;
  animation: dlg-in .16s var(--ease) both;
}
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.dlg-t { font-size: 14.5px; font-weight: 700; }
.dlg-b { margin-top: 7px; font-size: 13px; line-height: 1.7; color: var(--text-2); white-space: pre-wrap; }
.dlg-f { display: block; margin-top: 12px; }
.dlg-f span { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.dlg-f span:empty { display: none; }
.dlg-f input {
  width: 100%; border: 1px solid var(--border); border-radius: 9px;
  padding: 8px 11px; font: inherit; font-size: 13px; background: var(--surface);
}
.dlg-f input:focus { outline: none; border-color: rgba(13,148,136,.55); }
.dlg-a { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.dlg-a .btn { padding: 8px 16px; font-size: 13px; }
.btn-danger { background: var(--rose); color: #fff; border-color: transparent; }
.btn-danger:hover { filter: brightness(1.06); }

/* 文件名就地改：跟资源管理器一样，新建完直接进编辑 */
.fname-edit {
  width: 100%; min-width: 0; border: 1px solid rgba(13,148,136,.6); border-radius: 5px;
  padding: 1px 4px; font: inherit; font-size: inherit; background: var(--surface);
  color: var(--text); text-align: inherit;
}
.fname-edit:focus { outline: none; box-shadow: 0 0 0 2px rgba(13,148,136,.16); }
.ftile .fname-edit { text-align: center; }

/* ══ 执行记录整页 ═══════════════════════════════════════
   一个人一整页：左边一直播着他的画面，右上是这单活的详情，
   下面「计划」「日志」并排，底下压一条历史。
   以前这里是一张缩在左上角的卡片，右边大片空着 —— 全摊开。 */
.runpage {
  display: grid; gap: 10px; padding: 10px; min-height: 0; overflow-y: auto;
  align-content: start;
  /* 工作台这一栏窄的时候只有 600 出头，摆不下三列。
     按「容器」宽度分档，不能按视口 —— 视口 1440 而这里只有 612。 */
  grid-template-columns: minmax(210px, 280px) 1fr;
  grid-template-rows: auto minmax(160px, 1fr) auto auto;
}
.rp-shot { grid-column: 1; grid-row: 1 / 3; }
.rp-task { grid-column: 2; grid-row: 1; }
.rp-plan { grid-column: 2; grid-row: 2; }
.rp-log { grid-column: 1 / 3; grid-row: 3; min-height: 190px; }
.rp-hist { grid-column: 1 / 3; grid-row: 4; }

/* 宽敞了就把日志挪到计划旁边，三列铺开 */
@container omain (min-width: 1000px) {
  .runpage {
    grid-template-columns: minmax(280px, 340px) 1fr 1fr;
    grid-template-rows: auto minmax(200px, 1fr) auto;
  }
  .rp-task { grid-column: 2 / 4; }
  .rp-plan { grid-column: 2; grid-row: 2; }
  .rp-log  { grid-column: 3; grid-row: 2; min-height: 0; }
  .rp-hist { grid-column: 1 / 4; grid-row: 3; }
}

/* 窄到摆不下两列就整个竖过来 */
@container omain (max-width: 520px) {
  .runpage { grid-template-columns: 1fr; grid-template-rows: repeat(5, auto); }
  .rp-shot, .rp-task, .rp-plan, .rp-log, .rp-hist { grid-column: 1; grid-row: auto; }
  .rp-plan, .rp-log { min-height: 170px; }
}

.rp {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden;
}
.rp-h {
  display: flex; align-items: center; gap: 6px; flex: none;
  padding: 7px 10px; border-bottom: 1px solid var(--border); background: var(--bg-2);
}
.rp-h b { font-size: 11.5px; font-weight: 700; color: var(--text-2); letter-spacing: .02em; }
.rp-h .grow { flex: 1; }
.rp-n { font-size: 10.5px; color: var(--teal); font-variant-numeric: tabular-nums; }
.rp-dim {
  font-size: 10.5px; color: var(--muted); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rp-ico {
  flex: none; width: 22px; height: 22px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  display: grid; place-items: center; transition: color .15s, border-color .15s;
}
.rp-ico:hover { color: var(--teal); border-color: rgba(13,148,136,.4); }
.rp-ico[hidden] { display: none !important; }
.rp-live {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .04em; padding: 1px 6px;
  border-radius: 99px; border: 1px solid var(--border); color: var(--muted); background: var(--surface);
}
.rp-live.on { color: var(--rose); border-color: rgba(225,29,72,.35); }
.rp-live.on i {
  width: 5px; height: 5px; border-radius: 50%; background: currentColor;
  animation: bounce 1.4s var(--ease-io) infinite;
}

/* 画面 */
.rp-screen {
  position: relative; flex: none; aspect-ratio: 16 / 10; background: var(--bg-3);
  cursor: zoom-in; overflow: hidden;
}
.rp-screen img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: top center; opacity: 0; transition: opacity .32s var(--ease);
}
.rp-screen img.on { opacity: 1; }
.rp-noshot {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px;
  color: var(--muted); font-size: 11.5px;
}
.rp-noshot[hidden] { display: none !important; }
.rp-noshot svg { opacity: .3; }

.rp-where {
  display: flex; align-items: center; gap: 5px; flex: none; min-width: 0;
  padding: 7px 10px; border-bottom: 1px solid var(--border); font-size: 11.5px;
}
.rp-where b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: none; max-width: 55%; }
.rp-pin { color: var(--teal); display: inline-flex; flex: none; }
.rp-url { color: var(--muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rp-film { display: flex; gap: 5px; padding: 7px 10px; overflow-x: auto; flex: none; }
.rp-film[hidden] { display: none !important; }
.rp-film::-webkit-scrollbar { height: 5px; }
.rp-film::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
.rp-frame {
  flex: none; width: 74px; border-radius: 6px; overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-3); transition: border-color .15s;
}
.rp-frame:hover { border-color: var(--teal); }
.rp-frame img { width: 100%; aspect-ratio: 16/10; object-fit: cover; object-position: top center; display: block; }

.rp-facts { padding: 4px 10px 9px; overflow-y: auto; min-height: 0; }
.rp-fact {
  display: flex; align-items: baseline; gap: 8px; padding: 3px 0; font-size: 11.5px;
  border-bottom: 1px dashed var(--border);
}
.rp-fact:last-child { border-bottom: 0; }
.rp-fact span { color: var(--muted); flex: none; width: 46px; }
.rp-fact b { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 任务详情 */
.rp-goal { padding: 9px 11px 7px; font-size: 13.5px; font-weight: 600; line-height: 1.5; }
.rp-goal.none { color: var(--muted); font-weight: 400; }
.rp-bar { height: 4px; margin: 0 11px; border-radius: 99px; background: var(--bg-3); overflow: hidden; flex: none; }
.rp-bar i {
  display: block; height: 100%; border-radius: 99px; background: var(--grad);
  transition: width .5s var(--ease);
}
.rp-bar i.done { background: var(--emerald); }
.rp-bar i.failed { background: var(--rose); }
.rp-chips { display: flex; flex-wrap: wrap; gap: 5px; padding: 9px 11px; }
.rp-chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px;
  padding: 2px 8px; border-radius: 99px; border: 1px solid var(--border); background: var(--bg-2);
}
.rp-chip span { color: var(--muted); }
.rp-chip.ok { color: #047857; border-color: rgba(5,150,105,.3);  background: rgba(5,150,105,.07); }
.rp-chip.warn { color: #b45309; border-color: rgba(217,119,6,.3);  background: rgba(217,119,6,.07); }
.rp-acc,
.rp-err {
  margin: 0 11px 10px; padding: 8px 10px; border-radius: 9px; font-size: 11.5px; line-height: 1.6;
}
.rp-acc[hidden],
.rp-err[hidden] { display: none !important; }
.rp-acc { background: rgba(13,148,136,.06); border: 1px solid rgba(13,148,136,.22); }
.rp-err { background: rgba(225,29,72,.06);  border: 1px solid rgba(225,29,72,.22); color: #9f1239; }
.rp-acc b,
.rp-err b { display: block; font-size: 10.5px; letter-spacing: .03em; margin-bottom: 3px; opacity: .8; }
.rp-acc ul { margin: 5px 0 0; padding-left: 16px; }
.rp-acc li { margin: 1px 0; }

/* 计划 / 日志共用的滚动列表 */
.rp-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; }
.rp-list::-webkit-scrollbar { width: 5px; }
.rp-list::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
.rp-list .wl-row { font-size: 11.5px; }
.rp-list .wl-row .wl-s { white-space: normal; line-height: 1.5; }

/* 历史任务 */
.rp-hlist { max-height: 168px; overflow-y: auto; padding: 4px 6px; }
.rp-hlist::-webkit-scrollbar { width: 5px; }
.rp-hlist::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
.rp-hrow {
  display: grid; grid-template-columns: 14px 1fr auto auto; gap: 9px; align-items: center;
  padding: 4px 6px; border-radius: 6px; font-size: 11.5px;
}
.rp-hrow:hover { background: var(--bg-2); }
.rp-hs { text-align: center; font-size: 10px; color: var(--muted); }
.rp-hrow.ok  .rp-hs { color: var(--emerald); font-weight: 700; }
.rp-hrow.bad .rp-hs { color: var(--rose); font-weight: 700; }
.rp-hg { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-hm,
.rp-ht { color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }

/* ══ 对话：气泡里的富文本、任务卡、思考态 ═════════════ */
.msg .bubble .li { display: block; padding-left: 1em; text-indent: -1em; }
.msg .bubble .li::before { content: '· '; opacity: .65; }
.msg .bubble a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.msg .tcard {
  width: 100%; margin-top: 6px; padding: 8px 10px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
}
.msg .tcard.run { border-color: rgba(13,148,136,.32); background: rgba(13,148,136,.05); }
.msg .tcard.ok { border-color: rgba(5,150,105,.28);  background: rgba(5,150,105,.05); }
.msg .tcard.bad { border-color: rgba(225,29,72,.28);  background: rgba(225,29,72,.05); }
.tcard-h { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tcard-h b {
  font-size: 12px; font-weight: 600; color: var(--text); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tcard-tag {
  flex: none; font-size: 9.5px; font-weight: 700; letter-spacing: .03em;
  padding: 1px 6px; border-radius: 99px; border: 1px solid currentColor; opacity: .85;
}
.tcard.run .tcard-tag { color: var(--teal); }
.tcard.ok  .tcard-tag { color: var(--emerald); }
.tcard.bad .tcard-tag { color: var(--rose); }
.tcard-bar { height: 3px; margin: 7px 0 5px; border-radius: 99px; background: var(--bg-3); overflow: hidden; }
.tcard-bar i { display: block; height: 100%; border-radius: 99px; background: var(--grad); transition: width .5s var(--ease); }
.tcard.ok  .tcard-bar i { background: var(--emerald); }
.tcard.bad .tcard-bar i { background: var(--rose); }
.tcard-m { display: flex; gap: 9px; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.chat-typing { align-items: center; }
.chat-typing .why {
  margin-left: 4px; font-size: 11.5px; color: var(--muted); font-style: normal;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 380px;
}

/* 聊天页顶上那条：他现在停在哪一页 */
.ochat-top {
  display: flex; align-items: center; gap: 5px; flex: none; min-width: 0;
  padding: 6px 14px; border-bottom: 1px solid var(--border);
  background: var(--bg-2); font-size: 11.5px;
}
.ochat-top[hidden] { display: none !important; }
.ochat-top b { font-weight: 600; flex: none; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
