/* Astra · Chat 门户 原型样式（设计令牌取自 repo assets/bridge.css + review-refinements.css） */
:root {
  /* —— 底色 / 面板（仓库原值） —— */
  --bg-deep: #03060e;
  --bg-panel: rgba(8, 13, 25, 0.78);
  --bg-panel-solid: #0a1020;
  --bg-card: rgba(15, 23, 42, 0.62);
  --bg-card-hover: rgba(25, 37, 66, 0.78);
  --bg-topbar: rgba(7, 12, 23, 0.88);
  --bg-popover: #101929;
  --border-subtle: rgba(142, 176, 226, 0.16);
  --border-strong: rgba(168, 204, 250, 0.36);
  /* —— 文字（muted 用 refinements 覆盖值 #93a9c4，保证 ≥4.5:1） —— */
  --text-primary: #eef4ff;
  --text-secondary: #9bb1d1;
  --text-muted: #93a9c4;
  --text-on-gold: #ffe8ba;
  /* —— 强调 —— */
  --accent-gold: #f3be5e;
  --accent-gold-rgb: 243, 190, 94;
  --accent-cyan: #56d7eb;
  --accent-cyan-rgb: 86, 215, 235;
  --deco-purple: #8b7cf6; /* 新增：仅行星装饰，不用于信息 */
  /* —— 状态（仓库原值） —— */
  --status-running: #38d39f;
  --status-idle: #8da2c0;
  --status-blocked: #f26d6d;
  --status-done: #6ea8fe;
  --status-review: #38bdf8;
  --status-ready: #f5b942;
  /* —— 审批语义（新增，复用已有色相） —— */
  --approval-pending: #f7c877;   /* = --wait-rgb 247,200,119 */
  --approval-pending-rgb: 247, 200, 119;
  --approval-allowed: var(--status-running);
  --approval-denied: var(--status-blocked);
  --approval-expired: var(--status-idle);
  --countdown-urgent: #ff8a7a;
  --focus-ring: #9ec9ff;
  /* —— 字体 —— */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, "Noto Sans Mono CJK SC", monospace;
  --fs-11: 11px; --fs-12: 12px; --fs-13: 13px; --fs-14: 14px; --fs-16: 16px; --fs-20: 20px; --fs-24: 24px;
  /* —— 间距 4 基数 —— */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;
  /* —— 圆角（仓库原值 + 胶囊） —— */
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px; --radius-pill: 999px; --radius-bubble: 11px;
  /* —— 阴影 —— */
  --shadow-panel: 0 18px 48px rgba(0, 0, 0, 0.65);
  --shadow-popover: 0 10px 24px rgba(0, 0, 0, 0.53);
  /* —— 动效 —— */
  --dur-fast: 140ms; --dur-base: 200ms; --dur-slow: 280ms; --ease: ease;
  /* —— 尺寸 —— */
  --bar-height: 54px;
  --sidebar-w: 280px;
  --chat-max: 820px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-14);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ============ 星空背景 ============ */
#starfield { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.planet-deco {
  position: fixed; z-index: 0; pointer-events: none; border-radius: 50%;
  background:
    repeating-linear-gradient(-18deg, rgba(139,124,246,0.0) 0 14px, rgba(139,124,246,0.42) 14px 22px, rgba(98,84,200,0.25) 22px 34px),
    radial-gradient(circle at 35% 30%, #6d5fd6 0%, #3a2f86 55%, #160f3c 100%);
  box-shadow: inset -30px -24px 60px rgba(0,0,0,0.7), 0 0 80px rgba(139,124,246,0.18);
  opacity: 0.55;
}
.planet-deco.p1 { width: 340px; height: 340px; right: -110px; top: 120px; }
.planet-deco.p2 { width: 120px; height: 120px; left: 6%; bottom: 9%; opacity: 0.35; }
body[data-view="chat"] .planet-deco { opacity: 0.16; }

