/* app.css — 全站样式。结构按历史来源分段；末尾「统一设计规范」是颜色、尺度和组件外观的唯一维护入口。详见 docs/ui-design.md。 */
/* ================================================================ 来自 style.css */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.6 var(--font-ui); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { background: var(--card); border: 1px solid var(--border); padding: 7px 11px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--faint); }
::placeholder { color: var(--faint); }
.ic { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; line-height: 0; }
.ic > svg { display: block; flex-shrink: 0; }
.btn { display: inline-flex; align-items: center; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover-w); }
.btn.primary:hover { background: var(--accent-2); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: none; background: transparent; cursor: pointer; min-width: 32px; padding: 0 6px; font-size: 14px; }
.icon-btn.on { color: var(--text); background: var(--fill-2); }
#side .icon-btn:hover { background: var(--hover); }
.err { color: var(--danger); white-space: pre-wrap; }
.ok { color: var(--ok); }
.grow { flex: 1; }
.tag { display: inline-block; font-size: 12px; line-height: 20px; padding: 0 8px; border-radius: 6px; background: var(--fill); color: var(--muted); margin: 2px 4px 2px 0; }
.only-mobile { display: none !important; }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--faint); border-right-color: transparent; border-radius: 50%;
  animation: spin .8s linear infinite; vertical-align: -1px; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.ftile { display: inline-grid; place-items: center; border-radius: 8px; color: #fff; font-weight: 600; flex-shrink: 0; letter-spacing: -.3px;
  font-family: var(--font-ui); }
/* ---------------------------------------------------------------- 布局结构（外观由统一设计规范控制） */
#app { display: grid; position: relative; }
#app.side-collapsed { grid-template-columns: 0 minmax(0, 1fr) auto; }
#app.side-collapsed #side { visibility: hidden; }
#side { background: var(--side); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.side-top { display: flex; }
.brand { flex: 1; min-width: 0; color: var(--text); text-decoration: none; flex-direction: column; }
.side-nav { display: flex; flex-direction: column; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 0 10px; height: 36px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; cursor: pointer;
  transition: background var(--dur-1) var(--ease); }
.side-nav a .ic { color: var(--text); }
.side-nav a .hint { margin-left: auto; font-size: 12px; color: var(--faint); }
.side-nav a:hover { background: var(--hover); }
.side-search { margin: 6px 16px 0; padding: 0 4px 0 8px; min-height: 32px; display: flex; gap: 4px; align-items: center; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); }
.side-search[hidden] { display: none; }
.side-search input { flex: 1; min-width: 0; padding: 5px 2px; background: transparent; border: 0; border-radius: 0; }
.side-search:focus-within { border-color: var(--faint); }
.task-list { flex: 1; overflow-y: auto; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); }
.task-group { display: flex; align-items: center; color: var(--faint); cursor: pointer; user-select: none; position: sticky; top: 0; z-index: 1; background: var(--side); }
.task-group:hover { color: var(--muted); }
.task-group .ic { color: inherit; }
.task-group.shut .ic { transform: rotate(-90deg); }
.task-group.static { cursor: default; }
.task-group .clear { font-size: 12px; color: var(--link); cursor: pointer; }
.task-group .add { min-width: 22px; height: 22px; padding: 0; transition: opacity var(--dur-1) var(--ease); }
.task-group:hover .add { opacity: 1; }
.task-item.nested { padding-left: 34px; }
.task-item .pin { margin-right: -2px; }
.task-empty.sub { padding-left: 34px; }
.proj-item { display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 14px; transition: background var(--dur-1) var(--ease); }
.proj-item:hover { background: var(--hover); }
.proj-item.active { background: var(--active); }
.proj-item .pi { width: 16px; text-align: center; font-size: 14px; flex-shrink: 0; }
.proj-item .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-item .chev { color: var(--faint); }
.proj-item .more { display: none; min-width: 26px; height: 26px; }
.proj-item:hover .more { display: inline-flex; }
.side-top .filter-anchor { position: relative; }
.side-top .filter-anchor .menu { left: auto; right: -6px; min-width: 160px; }
.task-empty { display: flex; gap: 8px; align-items: flex-start; }
.task-empty .ic { margin-top: 2px; }
.task-item { display: flex; align-items: center; padding: 0 10px; cursor: pointer; position: relative; transition: background var(--dur-1) var(--ease); }
.task-item:hover { background: var(--hover); }
.task-item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-item .t mark { background: #fde68a; color: inherit; border-radius: 3px; padding: 0 1px; }
:root[data-theme="dark"] .task-item .t mark { background: #6b5a14; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .task-item .t mark { background: #6b5a14; }
}
.task-item.active .more { display: inline-flex; }
.task-item.active .meta, .task-item.active .dot { display: none; }
.task-item .meta { flex-shrink: 0; white-space: nowrap; }
.task-item .pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 20px; padding: 0 8px; border-radius: 999px;
  background: var(--accent); color: var(--accent-text); flex-shrink: 0; }
.task-item .pill::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.task-item .pill.bad { background: transparent; color: var(--danger); border: 1px solid currentColor; line-height: 18px; }
.task-item .pill.bad::after { display: none; }
.task-item .run-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; flex-shrink: 0; margin-right: 4px;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, .5); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.task-item .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--link); flex-shrink: 0; margin-right: 4px; }
.task-item .more { display: none; }
.task-item:hover .more { display: inline-flex; }
.task-item:hover .meta, .task-item:hover .pill, .task-item:hover .run-dot, .task-item:hover .dot { display: none; }
.side-foot { display: flex; align-items: center; }
.side-foot .avatar { display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.side-foot .uname { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .icon-btn.has::after { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); transform: translate(7px, -7px); }
.side-open { position: fixed; left: 16px; z-index: 20; }
#app.side-collapsed .task-head { padding-left: 58px; }
#main { min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--panel); position: relative; }
.page { flex: 1; overflow-y: auto; }
.page-inner { margin: 0 auto; }
.page h1 { margin: 0 0 4px; }
.page .sub { margin: 0 0 20px; }
.page-head { display: flex; flex-wrap: wrap; }
.page-head > div:first-child { flex: 1; }
.page-head .sub { margin: 0; }
/* ---------------------------------------------------------------- 首页 */
.home { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.home h1 { text-align: center; }
.home .home-foot { margin-top: auto; }
.home .composer-wrap { width: 100%; }
.expert-banner { display: flex; gap: 12px; align-items: center; background: var(--fill); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; }
.expert-banner .av { font-size: 24px; width: 40px; height: 40px; border-radius: 10px; background: var(--card); display: grid; place-items: center; flex-shrink: 0; }
.expert-banner .ex { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.expert-banner .ex button { border: none; background: var(--card); border-radius: 8px; padding: 2px 10px; font-size: 12px; cursor: pointer; color: var(--muted); }
.expert-banner .ex button:hover { color: var(--text); }
.scenes { width: 100%; display: flex; flex-direction: column; align-items: flex-start; }
.scene-tabs { display: inline-flex; }
.scene-tabs button { display: inline-flex; align-items: center; gap: 6px; border: none; background: transparent; cursor: pointer; color: var(--muted); transition: color var(--dur-1) var(--ease), background var(--dur-1) var(--ease); }
.scene-tabs button:hover { color: var(--text); }
.scene-tabs button.active { color: var(--text); }
.tpl-grid { width: 100%; display: grid; }
.tpl { display: flex; border: 1px solid var(--border-2); cursor: pointer; text-align: left; min-width: 0; transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease); }
.tpl .ti { font-size: 18px; line-height: 22px; flex-shrink: 0; }
.tpl .tt { display: flex; flex-direction: column; min-width: 0; }
.tpl .tt b { color: var(--text); }
.tpl .tt small { text-overflow: ellipsis; }
.disclaimer { text-align: center; margin-top: 8px; }
/* ---------------------------------------------------------------- 输入框 */
.composer { position: relative; }
.composer textarea { width: 100%; resize: none; min-height: 48px; max-height: 260px; display: block; }
.composer textarea:focus { outline: none; }
.composer .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--fill); max-width: 260px; color: var(--muted); }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { border: none; background: none; cursor: pointer; color: var(--faint); padding: 0; display: inline-flex; }
.chip.mode { color: var(--text); }
.composer .bar { display: flex; align-items: center; margin-left: -6px; }
.pick { position: relative; }
.pick > button { border: none; background: transparent; border-radius: 8px; height: 32px; min-width: 32px; padding: 0 7px; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.pick > button:hover { background: var(--hover-w); color: var(--text); }
.pick > button.on { color: var(--text); background: var(--fill-2); }
.pick > button .caret { color: var(--faint); }
.pick > button > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 输入框工具栏：即时悬停提示（替代浏览器迟钝的 title） */
.pick > button[data-tip], .send[data-tip] { position: relative; }
.pick > button[data-tip]:is(:hover, :focus-visible)::after, .send[data-tip]:is(:hover, :focus-visible)::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 40; pointer-events: none;
  background: var(--tip-bg); color: var(--tip-fg); font-size: 12px; line-height: 1.4; padding: 5px 8px; border-radius: 6px; white-space: nowrap; font-weight: normal;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18); animation: tipIn var(--dur-1) ease-out; }
.pick:has(.menu) > button::after { display: none; }
@keyframes tipIn { from { opacity: 0; transform: translate(-50%, 3px); } }
.composer .bar > .pick:last-of-type > button[data-tip]:is(:hover, :focus-visible)::after, .send[data-tip]:is(:hover, :focus-visible)::after { left: auto; right: 0; transform: none; animation: none; }
.composer .bar .pick > button { transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease); }
.composer .bar .pick > button.on { color: var(--text); background: var(--fill-2); }
/* 附件卡片 */
.fchip { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 6px 0 8px; border: 1px solid var(--border-2); border-radius: 10px;
  background: var(--fill); max-width: 240px; min-width: 0; position: relative; }
