:root {
  --bg-root: #05060a;
  --bg-zenith: #0a0a10;
  --bg-panel: rgba(12, 12, 17, 0.86);
  --bg-panel-solid: #0c0c11;
  --bg-card: rgba(255, 240, 215, 0.038);
  --bg-card-active: rgba(217, 183, 126, 0.11);
  --bg-elevated: #111115;
  --bg-sunken: rgba(0, 0, 0, 0.42);

  --border: rgba(232, 208, 166, 0.14);
  --border-subtle: rgba(232, 208, 166, 0.075);
  --border-strong: rgba(232, 208, 166, 0.28);

  --text-strong: #fff8ec;
  --text-main: #ebe5d9;
  --text-secondary: #a59d8f;
  --text-muted: #857e72;

  --accent: #d9b77e;
  --accent-rgb: 217, 183, 126;
  --accent-ink: #f0d9ae;
  --accent-soft: rgba(217, 183, 126, 0.14);
  --on-accent: #1a1308;

  --ok: #8fc7a5;
  --ok-rgb: 143, 199, 165;
  --warn: #ff9a5c;
  --warn-rgb: 255, 154, 92;
  --danger: #f2757a;
  --danger-rgb: 242, 117, 122;
  --cool: #9db4d8;
  --cool-rgb: 157, 180, 216;

  --font-ui: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI Variable Text", "Microsoft YaHei UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --radius: 11px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: visible;
  overscroll-behavior: none;
  background-color: var(--bg-root);
  background-image:
    radial-gradient(ellipse at 50% -10%, rgba(var(--accent-rgb), 0.09), transparent 58%),
    radial-gradient(circle at 18% 22%, rgba(255, 248, 236, 0.045) 1px, transparent 1.5px),
    radial-gradient(circle at 78% 36%, rgba(var(--accent-rgb), 0.06) 1px, transparent 1.6px),
    radial-gradient(circle at 42% 76%, rgba(255, 248, 236, 0.035) 1px, transparent 1.5px);
  background-size: 100% 100%, 160px 160px, 220px 220px, 190px 190px;
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app {
  /* 使用 absolute 而非 fixed，彻底规避 WebKit Bug 237961 超高 fixed 图层引起的反向滚动位移 */
  position: absolute;
  top: var(--app-top, 0px);
  left: 0;
  right: 0;
  height: var(--app-h, 100dvh);
  width: 100%;
  display: flex;
  flex-direction: column;
  max-width: 760px;
  margin: 0 auto;
  overflow: hidden;
}

/* ── 顶部遥测栏 ── */
.topbar {
  padding-top: calc(8px + var(--safe-top));
  padding-bottom: 9px;
  padding-left: 14px;
  padding-right: 14px;
  background: var(--bg-panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  z-index: 20;
}

.topbar.compact {
  padding-top: calc(5px + var(--safe-top));
  padding-bottom: 6px;
}

.topbar.compact .btn {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ws-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(var(--danger-rgb), 0.6);
}

.ws-dot.online {
  background: var(--ok);
  box-shadow: 0 0 8px rgba(var(--ok-rgb), 0.65);
}

.topbar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.wake-global-pill.active {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.55);
  color: #a7f3d0;
  font-size: 12px;
  font-weight: 600;
  gap: 5px;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.wake-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px #34d399;
  animation: wakePulse 1.3s ease-in-out infinite;
}

@keyframes wakePulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.8);
  }
}

.plat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 17px;
  padding: 0 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
}

.plat-badge.is-pi {
  background: rgba(var(--accent-rgb), 0.16);
  border: 1px solid rgba(var(--accent-rgb), 0.42);
  color: var(--accent);
}

.plat-badge.is-codex {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.48);
  color: #6ee7b7;
}

.plat-badge.is-agy {
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(129, 140, 248, 0.5);
  color: #c7d2fe;
}

.catalog-folder-group {
  margin-bottom: 10px;
}

.catalog-folder-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-strong);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 6px;
}

.catalog-folder-head .cfh-name {
  flex: 1;
  min-width: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-folder-head .cfh-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* ── 通用按钮与全局防误触热区优化 ── */
.btn,
.tab-item,
.seg-pill,
.tool-chip,
.butler-sub-pill,
.butler-dd-item,
.fleet-group-header,
.catalog-folder-head,
.quota-win-btn,
.session-card,
.artifact-card {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.btn {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
}

.btn:active {
  opacity: 0.78;
}

.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.btn-accent {
  background: linear-gradient(180deg, #e8ca95 0%, #c9a467 100%);
  border-color: rgba(var(--accent-rgb), 0.7);
  color: var(--on-accent);
  font-weight: 600;
}

.btn-danger {
  background: rgba(var(--danger-rgb), 0.16);
  border-color: rgba(var(--danger-rgb), 0.52);
  color: var(--danger);
  font-weight: 600;
}

.btn-warn {
  background: rgba(var(--warn-rgb), 0.16);
  border-color: rgba(var(--warn-rgb), 0.52);
  color: var(--warn);
  font-weight: 600;
}

.btn-ghost {
  min-height: 32px;
  padding: 0 9px;
  font-size: 12px;
  border-color: var(--border-subtle);
}

/* ── 主内容视口 ── */
.main-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.scroll-pane,
.chat-scroll,
.sheet-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.25) transparent;
}

.scroll-pane::-webkit-scrollbar,
.chat-scroll::-webkit-scrollbar,
.sheet-body::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.scroll-pane::-webkit-scrollbar-thumb,
.chat-scroll::-webkit-scrollbar-thumb,
.sheet-body::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-rgb), 0.26);
  border-radius: 999px;
}

.seg-bar,
.quota-strip,
.session-toolbar {
  scrollbar-width: none;
}