/* ============ 顶栏 ============ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--bar-height); z-index: 40;
  display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-4);
  background: var(--bg-topbar);
  backdrop-filter: blur(18px) saturate(130%); -webkit-backdrop-filter: blur(18px) saturate(130%);
  border-bottom: 1px solid rgba(152, 186, 236, 0.2);
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; }
.brand-title { font-weight: 700; font-size: 15px; letter-spacing: .02em; white-space: nowrap; }
.view-switch {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; gap: 4px; padding: 3px; border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.6); border: 1px solid var(--border-subtle);
}
.view-tab {
  appearance: none; border: 1px solid transparent; background: transparent; color: var(--text-secondary);
  font-size: var(--fs-13); font-weight: 600; padding: 5px 14px; min-height: 32px; border-radius: var(--radius-pill);
  cursor: pointer; white-space: nowrap; transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
  display: inline-flex; align-items: center; gap: 6px;
}
.view-tab:hover { color: var(--text-primary); }
.view-tab[aria-selected="true"] { background: rgba(var(--accent-gold-rgb), .18); border-color: rgba(var(--accent-gold-rgb), .56); color: var(--text-on-gold); }
.view-tab .tab-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--approval-pending); }
.topbar-actions { display: flex; align-items: center; gap: var(--sp-2); }
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle); background: rgba(15, 23, 42, 0.62); color: var(--text-secondary);
  font-size: var(--fs-13); font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}
.btn:hover { background: var(--bg-card-hover); color: var(--text-primary); border-color: var(--border-strong); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, rgba(243,190,94,.24), rgba(214,146,52,.32));
  border-color: rgba(243,190,94,.54); color: var(--text-on-gold); font-weight: 600;
}
.btn-primary:hover { background: linear-gradient(135deg, rgba(243,190,94,.35), rgba(214,146,52,.44)); border-color: rgba(247,206,122,.8); color: #fff3d6; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { min-height: 28px; padding: 0 10px; font-size: var(--fs-12); }

/* —— 全局待审批角标 —— */
.pending-badge {
  display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px 0 10px;
  border-radius: var(--radius-pill); cursor: pointer; font-size: var(--fs-13); font-weight: 600;
  color: #fff0cf; background: rgba(var(--approval-pending-rgb), .16); border: 1px solid rgba(var(--approval-pending-rgb), .62);
}
.pending-badge:hover { background: rgba(var(--approval-pending-rgb), .26); }
.pending-badge .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--approval-pending); box-shadow: 0 0 0 0 rgba(var(--approval-pending-rgb), .7); animation: pulse 1.8s ease-out infinite; }
.pending-badge .secs { font-family: var(--font-mono); font-size: var(--fs-12); font-weight: 500; color: var(--approval-pending); }
.pending-badge.is-urgent .secs { color: var(--countdown-urgent); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(var(--approval-pending-rgb), .7);} 70% { box-shadow: 0 0 0 7px rgba(var(--approval-pending-rgb), 0);} 100% { box-shadow: 0 0 0 0 rgba(var(--approval-pending-rgb), 0);} }
.popover {
  position: fixed; top: calc(var(--bar-height) + 6px); z-index: 60; width: 420px; max-width: calc(100vw - 24px);
  background: var(--bg-popover); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-popover); padding: var(--sp-3);
}
.popover h2 { margin: 2px 4px 10px; font-size: var(--fs-13); color: var(--text-secondary); font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.popover .pop-empty { padding: 16px 6px; color: var(--text-muted); font-size: var(--fs-13); }
.pop-item { border: 1px solid rgba(var(--approval-pending-rgb), .35); border-radius: var(--radius-md); padding: 10px 12px; background: rgba(var(--approval-pending-rgb), .05); }
.pop-item + .pop-item { margin-top: 8px; }
.pop-item .appr-line { flex-wrap: wrap; }
.pop-item .appr-text { flex-basis: calc(100% - 32px); white-space: normal; }
.pop-item .appr-actions { margin-left: auto; }
.pop-item.is-urgent .cd-fill { background: var(--countdown-urgent); }
.pop-item.is-urgent .cd-text { color: var(--countdown-urgent); }

/* ===================== v2 追加令牌 ===================== */
:root {
  --left-w: 280px;          /* 左栏 */
  --panel-w: 360px;         /* 右栏「当前事项」 */
  --banner-h: 0px;          /* 审批告警横幅高度（JS 设置 44px / 0） */
  --banner-bg: #3a2708;     /* 深琥珀 */
  --banner-border: rgba(247, 200, 119, .55);
  --lane-done: var(--status-done); --lane-running: var(--status-running); --lane-blocked: var(--status-blocked);
  --lane-review: var(--status-review); --lane-ready: var(--status-ready); --lane-todo: var(--status-idle);
  --edge-ready: rgb(245, 186, 66);     /* = EDGE_COLOR_READY (0.96,0.73,0.26) */
  --edge-review: rgb(56, 189, 247);    /* = EDGE_COLOR_REVIEW */
  --edge-blocked: rgb(242, 110, 110);  /* = EDGE_COLOR_BLOCKED */
  --grad-countdown: linear-gradient(90deg, #56d7eb 0%, #f3be5e 100%);
}
.ver-tag { font-size: 11px; font-weight: 700; color: #1a1205; background: var(--accent-gold); border-radius: 4px; padding: 0 5px; line-height: 16px; }
.tab-cd { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: #1a1205; background: var(--approval-pending); border-radius: 999px; padding: 0 6px; line-height: 17px; }
.tab-cd.is-urgent { background: var(--countdown-urgent); }
.mono { font-family: var(--font-mono); }

/* ===================== 审批告警横幅 ===================== */
.alert-banner {
  position: fixed; left: 0; right: 0; top: var(--bar-height); height: 44px; z-index: 39;
  display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: linear-gradient(90deg, #3d2908, #2c1f08 60%, #3d2908); border-bottom: 1px solid var(--banner-border);
  color: #ffe9c2; font-size: var(--fs-13); box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.alert-banner .blink { width: 9px; height: 9px; border-radius: 50%; background: var(--approval-pending); flex: none; animation: blink 1.1s steps(2, start) infinite; box-shadow: 0 0 8px rgba(247,200,119,.9); }
@keyframes blink { to { opacity: .25; } }
.alert-banner .ab-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.alert-banner .ab-text b { color: #fff3d6; }
.path-pill { font-family: var(--font-mono); font-size: var(--fs-12); color: #fff3d6; background: rgba(0,0,0,.35); border: 1px solid rgba(247,200,119,.4); border-radius: 999px; padding: 1px 10px; white-space: nowrap; flex: none; max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.cd-pill { font-family: var(--font-mono); font-size: var(--fs-12); font-weight: 700; color: #1a1205; background: var(--approval-pending); border-radius: 999px; padding: 1px 10px; white-space: nowrap; flex: none; }
.cd-pill.is-urgent { background: var(--countdown-urgent); }
.alert-banner .ab-more { appearance: none; border: 1px solid rgba(247,200,119,.5); background: transparent; color: #ffe9c2; border-radius: 999px; padding: 1px 10px; font-size: var(--fs-12); cursor: pointer; flex: none; white-space: nowrap; }
.alert-banner .ab-go { margin-left: auto; flex: none; }
.btn-gold { background: linear-gradient(135deg, #f7cf7a, #e0a33e); border-color: #f3be5e; color: #1a1205; font-weight: 700; }
.btn-gold:hover { background: linear-gradient(135deg, #ffdc92, #eab04c); color: #120c03; border-color: #ffd27a; }
.alert-banner.is-muted { background: rgba(40,30,12,.92); border-bottom-color: rgba(247,200,119,.28); box-shadow: none; color: #e9d6b0; }
.alert-banner.is-muted .path-pill, .alert-banner.is-muted .ab-go { display: none; }

/* ===================== 主体 ===================== */
.app { position: fixed; inset: calc(var(--bar-height) + var(--banner-h)) 0 0 0; z-index: 1; }
.view { position: absolute; inset: 0; }
.view[hidden] { display: none; }

/* ===================== 对话页 三栏 ===================== */
.portal { display: grid; grid-template-columns: var(--left-w) minmax(0, 1fr) 0; height: 100%; transition: grid-template-columns var(--dur-slow) var(--ease); }
.portal.panel-open { grid-template-columns: var(--left-w) minmax(0, 1fr) var(--panel-w); }
.sidebar { display: flex; flex-direction: column; min-height: 0; background: rgba(8,13,25,.84); border-right: 1px solid var(--border-subtle); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.side-sec { padding: 12px 12px 8px; }
.side-sec + .side-sec { border-top: 1px solid var(--border-subtle); }
.side-sec.fleet { max-height: 52%; overflow: auto; flex: none; }
.side-sec.grow { flex: 1; min-height: 0; overflow: auto; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 8px; }
.side-head h2 { margin: 0; font-size: var(--fs-12); font-weight: 700; color: var(--text-muted); letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bot-list, .sess-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.bot-item { width: 100%; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 52px; padding: 6px 8px; border-radius: var(--radius-md); border: 1px solid transparent; background: transparent; color: var(--text-primary); text-align: left; cursor: pointer; transition: background var(--dur-fast), border-color var(--dur-fast); position: relative; }
.bot-item:hover { background: var(--bg-card-hover); }
.bot-item[aria-current="true"] { background: rgba(var(--accent-gold-rgb), .10); border-color: rgba(var(--accent-gold-rgb), .42); }
.planet-wrap { position: relative; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.planet-wrap .planet-cv { border-radius: 50%; display: block; }
.planet-wrap.sun .planet-cv { filter: drop-shadow(0 0 6px rgba(245,184,65,.75)); }
.planet-wrap.ready::before, .planet-wrap.review::before, .planet-wrap.blocked::before { content: ""; position: absolute; inset: -3px; border-radius: 50%; pointer-events: none; }
.planet-wrap.ready::before { box-shadow: 0 0 0 1.5px var(--edge-ready), 0 0 8px rgba(245,186,66,.65); }
.planet-wrap.review::before { box-shadow: 0 0 0 1.5px var(--edge-review), 0 0 8px rgba(56,189,247,.55); animation: breathe 2.6s ease-in-out infinite; }
.planet-wrap.blocked::before { box-shadow: 0 0 0 1.5px var(--edge-blocked), 0 0 8px rgba(242,110,110,.55); animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; } }
.planet-wrap .sdot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--bg-panel-solid); }
.sdot.running { background: var(--status-running); } .sdot.idle { background: var(--status-idle); } .sdot.blocked { background: var(--status-blocked); } .sdot.review { background: var(--status-review); } .sdot.ready { background: var(--status-ready); } .sdot.waiting { background: var(--approval-pending); }
.bot-meta { min-width: 0; }
.bot-name { font-weight: 600; font-size: var(--fs-14); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.bot-sub { display: block; font-size: var(--fs-12); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.right-tags { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.badge { font-size: var(--fs-11); font-weight: 600; border-radius: 999px; padding: 0 7px; line-height: 18px; white-space: nowrap; border: 1px solid; }
.badge.running { color: #7df2c9; background: rgba(56,211,159,.14); border-color: rgba(56,211,159,.35); }
.badge.idle { color: #a9bbd6; background: rgba(141,162,192,.12); border-color: rgba(141,162,192,.25); }
.badge.blocked { color: #ffa3a3; background: rgba(242,109,109,.15); border-color: rgba(242,109,109,.36); }
.badge.review { color: #a5e3ff; background: rgba(56,189,248,.15); border-color: rgba(56,189,248,.36); }
.badge.ready { color: #ffe0a3; background: rgba(245,185,66,.15); border-color: rgba(245,185,66,.38); }
.badge.waiting { color: #1a1205; background: var(--approval-pending); border-color: var(--approval-pending); font-family: var(--font-mono); }
.badge.waiting.is-urgent { background: var(--countdown-urgent); border-color: var(--countdown-urgent); }
.unread { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent-gold); color: #1a1205; font-size: var(--fs-11); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

.sess-item { width: 100%; display: flex; flex-direction: column; gap: 2px; min-height: 44px; padding: 8px 10px; border-radius: var(--radius-md); border: 1px solid transparent; background: transparent; color: var(--text-primary); text-align: left; cursor: pointer; }
.sess-item:hover { background: var(--bg-card-hover); }
.sess-item[aria-current="true"] { background: rgba(var(--accent-cyan-rgb), .08); border-color: rgba(var(--accent-cyan-rgb), .35); }
.sess-title { font-size: var(--fs-13); font-weight: 600; display: flex; align-items: center; gap: 6px; min-width: 0; }
.sess-title .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sess-meta { font-size: var(--fs-11); color: var(--text-muted); font-family: var(--font-mono); margin-left: auto; flex: none; }
.sess-snippet { display: block; font-size: var(--fs-12); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { font-size: var(--fs-11); font-weight: 600; padding: 0 6px; border-radius: 4px; line-height: 18px; flex: none; }
.tag.cur { color: #c3f6ff; background: rgba(var(--accent-cyan-rgb), .16); }
.arch-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; min-height: 32px; margin-top: 6px; padding: 0 6px; background: transparent; border: 0; color: var(--text-muted); font-size: var(--fs-12); font-weight: 600; cursor: pointer; border-radius: 6px; }
.arch-toggle:hover { color: var(--text-primary); }
.switch-confirm { margin: 4px 2px 6px; padding: 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: rgba(15,23,42,.9); font-size: var(--fs-12); color: var(--text-secondary); }
.switch-confirm .row { display: flex; gap: 6px; margin-top: 8px; justify-content: flex-end; }
.side-note { font-size: var(--fs-12); color: var(--text-muted); padding: 6px 8px; margin: 0; }

/* —— 中栏 —— */
.chat-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.chat-header { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 20px; border-bottom: 1px solid var(--border-subtle); background: rgba(7,12,24,.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.chat-header .planet-wrap { width: 40px; height: 40px; }
.ch-title { min-width: 0; flex: 1; }
.ch-name { font-size: var(--fs-16); font-weight: 700; display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.ch-sub { font-size: var(--fs-12); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 10px; align-items: center; }
.chan { display: inline-flex; align-items: center; gap: 5px; color: #9ee8c8; }
.chan::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--status-running); }
.chan.ro { color: var(--text-muted); } .chan.ro::before { background: var(--status-idle); }
.ch-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.btn-toggle[aria-pressed="true"] { border-color: var(--accent-gold); color: var(--text-on-gold); background: rgba(var(--accent-gold-rgb), .14); box-shadow: 0 0 0 1px rgba(var(--accent-gold-rgb), .35) inset; }
.btn-toggle .n { font-family: var(--font-mono); font-weight: 700; color: var(--text-on-gold); }
.icon-btn { appearance: none; width: 36px; height: 36px; flex: none; border-radius: var(--radius-sm); border: 1px solid var(--border-subtle); background: rgba(15,23,42,.62); color: var(--text-secondary); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; }
.icon-btn:hover { color: var(--text-primary); border-color: var(--border-strong); }
.chat-header .sess-btn { display: none; }
.chat-header .hdr-new { display: none; }

.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; scroll-behavior: smooth; }
.chat-stream { max-width: var(--chat-max); margin: 0 auto; padding: 24px 24px 28px; display: flex; flex-direction: column; gap: 16px; }
.msg { display: flex; flex-direction: column; gap: 4px; max-width: 78%; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.agent { align-self: flex-start; align-items: flex-start; }
.msg-meta { font-size: var(--fs-11); color: var(--text-muted); font-family: var(--font-mono); display: flex; gap: 6px; align-items: center; }
.bubble { padding: 10px 14px; border-radius: var(--radius-bubble); font-size: var(--fs-14); line-height: 1.6; word-break: break-word; white-space: pre-wrap; }
.msg.user .bubble { background: linear-gradient(135deg, rgba(243,190,94,.16), rgba(212,148,52,.18)); border: 1px solid rgba(243,190,94,.45); color: #fff3d6; border-bottom-right-radius: 3px; }
.msg.agent .bubble { background: rgba(18,28,50,.78); border: 1px solid rgba(154,186,232,.28); color: #f2f7ff; border-bottom-left-radius: 3px; }
.msg.img-only .bubble { padding: 4px; background: transparent; border-color: rgba(243,190,94,.35); }
.bubble .att { display: block; max-width: 260px; border-radius: 8px; border: 1px solid var(--border-subtle); }
.bubble .att + .txt { margin-top: 8px; display: block; }
.task-chip { font-size: var(--fs-11); font-weight: 600; color: var(--text-on-gold); border: 1px solid rgba(var(--accent-gold-rgb), .5); border-radius: 999px; padding: 0 8px; line-height: 18px; background: rgba(var(--accent-gold-rgb), .1); }
.rel-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.rel-link { appearance: none; border: 1px solid rgba(var(--accent-cyan-rgb), .35); background: rgba(var(--accent-cyan-rgb), .06); color: #bff3fb; border-radius: 999px; padding: 2px 10px; font-size: var(--fs-12); cursor: pointer; }
.rel-link:hover { background: rgba(var(--accent-cyan-rgb), .16); }
.rel-link .st { font-weight: 600; }
.rel-link .st.blocked { color: #ffa3a3; } .rel-link .st.review { color: #a5e3ff; } .rel-link .st.running { color: #7df2c9; } .rel-link .st.done { color: #a8cdff; } .rel-link .st.ready, .rel-link .st.scheduled { color: #ffe0a3; }
.is-located { outline: 2px solid var(--accent-gold); outline-offset: 3px; border-radius: 12px; animation: locate 2.4s ease-out 1; }
@keyframes locate { 0%, 30% { box-shadow: 0 0 0 6px rgba(var(--accent-gold-rgb), .35), 0 0 30px rgba(var(--accent-gold-rgb), .5); } 100% { box-shadow: 0 0 0 0 rgba(var(--accent-gold-rgb), 0); } }
.sys { align-self: center; max-width: 90%; text-align: center; font-size: var(--fs-12); color: var(--text-muted); display: flex; align-items: center; gap: 10px; }
.sys::before, .sys::after { content: ""; height: 1px; width: 40px; background: var(--border-subtle); flex: none; }

/* —— 审批：待处理卡 —— */
.appr-card { align-self: stretch; max-width: 640px; position: relative; border: 1px solid rgba(var(--approval-pending-rgb), .5); background: rgba(14, 20, 36, .94); border-radius: 12px; padding: 16px 16px 12px; overflow: hidden; }
.appr-card .cd-top { position: absolute; left: 0; top: 0; height: 3px; background: var(--grad-countdown); transition: width 250ms linear; }
.appr-card.is-urgent .cd-top { background: linear-gradient(90deg, #ff8a7a, #f3be5e); }
.ac-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ac-title { font-size: var(--fs-14); font-weight: 700; color: var(--text-primary); }
.pill-cyan { font-size: var(--fs-11); font-weight: 600; color: #bff3fb; border: 1px solid rgba(86,215,235,.45); border-radius: 999px; padding: 0 8px; line-height: 18px; }
.ac-cd { margin-left: auto; font-family: var(--font-mono); font-size: var(--fs-12); font-weight: 700; color: var(--approval-pending); white-space: nowrap; }
.appr-card.is-urgent .ac-cd { color: var(--countdown-urgent); }
.ac-purpose { margin-top: 8px; font-size: var(--fs-13); color: var(--text-secondary); }
.ac-purpose b { color: var(--text-primary); font-weight: 600; }
.ac-path { margin-top: 10px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: rgba(3,6,14,.6); border: 1px solid var(--border-subtle); }
.ac-path .fi { flex: none; color: var(--accent-cyan); font-size: 14px; }
.ac-path .p { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: var(--fs-12); color: var(--text-secondary); overflow-wrap: anywhere; }
.ac-path .p b { color: #fff3d6; font-weight: 700; }
.link-btn { appearance: none; border: 0; background: transparent; color: var(--accent-cyan); font-size: var(--fs-12); cursor: pointer; padding: 2px 4px; border-radius: 4px; white-space: nowrap; flex: none; }
.link-btn:hover { text-decoration: underline; }
.ac-foot { margin-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ac-scope { flex: 1 1 260px; min-width: 0; font-size: var(--fs-12); color: var(--text-muted); }
.ac-actions { display: flex; gap: 8px; align-items: center; flex: none; margin-left: auto; }
.ac-actions .btn { min-height: 34px; }
.btn-deny:hover { border-color: rgba(242,109,109,.7); color: #ffd6d6; background: rgba(242,109,109,.12); }
.ac-more { margin-top: 8px; display: flex; justify-content: flex-start; }
.appr-detail { margin: 8px 0 2px; display: grid; grid-template-columns: 64px 1fr; gap: 4px 10px; font-size: var(--fs-12); color: var(--text-secondary); }
.appr-detail dt { color: var(--text-muted); } .appr-detail dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--text-primary); }
.spinner { width: 14px; height: 14px; border: 2px solid rgba(142,176,226,.3); border-top-color: var(--accent-cyan); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.web-ro { font-size: var(--fs-12); color: var(--text-muted); }
.pause-bar { align-self: stretch; max-width: 640px; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid rgba(var(--accent-gold-rgb), .6); border-radius: 10px; background: rgba(var(--accent-gold-rgb), .07); color: #ffe8ba; font-size: var(--fs-13); margin-top: -8px; }
.pause-bar .pz { font-weight: 800; letter-spacing: -1px; color: var(--accent-gold); }

/* —— 审批：折叠行 —— */
.appr-row { align-self: stretch; max-width: 640px; border-left: 3px solid var(--status-idle); background: rgba(15,23,42,.55); border-radius: 0 8px 8px 0; padding: 6px 12px; font-size: var(--fs-12); color: var(--text-secondary); }
.appr-row.allowed { border-left-color: var(--status-running); }
.appr-row.denied { border-left-color: var(--status-idle); }
.appr-row.expired, .appr-row.failed { border-left-color: var(--status-blocked); }
.ar-line { display: flex; align-items: center; gap: 10px; min-height: 26px; flex-wrap: wrap; }
.ar-ic { font-weight: 700; flex: none; }
.appr-row.allowed .ar-ic { color: var(--status-running); } .appr-row.expired .ar-ic, .appr-row.failed .ar-ic { color: var(--countdown-urgent); } .appr-row.denied .ar-ic { color: var(--text-secondary); }
.ar-text { min-width: 0; }
.ar-text b { color: var(--text-primary); font-weight: 600; }

/* —— 忙碌 —— */
.typing { align-self: flex-start; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-bubble); border: 1px dashed rgba(56,211,159,.45); background: rgba(56,211,159,.06); font-size: var(--fs-13); color: #b7f5dc; }
.dots { display: inline-flex; gap: 3px; } .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--status-running); animation: bounce 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.typing .elapsed { font-family: var(--font-mono); font-size: var(--fs-12); color: var(--text-muted); }

/* —— 输入区 —— */
.composer-wrap { padding: 0 24px 14px; background: linear-gradient(180deg, rgba(3,6,14,0) 0%, rgba(3,6,14,.85) 30%); }
.composer-inner { max-width: var(--chat-max); margin: 0 auto; }
.quick { display: flex; gap: 6px; padding: 8px 0; flex-wrap: wrap; }
.quick-chip { appearance: none; border: 1px solid rgba(148,179,224,.22); background: rgba(18,28,48,.65); color: var(--text-secondary); font-size: var(--fs-12); min-height: 28px; padding: 0 10px; border-radius: 999px; cursor: pointer; }
.quick-chip:hover { color: var(--text-primary); border-color: rgba(var(--accent-cyan-rgb), .48); }
.composer { border: 1px solid rgba(var(--accent-gold-rgb), .38); background: rgba(10,16,32,.92); border-radius: var(--radius-lg); padding: 8px 8px 8px 12px; transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.composer:focus-within { border-color: rgba(var(--accent-gold-rgb), .75); box-shadow: 0 0 0 3px rgba(var(--accent-gold-rgb), .14); }
.composer.is-draft { border-style: dashed; border-color: rgba(var(--accent-gold-rgb), .5); }
.thumbs { display: flex; gap: 8px; padding: 4px 0 8px; flex-wrap: wrap; }
.thumb { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border-strong); background: #0b1324; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .x { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(3,6,14,.85); color: #fff; font-size: 12px; cursor: pointer; }
.comp-row { display: flex; align-items: flex-end; gap: 8px; }
.comp-row textarea { flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: var(--fs-14); line-height: 22px; min-height: 22px; max-height: 176px; padding: 5px 0; }
.comp-row textarea::placeholder { color: #7f94b3; }
.comp-row textarea:focus-visible { outline: none; }
.send-btn { min-height: 36px; padding: 0 16px; }
.send-btn.is-waiting { background: rgba(141,162,192,.14); border-color: rgba(141,162,192,.35); color: #a9bbd6; }
.comp-hint { display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-11); color: var(--text-muted); padding: 6px 4px 0; }
.comp-hint .draft { color: #ffe8ba; } .comp-hint .ready { color: #9ee8c8; } .comp-hint .err { color: #ffb4b4; }
.drop-overlay { position: absolute; inset: 8px; z-index: 20; border: 2px dashed rgba(var(--accent-cyan-rgb), .8); border-radius: var(--radius-lg); background: rgba(6,18,32,.88); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; color: #c3f6ff; font-size: var(--fs-20); font-weight: 700; pointer-events: none; }
.drop-overlay::before { content: "⤓"; font-size: 40px; line-height: 1; color: var(--accent-cyan); }
.drop-overlay small { font-size: var(--fs-12); color: var(--text-secondary); font-weight: 400; }

/* —— 空状态 —— */
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 40px 24px; color: var(--text-secondary); }
.empty h3 { margin: 0; font-size: var(--fs-20); color: var(--text-primary); }
.empty p { margin: 0; max-width: 420px; font-size: var(--fs-13); }
.empty .chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

/* ===================== 右栏：当前事项 ===================== */
.tpanel { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: rgba(8,13,25,.9); border-left: 1px solid var(--border-subtle); overflow: hidden; }
.portal:not(.panel-open) .tpanel { visibility: hidden; }
.tp-head { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 12px 8px 16px; border-bottom: 1px solid var(--border-subtle); }
.tp-head h2 { margin: 0; font-size: var(--fs-14); font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-body { flex: 1; min-height: 0; overflow: auto; padding: 12px; }
.metrics { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.metric-pill { appearance: none; display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; min-height: 26px; border-radius: 999px; border: 1px solid rgba(148,182,230,.24); background: rgba(15,24,44,.72); color: var(--text-secondary); font-size: var(--fs-12); cursor: pointer; white-space: nowrap; }
.metric-pill strong { font-family: var(--font-mono); font-weight: 600; color: var(--text-primary); }
.metric-pill.is-attention strong { color: #ff9f9f; } .metric-pill.is-running strong { color: #7df2c9; }
.metric-pill[aria-pressed="true"] { background: rgba(243,190,94,.18); border-color: rgba(243,190,94,.58); color: #ffe8ba; }
.metric-pill[aria-pressed="true"] strong { color: #ffe8ba; }
.tcard { position: relative; border: 1px solid var(--border-subtle); border-radius: 10px; background: rgba(15,23,42,.7); padding: 10px 12px 10px 15px; margin-bottom: 8px; overflow: hidden; }
.tcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--lane-todo); }
.tcard.s-done::before { background: var(--lane-done); } .tcard.s-running::before { background: var(--lane-running); } .tcard.s-blocked::before { background: var(--lane-blocked); }
.tcard.s-review::before { background: var(--lane-review); } .tcard.s-ready::before, .tcard.s-scheduled::before { background: var(--lane-ready); }
.tcard:hover { border-color: var(--border-strong); }
.tc-open { appearance: none; border: 0; background: transparent; color: inherit; text-align: left; padding: 0; width: 100%; cursor: pointer; display: block; font: inherit; }
.tc-top { display: flex; align-items: flex-start; gap: 8px; }
.tc-title { flex: 1; min-width: 0; font-size: var(--fs-13); font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.tc-meta { margin-top: 3px; font-size: var(--fs-11); color: var(--text-muted); font-family: var(--font-mono); }
.tc-sum { margin-top: 4px; font-size: var(--fs-12); color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tc-foot { margin-top: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tc-foot .link-btn { padding-left: 0; }
.tc-foot .btn { min-height: 26px; font-size: var(--fs-12); padding: 0 10px; margin-left: auto; }
.chip { font-size: var(--fs-11); font-weight: 600; border-radius: 999px; padding: 0 7px; line-height: 18px; white-space: nowrap; border: 1px solid; flex: none; }
.chip.running { color: #7df2c9; background: rgba(56,211,159,.14); border-color: rgba(56,211,159,.35); }
.chip.blocked { color: #ffa3a3; background: rgba(242,109,109,.15); border-color: rgba(242,109,109,.36); }
.chip.done { color: #a8cdff; background: rgba(110,168,254,.15); border-color: rgba(110,168,254,.36); }
.chip.review { color: #a5e3ff; background: rgba(56,189,248,.15); border-color: rgba(56,189,248,.36); }
.chip.ready, .chip.scheduled, .chip.todo, .chip.triage { color: #ffe0a3; background: rgba(245,185,66,.15); border-color: rgba(245,185,66,.38); }
.chip.prio { color: #c9d5e6; background: rgba(141,162,192,.12); border-color: rgba(141,162,192,.3); }
.confirm-inline { margin-top: 8px; padding: 8px 10px; border: 1px solid rgba(56,189,248,.45); border-radius: 8px; background: rgba(56,189,248,.07); font-size: var(--fs-12); color: var(--text-secondary); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.confirm-inline .row { margin-left: auto; display: flex; gap: 6px; }
.hist-toggle { width: 100%; justify-content: center; margin-top: 4px; }
/* 任务详情（复用总览右栏「任务详情」结构） */
.td-back { margin-bottom: 10px; }
.td-head { padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--border-subtle); }
.td-title-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.td-ic { width: 18px; height: 18px; border-radius: 4px; border: 1px solid currentColor; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: var(--text-secondary); flex: none; }
.td-title { font-size: 14px; font-weight: 600; }
.td-sub { margin-top: 4px; font-size: var(--fs-12); color: var(--text-muted); font-family: var(--font-mono); }
.td-actions { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.wait-box { border: 1px solid rgba(247,200,119,.45); background: rgba(247,200,119,.07); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; font-size: var(--fs-12); color: #ffe9c2; }
.wait-box.unlock { border-color: rgba(86,215,235,.35); background: rgba(86,215,235,.05); color: #cdeff5; }
.wait-box h4, .td-block h4 { margin: 0 0 6px; font-size: var(--fs-12); font-weight: 700; letter-spacing: .03em; }
.td-block h4 { color: var(--text-muted); }
.wait-box ul { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.rel-row { display: flex; gap: 6px; align-items: center; }
.rel-row .link-btn { padding: 0; text-align: left; white-space: normal; }
.td-block { margin-bottom: 12px; font-size: var(--fs-13); color: var(--text-secondary); white-space: pre-wrap; }
.td-block .rel-row { margin-bottom: 4px; }

/* 抽屉/覆盖式右栏 */
.tp-mask { display: none; }

/* ===================== 全局总览（贴近现有：太阳系 + 左任务队列 + 右任务详情） ===================== */
.ov { position: absolute; inset: 0; }
.ov-stage { position: absolute; inset: 0; overflow: hidden; }
.orbit { position: absolute; left: 50%; top: 52%; border: 1px solid rgba(140,184,240,.18); border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.ov-body { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ov-body .planet-hit { appearance: none; border: 0; padding: 0; background: transparent; cursor: pointer; border-radius: 50%; position: relative; }
.ov-body .planet-hit.sel::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,204,92,.85), 0 0 18px rgba(255,204,92,.6); }
.ov-body.ready .planet-hit::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; box-shadow: 0 0 0 2px var(--edge-ready), 0 0 16px rgba(245,186,66,.7); }
.ov-body.review .planet-hit::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; box-shadow: 0 0 0 2px var(--edge-review), 0 0 14px rgba(56,189,247,.6); animation: breathe 2.6s ease-in-out infinite; }
.ov-body.sun .planet-cv { filter: drop-shadow(0 0 22px rgba(245,184,65,.8)); }
.ov-label { display: flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 999px; background: rgba(8,13,25,.82); border: 1px solid var(--border-subtle); font-size: var(--fs-12); white-space: nowrap; }
.ov-label b { font-weight: 700; }
.ov-label .go { appearance: none; border: 0; background: transparent; color: var(--accent-cyan); cursor: pointer; font-size: var(--fs-12); padding: 0 2px; }
.ov-side { position: absolute; top: 12px; bottom: 12px; width: 300px; background: rgba(8,13,25,.82); border: 1px solid var(--border-subtle); border-radius: 14px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.ov-side.left { left: 12px; } .ov-side.right { right: 12px; width: 320px; }
.ov-side .tp-head { min-height: 46px; }
.ov-hint { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); font-size: var(--fs-12); color: var(--text-muted); background: rgba(8,13,25,.7); padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border-subtle); white-space: nowrap; }

/* ===================== 任务关系（简化，节点贴近现有） ===================== */
.tg { height: 100%; overflow: auto; padding: 16px 24px; }
.tg-toolbar { display: flex; gap: 8px; align-items: center; margin: 0 auto 12px; max-width: 1180px; flex-wrap: wrap; }
.tg-toolbar h1 { margin: 0 12px 0 0; font-size: var(--fs-16); }
.tg-toolbar p { margin: 0; color: var(--text-muted); font-size: var(--fs-12); }
.tg-canvas { position: relative; max-width: 1180px; height: 480px; margin: 0 auto; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: rgba(8,13,25,.6); }
.tg-canvas svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tnode { position: absolute; width: 200px; transform: translate(-50%, -50%); appearance: none; text-align: left; padding: 9px 11px 9px 14px; border-radius: var(--radius-md); border: 1px solid var(--border-strong); background: rgba(15,23,42,.94); color: var(--text-primary); cursor: pointer; font-size: var(--fs-12); display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.tnode::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--lane-todo); }
.tnode.s-done::before { background: var(--lane-done); } .tnode.s-running::before { background: var(--lane-running); } .tnode.s-blocked::before { background: var(--lane-blocked); } .tnode.s-review::before { background: var(--lane-review); } .tnode.s-ready::before, .tnode.s-scheduled::before { background: var(--lane-ready); }
.tnode:hover { border-color: var(--accent-gold); }
.tnode.sel { border-color: var(--accent-gold); box-shadow: 0 0 0 2px rgba(243,190,94,.4); }
.tnode .tid { font-family: var(--font-mono); color: var(--text-muted); font-size: var(--fs-11); display: flex; justify-content: space-between; gap: 6px; }
.tnode .tt { font-size: var(--fs-13); font-weight: 600; line-height: 1.35; }

/* ===================== Toast / 演示 / 抽屉 ===================== */
.toast { position: fixed; left: 50%; top: calc(var(--bar-height) + var(--banner-h) + 76px); transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius-md); background: var(--bg-popover); border: 1px solid var(--border-strong); box-shadow: var(--shadow-popover); font-size: var(--fs-13); max-width: calc(100vw - 32px); }
.toast button { appearance: none; border: 0; background: transparent; color: var(--accent-cyan); cursor: pointer; font-size: var(--fs-13); font-weight: 600; padding: 2px 4px; }
.demo { position: fixed; left: 12px; bottom: 12px; z-index: 80; width: 236px; background: rgba(16,25,41,.97); border: 1px dashed rgba(139,124,246,.8); border-radius: var(--radius-md); box-shadow: var(--shadow-popover); font-size: var(--fs-12); }
.demo:not([open]) { width: auto; }
.demo summary { list-style: none; cursor: pointer; padding: 7px 10px; display: flex; gap: 8px; justify-content: space-between; align-items: center; color: #d6cffd; font-weight: 600; }
.demo summary::-webkit-details-marker { display: none; }
.demo .tagline { font-size: var(--fs-11); font-weight: 600; color: #1a1240; background: #b8adff; border-radius: 4px; padding: 0 5px; }
.demo .body { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.demo .body .btn { width: 100%; justify-content: flex-start; min-height: 28px; font-size: var(--fs-12); }
.demo label { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); min-height: 24px; cursor: pointer; }
.drawer-mask { position: fixed; inset: calc(var(--bar-height) + var(--banner-h)) 0 0 0; z-index: 30; background: rgba(3,6,14,.6); }
.drawer { position: fixed; top: calc(var(--bar-height) + var(--banner-h)); bottom: 0; left: 0; width: 300px; max-width: 86vw; z-index: 31; background: #0a1020; border-right: 1px solid var(--border-strong); box-shadow: var(--shadow-panel); display: flex; flex-direction: column; overflow: auto; }

/* ===================== 断点 ===================== */
/* XL ≥1440：left 280 / panel 360（默认值） */
@media (max-width: 1439px) { :root { --left-w: 272px; --panel-w: 320px; } }
/* L 1280–1439：右栏推挤；<1280：右栏改覆盖式抽屉 */
@media (max-width: 1279px) {
  :root { --left-w: 272px; --panel-w: 0px; }
  .portal.panel-open { grid-template-columns: var(--left-w) minmax(0, 1fr) 0; }
  .tpanel { position: fixed; top: calc(var(--bar-height) + var(--banner-h)); right: 0; bottom: 0; width: 380px; max-width: 92vw; z-index: 32; box-shadow: -18px 0 48px rgba(0,0,0,.6); border-left: 1px solid var(--border-strong); }
  .portal:not(.panel-open) .tpanel { display: none; }
  .portal.panel-open .tp-mask { display: block; position: fixed; inset: calc(var(--bar-height) + var(--banner-h)) 0 0 0; z-index: 31; background: rgba(3,6,14,.45); }
  .chat-header { padding: 8px 16px; }
  .chat-stream { padding: 20px 20px 24px; }
  .composer-wrap { padding: 0 20px 14px; }
  .msg { max-width: 84%; }
  .ov-side.right { display: none; }
}
/* M 1024–1279 由上一条覆盖。S 720–1023：左栏收成 72px 星球轨 */
@media (max-width: 1023px) {
  :root { --left-w: 72px; }
  .brand-title, .ver-tag { display: none; }
  .btn-create .lbl, .btn-more .lbl, .ch-actions .lbl-long { display: none; }
  .portal > .sidebar .side-sec.grow { display: none; }
  .portal > .sidebar .side-head h2, .portal > .sidebar .bot-meta { display: none; }
  .portal > .sidebar .bot-item { grid-template-columns: 1fr; justify-items: center; padding: 8px 0; min-height: 56px; }
  .portal > .sidebar .right-tags { position: absolute; top: 2px; right: 3px; }
  .portal > .sidebar .right-tags .badge:not(.waiting) { display: none; }
  .portal > .sidebar .right-tags .badge.waiting { font-size: 9.5px; padding: 0 4px; line-height: 15px; }
  .portal > .sidebar .right-tags .badge.waiting .w { display: none; }
  .chat-header .sess-btn, .chat-header .hdr-new { display: inline-flex; }
  .msg { max-width: 90%; }
  .ov-side.left { width: 260px; }
  .alert-banner .ab-text .purpose { display: none; }
}
@media (max-width: 719px) {
  .portal, .portal.panel-open { grid-template-columns: 0 minmax(0, 1fr) 0; }
  .portal > .sidebar { display: none; }
  .tpanel { width: 100vw; max-width: 100vw; }
  .alert-banner .path-pill { display: none; }
  .ov-side { display: none; }
}

/* ===================== 减少动态效果 ===================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .alert-banner .blink { opacity: 1; }
  .is-located { box-shadow: 0 0 0 4px rgba(var(--accent-gold-rgb), .35); }
}
body.force-reduced *, body.force-reduced *::before, body.force-reduced *::after { animation: none !important; transition: none !important; }
@media (forced-colors: active) {
  .appr-card, .bot-item[aria-current="true"], .pending-badge, .pending-more, .alert-banner { border: 2px solid CanvasText; }
  :focus-visible { outline: 2px solid Highlight; }
}
.tnode .chip { align-self: flex-start; }

.alert-banner .ab-short { display: none; }
.comp-hint > span:first-child { min-width: 0; }
.comp-hint .hr { flex: none; }
@media (max-width: 1279px) { .tpanel { background: #0a1020; } }
@media (max-width: 1100px) { .comp-hint .hr { display: none; } }
@media (max-width: 719px) {
  .portal, .portal.panel-open { grid-template-columns: minmax(0, 1fr); }
  .topbar { gap: 6px; padding: 0 8px; }
  .brand { display: none; }
  .view-switch { position: static; transform: none; margin-right: auto; }
  .view-tab { padding: 0 9px; font-size: 13px; }
  .pending-split, .pending-badge, .btn-more { display: none !important; }
  .alert-banner { padding: 0 10px; gap: 8px; }
  .alert-banner .ab-long { display: none; } .alert-banner .ab-short { display: inline; }
  .chat-header { padding: 8px 10px; gap: 8px; }
  .chat-stream { padding: 16px 12px 20px; }
  .composer-wrap { padding: 0 10px 10px; }
  .appr-card { padding: 14px 12px 10px; }
  .ac-actions { width: 100%; justify-content: flex-end; }
}
@media (max-width: 1023px) and (min-width: 720px) { .view-switch { left: 46%; } }
.popover { top: calc(var(--bar-height) + var(--banner-h) + 6px); }
@media (max-width: 719px) { .ch-sub > span:not(.chan) { display: none; } }
.demo .body .btn { white-space: normal; text-align: left; height: auto; padding-top: 4px; padding-bottom: 4px; line-height: 1.35; }
.demo { width: 260px; }

/* v2.1 待审批列表（listbox，无审批按钮） */
.pop-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; outline: none; }
.pop-opt { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-md); border: 1px solid rgba(142,176,226,.18); background: rgba(142,176,226,.04); cursor: pointer; }
.pop-opt:hover { background: rgba(var(--approval-pending-rgb), .08); }
.pop-opt.is-sel { border-color: rgba(var(--approval-pending-rgb), .75); background: rgba(var(--approval-pending-rgb), .12); }
.pop-list:focus-visible .pop-opt.is-sel { box-shadow: 0 0 0 2px var(--focus-ring, #f3be5e); }
.pop-opt .po-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pop-opt .po-bot { font-weight: 600; font-size: 13px; display: flex; gap: 6px; align-items: center; }
.pop-opt .po-first { font-size: 11px; font-weight: 500; color: #ffe9c2; background: rgba(var(--approval-pending-rgb), .22); border-radius: 999px; padding: 0 7px; }
.pop-opt .po-file { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding: 0 2px; }
.pop-hint { font-size: 12px; color: var(--text-muted); }
@media (max-width: 719px) { .pop-hint { display: none; } }

/* v2.1 角标分段按钮：左半跳到最快过期的卡片，右侧 ▾ 打开列表（仅多条时出现） */
.pending-split { display: inline-flex; align-items: stretch; }
.pending-split[hidden], .pending-more[hidden] { display: none; }
.pending-split.has-more .pending-badge { border-top-right-radius: 0; border-bottom-right-radius: 0; padding-right: 10px; }
.pending-more {
  display: inline-flex; align-items: center; justify-content: center; min-width: 30px; min-height: 32px; padding: 0 9px 0 8px; cursor: pointer;
  color: #fff0cf; font-size: 12px; background: rgba(var(--approval-pending-rgb), .16);
  border: 1px solid rgba(var(--approval-pending-rgb), .62); border-left: 1px solid rgba(var(--approval-pending-rgb), .38);
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0; margin-left: -1px;
}
.pending-more:hover, .pending-more[aria-expanded="true"] { background: rgba(var(--approval-pending-rgb), .30); }
.pending-more[aria-expanded="true"] span { display: inline-block; transform: rotate(180deg); }
