:root {
  --bg: #eef1f8;
  --bg-2: #e6eaf4;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-solid: #ffffff;
  --input-bg: #f4f6fb;
  --sunken: #f1f4fa;
  --border: rgba(35, 55, 110, 0.12);
  --border-strong: rgba(35, 55, 110, 0.22);
  --text: #1e2740;
  --muted: #5e6b8a;
  --faint: #8a94ad;
  --accent: #5b6fe6;
  --accent-2: #8b5cf6;
  --grad: linear-gradient(135deg, #6d8bff 0%, #a36bff 100%);
  --grad-soft: linear-gradient(135deg, rgba(109,139,255,.13), rgba(163,107,255,.13));
  --ok: #0f9d6b;
  --run: #0284c7;
  --warn: #c17e00;
  --fail: #e11d48;
  --idle: #8a94ad;
  --shadow: 0 14px 36px rgba(40, 55, 100, 0.13);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 12% -8%, rgba(109, 139, 255, 0.12), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(163, 107, 255, 0.10), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(80,100,150,.28); border-radius: 8px; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.login-card {
  width: 100%; max-width: 410px;
  background: var(--panel); backdrop-filter: blur(18px);
  border: 1px solid var(--border); border-radius: 22px;
  box-shadow: var(--shadow); padding: 40px 34px;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.brand .logo {
  width: 46px; height: 46px; border-radius: 13px; background: var(--grad);
  display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #fff;
  box-shadow: 0 8px 22px rgba(109,139,255,.45);
}
.brand h1 { font-size: 20px; margin: 0; letter-spacing: .5px; }
.brand p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 7px; }
.input {
  width: 100%; padding: 12px 14px; font-size: 14.5px; color: var(--text);
  background: var(--input-bg); border: 1px solid var(--border-strong);
  border-radius: 11px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(109,139,255,.18); }
.btn {
  width: 100%; padding: 12px 16px; font-size: 15px; font-weight: 650; color: #fff;
  background: var(--grad); border: none; border-radius: 11px;
  box-shadow: 0 10px 26px rgba(109,139,255,.4); transition: transform .08s, filter .15s;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.login-err {
  background: rgba(225,29,72,.08); border: 1px solid rgba(225,29,72,.28);
  color: var(--fail); font-size: 13px; padding: 10px 12px; border-radius: 10px; margin-bottom: 16px;
}
.login-foot { margin-top: 22px; text-align: center; font-size: 11.5px; color: var(--idle); }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(241,244,250,.92));
  border-right: 1px solid var(--border); padding: 22px 16px; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { margin-bottom: 30px; padding: 0 6px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 11px;
  color: var(--muted); font-size: 14px; font-weight: 550; transition: background .15s, color .15s;
}
.nav a .ico { width: 18px; text-align: center; opacity: .9; }
.nav a:hover { background: rgba(120,140,200,.08); color: var(--text); }
.nav a.active { background: var(--grad-soft); color: var(--accent); border: 1px solid var(--border-strong); font-weight: 650; }
.sidebar-foot { position: absolute; bottom: 18px; left: 16px; right: 16px; font-size: 11px; color: var(--idle); }

.main { padding: 26px 32px 60px; max-width: 1280px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.topbar h2 { margin: 0; font-size: 22px; letter-spacing: .3px; }
.topbar .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.hamburger { display: none; width: 40px; height: 40px; flex: none; align-items: center; justify-content: center; font-size: 19px; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 11px; }
.hamburger:hover { border-color: var(--border-strong); }
.scrim { display: none; }
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 14px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 30px; font-size: 13px;
}
.user-chip .av { width: 28px; height: 28px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; }
.ghost-btn { background: rgba(120,140,200,.1); border: 1px solid var(--border); color: var(--muted); padding: 7px 12px; border-radius: 9px; font-size: 12.5px; transition: .15s; }
.ghost-btn:hover { color: var(--text); border-color: var(--border-strong); }

/* ---------- Cards / stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; position: relative; overflow: hidden;
}
.stat::after { content: ""; position: absolute; right: -20px; top: -20px; width: 90px; height: 90px; background: var(--grad-soft); border-radius: 50%; }
.stat .k { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.stat .v { font-size: 30px; font-weight: 750; margin-top: 8px; letter-spacing: .5px; }
.stat .v small { font-size: 14px; color: var(--muted); font-weight: 500; }
.stat .ico-badge { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; background: var(--grad-soft); }

.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 22px; overflow: hidden;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.panel-head h3 { margin: 0; font-size: 15.5px; }
.panel-head .desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.panel-body { padding: 6px 8px; }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--idle); font-weight: 600; padding: 11px 14px; }
td { padding: 13px 14px; border-top: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
tr.click-row:hover { background: rgba(120,140,200,.06); cursor: pointer; }
.t-name { font-weight: 600; }
.t-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 30px; font-size: 12px; font-weight: 600; border: 1px solid transparent; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; }
.badge.active { color: var(--run); background: rgba(56,189,248,.1); border-color: rgba(56,189,248,.3); }
.badge.paused { color: var(--warn); background: rgba(251,191,36,.1); border-color: rgba(251,191,36,.3); }
.badge.completed { color: var(--ok); background: rgba(52,211,153,.1); border-color: rgba(52,211,153,.3); }
.badge.error, .badge.failed, .badge.timeout { color: var(--fail); background: rgba(251,113,133,.1); border-color: rgba(251,113,133,.3); }
.badge.running { color: var(--run); background: rgba(56,189,248,.1); border-color: rgba(56,189,248,.3); }
.badge.success { color: var(--ok); background: rgba(52,211,153,.1); border-color: rgba(52,211,153,.3); }
.badge.cancelled, .badge.pending, .badge.skipped { color: var(--idle); background: rgba(124,139,176,.12); border-color: rgba(124,139,176,.3); }
.dot.active, .dot.running { background: var(--run); box-shadow: 0 0 0 3px rgba(56,189,248,.18); }
.dot.completed, .dot.success { background: var(--ok); }
.dot.paused { background: var(--warn); }
.dot.error, .dot.failed, .dot.timeout { background: var(--fail); }
.dot.cancelled, .dot.pending, .dot.skipped { background: var(--idle); }

.cat-tag { font-size: 11px; padding: 3px 8px; border-radius: 7px; background: rgba(120,140,200,.12); color: var(--muted); border: 1px solid var(--border); }

/* ---------- Buttons row ---------- */
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.mini { padding: 6px 11px; font-size: 12px; border-radius: 8px; border: 1px solid var(--border); background: rgba(120,140,200,.08); color: var(--muted); transition: .14s; }
.mini:hover { color: var(--text); border-color: var(--border-strong); }
.mini.primary { background: var(--grad); color: #fff; border: none; box-shadow: 0 6px 16px rgba(109,139,255,.34); }
.mini.danger:hover { color: var(--fail); border-color: rgba(251,113,133,.5); }

.btn-new { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: 13.5px; font-weight: 600; color: #fff; background: var(--grad); border: none; border-radius: 11px; box-shadow: 0 10px 24px rgba(109,139,255,.36); }

/* ---------- Modal ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(28,38,68,.42); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 24px; z-index: 50; }
.modal { width: 100%; max-width: 680px; max-height: 88vh; overflow: auto; background: var(--panel-solid); border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: var(--shadow); }
.modal.wide { max-width: 820px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel-solid); z-index: 2; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 20px 22px; }
.x-btn { background: rgba(120,140,200,.1); border: 1px solid var(--border); color: var(--muted); width: 32px; height: 32px; border-radius: 9px; font-size: 16px; }
.x-btn:hover { color: var(--text); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-grid .full { grid-column: 1 / -1; }
.lbl { font-size: 12.5px; color: var(--muted); margin-bottom: 7px; display: block; }
.lbl .req { color: var(--fail); }
.hint { font-size: 11.5px; color: var(--idle); margin-top: 5px; line-height: 1.5; }
textarea.input { resize: vertical; min-height: 64px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2393a0c0' d='M6 8L2 4h8z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; }

.seg { display: inline-flex; background: var(--input-bg); border: 1px solid var(--border-strong); border-radius: 11px; padding: 4px; gap: 4px; }
.seg button { padding: 8px 16px; border: none; background: transparent; color: var(--muted); border-radius: 8px; font-size: 13px; font-weight: 550; transition: .14s; }
.seg button.on { background: var(--grad); color: #fff; }

.divider { height: 1px; background: var(--border); margin: 20px 0; }
.section-title { font-size: 13px; font-weight: 650; color: var(--text); margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.section-title .num { width: 20px; height: 20px; border-radius: 6px; background: var(--grad-soft); display: grid; place-items: center; font-size: 11px; color: var(--accent); border: 1px solid var(--border); }
.toggle { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text); cursor: pointer; }
.toggle input { width: 16px; height: 16px; accent-color: var(--accent); }
.ms-group { display: flex; flex-wrap: wrap; gap: 8px; }
.ms-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--input-bg); font-size: 12.5px; color: var(--text); cursor: pointer; transition: .14s; user-select: none; }
.ms-chip:hover { border-color: var(--accent); }
.ms-chip input { accent-color: var(--accent); margin: 0; }
.ms-chip:has(input:checked) { background: var(--grad-soft); border-color: var(--accent); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0 8px; }
.pchip { padding: 5px 11px; font-size: 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--input-bg); color: var(--muted); cursor: pointer; transition: .14s; }
.pchip:hover { border-color: var(--accent); color: var(--text); }
.pchip.on { background: var(--grad); color: #fff; border-color: transparent; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--panel-solid); }

/* ---------- Task detail / stages ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.kv { background: var(--sunken); border: 1px solid var(--border); border-radius: 11px; padding: 12px 14px; }
.kv .k { font-size: 11.5px; color: var(--idle); text-transform: uppercase; letter-spacing: .5px; }
.kv .v { font-size: 14px; margin-top: 5px; word-break: break-all; }

.runs-list { display: flex; flex-direction: column; gap: 8px; }
.run-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: var(--sunken); border: 1px solid var(--border); border-radius: 11px; cursor: pointer; transition: .14s; }
.run-item:hover { border-color: var(--border-strong); }
.run-item.sel { border-color: var(--accent); background: var(--grad-soft); }
.run-item .when { font-size: 12.5px; color: var(--muted); }
.run-item .meta { margin-left: auto; font-size: 12px; color: var(--idle); }

.timeline { padding: 8px 4px; }
.stage {
  position: relative; padding: 0 0 6px 28px; border-left: 2px solid var(--border); margin-left: 8px;
}
.stage:last-child { border-left-color: transparent; }
.stage .node { position: absolute; left: -9px; top: 2px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--bg); }
.stage.success .node { background: var(--ok); }
.stage.failed .node { background: var(--fail); }
.stage.running .node { background: var(--run); animation: pulse 1.2s infinite; }
.stage.pending .node, .stage.skipped .node { background: var(--idle); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(56,189,248,.5);} 50% { box-shadow: 0 0 0 6px rgba(56,189,248,0);} }
.stage-head { display: flex; align-items: center; gap: 10px; padding-bottom: 4px; }
.stage-head .name { font-size: 13.5px; font-weight: 600; }
.stage-head .dur { font-size: 11.5px; color: var(--idle); margin-left: auto; }
.stage-log { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; color: var(--muted); background: var(--sunken); border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; margin: 6px 0 14px; white-space: pre-wrap; max-height: 200px; overflow: auto; line-height: 1.55; }
.result-box { font-family: ui-monospace, monospace; font-size: 12px; background: var(--sunken); border: 1px solid var(--border); border-radius: 9px; padding: 11px 13px; color: var(--ok); white-space: pre-wrap; overflow: auto; max-height: 180px; }

.empty { text-align: center; padding: 48px 20px; color: var(--idle); }
.empty .big { font-size: 40px; margin-bottom: 10px; opacity: .5; }

/* 上线版本时间线 */
.rel-summary { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 12px 16px; margin-bottom: 18px; background: var(--grad-soft); border: 1px solid var(--border); border-radius: 12px; }
.rel-summary-k { font-size: 12.5px; color: var(--muted); margin-right: 4px; }
.rel-summary-t { font-size: 12px; color: var(--faint); }
.rel-timeline { position: relative; padding-left: 26px; }
.rel-timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border-strong); }
.rel-item { position: relative; padding-bottom: 20px; }
.rel-item:last-child { padding-bottom: 0; }
.rel-dot { position: absolute; left: -26px; top: 5px; width: 13px; height: 13px; border-radius: 50%; background: var(--panel-solid); border: 2px solid var(--faint); box-sizing: border-box; }
.rel-item.is-live .rel-dot { border-color: var(--run); background: var(--run); box-shadow: 0 0 0 4px rgba(2,132,199,.15); }
.rel-card { background: var(--panel-solid); border: 1px solid var(--border); border-radius: 12px; padding: 13px 16px; }
.rel-item.is-live .rel-card { border-color: rgba(2,132,199,.4); }
.rel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rel-ver { font-weight: 700; font-size: 15px; color: var(--accent); }
.rel-ver.live { color: var(--run); }
.rel-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.rel-meta { font-size: 12px; color: var(--muted); margin: 5px 0 8px; }
.rel-meta code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; background: var(--sunken); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; color: var(--muted); }
.rel-changes { margin: 0; padding-left: 18px; }
.rel-changes li { font-size: 13px; color: var(--text); line-height: 1.7; }
.spin { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--panel-solid); border: 1px solid var(--border-strong); color: var(--text); padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow); font-size: 13.5px; z-index: 100; opacity: 0; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.ok { border-color: rgba(52,211,153,.4); }
.toast.err { border-color: rgba(251,113,133,.4); }