.seg-bar::-webkit-scrollbar,
.quota-strip::-webkit-scrollbar,
.session-toolbar::-webkit-scrollbar {
  display: none;
}

.scroll-pane {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px 20px;
}

/* ── 额度胶囊条 ── */
.quota-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 9px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow-x: auto;
}

.quota-win-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  min-width: 34px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid rgba(var(--accent-rgb), 0.34);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: all 0.14s ease;
}

.quota-win-btn.is-7d {
  background: rgba(96, 165, 250, 0.16);
  border-color: rgba(96, 165, 250, 0.42);
  color: #9dc8ff;
}

.quota-win-btn:active {
  transform: scale(0.95);
}

.quota-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--bg-sunken);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}

.quota-pct.ok {
  color: var(--ok);
}
.quota-pct.warn {
  color: var(--warn);
}
.quota-pct.crit {
  color: var(--danger);
}

/* ── 分段过滤胶囊 ── */
.fleet-nav-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
}

.fleet-nav-row .seg-bar {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.fleet-nav-row .seg-pill {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12px;
}

.btn-fleet-add {
  width: 34px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 9px;
  flex-shrink: 0;
}

.seg-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  overflow-x: auto;
}

.seg-pill {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.seg-pill.active {
  background: var(--accent-soft);
  border-color: rgba(var(--accent-rgb), 0.55);
  color: var(--accent-ink);
  font-weight: 600;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 12px 2px 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── 舰队会话卡片 ── */
.startup-progress-banner {
  margin-bottom: 10px;
  padding: 9px 11px;
  border-radius: var(--radius);
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.26);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.startup-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.startup-progress-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.startup-progress-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.startup-progress-track {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.startup-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-ink));
  transition: width 0.28s ease;
}

.session-card {
  position: relative;
  padding: 12px 13px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 9px;
  cursor: pointer;
  overflow: hidden;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.session-card:active {
  background: rgba(var(--accent-rgb), 0.15);
  border-color: rgba(var(--accent-rgb), 0.55);
}

.session-card.selected {
  background: var(--bg-card-active);
  border-color: rgba(var(--accent-rgb), 0.55);
}

.session-card.st-running::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, transparent, var(--accent), transparent);
  animation: scanPulse 1.8s infinite linear;
}

.session-card.st-waiting {
  border-color: rgba(var(--warn-rgb), 0.65);
  box-shadow: 0 0 14px rgba(var(--warn-rgb), 0.14);
}

.fleet-group {
  margin-bottom: 10px;
}

.fleet-group-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  margin: 4px 0 8px;
  border-radius: 9px;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  background: rgba(var(--accent-rgb), 0.06);
  color: var(--text-strong);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.fleet-group-header:active {
  background: rgba(var(--accent-rgb), 0.13);
}

.fleet-group-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.fleet-group-chev {
  display: inline-flex;
  align-items: center;
  color: var(--accent-ink);
  transition: transform 0.16s ease;
}

.fleet-group-header.collapsed .fleet-group-chev {
  transform: rotate(-90deg);
}

.fleet-group-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.fleet-group-run {
  color: var(--accent);
  font-weight: 600;
}

.session-card.dragging {
  opacity: 0.55;
  transform: scale(0.985);
  border-color: rgba(var(--accent-rgb), 0.85);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.session-card.drop-before::before,
.session-card.drop-after::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.8);
  z-index: 4;
  pointer-events: none;
}

.session-card.drop-before::before {
  top: 0;
}

.session-card.drop-after::after {
  bottom: 0;
}

.sc-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-left: -4px;
  margin-right: 2px;
  border-radius: 6px;
  color: var(--text-muted);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  flex-shrink: 0;
}

.sc-drag-handle:active {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.14);
  cursor: grabbing;
}

@keyframes scanPulse {
  0% { opacity: 0.35; }
  50% { opacity: 1; }
  100% { opacity: 0.35; }
}

.sc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.sc-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.sc-title span.txt {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.status-badge.running {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-color: rgba(var(--accent-rgb), 0.45);
}

.status-badge.waiting {
  color: var(--warn);
  background: rgba(var(--warn-rgb), 0.14);
  border-color: rgba(var(--warn-rgb), 0.48);
}

.status-badge.idle {
  color: var(--ok);
  background: rgba(var(--ok-rgb), 0.11);
  border-color: rgba(var(--ok-rgb), 0.32);
}

.status-badge.external {
  color: var(--cool);
  background: rgba(var(--cool-rgb), 0.12);
  border-color: rgba(var(--cool-rgb), 0.35);
}

.status-badge.error {
  color: var(--danger);
  background: rgba(var(--danger-rgb), 0.13);
  border-color: rgba(var(--danger-rgb), 0.4);
}

.sc-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.sc-tool {
  margin-top: 7px;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--bg-sunken);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── 对话操控台 ── */
.session-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(12, 12, 17, 0.65);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  flex-shrink: 0;
}

.tool-chip {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 11.5px;
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  cursor: pointer;
}

.tool-chip.ctx-warn {
  border-color: rgba(var(--warn-rgb), 0.55);
  color: var(--warn);
}

.tool-chip.ctx-crit {
  border-color: rgba(var(--danger-rgb), 0.6);
  color: var(--danger);
}

