* { box-sizing: border-box; }
body { margin: 0; font-family: var(--ff-sans); background: var(--bg-page); color: var(--fg-primary); }
.hidden { display: none !important; }
#login { max-width: 360px; margin: 80px auto; padding: 32px; background: #fff; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
#login input { width: 100%; padding: 10px; margin: 8px 0; border: 1px solid #ddd; border-radius: 4px; }
#login button { width: 100%; padding: 10px; background: var(--c-brand-500); color: #fff; border: none; border-radius: 4px; cursor: pointer; }
#login-err { color: #e74c3c; margin-top: 8px; }
h1, h2 { color: #2c3e50; }
.card { background: var(--bg-surface); border: 1px solid var(--bd-base); border-radius: var(--rd-lg); box-shadow: var(--sh-xs); padding: var(--sp-4); margin: var(--sp-3) 0; }

/* ---- 项目详情页布局工具类（CTRL 域 · 项目详情页布局优化改造范围 §6） ---- */
.pd-page { padding: 16px; }
.pd-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.pd-title { font-size: 18px; font-weight: 600; margin: 0; }
.pd-sub { font-size: 12px; color: var(--fg-tertiary); }
.pd-back { color: var(--c-brand-600); text-decoration: none; font-size: 13px; }
.pd-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.pd-grid-21 { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-bottom: 16px; }
.pd-kpi-label { font-size: 12px; color: var(--fg-second); }
.pd-kpi-num { font-size: 24px; font-weight: 700; margin: 4px 0; }
.pd-kpi-sub { font-size: 12px; color: var(--fg-tertiary); }
/* 详情页卡片内的按钮：仅重置全局 .card button 造成的布局位移（margin-top/height），颜色与边框由各按钮的 inline 或 .btn-secondary 决定 */
.pd-page .card { margin: 0; }
.pd-page .card button { margin-top: 0; height: auto; }
.btn-secondary { padding: 6px 14px; border: 1px solid var(--bd-strong); border-radius: var(--rd-md); background: var(--bg-surface); color: var(--fg-primary); cursor: pointer; font-size: var(--fs-13); }
.pd-page .card .btn-secondary { border: 1px solid var(--bd-strong); background: var(--bg-surface); color: var(--fg-primary); padding: 6px 14px; }
.btn-secondary:hover { background: var(--bg-hover); }
.pd-tabs-body { margin-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
.pd-timeline { border-left: 2px solid var(--bd-subtle); padding-left: 14px; margin-left: 4px; }
.pd-timeline-item { position: relative; padding: 6px 0; }
.pd-timeline-item .dot { position: absolute; left: -20px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--c-brand-500); border: 2px solid var(--bg-surface); box-shadow: 0 0 0 1px var(--bd-subtle); }
.tbl { width: 100%; border-collapse: collapse; background: var(--bg-surface); border: 1px solid var(--bd-base); border-radius: var(--rd-lg); overflow: hidden; }
.tbl th, .tbl td { padding: var(--sp-3) var(--sp-3); text-align: left; border-bottom: 1px solid var(--bd-subtle); font-size: var(--fs-13); }
.tbl th { background: var(--bg-sunken); font-weight: var(--fw-semi); color: var(--fg-second); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px var(--sp-2); border-radius: var(--rd-sm); font-size: var(--fs-11); font-weight: var(--fw-semi); line-height: 18px; white-space: nowrap; background: var(--c-idle-bg); color: var(--c-idle-fg); }
form label { display: block; margin: 10px 0 4px; font-size: 13px; font-weight: 600; }
form input, form select, form textarea { width: 100%; padding: 0 var(--sp-3); border: 1px solid var(--bd-strong); border-radius: var(--rd-md); font-family: inherit; font-size: var(--fs-13); height: var(--h-control); box-sizing: border-box; }
form button, .card button, #btn-upgrade { margin-top: var(--sp-3); padding: 0 var(--sp-4); height: var(--h-control); background: var(--c-brand-500); color: #fff; border: 1px solid var(--c-brand-500); border-radius: var(--rd-md); cursor: pointer; font-size: var(--fs-13); font-weight: var(--fw-medium); }
.row { display: flex; gap: 16px; }
.row > div { flex: 1; }
.log, .diff { background: #1e1e1e; color: #dcdcdc; padding: 14px; border-radius: 6px; max-height: 480px; overflow: auto; white-space: pre-wrap; font-size: 12px; line-height: 1.6; }
.interact { border: 2px solid #e67e22; }
.err { color: var(--c-bad-600); }
.hint { color: var(--fg-tertiary); font-size: var(--fs-13); }
code { font-size: 12px; }

/* ---- v1.2.0 版本升级页 ---- */
.muted { color: var(--fg-tertiary); font-size: var(--fs-13); }
.warn { background: var(--c-warn-bg); border-left: 3px solid var(--c-warn-500); padding: 10px 12px; border-radius: var(--rd-sm); font-size: var(--fs-13); color: var(--c-warn-fg); }
.ver { font-size: 24px; font-weight: 700; color: var(--c-brand-500); margin-top: 4px; }
.nowrap { white-space: nowrap; }
.tag { display: inline-block; padding: 2px 8px; border-radius: var(--rd-sm); font-size: var(--fs-12); background: var(--bg-sunken); color: var(--fg-second); }
.nowrap button { padding: 0 var(--sp-2); margin: 0 var(--sp-1) 0 0; font-size: var(--fs-12); height: var(--h-control-sm); border-radius: var(--rd-sm); background: var(--bg-surface); border: 1px solid var(--bd-base); color: var(--fg-second); cursor: pointer; }
.changelog { background: #1e1e1e; color: #dcdcdc; padding: 12px; border-radius: 6px; max-height: 320px; overflow: auto; white-space: pre-wrap; font-size: 12px; line-height: 1.6; margin: 0; }
.status-pending, .status-published, .status-rejected,
.status-running, .status-success, .status-failed {
  display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; line-height: 1.6;
}
.status-pending   { color: #8e44ad; background: #f3e8fb; }
.status-published { color: #2c3e50; background: #eaf2f8; }
.status-rejected  { color: #7f8c8d; background: #eceff1; }
.status-running   { color: #c77700; background: #fff4e0; }
.status-success   { color: #1e8449; background: #e7f7ee; }
.status-failed    { color: #c0392b; background: #fdecea; }
.btn-reject { background: #95a5a6; }
h3 { margin-top: 28px; color: #2c3e50; }
h4 { margin: 18px 0 6px; color: #2c3e50; }
hr { border: none; border-top: 1px solid #eee; margin: 18px 0; }

/* ---- v1.5.1 软件公司级登录页（整页科技背景 + 登录卡居中悬浮） ---- */
#login {
  position: relative;
  max-width: none; margin: 0; padding: 0;
  width: 100vw; height: 100vh;
  display: block; overflow: hidden;
  border-radius: 0; box-shadow: none;
  background:
    radial-gradient(ellipse at 78% 12%, rgba(52,152,219,.30), transparent 55%),
    radial-gradient(ellipse at 8% 92%, rgba(44,90,160,.45), transparent 55%),
    radial-gradient(ellipse at 50% 50%, rgba(52,152,219,.10), transparent 60%),
    linear-gradient(135deg, #0e1c33 0%, #16304f 55%, #1c4a74 100%);
}
/* 全页网格纹理 */
#login::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 45%, #000 25%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 45%, #000 25%, transparent 75%);
}
/* 左侧品牌区：已按用户要求整体移除，仅保留居中登录卡 */
/* 居中登录卡（悬浮于整页背景之上） */
.login-center {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.login-card {
  pointer-events: auto;
  width: 380px; padding: 46px 46px 40px;
  background: linear-gradient(160deg, rgba(20,42,74,.72), rgba(12,26,48,.82));
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 30px 80px rgba(4,16,34,.55),
    0 8px 24px rgba(4,16,34,.35),
    inset 0 1px 0 rgba(255,255,255,.08);
}
/* 卡内品牌区：logo 方标 + 白色大字（与整页背景协调） */
.login-brand { text-align: center; margin-bottom: 34px; }
.login-card .login-logo { display: flex; justify-content: center; align-items: center; gap: 13px; }
.login-card .logo-mark {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 23px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--c-brand-500), #2c5aa0);
  box-shadow: 0 8px 24px rgba(52,152,219,.4), inset 0 1px 0 rgba(255,255,255,.25);
}
.login-card .logo-name { font-size: 31px; font-weight: 800; letter-spacing: 6px; color: #fff; }
.login-sub {
  display: block; margin-top: 12px;
  font-size: 13px; color: rgba(234,243,251,.6); letter-spacing: 4px;
}
.login-field { margin-bottom: 20px; }
.login-field label {
  display: block; margin-bottom: 7px;
  font-size: 13px; font-weight: 600; color: rgba(234,243,251,.78); letter-spacing: 1px;
}
#login input {
  width: 100%; padding: 12px 14px;
  font-size: 14.5px; color: #eaf3fb;
  border: 1px solid rgba(255,255,255,.18); border-radius: 9px;
  background: rgba(255,255,255,.07);
  transition: border-color .15s, box-shadow .15s, background .15s;
  outline: none;
}
#login input::placeholder { color: rgba(234,243,251,.35); }
#login input:focus {
  border-color: #5db3ef; background: rgba(255,255,255,.11);
  box-shadow: 0 0 0 3px rgba(52,152,219,.25);
}
#login button {
  width: 100%; margin-top: 8px; padding: 13px;
  font-size: 15.5px; font-weight: 600; letter-spacing: 6px; text-indent: 6px;
  background: linear-gradient(135deg, #2f89cf, #2364a8);
  color: #fff; border: none; border-radius: 9px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(35,100,168,.45);
  transition: filter .15s, transform .1s;
}
#login button:hover { filter: brightness(1.12); }
#login button:active { transform: translateY(1px); }
#login-err { color: #ff8a7a; margin-top: 12px; font-size: 13px; text-align: center; min-height: 18px; }
/* 底部：一行对齐 + 备案链接 */
.login-powered {
  position: absolute; left: 0; right: 0; bottom: 26px; z-index: 2;
  text-align: center; font-size: 12.5px; letter-spacing: 1px;
  color: rgba(234,243,251,.5);
}
.login-powered .powered-row { display: flex; align-items: center; justify-content: center; gap: 12px; }
.login-powered .powered-row i { font-style: normal; color: rgba(234,243,251,.25); }
.login-powered b { color: rgba(234,243,251,.75); font-weight: 600; }
.login-powered .powered-icp { margin-top: 7px; font-size: 12px; color: rgba(234,243,251,.4); }
.login-powered .powered-icp a {
  color: rgba(234,243,251,.55); text-decoration: none; transition: color .15s;
}
.login-powered .powered-icp a:hover { color: #5db3ef; }

/* 登录页：账号登录 / 扫码登录 切换 */
.login-tabs {
  display: flex; gap: 6px; margin: 0 0 22px; background: rgba(255,255,255,.07);
  border-radius: 10px; padding: 4px;
}
.login-tab {
  flex: 1; padding: 9px 0; border: 0; border-radius: 8px; background: transparent;
  color: rgba(255,255,255,.7); font-size: 14px; cursor: pointer;
  transition: background .15s, color .15s;
}
.login-tab.active {
  background: #fff; color: #1d6df0; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.login-pane--scan { text-align: center; }
.scan-qr {
  width: 220px; height: 220px; margin: 6px auto 14px; background: #fff;
  border-radius: 12px; padding: 10px; display: flex; align-items: center; justify-content: center;
}
.scan-qr svg { width: 200px !important; height: 200px !important; display: block; }
.scan-status { font-size: 13px; color: rgba(255,255,255,.8); margin-bottom: 12px; }
.scan-status--err { color: #ffb4b4; }
.scan-status--ok { color: #9be7a8; }
.scan-refresh { margin: 0 auto; }
.scan-tip { margin-top: 14px; font-size: 12px; color: rgba(255,255,255,.45); }

/* 窄屏：登录卡自适应缩放 */
@media (max-width: 520px) {
  .login-card { width: 92vw; padding: 36px 24px 30px; }
}
.nav-act { font-size: 13px; opacity: .9; }
.nav-btn {
  padding: 5px 12px; font-size: 13px; color: #ecf0f1;
  background: transparent; border: 1px solid #5a6c7d; border-radius: 4px; cursor: pointer;
}
.nav-btn:hover { border-color: var(--c-brand-500); color: var(--c-brand-500); }

/* ---- v1.4.0 升级提醒横幅 ---- */
#update-notice { max-width: 1400px; margin: 0 auto; padding: 0 32px; }
.notice-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 14px; padding: 12px 16px;
  background: #eaf4ff; border: 1px solid #9dc7f0; border-left: 4px solid var(--c-brand-500); border-radius: 6px;
}
.notice-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c-brand-500); box-shadow: 0 0 0 4px rgba(52,152,219,.18); }
.notice-ver { font-size: 15px; }
.notice-title { font-size: 14px; color: #34495e; }
.notice-actions { margin-left: auto; display: flex; gap: 8px; }
.btn-primary { padding: 0 var(--sp-4); height: var(--h-control); background: var(--c-brand-500); color: #fff; border: 1px solid var(--c-brand-500); border-radius: var(--rd-md); cursor: pointer; font-size: var(--fs-13); font-weight: var(--fw-medium); }
.btn-primary:disabled { background: var(--c-n-400); border-color: var(--c-n-400); cursor: not-allowed; }
.btn-plain { padding: 0 var(--sp-4); height: var(--h-control); background: var(--bg-surface); color: var(--fg-second); border: 1px solid var(--bd-base); border-radius: var(--rd-md); cursor: pointer; font-size: var(--fs-13); font-weight: var(--fw-medium); }
.btn-plain:hover { border-color: var(--c-brand-500); color: var(--c-brand-600); }
#notice-progress { margin: 8px 0 0; padding: 12px 16px; background: #fff; border: 1px solid #eee; border-radius: 6px; font-size: 13px; }

/* ---- v1.8.0 升级进度弹窗（真实进度条 + 升级成功提示） ---- */
.upg-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 30, 48, .45); backdrop-filter: blur(2px);
}
.upg-box {
  width: 440px; max-width: 92vw; padding: 26px 28px 22px;
  background: #fff; border-radius: 14px;
  box-shadow: 0 24px 60px rgba(10, 22, 40, .35);
}
.upg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.upg-title { font-size: 16px; font-weight: 700; color: #2c3e50; }
.upg-status { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 10px; }
.upg-status.status-running { color: #c77700; background: #fff4e0; }
.upg-status.status-success { color: #1e8449; background: #e7f7ee; }
.upg-status.status-failed  { color: #c0392b; background: #fdecea; }
.upg-track {
  width: 100%; height: 12px; border-radius: 8px;
  background: #eef1f5; overflow: hidden;
}
.upg-fill {
  height: 100%; width: 0%;
  border-radius: 8px;
  background: linear-gradient(90deg, #2f89cf, var(--c-brand-500));
  background-size: 200% 100%;
  transition: width .6s ease;
  animation: upg-stripes 1.1s linear infinite;
}
.upg-fill { background-image: linear-gradient(90deg, var(--c-brand-500) 25%, #5db3ef 25%, #5db3ef 50%, var(--c-brand-500) 50%, var(--c-brand-500) 75%, #5db3ef 75%, #5db3ef 100%); background-size: 26px 26px; }
@keyframes upg-stripes { from { background-position: 0 0; } to { background-position: 26px 0; } }
.upg-row { display: flex; align-items: baseline; justify-content: space-between; margin-top: 10px; }
.upg-pct { font-size: 20px; font-weight: 800; color: var(--c-brand-500); font-variant-numeric: tabular-nums; }
.upg-stage { font-size: 13px; color: #34495e; }
.upg-msg { margin-top: 10px; font-size: 13px; color: #7f8c8d; min-height: 18px; }
.upg-detail {
  margin-top: 12px; max-height: 220px; overflow: auto;
  background: #1e1e1e; color: #dcdcdc; padding: 12px;
  border-radius: 6px; font-size: 12px; line-height: 1.6; white-space: pre-wrap;
}
.upg-actions { margin-top: 16px; text-align: right; }
.upg-close {
  padding: 7px 18px; background: var(--c-brand-500); color: #fff;
  border: none; border-radius: 5px; cursor: pointer; font-size: 13px;
}
.upg-close:hover { filter: brightness(1.1); }

/* =========================================================
   v1.2.0 任务看板 —— 专业调度中台风格
   ========================================================= */

/* 页面容器 */
.tasks-page { padding-bottom: 40px; }

/* 页面头部 */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 22px;
}
.page-header h2 { margin: 0 0 var(--sp-1); font-size: var(--fs-24); font-weight: var(--fw-bold); letter-spacing: -0.02em; color: var(--c-n-900); }
.page-subtitle { margin: 0; color: #7f8c8d; font-size: 13.5px; }
.btn-new-task {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; font-size: 13.5px; font-weight: 600;
  background: linear-gradient(135deg, #2f89cf, #2364a8);
  box-shadow: 0 6px 16px rgba(35,100,168,.32);
  transition: filter .15s, transform .1s, box-shadow .15s;
}
.btn-new-task:hover { filter: brightness(1.08); box-shadow: 0 8px 20px rgba(35,100,168,.4); }
.btn-new-task:active { transform: translateY(1px); }

/* 统计卡片 */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px; margin-bottom: 22px;
}
.metric-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; background: #fff; border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.04);
  cursor: pointer; transition: transform .12s, box-shadow .15s, border-color .15s;
  border: 1px solid transparent;
}
.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
  border-color: #dbe4ee;
}
.metric-card.active {
  border-color: var(--c-brand-500);
  box-shadow: 0 0 0 3px rgba(52,152,219,.12), 0 8px 20px rgba(0,0,0,.08);
}
.metric-ring {
  position: relative; width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--ring-color, var(--c-brand-500)) calc(var(--pct, 0) * 1%), #eef1f5 0);
}
.metric-ring::before {
  content: ''; position: absolute; inset: 4px; border-radius: 50%; background: #fff;
}
.metric-icon {
  position: relative; z-index: 1; width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.metric-all { background: #eaf4ff; color: var(--c-brand-500); --ring-color: var(--c-brand-500); }
.metric-run { background: #e7f7ee; color: #27ae60; --ring-color: #27ae60; }
.metric-warn { background: #fff4e6; color: #e67e22; --ring-color: #e67e22; }
.metric-ok  { background: #e6f7f4; color: #16a085; --ring-color: #16a085; }
.metric-err { background: #fdecea; color: #c0392b; --ring-color: #c0392b; }
.metric-body { display: flex; flex-direction: column; }
.metric-value { font-size: 26px; font-weight: 800; line-height: 1; color: #2c3e50; }
.metric-label { margin-top: 4px; font-size: 12.5px; color: #7f8c8d; }

/* 工具栏 */
.task-toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.search-box {
  position: relative; flex: 1 1 260px; min-width: 220px;
}
.search-box svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: #95a5a6; pointer-events: none;
}
.search-box input {
  width: 100%; padding: 9px 12px 9px 36px;
  border: 1px solid #dbe4ee; border-radius: 8px;
  font-size: 13.5px; background: #fff;
  transition: border-color .15s, box-shadow .15s; outline: none;
}
.search-box input:focus {
  border-color: var(--c-brand-500);
  box-shadow: 0 0 0 3px rgba(52,152,219,.12);
}
.filter-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 12px; border-radius: 16px; font-size: 12.5px;
  background: #fff; color: #5d6d7e; border: 1px solid #dbe4ee;
  cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--c-brand-500); color: var(--c-brand-500); }
.chip.active {
  background: #eaf4ff; color: #2364a8; border-color: var(--c-brand-500); font-weight: 600;
}

/* 任务表格卡片 */
.task-table-card {
  background: #fff; border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.04);
  overflow: hidden;
}
.task-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.task-table thead th {
  padding: 13px 14px; text-align: left; font-weight: 600; color: #5d6d7e;
  background: #f8fafc; border-bottom: 1px solid #eef1f5;
  font-size: 12px; letter-spacing: .3px; text-transform: uppercase;
}
.task-table tbody tr {
  border-bottom: 1px solid #f1f3f5;
  transition: background .12s;
}
.task-table tbody tr:hover { background: #f8fbff; }
.task-table tbody tr.task-status-running { background: #fafffd; }
.task-table tbody tr.task-status-await_human_input { background: #fffdfa; }
.task-table tbody tr.task-status-failed { background: #fffafa; }
.task-table tbody tr.task-status-running:hover { background: #f0fdf6; }
.task-table tbody tr.task-status-await_human_input:hover { background: #fff8ed; }
.task-table tbody tr.task-status-failed:hover { background: #fff2f0; }
.task-table td { padding: 14px; vertical-align: middle; }

.col-id { width: 50px; color: #95a5a6; font-variant-numeric: tabular-nums; }
.col-title { min-width: 260px; }
.col-machine { min-width: 150px; }
.col-status { width: 110px; }
.col-branch { width: 150px; }
.col-mr { width: 80px; }
.col-time { width: 110px; }
.col-action { width: 110px; text-align: right; }

.task-title {
  font-weight: 600; color: #2c3e50; margin-bottom: 5px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.task-summary {
  color: #7f8c8d; font-size: 12px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.machine-name {
  font-weight: 600; color: #34495e;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px;
}
.machine-meta { font-size: 11.5px; color: #95a5a6; margin-top: 3px; }

/* 状态徽章 */
.task-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600;
  white-space: nowrap;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  box-shadow: 0 0 0 2px currentColor;
  opacity: .35;
}

.branch-tag {
  display: inline-block; padding: 3px 8px;
  background: #f4f6f8; color: #5d6d7e; border-radius: 4px;
  font-size: 11.5px; max-width: 140px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task-mr {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600;
  background: #eaf4ff; color: #2364a8; text-decoration: none;
  transition: background .12s;
}
.task-mr:hover { background: #d6ebff; }
.task-mr-empty { background: #f4f6f8; color: #95a5a6; cursor: default; }

.time-relative { font-weight: 600; color: #34495e; font-size: 12.5px; }
.time-label { font-size: 11px; color: #95a5a6; margin-top: 2px; }

.btn-task-detail, .btn-task-warn {
  display: inline-block; padding: 5px 12px; border-radius: 5px;
  font-size: 12px; font-weight: 600; text-decoration: none; margin-left: 4px;
  transition: filter .12s;
}
.btn-task-detail { background: #f4f6f8; color: #5d6d7e; }
.btn-task-detail:hover { background: #eaf4ff; color: #2364a8; }
.btn-task-warn { background: #fff4e6; color: #c77700; }
.btn-task-warn:hover { background: #ffeacc; }
.btn-task-retry {
  margin-left: 6px;
  background: #fdecea;
  color: #c0392b;
  border: 1px solid #f5c6c0;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-task-retry:hover { background: #c0392b; color: #fff; border-color: #c0392b; }
.btn-task-retry:active { transform: translateY(1px); }

/* 空状态 */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 56px 24px; text-align: center;
  background: #fff; border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.04);
}
.empty-illustration { margin-bottom: 18px; }
.empty-state h3 { margin: 0 0 8px; color: #2c3e50; font-size: 17px; }
.empty-state p { margin: 0 0 20px; color: #7f8c8d; font-size: 13px; max-width: 360px; }

/* 任务详情页 */
.task-meta-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 18px; margin-bottom: 18px;
}
.task-meta-bar div { display: flex; flex-direction: column; gap: 4px; }
.task-meta-bar b { font-size: 11.5px; color: #95a5a6; text-transform: uppercase; letter-spacing: .5px; }
.task-meta-bar span, .task-meta-bar a { font-size: 13.5px; color: #2c3e50; font-weight: 500; }
.task-meta-bar a { color: var(--c-brand-500); text-decoration: none; }
.task-meta-bar a:hover { text-decoration: underline; }

/* 新建任务表单优化 */
.task-form .row { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; align-items: end; }
.task-form select, .task-form input, .task-form textarea {
  width: 100%;
  min-height: var(--h-control);
  height: auto;
  padding: 10px 12px; border: 1px solid #dbe4ee; border-radius: 8px;
  font-size: 13.5px; line-height: var(--lh-snug);
  transition: border-color .15s, box-shadow .15s; outline: none;
  box-sizing: border-box;
}
.task-form select {
  padding-right: 28px;
  appearance: auto;
  -webkit-appearance: menulist;
  text-overflow: ellipsis;
}
.task-form textarea { resize: vertical; }
.task-form select:focus, .task-form input:focus, .task-form textarea:focus {
  border-color: var(--c-brand-500); box-shadow: 0 0 0 3px rgba(52,152,219,.12);
}
.task-form button[type="submit"] {
  padding: 11px 22px; font-size: 14px; font-weight: 600;
  background: linear-gradient(135deg, #2f89cf, #2364a8);
  box-shadow: 0 6px 16px rgba(35,100,168,.28);
}

/* 自动路由提交开关 */
.auto-route-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: var(--sp-3);
  background: linear-gradient(135deg, rgba(52,152,219,.08), rgba(46,204,113,.08));
  border: 1px solid rgba(52,152,219,.35); border-radius: 10px;
}
.auto-route-text { display: flex; flex-direction: column; gap: 2px; }
.auto-route-text strong { font-size: 14px; color: var(--fg-primary); }
.auto-route-note {
  margin: -6px 0 12px; padding: 8px 12px; font-size: 12.5px;
  color: #1f7a4d; background: #e7f7ee; border: 1px dashed #27ae60; border-radius: 8px;
}
.auto-route-note[hidden] { display: none; }
/* 开关本体 */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute; inset: 0; cursor: pointer; border-radius: 999px;
  background: #cbd5e1; transition: background .2s;
}
.switch-track::before {
  content: ''; position: absolute; left: 3px; top: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s;
}
.switch input:checked + .switch-track { background: linear-gradient(135deg, #2f89cf, #2364a8); }
.switch input:checked + .switch-track::before { transform: translateX(20px); }
/* 自动路由开启时禁用手动目标选择 */
#target-select-row.is-locked select { background: #f1f5f9; color: var(--fg-tertiary); cursor: not-allowed; }

/* 响应式 */
@media (max-width: 900px) {
  .task-toolbar { flex-direction: column; align-items: stretch; }
  .search-box { flex: 1 1 auto; }
  .filter-chips { order: 3; }
  .task-table { min-width: 780px; }
  .task-table-card { overflow-x: auto; }
  .col-branch, .col-mr { display: none; }
}
@media (max-width: 640px) {
  .kx-main { padding: 16px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .page-header { flex-direction: column; align-items: flex-start; }
  .task-form .row { grid-template-columns: 1fr; }
}

/* ================= 智慧调度（多机任务路由器） ================= */
.router-page { max-width: 1180px; margin: 0 auto; }
.router-page .card { margin-bottom: 22px; }
.router-page h3 { font-size: 16px; margin: 0 0 10px; color: #1f2d3d; }

/* 能力矩阵 */
.matrix-wrap { overflow-x: auto; }
table.matrix { border-collapse: collapse; width: 100%; min-width: 920px; font-size: 13px; }
table.matrix th, table.matrix td { border: 1px solid #e7ecf3; padding: 8px 10px; text-align: center; }
table.matrix thead th { background: #f4f8fc; color: #5a6b7b; font-weight: 600; position: sticky; top: 0; }
table.matrix thead th i { display: block; font-style: normal; font-weight: 400; font-size: 10px; color: #97a6b5; }
table.matrix th.mc-name, table.matrix td.mc-name { text-align: left; min-width: 150px; background: #fafcfe; }
.mc-name { font-weight: 600; color: #1f2d3d; }
.mc-name .mc-id { display: block; font-size: 11px; color: #97a6b5; font-weight: 400; }
table.matrix td.cell.on { background: #e9f9ef; color: #1ca75c; font-weight: 700; }
table.matrix td.cell.off { color: #cdd6e0; }
.tools-cell { text-align: left !important; min-width: 180px; }
.tool-chip { display: inline-block; background: #eef4ff; color: #2f6bd0; border: 1px solid #d6e4fb;
  border-radius: 10px; padding: 1px 8px; font-size: 11px; margin: 1px 2px; white-space: nowrap; }
td.num { font-variant-numeric: tabular-nums; color: #44566c; }
.load-cell { min-width: 120px; }
.load-bar { height: 7px; background: #eef1f5; border-radius: 4px; overflow: hidden; display: inline-block; width: 70px; vertical-align: middle; }
.load-fill { display: block; height: 100%; border-radius: 4px; }
.load-fill.ok { background: #1ca75c; }
.load-fill.warn { background: #f0a90a; }
.load-fill.danger { background: #e74c3c; }
.load-num { font-size: 11px; color: #6b7a8a; margin-left: 6px; }

/* 域覆盖 */
.cov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cov-item { border: 1px solid #e7ecf3; border-radius: 10px; padding: 10px 12px; background: #fafcfe; }
.cov-head b { color: #2f6bd0; margin-right: 6px; }
.cov-head { font-size: 13px; margin-bottom: 6px; }
.cov-body { display: flex; flex-wrap: wrap; gap: 4px; }
.cov-chip { background: #e9f9ef; color: #1ca75c; border-radius: 8px; padding: 1px 8px; font-size: 11px; }

/* 推荐 / 迁移表单 */
.router-page .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 12px; }
.router-page .row .rg-field { display: flex; flex-direction: column; }
.router-page label { font-size: 12px; color: #6b7a8a; margin: 6px 0 4px; font-weight: 600; }
.router-page input, .router-page textarea, .router-page select {
  border: 1px solid #dde3ec; border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit;
  background: #fff; color: #1f2d3d; width: 100%; box-sizing: border-box;
}
.router-page textarea { resize: vertical; }
.router-page select[multiple] { min-height: 78px; }
.router-page .chk { font-size: 12px; color: #44566c; display: flex; align-items: center; gap: 6px; margin: 4px 0 10px; }
.btn-mini { cursor: pointer; border: 1px solid #dde3ec; background: #fff; border-radius: 6px; padding: 2px 8px; font-size: 11px; color: #2f6bd0; }

/* 推荐结果 */
.rec-result, .mig-result { margin-top: 12px; }
.rec-card { display: flex; align-items: center; gap: 12px; border: 1px solid #e7ecf3; border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.rec-card.sel { border-left: 4px solid #1ca75c; }
.rec-card.noselect { border-left: 4px solid #e0e6ee; background: #fafbfc; opacity: .8; }
.rec-rank { font-size: 18px; font-weight: 700; color: #97a6b5; min-width: 30px; text-align: center; }
.rec-name { font-weight: 600; color: #1f2d3d; font-size: 14px; }
.rec-name .star { color: #f0a90a; font-size: 12px; margin-left: 6px; }
.rec-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: #6b7a8a; margin-top: 4px; }
.rec-meta b { color: #1f2d3d; }
.badge { border-radius: 8px; padding: 1px 8px; font-size: 11px; }
.badge.sel { background: #e9f9ef; color: #1ca75c; }
.badge.noselect { background: #fdeaea; color: #d05050; }
.warn-reason { color: #d9882b; }

/* 投喂包 */
.feedpack-box { margin-top: 10px; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; }
.fp-head { background: #f4f8fc; padding: 6px 12px; font-size: 12px; color: #5a6b7b; display: flex; justify-content: space-between; align-items: center; }
.feedpack-box pre.log { margin: 0; max-height: 360px; overflow: auto; font-size: 12px; background: #fbfcfe; }
.ok-msg { color: #1ca75c; font-weight: 600; }
.err { color: #d05050; }

/* ---- v1.8.0 远程终端（WebShell 反向隧道） ---- */
.wt-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.wt-toolbar select,
.wt-toolbar button { padding: 5px 12px; border: 1px solid #d6dde5; border-radius: 6px; background: #fff; font-size: 13px; cursor: pointer; }
.wt-toolbar button:hover { background: #f4f8fc; }
.wt-toolbar button:disabled { opacity: .5; cursor: not-allowed; }
.wt-toolbar .btn-primary { background: var(--c-brand-500); color: #fff; border-color: var(--c-brand-500); }
.wt-toolbar .btn-primary:hover { background: #2c87c4; }
.wt-toolbar .hint { margin-left: auto; }
.wt-back { font-size: 13px; color: var(--c-brand-500); text-decoration: none; }
/* 工具条内的状态徽章：需自带底色（全局 .badge 只定义尺寸，不定义颜色） */
.wt-toolbar .badge { color: #fff; background: #7f8c8d; padding: 3px 10px; border-radius: 8px; font-size: 12px; }
.wt-toolbar .badge.green { background: #27ae60; }
.wt-toolbar .badge.red { background: #c0392b; }

.wt-screen {
  margin: 0;
  height: 460px;
  overflow: auto;
  background: #0f1720;
  color: #e5e7eb;
  border-radius: 8px;
  padding: 12px 14px;
  font-family: "Cascadia Mono", "Consolas", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}
.wt-inputline { display: flex; align-items: center; gap: 8px; margin-top: 8px; background: #0f1720; border-radius: 8px; padding: 8px 12px; }
.wt-prompt { color: #22c55e; font-family: "Consolas", monospace; font-weight: 700; }
.wt-input { flex: 1; background: transparent; border: none; outline: none; color: #e5e7eb;
  font-family: "Cascadia Mono", "Consolas", "Courier New", monospace; font-size: 13px; }
.wt-input::placeholder { color: #64748b; }
button:disabled.btn-term { opacity: .45; cursor: not-allowed; }

/* ---------------- v1.9.0：远程桌面页 ---------------- */
.btn-danger { padding: 9px 18px; border: none; border-radius: 8px; font-size: 13px;
  font-weight: 600; cursor: pointer; background: #d05050; color: #fff; }
.btn-danger:disabled { opacity: .45; cursor: not-allowed; }
.badge-ok { background: #e9f9ef; color: #1ca75c; }
.badge-off { background: #eceff3; color: #6b7280; }
.badge-warn { background: #fdf3e0; color: #b7791f; }
.badge-err { background: #fdeaea; color: #d05050; }
/* ---- v1.9.11：机器管理页专业排版增强（编号/别名/任务分配） ---- */
/* ---- v1.9.11：机器管理页专业排版增强（编号/别名/任务分配） ---- */
.machines-page .page-header {
  margin-bottom: 18px;
}
.machines-page .page-header h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .5px;
}
.machines-page .page-subtitle {
  margin: 0;
  color: #7f8c8d;
  font-size: 13.5px;
  line-height: 1.6;
  max-width: 980px;
}

.mc-table-wrap {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.04);
  overflow: hidden;
}

.mc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.mc-table th,
.mc-table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid #f1f3f5;
  vertical-align: middle;
}
.mc-table thead th {
  background: #f8fafc;
  font-weight: 600;
  color: #5d6d7e;
  font-size: 12px;
  letter-spacing: .3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.mc-table tbody tr {
  transition: background .12s;
}
.mc-table tbody tr:hover {
  background: #f8fbff;
}
.mc-table tbody tr.mc-status-online {
  background: #fafffd;
}
.mc-table tbody tr.mc-status-online:hover {
  background: #f0fdf6;
}
.mc-table tbody tr.mc-status-offline {
  opacity: .92;
}
.mc-table tbody tr.mc-status-offline td.mc-col-no .mc-no,
.mc-table tbody tr.mc-status-offline .mc-id-main,
.mc-table tbody tr.mc-status-offline .mc-role-title {
  opacity: .65;
}

/* 列宽 */
.mc-col-no { width: 64px; text-align: center; }
.mc-col-id { min-width: 150px; }
.mc-col-role { min-width: 170px; }
.mc-col-tasks { min-width: 260px; }
.mc-col-status { width: 86px; text-align: center; }
.mc-col-ver { width: 100px; text-align: center; }
.mc-col-hb { width: 150px; }
.mc-col-action { width: 210px; text-align: right; white-space: nowrap; }

/* 编号徽章 */
.mc-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
.mc-no-1 { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.mc-no-2 { background: linear-gradient(135deg, #8e44ad, #71368a); }
.mc-no-3 { background: linear-gradient(135deg, var(--c-brand-500), #2c87c4); }
.mc-no-4 { background: linear-gradient(135deg, #27ae60, #219150); }
.mc-no-5 { background: linear-gradient(135deg, #f39c12, #d68910); }
.mc-no-6 { background: linear-gradient(135deg, #1abc9c, #16a085); }
.mc-no-7 { background: linear-gradient(135deg, #34495e, #2c3e50); }
.mc-no-8 { background: linear-gradient(135deg, #7f8c8d, #616a6b); }
.mc-no-9 { background: linear-gradient(135deg, #d35400, #a04000); }
.mc-no-10 { background: linear-gradient(135deg, #8e44ad, #6c3483); }
.mc-no-11 { background: linear-gradient(135deg, #2980b9, #1f618d); }
.mc-no-x { background: #bdc3c7; }

/* Machine ID 与别名 */
.mc-id-main {
  font-weight: 700;
  color: #2c3e50;
  font-size: 14px;
  line-height: 1.3;
}
.mc-id-alias {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #eef4ff;
  color: #2f6bd0;
  font-size: 12px;
  font-weight: 600;
}
.mc-id-note {
  margin-top: 6px;
  font-size: 12px;
  color: #7f8c8d;
  line-height: 1.4;
}

/* v1.9.19：机器页状态徽章（自带底色，修复白字白底不可见） */
.mc-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.mc-badge-online { background: #e9f9ef; color: #1ca75c; }
.mc-badge-offline { background: #eceff3; color: #6b7280; }
.mc-badge-ctrl { background: #e8f1ff; color: #2f6bd0; }

/* v1.9.20：最后心跳列状态符号（绿点=在线 / 灰点=离线） */
.mc-hb-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: 1px;
}
.mc-hb-online { background: #27ae60; }
.mc-hb-offline { background: #bdc3c7; }
.mc-hb-state { font-size: 12px; font-weight: 600; color: #2c3e50; }
.mc-hb-time { font-size: 12px; color: #7f8c8d; }

/* v1.9.19：不适合做的事列 */
.mc-col-forbid { max-width: 240px; }
.mc-forbid {
  font-size: 12px;
  color: #b0543c;
  background: #fdf5f0;
  border-radius: 6px;
  padding: 5px 8px;
  line-height: 1.5;
}


/* 角色与仓库 */
.mc-role-title {
  font-weight: 700;
  color: #2c3e50;
  font-size: 13.5px;
  line-height: 1.35;
}
.mc-role-sub {
  margin-top: 5px;
  font-size: 12px;
  color: #95a5a6;
}

/* 任务芯片 */
.mc-task-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.mc-task-chip {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f4f6f8;
  color: #5d6d7e;
  font-size: 11.5px;
  border: 1px solid #eef1f5;
  white-space: nowrap;
}
.mc-task-empty {
  color: #bdc3c7;
  font-size: 12px;
}

/* 空状态 */
.mc-empty {
  text-align: center;
  padding: 48px 24px;
  color: #95a5a6;
  font-size: 14px;
}

/* 操作按钮紧凑 */
.mc-col-action button {
  padding: 5px 10px;
  font-size: 12px;
  margin-left: 4px;
}

/* 响应式 */
@media (max-width: 1100px) {
  .mc-table-wrap { overflow-x: auto; }
  .mc-table { min-width: 1080px; }
}
@media (max-width: 640px) {
  .kx-main { padding: 16px; }
  .mc-col-ver,
  .mc-col-hb { display: none; }
}
/* ---- v1.9.16：VNC 远程桌面新版式（顶部操作栏 + 左侧功能键栏） ---- */

.vnc-topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  background: #1f242c;
  border: 1px solid #2f353f;
  border-radius: 8px 8px 0 0;
  padding: 8px 14px;
  color: #c9d1d9;
}
.vnc-topbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.vnc-topbar-center {
  flex: 1 1 auto;
  justify-content: center;
}
.vnc-topbar-right {
  justify-content: flex-end;
}
.vnc-topbar-btn {
  padding: 6px 12px;
  font-size: 13px;
  color: #c9d1d9;
  background: #2b323d;
  border: 1px solid #3e4754;
  border-radius: 5px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.vnc-topbar-btn:hover:not(:disabled) {
  background: #353e4b;
  border-color: #5b6778;
}
.vnc-topbar-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.vnc-topbar-primary {
  background: #1f6feb;
  border-color: #1f6feb;
  color: #fff;
}
.vnc-topbar-primary:hover:not(:disabled) { background: #2875f0; border-color: #2875f0; }
.vnc-topbar-link {
  font-size: 13px;
  color: #79c0ff;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 5px;
}
.vnc-topbar-link:hover { background: rgba(121,192,255,.12); }
.vnc-topbar-info {
  font-size: 13px;
  color: #8b949e;
  white-space: nowrap;
}
.vnc-cmd-input {
  display: none;
  width: 220px;
  padding: 5px 10px;
  font-size: 13px;
  background: #0d1117;
  color: #c9d1d9;
  border: 1px solid #3e4754;
  border-radius: 5px;
}
.vnc-cmd-input:focus { outline: none; border-color: #1f6feb; }
#vnc-topbar #vnc-pass {
  width: 140px;
  padding: 6px 10px;
  font-size: 13px;
  background: #0d1117;
  color: #c9d1d9;
  border: 1px solid #3e4754;
  border-radius: 5px;
}
#vnc-topbar #vnc-pass:focus { outline: none; border-color: #1f6feb; }

.vnc-main {
  display: flex;
  height: calc(100vh - 220px);
  min-height: 420px;
}

/* 左侧功能键栏 */
.vnc-sidebar {
  width: 118px;
  flex: 0 0 118px;
  background: #1f242c;
  border-left: 1px solid #2f353f;
  border-bottom: 1px solid #2f353f;
  border-radius: 0 0 0 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  box-sizing: border-box;
}
.vnc-sidebar-btn {
  width: 100%;
  padding: 7px 4px;
  font-size: 11px;
  font-weight: 600;
  color: #c9d1d9;
  background: #2b323d;
  border: 1px solid #3e4754;
  border-radius: 5px;
  cursor: pointer;
  text-align: center;
  transition: background .15s, border-color .15s;
  line-height: 1.25;
}
.vnc-sidebar-btn:hover:not(:disabled) {
  background: #353e4b;
  border-color: #5b6778;
}
.vnc-sidebar-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}
.vnc-sidebar-danger {
  background: #5c1e1e;
  border-color: #7f2e2e;
  color: #ffd1d1;
}
.vnc-sidebar-danger:hover:not(:disabled) {
  background: #702626;
  border-color: #9e3a3a;
}

.vnc-container {
  flex: 1 1 auto;
  transition: width 0.15s ease, height 0.15s ease, border-radius 0.15s ease;
  border-radius: 0 0 8px 0 !important;
}

/* 全屏模式：容器真正占满视口，去掉滚动条和黑边 */
.vnc-container.vnc-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  z-index: 2147483647 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #0d1117 !important;
}

/* 全屏时隐藏主页面滚动条，避免拖动滚动条 */
body.vnc-fullscreen-active {
  overflow: hidden !important;
}

body.vnc-fullscreen-active .kx-main,
body.vnc-fullscreen-active .kx-main {
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100vw !important;
  overflow: hidden !important;
}

/* 窗口最大化（伪全屏）时隐藏页面标题、提示、顶部栏、左侧栏，把空间全给画面 */
body.vnc-fullscreen-active h2,
body.vnc-fullscreen-active .hint,
body.vnc-fullscreen-active .vnc-topbar,
body.vnc-fullscreen-active .vnc-sidebar {
  display: none !important;
}

/* 全屏状态下顶部工具条悬浮在画面上方（仅当 vnc-topbar 被强制保留时生效） */
.vnc-toolbar-fullscreen {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 2147483648 !important;
  background: rgba(13, 17, 23, 0.92) !important;
  border-bottom: 1px solid #2b313a !important;
  border-radius: 0 !important;
  padding: 6px 12px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
  backdrop-filter: blur(4px);
}

/* 全屏时画面提示 Esc 退出 */
.vnc-fullscreen::after {
  content: '按 Esc 退出全屏';
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.65);
  color: #c9d1d9;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  opacity: 0.8;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.vnc-fullscreen:hover::after {
  opacity: 0;
}

.vnc-placeholder {
  color: #8b949e;
  padding: 24px;
  text-align: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* 浮动文件上传状态条 */
.vnc-transfer-status {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2147483647;
  background: rgba(13, 17, 23, 0.95);
  border: 1px solid #2b313a;
  border-radius: 20px;
  padding: 6px 16px;
  color: #c9d1d9;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  white-space: nowrap;
}

/* 流畅优先开关 */
#vnc-quality-label {
  cursor: pointer;
  user-select: none;
  color: #c9d1d9;
}

#vnc-quality-toggle {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* 小屏适配 */
@media (max-width: 900px) {
  .vnc-main { flex-direction: column; height: auto; }
  .vnc-sidebar {
    width: 100%;
    flex: none;
    flex-direction: row;
    flex-wrap: wrap;
    border-radius: 0;
    max-height: none;
  }
  .vnc-sidebar-btn { width: auto; min-width: 92px; flex: 1 1 90px; }
  .vnc-container { min-height: 360px; border-radius: 0 0 8px 8px !important; }
}
@media (max-width: 640px) {
  .vnc-topbar { gap: 6px; }
  #vnc-pass { width: 110px; }
  .vnc-cmd-input { width: 160px; }
  #vnc-quality-label { display: inline-flex !important; }
}

.vnc-drag-over { outline: 2px dashed #2f81f7; outline-offset: -6px; }
.vnc-container.vnc-drag-over::after {
  content: "松开鼠标即可发送到被控机";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px;
  text-align: center;
  font-size: 14px;
  color: #fff;
  background: rgba(47,129,247,.85);
  z-index: 20;
}


/* ============ 中控 UI 改造（对齐咖算云设计系统 v1.0） ============ */
.kx-topbar__avatar {
  display: inline-flex; align-items: center; padding: 2px 12px;
  border-radius: var(--rd-full);
  background: var(--bg-brand-soft); color: var(--fg-on-brand-soft);
  font-size: var(--fs-13); font-weight: var(--fw-semi);
}
button.kx-nav__item {
  background: none; border: 1px solid transparent; font: inherit;
  width: 100%; text-align: left; color: var(--fg-second);
}
button.kx-nav__item:hover { background: var(--bg-sunken); }
#update-notice { max-width: none; margin: 0; padding: var(--sp-3) var(--sp-5); }
.ver { color: var(--c-brand-500); }
.status-published { color: var(--c-brand-600); background: var(--bg-brand-soft); }


/* ===== BIZ-TASK · 业务任务调度（B3） ===== */
.biztask-page .biz-actions { display:flex; gap:8px; }
.biz-kpi { gap:24px; align-items:flex-start; }
.biz-kpi .ver { font-size:18px; font-weight:600; margin-top:4px; }
.biz-kpi .tag { margin-right:4px; }
.biz-isolate { margin-top:8px; font-weight:600; }
.biz-root { border:1px solid var(--bd-base, #e3e8ef); border-radius:10px; margin:8px 0; overflow:hidden; }
.biz-root__head, .biz-sub__head { display:flex; align-items:center; gap:10px; padding:10px 12px; flex-wrap:wrap; }
.biz-root__head { background:var(--bg-sunken, #f6f8fb); }
.biz-cardno { font-family:ui-monospace,Menlo,Consolas,monospace; color:var(--c-brand-500,#1D6DF0); font-size:12px; }
.biz-title { font-size:14px; }
.biz-root__ops, .biz-sub__ops { margin-left:auto; display:flex; gap:6px; }
.biz-expand { background:none; border:none; cursor:pointer; font-size:14px; color:var(--c-brand-500,#1D6DF0); }
.biz-root__subs { padding:0 12px 12px; border-top:1px dashed var(--bd-base,#e3e8ef); }
.biz-sub { border:1px solid var(--bd-base,#e3e8ef); border-radius:8px; margin:8px 0; }
.biz-sub__head { background:var(--bg-sunken,#f6f8fb); }
.biz-sub__panel, .biz-inline { padding:10px 12px; }
.biz-agg { padding:8px 12px; color:var(--fg-second,#667); font-size:13px; }
.biz-inline { background:var(--bg-sunken,#f6f8fb); border-radius:8px; margin:8px 0; }
.biztask-page .card-form, .bizalarm-page .card-form { display:flex; flex-direction:column; gap:8px; max-width:640px; }
.biztask-page .card-form .row, .bizalarm-page .card-form .row { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.biztask-page .card-form textarea, .bizalarm-page .card-form textarea, .biztask-page .card-form input, .bizalarm-page .card-form input, .biztask-page .card-form select, .bizalarm-page .card-form select { width:100%; }
.biztask-page .status-success, .bizalarm-page .status-success { color:#1a9d54; }
.biztask-page .status-failed, .bizalarm-page .status-failed { color:#d23f3f; }
/* ===== /BIZ-TASK ===== */

/* B4 · 业务任务调度扩展样式（install-b4.js 注入） */
.biztask-page, .bizalarm-page { padding: 8px 0; }
.biztask-page .biz-actions, .bizalarm-page .biz-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.biztask-page .biz-kpi, .bizalarm-page .biz-kpi { display:flex; gap:16px; flex-wrap:wrap; }
.biztask-page .biz-kpi > div, .bizalarm-page .biz-kpi > div { min-width:120px; }
.biztask-page .biz-kpi .ver, .bizalarm-page .biz-kpi .ver { font-size:18px; font-weight:600; margin-top:2px; }
.biztask-page .biz-batch-bar, .bizalarm-page .biz-batch-bar { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin:8px 0; }
.biztask-page .tag, .bizalarm-page .tag { display:inline-block; padding:1px 8px; border-radius:10px; font-size:12px; margin:2px; }
.biztask-page .tag.status-failed, .bizalarm-page .tag.status-failed { background:#fde2e2; color:#c0392b; }
.biztask-page .tag.status-warn, .bizalarm-page .tag.status-warn { background:#fef3cd; color:#a86a00; }
.biztask-page .tag.status-info, .bizalarm-page .tag.status-info { background:#e3f0ff; color:#1d6fc4; }
.biztask-page .status-success, .bizalarm-page .status-success { color:#1a9d54; }
.biztask-page .status-failed, .bizalarm-page .status-failed { color:#c0392b; }
.biztask-page .status-warn, .bizalarm-page .status-warn { color:#a86a00; }
.biztask-page .status-info, .bizalarm-page .status-info { color:#1d6fc4; }
.biztask-page .err, .bizalarm-page .err { color:#c0392b; }
.biztask-page .muted, .bizalarm-page .muted { color:#888; font-size:13px; }
.biztask-page .hidden, .bizalarm-page .hidden { display:none !important; }
.biztask-page .biz-root, .bizalarm-page .biz-root, .biztask-page .biz-sub, .bizalarm-page .biz-sub { border:1px solid #e3e3e3; border-radius:8px; padding:8px; margin:8px 0; background:#fff; }
.biztask-page .biz-root__head, .bizalarm-page .biz-root__head, .biztask-page .biz-sub__head, .bizalarm-page .biz-sub__head { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.biztask-page .biz-cardno, .bizalarm-page .biz-cardno { font-family:monospace; color:#1d6fc4; }
.biztask-page .biz-title, .bizalarm-page .biz-title { font-size:15px; }
.biztask-page .biz-root__ops, .bizalarm-page .biz-root__ops, .biztask-page .biz-sub__ops, .bizalarm-page .biz-sub__ops { margin-left:auto; display:flex; gap:6px; flex-wrap:wrap; }
.biztask-page .biz-inline, .bizalarm-page .biz-inline { margin-top:8px; padding:8px; background:#f7f9fc; border-radius:6px; }
.biztask-page .biz-agg, .bizalarm-page .biz-agg { font-size:13px; color:#555; margin-bottom:6px; }
.biztask-page .biz-isolate, .bizalarm-page .biz-isolate { margin-top:6px; }
.biztask-page .biz-alert, .bizalarm-page .biz-alert { padding:8px 10px; border-radius:6px; margin:6px 0; border:1px solid transparent; }
.biztask-page .biz-alert.status-failed, .bizalarm-page .biz-alert.status-failed { background:#fde2e2; border-color:#f1b0b0; }
.biztask-page .biz-alert.status-warn, .bizalarm-page .biz-alert.status-warn { background:#fef3cd; border-color:#f3e0a8; }
.biztask-page .biz-alert.status-info, .bizalarm-page .biz-alert.status-info { background:#e3f0ff; border-color:#bcdcff; }
.rg-field { display:flex; flex-direction:column; gap:4px; }
.rg-field label { font-size:13px; color:#555; }
.biztask-page .card-form, .bizalarm-page .card-form { display:flex; flex-direction:column; gap:10px; }
.biztask-page .row, .bizalarm-page .row { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.biztask-page .btn-primary, .bizalarm-page .btn-primary, .biztask-page .btn-plain, .bizalarm-page .btn-plain { padding:6px 12px; border-radius:6px; border:1px solid #ccc; cursor:pointer; font-size:13px; }
.biztask-page .btn-primary, .bizalarm-page .btn-primary { background:var(--c-brand-500); color:#fff; border-color:var(--c-brand-500); }
.biztask-page .btn-plain, .bizalarm-page .btn-plain { background:#fff; color:#333; }

/* ── 版本升级「常驻提醒角标」（CTRL-TASK-BADGE）────────────
   复用现有 30s 轮询 checkUpdateNotice，不新增定时器/请求。
   角标唯一熄灭条件 = 无待升级版本（忽略横幅不熄角标，硬约束①）。
   配色走语义令牌 --c-bad-*，light/dark 与品牌橙主题均自适应。 */
.kx-nav__item { position: relative; }          /* 挂绝对定位红点的定位上下文 */
.nav-dot {
  position: absolute; top: 7px; right: 9px;
  min-width: 8px; height: 8px; padding: 0;
  border-radius: 999px; background: var(--c-bad-600);
  box-shadow: 0 0 0 2px var(--c-n-0);          /* 描边与导航底分隔：浅主题白环 / 深主题深环 */
}
.nav-dot--num {
  min-width: 16px; height: 16px; line-height: 16px;
  text-align: center; font-size: 11px; font-weight: 600; color: #fff; padding: 0 4px;
}
.kx-badge--update {
  background: var(--c-bad-bg); color: var(--c-bad-fg);
  border: 1px solid var(--c-bad-600);
  animation: kx-badge-pulse 1.8s ease-in-out infinite;
}
@keyframes kx-badge-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(201,58,47,.45); }
  70%  { box-shadow: 0 0 0 6px rgba(201,58,47,0); }
  100% { box-shadow: 0 0 0 0 rgba(201,58,47,0); }
}