.type-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type-card { padding: 13px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--sunken); cursor: pointer; transition: .14s; }
.type-card:hover { border-color: var(--border-strong); }
.type-card.on { border-color: var(--accent); background: var(--grad-soft); }
.type-card .tc-name { font-size: 13.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.type-card .tc-desc { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.danger-flag { font-size: 10px; color: var(--fail); border: 1px solid rgba(251,113,133,.4); padding: 1px 6px; border-radius: 6px; }

/* ---------- 任务表单:紧凑布局 ---------- */
.modal.wide { max-width: 900px; }
.compact-form .divider { margin: 16px 0; }
.compact-form .section-title { margin-bottom: 11px; }
.compact-form .field { margin-bottom: 0; }
.compact-form .form-grid { gap: 11px 14px; }
.compact-form .hint { font-size: 11px; margin-top: 4px; line-height: 1.45; }
.compact-form .lbl { margin-bottom: 5px; }
.compact-form .input { padding: 9px 12px; font-size: 13.5px; }
.compact-form textarea.input { min-height: 52px; }
.compact-form .ms-chip { padding: 5px 10px; font-size: 12px; }
.compact-form .seg button { padding: 7px 14px; font-size: 12.5px; }

.type-pick.compact { grid-template-columns: repeat(2, 1fr); gap: 8px; max-height: 400px; overflow: auto; padding-right: 2px; align-items: start; }
.type-pick.compact .type-card { padding: 9px 11px; border-radius: 10px; }
.type-pick.compact .tc-name { font-size: 12.5px; }
.type-pick.compact .tc-desc { font-size: 10.5px; margin-top: 3px; line-height: 1.55; }
.type-locked { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: var(--sunken); border: 1px solid var(--border); border-radius: 11px; font-size: 13.5px; }
.type-locked .pg-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.type-locked .pg-badge { margin-left: auto; flex: none; }

/* 参数分组折叠 */
.pgroup { border: 1px solid var(--border); border-radius: 12px; background: var(--sunken); margin-top: 11px; overflow: hidden; }
.pgroup summary { display: flex; align-items: center; gap: 9px; padding: 11px 14px; cursor: pointer; font-size: 13px; font-weight: 600; list-style: none; user-select: none; transition: background .14s; }
.pgroup summary:hover { background: rgba(120,140,200,.07); }
.pgroup summary::-webkit-details-marker { display: none; }
.pgroup summary::after { content: '▾'; margin-left: 4px; color: var(--idle); font-size: 12px; transition: transform .16s; }
.pgroup[open] summary::after { transform: rotate(180deg); }
.pg-ico { font-size: 14px; }
.pg-desc { font-size: 11.5px; color: var(--idle); font-weight: 450; flex: 1; min-width: 0; }
.pg-badge { flex: none; margin-left: auto; font-size: 10.5px; padding: 2px 8px; border-radius: 6px; background: rgba(120,140,200,.13); color: var(--muted); border: 1px solid var(--border); font-weight: 500; }
.pgroup summary .pg-badge { margin-left: 0; }
.pgroup .pg-body { padding: 13px 14px 14px; border-top: 1px solid var(--border); background: var(--panel-solid); }

/* 高级选项一行三列 */
.adv-grid { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 12px; align-items: end; }
.adv-grid .adv-toggle { padding-bottom: 9px; }

/* 生成预览 */
.preview-wrap { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.preview-box { width: 100%; margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--muted); background: var(--sunken); border: 1px dashed var(--border-strong); border-radius: 9px; padding: 10px 12px; white-space: pre-wrap; word-break: break-all; max-height: 190px; overflow: auto; line-height: 1.55; }
.id-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; font-family: inherit; }
.id-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; padding: 3px 0; border-bottom: 1px dashed var(--border); }
.id-row span { color: var(--idle); flex: none; }
.id-row b { font-weight: 600; color: var(--text); text-align: right; word-break: break-all; }
.id-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.id-status { font-size: 11.5px; color: var(--ok); font-weight: 600; }