.ctx-inline {
  font-family: var(--font-mono);
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ctx-inline.warn {
  color: var(--warn);
  font-weight: 600;
}

.ctx-inline.crit {
  color: var(--danger);
  font-weight: 600;
}

.issue-heal-banner {
  margin: 8px 12px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(var(--danger-rgb), 0.12);
  border: 1px solid rgba(var(--danger-rgb), 0.45);
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex-shrink: 0;
}

.issue-heal-banner.warn {
  background: rgba(var(--warn-rgb), 0.12);
  border-color: rgba(var(--warn-rgb), 0.45);
}

.session-card.st-stalling {
  border-color: rgba(var(--danger-rgb), 0.55);
  box-shadow: inset 0 0 0 1px rgba(var(--danger-rgb), 0.18);
}

.tab-badge.danger {
  background: var(--danger);
  color: #fff;
}

.mob-subagent-tree {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px dashed var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mob-sa-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.mob-sa-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}
.mob-sa-dot.running {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}
.mob-sa-dot.failed {
  background: var(--danger);
}

.mob-subagent-bar {
  margin: 0 10px 6px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}

.dialog-banner {
  margin: 10px 12px 0;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(var(--warn-rgb), 0.12);
  border: 1px solid rgba(var(--warn-rgb), 0.55);
  flex-shrink: 0;
}

.dialog-banner h4 {
  color: var(--warn);
  font-size: 13.5px;
  margin-bottom: 5px;
}

.dialog-banner p {
  font-size: 12.5px;
  color: var(--text-main);
  margin-bottom: 10px;
  word-break: break-word;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── 会话「探讨模式」横幅与气泡标签 ── */
.tool-chip.discuss-on {
  background: rgba(96, 165, 250, 0.18);
  border-color: rgba(96, 165, 250, 0.5);
  color: #9dc8ff;
  font-weight: 600;
}

.tool-chip.tool-chip-compact {
  min-height: 27px;
  padding: 0 8px;
  font-size: 11px;
  gap: 4px;
}

.discuss-banner {
  flex-shrink: 0;
  padding: 7px 12px;
  background: linear-gradient(180deg, rgba(16, 26, 44, 0.96), rgba(10, 14, 24, 0.96));
  border-bottom: 1px solid rgba(96, 165, 250, 0.28);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.discuss-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.discuss-banner-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #9dc8ff;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discuss-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #60a5fa;
  flex-shrink: 0;
}

.discuss-dot.speaking {
  background: #de3b49;
  box-shadow: 0 0 0 4px rgba(222, 59, 73, 0.25);
  animation: voicePulseGlow 1.1s infinite;
}

.discuss-dot.tts {
  background: #d9b77e;
  box-shadow: 0 0 0 3px rgba(217, 183, 126, 0.24);
}

.discuss-status-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.3);
  color: #b7d8ff;
  flex-shrink: 0;
  white-space: nowrap;
}

.discuss-status-pill.hot {
  background: rgba(222, 59, 73, 0.2);
  border-color: rgba(255, 138, 147, 0.5);
  color: #ffc2c8;
}

.discuss-banner-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.discuss-act-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 25px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.discuss-act-btn.on {
  background: rgba(96, 165, 250, 0.18);
  border-color: rgba(96, 165, 250, 0.45);
  color: #a8d0ff;
}

.discuss-act-btn.plan {
  background: rgba(var(--accent-rgb), 0.14);
  border-color: rgba(var(--accent-rgb), 0.36);
  color: var(--accent-ink);
}

.discuss-act-btn.exec {
  background: rgba(52, 211, 153, 0.16);
  border-color: rgba(52, 211, 153, 0.42);
  color: #86efac;
  font-weight: 600;
}

.discuss-select {
  height: 25px;
  padding: 0 5px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 11px;
  font-family: var(--font-mono);
  outline: none;
  flex-shrink: 0;
}

.discuss-msg-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  margin-bottom: 5px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 600;
}

.discuss-msg-tag.discuss {
  background: rgba(96, 165, 250, 0.16);
  border: 1px solid rgba(96, 165, 250, 0.34);
  color: #9dc8ff;
}

.discuss-msg-tag.plan {
  background: rgba(var(--accent-rgb), 0.2);
  border: 1px solid rgba(var(--accent-rgb), 0.42);
  color: #f6d89e;
}

.discuss-msg-tag.execute {
  background: rgba(52, 211, 153, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #86efac;
}

.chat-scroll {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 12px 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

#chat-messages-slot,
#chat-streaming-slot {
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.msg-user {
  align-self: flex-end;
  max-width: 88%;
  min-width: 0;
  padding: 10px 13px;
  border-radius: 14px 14px 3px 14px;
  background: linear-gradient(160deg, rgba(var(--accent-rgb), 0.24), rgba(var(--accent-rgb), 0.12));
  border: 1px solid rgba(var(--accent-rgb), 0.38);
  color: var(--text-strong);
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.msg-assistant {
  align-self: stretch;
  min-width: 0;
  max-width: 100%;
  padding: 12px 13px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 14px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.msg-assistant.streaming {
  border-color: rgba(var(--accent-rgb), 0.48);
}

.msg-footer {
  margin-top: 9px;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.msg-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.btn-msg-act {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-msg-act:active {
  transform: scale(0.96);
}

.btn-read-aloud.is-loading {
  border-color: rgba(var(--accent-rgb), 0.48);
  color: var(--accent-ink);
  background: rgba(var(--accent-rgb), 0.1);
}

.btn-read-aloud.is-playing {
  border-color: rgba(222, 59, 73, 0.65);
  color: #ff9da5;
  background: rgba(222, 59, 73, 0.16);
}

/* ── 聊天流内：桌面文件同步卡片 ── */
.synced-artifact-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.12), rgba(20, 24, 34, 0.94));
  border: 1px solid rgba(var(--accent-rgb), 0.36);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.16s ease, background 0.16s ease;
}

.synced-artifact-card:active {
  transform: scale(0.985);
  border-color: rgba(var(--accent-rgb), 0.72);
}

.sac-thumb {
  width: 52px;
  height: 52px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-sunken);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
}

.sac-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(var(--accent-rgb), 0.14);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  color: var(--accent-ink);
}

.sac-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sac-top {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.sac-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent-ink);
}

