:root {
  --bg: #f4f6fa; --panel: #ffffff; --line: #e3e8f0; --ink: #1c2333; --muted: #66708a;
  --accent: #3358ff; --accent-soft: #eef1ff; --ok: #0f9d58; --warn: #b7791f;
  --bad: #d64545; --radius: 12px; --shadow: 0 1px 3px rgba(20,30,60,.08);
  --motion-fast: 160ms; --motion-ease: cubic-bezier(.2,.75,.25,1);
  --focus-ring: #7187ff; --hover-shadow: 0 8px 22px rgba(20,30,60,.10);
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.55 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); }
.boot { padding: 48px; text-align: center; color: var(--muted); }
button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: #fff;
  border-radius: 8px; padding: 6px 14px; color: var(--ink); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--bad); }
button:disabled { opacity: .45; cursor: not-allowed; }
input, textarea, select { font: inherit; border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 10px; background: #fff; color: var(--ink); width: 100%; }
textarea { resize: vertical; min-height: 64px; }
a { color: var(--accent); text-decoration: none; }

/* 布局 */
.topbar { display: flex; align-items: center; gap: 20px; padding: 0 20px; height: 52px;
  background: #101631; color: #fff; position: sticky; top: 0; z-index: 30; }
.topbar .logo { font-weight: 700; letter-spacing: .5px; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { color: #b9c2e0; padding: 6px 12px; border-radius: 8px; }
.topbar nav a.active { background: rgba(255,255,255,.12); color: #fff; }
.topbar .who { color: #b9c2e0; font-size: 12px; }
.layout { display: flex; min-height: calc(100vh - 52px); }
.sidebar { width: 220px; padding: 16px 12px; border-right: 1px solid var(--line);
  background: var(--panel); }
.sidebar h4 { margin: 12px 8px 6px; font-size: 12px; color: var(--muted); }
.sidebar a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--ink); }
.sidebar a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.main { flex: 1; padding: 20px 24px; max-width: 1200px; }
.page-title { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.page-title h2 { margin: 0; font-size: 18px; }
.page-title .spacer { flex: 1; }

/* 卡片与状态 */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 14px; }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.stat .num { font-size: 26px; font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: 12px; }
.badge { display: inline-block; padding: 1px 9px; border-radius: 20px; font-size: 12px;
  border: 1px solid var(--line); background: #f7f8fb; color: var(--muted); }
.badge.s-queued { color: #3556c8; border-color: #c4d0f5; background: #eef2ff; }
.badge.s-running { color: #8a5a00; border-color: #ecd9a8; background: #fdf3dd; }
.badge.s-blocked, .badge.s-failed, .badge.s-changes_requested { color: var(--bad);
  border-color: #f0c4c4; background: #fdeeee; }
.badge.s-submitted, .badge.s-reviewing { color: #6b21a8; border-color: #ddc7f5; background: #f6ecfd; }
.badge.s-accepted { color: var(--ok); border-color: #bfe5cf; background: #ebf8f0; }
.badge.s-cancelled { color: var(--muted); }
.badge.s-draft { color: var(--muted); }
.tag-sim { background: #fff4e5; color: #9a5b00; border-color: #ecd2a8; }
.tag-manual { background: #e8f4fd; color: #14629e; border-color: #b7dcf3; }

/* 会议室 */
.room-wrap { display: grid; grid-template-columns: 220px 1fr 340px; gap: 14px; align-items: start; }
.timeline { display: flex; flex-direction: column; gap: 10px; }
.msg { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 14px; max-width: 92%; box-shadow: var(--shadow); }
.msg .head { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; font-size: 12px;
  color: var(--muted); flex-wrap: wrap; }
.msg .head b { color: var(--ink); }
.msg.agent_text { align-self: flex-start; }
.msg.user_text { align-self: flex-end; background: var(--accent-soft); border-color: #d8e0ff; }
.msg.meeting_summary, .msg.system_alert { align-self: center; background: #fbfcff;
  border-style: dashed; font-size: 13px; }
.msg.task_event, .msg.submission, .msg.review { align-self: center; font-size: 13px; }
.task-card { border: 1px solid var(--d8e0ff, #d8e0ff); background: #f6f8ff; border-radius: 10px;
  padding: 8px 12px; margin-top: 6px; cursor: pointer; }
.task-card .t-title { font-weight: 600; }
.task-card .t-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.composer { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.composer .row { display: flex; gap: 8px; }
.composer select { width: auto; min-width: 140px; }
.msg-body { white-space: pre-wrap; word-break: break-word; }
.withdraw-btn { padding: 1px 7px; font-size: 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--panel); cursor: pointer; }
.withdraw-btn:disabled { opacity: .5; cursor: wait; }
.withdrawn { font-style: italic; }
.meta-note { font-size: 12px; color: var(--muted); }

/* 看板 */
.kanban { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; overflow-x: auto; }
.kan-col { background: #eef1f6; border-radius: var(--radius); padding: 8px; min-height: 300px; }
.kan-col h5 { margin: 4px 6px 8px; font-size: 12px; color: var(--muted); }
.kan-card { background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; margin-bottom: 8px; cursor: pointer; font-size: 13px; }
.kan-card .no { color: var(--muted); font-size: 11px; }

/* 任务详情抽屉 */
.drawer { position: fixed; right: 0; top: 52px; bottom: 0; width: 460px; background: var(--panel);
  border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(20,30,60,.12); padding: 18px;
  overflow-y: auto; z-index: 40; }
.drawer h3 { margin-top: 0; }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 4px 10px; font-size: 13px; margin: 10px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.crit-row { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 8px; margin-bottom: 6px; font-size: 13px; }
.crit-row input[type=checkbox] { width: auto; }
.crit-row input[type=text] { flex: 1; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ev { font-size: 12px; color: var(--muted); padding: 4px 0; border-bottom: 1px dashed var(--line); }
.asset-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; margin-bottom: 6px; font-size: 13px; }

/* 登录 */
.login-box { max-width: 360px; margin: 12vh auto; }
.login-box .card { padding: 28px; }
.notice { background: #fff8e8; border: 1px solid #eedfb0; color: #7a5a00; border-radius: 8px;
  padding: 8px 12px; font-size: 13px; margin-bottom: 12px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 12px; }
table.list { width: 100%; border-collapse: collapse; font-size: 13px; }
table.list th, table.list td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
table.list th { color: var(--muted); font-weight: 500; }
pre.preview { background: #f7f8fb; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; white-space: pre-wrap; max-height: 420px; overflow: auto; font-size: 12.5px; }

/* ---- v1.1 群聊化 ---- */
.chat-layout { display: grid; grid-template-columns: 1fr 340px; gap: 14px; align-items: start; }
.chat-main { display: flex; flex-direction: column; gap: 12px; }
.chat-scroll { max-height: calc(100vh - 250px); overflow-y: auto; padding: 18px; }
.chat-row { display: flex; gap: 10px; margin-bottom: 14px; }
.chat-row.user { flex-direction: row-reverse; }
.avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.bubble-wrap { max-width: 78%; display: flex; flex-direction: column; gap: 4px; }
.chat-row.user .bubble-wrap { align-items: flex-end; }
.chat-head { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.bubble { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 13px; box-shadow: var(--shadow); white-space: pre-wrap; word-break: break-word; }
.chat-row.user .bubble { background: var(--accent-soft); border-color: #d8e0ff; }
.mention { color: var(--accent); font-weight: 600; }
.sysline { text-align: center; font-size: 12px; color: var(--muted); margin: 10px auto;
  max-width: 85%; }
.sysline a { margin: 0 4px; }
.day-sep { text-align: center; font-size: 11px; color: var(--muted); margin: 14px 0 8px;
  position: relative; }
.day-sep::before, .day-sep::after { content: ""; display: inline-block; width: 60px; height: 1px;
  background: var(--line); vertical-align: middle; margin: 0 10px; }
.file-card { display: flex; align-items: center; gap: 10px; background: #f7f9fd;
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.file-name { font-weight: 600; }
.file-info { flex: 1; min-width: 0; }
.mention-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip { border-radius: 20px; padding: 3px 12px; font-size: 12px; background: #f2f4fa; }
.tag-cli { background: #eefaf1; color: #157347; border-color: #bfe5cf; }
.msg.meeting_summary { max-width: 92%; }
.sysline.collab { background: #f4f7ff; border: 1px dashed #c9d6f5; border-radius: 10px;
  padding: 8px 12px; max-width: 88%; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  vertical-align: middle; margin-right: 2px; }
.dot.on { background: var(--ok); box-shadow: 0 0 4px var(--ok); }
.dot.off { background: #b9c2d8; }
.dot.na { background: #d5dae6; }

/* ---- v1.3.2 参照 BOLI AI 风格的群聊窗口 ---- */
.chat-main { max-width: 900px; margin: 0 auto; width: 100%; }
.chat-scroll { max-height: calc(100vh - 258px); border-radius: 18px; }
.day-sep { letter-spacing: .04em; font-weight: 700; }
.day-sep::before, .day-sep::after {
  background: linear-gradient(90deg, transparent, var(--line-strong, #cdd6e6)); }

/* 气泡：用户=蓝渐变靠右；Agent=浅蓝玻璃靠左 */
.chat-row .bubble {
  border-radius: 14px; padding: 12px 16px; font-size: 14.5px; line-height: 1.7;
  border: none; box-shadow: 0 3px 12px rgba(37, 99, 235, .10); }
.chat-row.agent .bubble {
  background: #dcedffc7; color: #162040; border: 1px solid rgba(37, 99, 235, .12);
  border-radius: 4px 14px 14px 14px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.chat-row.user .bubble {
  background: linear-gradient(135deg, #2563eb, #3b82f6); color: #fff;
  border-radius: 14px 4px 14px 14px; }
.chat-row.user .bubble .mention { color: #ffe08a; }
.chat-row.user .chat-head { flex-direction: row-reverse; }
.chat-row .avatar { width: 32px; height: 32px; font-size: 12px; border-radius: 50%; }
.chat-row.agent .avatar { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.chat-row.user .avatar { background: linear-gradient(135deg, #d97706, #b45309); }

/* 输入卡片：白色大圆角 + 透明输入区 + 工具行 */
.composer { background: var(--panel); border-radius: 18px; padding: 12px 14px 10px;
  box-shadow: 0 10px 30px rgba(20, 30, 60, .08), 0 0 0 1px var(--line); border: none; }
#chat-scroll + .composer, .composer.input-wrap { }
.input-card { display: flex; flex-direction: column; gap: 4px; }
#c-body { width: 100%; background: transparent; border: none; outline: none;
  color: var(--ink); font-size: 15px; line-height: 1.7; resize: none;
  min-height: 48px; max-height: 200px; caret-color: var(--accent); font-family: inherit; }
#c-body::placeholder { color: #94a3b8; }
.card-toolbar { display: flex; align-items: center; gap: 8px;
  border-top: 1px solid var(--line); padding-top: 8px; }
.card-toolbar .mention-bar { flex: 1; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.send-btn { width: 34px; height: 34px; border-radius: 10px; border: none; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700;
  background: linear-gradient(135deg, #2563eb, #3b82f6); color: #fff; cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .30); }
.send-btn.send-btn-idle { background: rgba(37, 99, 235, .08); color: #94a3b8;
  box-shadow: none; cursor: not-allowed; }

/* 快捷问题 */
.quick-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.quick-label { font-size: 12px; color: var(--muted); }
.quick-chip { border-radius: 999px; padding: 4px 12px; font-size: 12px;
  background: rgba(37, 99, 235, .07); border: 1px solid rgba(37, 99, 235, .15);
  color: #2563eb; cursor: pointer; }

/* 文件卡与系统行微调适配新气泡 */
.file-card { background: rgba(255, 255, 255, .75); }
.chip { border: none; }

/* ---- v1.3.3 输入框可拖拽调高，聊天区随动 ---- */
.chat-layout { height: calc(100vh - 158px); align-items: stretch; }
.chat-main { display: flex; flex-direction: column; min-height: 0; }
.chat-scroll { flex: 1 1 0; min-height: 0; max-height: none; }
.resize-handle { flex-shrink: 0; height: 10px; margin: 2px 0; cursor: ns-resize;
  display: flex; align-items: center; justify-content: center; border-radius: 999px; }
.resize-handle span { width: 44px; height: 4px; border-radius: 999px;
  background: #c3cddf; transition: background .15s; }
.composer.input-wrap { height: var(--composer-h, 235px); flex-shrink: 0;
  display: flex; flex-direction: column; overflow: hidden; margin-top: 0; }
.composer .quick-row { flex-shrink: 0; margin-bottom: 6px; }
.input-card { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
#c-body { flex: 1 1 0; min-height: 0; max-height: none; overflow-y: auto; }
.card-toolbar { flex-shrink: 0; }
#task-panel { min-height: 0; overflow-y: auto; max-height: calc(100vh - 158px); }

/* ---- v1.3.3b 房间页去标题栏 + 任务栏左右拖拽 ---- */
.room-grid { height: calc(100vh - 72px); grid-template-columns: 1fr 10px var(--taskpanel-w, 340px); }
.room-grid .chat-main { min-width: 0; }
.resize-handle-v { cursor: ew-resize; display: flex; align-items: center; justify-content: center;
  border-radius: 999px; }
.resize-handle-v span { width: 4px; height: 44px; border-radius: 999px; background: #c3cddf;
  transition: background .15s; }
#task-panel { width: auto; }
.room-actions { display: flex; gap: 4px; flex-shrink: 0; }
.ghost-chip { border: none; background: transparent; color: var(--muted); font-size: 12px;
  padding: 4px 8px; border-radius: 8px; cursor: pointer; white-space: nowrap; }

/* ---- v1.3.3e 任务栏收起 + 把手双态 ---- */
.room-grid.panel-collapsed { grid-template-columns: 1fr 10px 0px; }
.room-grid.panel-collapsed #task-panel { width: 0; padding: 0; margin: 0; overflow: hidden;
  border: none; box-shadow: none; background: transparent; }
.resize-handle-v span.expand-glyph { width: auto; height: auto; background: transparent;
  color: var(--muted); font-size: 13px; font-weight: 700; }

/* ---- v1.3.3f 任务栏收起时铺满宽度 ---- */
.room-grid.panel-collapsed .chat-main { max-width: none; }
.main:has(.room-grid.panel-collapsed) { max-width: none; padding-right: 12px; }
.main:has(.room-grid.panel-collapsed) .chat-scroll { max-width: none; }
.main:has(.room-grid.panel-collapsed) .timeline { max-width: none; }
.main:has(.room-grid.panel-collapsed) .composer { max-width: none; }

/* ---- v1.3.3g 房间页铺满窗口宽（去 1200px 上限与右侧留白）---- */
.main:has(.room-grid) { max-width: none; padding: 14px 16px 10px 16px; }
.room-grid { grid-template-columns: minmax(0, 1fr) 10px var(--taskpanel-w, 340px); }
.room-grid .chat-scroll { max-width: none; }
.room-grid .timeline { max-width: none; }
.room-grid .composer { max-width: none; }

/* ---- 开发指南页 ---- */
.guide { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 14px; align-items: start; }
.guide-toc { position: sticky; top: 66px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); }
.guide-toc h4 { margin: 4px 8px 8px; font-size: 12px; color: var(--muted); }
.guide-toc a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--ink);
  font-size: 13px; line-height: 1.45; }
.guide-toc a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.md-body { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 32px 32px; box-shadow: var(--shadow); line-height: 1.75; font-size: 14px; }
.md-body h1 { font-size: 21px; margin: 0 0 14px; padding-bottom: 10px;
  border-bottom: 2px solid var(--line); }
.md-body h2 { font-size: 17px; margin: 26px 0 10px; padding-bottom: 6px;
  border-bottom: 1px solid var(--line); }
.md-body h3 { font-size: 15px; margin: 20px 0 8px; }
.md-body h4 { font-size: 14px; margin: 16px 0 6px; }
.md-body p { margin: 8px 0; }
.md-body ul, .md-body ol { margin: 8px 0; padding-left: 22px; }
.md-body li { margin: 3px 0; }
.md-body code { background: #f1f3f9; border: 1px solid var(--line); border-radius: 5px;
  padding: 1px 6px; font-size: 12.5px; font-family: "SF Mono", Menlo, Consolas, monospace; }
.md-body pre { background: #f7f8fb; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; overflow-x: auto; margin: 10px 0; }
.md-body pre code { background: none; border: none; padding: 0; font-size: 12.5px;
  line-height: 1.6; white-space: pre; }
.md-body table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.md-body th, .md-body td { border: 1px solid var(--line); padding: 7px 10px;
  text-align: left; vertical-align: top; }
.md-body th { background: #f7f8fb; color: var(--muted); font-weight: 600; }
.md-body blockquote { margin: 10px 0; padding: 8px 14px; border-left: 3px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 8px 8px 0; color: #3a4563; }
.md-body blockquote p { margin: 4px 0; }
.md-body hr { border: none; border-top: 1px dashed var(--line); margin: 18px 0; }
.md-body a { word-break: break-all; }

/* 专用 API 模型设置，不影响普通 Agent 的管理卡。 */
.model-settings { max-width: 860px; }
.model-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; }
.model-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.model-field label { font-weight: 600; }
.model-field input, .model-field select { width: 100%; }
.model-field small { color: var(--muted); line-height: 1.6; }
.model-wide { grid-column: 1 / -1; }
.model-result { padding: 10px 12px; background: var(--accent-soft); border-radius: 8px; line-height: 1.6; overflow-wrap: anywhere; }

/* Embedded/native chat panels must remain usable without desktop-width grids. */
@media (max-width: 850px) {
  .topbar { height: auto; min-height: 52px; flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .topbar .logo, .topbar .who, .topbar > button { white-space: nowrap; }
  .topbar nav { order: 4; flex: 1 0 100%; overflow-x: auto; }
  .topbar nav a { white-space: nowrap; padding: 6px 8px; }
  .layout { display: block; }
  .sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; }
  .sidebar h4 { margin: 2px 0; }
  .sidebar a { display: inline-block; padding: 5px 8px; }
  .main, .main:has(.room-grid) { min-width: 0; width: 100%; padding: 10px; }
  .room-grid, .room-grid.panel-collapsed { display: flex; flex-direction: column; height: auto; }
  .room-grid .chat-main { width: 100%; min-width: 0; }
  .room-grid .resize-handle-v { display: none; }
  .room-grid #task-panel { width: 100%; max-height: none; }
  .room-grid .chat-scroll { flex: none; height: 380px; padding: 12px; }
  .composer.input-wrap { height: max(320px, var(--composer-h, 235px)); }
  .quick-row, .card-toolbar { flex-wrap: wrap; }
  .chat-head { flex-wrap: wrap; }
  .bubble { overflow-wrap: anywhere; }
  .grid.c4, .grid.c3, .grid.c2 { grid-template-columns: 1fr; }
  .model-fields { grid-template-columns: 1fr; }
  .guide { grid-template-columns: 1fr; }
  .guide-toc { position: static; }
  .md-body { padding: 18px 16px; }
}

/* 统一交互反馈：仅动画视觉属性，不改变尺寸、布局或业务状态。 */
:is(button, a, input, textarea, select, summary, .chip, .card, .task-card, .kan-card,
    .file-card, .asset-item, .crit-row, .composer, .bubble, .msg, .avatar,
    .resize-handle, .resize-handle-v, table.list tbody tr) {
  transition: background-color var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease),
    color var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-fast) var(--motion-ease),
    transform var(--motion-fast) var(--motion-ease);
}

/* 键盘反馈独立于鼠标；操作入口不会被隐藏在 hover 后面。 */
:is(button, a, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus-ring); outline-offset: 3px;
}
.topbar :is(a, button):focus-visible { outline-color: #b4c2ff; }
summary { cursor: pointer; border-radius: 6px; }
:is(input, textarea, select):not(:disabled):not([readonly]):focus {
  border-color: var(--accent);
}
#c-body:focus-visible {
  outline: 2px solid var(--focus-ring); outline-offset: -2px; border-radius: 8px;
}
.composer:focus-within {
  box-shadow: 0 10px 30px rgba(20,30,60,.08), 0 0 0 2px var(--focus-ring);
}
:is(.task-card, .kan-card, .file-card, .asset-item, .crit-row):focus-within {
  border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft);
}

/* 只有支持精确悬停的鼠标设备才抬升，避免触屏留下粘滞状态。 */
@media (hover: hover) and (pointer: fine) {
  button:not(:disabled):not([aria-disabled="true"]):not(.send-btn):hover {
    background-color: #f7f9ff; border-color: var(--accent); color: var(--accent);
    transform: translateY(-1px); box-shadow: 0 3px 9px rgba(51,88,255,.12);
  }
  button.primary:not(:disabled):not([aria-disabled="true"]):hover {
    background-color: #2948df; color: #fff;
    box-shadow: 0 5px 14px rgba(51,88,255,.24);
  }
  button.danger:not(:disabled):not([aria-disabled="true"]):hover,
  .withdraw-btn:not(:disabled):not([aria-disabled="true"]):hover {
    background-color: #fff3f3; border-color: var(--bad); color: #b91c1c;
    box-shadow: 0 3px 9px rgba(214,69,69,.10);
  }
  .send-btn:not(:disabled):not([aria-disabled="true"]):not(.send-btn-idle):hover {
    color: #fff; transform: translateY(-2px) scale(1.04);
    box-shadow: 0 7px 18px rgba(37,99,235,.38);
  }
  button:not(:disabled):not([aria-disabled="true"]):not(.send-btn-idle):active {
    transform: translateY(0) scale(.98);
  }
  .chip:not(:disabled):not([aria-disabled="true"]):hover,
  .quick-chip:not(:disabled):not([aria-disabled="true"]):hover {
    background-color: #e6edff; color: #2448c8;
    box-shadow: 0 2px 7px rgba(51,88,255,.10);
  }
  .ghost-chip:not(:disabled):not([aria-disabled="true"]):hover {
    background-color: var(--accent-soft); color: var(--accent); box-shadow: none;
  }
  .topbar nav a:hover {
    background-color: rgba(255,255,255,.20); color: #fff;
    transform: translateY(-1px);
  }
  :is(.sidebar, .guide-toc) a:hover {
    background-color: var(--accent-soft); color: var(--accent);
    box-shadow: inset 3px 0 0 var(--accent); transform: translateX(2px);
  }
  :is(.sidebar, .guide-toc) a.active:hover { background-color: #e4eaff; }
  :is(.sysline, .file-card, .asset-item, .md-body, table.list) a:hover,
  #load-earlier:hover {
    color: #2448c8; text-decoration: underline; text-underline-offset: 3px;
  }
  /* 非点击型面板、聊天区不抬升，不制造可点击的假象或滚动抖动。 */
  .card:not(.chat-scroll):hover {
    border-color: #c7d2e8; box-shadow: var(--hover-shadow);
  }
  :is(.task-card, .kan-card):hover {
    background-color: #f7f9ff; border-color: var(--accent);
    box-shadow: var(--hover-shadow); transform: translateY(-2px);
  }
  :is(.file-card, .asset-item):hover:not(:focus-within) {
    background-color: #f7f9ff; border-color: #c7d2e8;
    box-shadow: 0 3px 12px rgba(20,30,60,.07);
  }
  .crit-row:hover:not(:focus-within) { background-color: #fafbff; border-color: #c7d2e8; }
  table.list tbody tr:hover { background-color: #f2f5ff; }
  :is(input, textarea, select):not(:disabled):not([readonly]):not(:focus):hover {
    border-color: #bcc9e4;
  }
  summary:hover { background-color: var(--accent-soft); color: var(--accent); }
  .chat-row:hover .bubble, .msg:hover {
    box-shadow: 0 6px 20px rgba(37,99,235,.17);
  }
  .chat-row.agent:hover .bubble { border-color: rgba(37,99,235,.25); }
  .chat-row:hover .avatar {
    transform: scale(1.04); box-shadow: 0 0 0 3px rgba(51,88,255,.12);
  }
  .composer:hover:not(:focus-within) {
    box-shadow: 0 12px 32px rgba(20,30,60,.10), 0 0 0 1px #c7d2e8;
  }
  :is(.resize-handle, .resize-handle-v):hover { background-color: rgba(51,88,255,.07); }
  :is(.resize-handle, .resize-handle-v):hover span { background-color: var(--accent); }
  .resize-handle-v:hover span.expand-glyph { background: transparent; color: var(--accent); }
}

/* 系统辅助功能优先：保留颜色/焦点反馈，取消位移与过渡。 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0s !important; animation-duration: 0s !important;
    animation-iteration-count: 1 !important; scroll-behavior: auto !important;
  }
  :is(button, a, .task-card, .kan-card, .avatar) { transform: none !important; }
}
