:root {
  --bg: #0b1020;
  --panel: #111827;
  --panel-2: #1a2435;
  --line: #273449;
  --text: #e8edf5;
  --muted: #91a0b5;
  --primary: #ff8a3d;
  --ok: #38b48b;
  --warn: #d0a215;
  --err: #e2564a;
  --run: #4a9eff;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  display: flex; flex-direction: column; overflow: hidden;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid var(--line); flex: none;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--primary); color: #14161a; font-weight: 800; font-size: 13px;
}
h1 { font-size: 15px; margin: 0; }
.sub { margin: 0; color: var(--muted); font-size: 12px; }
.meta { display: flex; align-items: center; gap: 8px; }
.chip {
  font-size: 12px; color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 10px; background: var(--panel);
}
.brancher { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.brancher select {
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 8px; font-size: 12px; max-width: 240px;
}

/* ---------- 主框架 ---------- */
.shell { flex: 1; display: flex; min-height: 0; }
.side {
  width: 172px; flex: none; border-right: 1px solid var(--line);
  padding: 12px 8px; display: flex; flex-direction: column; gap: 4px; background: #12151b;
}
.side button {
  display: flex; justify-content: space-between; align-items: center;
  background: transparent; border: 0; color: var(--muted); text-align: left;
  padding: 9px 12px; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.side button:hover { background: #1a1e26; color: var(--text); }
.side button.active { background: var(--panel-2); color: var(--text); font-weight: 600; }
.side .count { font-size: 11px; color: var(--muted); }
.side .running-dot { color: var(--run); }

main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.tabs {
  display: flex; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--line);
  overflow-x: auto; flex: none;
}
.tabs button {
  white-space: nowrap; background: transparent; border: 1px solid var(--line);
  color: var(--muted); padding: 5px 12px; border-radius: 999px; font-size: 12px; cursor: pointer;
}
.tabs button.active { color: #14161a; background: var(--primary); border-color: var(--primary); font-weight: 600; }
.tabs .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-left: 6px; vertical-align: middle; }
.dot.running { background: var(--run); }
.dot.failed { background: var(--err); }
.dot.succeeded { background: var(--ok); }
.dot.stopped { background: var(--warn); }

/* ---------- 任务面板 ---------- */
.panel { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px 16px; gap: 10px; }
.empty { color: var(--muted); font-size: 13px; margin: auto; }
.taskhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex: none; }
.taskhead h2 { margin: 0; font-size: 15px; }
.taskhead p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.actions { display: flex; gap: 8px; align-items: center; }
.btn {
  border: 0; border-radius: 8px; padding: 7px 14px; font-size: 12px; cursor: pointer;
  background: var(--primary); color: #14161a; font-weight: 600;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 500; }
.pill { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.pill.running { color: var(--run); border-color: #234a72; background: #12233a; }
.pill.succeeded { color: var(--ok); border-color: #1d4a3a; background: #0f2a22; }
.pill.failed { color: var(--err); border-color: #5a2620; background: #2a1210; }
.pill.stopped { color: var(--warn); border-color: #4d3c12; background: #2a220c; }
.cmd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: #7f8797;
  background: #10131a; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px;
  white-space: pre-wrap; word-break: break-all; flex: none; max-height: 74px; overflow: auto;
}
.log {
  flex: 1 1 auto; min-height: 160px; margin: 0; padding: 10px 12px; overflow: auto;
  background: #0b0d12; border: 1px solid var(--line); border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
}
.l-stdout { color: #d7dce5; }
.l-stderr { color: #ff9d93; }
.l-system { color: #7f8797; font-style: italic; }
.logtools { display: flex; gap: 8px; align-items: center; flex: none; color: var(--muted); font-size: 12px; }

/* ---------- 说明块 ---------- */
.tabs .spacer { flex: 1; }
.teach {
  flex: none; border: 1px solid var(--line); border-radius: 10px;
  background: #131720; font-size: 12.5px;
}
.teach summary {
  cursor: pointer; padding: 8px 12px; color: var(--muted); user-select: none;
}
.teach summary:hover { color: var(--text); }
.teach-body {
  padding: 2px 14px 12px; display: flex; flex-direction: column; gap: 6px; color: #c6ccd8;
}
.teach-body p { margin: 0; line-height: 1.7; }
.teach-body b { color: var(--primary); font-weight: 600; margin-right: 6px; }
.teach-body ul { margin: 0; padding-left: 18px; color: #aab1bf; }
.teach-body li { margin: 2px 0; }
.logtools input[type="search"] {
  flex: 1; max-width: 280px;
  background: #10131a; color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 10px; font-size: 12px; font-family: inherit;
}
.logtools input[type="search"]::placeholder { color: #5f6774; }

/* ---------- 总览 ---------- */
.overview { display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.envgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.envcard {
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  padding: 14px; display: flex; flex-direction: column; gap: 8px;
}
.envcard.wide { background: #131720; }
.envhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.envhead b { font-size: 14px; }
.envsub { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.envsub code { background: #10131a; border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; font-size: 11px; }
.envlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.envlist li {
  display: grid; grid-template-columns: minmax(90px, max-content) minmax(0, 1fr);
  align-items: start; gap: 3px 10px; font-size: 12.5px; color: #c6ccd8;
}
.envlist a {
  min-width: 0; color: #9db8dc; font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere; text-decoration: none;
}
.envlist a:hover { color: #c5dcff; text-decoration: underline; }
.envlist em { font-style: normal; color: var(--muted); }
.envlist em { grid-column: 2; font-size: 11px; overflow-wrap: anywhere; }
.envvalue { min-width: 0; color: #aab1bf; overflow-wrap: anywhere; }
.envlist em.running { color: var(--run); }
.envlist em.succeeded { color: var(--ok); }
.envlist em.failed { color: var(--err); }
.envacts { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.envtag {
  font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px;
  vertical-align: middle; margin-left: 6px;
}
.envtag.dev { color: #7fb2ff; background: #16263c; border: 1px solid #234a72; }
.envtag.prod { color: #ffb27a; background: #2a1d10; border: 1px solid #5a3a1c; }
.onlyerr { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; cursor: pointer; }

/* ---------- 任务参数 ---------- */
.paramrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: none; }
.paramrow label { font-size: 12px; color: var(--muted); }
.paramrow input {
  flex: 1; min-width: 260px; max-width: 420px;
  background: #10131a; color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; font-size: 12px; font-family: ui-monospace, Menlo, monospace;
}
.paramhint { font-size: 11px; color: #5f6774; }

/* ---------- 设置弹窗 ---------- */
dialog.settings {
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  color: var(--text); padding: 20px; width: 420px; max-width: 92vw;
}
dialog.settings::backdrop { background: rgba(0,0,0,.55); }
dialog.settings h3 { margin: 0 0 4px; font-size: 15px; }
dialog.settings label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); margin-top: 12px; }
dialog.settings input {
  background: #10131a; color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: ui-monospace, Menlo, monospace;
}
dialog.settings .hint { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---------- 环境过滤条 ---------- */
.envbar { display: inline-flex; gap: 4px; padding: 2px 8px 2px 0; border-right: 1px solid var(--line); margin-right: 6px; }
.envchip {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  font-size: 12px; padding: 3px 9px; border-radius: 999px; cursor: pointer;
}
.envchip:hover { color: var(--text); }
.envchip.active { color: var(--text); background: var(--panel-2); border-color: var(--line); font-weight: 600; }

.tabnone { font-size: 12px; color: var(--muted); padding: 5px 4px; }

/* ---------- 视觉层级与响应式布局 ---------- */
body {
  background:
    radial-gradient(ellipse at 68% -18%, rgba(52, 86, 132, .18), transparent 42%),
    var(--bg);
}
button, input, select { font: inherit; }
button { transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid rgba(255, 138, 61, .8);
  outline-offset: 2px;
}

.topbar {
  min-height: 76px;
  padding: 12px 24px;
  background: rgba(13, 19, 32, .88);
  border-bottom-color: rgba(145, 160, 181, .16);
}
.brand { gap: 14px; }
.logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, #ffab66, #f4772c);
  box-shadow: 0 6px 20px rgba(255, 122, 26, .2);
}
h1 { font-size: 16px; letter-spacing: .02em; }
.meta { gap: 10px; }
.chip {
  padding: 5px 11px;
  background: rgba(17, 24, 39, .78);
  border-color: rgba(145, 160, 181, .18);
}
.brancher select {
  padding: 7px 10px;
  background-color: var(--panel);
  border-color: rgba(145, 160, 181, .2);
}

.shell { min-height: 0; }
.side {
  width: 204px;
  padding: 18px 12px;
  gap: 6px;
  background: rgba(13, 19, 32, .72);
  border-right-color: rgba(145, 160, 181, .14);
}
.side button {
  position: relative;
  min-height: 44px;
  padding: 10px 12px 10px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
}
.side button:hover { background: rgba(255, 255, 255, .045); }
.side button.active {
  color: #fff;
  background: linear-gradient(100deg, rgba(255, 138, 61, .14), rgba(255, 138, 61, .035));
  border-color: rgba(255, 138, 61, .16);
}
.side button.active::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 3px;
  border-radius: 3px;
  background: var(--primary);
  content: "";
}
.side .count { color: #a7b3c5; }

.tabs {
  min-height: 62px;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: rgba(15, 23, 38, .56);
  border-bottom-color: rgba(145, 160, 181, .14);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button:not(.btn) {
  padding: 7px 13px;
  border-color: rgba(145, 160, 181, .16);
  background: rgba(17, 24, 39, .55);
}
.tabs button:not(.btn):hover {
  color: var(--text);
  border-color: rgba(145, 160, 181, .32);
  background: rgba(255, 255, 255, .045);
}
.tabs button.active:not(.envchip) {
  color: #1c1b19;
  background: linear-gradient(135deg, #ffad70, #ff8538);
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(255, 122, 26, .16);
}
.envbar {
  gap: 3px;
  padding-right: 10px;
  border-right-color: rgba(145, 160, 181, .18);
}
.envchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
}
.envcount {
  display: inline-grid;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  place-items: center;
  border-radius: 999px;
  background: rgba(145, 160, 181, .12);
  color: #aab8ca;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.envchip.active {
  color: var(--text);
  background: rgba(145, 160, 181, .12);
  border-color: rgba(145, 160, 181, .12);
}
.tabs button.envchip.active {
  color: var(--text);
  background: rgba(145, 160, 181, .12);
  border-color: rgba(145, 160, 181, .12);
}
.tabs button.envchip.active .envcount {
  background: rgba(255, 255, 255, .1);
  color: var(--text);
}

.panel { padding: 22px 24px; gap: 14px; }
.taskhead {
  align-items: center;
  padding: 18px 20px;
  background: linear-gradient(120deg, rgba(26, 36, 53, .9), rgba(17, 24, 39, .82));
  border: 1px solid rgba(145, 160, 181, .16);
  border-radius: 14px;
}
.taskhead h2 { font-size: 17px; letter-spacing: .01em; }
.taskhead p { margin-top: 5px; font-size: 13px; }
.actions { gap: 9px; }
.btn {
  padding: 8px 15px;
  border-radius: 9px;
  background: linear-gradient(135deg, #ffa263, #ff8135);
  box-shadow: 0 3px 12px rgba(255, 122, 26, .13);
}
.btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); }
.btn.ghost {
  background: rgba(255, 255, 255, .025);
  border-color: rgba(145, 160, 181, .22);
  box-shadow: none;
}
.btn.ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, .07);
  border-color: rgba(145, 160, 181, .4);
}
.pill { padding: 4px 10px; background: rgba(17, 24, 39, .7); }
.teach {
  overflow: hidden;
  background: rgba(17, 24, 39, .64);
  border-color: rgba(145, 160, 181, .15);
}
.teach summary { padding: 10px 14px; }
.teach[open] summary { border-bottom: 1px solid rgba(145, 160, 181, .12); }
.teach-body { padding: 12px 16px 15px; }
.cmd {
  padding: 9px 12px;
  color: #aab8ca;
  background: rgba(8, 13, 23, .72);
  border-color: rgba(145, 160, 181, .14);
}
.log {
  padding: 14px 16px;
  background: rgba(7, 11, 19, .82);
  border-color: rgba(145, 160, 181, .16);
  border-radius: 12px;
}
.logtools { gap: 10px; }
.logtools input[type="search"], .paramrow input, dialog.settings input {
  border-color: rgba(145, 160, 181, .2);
  background: rgba(8, 13, 23, .72);
}

.overview { gap: 14px; }
.envgrid { gap: 14px; }
.envcard {
  padding: 17px;
  gap: 10px;
  background: linear-gradient(145deg, rgba(22, 32, 49, .92), rgba(15, 23, 38, .9));
  border-color: rgba(145, 160, 181, .16);
  border-radius: 14px;
}
.envcard.wide { background: rgba(17, 24, 39, .78); }
.envhead b { font-size: 14px; }
.envlist { gap: 7px; }
.envlist li { align-items: baseline; }
.envacts { gap: 9px; }

dialog.settings {
  box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
}
dialog.settings input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

@media (max-width: 900px) {
  .topbar { padding-inline: 16px; }
  .side { width: 176px; }
  .panel { padding: 18px; }
  .tabs { padding-inline: 16px; }
}

@media (max-width: 680px) {
  html, body { min-height: 100%; height: auto; }
  body { min-height: 100dvh; overflow: auto; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 12px; padding: 14px 16px; }
  .meta { width: 100%; flex-wrap: wrap; }
  .brancher { flex: 1; min-width: 180px; }
  .brancher select { flex: 1; min-width: 0; max-width: none; }
  .shell { flex: 1; flex-direction: column; }
  .side {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(145, 160, 181, .14);
  }
  .side button { flex: none; min-height: 38px; padding: 8px 12px; }
  .side button.active::before { top: auto; right: 10px; bottom: 0; left: 10px; width: auto; height: 2px; }
  .tabs { min-height: 54px; padding: 8px 12px; }
  .panel { min-height: 60vh; padding: 14px 12px; }
  .taskhead { align-items: flex-start; flex-direction: column; padding: 15px; }
  .actions { width: 100%; flex-wrap: wrap; }
  .envgrid { grid-template-columns: minmax(0, 1fr); }
  .envlist li { overflow-wrap: anywhere; }
  .logtools { flex-wrap: wrap; }
  .logtools input[type="search"] { flex-basis: 100%; max-width: none; }
  .paramrow input { min-width: min(260px, 100%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* ---------- 日志滚动条（细、深色、悬停变亮） ---------- */
.log { scrollbar-width: thin; scrollbar-color: #333a47 transparent; }
.log::-webkit-scrollbar { width: 10px; height: 10px; }
.log::-webkit-scrollbar-track { background: transparent; }
.log::-webkit-scrollbar-thumb {
  background: #2b3140; border-radius: 999px; border: 2px solid transparent; background-clip: content-box;
}
.log:hover::-webkit-scrollbar-thumb { background: #3b4456; background-clip: content-box; }
.log::-webkit-scrollbar-thumb:hover { background: #4a5468; background-clip: content-box; }
.log::-webkit-scrollbar-corner { background: transparent; }

.followhint { font-size: 11px; color: var(--ok); }
.followhint.paused { color: var(--warn); }

/* 面板外层：让内部块按列排布并撑满剩余高度 */
.taskpane { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.taskbody { flex: 0 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }

/* ---------- 按环境分栏（可拖动分隔条） ---------- */
.split { flex: 1; min-height: 0; display: flex; gap: 10px; }
.envpane {
  flex: 1 1 0; min-width: 300px; min-height: 0; display: flex; flex-direction: column; gap: 10px;
  background: var(--card, #14181f); border: 1px solid var(--line, #232935); border-radius: 12px; padding: 12px;
}
.panehead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panetitle { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.pane-tasks { display: flex; flex-wrap: wrap; gap: 6px; }
.taskchip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; font-size: 12px;
  color: var(--text-dim, #9aa4b2); background: #1b2029; border: 1px solid #262d3a; border-radius: 999px;
  cursor: pointer;
}
.taskchip:hover { color: #fff; border-color: #38414f; }
.taskchip.active { color: #0b0e13; background: var(--accent, #ff8a3d); border-color: transparent; font-weight: 600; }
.taskchip .dot { width: 6px; height: 6px; border-radius: 50%; background: #666; }
.taskchip .dot.running { background: #3ddc97; }
.taskchip .dot.succeeded { background: #3ddc97; }
.taskchip .dot.failed { background: #ff5d5d; }
.pane-detail { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.splitter {
  flex: 0 0 8px; align-self: stretch; cursor: col-resize; border-radius: 4px; background: transparent;
  position: relative;
}
.splitter::after {
  content: ''; position: absolute; inset: 0 3px; border-radius: 2px; background: #232935;
}
.splitter:hover::after, .splitter.dragging::after { background: var(--accent, #ff8a3d); }
@media (max-width: 1100px) {
  .split { flex-direction: column; }
  .splitter { display: none; }
  .envpane { min-height: 320px; }
}

/* ---------- 顶部任务 tab（跨环境同一件事） ---------- */
.roletabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 0 0 auto; }
.roletab {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 13px;
  color: var(--text-dim, #9aa4b2); background: #151a22; border: 1px solid #232935; border-radius: 10px; cursor: pointer;
}
.roletab:hover { color: #fff; border-color: #38414f; }
.roletab.active { color: #fff; background: #1d232d; border-color: var(--accent, #ff8a3d); }
.rolecount { font-size: 11px; color: #8a94a3; background: #232935; border-radius: 999px; padding: 1px 7px; }
.roletab.active .rolecount { color: var(--accent, #ff8a3d); }
.panemuted { font-size: 12px; color: #6b7484; }
.pane-empty { font-size: 13px; color: #6b7484; padding: 16px 4px; }
.rolecount.running { color: #3ddc97; background: #1b2a22; }


/* ---------- 全局滚动条：细、深色、悬停变亮 ---------- */
* { scrollbar-width: thin; scrollbar-color: #2b3140 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #2b3140; border-radius: 999px; border: 2px solid transparent; background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: #455065; background-clip: content-box; }
*::-webkit-scrollbar-corner { background: transparent; }

/* 代码块/命令块不要被内容撑破；横向滚动也一样细 */
.cmd, .teach-body, .pane-detail, .log { min-width: 0; }
.envpane { min-width: 0; }

/* ---------- 栏折叠 ---------- */
.collapsebtn {
  margin-left: auto; width: 22px; height: 22px; line-height: 1; font-size: 15px; cursor: pointer;
  color: #8a94a3; background: #1b2029; border: 1px solid #262d3a; border-radius: 6px;
}
.collapsebtn:hover { color: #fff; border-color: #38414f; }
.envpane.collapsed { flex: 0 0 52px !important; min-width: 52px; padding: 10px 6px; align-items: center; overflow: hidden; }
.envpane.collapsed .panehead { flex-direction: column; gap: 10px; align-items: center; }
.envpane.collapsed .panetitle { flex-direction: column; gap: 6px; }
.envpane.collapsed .panetitle b { writing-mode: vertical-rl; letter-spacing: 2px; }
.envpane.collapsed .panemuted, .envpane.collapsed .running-dot { display: none; }

/* 不能折叠时的提示抖动 */
@keyframes shake-x { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
.collapsebtn.shake { animation: shake-x .3s ease; border-color: #ff8a3d; color: #ff8a3d; }

/* 窄栏防溢出：头部换行、文本块可收缩 */
.taskhead { flex-wrap: wrap; }
.taskhead > div:first-child { min-width: 0; flex: 1 1 220px; }
.taskhead .actions { flex-wrap: wrap; }
.envpane { min-width: 300px; }

/* 控制台环境徽标：测试=蓝，线上=橙，避免在错误的控制台里点危险操作 */
.envbadge {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; vertical-align: middle;
  background: #2a1a10; color: #ff9f5a; border: 1px solid #5a3218;
}
.envbadge[data-env='staging'] { background: #10222e; color: #58b7ff; border-color: #1d4a66; }

/* ---------- 登录浮层 ---------- */
.loginlayer { position: fixed; inset: 0; background: #0b0d12ee; display: grid; place-items: center; z-index: 50; }
.loginlayer[hidden] { display: none; }
.logincard { width: 340px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 4px; }
.logincard h2 { margin: 0 0 2px; font-size: 16px; }
.loginsub { color: var(--dim); font-size: 12px; margin: 0 0 10px; }
.logincard label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--dim); margin-bottom: 10px; }
.loginmsg { color: var(--bad); font-size: 12px; min-height: 16px; margin: 6px 0 0; }
.userchip { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); }