.sac-meta-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.sac-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sac-note {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.38;
}

.sac-path {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.steps-fold {
  border-radius: 8px;
  background: var(--bg-sunken);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}

.steps-fold summary {
  padding: 7px 11px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.steps-fold summary::-webkit-details-marker {
  display: none;
}

.steps-list {
  padding: 6px 11px 9px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
}

.step-row {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Markdown 排版控制 */
.md-body {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.md-body a,
.md-body p,
.md-body li,
.md-body blockquote {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.md-body p {
  margin-bottom: 8px;
}
.md-body p:last-child {
  margin-bottom: 0;
}
.md-body h1,
.md-body h2,
.md-body h3,
.md-body h4 {
  color: var(--text-strong);
  margin: 10px 0 6px;
  font-size: 15px;
}
.md-body ul,
.md-body ol {
  padding-left: 19px;
  margin-bottom: 8px;
}
.md-body li {
  margin-bottom: 3px;
}
.md-body code {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.45);
  color: var(--accent-ink);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.md-body pre {
  margin: 8px 0;
  padding: 10px;
  border-radius: 8px;
  background: #07080d;
  border: 1px solid var(--border-subtle);
  max-width: 100%;
  overflow-x: auto;
}
.md-body pre code {
  padding: 0;
  background: transparent;
  color: var(--text-main);
  overflow-wrap: normal;
  word-break: normal;
}
.md-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 12.5px;
  display: block;
  overflow-x: auto;
}
.md-body th,
.md-body td {
  border: 1px solid var(--border);
  padding: 5px 8px;
  text-align: left;
}

.thinking-block {
  font-size: 12px;
  color: var(--text-muted);
  border-left: 2px solid rgba(var(--accent-rgb), 0.35);
  padding-left: 9px;
  margin-bottom: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
  max-width: 100%;
}

.stream-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.stream-head-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
}

.stream-char-badge {
  font-size: 10.5px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 6px;
  white-space: nowrap;
}

.stream-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-think-toggle {
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent-ink);
  font-size: 11px;
  line-height: 1.2;
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
  cursor: pointer;
}

.btn-think-toggle.is-active {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.22);
  color: var(--accent);
}

.live-plan-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 9px;
  margin-bottom: 7px;
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.07);
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  font-size: 11.5px;
  color: var(--text-strong);
  min-width: 0;
}

.live-plan-main {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.live-plan-step {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

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

.live-thinking-box {
  font-size: 12px;
  line-height: 1.48;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.025);
  border-left: 2px solid rgba(var(--accent-rgb), 0.45);
  border-radius: 0 7px 7px 0;
  padding: 6px 9px;
  margin-bottom: 8px;
  max-height: 112px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
  max-width: 100%;
}

.live-thinking-box.is-expanded {
  max-height: 360px;
}

.live-thinking-preview {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text-muted);
  border-left: 2px solid rgba(var(--accent-rgb), 0.35);
  padding: 2px 0 2px 8px;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

/* ── 底部单行紧凑输入坞 ── */
.composer-dock {
  position: relative;
  padding: 7px 10px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  flex-shrink: 0;
}

.voice-hint-pill {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translate(-50%, 4px);
  opacity: 0;
  pointer-events: none;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(16, 19, 28, 0.92);
  border: 1px solid rgba(var(--accent-rgb), 0.42);
  color: var(--text-strong);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  max-width: min(88vw, 380px);
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 45;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.voice-hint-pill.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.composer-row {
  width: 100%;
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.icon-sq-btn,
.voice-mic-btn {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.08s ease;
}

.icon-sq-btn:active,
.voice-mic-btn:active {
  transform: scale(0.95);
}

.voice-mic-btn {
  border: 1px solid rgba(var(--accent-rgb), 0.34);
  background: rgba(var(--accent-rgb), 0.09);
  color: var(--accent-ink);
  touch-action: none;
}

@keyframes voicePulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(235, 68, 84, 0.45);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(235, 68, 84, 0.08);
  }
}

@keyframes waveBounce {
  0%, 100% {
    transform: scaleY(0.45);
  }
  50% {
    transform: scaleY(1);
  }
}

@keyframes spinLoop {
  to {
    transform: rotate(360deg);
  }
}

.voice-mic-btn.recording {
  background: #de3b49 !important;
  border-color: #ff8a93 !important;
  color: #ffffff !important;
  animation: voicePulseGlow 1.2s infinite;
}

.voice-mic-btn.requesting {
  background: rgba(222, 59, 73, 0.35);
  border-color: #ff8a93;
  color: #ffffff;
}

.voice-mic-btn.recording .vw-b1 {
  transform-origin: center;
  animation: waveBounce 0.75s ease-in-out infinite;
}
.voice-mic-btn.recording .vw-b2 {
  transform-origin: center;
  animation: waveBounce 0.75s ease-in-out 0.18s infinite;
}
.voice-mic-btn.recording .vw-b3 {
  transform-origin: center;
  animation: waveBounce 0.75s ease-in-out 0.36s infinite;
}

.voice-mic-btn.cancelling {
  background: rgba(var(--danger-rgb), 0.32);
  border-color: var(--danger);
  color: #fff;
}

.voice-mic-btn.transcribing {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--accent);
}

.spin-svg {
  animation: spinLoop 0.85s linear infinite;
}

.svg-ico {
  display: inline-block;
  vertical-align: -2px;
  flex-shrink: 0;
}

.composer-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.composer-input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  max-height: 112px;
  padding: 8px 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-sunken);
  color: var(--text-strong);
  /* 必须 >=16px 防止 iOS Safari 聚焦时强制放大视口 */
  font-size: 16px;
  font-family: var(--font-ui);
  line-height: 1.4;
  resize: none;
  outline: none;
  scrollbar-width: none;
}