/* 操作回放播放器 */
.cast { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #0d1220; }
.cast-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0d1220 center/contain no-repeat; display: grid; place-items: center; }
.cast-stage img { max-width: 100%; max-height: 100%; display: block; }
.cast-mark { position: absolute; left: 10px; top: 10px; background: rgba(13,18,32,.82); color: #fff; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 8px; border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(4px); }
.cast-ctrl { display: flex; align-items: center; gap: 11px; padding: 10px 12px; background: var(--panel-solid); border-top: 1px solid var(--border); }
.cast-ctrl input[type=range] { flex: 1; accent-color: var(--accent); }
.cast-time { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 78px; text-align: right; }

/* 实时观看(浏览器采购运行中) */
.live-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0d1220; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: grid; place-items: center; }
.live-stage img { max-width: 100%; max-height: 100%; display: block; }
.live-wait { position: absolute; color: var(--muted); font-size: 13px; }
.live-mark { position: absolute; left: 10px; bottom: 10px; background: rgba(13,18,32,.82); color: #fff; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 8px; border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(4px); }
.live-dot { color: #ff4d4f; margin: 0 3px; animation: livepulse 1.1s infinite; }
@keyframes livepulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* ---------- 手机端适配 ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  /* 侧栏改为离屏抽屉:汉堡 + 蒙层切换(原先直接 display:none 会让手机无导航) */
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100vh; width: 250px; display: block;
    z-index: 60; transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 0 0 44px rgba(20, 28, 55, .2);
  }
  body.nav-open .sidebar { transform: none; }
  .scrim {
    display: block; position: fixed; inset: 0; background: rgba(20, 28, 55, .42);
    z-index: 55; opacity: 0; pointer-events: none; transition: opacity .22s;
  }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .hamburger { display: inline-flex; }

  .main { padding: 18px 15px 56px; max-width: 100%; }
  .topbar { flex-wrap: wrap; gap: 12px 10px; margin-bottom: 20px; }
  .topbar h2 { font-size: 20px; }
  .topbar-actions { flex: 1 1 100%; justify-content: space-between; }

  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

  /* 宽表格横向滚动,不挤成一团 */
  .panel-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .panel-body table { min-width: 480px; }

  /* 表单/明细单列 */
  .form-grid, .detail-grid, .type-pick, .adv-grid, .id-grid { grid-template-columns: 1fr; }
  .type-pick.compact { grid-template-columns: 1fr 1fr; }

  /* 弹窗近全宽 */
  .modal-mask { padding: 10px; }
  .modal, .modal.wide { max-width: 100%; max-height: 92vh; }
  .modal-head { padding: 15px 16px; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 13px 16px; }
}

@media (max-width: 480px) {
  .main { padding: 14px 12px 48px; }
  .topbar h2 { font-size: 18px; }
  .user-chip { padding: 6px 7px; }
  .user-chip #uname { display: none; }
  .btn-new { padding: 9px 13px; font-size: 13px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat .v { font-size: 25px; }
  .type-pick.compact { grid-template-columns: 1fr; }
}