.fchip .ftile { width: 28px; height: 28px; border-radius: 6px; }
.fchip .fthumb { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border-2); }
.fchip .fmeta { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.fchip .fmeta b { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fchip .fmeta small { font-size: 11px; color: var(--faint); }
.fchip .fx { border: none; background: transparent; color: var(--faint); cursor: pointer; width: 20px; height: 20px; border-radius: 5px; display: inline-grid; place-items: center; flex-shrink: 0; }
.fchip .fx:hover { background: var(--fill-2); color: var(--text); }
.fchip.busy { opacity: .75; }
.fchip .spin { margin: 0 4px; }
.composer .chips { align-items: center; }
/* 拖文件进来 */
.composer.drop { border-color: var(--link); border-style: dashed; background: color-mix(in srgb, var(--link) 4%, var(--card)); }
.composer.drop::after { content: "松开即可上传"; position: absolute; inset: 0; display: grid; place-items: center; border-radius: inherit;
  color: var(--link); font-size: 14px; font-weight: 600; background: color-mix(in srgb, var(--card) 70%, transparent); pointer-events: none; }
.composer-tray { display: flex; align-items: center; }
.composer-tray .pick > button:hover { background: var(--fill-2); }
.menu { position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 30; background: var(--card); max-height: 360px; overflow-y: auto; color: var(--text); text-align: left; font-weight: normal; }
.menu.down { bottom: auto; top: calc(100% + 6px); }
.menu.right { left: auto; right: 0; }
.menu .mi { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; line-height: 1.45; }
.menu .mi:hover { background: var(--hover-w); }
.menu .mi.sel { font-weight: 600; }
.menu .mi small { display: block; font-weight: normal; margin-top: 1px; }
.menu .mh { color: var(--faint); }
.menu input.ms { width: 100%; margin-bottom: 4px; }
.send { border-radius: 50%; border: none; background: var(--accent); color: var(--accent-text); cursor: pointer; display: grid; place-items: center; margin-left: 4px; flex-shrink: 0; }
.send:disabled, .send.idle { background: var(--send-idle-bg); color: var(--send-idle-fg); cursor: default; }
.send.stop { background: var(--accent); }
.queue { margin: 0 auto 6px; display: flex; flex-direction: column; gap: 4px; }
.queue .q { display: flex; gap: 8px; align-items: center; background: var(--fill); border-radius: 12px; padding: 2px 6px 2px 12px; font-size: 13px; }
.queue .q span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-error { color: var(--muted); }
.composer-queue-hint { padding: 0 12px 8px; text-align: right; color: var(--muted); font-size: 12px; }
/* ---------------------------------------------------------------- 任务视图 */
.task-head { display: flex; align-items: center; position: relative; z-index: 2; }
.task-head .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: text; }
.task-head .xp { font-size: 17px; margin-right: 4px; }
.task-head .crumb { color: var(--muted); font-size: 14px; white-space: nowrap; max-width: 30%; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; border-radius: 6px; padding: 2px 4px; margin-left: -4px; }
.task-head .crumb:hover { color: var(--text); background: var(--hover-w); }
.task-head .crumb-sep { color: var(--faint); margin: 0 6px 0 2px; }
.msgs { flex: 1; overflow-y: auto; overflow-x: hidden; }
.msgs-inner { margin: 0 auto; }
.task-foot .composer { margin: 0 auto; }
.u-msg { display: flex; justify-content: flex-end; }
.u-msg .b { max-width: 78%; white-space: pre-wrap; overflow-wrap: anywhere; }
.turn { margin: 0 0 26px; }
.turn .who { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--faint); margin-bottom: 6px; }
.turn .who:empty { display: none; }
.turn .who .av { font-size: 15px; }
details.process { margin-bottom: 10px; }
details.process > summary { list-style: none; cursor: pointer; padding: 4px 0; display: inline-flex; gap: 6px; align-items: center; user-select: none; }
details.process > summary:hover { color: var(--muted); }
details.process > summary::-webkit-details-marker { display: none; }
details.process > summary .chev { transition: transform var(--dur-1) var(--ease); }
details.process:not([open]) > summary .chev { transform: rotate(-90deg); }
details.process .steps { margin: 4px 0 4px 6px; padding: 2px 0 2px 16px; border-left: 1px solid var(--border); }
.step { display: flex; gap: 8px; align-items: flex-start; padding: 2px 0; font-size: 13px; color: var(--muted); line-height: 22px; }
.step > .ic { width: 16px; height: 22px; color: var(--faint); }
.step .body { flex: 1; min-width: 0; }
.step .lbl { color: var(--muted); font-weight: 500; flex-shrink: 0; }
.step .arg { color: var(--faint); overflow-wrap: anywhere; }
.step-d > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; min-width: 0; }
.step-d > summary::-webkit-details-marker { display: none; }
.step-d > summary .arg { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-d > summary .arg.path { color: var(--link); }
.step-d > summary .arg.cmd { font-family: var(--font-code); font-size: 12px; color: var(--muted); }
.step-d > summary > .ic { color: var(--faint); opacity: 0; transition: opacity var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); }
.step-d > summary:hover > .ic, .step-d[open] > summary > .ic { opacity: 1; }
.step-d[open] > summary > .ic { transform: rotate(90deg); }
.step-d > summary:hover .lbl { color: var(--text); }
.dstat { display: inline-flex; gap: 4px; font: 500 12px var(--font-code); flex-shrink: 0; }
.dstat .add { color: var(--ok); font-weight: 500; }
.dstat .del { color: var(--danger); font-weight: 500; }
.step .stt.run { display: inline-flex; align-items: center; gap: 5px; }
.step .stt .spin { width: 11px; height: 11px; border-width: 1.5px; }
.step .stt.wait { color: var(--warn); }
.step .sub-tag { font-size: 12px; color: var(--muted); background: var(--fill); border-radius: 6px; padding: 0 5px; margin-left: 4px; }
.step .stt { font-size: 12px; flex-shrink: 0; color: var(--faint); }
.step .stt.run { color: var(--warn); }
.step .stt.ok { color: var(--faint); }
.step .stt.bad { color: var(--danger); }
.step details { margin-top: 0; }
.step pre { margin: 4px 0 0; background: var(--code); border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; word-break: break-all; max-height: 260px; overflow: auto; font-size: 12px; color: var(--text); }
.step.note .body { color: var(--muted); }
.step.note .body.md { font-size: 13px; line-height: 22px; }
.step.note .body.md strong { font-weight: 600; color: var(--text); }
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md ul, .md ol { padding-left: 1.5em; margin: .5em 0; }
.md li { margin: .15em 0; }
.md h1, .md h2, .md h3, .md h4 { line-height: 1.4; margin: 1em 0 .4em; }
.md strong { font-weight: var(--font-weight-semibold); }
.md pre { background: var(--code); padding: 12px 14px; border-radius: 12px; overflow-x: auto; line-height: 1.55; }
.md code { background: var(--code); padding: 1px 5px; border-radius: 6px; }
.md pre code { padding: 0; background: none; }
.md .code-wrap { position: relative; margin: .7em 0; }
.md .code-wrap pre { margin: 0; padding-right: 40px; }
.md .code-wrap.has-lang pre { padding-top: 28px; padding-right: 14px; }
.md .code-bar { position: absolute; top: 4px; left: 14px; right: 4px; display: flex; align-items: center; font-size: 12px; color: var(--faint); pointer-events: none; }
.md .code-bar > span { font-family: var(--font-code); }
.md .code-bar .icon-btn { margin-left: auto; min-width: var(--h-sm); height: var(--h-sm); pointer-events: auto; color: var(--faint); }
.md .code-bar .icon-btn:hover { background: var(--fill-2); color: var(--text); }
.md pre.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.md pre.prose, .md pre.prose code { font-family: inherit; }
.md pre.prose code { font-size: 14px; line-height: 1.75; }
.md table { border-collapse: collapse; display: block; overflow-x: auto; margin: .7em 0; }
.md th, .md td { border: 1px solid var(--border); padding: 6px 12px; }
.md th { background: var(--fill); font-weight: 600; }
.md img { max-width: 100%; border-radius: 12px; cursor: zoom-in; }
.md blockquote { margin: .7em 0; padding: 2px 0 2px 14px; border-left: 3px solid var(--border); color: var(--muted); }
.md a { color: var(--link); }
.md a:hover { text-decoration: underline; }
.md hr { border: none; border-top: 1px solid var(--border); margin: 1em 0; }
.cursor::after { content: "▍"; animation: blink 1s infinite; color: var(--faint); }
@keyframes blink { 50% { opacity: 0; } }
.thinking { display: inline-flex; align-items: center; gap: 8px; color: var(--faint); font-size: 14px; }
.art-cards { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.art-card { display: flex; gap: 14px; align-items: center; background: var(--fill); border-radius: 16px; padding: 0 14px 0 20px; height: 76px; cursor: pointer; }
.art-card:hover { background: var(--fill-2); }
.art-card > div { min-width: 0; flex: 1; }
.art-card .nm { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art-card .meta { font-size: 12px; color: var(--faint); }
.art-card .icon-btn { color: var(--muted); }
.art-card .icon-btn:hover { background: var(--card); }
.see-all { display: flex; gap: 22px; margin-top: 14px; }
.media-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.media-row img { height: 180px; width: auto; min-width: 120px; max-width: min(100%, 360px); object-fit: cover; object-position: top;
  border-radius: 12px; cursor: zoom-in; border: 1px solid var(--border); background: var(--fill); }
.media-row video { max-height: 300px; border-radius: 12px; }
.msg-actions { display: flex; gap: 4px; margin-top: 12px; margin-left: -6px; }
.msg-actions .icon-btn.on { color: var(--text); background: var(--fill); }
.approval { border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; margin: 12px 0; background: var(--card); box-shadow: var(--shadow-sm); }
.approval h4 { margin: 0 0 8px; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.approval h4 .ic { color: var(--warn); }
.approval pre { background: var(--code); border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; word-break: break-all; font-size: 12px; max-height: 200px; overflow: auto; }
.approval .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.approval .acts input { flex: 1; min-width: 160px; }
.plan-confirm { margin-top: 12px; display: flex; gap: 8px; }
.err-box { background: color-mix(in srgb, var(--danger) 7%, var(--panel)); color: var(--danger); border-radius: 12px; padding: 10px 14px; margin-top: 10px; white-space: pre-wrap; font-size: 13px;
  display: flex; gap: 12px; align-items: flex-start; }
.err-box > div { flex: 1; min-width: 0; }
.err-box .btn { flex-shrink: 0; }
.done-line { color: var(--ok); font-size: 13px; }
/* ---------------------------------------------------------------- 右侧结果区 */
#panel { width: 500px; background: var(--panel); display: flex; flex-direction: column; min-height: 0; overflow: hidden; position: relative; }
#panel.wide { position: fixed; right: 8px; top: 8px; bottom: 8px; z-index: 25; width: min(58vw, 960px); box-shadow: var(--pop); }
#panel:not(.wide) { width: var(--panel-w, 500px); }
#panel[hidden] { display: none; }
.panel-tabs { display: flex; align-items: center; gap: 4px; }
.panel-tabs > button[data-tab] { display: inline-flex; align-items: center; gap: 6px; border: none; background: none; cursor: pointer; color: var(--muted); }
.panel-tabs > button[data-tab]:hover { background: var(--hover-w); color: var(--text); }
.panel-tabs > button[data-tab].active { color: var(--text); background: var(--fill); font-weight: 600; }
.panel-tabs b { font-weight: normal; font-size: 12px; color: var(--faint); }
.panel-body { flex: 1; overflow-y: auto; }
.panel-body .empty { color: var(--faint); text-align: center; margin-top: 60px; font-size: 13px; }
.panel-tools { display: flex; gap: 6px; margin-bottom: 10px; }
.flist { display: flex; flex-direction: column; gap: 2px; }
.fitem { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 12px; cursor: pointer; }
.fitem, .tree button.row { width: 100%; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; }
.fitem:focus-visible, .tree button.row:focus-visible { outline: 2px solid var(--muted); outline-offset: -2px; }
.fitem:hover { background: var(--hover-w); }
.fitem .thumb { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); flex-shrink: 0; background: var(--fill); }
.fitem .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.fitem > div { min-width: 0; flex: 1; }
.fitem .meta { font-size: 12px; color: var(--faint); }
.tree .row { display: flex; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.tree .row:hover { background: var(--hover-w); }
.tree .row .sz { margin-left: auto; color: var(--faint); font-size: 12px; }
.todo { padding: 6px 0; display: flex; gap: 10px; font-size: 14px; align-items: flex-start; }
.todo .ic { margin-top: 3px; color: var(--faint); }
.todo.completed { color: var(--faint); text-decoration: line-through; }
.todo.completed .ic { color: var(--ok); }
.todo.in_progress { font-weight: 600; }
.todo.in_progress .ic { color: var(--text); }
.preview { position: absolute; inset: 0; background: var(--panel); display: flex; flex-direction: column; }
.preview[hidden] { display: none; }
.pv-head { display: flex; align-items: center; gap: 4px; padding: 12px 12px 10px; border-bottom: 1px solid var(--border-2); }
.pv-head .tabpill { display: inline-flex; align-items: center; gap: 8px; background: var(--fill); border-radius: 10px; height: 36px; padding: 0 6px 0 10px; min-width: 0; max-width: 60%; }
.pv-head .nm { min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-head .tabpill .icon-btn { min-width: 28px; height: 28px; }
.pv-body { flex: 1; overflow: auto; position: relative; }
.pv-body iframe { width: 100%; height: 100%; border: none; background: #fff; display: block; }
.pv-body.web { display: flex; flex-direction: column; overflow: hidden; }
.pv-bar { display: flex; align-items: center; gap: 2px; padding: 6px 10px; border-bottom: 1px solid var(--border-2); }
.pv-bar .icon-btn { min-width: 28px; height: 28px; }
.pv-url { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; margin: 0 4px; border-radius: 8px;
  background: var(--fill); color: var(--muted); font-size: 12px; }
.pv-url span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-url .ic { color: var(--faint); }
.pv-stage { flex: 1; min-height: 0; display: flex; justify-content: center; }
.pv-stage.phone { background: var(--fill); padding: 16px 0; }
.pv-stage.phone iframe { width: 390px; max-width: 100%; border-radius: 14px; box-shadow: 0 2px 12px rgba(0, 0, 0, .12); }
.pv-body img, .pv-body video { max-width: 100%; display: block; margin: 12px auto; }
.pv-body .md { padding: 18px 24px; }
.pv-body pre.txt { margin: 0; padding: 16px; white-space: pre-wrap; word-break: break-all; font-size: 12px; }
.pv-body .pages { padding: 14px; display: flex; flex-direction: column; gap: 14px; background: var(--fill); min-height: 100%; }
.pv-body .pages figure { margin: 0; }
.pv-body .pages img { width: 100%; margin: 0; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.12); border-radius: 4px; cursor: zoom-in; }
.pv-body .pages figcaption { text-align: center; font-size: 12px; color: var(--faint); margin-top: 4px; }
.pv-body .loading { padding: 60px 20px; text-align: center; color: var(--faint); }
/* ---------------------------------------------------------------- 专家·技能·连接器 */
.hub-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hub-tabs { display: flex; flex: 1 0 auto; min-width: 300px; }
.hub-tabs a { display: inline-flex; align-items: center; color: var(--faint); cursor: pointer; text-decoration: none; white-space: nowrap; }
.hub-tabs a .ic { color: inherit; }
.hub-tabs a:hover { color: var(--muted); }
.hub-tabs a.active { color: var(--text); }
.search-box { position: relative; display: inline-flex; align-items: center; }
.search-box .ic { position: absolute; color: var(--faint); pointer-events: none; }
.banner-row { display: grid; }
.bcard { transition: box-shadow var(--dur-1) var(--ease); overflow: hidden; }
.bcard .top { display: flex; justify-content: space-between; padding-bottom: 14px; position: relative; }
:root[data-theme="dark"] .bcard .top { background: linear-gradient(120deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)) !important; }
:root[data-theme="dark"] .bcard .top b { color: var(--text); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bcard .top { background: linear-gradient(120deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)) !important; }
  :root:not([data-theme="light"]) .bcard .top b { color: var(--text); }
}
.bcard .top .emo { line-height: 1; opacity: .95; }
.bcard .links { display: flex; flex-direction: column; }
.bcard .links a { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); cursor: pointer; overflow: hidden; white-space: nowrap; }
.bcard .links a:hover { color: var(--text); }
.sub-head { display: flex; align-items: center; }
.sub-head .stabs { display: flex; }
.sub-head .stabs a { color: var(--faint); cursor: pointer; }
.sub-head .stabs a.active { color: var(--text); }
.seg-soft { display: inline-flex; gap: 2px; padding: 3px; background: var(--fill); border-radius: 10px; }
.seg-soft button { border: none; background: transparent; border-radius: 8px; cursor: pointer; color: var(--muted); }
.seg-soft button.active { background: var(--card); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }
.tabs-line { overflow-x: auto; scrollbar-width: none; }
.tabs-line::-webkit-scrollbar { display: none; }
.tabs-line button { cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.grid { display: grid; }
.card { background: var(--card); }
.gcard { display: flex; flex-direction: column; cursor: pointer; position: relative; border: 1px solid var(--border-2); box-shadow: none; }
.grid > *, .banner-row > * { min-width: 0; }
.gcard .hd { display: flex; gap: 12px; align-items: center; }
.gcard .hd > div:last-child { min-width: 0; flex: 1; }
.gcard .av { background: var(--fill); display: grid; place-items: center; flex-shrink: 0; }
.gcard .av.t0 { background: #efedfb; }
.gcard .av.t1 { background: #e8f3ea; }
.gcard .av.t2 { background: #e6eef9; }
.gcard .av.t3 { background: #f9eee4; }
.gcard .av.t4 { background: #f8eaf0; }
.gcard .av.t5 { background: #f3f1e6; }
:root[data-theme="dark"] .gcard .av { background: var(--fill-2) !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .gcard .av { background: var(--fill-2) !important; }
}
.gcard .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcard .nm .badge { margin-left: 6px; vertical-align: 1px; }
.gcard .cat { color: var(--faint); }
.gcard .ds { overflow: hidden; text-overflow: ellipsis; }
.gcard .ds.two { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.gcard .tags { display: flex; gap: 6px; flex-wrap: nowrap; overflow: hidden; }
.gcard .tags .tag { margin: 0; white-space: nowrap; }
.gcard .ft { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--faint); }
.gcard .uses { display: inline-flex; align-items: center; gap: 4px; }
.gcard .summon { transition: opacity var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); gap: 4px; }
.gcard:hover .summon, .gcard .summon:focus-visible { opacity: 1; transform: none; }
@media (hover: none) {
  .gcard .summon { opacity: 1; transform: none; }
}
.list { display: flex; flex-direction: column; gap: 10px; }
.lcard { display: flex; gap: 14px; align-items: center; }
.lcard .main { flex: 1; min-width: 0; }
.lcard .nm { display: flex; align-items: center; }
.lcard .ds { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.lcard .lic { display: grid; place-items: center; flex-shrink: 0; }
.badge { white-space: nowrap; }
.switch { position: relative; flex-shrink: 0; display: inline-block; }
.switch span { position: absolute; inset: 0; border-radius: 999px; cursor: pointer; transition: var(--dur-1) var(--ease); }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%; transition: var(--dur-1) var(--ease); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span::before { transform: translateX(16px); }
:root[data-theme="dark"] .switch input:checked + span::before { background: var(--accent-text); }
.form { display: flex; flex-direction: column; }
.form label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.form label > b { color: var(--text); }
.form .row { display: flex; flex-wrap: wrap; }
.form .row > * { flex: 1; min-width: 140px; }
.form .row > .wide { flex-basis: 100%; }
.form textarea { min-height: 90px; resize: vertical; }
.checks { display: flex; gap: 12px; flex-wrap: wrap; color: var(--text); }
.checks label { flex-direction: row; align-items: center; gap: 4px; color: var(--text); }
.section { margin-bottom: 20px; }
.section h3 { font-size: 16px; margin: 0 0 12px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; align-items: center; }
.dropzone { border: 1.5px dashed var(--border); border-radius: 14px; background: var(--fill); padding: 34px 20px; text-align: center; cursor: pointer; color: var(--text); }
.dropzone:hover, .dropzone.over { border-color: var(--faint); }
.dropzone .ic { color: var(--muted); margin-bottom: 10px; }
.modal-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
/* ---------------------------------------------------------------- 弹层 */
#modal, #login, #lightbox { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
#login { background: var(--bg); }
#lightbox { background: rgba(0, 0, 0, .85); cursor: zoom-out; }
#lightbox img { max-width: 95vw; max-height: 95vh; }
#modal[hidden], #login[hidden], #lightbox[hidden] { display: none; }
.modal-card { width: 100%; max-width: 640px; overflow-y: auto; }
.modal-card.wide { max-width: 900px; }
.modal-head { display: flex; align-items: center; gap: 10px; }
.modal-head h3 { flex: 1; }
.modal-foot { display: flex; justify-content: flex-end; }
.login-card { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.login-card h2 { margin: 0 0 6px; }
.sso-sep { display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; color: var(--muted); font-size: 12px; }
.sso-sep::before, .sso-sep::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.sso-row { display: flex; flex-direction: column; gap: 8px; }
.sso-btn { justify-content: center; text-decoration: none; }
.user-links { display: flex; flex-direction: column; gap: 4px; }
.sso-requests { margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.sso-requests h4 { margin: 0 0 4px; }
.sso-requests .acts { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.srows .acts { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.user-link { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
#toasts { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--card); color: var(--text); max-width: 420px; cursor: pointer; border: 1px solid var(--border); }
.toast.bad { color: var(--danger); }
pre.skill { background: var(--code); padding: 14px; border-radius: 10px; white-space: pre-wrap; font-size: 12px; max-height: 60vh; overflow: auto; }
/* ---------------------------------------------------------------- 窄屏 */
@media (max-width: 1180px) {
  #panel { position: fixed; right: 8px; top: 8px; bottom: 8px; z-index: 25; box-shadow: var(--pop); }
  #panel:not(.wide) { width: min(var(--panel-w, 480px), calc(100vw - 16px)); }
  #panel.wide { width: calc(100vw - 16px); }
}
@media (max-width: 760px) {
  #app { grid-template-columns: minmax(0, 1fr); padding: 0; }
  #main { border-radius: 0; }
  #side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 30; transform: translateX(-100%); transition: transform var(--dur-2) var(--ease); box-shadow: none; }
  #side.open { transform: none; box-shadow: var(--pop); }
  .only-mobile { display: inline-flex !important; }
  .only-desktop { display: none !important; }
  .page { padding: 16px 16px 40px; }
  .home { padding: 8vh 16px 40px; }
  .home h1 { font-size: 26px; }
  .u-msg .b { max-width: 92%; }
  .kv { grid-template-columns: 1fr; }
  .hub-tabs { gap: 16px; }
  .hub-tabs a { font-size: 17px; }
  .search-box input { width: 100%; }
  .search-box { flex: 1; }
  .grid { grid-template-columns: 1fr; }
  .banner-row { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; scrollbar-width: none; }
  .pick > button > span { max-width: 72px; }
  .composer .bar .pick > button { padding: 0 5px; }
  .hub-tabs { min-width: 0; flex-basis: 100%; }
  .page { overflow-x: hidden; }
  .composer-tray { flex-wrap: wrap; }
  #panel { right: 0; top: 0; bottom: 0; width: 100vw; border-radius: 0; }
}
/* ---------------------------------------------------------------- 管理后台 */
.page-inner.wide { max-width: 1280px; }
.admin-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.admin-tabs a { padding: 8px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.admin-tabs a.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.filter-row { display: flex; align-items: center; flex-wrap: wrap; }
.filter-row input:not([type]) { min-width: 220px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--fill); border-radius: 10px; }
.seg button { border: none; background: transparent; padding: 0 12px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--muted); }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--card); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.admin-body { transition: opacity var(--dur-2) var(--ease); display: flex; flex-direction: column; gap: 14px; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 14px; }
.admin-body .kpi-row { margin-bottom: 0; }
.kpi { padding: 14px 16px; }
.kpi-label { color: var(--muted); }
.kpi-value { margin: 2px 0; }
.kpi-sub { color: var(--muted); display: flex; gap: 2px 6px; flex-wrap: wrap; }
.kpi-sub > * { white-space: nowrap; }
.kpi-sub > .long { white-space: normal; }
.kpi-sub > .delta { white-space: normal; flex-basis: 100%; }
.kpi-sub > span:not(.delta):not(:last-child)::after { content: "·"; margin-left: 6px; color: var(--faint); }
.delta.up { color: #006300; }
.delta.down { color: var(--danger); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .delta.up { color: #0ca30c; }
}
:root[data-theme="dark"] .delta.up { color: #0ca30c; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 14px; }
.viz-card { margin-bottom: 14px; }
.admin-body .viz-card, .grid2 .viz-card { margin-bottom: 0; }
.viz-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.viz-head > div:first-child { flex: 1; }
.viz-head h3 { margin: 0; }
.viz { width: 100%; overflow: hidden; }
.viz svg { display: block; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; shape-rendering: crispEdges; }
.viz-base { stroke: var(--viz-base); stroke-width: 1; shape-rendering: crispEdges; }
.viz-axis { fill: var(--viz-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-label { fill: var(--text); font-size: 12px; }
.viz-label.viz-err { fill: var(--danger); }
.viz-value { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-hit { outline: none; cursor: default; }
.viz-hit:hover, .viz-hit:focus { fill: var(--text); fill-opacity: .04; }
.viz-row { cursor: pointer; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.viz-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.key-box { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.key-line { width: 12px; height: 2px; border-radius: 2px; display: inline-block; }
.viz-tip { position: fixed; z-index: 70; background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow);
  padding: 8px 10px; font-size: 12px; pointer-events: none; min-width: 140px; }
.viz-tip[hidden] { display: none; }
.viz-tip-title { color: var(--muted); margin-bottom: 4px; }
.viz-tip-row { display: flex; align-items: center; gap: 6px; line-height: 1.7; }
.viz-tip-row b { font-variant-numeric: tabular-nums; }
.viz-tip-row span:last-child { color: var(--muted); }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl td.nowrap, .nowrap { white-space: nowrap; }
.tbl td.tbl-empty { text-align: center; color: var(--faint); }
.tbl-wrap + .more-rows { margin-top: 10px; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.clickable { cursor: pointer; }
.tbl td:first-child { white-space: nowrap; }
.tbl a.ellipsis { display: inline-block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.tbl tr.clickable:hover td { background: var(--hover); }
.tbl .ellipsis { display: inline-block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.tbl .acts { display: inline-flex; gap: 4px; }
.err-text { color: var(--danger); }
.detail-text { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.st-badge { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.st-badge .st-ic { display: inline-flex; align-items: center; justify-content: center; width: 14px; }
.st-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.meter { position: relative; height: 18px; min-width: 150px; background: var(--code); border-radius: 4px; overflow: hidden; font-size: 11px; }
.meter-fill { position: absolute; inset: 0 auto 0 0; background: #b7d3f6; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .meter-fill { background: #184f95; }
}
:root[data-theme="dark"] .meter-fill { background: #184f95; }
.meter span { position: relative; padding-left: 6px; line-height: 18px; color: var(--text); font-variant-numeric: tabular-nums; }
.health-banner { padding: 12px 16px; margin-bottom: 14px; font-weight: 600; }
.health-banner.ok { color: var(--ok); }
.health-banner.bad { color: var(--danger); }
.trace-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.trace-head h2 { margin: 0; font-size: 18px; flex: 1; min-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.span-detail h4 { margin: 14px 0 6px; font-size: 13px; color: var(--muted); }
/* 全链路回放 */
.viz-row-active { fill: color-mix(in srgb, var(--viz-s1) 14%, transparent) !important; }
.replay-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.replay-bar input[type=range] { flex: 1; min-width: 160px; }
.replay-pos { font-size: 13px; color: var(--muted); white-space: nowrap; }
.replay-step { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 10px; }
.replay-step .k { font-size: 11px; color: var(--muted); }
.replay-step .v { font-size: 14px; font-weight: 600; }
.replay-gap { font-size: 12px; color: var(--muted); margin: -4px 0 8px; }
.replay-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.replay-live .spin { width: 10px; height: 10px; }
.span-detail pre.code { max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
pre.code { background: var(--code); border-radius: 8px; padding: 10px; white-space: pre-wrap; word-break: break-all; font-size: 12px; max-height: 360px; overflow: auto; margin: 0; }
.log-box { border-radius: 10px; padding: 10px 12px; height: calc(100vh - 260px); min-height: 300px; overflow: auto; font: 12px/1.6 var(--font-code); }
.log-line { display: flex; white-space: pre-wrap; word-break: normal; overflow-wrap: anywhere; }
.log-ts { color: #7d8590; flex-shrink: 0; }
.log-lv { width: 64px; flex-shrink: 0; color: #9da5b4; }
.log-src { color: #7d8590; flex-shrink: 0; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.lv-WARNING .log-lv { color: #fab219; }
.lv-ERROR .log-lv, .lv-CRITICAL .log-lv { color: #ff7b72; }
.lv-ERROR .log-msg { color: #ffb4ad; }
.trace-anchor { position: relative; width: 0; height: 0; }
@media (max-width: 760px) {
  .grid2 { grid-template-columns: 1fr; }
  .kpi-value { font-size: 22px; }
  .filter-row input:not([type]) { min-width: 0; flex: 1; }
}
/* ---------------------------------------------------------------- 质量评测 */
.clickable-card { cursor: pointer; }
.clickable-card:hover { border-color: var(--accent); }
.eval-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.eval-chip { font-size: 12px; background: var(--code); border-radius: 6px; padding: 2px 8px; color: var(--muted); }
.eval-chip b { color: var(--text); font-weight: 600; }
.eval-cat { margin-bottom: 8px; }
.eval-cat > b { font-size: 13px; color: var(--text); }
.eval-cell { border: 1px solid var(--border); background: var(--card); border-radius: 6px; padding: 2px 10px; cursor: pointer; font-variant-numeric: tabular-nums; white-space: nowrap; }
.eval-cell.good { color: #006300; }
.eval-cell.bad { color: var(--danger); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .eval-cell.good { color: #0ca30c; }
}
:root[data-theme="dark"] .eval-cell.good { color: #0ca30c; }
.acc-text { color: var(--accent); }
.eval-progress { margin-bottom: 14px; }
.check-list { display: flex; flex-direction: column; gap: 4px; }
.check-item { display: flex; gap: 8px; font-size: 13px; align-items: baseline; }
.check-item.ok > span:first-child { color: #006300; }
.check-item.bad > span:first-child, .check-item.bad b { color: var(--danger); }
.auto-tag { font-size: 11px; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 0 6px; margin-left: 4px; }
/* 专家团 */
.gcard .members { display: flex; align-items: center; gap: 0; min-width: 0; }
.gcard .members .faint { margin-left: 10px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mav { width: 30px; height: 30px; border-radius: 50%; background: var(--fill); display: inline-grid; place-items: center; font-size: 16px; flex-shrink: 0; border: 2px solid var(--card); }
.gcard .members .mav + .mav { margin-left: -8px; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.member-row .faint { font-size: 12px; }
.member-pick { max-height: 280px; overflow: auto; border: 1px solid var(--border-2); border-radius: 12px; padding: 4px; margin-top: 6px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.form .member-pick label.member-row { display: flex; flex-direction: row; align-items: center; gap: 10px; cursor: pointer; font-weight: normal; text-align: left; margin: 0; }
.form .member-pick label.member-row input { width: auto; margin: 0; flex-shrink: 0; }
.member-pick .member-row > div { min-width: 0; }
.member-pick .member-row:hover { background: var(--fill); }
/* 代码模式 */
.repo-chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border-2); background: var(--card); border-radius: 999px; padding: 2px 10px; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.repo-chip:hover { color: var(--text); }
.repo-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 14px; }
.repo-head .grow { flex: 1; }
.diff-stat { font-size: 12px; background: var(--fill); border-radius: 10px; padding: 8px 10px; margin: 0 0 10px; white-space: pre-wrap; overflow-x: auto; }
.diff-file { border: 1px solid var(--border-2); border-radius: 10px; margin-bottom: 8px; overflow: hidden; }
.diff-file summary { display: flex; gap: 8px; align-items: center; padding: 7px 10px; cursor: pointer; font-size: 13px; background: var(--fill); }
.diff-file summary .fn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-code); }
.diff-file summary .add { color: #1a7f37; }
.diff-file summary .del { color: #cf222e; }
pre.diff { margin: 0; font-size: 12px; line-height: 1.5; overflow-x: auto; font-family: var(--font-code); }
pre.diff > div { padding: 0 10px; white-space: pre; min-height: 18px; }
pre.diff .add { background: #e6ffec; }
pre.diff .del { background: #ffebe9; }
pre.diff .hunk { background: #ddf4ff; color: #57606a; }
:root[data-theme="dark"] pre.diff .add { background: #12261e; }
:root[data-theme="dark"] pre.diff .del { background: #2d1517; }
:root[data-theme="dark"] pre.diff .hunk { background: #121d2f; color: #8b949e; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) pre.diff .add { background: #12261e; }
  :root:not([data-theme="light"]) pre.diff .del { background: #2d1517; }
  :root:not([data-theme="light"]) pre.diff .hunk { background: #121d2f; color: #8b949e; }
}
.repo-list { max-height: 380px; overflow: auto; margin-top: 10px; }
.repo-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.repo-row:hover { background: var(--fill); }
.repo-row .grow { flex: 1; min-width: 0; }
.repo-row .faint { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 专家团成员的实时步骤（缩进在「分派子任务」下面） */
.sub-steps { margin: 0 0 4px 26px; padding-left: 12px; border-left: 2px solid var(--border-2); }
.step.sub { font-size: 13px; padding-top: 3px; padding-bottom: 3px; }
.step.sub .lbl { color: var(--muted); }
/* 外发确认：更醒目 */
.approval.outbound { border-color: color-mix(in srgb, var(--warn) 55%, transparent); background: color-mix(in srgb, var(--warn) 7%, var(--card)); }
.approval.outbound h4 { color: var(--warn); }
/* 评测：多次运行结果不一致 / 评委分歧 */
.eval-cell.warn, .warn-text { color: #9a6700; }
:root[data-theme="dark"] .eval-cell.warn, :root[data-theme="dark"] .warn-text { color: #d29922; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .eval-cell.warn, :root:not([data-theme="light"]) .warn-text { color: #d29922; }
}
/* 技能沉淀建议 */
.skill-sug { margin: 14px 0 6px; padding: 14px 16px; border-color: var(--border); background: var(--card); }
.skill-sug .sug-head { display: flex; align-items: center; gap: 8px; }
.skill-sug .sug-acts { display: flex; gap: 8px; }
.sug-preview { max-height: 52vh; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }
a.art-card { color: inherit; text-decoration: none; }
/* ask_user 提问卡片 */
.ask-card h4 .ic { color: var(--accent); }
.ask-card .ask-q { margin: 10px 0 4px; }
.ask-card .ask-q .q { font-weight: 500; margin-bottom: 8px; }
.ask-card .ask-q .q .faint { font-weight: 400; font-size: 12px; margin-left: 4px; }
.ask-card .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.ask-card .chip { border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; }
.ask-card .chip:hover:not(:disabled) { border-color: var(--accent); }
.ask-card .chip.on { border-color: var(--accent); background: var(--accent); color: var(--accent-text); }
.ask-card .ask-q input { width: 100%; box-sizing: border-box; }
.ask-card.answered { opacity: .65; }
/* 项目空间 */
.proj-grid { display: grid; }
.proj-card { display: flex; gap: 12px; align-items: flex-start; text-decoration: none; }
.proj-ic { font-size: 26px; line-height: 1; }
.proj-ins { font-size: 12px; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.proj-task { display: flex; align-items: center; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.proj-task:last-child { border-bottom: 0; }
.proj-task:hover { background: var(--accent-soft); }
.proj-banner { margin-bottom: 8px; }
.pre-wrap { white-space: pre-wrap; font-size: 14px; }
.pill.ok { color: var(--viz-good); border-color: currentColor; }
/* 自动记住的记忆 */
.auto-mem { display: flex; border-bottom: 1px solid var(--border); font-size: 13px; }
.auto-mem:last-child { border-bottom: 0; }
.corr-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.7; max-height: 320px; overflow: auto; }
/* 浏览器操作步骤里的截图 */
.step .browser-shot { display: block; max-width: min(300px, 100%); margin-top: 6px; border: 1px solid var(--border); border-radius: 8px; cursor: zoom-in; }
/* 团队记忆审核 */
.tm-item { padding: 12px 14px; }
.tm-row { display: flex; gap: 10px; align-items: flex-start; }
.tm-row .tm-sel { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; max-width: 220px; }
.tm-meta { font-size: 12px; margin: 6px 0; }
.tm-item .acts { display: flex; gap: 8px; }
/* 组织与用户 */
.org-grid { align-items: start; }
.org-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.org-head h3 { margin: 0; }
.org-dept { display: flex; gap: 8px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.org-dept:hover { background: var(--accent-soft); }
.org-dept.active { background: var(--accent-soft); font-weight: 600; }
/* 技能闭环：使用统计、试跑对比、版本 */
.skill-stat { font-size: 12px; margin: 6px 0 2px; }
.skill-stats { margin: -4px 0 10px; display: flex; flex-direction: column; gap: 2px; }
.trial-box:empty { display: none; }
.trial-box { margin: 0 0 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.trial-line { display: flex; align-items: center; gap: 8px; }
.trial-items { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.trial-items li { display: flex; gap: 14px; align-items: center; color: var(--muted); }
.trial-items li .ellipsis { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trial-cell { white-space: nowrap; }
.spinner { width: 12px; height: 12px; border: 2px solid var(--border); border-top-color: var(--text); border-radius: 50%; animation: spin 0.8s linear infinite; flex: none; }
.sug-file summary { cursor: pointer; font-size: 13px; padding: 3px 0; }
.sug-file pre { max-height: 260px; overflow: auto; }
.ver-list { list-style: none; margin: 0; padding: 0; }
.ver-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.skill-flag-row td { vertical-align: top; }
.spark { display: inline-flex; align-items: flex-end; gap: 2px; height: 20px; }
.spark i { display: block; width: 5px; border-radius: 1px; }
.step.steer { background: var(--fill); border-radius: 8px; padding: 6px 8px; }
.step.steer b { font-weight: 600; margin-right: 4px; }
.pages figcaption { display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn.xs { line-height: 20px; }
.anno { margin: 6px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.anno textarea { width: 100%; box-sizing: border-box; font-size: 13px; }
.anno-wrap { position: relative; }
.anno-pop { position: absolute; z-index: 5; }
.hook-line { display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.hook-line code { font-size: 12px; background: var(--fill); padding: 1px 6px; border-radius: 4px; }
.login-shot { width: 100%; aspect-ratio: 1280 / 800; background: var(--fill); border: 1px solid var(--border); border-radius: 8px; cursor: crosshair; object-fit: contain; }
/* ---------------------------------------------------------------- 空状态 */
.empty-state { text-align: center; color: var(--muted); font-size: 13px; display: flex; flex-direction: column; align-items: center; }
.empty-state > .ic { color: var(--faint); }
/* ---------------------------------------------------------------- 管理后台：左侧分组导航 */
.page-inner.admin-layout { max-width: 1400px; display: grid; grid-template-columns: 156px minmax(0, 1fr); align-items: start; }
.admin-rail { display: flex; flex-direction: column; padding-top: 4px; }
.admin-rail .rail-title { padding: 0 10px; }
.admin-rail .rail-group { display: flex; flex-direction: column; gap: 1px; }
.admin-rail .rail-h { color: var(--faint); padding: 0 10px 4px; }
.admin-rail a { display: flex; align-items: center; gap: 8px; padding: 0 10px; color: var(--muted); text-decoration: none; transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease); }
.admin-rail a .ic { color: var(--faint); }
.admin-rail a:hover { background: var(--hover-w); color: var(--text); }
.admin-rail a.active { color: var(--text); }
.admin-rail a.active .ic { color: var(--text); }
@media (max-width: 1000px) {
  .page-inner.admin-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .admin-rail { position: static; flex-direction: row; overflow-x: auto; gap: 2px; scrollbar-width: none; padding-bottom: 4px; border-bottom: 1px solid var(--border-2); }
  .admin-rail .rail-title, .admin-rail .rail-h { display: none; }
  .admin-rail .rail-group { flex-direction: row; gap: 2px; }
  .admin-rail a { white-space: nowrap; flex-shrink: 0; }
}
.admin-main .kpi-row { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.admin-main .tbl .ellipsis, .admin-main .tbl a.ellipsis { max-width: 200px; }
.admin-main .tbl th, .admin-main .tbl td { padding-left: 8px; padding-right: 8px; }
.form label.chk { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; }
.org-head { min-height: 30px; }
/* ---------------------------------------------------------------- 三栏拖拽条 */
.col-resizer { position: absolute; top: 8px; bottom: 8px; width: 10px; z-index: 20; cursor: col-resize; touch-action: none; outline: none; }
.col-resizer.over { z-index: 26; position: fixed; }
.col-resizer::after { content: ""; position: absolute; left: 4px; top: 50%; width: 2px; height: 36px; margin-top: -18px; border-radius: 2px;
  background: var(--border); opacity: 0; transition: opacity var(--dur-1) var(--ease), background var(--dur-1) var(--ease), height var(--dur-1) var(--ease), margin-top var(--dur-1) var(--ease); }
.col-resizer:hover::after, .col-resizer:focus-visible::after { opacity: 1; background: var(--faint); }
.col-resizer.active::after { opacity: 1; background: var(--link); top: 0; height: 100%; margin-top: 0; }
body.col-resizing { cursor: col-resize; user-select: none; }
body.col-resizing iframe, body.col-resizing #main, body.col-resizing #panel { pointer-events: none; }
/* ---------------------------------------------------------------- 设置：一行一项 */
.srows { padding-top: 4px; padding-bottom: 4px; }
.srow { display: flex; align-items: center; gap: 24px; border-bottom: 1px solid var(--border-2); }
.srow:last-child { border-bottom: none; }
.srow .sl { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.srow .sc { flex-shrink: 0; display: flex; align-items: center; justify-content: flex-end; }
.srow .sc select { width: 220px; }
.settings-layout .section > h3:first-child { display: none; }
.settings-layout .section { margin-bottom: 0; }
.settings-layout .section textarea { margin-top: 6px; }
@media (max-width: 760px) {
  .srow { flex-direction: column; align-items: stretch; gap: 8px; }
  .srow .sc { justify-content: flex-start; }
  .srow .sc select { width: 100%; }
}
.grid > .empty-state, .list > .empty-state { grid-column: 1 / -1; }
/* ---------------------------------------------------------------- 全站图标按钮：即时悬停提示（title 在悬停时转成 data-tip） */
.icon-btn[data-tip] { position: relative; }
.icon-btn[data-tip]:is(:hover, :focus-visible)::before { content: attr(data-tip); position: absolute; left: 50%; transform: translateX(-50%); z-index: 60; pointer-events: none; white-space: nowrap;
  background: var(--tip-bg); color: var(--tip-fg); font-size: 12px; line-height: 1.4; padding: 5px 8px; border-radius: 6px; font-weight: normal;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18); top: calc(100% + 6px); }
.icon-btn[data-tip][data-tip-pos~="above"]:is(:hover, :focus-visible)::before { top: auto; bottom: calc(100% + 6px); }
.icon-btn[data-tip][data-tip-pos~="right"]:is(:hover, :focus-visible)::before { left: auto; right: 0; transform: none; }
.icon-btn[data-tip][data-tip-pos~="left"]:is(:hover, :focus-visible)::before { left: 0; transform: none; }
.icon-btn[data-tip][data-tip-pos~="wrap"]:is(:hover, :focus-visible)::before { white-space: normal; width: max-content; max-width: 260px; text-align: left; }
/* ================================================================ 细节向 Codex 靠：更小的字号、更轻的边框和阴影、状态放在行首 */
/* 侧边栏行：状态位在左（固定宽，标题对齐），短时间在右 */
.task-item { gap: 6px; }
.task-item .lead { width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; margin-left: -2px; }
.task-item .lead:empty { display: none; }
.task-item.nested .lead:empty, .task-list:has(.lead:not(:empty)) .task-item .lead:empty { display: inline-flex; }
.task-item .ring { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--border); border-top-color: var(--muted); animation: spin .9s linear infinite; }
.task-item .sdot { width: 7px; height: 7px; border-radius: 50%; }
.task-item .sdot.warn { background: #d97706; }
.task-item .sdot.bad { background: var(--danger); }
.task-item .sdot.new { background: var(--link); }
.task-item .pin { color: var(--faint); margin: 0; }
.task-item .meta { color: var(--faint); }
.task-item .meta.warn { color: #b45309; }
:root[data-theme="dark"] .task-item .meta.warn { color: #f0b056; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .task-item .meta.warn { color: #f0b056; }
}
.task-item:hover .meta { display: none; }
.task-group { gap: 3px; }
.task-group .ic { opacity: 0; transition: opacity var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); }
.task-group:hover .ic, .task-group.shut .ic { opacity: 1; }
/* 对话区：正文 14px，标题、气泡、步骤都收一档 */
.md h1 { font-size: 18px; }
.md h2 { font-size: 16px; }
.md h3 { font-size: 15px; }
.md h4 { font-size: 14px; }
.md pre, .md code { font-size: 12.5px; }
.md table { font-size: 13px; }
.u-msg .b { line-height: 1.65; }
.task-head { padding-top: 8px; padding-bottom: 6px; }
/* 输入框：字号 14px，首页阴影更淡 */
/* 菜单：更紧凑、边框更细、阴影更轻 */
.menu .mi { border-radius: 6px; }
.menu .mh { font-size: 11.5px; padding: 6px 10px 2px; }
/* 卡片与按钮：圆角收小，按钮字号 13px */
/* ---------------------------------------------------------------- 专家 / 技能 / 连接器：统一字号层级（12 / 13 / 14 / 18） */
.hub-tabs { gap: 20px; }
.hub-tabs a { gap: 6px; }
.hub-tabs a .ic svg { width: 16px; height: 16px; }
.search-box input { font-size: 13px; border-radius: 8px; }
.search-box .ic svg { width: 16px; height: 16px; }
.btn.lg { border-radius: 8px; }
.btn.lg .ic svg { width: 16px; height: 16px; }
.bcard .top b { font-weight: 600; }
.sub-head .stabs { gap: 18px; }
.sub-head .stabs a { font-size: 14px; }
.sub-head .stabs a.active { font-weight: 600; }
.seg-soft button { height: 28px; padding: 0 12px; }
.gcard .av { width: 40px; height: 40px; font-size: 21px; border-radius: 10px; }
.gcard .tags .tag { line-height: 20px; padding: 0 7px; }
.gcard .ft { min-height: 36px; font-size: 12px; }
.hub-sub, .page .sub { font-size: 12px; }
/* 虚拟桌面（桌面 RPA）：实时画面 + 接管 */
.desk-modal { display: flex; flex-direction: column; gap: 10px; }
.desk-modal .desk-screen { position: relative; background: #111; border-radius: 10px; overflow: hidden; height: min(52vh, 540px); }
.desk-modal .desk-screen img { display: block; width: 100%; height: 100%; object-fit: contain; cursor: crosshair; }
.desk-modal .desk-screen .desk-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #ccc; font-size: 14px; gap: 10px; text-align: center; padding: 20px; }
.desk-modal .desk-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.desk-modal .desk-bar input { flex: 1; min-width: 160px; }
.desk-modal .desk-hint { color: var(--muted); font-size: 12px; }
/* 灰度发布 */
.rollout-card { margin-bottom: 12px; }
.rollout-card .badge { font-size: 12px; }
.rollout-card .tbl td.num { white-space: nowrap; }
/* 组织策略：外发规则 */
.outbound-rules { display: grid; gap: 6px; }
.outbound-rules label { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.outbound-rules label span { flex: 1; }
.outbound-rules select { min-width: 160px; }
.check-inline { display: flex; align-items: center; gap: 6px; font-size: 13px; }
/* 主动规则页 */
.inline-sel { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.inline-sel select { padding: 4px 8px; }
/* 待办收件箱 */
.count-badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 9px; font-size: 11px; line-height: 18px; text-align: center; }
.inbox-group { margin: 14px 0 6px; font-size: 13px; color: var(--faint); font-weight: 600; }
.inbox-item .nm { text-decoration: none; color: var(--text); }
.accept-bar { display: flex; align-items: center; gap: 8px; margin: 0 16px 8px; padding: 8px 12px; border: 1px solid var(--border); font-size: 13px; }
/* 手机宽度：策略表单单列，外发规则的下拉占满一行 */
@media (max-width: 760px) {
  .policy-kv { grid-template-columns: 1fr !important; }
  .policy-kv textarea, .policy-kv input[type=number] { max-width: none; }
  .outbound-rules label { flex-wrap: wrap; }
  .outbound-rules select { min-width: 0; width: 100%; }
  .accept-bar { flex-wrap: wrap; }
}
/* ================================================================ 来自 workspace.css */
/* Workspace presentation layer: shared rhythm, neutral surfaces and compact controls. */


button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease); }
:where(button, a, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--muted); outline-offset: 3px; }
input, select, textarea { border-radius: 8px; }
input:focus-visible, select:focus-visible { border-color: var(--muted); }
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
#app { grid-template-columns: var(--side-w, 248px) minmax(0, 1fr) auto; height: 100dvh; padding: 8px 8px 8px 0; gap: 0 8px; }
#main { border: 1px solid var(--border-2); border-radius: 12px; box-shadow: var(--shadow-sm); }
#side { padding: 8px 0 2px; }
.side-backdrop { display: none; }
.side-top { align-items: center; padding: 0 14px 0 18px; gap: 8px; }
.brand { display: grid; align-items: center; line-height: 1.25; }
.brand-mark { grid-row: span 2; display: grid; place-items: center; background: var(--accent); color: var(--accent-text); font-weight: 600; font-family: var(--font-code); }
.brand small { margin-top: 2px; color: var(--muted); }
.side-top .icon-btn { width: 28px; min-width: 28px; height: 28px; }
.side-nav { padding: 0 10px; }
.side-nav a, .side-nav > button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 0 12px; border: 0; background: transparent; color: var(--muted); text-align: left; font-size: 13px; font-weight: 400; cursor: pointer; }
.side-nav a .ic, .side-nav > button .ic { color: var(--muted); }
.side-nav a:hover, .side-nav > button:hover, .side-nav > button.on { background: var(--hover); color: var(--text); }
.side-nav a.active { background: var(--active); color: var(--text); font-weight: var(--font-weight-medium); }
.side-nav #newTask { color: var(--text); border: 1px solid var(--border); font-weight: 400; margin-bottom: 2px; }
.side-nav .nav-end, .side-nav kbd { margin-left: auto; }
.side-nav kbd { font-family: inherit; font-size: 11px; color: var(--faint); }
.nav-label { padding: 20px 12px 6px; font-size: 11px; color: var(--faint); }
.side-list-tools { display: flex; align-items: center; gap: 6px; padding: 16px 18px 0 22px; font-size: 11px; color: var(--faint); }
.side-list-tools > span:first-child { flex: 1; }
.side-list-tools .icon-btn { min-width: 26px; height: 26px; }
.filter-anchor { position: relative; }
.filter-anchor .menu { left: auto; right: 0; min-width: 180px; }
.task-list { padding: 0 10px 20px; }
.task-group { font-size: 11px; padding: 14px 12px 5px; }
.task-group:first-child { padding-top: 7px; }
.task-group .add { opacity: 1; color: var(--faint); }
.task-empty { padding: 7px 12px 12px; }
.task-item, .proj-item { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 7px; }
.side-foot { margin: 0 12px; padding: 12px 2px 4px; border-top: 1px solid var(--border-2); gap: 2px; }
.side-foot .avatar { border-radius: 8px; background: var(--fill-2); color: var(--text); }
.side-foot .uname { margin-left: 6px; }
.side-foot .icon-btn { min-width: 28px; }
.side-open { top: 21px; }
.home-topbar { flex-shrink: 0; display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 24px; font-size: 13px; font-weight: 500; }
.home-topbar-note { margin-left: auto; color: var(--faint); font-size: 11px; font-weight: 400; }
#app.side-collapsed .home-topbar { padding-left: 56px; }
.home { align-items: center; }
.home-content { width: 100%; }
.home-heading { text-align: center; }
.home-symbol { display: inline-grid; place-items: center; border-radius: 15px; color: var(--text); }
.home h1 { margin: 0; line-height: 1.4; }
.home-heading p { margin: 12px 0 0; color: var(--muted); }
.home .composer-wrap { max-width: none; }
.composer-shell { transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease); }
.home .composer { border: 0; border-bottom: 1px solid var(--border-2); background: var(--panel); }
.composer textarea:focus-visible { outline: none; }
.pick > button { font-size: 12px; gap: 5px; }
.pick > button > span { max-width: 180px; }
.composer-tray { flex-wrap: wrap; }
.send.idle { background: var(--fill-2); color: var(--faint); }
.compose-hint { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; padding: 10px 4px 0; color: var(--faint); }
.scenes { max-width: none; }
.scene-heading { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 8px; }
.scene-tabs { background: transparent; }
.scene-tabs button.active { background: var(--fill); }
.template-more { display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 6px; background: transparent; color: var(--faint); font-size: 11px; padding: 5px 6px; cursor: pointer; white-space: nowrap; }
.template-more:hover { color: var(--text); background: var(--fill); }
.template-more[aria-expanded="true"] .ic { transform: rotate(180deg); }
.tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tpl { align-items: center; gap: 12px; background: var(--panel); }
.tpl:hover { border-color: var(--border); background: var(--fill); }
.tpl .ti { display: grid; place-items: center; width: 32px; height: 32px; color: var(--muted); border-radius: 8px; }
.tpl .tt { flex: 1; gap: 3px; }
.tpl .tt b { line-height: 1.5; }
.tpl .tt small { white-space: normal; overflow: visible; color: var(--muted); }
.template-arrow { color: var(--faint); transform: rotate(45deg); opacity: 0; transition: opacity var(--dur-1) var(--ease); }
.tpl:hover .template-arrow, .tpl:focus-visible .template-arrow { opacity: 1; }
.home .home-foot { font-size: 10px; letter-spacing: .2px; }
.msgs { padding: 24px 32px; }
.msgs-inner, .task-foot .composer, .queue { max-width: 800px; }
.task-foot .disclaimer { margin-top: 10px; }
.md { font-size: 14px; line-height: 1.85; }
.md p { margin: 0 0 14px; }
.u-msg { margin: 0 0 28px; }
.turn { margin-bottom: 32px; }
details.process > summary { color: var(--muted); font-size: 12px; padding-top: 8px; padding-bottom: 8px; }
.panel-tabs > button[data-tab] { font-size: 12px; }
.gcard { gap: 14px; }
.gcard .av[class] { background: var(--fill); border-radius: 10px; }
.gcard .ds { white-space: normal; color: var(--muted); }
.gcard .summon { opacity: 1; transform: none; font-size: 12px; }
.gcard .tags .tag { font-size: 11px; background: var(--fill); }
.hub-tabs a { font-size: 19px; font-weight: 400; }
.hub-tabs a.active { font-weight: var(--font-weight-medium); }
.hub-head { margin-bottom: 26px; }
.bcard { border: 1px solid var(--border-2); background: var(--fill); border-radius: 10px; box-shadow: none; }
.bcard .top { background: var(--fill) !important; }
.bcard .top b { font-size: 14px; color: var(--text); }
.bcard .links { border-top: 1px solid var(--border-2); background: var(--panel); }
.btn { border-color: var(--border); }
.menu { border-color: var(--border); }
.menu .mi { padding: 8px 10px; }
.settings-nav { gap: 4px; }
.srow { padding-top: 20px; padding-bottom: 20px; }
.srow .sl small { color: var(--muted); }
.switch span::before { background: var(--panel); }
@media (max-width: 1100px) {
  .home { padding-top: 48px; }
  .page { padding: 28px; }
  .pick > button > span { max-width: 140px; }
}
@media (max-width: 760px) {
  #app { display: flex; padding: 0; gap: 0; height: 100dvh; }
  #main { flex: 1; border: 0; border-radius: 0; }
  #side { width: min(280px, 85vw); padding-top: 18px; z-index: 30; box-shadow: none; }
  #app.side-collapsed #side.open { visibility: visible; }
  #app:has(#side.open) .side-backdrop { display: block; position: fixed; inset: 0; z-index: 25; border: 0; border-radius: 0; background: #0003; backdrop-filter: blur(2px); cursor: pointer; }
  .home-topbar { padding: 0 16px; height: 54px; }
  .home-topbar-note { display: none; }
  .home { padding: 36px 20px 20px; }
  .home-heading { margin-bottom: 25px; }
  .home-symbol { margin-bottom: 16px; width: 42px; height: 42px; border-radius: 12px; }
  .home h1 { font-size: 26px; }
  .home-heading p { font-size: 12px; }
  .home .composer textarea { min-height: 92px; }
  .pick > button { min-width: 28px; padding: 0 5px; gap: 3px; }
  .pick > button > span { max-width: 96px; }
  .compose-hint { font-size: 10px; }
  .compose-hint > span { display: none; }
  .scenes { margin-top: 28px; }
  .scene-tabs { gap: 0; }
  .scene-tabs button { font-size: 11px; padding: 0 7px; gap: 4px; }
  .scene-tabs .ic svg { width: 16px; height: 16px; }
  .template-more { font-size: 10px; gap: 2px; padding: 5px 0; }
  .tpl-grid { gap: 8px; }
  .tpl { padding: 13px 11px; gap: 8px; align-items: flex-start; }
  .tpl .ti { width: 24px; height: 26px; background: transparent; }
  .tpl .tt b { font-size: 12px; }
  .tpl .tt small { font-size: 10px; }
  .template-arrow { display: none; }
  .home .home-foot { padding-top: 32px; }
  .page { padding: 24px 20px; }
  .msgs { padding: 20px 16px; }
  .side-foot .icon-btn { width: 32px; min-width: 32px; height: 32px; }
}
@media (max-width: 380px) {
  .home { padding-left: 14px; padding-right: 14px; }
  .tpl-grid { grid-template-columns: 1fr; }
  .scene-tabs button { padding: 0 5px; }
  .composer .bar .pick > button > span { max-width: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
/* Feature pages: one heading, one action area, predictable section spacing. */
.page-actions { display: flex; align-items: center; flex-wrap: wrap; }
.page-head { align-items: flex-start; }
.page-head > div:first-child { min-width: min(200px, 100%); }
.page-head > .btn { margin-top: 3px; }
.page .sub { max-width: 740px; }
.hub-header .hub-tabs { min-width: 0; border-bottom: 1px solid var(--border-2); }
.hub-header .hub-tabs a { position: relative; padding: 0 0 12px; font-size: 13px; gap: 7px; }
.hub-header .hub-tabs a.active::after { content: ""; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; border-radius: 2px; background: var(--text); }
.page-actions .search-box input { background: var(--panel); }
.page-actions .btn { height: 32px; }
.banner-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.bcard .top { height: 62px; padding: 14px 16px; align-items: center; }
.bcard .top .emo { font-size: 22px; }
.bcard .links { padding: 8px 16px 12px; }
.bcard .links a { font-size: 12px; height: 28px; }
.sub-head { flex-wrap: wrap; gap: 10px 16px; margin-bottom: 16px; }
.sub-head .stabs { flex: 1 0 auto; }
.sub-head > .faint { flex: 1 1 200px; font-size: 12px !important; line-height: 1.7; }
.gcard { min-width: 0; }
.gcard .cat { overflow-wrap: anywhere; line-height: 1.65; }
.gcard .ft { flex-wrap: wrap; }
.gcard .ds.two { min-height: 3.5em; line-height: 1.75; }
.empty-state { gap: 12px; }
.empty-symbol { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 2px; }
.empty-state h3 { color: var(--text); }
.empty-state > .btn { margin-top: 8px; }
.card .empty-state { border: 0; min-height: 170px; padding: 28px 12px; }
.grid > .faint:only-child, .list > .faint:only-child { grid-column: 1 / -1; padding: 24px; border: 1px solid var(--border-2); border-radius: 10px; font-size: 12px; line-height: 1.8; }
.sug-list { border: 1px solid var(--border-2); border-radius: 10px; background: var(--fill); margin-bottom: 24px; padding: 0 16px; }
.sug-list > summary { display: flex; align-items: center; gap: 9px; list-style: none; cursor: pointer; min-height: 48px; font-size: 12px; }
.sug-list > summary::-webkit-details-marker { display: none; }
.sug-list > summary b { font-weight: 500; }
.sug-list[open] > summary > .ic:last-child { transform: rotate(180deg); }
.sug-list .skill-sug { background: var(--panel); }
.sug-list .skill-sug:last-child { margin-bottom: 16px; }
.sug-acts { flex-wrap: wrap; }
.section-toolbar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.section-toolbar > .faint { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; padding-top: 6px; }
.proj-grid { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.proj-card { color: var(--text); transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease); }
.proj-card:hover { background: var(--fill); border-color: var(--border); }
.proj-card .grow { min-width: 0; }
.proj-card b { font-weight: var(--font-weight-medium); overflow-wrap: anywhere; }
.proj-ins { line-height: 1.8; }
.proj-task { padding: 12px 8px; gap: 12px; }
.pre-wrap, .auto-mem, .tm-meta { overflow-wrap: anywhere; }
.auto-mem { gap: 14px; padding: 16px 0; align-items: flex-start; border-color: var(--border-2); }
.auto-mem > .grow { min-width: 0; }
.auto-mem b { font-weight: var(--font-weight-medium); }
.settings-layout textarea { line-height: 1.85; padding: 14px; }
.settings-layout .kv { font-size: 13px; line-height: 1.8; }
.settings-layout .section > .muted { line-height: 1.9; }
.section-picker { display: none; }
.page-inner.admin-layout { gap: 24px; }
.admin-rail { gap: 20px; }
.admin-rail .rail-title { color: var(--text); }
.admin-main > .page-head { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--border-2); }
.filter-row { font-size: 12px; }
.filter-row > select, .filter-row > input { max-width: 100%; min-height: 32px; font-size: 12px; }
.filter-row .seg { display: flex; flex-wrap: wrap; }
.filter-row .seg button { font-size: 12px; }
.filter-row .chk { font-size: 11px; color: var(--muted); }
.admin-main .kpi-row { display: flex; flex-wrap: wrap; gap: 12px; }
.admin-main .kpi { flex: 1 1 180px; min-width: 0; min-height: 114px; padding: 16px; }
.kpi-label { font-size: 11px; line-height: 1.5; }
.admin-main .kpi-value { margin: 7px 0; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 11px; line-height: 1.7; }
.viz-card { padding: 18px; }
.viz-head h3 { font-size: 13px; font-weight: var(--font-weight-medium); }
.tbl-wrap { max-width: 100%; border: 1px solid var(--border-2); border-radius: 9px; background: var(--card); overscroll-behavior-x: contain; }
.tbl th { background: var(--fill); }
.tbl td, .tbl th, .admin-main .tbl td, .admin-main .tbl th { padding: 11px 12px; line-height: 1.65; }
.tbl td.tbl-empty { padding: 40px 20px; font-size: 12px; }
.tbl .acts { flex-wrap: wrap; }
.tbl td input, .tbl td select { font-size: 12px; }
.log-box { border: 1px solid var(--border); background: var(--code); color: var(--text); font-size: 11px; line-height: 1.8; }
.log-line { gap: 8px; }
.log-line > :last-child { min-width: 0; overflow-wrap: anywhere; }
.form { gap: 18px; }
.form label > b { font-size: 12px; font-weight: var(--font-weight-medium); }
.form input:not([type="checkbox"]), .form select { min-height: 36px; min-width: 0; }
.form .faint { font-size: 11px; line-height: 1.8; }
.form .row { gap: 12px; }
.form .row > .project-icon-field { min-width: 64px; }
.modal-foot { flex-wrap: wrap; }
@media (max-width: 1100px) {
  .banner-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hub-header .page-head { flex-direction: column; }
  .page-actions { width: 100%; }
}
@media (max-width: 1000px) {
  .section-picker { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 12px; white-space: nowrap; padding-bottom: 16px; border-bottom: 1px solid var(--border-2); }
  .section-picker select { flex: 1; min-width: 0; background: var(--fill); border-color: transparent; }
  .admin-layout > .admin-rail { display: none; }
  .page-inner.admin-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 760px) {
  .page-menu { margin: -8px 0 20px -6px; }
  .page h1 { font-size: 22px; }
  .page-head { flex-direction: column; gap: 14px; margin-bottom: 24px; }
  .page-head > div:first-child { width: 100%; }
  .page-actions { gap: 8px; }
  .page-actions .search-box { flex-basis: 100%; }
  .page-actions .search-box input { width: 100%; }
  .hub-header .hub-tabs { flex-basis: auto; }
  .hub-header .page-head { margin-bottom: 20px; }
  .banner-row { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; overflow: visible; }
  .bcard .top { height: auto; min-height: 50px; padding: 10px 12px; }
  .bcard .top b { font-size: 12px; }
  .bcard .top .emo { font-size: 18px; }
  .bcard .links { padding: 8px 12px; }
  .bcard .links a { font-size: 11px; }
  .sub-head { align-items: flex-start; }
  .sub-head > .faint { flex-basis: 100%; order: 1; }
  .empty-state { min-height: 220px; padding: 30px 20px; }
  .sug-list { padding: 0 12px; }
  .sug-list > summary { font-size: 11px; gap: 6px; }
  .sug-list > summary > .faint { display: none; }
  .sug-list .skill-sug { padding: 14px; }
  .sug-head { align-items: flex-start; }
  .auto-mem { flex-wrap: wrap; }
  .auto-mem > .grow { flex-basis: 100%; }
  .lcard { flex-wrap: wrap; gap: 10px; }
  .lcard > .main { flex-basis: calc(100% - 60px); }
  .tm-row { flex-direction: column; }
  .tm-row .tm-sel { max-width: none; width: 100%; flex-direction: row; flex-wrap: wrap; }
  .tm-sel select { min-width: 0; flex: 1; }
  .admin-main .kpi { flex-basis: calc(50% - 6px); padding: 14px; }
  .filter-row > input:not([type="checkbox"]), .filter-row > select { flex: 1 1 140px; min-width: 0; width: 100%; }
  .filter-row .seg { width: 100%; }
  .filter-row .seg button { flex: 1; padding-left: 7px; padding-right: 7px; white-space: nowrap; }
  .filter-row > .grow { display: none; }
  .tbl td, .tbl th { white-space: nowrap; }
  .tbl .acts { flex-wrap: nowrap; }
  .log-line { flex-wrap: wrap; }
  .log-line > :last-child { flex-basis: 100%; }
  .modal-card { padding: 20px; max-height: calc(100dvh - 24px); }
  #modal { padding: 12px; }
  .form .row > * { min-width: min(140px, 100%); }
}
/* Conversations: results first, execution details on demand. */
.conversation { scroll-padding-top: 24px; }
.conversation .turn { margin: 0 0 42px; min-width: 0; }
.conversation .who { gap: 9px; min-height: 25px; }
.assistant-mark { display: inline-grid; place-items: center; width: 25px; height: 25px; border: 1px solid var(--border-2); border-radius: 8px; color: var(--text); }
.assistant-name { color: var(--text); font-weight: var(--font-weight-medium); font-size: 12px; }
.turn-status { color: var(--faint); font-size: 12px; margin-left: auto; }
.turn[data-status="failed"] .turn-status { color: var(--danger); }
.turn[data-status="waiting"] .turn-status { color: var(--warn); }
.conversation details.process { border-bottom: 1px solid var(--border-2); padding-bottom: 10px; }
.conversation details.process > summary { display: flex; width: fit-content; max-width: 100%; padding: 4px 0; gap: 8px; }
.conversation .sum-text { min-width: 0; overflow-wrap: anywhere; }
.process-count { color: var(--faint); font-size: 12px; white-space: nowrap; }
.conversation .steps { margin: 12px 0 2px 5px; padding-left: 16px; }
.conversation .step { padding: 9px 0; align-items: flex-start; gap: 9px; }
.conversation .step > .ic { margin-top: 3px; color: var(--faint); }
.conversation .step-d > summary { min-height: 22px; }
.conversation .step-d .lbl { font-weight: 500; }
.conversation .step-d > summary > .ic { opacity: .65; margin-left: auto; flex-shrink: 0; }
.tool-outcome { font-size: 12px; color: var(--muted); line-height: 1.65; margin: 3px 0 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tool-detail-label { font-size: 12px; color: var(--faint); margin-top: 12px; }
.conversation .step pre { padding: 12px; border: 1px solid var(--border-2); font-size: 12px; max-height: 240px; }
.conversation .has-error .tool-outcome { color: var(--danger); }
.conversation .browser-shot { max-height: 160px; object-fit: contain; object-position: left; margin-top: 8px; }
.conversation .final { color: var(--text); }
.conversation .final p { margin: 0 0 16px; }
.conversation .final .response-lead { margin-bottom: 22px; }
.conversation .final h1 { font-size: 22px; }
.conversation .final h2 { font-size: 18px; }
.conversation .final h3 { font-size: 15px; }
.conversation .final h1, .conversation .final h2, .conversation .final h3 { margin: 28px 0 12px; font-weight: 600; letter-spacing: -.2px; scroll-margin-top: 24px; }
.conversation .final > :first-child { margin-top: 0; }
.conversation .final strong { font-weight: var(--font-weight-semibold); }
.conversation .final ul, .conversation .final ol { padding-left: 22px; margin: 10px 0 20px; }
.conversation .final li { padding-left: 3px; margin: 7px 0; }
.conversation .final li > p { margin-bottom: 8px; }
.conversation .final blockquote { border-left: 2px solid var(--border); padding: 10px 16px; background: var(--fill); border-radius: 0 8px 8px 0; margin: 18px 0; }
.conversation .final blockquote p:last-child { margin: 0; }
.conversation .final hr { margin: 26px 0; border-color: var(--border-2); }
.response-outline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 22px; padding: 10px 0; border-bottom: 1px solid var(--border-2); }
.response-outline > span { font-size: 12px; color: var(--faint); margin-right: 3px; }
.response-outline button { border: 0; background: var(--fill); color: var(--muted); padding: 5px 8px; border-radius: 6px; font-size: 12px; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.response-outline button:hover { background: var(--hover); color: var(--text); }
.response-table { max-width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; margin: 18px 0 22px; }
.conversation .response-table table { display: table; width: 100%; margin: 0; font-size: 12px; border-collapse: separate; border-spacing: 0; }
.conversation .response-table th, .conversation .response-table td { border: 0; border-bottom: 1px solid var(--border-2); padding: 11px 14px; text-align: left; min-width: 95px; }
.conversation .response-table tr:last-child td { border-bottom: 0; }
.conversation .response-table th { font-size: 12px; font-weight: var(--font-weight-medium); white-space: nowrap; }
.conversation .response-table tbody tr:hover { background: var(--hover-w); }
.conversation .code-wrap { border: 1px solid var(--border-2); overflow: hidden; margin: 18px 0; background: var(--code); }
.conversation .code-bar { position: static; padding: 6px 10px 6px 14px; min-height: 34px; border-bottom: 1px solid var(--border-2); }
.conversation .code-wrap pre, .conversation .code-wrap.has-lang pre { padding: 14px; border-radius: 0; font-size: 12px; }
.response-extras { margin-top: 18px; }
.response-extras:empty { display: none; }
.deliverables { margin: 20px 0 12px; }
.deliverables-title { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; margin-bottom: 9px; }
.conversation .art-cards { margin-top: 0; grid-template-columns: repeat(auto-fit, minmax(min(310px, 100%), 1fr)); }
.conversation .art-card { min-width: 0; height: auto; background: var(--panel); }
.conversation .art-card:hover { background: var(--fill); border-color: var(--border); }
.conversation .art-card .nm { font-weight: var(--font-weight-medium); overflow-wrap: anywhere; line-height: 1.5; }
.conversation .art-card .meta { margin-top: 4px; }
.conversation .art-card .icon-btn { width: 28px; min-width: 28px; height: 28px; }
.conversation .see-all { margin: 10px 0 0; }
.conversation .msg-actions { margin-top: 18px; padding-top: 10px; gap: 6px; opacity: 1; }
.conversation .msg-actions .icon-btn { color: var(--faint); width: 28px; height: 28px; }
.response-error { padding: 16px; border: 1px solid color-mix(in srgb, var(--danger) 25%, var(--border)); margin: 18px 0; background: color-mix(in srgb, var(--danger) 3%, var(--panel)); }
.response-error-title { display: flex; gap: 8px; align-items: center; font-weight: var(--font-weight-medium); color: var(--danger); }
.response-error p { line-height: 1.8; margin: 10px 0; overflow-wrap: anywhere; }
.response-error details { color: var(--muted); margin-bottom: 12px; }
.response-error summary { cursor: pointer; font-size: 12px; }
.response-error pre { max-height: 220px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.response-notice { display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px; background: var(--fill); color: var(--muted); }
.task-foot { position: relative; }
.jump-latest { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--panel); box-shadow: var(--shadow); color: var(--muted); cursor: pointer; font-size: 12px; z-index: 3; }
.conversation-plan { margin: 0 auto 8px; border: 1px solid var(--border-2); border-radius: 12px; background: var(--panel); }
.conversation-plan > summary { display: flex; align-items: center; gap: 8px; padding: 9px 12px; list-style: none; cursor: pointer; font-size: 12px; color: var(--muted); }
.conversation-plan > summary::-webkit-details-marker { display: none; }
.plan-count { font-variant-numeric: tabular-nums; white-space: nowrap; }
.plan-current { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--faint); }
.plan-items { border-top: 1px solid var(--border-2); padding: 8px 12px; max-height: 180px; overflow: auto; }
.plan-items .todo { font-size: 12px; }
@media (max-width: 760px) {
  .task-head { flex-wrap: wrap; }
  .task-head .title { font-size: 12px; }
  .task-head .icon-btn { width: 27px; min-width: 27px; }
  .conversation .final { font-size: 14px; }
  .conversation .final .response-lead { font-size: 14px; }
  .response-outline { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 12px; }
  .response-outline > span, .response-outline button { flex-shrink: 0; }
  .conversation .response-table th, .conversation .response-table td { padding: 10px 12px; }
  .plan-current { display: none; }
  .conversation-plan > summary > .ic:last-child { margin-left: auto; }
}
.conversation .artifact-open { flex: 1; min-width: 0; border: 0; background: transparent; text-align: left; padding: 0; color: var(--text); cursor: pointer; }
.conversation .artifact-open > span { display: block; }
.conversation .turn { scroll-margin-top: 24px; }
.process-warning { color: var(--warn); font-size: 12px; margin-left: 3px; }
/* 任务顶栏：累计用量（token · 费用），没用量时不占位 */
.task-head .run-usage { flex-shrink: 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 760px) {
  .task-head .run-usage { display: none; }
}
/* 工作流：步骤编辑器与运行记录 */
.wf-editor { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 4px; }
.wf-step-card { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.wf-step-head { display: flex; align-items: center; gap: 8px; }
.wf-step-head input { flex: 1; }
.wf-step-head .icon-btn[disabled] { opacity: .35; pointer-events: none; }
.wf-n { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--fill); color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.wf-when { display: flex; gap: 6px; }
.wf-when select { flex: 0 0 auto; }
.wf-when input { flex: 1; min-width: 0; }
.wf-steps { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.wf-step { display: flex; gap: 10px; align-items: flex-start; }
.wf-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wf-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.wf-ans { font-size: 13px; color: var(--muted); white-space: pre-wrap; word-break: break-word; }
.wf-acts { display: flex; gap: 6px; }
.wf-acts:empty { display: none; }
.badge.warn { color: var(--warn); }
/* 管理后台：组织策略 */
.policy-kv { grid-template-columns: 160px 1fr; align-items: start; }
.policy-kv > span { padding-top: 4px; }
.policy-kv textarea, .policy-kv input[type=number] { max-width: 420px; }
.policy-kv .checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
/* 组织与用户：策略表单使用明确的行间距和可换行的选项组。 */
.org-grid { margin-bottom: 16px; }
.org-policy { margin-bottom: 16px; }
.org-policy .org-head { margin-bottom: 10px; }
.org-policy .policy-kv { grid-template-columns: 160px minmax(0, 1fr); column-gap: 24px; row-gap: 0; margin-top: 18px; }
.org-policy .policy-kv > * { min-width: 0; }
.org-policy .policy-kv > span, .org-policy .policy-kv > div, .org-policy .policy-kv > label { padding-top: 16px; padding-bottom: 16px; border-top: 1px solid var(--border); }
.org-policy .policy-kv > input, .org-policy .policy-kv > select { margin: 12px 0; }
.org-policy .policy-kv > span { color: var(--text); font-size: 13px; font-weight: 500; line-height: 20px; }
.org-policy .policy-kv .checks { display: flex; flex-wrap: wrap; gap: 8px; }
.org-policy .checks label { display: inline-flex; align-items: flex-start; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; line-height: 18px; cursor: pointer; overflow-wrap: anywhere; }
.org-policy .checks input, .org-policy .check-inline input { flex: 0 0 auto; margin: 2px 0 0; }
.org-policy .check-inline { align-items: flex-start; gap: 8px; line-height: 20px; }
.org-policy .policy-kv textarea { display: block; width: 100%; max-width: 560px; min-height: 76px; resize: vertical; }
.org-policy .policy-kv input[type=number] { width: 100%; max-width: 420px; }
.org-policy .policy-kv > div > .faint { margin-top: 8px; line-height: 1.6; }
.org-policy .outbound-rules { max-width: 720px; gap: 0; }
.org-policy .outbound-rules label { min-height: 48px; gap: 16px; padding: 6px 0; }
.org-policy .outbound-rules label + label { border-top: 1px solid var(--border); }
.org-policy .policy-actions { padding-top: 16px; border-top: 1px solid var(--border); }
@media (max-width: 1000px) {
  .org-policy .org-head { flex-wrap: wrap; }
  .org-policy .policy-kv { grid-template-columns: minmax(0, 1fr); }
  .org-policy .policy-kv > span { padding: 16px 0 6px; }
  .org-policy .policy-kv > span + div, .org-policy .policy-kv > span + label { border-top: 0; padding: 0 0 16px; }
  .org-policy .policy-kv > input, .org-policy .policy-kv > select { margin: 0 0 16px; }
  .org-policy .outbound-rules label { align-items: stretch; flex-direction: column; gap: 6px; }
}
/* 设置：IM 机器人多平台 */
.im-platform { padding: 10px 0; border-top: 1px solid var(--border); }
.im-platform:first-of-type { border-top: 0; padding-top: 0; }
.im-platform h4 { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
/* 协作：评论、只读任务、项目成员 */
.cmt-box { display: flex; flex-direction: column; gap: 10px; }
.cmt-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow: auto; }
.cmt { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.cmt-head { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 4px; }
.cmt-head .icon-btn { margin-left: auto; width: 22px; height: 22px; }
.cmt-body { font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.cmt-input { display: flex; gap: 8px; align-items: flex-end; }
.cmt-input textarea { flex: 1; }
.owner-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); padding: 3px 8px; border-radius: 6px; background: var(--fill); flex-shrink: 0; }
.ro-note { font-size: 13px; color: var(--muted); text-align: center; padding: 12px; border: 1px dashed var(--border); border-radius: 10px; margin: 0 auto 8px; max-width: 40rem; }
.members { display: flex; flex-wrap: wrap; gap: 6px; }
.member { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--fill); }
.member .icon-btn { width: 20px; height: 20px; }
.proj-item .shared { color: var(--muted); margin-left: 4px; flex-shrink: 0; }
/* 技能评分 */
.rating-box { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.rating-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.stars { display: inline-flex; gap: 2px; }
.star { background: none; border: 0; cursor: pointer; font-size: 18px; line-height: 1; color: var(--border); padding: 0 1px; }
.star.on, .stars:hover .star:hover, .stars:hover .star:has(~ .star:hover) { color: #f5a623; }
.review-list { margin: 4px 0 0; padding-left: 16px; font-size: 13px; }
/* ================================================================ 来自 refinements.css */
/* worker: compact task surfaces and a consistent hierarchy across every route. */



/* Shared controls: the action, rather than decoration, carries the emphasis. */
.btn { justify-content: center; }
.btn.lg { font-size: 12px; }
input:not([type="checkbox"]), select, textarea { font-size: 13px; }
input:not([type="checkbox"]), select { min-height: 34px; }
.menu button.mi { width: 100%; text-align: left; border: 0; background: transparent; font: inherit; color: var(--text); cursor: pointer; }
.menu button.mi:hover, .menu button.mi:focus-visible { background: var(--fill); }
.menu .mh { letter-spacing: 0; }
.badge, .tag, .pill { font-size: 11px; font-weight: 400; border-radius: 5px; }
/* Navigation stays quiet; task status remains distinguishable. */
.brand { grid-template-columns: 27px 1fr; column-gap: 9px; }
.brand-mark { width: 27px; height: 27px; font-size: 16px; }
.brand small { letter-spacing: 0; }
.side-nav #newTask { background: transparent; border-color: transparent; box-shadow: none; }
.side-nav #newTask:hover { background: var(--hover); }
.nav-label { padding-top: 16px; }
.task-empty { color: var(--faint); font-size: 11px; line-height: 1.7; }
.task-list .task-item .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot { border-top-color: transparent; }
/* Keep a visible navigation rail when the full sidebar is collapsed. */
@media (min-width:761px) {
  #app.side-collapsed { grid-template-columns:52px minmax(0,1fr) auto; }
  #app.side-collapsed .task-head, #app.side-collapsed .home-topbar { padding-left:22px; }
}
.collapsed-rail { position:fixed; left:6px; top:16px; bottom:16px; z-index:30; width:42px; display:flex; flex-direction:column; align-items:center; gap:12px; background:var(--side); }
.rail-brand { width:28px; height:28px; border-radius:8px; display:grid; place-items:center; color:var(--accent-text); background:var(--accent); font-weight:600; margin:4px 0 8px; }
.rail-expand { display:flex; align-items:center; justify-content:center; width:36px; height:36px; padding:0; border:0; border-radius:8px; color:var(--muted); background:transparent; cursor:pointer; }
.rail-expand:hover { color:var(--text); background:var(--hover-w); }
@media (max-width:760px) {
  #collapsedRail { display:none!important; }
}
/* Sidebar: compact navigation and room for the actual conversations. */
.side-top { padding-left: 16px; }
.side-nav a, .side-nav > button { height:33px; border-radius:7px; }
.side-workspace { margin-top:8px; }
.side-workspace > summary { display:flex; align-items:center; justify-content:space-between; min-height:30px; padding:0 12px; border-radius:7px; color:var(--muted); font-size:11px; cursor:pointer; list-style:none; user-select:none; }
.side-workspace > summary::-webkit-details-marker { display:none; }
.side-workspace > summary:hover { background:var(--hover); color:var(--text); }
.side-workspace > summary:focus-visible { outline:2px solid var(--muted); outline-offset:-2px; }
.side-workspace > summary .ic { transition:transform var(--dur-1) var(--ease); }
.side-workspace[open] > summary .ic { transform:rotate(90deg); }
.workspace-links { display:flex; flex-direction:column; gap:2px; padding-top:2px; }
.side-top, .side-nav, .side-search, .side-list-tools, .side-foot { flex-shrink:0; }
.side-list-tools { padding-top:8px; padding-bottom:4px; }
.task-list { min-height:0; margin-top:4px; }
.task-group.static { padding-top:10px; padding-bottom:4px; letter-spacing:.2px; font-size:10px; }
.task-item { margin: 1px 0; }
.task-item.active { background:var(--active); }
.task-item .more { min-width:24px; height:24px; }
.task-item .meta { font-size:10px; opacity:.8; }
.task-item.unread .t { font-weight: var(--font-weight-medium); }
.branch-origin { display:inline-flex; align-items:center; gap:5px; font-size:12px; color:var(--muted); border:1px solid var(--border-2); padding:4px 7px; border-radius:6px; white-space:nowrap; }
/* Conversation controls stay attached to the message they act on. */
.conversation .u-msg { position:relative; }
.user-actions { display:flex; justify-content:flex-end; gap:2px; margin-top:4px; min-height:24px; opacity:0; transition:opacity var(--dur-1) var(--ease); }
.u-msg:hover .user-actions, .u-msg:focus-within .user-actions { opacity:1; }
.user-actions .icon-btn, .msg-actions .icon-btn { font-size: 12px; }
.user-actions .branch-action, .msg-actions .branch-action { gap:4px; width:auto; min-width:56px; white-space:nowrap; padding:0 7px; }
.branch-action > span:not(.ic) { font-size:12px; }
.steer-message { max-width:85%; width:fit-content; margin:18px 0 20px auto; padding:11px 15px 7px; border:1px solid var(--border-2); border-radius:12px; background:var(--user); font-size:13px; line-height:1.7; }
.steer-caption { display:flex; align-items:center; gap:6px; margin-bottom:6px; color:var(--muted); font-size:12px; }
.steer-caption > span { margin-left:auto; padding-left:12px; color:var(--faint); }
.steer-actions { display:flex; justify-content:flex-end; gap:3px; margin-top:5px; }
.steer-actions .branch-action { width:auto; min-width:56px; }
.steer-actions .icon-btn { height:var(--h-sm); }
.stopped-notice { flex-wrap:wrap; align-items:center; }
.stopped-notice .btn { margin-left:auto; }
.composer .run-stop { flex-shrink:0; }
.user-message-body { white-space:pre-wrap; overflow-wrap:anywhere; }
.user-message-body.collapsed-message { max-height:154px; overflow:hidden; mask-image:linear-gradient(#000 80%,transparent); }
.expand-message { display:block; border:0; background:transparent; color:var(--muted); padding:7px 0 0; font-size:12px; cursor:pointer; }
.expand-message:hover { color:var(--text); }
.step-fork { align-self:flex-start; opacity:0; width:var(--h-sm); min-width:var(--h-sm); height:var(--h-sm); }
.step:hover .step-fork, .step:focus-within .step-fork { opacity:1; }
.task-head .title { letter-spacing: -.1px; }
.task-head button.title { border:0; border-radius:6px; background:transparent; color:var(--text); text-align:left; padding:4px 0; font:inherit; }
.task-head button.title:hover { color:var(--muted); }
.task-head button.title:disabled { opacity: 1; cursor: default; color: var(--text); }
.task-head button.title:focus-visible, .task-item:focus-visible { outline:2px solid var(--muted); outline-offset:-2px; }
.task-item:focus-within .more, .proj-item:focus-within .more { display:inline-flex; }
.task-item:focus-within .meta { display:none; }
.side-search input { width:0; }
.side-search .icon-btn { min-width:26px; height:26px; }
.menu .mi small { font-size: 11px; }
.pick > button[aria-expanded="true"]::after { display:none; }
.task-group button.clear { border:0; padding:0; background:transparent; font:inherit; color:var(--link); cursor:pointer; }
.conversation .final { overflow-wrap:anywhere; }
.task-foot > .local-folders { width:min(100%,768px); margin:0 auto 7px; }
.branch-preview { font-size:12px; line-height:1.6; color:var(--muted); background:var(--fill); border:1px solid var(--border-2); border-radius:8px; margin:14px 0; padding:12px; max-height:124px; overflow:auto; white-space:pre-wrap; }
.branch-label { display:flex; flex-direction:column; gap:6px; font-size:12px; margin:14px 0; }
.branch-copy { display:flex; align-items:center; gap:8px; font-size:12px; margin-top:16px; }
.branch-note { font-size:11px; margin:6px 0; line-height:1.6; }
@media (hover:none) {
  .user-actions, .step-fork { opacity:1; }
}
.local-folders { display:flex; flex-wrap:wrap; align-items:center; gap:7px; margin:0 2px 8px; }
.local-folder-add, .local-folder-chip { display:inline-flex; align-items:center; gap:6px; background:transparent; border:1px solid var(--border); border-radius:8px; color:var(--muted); padding:5px 8px; font:inherit; font-size:12px; cursor:pointer; }
.local-folder-add:hover, .local-folder-chip:hover { color:var(--text); background:var(--fill); }
.local-folder-chips { display:contents; }
.local-folder-chip > span { font-size:12px; color:var(--faint); }
.folder-permissions { padding:4px 24px 24px; }
.folder-choice { display:flex; flex-direction:column; gap:4px; text-align:left; width:100%; padding:14px 16px; margin:10px 0; border:1px solid var(--border); border-radius:10px; background:transparent; color:var(--text); cursor:pointer; font:inherit; }
.folder-choice:hover { background:var(--fill); border-color:var(--muted); }
.folder-choice > span, .folder-receipt small { font-size:12px; color:var(--muted); }
.folder-path { overflow-wrap:anywhere; }
.folder-receipts { margin:16px 0 20px; max-height:300px; overflow:auto; }
.folder-receipt { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; border-bottom:1px solid var(--border); }
.folder-receipt b, .folder-receipt small { display:block; overflow-wrap:anywhere; }
/* Home fits a laptop viewport without cutting off the suggested tasks. */
.home { padding: clamp(24px, 5vh, 64px) 32px 20px; }
.home-content { max-width: 720px; }
.home-heading { margin-bottom: 24px; }
.home-symbol { width: 36px; height: 36px; margin-bottom: 16px; border: 0; background: transparent; }
.home-heading p { margin-top: 10px; font-size: 12px; }
.home .composer { border-radius: 13px; }
.composer-tray { min-height: 36px; }
.compose-hint { font-size: 11px; }
.tpl-grid { gap: 8px; }
.tpl { padding: 13px 14px; min-height: 65px; border-radius: 9px; box-shadow: none; }
.tpl .ti { background: transparent; }
.tpl .tt b { font-size: 12px; font-weight: 500; }
.tpl .tt small { font-size: 11px; line-height: 1.6; }
.home .home-foot { padding-top: 24px; }
/* Feature pages share an alignment axis, while retaining their own workflow. */
.page { padding: 36px 40px; }
.page-inner { max-width: 1100px; }
.page h1 { font-size: 22px; letter-spacing: -.5px; font-weight: var(--font-weight-medium); line-height: 1.4; }
.page .sub { font-size: 12px; line-height: 1.8; margin-top: 8px; color: var(--muted); }
.page h3 { font-size: 14px; font-weight: var(--font-weight-medium); }
.hub-header { margin-bottom: 20px; }
.hub-header .page-head { gap: 16px; margin-bottom: 24px; }
.hub-header .hub-tabs { gap: 26px; }
.page-actions { gap: 8px; justify-content: flex-end; }
.page-actions .search-box input { width: 160px; font-size: 12px; }
.search-box { color: var(--faint); }
.tabs-line { display: flex; flex-wrap: wrap; border-bottom: 0; }
.tabs-line button { border: 0; background: transparent; }
.stabs a { font-size: 13px; }
.seg-soft button { font-size: 11px; }
.grid { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 12px; }
.gcard { padding: 18px; border-radius: 10px; transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease); }
.gcard:hover { box-shadow: none; transform: none; border-color: var(--border); background: var(--hover-w); }
.gcard .av, .gcard .av[class*="t"] { width: 36px; height: 36px; border-radius: 9px; background: var(--fill); color: var(--muted); font-size: 21px; }
.gcard .nm { font-size: 13px; font-weight: var(--font-weight-medium); }
.gcard .cat { font-size: 11px; margin-top: 2px; }
.gcard .ds { font-size: 12px; line-height: 1.8; margin: 14px 0; }
.gcard .ft { border-top: 1px solid var(--border-2); padding-top: 12px; margin-top: 14px; }
.gcard .summon { background: transparent; color: var(--text); border: 1px solid var(--border); }
.gcard .summon:hover { background: var(--fill-2); }
.empty-state { grid-column: 1 / -1; }
.empty-state p { max-width: 420px; line-height: 1.8; }
.empty-symbol { background: var(--fill); border-radius: 10px; }
.section-loading { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 180px; font-size: 12px; color: var(--muted); }
/* Projects, knowledge, and schedules: metadata sits below the content. */
.proj-card { padding: 20px; border-radius: 10px; }
.proj-card b { font-size: 14px; }
.proj-card .proj-ic { background: var(--fill); border-radius: 9px; }
.section { padding: 20px; border-radius: 10px; }
.section h3 { margin-top: 0; }
.section-toolbar { align-items: center; }
.section-toolbar .tabs-line { margin-bottom: 0; }
.lcard { border-radius: 10px; padding: 18px; }
.lcard .nm { font-size: 13px; font-weight: var(--font-weight-medium); gap: 8px; flex-wrap: wrap; }
.lcard .desc { font-size: 12px; line-height: 1.8; }
/* Settings and admin: stable rails and restrained, readable data surfaces. */
.srow .sl small { line-height: 1.7; max-width: 440px; }
.srow .sc { min-width: 130px; }
.admin-rail { position: sticky; top: 0; align-self: start; max-height: calc(100dvh - 96px); overflow-y: auto; }
.admin-rail a.active { background: var(--fill-2); font-weight: 500; }
.admin-main { min-width: 0; }
.admin-main .kpi { border-radius: 9px; background: var(--panel); }
.admin-main .kpi-value { font-size: 24px; font-weight: var(--font-weight-medium); }
.tbl th { letter-spacing: 0; }
.tbl tbody tr:hover { background: var(--hover-w); }
.tbl td { font-variant-numeric: tabular-nums; }
.viz-card { border-radius: 10px; }
/* Conversations and results: readable prose, quiet process, clear next actions. */
.conversation { padding-top: 28px; }
.conversation .md h1 { font-size: 22px; }
.conversation .md h2 { font-size: 18px; }
.conversation .md h3 { font-size: 15px; }
.conversation .md :is(h1,h2,h3) { margin-top: 24px; margin-bottom: 10px; font-weight: var(--font-weight-semibold); }
.conversation .who { margin-bottom: 12px; }
.process { border-color: var(--border-2); border-radius: 8px; }
.process > summary { font-size: 12px; }
.response-error, .response-notice, .plan-confirm { border-radius: 12px; font-size: 12px; line-height: 1.8; }
.panel-tabs button { font-size: 12px; }
#panel .preview pre { line-height: 1.85; font-size: 12px; }
/* Dialogs and feedback use the same compact rhythm as pages. */
.modal-card { box-shadow: var(--pop); }
.login-card { max-width: 360px; padding: 30px; border-radius: 14px; }
.login-card h2 { font-size: 22px; font-weight: var(--font-weight-medium); }
@media (max-width: 1100px) {
  .hub-header .page-head { flex-direction: column; }
  .page-actions { width: 100%; justify-content: flex-start; }
}
@media (max-height: 760px) and (min-width: 761px) {
  .home { padding-top: 16px; }
  .home-symbol { display: none; }
  .home-heading { margin-bottom: 20px; }
  .scenes { margin-top: 18px; }
}
@media (max-width: 760px) {
  .page { padding: 24px 20px; }
  .home { padding: 28px 20px 18px; }
  .home-topbar-note { display: none; }
  .home-heading { text-align: left; }
  .home-symbol { display: none; }
  .home h1 { font-size: 24px; }
  .page h1 { font-size: 21px; }
  .tpl .tt small { display: none; }
  .tpl { min-height: 54px; padding: 10px; }
  .page-actions .search-box { flex-basis: 100%; }
  .page-actions .search-box input { width: 100%; }
  .gcard { padding: 16px; }
  .admin-rail { position: static; }
  .srow { flex-wrap: wrap; gap: 12px; }
  .srow .sc { min-width: 0; }
}
.preview-updated { color: var(--muted); font-size: 11px; white-space: nowrap; }
.fchip.failed { border-color: var(--danger); }
.fchip.failed small { color: var(--danger); }
/* Model endpoint forms and scenario packages share the capability hub. */
.endpoint-form { display:grid; gap:14px; }
.endpoint-field { display:grid; gap:6px; font-size:13px; }
.endpoint-field input,.endpoint-field select { width:100%; min-width:0; }
.endpoint-checks { display:flex; flex-wrap:wrap; gap:16px; }
.endpoint-help { margin:0; line-height:1.6; }
.endpoint-url { max-width:300px; overflow-wrap:anywhere; color:var(--muted); font-size:12px; }
.tbl tr.clickable:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
.admin-body[aria-busy=true] { opacity:.6; }
.pack-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr)); gap:16px; }
.pack-card { display:flex; flex-direction:column; gap:12px; padding:20px; min-width:0; }
.pack-card-head { display:flex; gap:12px; align-items:center; }
.pack-card-head h3 { margin:0 0 4px; font-size:16px; }
.pack-card-head>.badge { margin-left:auto; white-space:nowrap; }
.pack-avatar { font-size:25px; width:40px; flex-shrink:0; }
.pack-description { line-height:1.7; margin:0; min-height:48px; }
.pack-members { color:var(--muted); font-size:12px; margin:0; line-height:1.7; }
.pack-card-actions { display:flex; gap:8px; align-items:center; margin-top:auto; padding-top:8px; }
.pack-template { text-align:left; padding:14px; border:1px solid var(--border); background:transparent; border-radius:10px; color:inherit; display:grid; gap:8px; }
.pack-template:hover { background:var(--hover); }
.pack-template small { line-height:1.7; color:var(--muted); }
.pack-intro { line-height:1.8; }
.composer-model-notice { color:var(--muted); font-size:12px; line-height:1.7; padding:4px 0 10px; }
/* Shared icon rhythm: visible marks are compact; their targets keep comfortable padding. */
.icon-label { display:inline-flex; align-items:center; gap:6px; vertical-align:middle; }
.user-actions .icon-btn, .msg-actions .icon-btn { min-width:28px; height:28px; }
.icon-btn:focus-visible, .rail-expand:focus-visible { outline:2px solid var(--muted); outline-offset:2px; }
.pick > button { min-height:30px; }
.chip button, .fchip .fx { min-width:24px; min-height:24px; }
.health-banner { display:flex; align-items:center; gap:8px; }
/* ================================================================ 来自 controls.css */
/* Shared controls and interaction states. Layout stays in the page styles. */
:root { --control-hover: var(--fill); --control-selected: var(--fill-2); --control-ring: color-mix(in srgb, var(--text) 10%, transparent); }
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; }
}
/* Neutral surfaces, restrained emphasis, and a stable target when pressed. */
:where(button, input, select, textarea, summary) { transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease); }
.btn.lg { min-height: var(--control-height); height: auto; padding: 6px 12px; }
.btn:active:not(:disabled) { background: var(--control-selected); transform: none; }
.btn.primary:active:not(:disabled) { background: var(--accent); border-color: var(--accent); }
.btn.danger:hover:not(:disabled), .btn.danger:active:not(:disabled) { background: color-mix(in srgb, var(--danger) 7%, var(--card));
  border-color: color-mix(in srgb, var(--danger) 28%, var(--border)); }
.icon-btn, .pick > button { border-radius: var(--control-radius); }
.icon-btn:hover:not(:disabled), .pick > button:hover:not(:disabled) { background: var(--control-hover); color: var(--text); }
.icon-btn:active:not(:disabled), .pick > button:active:not(:disabled) { background: var(--control-selected); }
.icon-btn.on, .pick > button.on, .pick > button[aria-expanded="true"] { background: var(--control-selected); color: var(--text); }
.scene-tabs button.active, .seg button.active, .seg-soft button.active, .tabs-line button.active { background: var(--control-selected); color: var(--text); box-shadow: none; }
.scene-tabs button:hover:not(:disabled):not(.active), .seg button:hover:not(:disabled):not(.active), .seg-soft button:hover:not(:disabled):not(.active), .tabs-line button:hover:not(:disabled):not(.active) { background: var(--control-hover); color: var(--text); }
:where(button, a, summary, [tabindex]):focus-visible { outline: 2px solid var(--control-focus); outline-offset: 2px; }
.menu button.mi:focus-visible, .task-item:focus-visible { outline-offset: -2px; }
/* Fields share a clear hover, focus, invalid, read-only, and disabled treatment. */
:is(input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="file"], [type="range"], [type="color"], [type="button"], [type="submit"]), select, textarea):not(:where(.composer textarea)) { border: 1px solid var(--border); border-radius: var(--control-radius); background: var(--card);
  padding: 7px 10px; min-height: 36px; line-height: 1.5; outline: none; box-shadow: none; }
:is(input, select, textarea):not(:disabled):not([readonly]):not(.composer textarea):hover:not(:focus) { border-color: color-mix(in srgb, var(--muted) 55%, var(--border)); }
:is(input, select, textarea):not([type="checkbox"], [type="radio"]):not(.composer textarea):focus { border-color: var(--control-focus); outline: none; box-shadow: none; }
input::placeholder, textarea::placeholder { opacity: 1; }
:is(input, textarea)[readonly] { background: var(--fill); color: var(--muted); }
:is(input, select, textarea):not([type="checkbox"], [type="radio"]):not(.composer textarea):not(:disabled):is([aria-invalid="true"], :user-invalid) { border-color: var(--danger); }
:is(input, select, textarea):not([type="checkbox"], [type="radio"]):not(.composer textarea):not(:disabled):is([aria-invalid="true"], :user-invalid):focus { box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 12%, transparent); }
.search-box input, .side-search input, .filter-row > input, .filter-row > select, .tbl input, .tbl select { min-height: 32px; padding-top: 5px; padding-bottom: 5px; }
select:not([multiple]) { appearance: none; -webkit-appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23777777' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px 14px; }
/* 输入框聚焦：只把内层边线稍微加深一点，不加外圈、外壳不变（之前是内外两层边线加一圈阴影，太重） */
.composer-shell:focus-within { border-color: var(--border); }
.composer textarea { outline: none; box-shadow: none; }
/* Selection controls remain visible for keyboard use, including custom switches. */
input:is([type="checkbox"], [type="radio"]) { width: 16px; height: 16px; min-height: 0; margin: 0; accent-color: var(--accent); flex-shrink: 0; vertical-align: middle; cursor: pointer; }
input:is([type="checkbox"], [type="radio"]):focus-visible { outline: 2px solid var(--control-focus); outline-offset: 3px; box-shadow: none; }
.switch { width: 36px; height: 20px; }
.switch input { position: absolute; width: 1px; height: 1px; margin: -1px; opacity: 0; }
.switch span { background: var(--border); }
.switch:hover input:not(:disabled):not(:checked) + span { background: var(--faint); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { background: var(--accent-text); }
.switch input:focus-visible + span { outline: 2px solid var(--control-focus); outline-offset: 3px; }
.switch input:disabled + span { opacity: .45; cursor: not-allowed; }
/* A selected menu item stays distinct from hover; unavailable actions stay inert. */
.menu { border: 1px solid var(--border); }
.menu button.mi { align-items: center; }
.menu button.mi:hover:not(:disabled), .menu button.mi:focus-visible { background: var(--control-hover); }
.menu button.mi.sel { background: var(--control-selected); font-weight: 500; }
.menu button.mi.sel:hover:not(:disabled) { background: var(--active); }
.menu .mi small { color: var(--muted); line-height: 1.6; }
.menu-empty { padding: 18px 12px; color: var(--muted); font-size: 12px; text-align: center; }
/* Keep headings and actions available when a longer form scrolls. */
#modal { background: rgba(0, 0, 0, .28); padding: 20px; }
.modal-card { max-height: min(88vh, calc(100dvh - 40px)); padding: 24px; border: 1px solid var(--border); border-radius: 14px; overscroll-behavior: contain; }
.modal-card.compact { max-width: 440px; }
.modal-head { background: var(--card); }
.modal-head h3 { line-height: 1.5; }
.modal-head .icon-btn { width: 32px; height: 32px; flex-shrink: 0; }
.modal-foot { background: var(--card); padding-top: 16px; border-top: 1px solid var(--border-2); gap: 8px; }
.form > .modal-head, .endpoint-form > .modal-head { margin-bottom: 0; }
.form > .modal-foot, .endpoint-form > .modal-foot { margin-top: 0; }
.modal-card :is(input, select, textarea) { max-width: 100%; }
.form label > b, .endpoint-field > b { font-size: 12px; font-weight: var(--font-weight-medium); }
.form .faint, .endpoint-field .faint { font-size: 12px; line-height: 1.65; }
.endpoint-form > .err-text:empty { display: none; }
.modal-card:has(> .modal-layout) { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.modal-layout { display: flex; flex-direction: column; gap: 0; min-height: 0; max-height: inherit; width: 100%; margin: 0; padding: 0; }
.modal-layout > .modal-head { flex-shrink: 0; margin: 0; padding: 18px 20px 16px 24px; }
.modal-scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding: 20px 24px; scrollbar-gutter: stable; }
.modal-layout > .modal-foot { flex-shrink: 0; margin: 0; padding: 16px 24px 20px; }
/* Settings choices avoid platform-native arrows and use the shared menu. */
.choice-control { width: 220px; max-width: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.choice-button { width: 100%; min-width: 0; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 400; text-align: left; background: var(--card); border-color: var(--border); }
.choice-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choice-button > .ic { color: var(--muted); }
.choice-button[aria-expanded="true"] { background: var(--control-selected); border-color: var(--control-focus); }
.choice-error { color: var(--danger); font-size: 11px; line-height: 1.6; }
.menu.choice-menu { width: 280px; min-width: 220px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.page-inner.settings-layout { max-width: 1080px; margin: 0 auto; }
.settings-layout .srows { background: transparent; border: 0; border-radius: 0; padding: 0; }
.settings-layout .srow { gap: 28px; padding: 20px 0; }
.settings-layout .sl b { font-size: 13px; font-weight: var(--font-weight-medium); }
.settings-layout .sl small { color: var(--muted); font-size: 12px; line-height: 1.7; }
.settings-layout .sc { min-width: 180px; }
.settings-layout .section-picker .choice-control { width: 100%; }
.wf-files { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.wf-input { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 12px; margin: 8px 0; }
.wf-acts { flex-wrap: wrap; }
.wf-acts > input { width: min(240px, 100%); }
.wf-skill-pick { min-width: 0; max-width: 100%; white-space: normal; text-align: left; justify-content: flex-start; }
/* Disabled controls retain their geometry and never borrow an enabled hover state. */
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; }
.btn:disabled, .btn:disabled:hover, .btn:disabled:active { background: var(--fill); border-color: var(--border-2); color: var(--faint); opacity: 1; box-shadow: none; transform: none; }
.icon-btn:disabled, #side .icon-btn:disabled, .pick > button:disabled, .menu button.mi:disabled { background: transparent; color: var(--faint); opacity: .55; box-shadow: none; transform: none; }
.send:disabled { background: var(--fill-2); color: var(--faint); opacity: 1; box-shadow: none; }
.pack-template:disabled, .tpl:disabled, .folder-choice:disabled { background: var(--fill); border-color: var(--border-2); opacity: .55; box-shadow: none; transform: none; }
:is(input, select, textarea):disabled:not([type="checkbox"], [type="radio"]) { background: var(--fill); border-color: var(--border-2); color: var(--faint); opacity: 1; box-shadow: none; }
input:is([type="checkbox"], [type="radio"]):disabled { cursor: not-allowed; opacity: .45; }
@media (max-width: 760px) {
  #modal { padding: 12px; }
  .modal-card { padding: 20px; max-height: calc(100dvh - 24px); }
  .modal-layout > .modal-head { padding: 16px 16px 14px 20px; }
  .modal-scroll { padding: 18px 20px; }
  .modal-layout > .modal-foot { padding: 14px 20px 18px; }
  .modal-foot .btn { min-height: 36px; }
  .settings-layout .srow { gap: 10px; }
  .settings-layout .sc { width: 100%; }
  .settings-layout .choice-control { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  :where(button, input, select, textarea, summary), .switch span, .switch span::before { transition: none; }
}
.wf-upload-zone { display:flex;flex-direction:column;gap:10px;padding:14px;border:1px dashed var(--border);border-radius:12px;background:var(--surface,transparent); }
.wf-upload-zone > .btn { align-self:flex-start; }
.wf-upload-list { display:flex;flex-direction:column;gap:6px; }
.wf-upload-list:empty { display:none; }
.wf-upload-item { display:flex;align-items:center;gap:8px;min-width:0; }
.wf-upload-item .grow { overflow-wrap:anywhere; }
.wf-files > a { flex-wrap:wrap;overflow-wrap:anywhere; }
/* ================================================================ 统一设计规范
   Codex 风格的本项目实现，详见 docs/ui-design.md。颜色只在此定义；组件结构保留在前文。
   显式深色与系统深色必须一致。改变公共尺度时同时验证菜单、表单和移动端。 */
:root {
  --r-sm: 6px; --r: 8px; --r-lg: 12px; --r-xl: 16px;
  --h-sm: 28px; --h: 32px; --h-lg: 36px;
  --radius: var(--r-lg); --radius-lg: var(--r-xl);
  /* Keep Codex's native Latin faces; resolve CJK before browser defaults. */
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  --font-code: "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "Noto Sans SC", ui-monospace, monospace;
  --font-weight-ui: 430; --font-weight-medium: 500; --font-weight-semibold: 600;
  --content-width: 768px; --page-width: 1080px; --line: var(--border-2);
  /* 动效：Codex 的三档时长与进入缓动 */
  --dur-1: .15s; --dur-2: .2s; --dur-3: .3s; --ease: cubic-bezier(.19, 1, .22, 1);
  --control-height: var(--h-lg); --control-radius: var(--r);
  --control-focus: var(--text);
  color-scheme: light;
  --bg: #f9f9f9; --side: #f9f9f9; --panel: #fff; --card: #fff;
  --fill: #f5f5f5; --fill-2: #ededed; --text: #1a1c1f;
  --muted: color-mix(in oklab, #1a1c1f 70%, transparent); --faint: color-mix(in oklab, #1a1c1f 65%, transparent);
  --border: color-mix(in oklab, #1a1c1f 12%, transparent); --border-2: color-mix(in oklab, #1a1c1f 8%, transparent);
  --hover: #efefef; --hover-w: #f5f5f5; --active: #e9e9e9;
  --accent: #1a1c1f; --accent-2: #383838; --accent-text: #fff; --accent-soft: #efefef;
  --link: #245dbe; --danger: #b42318; --ok: #227447; --warn: #956000;
  --code: #f5f5f5; --user: color-mix(in oklab, #1a1c1f 5%, transparent); --shadow-sm: none; --shadow: none;
  --pop: 0 8px 32px #00000014, 0 2px 6px #00000008;
  --shadow-composer: 0 1px 2px -1px rgb(0 0 0 / 8%), 0 2px 4px -1px rgb(0 0 0 / 8%), 0 4px 8px -2px rgb(0 0 0 / 10%);
  --tip-bg: #1a1a1a; --tip-fg: #fff; --send-idle-bg: #d6d6d6; --send-idle-fg: #fff;
  --viz-s1: #2a78d6; --viz-s2: #d95926; --viz-good: #227447; --viz-warning: #956000; --viz-critical: #b42318;
  --viz-neutral: #a8a7a0; --viz-grid: #e5e5e5; --viz-base: #c3c2b7; --viz-muted: #707070;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131313; --side: #131313; --panel: #181818; --card: #212121;
  --fill: #262626; --fill-2: #303030; --text: #dfdfdf;
  --muted: color-mix(in oklab, #fff 70%, transparent); --faint: color-mix(in oklab, #fff 50%, transparent);
  --border: color-mix(in oklab, #fff 16%, transparent); --border-2: color-mix(in oklab, #fff 8%, transparent);
  --hover: #222; --hover-w: #262626; --active: #2c2c2c;
  --accent: #ececec; --accent-2: #d4d4d4; --accent-text: #181818; --accent-soft: #303030;
  --link: #8ab4f8; --danger: #ff938a; --ok: #7acb9c; --warn: #e5b566;
  --code: #212121; --user: color-mix(in oklab, #fff 8%, transparent); --shadow-sm: none; --shadow: none;
  --pop: 0 12px 36px #00000050, 0 2px 8px #00000030;
  --shadow-composer: 0 1px 2px -1px rgb(0 0 0 / 20%), 0 2px 4px -1px rgb(0 0 0 / 20%), 0 4px 8px -2px rgb(0 0 0 / 36%);
  --tip-bg: #ececec; --tip-fg: #141414; --send-idle-bg: #3a3a3a; --send-idle-fg: #777;
  --viz-s1: #70a7eb; --viz-s2: #ed9867; --viz-good: #7acb9c; --viz-warning: #e5b566; --viz-critical: #ff938a;
  --viz-neutral: #777; --viz-grid: #383838; --viz-base: #555; --viz-muted: #a0a0a0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  color-scheme: dark;
  --bg: #131313; --side: #131313; --panel: #181818; --card: #212121;
  --fill: #262626; --fill-2: #303030; --text: #dfdfdf;
  --muted: color-mix(in oklab, #fff 70%, transparent); --faint: color-mix(in oklab, #fff 50%, transparent);
  --border: color-mix(in oklab, #fff 16%, transparent); --border-2: color-mix(in oklab, #fff 8%, transparent);
  --hover: #222; --hover-w: #262626; --active: #2c2c2c;
  --accent: #ececec; --accent-2: #d4d4d4; --accent-text: #181818; --accent-soft: #303030;
  --link: #8ab4f8; --danger: #ff938a; --ok: #7acb9c; --warn: #e5b566;
  --code: #212121; --user: color-mix(in oklab, #fff 8%, transparent); --shadow-sm: none; --shadow: none;
  --pop: 0 12px 36px #00000050, 0 2px 8px #00000030;
  --shadow-composer: 0 1px 2px -1px rgb(0 0 0 / 20%), 0 2px 4px -1px rgb(0 0 0 / 20%), 0 4px 8px -2px rgb(0 0 0 / 36%);
  --tip-bg: #ececec; --tip-fg: #141414; --send-idle-bg: #3a3a3a; --send-idle-fg: #777;
  --viz-s1: #70a7eb; --viz-s2: #ed9867; --viz-good: #7acb9c; --viz-warning: #e5b566; --viz-critical: #ff938a;
  --viz-neutral: #777; --viz-grid: #383838; --viz-base: #555; --viz-muted: #a0a0a0;
  }
}
/* ---------- 排版 ---------- */
html, body { font-size: 14px; line-height: 1.6; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: 0; }
.page-head h1, .admin-main .page-head h1 { font-size: 20px; line-height: 1.3; margin: 0 0 4px; }
.page-head .sub, p.sub { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.6; }
.page-head { margin-bottom: 24px; gap: 16px; }
.card h3, .viz-head h3, .org-head h3 { font-size: 14px; font-weight: 600; margin: 0; }
.viz-sub { font-size: 12px; color: var(--muted); line-height: 1.6; margin-top: 2px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
small, .small { font-size: 12px; }
kbd { font: 11px/1 var(--font-code); color: var(--faint); background: var(--fill); border: 1px solid var(--border-2); border-radius: 4px; padding: 2px 5px; }
/* ---------- 滚动条：细、灰 ---------- */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }
/* ---------- 按钮 ---------- */
.btn { height: var(--h); min-height: var(--h); padding: 0 12px; font-size: 13px; font-weight: 500; border-radius: var(--r); border: 1px solid var(--border); background: var(--card); color: var(--text); box-shadow: none; line-height: 1; gap: 6px; }
.btn:hover:not(:disabled) { background: var(--hover-w); border-color: var(--border); }
.btn.sm { height: var(--h-sm); min-height: var(--h-sm); padding: 0 10px; font-size: 12px; border-radius: var(--r-sm); }
.btn.xs { height: 24px; min-height: 24px; padding: 0 8px; font-size: 12px; border-radius: var(--r-sm); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover:not(:disabled) { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { color: var(--danger); border-color: var(--border); background: var(--card); }
.btn.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 6%, var(--card)); border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--hover-w); }
.btn:disabled { opacity: 1; cursor: not-allowed; }
.icon-btn { width: var(--h-sm); height: var(--h-sm); border-radius: var(--r-sm); color: var(--muted); }
.icon-btn:hover { background: var(--hover-w); color: var(--text); }
.acts, .modal-foot { gap: 8px; }
/* ---------- 输入 ---------- */
:where(input:not([type="checkbox"], [type="radio"], [type="range"]), select, textarea) { font-size: 13px; border-radius: var(--r); border: 1px solid var(--border); background: var(--card); color: var(--text); padding: 6px 10px; }
:where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"]), select) { height: var(--h-lg); }
textarea { line-height: 1.6; padding: 8px 10px; }
select { padding-right: 28px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
.form label > b, .form b { font-size: 13px; font-weight: 500; color: var(--text); }
.form label { gap: 6px; }
.form label > .faint, .form .hint { font-size: 12px; line-height: 1.6; }
.checks label, .chk { font-size: 13px; gap: 6px; }
input[type="checkbox"], input[type="radio"] { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; }
/* ---------- 卡片 / 列表卡 / 空状态 ---------- */
.card { border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: none; padding: 16px 18px; }
.card.muted { color: var(--muted); font-size: 13px; }
.lcard, .gcard, .viz-card, .rollout-card { border-radius: var(--r-lg); padding: 16px 18px; }
.lcard .nm, .gcard .nm { font-size: 14px; font-weight: 600; }
.lcard .ds, .gcard .ds, .lcard .desc { font-size: 13px; line-height: 1.7; color: var(--muted); }
.lcard .lic { width: 40px; height: 40px; border-radius: var(--r); background: var(--fill); color: var(--muted); font-size: 20px; }
.gcard .av, .gcard .av[class*="t"], .av { border-radius: var(--r); background: var(--fill) !important; color: var(--muted) !important; }
/* 图标与头像统一灰度：彩色字母 / emoji 在单色界面里很跳 */
.lcard .lic, .gcard .av, .av, .pack-icon, .xp, .brand-mark { filter: grayscale(1); }
.empty-state { border: 1px solid var(--border-2); border-style: solid; border-radius: var(--r-lg); background: transparent; min-height: 200px; padding: 40px 24px; }
.empty-state h3 { font-size: 14px; font-weight: 600; margin: 12px 0 6px; }
.empty-state p { font-size: 13px; color: var(--muted); margin: 0 auto 16px; }
.empty-symbol { color: var(--faint); }
.grid2, .grid3, .list { gap: 12px; }
/* ---------- 徽标 / 芯片 / 状态 ---------- */
.badge { font-size: 12px; line-height: 20px; height: 20px; padding: 0 7px; border-radius: var(--r-sm); background: var(--fill); color: var(--muted); font-weight: 500; }
.badge.ok { color: var(--ok); }
.badge.bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--fill)); }
.badge.acc { color: var(--text); background: var(--fill-2); }
.chip { border-radius: var(--r-sm); font-size: 12px; padding: 2px 6px 2px 8px; }
.st-badge { font-size: 12px; }
.count-badge { background: var(--text); color: var(--panel); font-weight: 600; }
/* ---------- 标签页 / 分段控件 ---------- */
.tabs-line { gap: 4px; margin-bottom: 18px; }
.tabs-line button { height: var(--h-sm); padding: 0 10px; font-size: 13px; border-radius: var(--r-sm); color: var(--muted); }
.tabs-line button:hover { color: var(--text); background: var(--hover-w); }
.tabs-line button.active { background: var(--fill-2); color: var(--text); font-weight: 500; box-shadow: none; }
.scene-tabs { padding: 3px; border-radius: var(--r); gap: 2px; }
.scene-tabs button { height: 28px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }
.scene-tabs button.active { box-shadow: none; font-weight: 500; }
/* ---------- 表格 ---------- */
.tbl { font-size: 13px; }
.tbl th { font-size: 12px; font-weight: 500; color: var(--muted); padding: 8px 10px; }
.tbl td { padding: 9px 10px; }
.tbl tbody tr:hover td { background: var(--hover-w); }
/* ---------- 菜单 / 弹窗 / 提示 ---------- */
.menu { border-radius: 10px; padding: 4px; box-shadow: var(--pop); font-size: 13px; min-width: 200px; }
.menu button.mi { min-height: 30px; padding: 6px 10px; border-radius: var(--r-sm); font-size: 13px; }
.menu .mi-desc, .menu small { font-size: 12px; color: var(--faint); }
.modal-card { border-radius: 14px; padding: 22px 24px; box-shadow: var(--pop); border: 1px solid var(--border); }
.modal-head { padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--border-2); }
.modal-head h3 { font-size: 16px; font-weight: 600; margin: 0; }
.modal-foot { margin-top: 20px; }
.toast { font-size: 13px; border-radius: 10px; padding: 10px 14px; box-shadow: var(--pop); }
/* ---------- 侧边栏 ---------- */
.side-top { min-height: 48px; margin-bottom: 14px; }
.brand b { font-size: 15px; font-weight: 600; letter-spacing: 0; }
.brand small { font-size: 11px; }
.brand-mark { border-radius: var(--r); }
.side-nav { gap: 1px; }
.side-nav button, .side-nav a { height: 32px; font-size: 13px; font-weight: 500; border-radius: var(--r); }
.side-nav kbd { border: none; background: transparent; padding: 0; }
.side-nav .nav-end { color: var(--faint); }
.task-item { height: 32px; font-size: 13px; border-radius: var(--r); }
.task-item .t { font-weight: 400; }
.task-item.active .t { font-weight: 500; }
.side-foot .avatar { width: 28px; height: 28px; font-size: 12px; }
.side-foot .icon-btn { width: 28px; height: 28px; }
.side-foot .uname { font-size: 13px; }
/* ---------- 首页 ---------- */
.home h1 { font-size: 26px; font-weight: 600; letter-spacing: 0; margin-bottom: 8px; }
.home .sub, .home p.sub { font-size: 13px; }
.home .composer { box-shadow: none; border-color: var(--border); }
/* 输入框：外壳不画边线，只有卡片一条边线；下方工具行像卡片的底部一栏 */
.composer-shell { border: none; background: transparent; box-shadow: none; border-radius: var(--r-xl); }
.composer-shell:focus-within { border: none; box-shadow: none; }
.composer, .composer-shell .composer { border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--card); }
.composer-tray .pick > button { border-radius: var(--r-sm); }
.composer .bar .pick > button, .composer .bar .icon-btn { height: 28px; border-radius: var(--r-sm); font-size: 12px; }
.send { width: 30px; height: 30px; }
.scenes { gap: 12px; margin-top: 24px; }
/* ---------- 任务页 ---------- */
.run-usage { font-size: 12px; color: var(--faint); }
.u-msg .b { font-size: 14px; border-radius: 16px; padding: 8px 14px; background: var(--user); }
.step-d > summary { font-size: 13px; color: var(--muted); }
.msg-actions .icon-btn { width: 26px; min-width: 26px; height: 26px; color: var(--faint); }
.msg-actions .icon-btn:hover { color: var(--text); }
.disclaimer { font-size: 11px; color: var(--faint); }
.accept-bar { border-radius: var(--r); background: var(--fill); border-color: transparent; }
.need-bar, .inbox-item .need { color: var(--warn, #b45309); }
/* ---------- 后台 ---------- */
.admin-rail .rail-title { font-size: 13px; font-weight: 600; }
.admin-rail .rail-h { font-size: 11px; letter-spacing: .3px; }
.admin-rail a { height: 30px; font-size: 13px; border-radius: var(--r-sm); }
.kpi { border-radius: var(--r-lg); }
.kpi-value { font-size: 24px; font-weight: 600; letter-spacing: -.3px; }
.kpi-label, .kpi-sub { font-size: 12px; }
.filter-row { gap: 8px; margin-bottom: 14px; }
.section-toolbar { margin-bottom: 14px; }
.policy-kv > span { font-size: 13px; color: var(--muted); }
/* ---------- 设置 ---------- */
.settings-nav a { height: 32px; font-size: 13px; border-radius: var(--r); }
.srow { padding: 14px 0; }
.srow .sl b { font-size: 14px; font-weight: 500; }
.srow .sl small { font-size: 12px; }
/* ---------- 深色主题下的同款微调 ---------- */
:root[data-theme="dark"] .btn, :root:not([data-theme="light"]) .btn { box-shadow: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lcard .lic, :root:not([data-theme="light"]) .gcard .av, :root:not([data-theme="light"]) .av { filter: grayscale(1) brightness(1.1); }
}
:root[data-theme="dark"] .lcard .lic, :root[data-theme="dark"] .gcard .av, :root[data-theme="dark"] .av { filter: grayscale(1) brightness(1.1); }
/* ---------- 修正：带图标的搜索框保留左侧留白；场景标签不换行 ---------- */
.search-box input { padding-left: 32px; height: var(--h); width: 220px; }
.search-box .ic { left: 10px; }
.scene-tabs button { white-space: nowrap; }
.scenes > .row, .scene-row { flex-wrap: wrap; gap: 8px; }
.scene-heading { flex-wrap: wrap; }
/* ---------- 任务页顶栏：标题 + 状态 + 更多 + 文件，手机上标题有足够空间 ---------- */
.task-head { gap: 6px; }
.task-head .icon-btn { width: var(--h-sm); min-width: var(--h-sm); height: var(--h-sm); }
@media (max-width: 760px) {
  .task-head { gap: 4px; }
  .task-head .crumb, .task-head .crumb-sep, .task-head .xp { display: none; }
}

/* ---------- 布局与排版：内容、导航、浮层三个层级 ---------- */
html, body { font-family: var(--font-ui); font-weight: var(--font-weight-ui); }
code, pre, kbd { font-family: var(--font-code); }
::selection { background: var(--fill-2); color: var(--text); }
#app { grid-template-columns: var(--side-w, 264px) minmax(0, 1fr) auto; padding: 0; gap: 0; }
#main { border: 0; border-left: 1px solid var(--border-2); border-radius: 0; box-shadow: none; }
#side { padding: 12px 0 8px; }
.side-top { padding: 0 16px; min-height: 40px; margin-bottom: 16px; }
.brand { grid-template-columns: 28px 1fr; column-gap: 10px; }
.brand-mark { width: 28px; height: 28px; font-size: 15px; }
.side-nav { padding: 0 12px; gap: 2px; }
.side-nav a, .side-nav > button { height: 36px; padding: 0 10px; color: var(--text); font-weight: 400; }
.side-nav a .ic, .side-nav > button .ic { color: var(--text); }
.side-nav #newTask { font-weight: 400; }
#taskSearch { border: 0; border-radius: 0; background: transparent; padding: 5px 2px; box-shadow: none; outline: none; }
.side-search:focus-within { border-color: var(--control-focus); }
.side-workspace > summary, .side-list-tools, .task-group, .task-group.static { font-size: 12px; color: var(--muted); letter-spacing: 0; }
.task-list { padding: 0 12px 16px; mask-image: none; -webkit-mask-image: none; }
.task-item, .proj-item { height: 38px; font-size: 13px; }
.task-list .task-item, .task-list .proj-item { margin: 2px 0; }
.task-list .task-group { padding-top: 16px; padding-bottom: 6px; }
.task-list .task-group:first-child { padding-top: 8px; }
.task-list .task-group.static { padding-top: 12px; padding-bottom: 6px; }
.task-item .meta { font-size: 12px; opacity: 1; }
/* 会话列表：状态占固定位置，标题和时间保持整齐，类型使用低对比线性图标。 */
.task-list .task-item { gap: 6px; padding: 0 8px; }
.task-list .task-item.nested { padding-left: 26px; }
.task-list .task-item .lead, .task-list .task-item .lead:empty { display: inline-flex; width: 14px; margin: 0; }
.task-list .task-item .task-kind, .task-list .task-item .branch-mark { color: var(--faint); }
.task-list .task-item .meta { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.task-list .task-item.unread .t { font-weight: 400; }
.task-list .task-item.active .t { font-weight: 600; }
/* 侧栏正文适当放大，分组与项目文字使用一致的左侧基线。 */
.side-nav a, .side-nav > button { font-size: 14px; }
.task-list .task-item, .task-list .proj-item { font-size: 14px; }
.side-list-tools { padding-left: 22px; padding-right: 18px; }
.task-list .task-group, .task-list .task-group.static { padding-left: 10px; }
.task-empty { font-size: 12px; padding: 10px; }
.side-foot { padding: 12px 0 0; margin: 0 16px; gap: 4px; }
.side-foot .avatar { border-radius: 50%; }
.home-topbar, .task-head { min-height: 56px; padding: 12px 24px; border-bottom: 0; }
.home-topbar-note { font-size: 12px; }
.task-head .title, .task-head button.title { font-size: 14px; font-weight: 500; }
.home { padding: clamp(40px, 12vh, 120px) 32px 24px; }
.home-content { max-width: var(--content-width); }
.home-heading { margin-bottom: 28px; }
.home-symbol { display: none; }
.home h1 { font-size: 28px; font-weight: 600; letter-spacing: 0; line-height: 1.4; margin: 0; }
.home-heading p { font-size: 13px; margin-top: 12px; line-height: 1.7; }
.home .home-foot, .task-foot .disclaimer, .compose-hint { font-size: 12px; color: var(--muted); letter-spacing: 0; }
.home .home-foot { padding-top: 40px; }
.composer, .composer-shell .composer { padding: 16px 16px 12px; border-radius: var(--r-xl); box-shadow: none; }
.composer textarea { border: 0; background: transparent; padding: 0; border-radius: 0; font-size: 14px; line-height: 1.7; }
.home .composer textarea { min-height: 72px; }
.composer:focus-within, .composer-shell .composer:focus-within { border-color: var(--muted); box-shadow: none; }
.composer-tray { padding: 8px 2px 0; gap: 4px; }
.composer .bar { gap: 4px; margin-top: 16px; flex-wrap: wrap; }
.composer-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-left: auto; max-width: 100%; min-width: 0; }
.composer-actions > .pick:last-of-type { min-width: 0; }
.composer-actions > .pick:last-of-type > button { min-width: 0; max-width: 100%; }
.composer .bar > .pick { flex-shrink: 0; }
.composer .bar > .send { flex-shrink: 0; }
.composer .bar .pick > button, .composer-tray .pick > button { height: 32px; font-size: 12px; }
.send { width: 32px; height: 32px; border-radius: 50%; }
.send.idle, .send:disabled { background: var(--fill-2); color: var(--faint); }
.scenes { margin-top: 32px; gap: 16px; }
.scene-tabs { background: transparent; padding: 0; flex-wrap: wrap; }
.scene-tabs button { height: 32px; padding: 0 10px; font-size: 13px; }
.scene-tabs button.active { font-weight: 600; }
.tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tpl { padding: 14px; min-height: 76px; border-radius: var(--r-lg); background: transparent; }
.tpl:hover { background: var(--fill); border-color: var(--border); }
.tpl .tt b { font-size: 14px; font-weight: 600; }
.tpl .tt small { display: block; font-size: 13px; line-height: 1.6; color: var(--muted); white-space: normal; }
.tpl .ti { color: var(--muted); background: transparent; }
.page { padding: 40px; }
.page-inner { max-width: var(--page-width); }
.page-inner { container: page-content / inline-size; }
@container page-content (max-width: 680px) {
  .lcard { flex-wrap: wrap; gap: 10px; align-items: center; }
  .lcard > .main { flex: 1 1 calc(100% - 60px); }
}
.page h1, .page-head h1, .admin-main .page-head h1 { font-size: 24px; font-weight: 600; letter-spacing: -.4px; line-height: 1.4; }
.page .sub, .page-head .sub { font-size: 13px; line-height: 1.7; margin-top: 8px; }
.page-head { margin-bottom: 28px; gap: 16px; }
.page-actions { gap: 8px; }
.gcard, .lcard, .proj-card, .pack-card, .viz-card, .rollout-card { border-radius: var(--r-lg); padding: 20px; box-shadow: none; }
.gcard .nm, .lcard .nm, .pack-card-head h3 { font-size: 14px; font-weight: 600; }
.gcard .ds, .gcard .cat, .lcard .desc, .pack-description { font-size: 13px; line-height: 1.7; }
.pack-members { font-size: 13px; }
.empty-state { border: 0; min-height: 240px; }
.empty-symbol { background: transparent; }
.settings-layout .section { padding: 0; border: 0; border-radius: 0; background: transparent; }
.settings-layout .srow { padding: 22px 0; gap: 24px; }
.settings-layout .sl b { font-size: 14px; font-weight: 500; }
.settings-layout .sl small { font-size: 13px; line-height: 1.7; }
.settings-nav a, .admin-rail a { min-height: 36px; font-size: 13px; }
.admin-layout:not(.settings-layout) .admin-rail .rail-group { gap: 3px; }
.admin-layout:not(.settings-layout) .admin-rail a { min-height: 38px; font-size: 14px; }
.admin-layout:not(.settings-layout) .admin-rail a.active { font-weight: 600; }
.admin-main .viz-sub, .admin-main p.faint[style*="font-size"] { font-size: 13px !important; line-height: 1.7; }
.settings-layout .admin-rail .rail-group { gap: 3px; }
.settings-layout .admin-rail a { min-height: 38px; font-size: 14px; }
.settings-layout .admin-rail a.active { font-weight: 600; }
.settings-layout .sl b { font-size: 14px; font-weight: 600; }
.settings-layout .sl small, .settings-layout .page-head .sub { font-size: 13px; line-height: 1.7; }
.settings-layout .settings-about { display: flex; align-items: flex-start; gap: 16px; padding: 22px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.settings-layout { container: settings / inline-size; }
@container settings (max-width: 600px) {
  .settings-layout .srow { flex-direction: column; align-items: stretch; gap: 10px; }
  .settings-layout .srow .sc { width: 100%; min-width: 0; justify-content: flex-start; }
  .settings-layout .choice-control { width: 100%; }
}
.settings-about-mark { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 11px; background: var(--text); color: var(--panel); font-size: 18px; font-weight: 600; }

/* 会话页：统一正文、输入区和操作控件的尺度。 */
.task-head { min-height: 46px; padding: 7px 20px; border-bottom: .5px solid var(--border); }
.task-head .title { max-width: 320px; }
.conversation .msgs-inner, .task-foot .composer, .task-foot > .local-folders, .task-foot .queue, .conversation-plan { max-width: 768px; }
.conversation .final, .conversation .final .response-lead { font-size: 14px; line-height: 1.625; }
.task-foot .composer { border-radius: 24px; }
.conversation .turn .assistant-mark, .conversation .turn .assistant-name { display: none; }
.conversation .turn .who { margin-bottom: 8px; }
.jump-latest { width: 32px; height: 32px; justify-content: center; padding: 0; border-radius: 50%; bottom: calc(100% + 24px); }
@media (max-width: 760px) {
}
.settings-about h2 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.settings-about p { max-width: 620px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.admin-rail .rail-h { font-size: 12px; letter-spacing: 0; }
.tbl-wrap { border-radius: var(--r-lg); }
.tbl th, .tbl td, .admin-main .tbl th, .admin-main .tbl td { padding: 12px 14px; }
.tbl th { color: var(--muted); background: var(--fill); font-size: 13px; }
.conversation { padding: 28px 32px; }
.conversation .msgs-inner, .msgs-inner, .task-foot .composer, .queue { max-width: var(--content-width); }
.conversation .md { font-size: 14px; line-height: 1.85; }
.conversation .u-msg { display: flex; flex-direction: column; align-items: flex-end; padding-bottom: 0; margin: 8px 0 32px; }
.conversation .u-msg .b { background: var(--user); font-size: 14px; }
.conversation .user-actions { margin-top: 3px; }
.conversation details.process { border: 0; padding: 0; margin: 0 0 16px; }
.conversation details.process > summary { font-size: 13px; line-height: 1.5; }
.conversation .step-d > summary, .conversation .tool-outcome { font-size: 13px; }
.conversation .turn .turn-status, .conversation .process-count { font-size: 12px; opacity: 1; }
.conversation .turn { margin-bottom: 36px; }
.task-foot { padding: 12px 32px 20px; }
.task-foot .composer { box-shadow: var(--shadow-composer); }
#panel { border: 0; border-left: 1px solid var(--border-2); border-radius: 0; box-shadow: none; }
.panel-tabs { min-height: 46px; padding: 6px 12px; border-bottom: .5px solid var(--border); } /* 与会话头部同高、同一条发丝线 */
.panel-tabs > button[data-tab] { border-radius: var(--r); padding: 0 10px; height: 32px; font-weight: 500; }
.panel-body { padding: 16px; }
.menu { border-radius: var(--r-lg); max-width: calc(100vw - 24px); }
.menu button.mi { min-height: 34px; }
.modal-card { border-radius: var(--r-xl); padding: 24px; }
.modal-card:has(> .modal-layout) { padding: 0; }
.modal-head h3 { font-size: 18px; }
.modal-foot { flex-wrap: wrap; }
.login-card { width: min(380px, 100%); max-width: 380px; padding: 32px; border-radius: var(--r-xl); }
.login-card h2 { margin: 0; font-size: 26px; font-weight: 500; }
.login-card .login-intro { margin: -6px 0 6px; color: var(--muted); font-size: 13px; }
.login-field { display: grid; gap: 6px; font-size: 13px; }
.login-field input, .login-card .btn { width: 100%; height: 40px; }
:where(button, a, summary, [tabindex]):focus-visible { outline: 2px solid var(--control-focus); outline-offset: 2px; }
.btn.lg { height: var(--h-lg); min-height: var(--h-lg); font-size: 13px; }
.btn.primary:disabled, .btn.ghost:disabled, .btn.danger:disabled { background: var(--fill); color: var(--faint); border-color: var(--border-2); }
.switch input { width: 1px; height: 1px; }
@media (max-height: 760px) and (min-width: 761px) {
  .home { padding-top: 36px; }
}
@media (max-width: 1100px) {
  .page { padding: 28px; }
}
@media (max-width: 760px) {
  #app { display: flex; }
  #main { border: 0; }
  #side { padding: 16px 0; overflow-y: auto; }
  #panel { border-left: 0; }
  #panel:not(.wide), #panel.wide { width: 100vw; }
  .home-topbar, .task-head { min-height: 52px; padding: 10px 16px; }
  .home { padding: 32px 20px 20px; }
  .home h1 { font-size: 24px; text-align: left; }
  .home-heading { text-align: left; }
  .home-heading p { font-size: 13px; }
  .page { padding: 24px 20px; }
  .page h1, .page-head h1, .admin-main .page-head h1 { font-size: 22px; }
  .page-head > .btn, .page-actions .btn { white-space: normal; height: auto; min-height: 36px; line-height: 1.5; padding: 8px 12px; }
  .page-actions .search-box, .page-actions .search-box input { width: 100%; }
  .scene-heading { gap: 12px; }
  .tpl-grid { grid-template-columns: 1fr; }
  .tpl { min-height: 68px; }
  .composer { padding: 14px 12px 10px; }
  .composer .bar { gap: 2px; }
  .composer-actions { gap: 2px; }
  .composer .permission-pick > button > span:not(.ic), .composer .permission-pick .caret { display: none; }
  .composer .bar .pick > button > span:not(.ic) { max-width: 64px; }
  .composer .bar .pick > button, .composer-tray .pick > button { min-height: 36px; }
  .conversation { padding: 20px 16px; }
  .task-foot { padding: 8px 12px 16px; }
  .settings-layout .srow { gap: 12px; }
  .settings-layout .sc, .settings-layout .choice-control { width: 100%; min-width: 0; }
  .modal-card, .login-card { padding: 24px; }
  .modal-card:has(> .modal-layout) { padding: 0; }
  .task-head .crumb, .task-head .crumb-sep, .task-head .xp { display: none; }
}
@media (hover: none) {
  .user-actions, .step-fork { opacity: 1; }
  .task-item .more, .proj-item .more { display: inline-flex; }
  .icon-btn, .side-foot .icon-btn, .msg-actions .icon-btn { min-width: 36px; min-height: 36px; }
}
@media (max-width: 380px) {
  .composer .bar > .pick:first-child > button > span:not(.ic), .composer .bar > .pick:first-child .caret { display: none; }
}
/* 仓库对话框：顶部的「不关联」选项 */
.repo-skip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; font-size: 12.5px; }

/* ---- 改进队列（提案账本） */
.proposal-card .badge { font-size: 12px; }
.proposal-card .org-head { flex-wrap: wrap; gap: 6px; }
.kv-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv-row:last-of-type { border-bottom: 0; }
.kv-row select { flex: 0 0 auto; }
ul.timeline { margin: 4px 0 0; padding-left: 18px; font-size: 12px; color: var(--muted); }
ul.timeline li { margin: 2px 0; }

/* 偏好画像 */
.pref-entry.faded { opacity: .7; }
.conf-bar { display: inline-block; width: 60px; height: 6px; border-radius: 3px; background: var(--border); vertical-align: middle; overflow: hidden; }
.conf-bar i { display: block; height: 100%; background: var(--accent, #3b82f6); }

.conversation .u-msg[hidden], .conversation .art-card[hidden], .delivery-more[hidden] { display: none; }
.message-editor { margin: 8px 0 24px auto; width: min(100%, 640px); padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); }
.message-editor textarea { width: 100%; min-height: 72px; resize: vertical; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; }
.message-editor p { margin: 8px 0; font-size: 12px; line-height: 1.5; }
.message-editor-actions { display: flex; justify-content: flex-end; gap: 8px; }
.tool-detail-box { margin-top: 8px; overflow: hidden; border: 1px solid var(--border-2); border-radius: 12px; background: var(--fill); }
.tool-detail-head, .tool-detail-footer { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; font-size: 12px; color: var(--muted); }
.conversation .step .tool-detail-box pre { margin: 0; padding: 10px; max-height: 144px; border: 0; border-radius: 0; font-size: 12px; overflow: auto; }
.tool-detail-footer { border-top: 1px solid var(--border-2); }
.conversation .deliverables { border: 1px solid var(--border-2); border-radius: 12px; overflow: hidden; }
.conversation .deliverables-title { margin: 0; padding: 10px 12px; font-size: 13px; font-weight: 500; border-bottom: 1px solid var(--border-2); }
.conversation .art-cards { display: flex; flex-direction: column; gap: 0; }
.conversation .art-card { min-height: 36px; padding: 4px 10px; border: 0; border-radius: 0; gap: 8px; }
.conversation .art-card .nm { font-size: 13px; white-space: nowrap; }
.conversation .art-card .meta { margin: 0; font-size: 12px; }
.conversation .delivery-more { margin: 4px 10px 8px; }

/* 会话排版在通用页面规则之后生效。 */
.conversation .msgs-inner, .task-foot .composer, .task-foot > .local-folders, .task-foot .queue, .conversation-plan { max-width: 768px; }
.conversation .final, .conversation .final .response-lead { font-size: 14px; line-height: 1.625; }
.conversation .u-msg .b { max-width: 70%; border-radius: 22px; padding: 10px 16px; line-height: 1.625; }
.conversation .turn .turn-status { margin-left: 0; }
.conversation .turn[data-status="done"] .who { display: none; }
.conversation .code-wrap { border-radius: 20px; }
.conversation .code-bar { pointer-events: auto; gap: 8px; }
.conversation .code-bar > span { margin-right: auto; }
.conversation .code-wrap.wrap-lines pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.conversation .code-bar .icon-btn { margin-left: 0; }
.task-foot .queue { max-height: 30dvh; overflow-y: auto; }
.task-foot .composer[hidden], .interrupt-panel[hidden] { display: none; }
.interrupt-panel { width: min(100%, 768px); margin: 0 auto; max-height: min(50dvh, 480px); overflow-y: auto; }
.interrupt-panel .approval { margin: 0; border-radius: 20px; box-shadow: none; }
.interrupt-panel .acts { justify-content: flex-end; }
.interrupt-panel .acts input { flex: 1 1 180px; }
.approval-command-full summary { color: var(--muted); cursor: pointer; font-size: 12px; }
.approval-command-full summary:hover { color: var(--text); }
.approval-command-preview[hidden] { display: none; }
.queue .q .queue-grip { flex: none; overflow: visible; color: var(--muted); cursor: grab; user-select: none; letter-spacing: -3px; padding-right: 4px; }
.queue .q[draggable="true"]:active .queue-grip { cursor: grabbing; }
.queue-move { flex: none; }
@media (max-width: 760px) {
  .task-head { min-height: 46px; padding: 7px 12px; }
  .conversation .u-msg .b { max-width: 90%; }
}
/* 会话页 S1：头部右侧为「更多 / 用量 | 面板开关」，按钮组之间 16px 竖线；输入区上方 32px 渐隐。 */
.task-head .head-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-shrink: 0; }
.task-head .head-sep { width: 1px; height: 16px; margin: 0 4px; background: var(--border); flex-shrink: 0; }
.task-head .run-usage[hidden] { display: none; }
.task-foot::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 32px; pointer-events: none; background: linear-gradient(to bottom, transparent, var(--panel)); }
.approval b { font-weight: var(--font-weight-semibold); }
/* 窄桌面（761–1180px）结果区浮在对话上方：保留浮层的边线、圆角和阴影（此前被通用 #panel 规则抹掉） */
@media (min-width: 761px) and (max-width: 1180px) {
  #panel { border: .5px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--pop); }
}
/* ================================================================ 会话页 S2：消息与工作日志（对齐 Codex） */
/* 助手不显示头像、名字和状态行；状态由工作日志表达 */
.conversation .turn .who { display: none; }
/* 闪光文字：正在思考 / 处理中 / 正在运行；系统要求减少动效时只保留文字 */
.shimmer, .conversation .step.running .step-d > summary .lbl {
  background: linear-gradient(90deg, var(--faint) 0%, var(--faint) 40%, var(--text) 50%, var(--faint) 60%, var(--faint) 100%);
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 2.2s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .shimmer, .conversation .step.running .step-d > summary .lbl { animation: none; background: none; color: var(--muted); }
}
.conversation .thinking { color: var(--faint); font-size: 14px; }
/* 工作日志标题：运行中「已处理 {time}」+ 横线；结束后「用时 {time}」，展开时箭头转 90° */
.conversation details.process > summary { width: 100%; gap: 8px; color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.conversation details.process > summary:hover { color: var(--text); }
.conversation details.process > summary .chev { flex-shrink: 0; transition: transform var(--dur-1) var(--ease); }
.conversation details.process:not([open]) > summary .chev { transform: none; }
.conversation details.process[open] > summary .chev { transform: rotate(90deg); }
.conversation .turn:not([data-status]) details.process > summary::after { content: ""; flex: 1; height: .5px; background: var(--border); }
/* 步骤：一行文字、第三级色，悬停或展开时为正文色；不画图标和竖线 */
.conversation details.process .steps { margin: 4px 0 2px; padding-left: 0; border-left: 0; }
.conversation .step { padding: 2px 0; gap: 8px; color: var(--faint); }
.conversation .step-d > summary { color: var(--faint); min-height: 24px; }
.conversation .step:hover .step-d > summary, .conversation .step-d[open] > summary { color: var(--text); }
.conversation .step-d .lbl { color: inherit; font-weight: 400; flex-shrink: 0; }
.conversation .step-d > summary .arg, .conversation .step-d > summary .arg.path { color: inherit; }
.conversation .step-d > summary .arg.cmd { font-family: var(--font-code); font-size: 12px; color: inherit; }
.conversation .step.note .body { color: var(--muted); }
.conversation .step .stt.paused, .conversation .step .stt.bad { font-size: 12px; }
/* Shell 框：$ 命令、输出（最高 144px，打开时滚到最新）、底栏状态与复制 */
.conversation .step .shell-box { margin-top: 6px; border: .5px solid var(--border); border-radius: var(--r-lg); background: var(--code); overflow: hidden; }
.conversation .step .shell-box pre { margin: 0; padding: 10px 12px; border: 0; border-radius: 0; background: none; max-height: none; font: 12px/1.6 var(--font-code); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.conversation .step .shell-box .shell-out { max-height: 144px; overflow: auto; color: var(--muted); border-top: .5px solid var(--border-2); }
.shell-out[hidden] { display: none; }
.shell-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; padding: 2px 4px 2px 12px; border-top: .5px solid var(--border-2); font-size: 12px; color: var(--faint); }
.shell-status.bad { color: var(--danger); }
.shell-actions { display: flex; gap: 4px; }
/* 推理：「正在思考」→「已思考 {elapsed}」，默认收起，正文 60% 透明度、最高 140px */
.conversation details.reason-item { display: block; padding: 2px 0; }
.conversation .reason-item > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 24px; color: var(--faint); font-size: 13px; }
.conversation .reason-item > summary::-webkit-details-marker { display: none; }
.conversation .reason-item > summary:hover { color: var(--text); }
.conversation .reason-item > summary .chev { transition: transform var(--dur-1) var(--ease); }
.conversation .reason-item[open] > summary .chev { transform: rotate(90deg); }
.reason-body { margin: 4px 0 6px; max-height: 140px; overflow: auto; opacity: .6; font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
/* 助手操作行：悬停或聚焦时显示，最后一轮常显；触屏常显 */
.conversation .turn .msg-actions { opacity: 0; transition: opacity var(--dur-1) var(--ease); }
.conversation .turn:is(:hover, :focus-within) .msg-actions, .conversation article.turn:last-of-type .msg-actions { opacity: 1; }
@media (hover: none) { .conversation .turn .msg-actions { opacity: 1; } }
/* 计划药丸：「第 n / m 步」+ 蓝点，悬停或点开看步骤 */
.task-foot .conversation-plan { position: relative; width: min(100%, 768px); max-width: none; margin: 0 auto 8px; border: 0; border-radius: 0; background: none; }
.task-foot .conversation-plan > summary { display: inline-flex; align-items: center; gap: 6px; height: var(--h-sm); padding: 0 10px; border: .5px solid var(--border); border-radius: 999px; background: var(--card); color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.task-foot .conversation-plan > summary:hover { color: var(--text); }
.plan-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--link); flex-shrink: 0; }
.task-foot .conversation-plan .plan-items { display: none; position: absolute; left: 0; bottom: 100%; z-index: 20; width: min(380px, 100%); max-height: 260px; overflow: auto; margin: 0; padding: 8px 12px; list-style: none; border: .5px solid var(--border); border-top: .5px solid var(--border); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--pop); }
.task-foot .conversation-plan:is([open], :hover, :focus-within) .plan-items { display: block; }
.task-foot .conversation-plan .plan-items .todo { font-size: 13px; padding: 4px 0; }
/* 计划完成后：实施此计划？ */
.plan-confirm { flex-wrap: wrap; align-items: center; }
.plan-confirm-q { color: var(--text); font-weight: var(--font-weight-medium); margin-right: 4px; }
.conversation details.process.empty > summary { pointer-events: none; }
.conversation details.process.empty > summary .chev { display: none; }
/* ================================================================ 会话页 S3：输入框与运行中逻辑（对齐 Codex） */
/* 单按钮：停止为圆里 11px 圆角方块；第一次按 Esc 显示「Esc」；停止 / 失败后输入为空时为「继续」 */
.send .stop-mark { width: 11px; height: 11px; border-radius: 3px; background: currentColor; }
.send .esc { font: 600 11px/1 var(--font-ui); letter-spacing: 0; }
.send.stop.armed { width: auto; min-width: 44px; padding: 0 10px; border-radius: 999px; }
.send.resume { width: auto; padding: 0 12px 0 10px; gap: 4px; border-radius: 999px; display: inline-flex; align-items: center; font-size: 13px; font-weight: var(--font-weight-medium); }
/* 运行中提示：「Ctrl+Enter 稍后发送」可点，替代单独的按钮 */
.composer-queue-hint .linkish { border: 0; padding: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.composer-queue-hint .linkish:hover:not(:disabled) { color: var(--text); }
.composer-queue-hint .linkish:disabled { cursor: default; text-decoration: none; opacity: .7; }
/* 审批：小标签 + 问句标题；「拒绝 Esc」与分体按钮「允许一次 Enter ▾」 */
.approval-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.approval-head h4 { margin: 0; }
.approval-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--fill); color: var(--muted); font-size: 12px; flex-shrink: 0; }
.approval.outbound .approval-tag { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.approval-req + .approval-req { margin-top: 10px; }
.approval .acts kbd { display: inline; margin-left: 6px; font: 12px var(--font-ui); color: inherit; opacity: .6; background: none; border: 0; padding: 0; box-shadow: none; }
.split-btn { display: inline-flex; }
.split-btn > .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split-btn > .split-caret { width: var(--h); min-width: var(--h); padding: 0; justify-content: center; border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: .5px solid color-mix(in srgb, var(--accent-text) 30%, transparent); }