.composer-input::-webkit-scrollbar {
  display: none;
}

.composer-input:focus {
  border-color: rgba(var(--accent-rgb), 0.6);
}

.composer-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.jump-bottom {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 62px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(22, 22, 31, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(var(--accent-rgb), 0.52);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  z-index: 15;
  cursor: pointer;
}

/* ── 产物网格与预览 ── */
.artifact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.art-card {
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.art-thumb {
  height: 118px;
  background: #08090f;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.art-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.art-kind-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(5, 6, 10, 0.78);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-ink);
}

.art-info {
  padding: 8px 9px;
}

.art-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.art-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── 底部四栏主导航（舰队 · 操控 · 执行官 · 产物，贴底全屏自适应） ── */
.tabbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding-top: 5px;
  padding-bottom: max(10px, calc(var(--safe-bottom) - 12px));
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 20;
}

.tab-item {
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 40px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
}

.tab-item .ico {
  font-size: 17px;
  line-height: 1.1;
}

.tab-item.active {
  color: var(--accent);
  font-weight: 600;
}

.tab-badge {
  position: absolute;
  top: 2px;
  margin-left: 26px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── 模态抽屉（选模型、会话管理、新建会话、产物详情） ── */
.sheet-mask {
  position: fixed;
  top: var(--app-top, 0px);
  left: 0;
  right: 0;
  height: var(--app-h, 100dvh);
  padding-top: calc(var(--safe-top, 0px) + 52px);
  background: rgba(3, 4, 7, 0.74);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 60;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: height 0.16s ease, top 0.16s ease;
}

.sheet-panel {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  max-height: 100%;
  background: var(--bg-elevated);
  border-top: 1px solid rgba(var(--accent-rgb), 0.24);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -14px 40px rgba(0, 0, 0, 0.65);
  padding-bottom: calc(12px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sheet-panel::before {
  content: "";
  width: 34px;
  height: 3.5px;
  border-radius: 999px;
  background: rgba(232, 208, 166, 0.22);
  margin: 7px auto 1px;
  flex-shrink: 0;
}

html.kb-open .sheet-mask {
  padding-top: calc(var(--safe-top, 0px) + 18px);
}

html.kb-open .sheet-panel {
  padding-bottom: 10px;
}

.sheet-head {
  padding: 8px 14px 10px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.sheet-head h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sheet-head .btn {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.sheet-body {
  padding: 10px 14px 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}

.sheet-search {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-sunken);
  color: var(--text-strong);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  margin-bottom: 10px;
}

.sheet-search:focus {
  border-color: var(--accent);
}

.sheet-group-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 8px 2px 5px;
}

.sheet-group-label:first-child {
  margin-top: 0;
}

.sheet-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sheet-model-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.sheet-model-row:active {
  background: rgba(var(--accent-rgb), 0.1);
}

.sheet-model-row.active {
  background: var(--bg-card-active);
  border-color: rgba(var(--accent-rgb), 0.42);
}

.sheet-model-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sheet-model-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}

.sheet-model-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-model-pin {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.sheet-model-pin.pinned {
  color: var(--accent);
}

.sheet-model-pin:active {
  background: rgba(var(--accent-rgb), 0.14);
}

.sheet-action-group {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.sheet-action-row {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-main);
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  touch-action: manipulation;
  text-align: left;
}

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

.sheet-action-row:active {
  background: rgba(var(--accent-rgb), 0.1);
}

.sheet-action-row.danger {
  color: var(--danger);
}

.sheet-action-left {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.sheet-action-meta {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  flex-shrink: 0;
}

.sheet-action-meta.accent {
  color: var(--accent);
}

.media-player-box video,
.media-player-box img {
  width: 100%;
  max-height: 62dvh;
  border-radius: 10px;
  background: #000;
  display: block;
  margin: 0 auto;
}

/* ── 登录解锁屏 ── */
.auth-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 22px;
  text-align: center;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  padding: 26px 20px;
  border-radius: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.65);
}

.auth-card h2 {
  color: var(--text-strong);
  font-size: 18px;
  margin-bottom: 6px;
}

.auth-card p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 18px;
}

.field-input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 44px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-sunken);
  color: var(--text-strong);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  margin-bottom: 12px;
}

.field-input:focus {
  border-color: var(--accent);
}

textarea.field-input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: auto;
  min-height: 96px;
  max-height: min(50dvh, 420px);
  padding: 10px 13px;
  line-height: 1.55;
  font-family: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow-y: hidden;
  resize: none;
}

textarea.field-input.field-autogrow-single {
  min-height: 44px;
  max-height: 140px;
  padding: 10px 13px;
  line-height: 22px;
}

html.kb-open textarea.field-input {
  max-height: min(32dvh, 230px);
}

html.kb-open textarea.field-input.field-autogrow-single {
  max-height: 104px;
}

.butler-edit-sheet .sheet-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.butler-edit-field {
  width: 100%;
  min-width: 0;
}

.butler-edit-sheet .field-input {
  margin-bottom: 0;
}

.toast-pill {
  position: fixed;
  top: calc(58px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  color: var(--text-strong);
  font-size: 13px;
  z-index: 90;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  max-width: 88vw;
  text-align: center;
}

.task-alert-banner {
  position: fixed;
  top: calc(56px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 440px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(13, 21, 35, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(52, 211, 153, 0.52);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.62);
  color: var(--text-strong);
  z-index: 92;
  cursor: pointer;
}
.task-alert-banner.is-error {
  border-color: rgba(248, 113, 113, 0.58);
}
.task-alert-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #34d399;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.8);
  flex-shrink: 0;
}
.task-alert-banner.is-error .task-alert-dot {
  background: #f87171;
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.8);
}
.task-alert-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.task-alert-title {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-alert-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-alert-close {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.md-body .artifact-inline-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 1px 7px;
  margin: 0 1px;
  border-radius: 5px;
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  background: rgba(var(--accent-rgb), 0.11);
  color: var(--accent-ink);
  font: inherit;
  font-size: inherit;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  vertical-align: baseline;
}
.md-body .artifact-inline-link:active {
  background: rgba(var(--accent-rgb), 0.22);
  border-color: rgba(var(--accent-rgb), 0.62);
}
.md-body .artifact-inline-link .artifact-inline-icon {
  display: inline-flex;
  align-items: center;
  opacity: 0.85;
  flex-shrink: 0;
}
.md-body .artifact-inline-link .artifact-inline-code {
  background: transparent;
  padding: 0;
  color: inherit;
  word-break: break-all;
}
.md-body .artifact-inline-link .artifact-inline-text {
  text-decoration: underline;
  text-decoration-color: rgba(var(--accent-rgb), 0.45);
  text-underline-offset: 2px;
  word-break: break-all;
}

.seg-bar.turn-scope-bar {
  padding: 2px 10px 6px;
  gap: 5px;
  align-items: center;
}
.seg-bar.turn-scope-bar .seg-pill {
  min-height: 26px;
  padding: 0 9px;
  font-size: 11px;
}

.butler-batch-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  margin-top: 2px;
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  align-self: flex-start;
}

.art-gallery-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
}

.art-gallery-btn {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 600;
}

.art-gallery-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.art-gallery-counter {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-box {
  padding: 36px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.art-transfer-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.art-transfer-btn {
  min-height: 35px;
  padding: 0 11px;
  font-size: 12.5px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

#btn-copy-dl-link {
  flex: 1.15;
}

#btn-sys-share {
  flex: 1.15;
}

.art-link-box {
  padding: 8px 14px;
  background: rgba(217, 183, 126, 0.07);
  border-bottom: 1px solid rgba(217, 183, 126, 0.22);
  flex-shrink: 0;
}

.binary-art-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 34px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.sheet-panel.is-html-sheet {
  height: calc(var(--app-h, 100vh) - 44px) !important;
  max-height: calc(var(--app-h, 100vh) - 44px) !important;
}

.sheet-body-html {
  position: relative !important;
  flex: 1 1 auto !important;
  height: 100%;
  padding: 0 !important;
  overflow: hidden !important;
  background: #0c0e14;
}

.html-stage-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #0c0e14;
  overflow: hidden;
}

.html-stage-wrap.is-fullscreen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.html-stage-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #ffffff;
}

.html-immersive-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: var(--app-h, 100vh);
  z-index: 120;
  background: #05060a;
  overflow: hidden;
}

.html-exit-float-btn {
  position: fixed;
  top: calc(10px + var(--safe-top));
  right: 12px;
  z-index: 130;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(217, 183, 126, 0.55);
  background: rgba(11, 13, 20, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff8ec;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
}

/* ── Echo 执行官语音面板专属样式 ── */
.butler-phase-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  white-space: nowrap;
}

.butler-phase-pill.busy {
  color: #fff8ec;
  background: rgba(222, 59, 73, 0.28);
  border-color: rgba(255, 138, 147, 0.65);
  cursor: pointer;
}

.butler-phase-pill.armed {
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.5);
  font-weight: 600;
}

.butler-live-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.36);
  color: var(--accent-ink);
}
.butler-live-strip.is-armed {
  background: rgba(16, 185, 129, 0.13);
  border-color: rgba(52, 211, 153, 0.45);
  color: #a7f3d0;
}
.butler-live-strip.is-busy {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(251, 191, 36, 0.48);
  color: #fde68a;
}
.butler-live-strip-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.butler-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  flex-shrink: 0;
  animation: pulseDot 1.2s ease-in-out infinite;
}

.seg-pill.vad-on {
  background: #de3b49 !important;
  border-color: #ff8a93 !important;
  color: #ffffff !important;
  font-weight: 600;
  animation: voicePulseGlow 1.2s infinite;
}

.seg-pill.wake-on {
  background: rgba(16, 185, 129, 0.16) !important;
  border-color: rgba(52, 211, 153, 0.52) !important;
  color: #a7f3d0 !important;
  font-weight: 600;
}

.seg-pill.wake-off {
  color: var(--text-tertiary) !important;
  opacity: 0.78;
}

.butler-speaker-sel {
  height: 30px;
  padding: 0 7px;
  border-radius: 7px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 11.5px;
  outline: none;
}

.butler-welcome-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 26px 18px;
  margin-top: 8px;
  border-radius: 12px;
  background: rgba(217, 183, 126, 0.05);
  border: 1px solid rgba(217, 183, 126, 0.22);
}

.butler-action-card {
  padding: 10px 13px;
  border-radius: 10px;
  background: rgba(217, 183, 126, 0.08);
  border: 1px solid rgba(217, 183, 126, 0.32);
}

.butler-note-card {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

/* ── 执行官顶部菜单弹层 & 独立待办清单卡片 ── */
.butler-popover {
  position: relative;
}

.butler-dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  z-index: 60;
  min-width: 210px;
  max-width: min(326px, calc(100vw - 24px));
  padding: 8px;
  border-radius: 11px;
  background: rgba(15, 19, 28, 0.98);
  border: 1px solid rgba(var(--accent-rgb), 0.34);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.butler-dropdown-panel.left {
  left: 0;
}

.butler-dropdown-panel.right {
  right: 0;
}

.butler-dd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}

.butler-dd-item.active {
  background: rgba(var(--accent-rgb), 0.16);
  border-color: rgba(var(--accent-rgb), 0.38);
  color: var(--accent-ink);
  font-weight: 600;
}

.butler-dd-sec-title {
  font-size: 10.5px;
  color: var(--text-muted);
  padding: 2px 4px 0;
  letter-spacing: 0.03em;
}

.butler-dd-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.butler-dd-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 11.5px;
  cursor: pointer;
}

.butler-dd-pill.active {
  background: rgba(var(--accent-rgb), 0.18);
  border-color: rgba(var(--accent-rgb), 0.45);
  color: var(--accent-ink);
  font-weight: 600;
}

.butler-todo-card {
  padding: 11px 13px;
  border-radius: 12px;
  background: linear-gradient(155deg, rgba(24, 34, 52, 0.92), rgba(14, 18, 28, 0.96));
  border: 1px solid rgba(96, 165, 250, 0.34);
  border-left: 3px solid #60a5fa;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.butler-todo-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.butler-todo-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.butler-todo-idx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 6px;
  background: rgba(96, 165, 250, 0.16);
  color: #9dc8ff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.butler-todo-added-card {
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.34);
  border-left: 3px solid #60a5fa;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ── 执行官无框通透对话流 + 说话人小底色徽章 ── */
.msg-bubble {
  padding: 2px 2px 6px;
  border: none;
  background: transparent;
  color: var(--text-main);
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.msg-bubble.user,
.msg-bubble.assistant,
.msg-bubble.streaming {
  background: transparent;
  border: none;
}

.msg-bubble .msg-role {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.msg-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.msg-role-pill.user {
  background: rgba(var(--accent-rgb), 0.16);
  border: 1px solid rgba(var(--accent-rgb), 0.30);
  color: #f6d89e;
}

.msg-role-pill.echo {
  background: rgba(96, 165, 250, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.28);
  color: #9dc8ff;
}

.msg-bubble .md-body {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-main);
  padding-left: 2px;
}

/* ── 会议持续录制控制条与多人声纹识别流 ── */
.meeting-control-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 6px;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid var(--border);
}

.meeting-control-strip.is-recording {
  background: linear-gradient(90deg, rgba(222, 59, 73, 0.32), rgba(145, 28, 38, 0.25));
  border-bottom-color: rgba(255, 138, 147, 0.45);
}

.meeting-start-btn {
  min-height: 29px;
  padding: 0 11px;
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(222, 59, 73, 0.88);
  border: 1px solid rgba(255, 138, 147, 0.65);
  border-radius: 7px;
}

.meeting-stop-btn {
  min-height: 29px;
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  background: #de3b49;
  border: 1px solid #ff9ba3;
  border-radius: 7px;
}

.meeting-oled-btn {
  min-height: 29px;
  padding: 0 9px;
  font-size: 11.5px;
  color: #e8dcc8;
  background: rgba(12, 14, 20, 0.72);
  border: 1px solid rgba(217, 183, 126, 0.45);
  border-radius: 7px;
}

.meeting-live-dot {
  display: inline-flex;
  color: #ff4d5b;
  animation: voicePulseGlow 1.1s infinite;
}

.meeting-guard-card {
  padding: 11px 13px;
  border-radius: 10px;
  background: rgba(222, 59, 73, 0.09);
  border: 1px solid rgba(222, 59, 73, 0.35);
}

.meeting-guard-card.is-interrupted {
  background: rgba(222, 59, 73, 0.22);
  border-color: #ff6b78;
}

.meeting-seg-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meeting-seg-item {
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.meeting-seg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.meeting-seg-time {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
}

.meeting-seg-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
  white-space: pre-wrap;
}

.spk-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
}

.spk-boss {
  color: #f7d99c;
  background: rgba(217, 183, 126, 0.18);
  border: 1px solid rgba(217, 183, 126, 0.48);
}

.spk-a {
  color: #8fd4ff;
  background: rgba(56, 152, 236, 0.16);
  border: 1px solid rgba(56, 152, 236, 0.42);
}

.spk-b {
  color: #a8f0c6;
  background: rgba(46, 184, 114, 0.16);
  border: 1px solid rgba(46, 184, 114, 0.42);
}

.spk-c {
  color: #d8b4fe;
  background: rgba(168, 85, 247, 0.16);
  border: 1px solid rgba(168, 85, 247, 0.42);
}

.spk-other {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

/* ── OLED 全黑暗屏省电防误触遮罩 (伪锁屏防断流) ── */
.meeting-oled-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #000000;
  color: rgba(255, 255, 255, 0.42);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 22px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.oled-saver-inner {
  width: 100%;
  max-width: 350px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.oled-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(222, 59, 73, 0.35);
  background: rgba(222, 59, 73, 0.07);
  color: rgba(255, 190, 195, 0.72);
  font-size: 13px;
}

.oled-status-badge.warn {
  border-color: rgba(255, 100, 110, 0.75);
  color: #ff949c;
}

.oled-rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #de3b49;
  opacity: 0.75;
}

.oled-sub-hint {
  font-size: 11.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.32);
}

.oled-live-captions {
  width: 100%;
  min-height: 76px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.015);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.oled-caption-empty {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.26);
  text-align: center;
  padding: 12px 0;
}

.oled-caption-line {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.46);
}

.oled-spk {
  color: rgba(217, 183, 126, 0.68);
  font-weight: 600;
  margin-right: 4px;
}

.oled-unlock-foot {
  margin-top: 20px;
  font-size: 11.5px;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.25);
}

/* ── 会话插话纠偏 (Steer) 与排队等待 (FollowUp) 虚线气泡 ── */
.queued-stream-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(217, 183, 126, 0.06);
  border: 1px dashed rgba(217, 183, 126, 0.42);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.queued-bubble {
  padding: 8px 11px;
  border-radius: 8px;
  background: rgba(14, 17, 26, 0.78);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.queued-bubble-text {
  font-size: 12.5px;
  color: var(--text-strong);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
  max-width: 100%;
}

.queued-bubble.mode-steer {
  border-color: rgba(255, 210, 128, 0.55);
  background: rgba(255, 185, 64, 0.09);
}

.queued-bubble.mode-followUp {
  border-color: rgba(217, 183, 126, 0.45);
}

/* ── 小七画板 · 分镜状态监视器 (390px 单列流) ── */
.canvas-controls-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 11px;
  border-radius: 11px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

.canvas-select-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.canvas-select {
  flex: 1;
  min-width: 0;
  height: 33px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-sunken);
  color: var(--text-strong);
  font-size: 12px;
  outline: none;
}

.canvas-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.canvas-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #a7f3d0;
}

.canvas-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px #34d399;
  animation: wakePulse 1.4s ease-in-out infinite;
}

.canvas-shot-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 8px;
  scrollbar-width: none;
}

.canvas-shot-nav::-webkit-scrollbar {
  display: none;
}

.canvas-shot-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
}

.canvas-shot-chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6b7280;
}

.canvas-shot-chip.st-ready .dot {
  background: #34d399;
}

.canvas-shot-chip.st-running .dot {
  background: #f59e0b;
  animation: wakePulse 1s ease-in-out infinite;
}

.canvas-shot-chip.st-error .dot {
  background: #f43f5e;
}

.canvas-shot-chip.is-updated {
  border-color: rgba(245, 158, 11, 0.72);
  color: #fde68a;
}

.canvas-shot-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 16px;
}

.canvas-shot-card {
  padding: 11px 12px;
  border-radius: 11px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.canvas-shot-card.is-updated {
  border-color: rgba(245, 158, 11, 0.85);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.2);
}

.canvas-shot-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.canvas-shot-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-strong);
  line-height: 1.35;
  word-break: break-word;
}

.canvas-status-tag {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.canvas-status-tag.st-ready {
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(52, 211, 153, 0.4);
}

.canvas-status-tag.st-running {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(251, 191, 36, 0.45);
}

.canvas-status-tag.st-error {
  color: #fecdd3;
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(251, 113, 133, 0.48);
}

.canvas-progress-track {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.canvas-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d9b77e, #34d399);
  transition: width 0.3s ease;
}

.canvas-thumb-section-label {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

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

.canvas-thumb-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-sunken);
  cursor: pointer;
  padding: 0;
}

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

.canvas-thumb-badge {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 9.5px;
  background: rgba(5, 6, 10, 0.78);
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.canvas-prompt-box {
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 11.5px;
  line-height: 1.48;
  color: var(--text-secondary);
}

.canvas-prompt-text.clamped {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.canvas-err-box {
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(251, 113, 133, 0.35);
  color: #fecdd3;
  font-size: 11.5px;
  line-height: 1.45;
  word-break: break-word;
}

.agy-plugin-card {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 115, 0.35);
  background: rgba(212, 175, 115, 0.08);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.agy-plugin-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.agy-plugin-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(212, 175, 115, 0.18);
  color: #f3d9a8;
}
.agy-plugin-name {
  font-size: 13px;
  color: var(--text-primary);
}
.agy-plugin-id {
  font-size: 11px;
  color: var(--text-secondary);
}
.agy-plugin-hint {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-muted);
}

/* ── 上下文置顶压缩预警、减负换代提醒与前代存档查看 ── */
.btn-xs {
  min-height: 26px !important;
  padding: 2px 9px !important;
  font-size: 11.5px !important;
  border-radius: 7px !important;
  white-space: nowrap;
}

.ctx-sticky-warn-bar,
.rollover-advice-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  font-size: 11.5px;
  line-height: 1.35;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.ctx-sticky-warn-bar.is-warn {
  background: rgba(217, 183, 126, 0.12);
  border-bottom-color: rgba(217, 183, 126, 0.28);
}

.ctx-sticky-warn-bar.is-danger {
  background: rgba(222, 59, 73, 0.16);
  border-bottom-color: rgba(255, 138, 147, 0.35);
}

.rollover-advice-bar {
  background: rgba(96, 165, 250, 0.1);
  border-bottom-color: rgba(96, 165, 250, 0.24);
}

.csw-main,
.rab-main {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.csw-badge,
.rab-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
}

.ctx-sticky-warn-bar.is-warn .csw-badge {
  background: rgba(217, 183, 126, 0.22);
  color: #f3d9a8;
}

.ctx-sticky-warn-bar.is-danger .csw-badge {
  background: rgba(222, 59, 73, 0.26);
  color: #fecdd3;
}

.rab-badge {
  background: rgba(96, 165, 250, 0.2);
  color: #bfdbfe;
}

.csw-text,
.rab-text {
  color: var(--text-primary);
}

.csw-actions,
.rab-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.rollover-divider-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px dashed rgba(217, 183, 126, 0.36);
  background: rgba(217, 183, 126, 0.06);
}

.rdc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.rdc-badge {
  font-size: 11px;
  font-weight: 600;
  color: #f3d9a8;
}

.rdc-size {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.rdc-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.rdc-btn {
  align-self: flex-start;
  border: 1px solid rgba(217, 183, 126, 0.3) !important;
}

.mav-load-all-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 11.5px;
  color: var(--text-secondary);
}

.mav-msg {
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.mav-msg.is-user {
  border-color: rgba(217, 183, 126, 0.25);
  background: rgba(217, 183, 126, 0.07);
}

.mav-msg-head {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-ink);
  margin-bottom: 4px;
}

.mav-msg-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}



