/* =========================================================================
   HPC 任务管理系统 v2.3 · 视觉样式
   浅色工作区 + 深色「控制台」面板；128 个物理核的实时热力图是全站的视觉中心。
   ========================================================================= */
:root {
  --bg: #f3f4f6;
  --surface: #fff;
  --surface-2: #f8f9fb;
  --sunken: #eff1f4;
  --ink: #0d121c;
  --ink-2: #4a5263;
  --ink-3: #8b93a2;
  --line: #e6e8ed;
  --line-2: #d6dae1;
  --brand: #2f5bea;
  --brand-ink: #2149c9;
  --brand-soft: #edf1fe;
  --castep: #2f5bea;
  --castep-soft: #edf1fe;
  --cp2k: #ea7317;
  --cp2k-ink: #b9580b;
  --cp2k-soft: #fdf1e6;
  --ok: #10995a;
  --ok-soft: #e7f6ee;
  --warn: #c27c06;
  --warn-soft: #fcf4e3;
  --bad: #dc3f46;
  --bad-soft: #fcecec;
  --mute: #6b7384;
  --mute-soft: #eff1f4;
  --console: #0b1019;
  --console-2: #121927;
  --console-3: #1a2232;
  --c-line: rgba(255, 255, 255, .08);
  --c-ink: #e8edf6;
  --c-ink-2: #9aa5ba;
  --c-ink-3: #606c83;
  --cell: rgba(255, 255, 255, .065);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(13, 18, 28, .05);
  --shadow-md: 0 6px 18px -8px rgba(13, 18, 28, .18);
  --shadow-lg: 0 24px 60px -24px rgba(13, 18, 28, .45);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", "Noto Sans SC", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;
  --side-w: 244px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-ink); }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
code, pre, .mono { font-family: var(--mono); }
.ic { flex: none; display: inline-block; vertical-align: -0.2em; }
.muted { color: var(--ink-3); }
.sub { color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
::selection { background: rgba(47, 91, 234, .18); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- 布局 ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 40; display: flex; flex-direction: column; background: var(--console); color: var(--c-ink-2); }
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 18px 16px; color: #fff; }
.brand:hover { color: #fff; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand b { display: block; font-size: 14.5px; font-weight: 650; letter-spacing: .01em; }
.brand small { display: block; font-size: 10.5px; color: var(--c-ink-3); letter-spacing: .1em; font-family: var(--mono); margin-top: 1px; }
.nav { padding: 4px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 10.5px; letter-spacing: .18em; color: var(--c-ink-3); padding: 18px 10px 6px; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; border-radius: 9px; color: var(--c-ink-2); font-weight: 500; font-size: 13.5px; transition: background .15s, color .15s; }
.nav a .ic { opacity: .75; }
.nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav a.on { color: #fff; background: rgba(255, 255, 255, .08); }
.nav a.on::before { content: ""; position: absolute; left: -10px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: #7098ff; }
.nav a.on .ic { opacity: 1; color: #8eabff; }
.nav a .pill { margin-left: auto; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 6px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }
.side-foot { margin-top: auto; padding: 14px; }
.node-card { display: block; border-radius: 12px; padding: 12px; background: var(--console-2); border: 1px solid var(--c-line); color: var(--c-ink-2); }
.node-card:hover { color: var(--c-ink-2); border-color: rgba(255, 255, 255, .14); }
.node-card .nc-h { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--c-ink); font-weight: 600; }
.node-card .nc-h .mono { font-weight: 500; font-size: 11.5px; }
.node-card .nc-h b { margin-left: auto; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; color: #fff; }
.node-card .nc-h b small { font-size: 10.5px; font-weight: 500; color: var(--c-ink-3); margin-left: 3px; }
.node-card .nc-f { display: flex; justify-content: space-between; font-size: 11.5px; margin-top: 10px; font-variant-numeric: tabular-nums; }
.node-card .nc-f b { color: var(--c-ink); font-weight: 600; }
.live-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #2bd48a; animation: live 2s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(43, 212, 138, .55); } 70% { box-shadow: 0 0 0 7px rgba(43, 212, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(43, 212, 138, 0); } }
.main { flex: 1; margin-left: var(--side-w); min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 14px 36px; background: rgba(243, 244, 246, .86); -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar h1 { font-size: 22px; font-weight: 650; letter-spacing: -.025em; line-height: 1.3; }
.topbar .crumb { color: var(--ink-3); font-size: 12px; }
.topbar .crumb a { color: var(--ink-3); }
.topbar .crumb a:hover { color: var(--ink); }
.topbar .spacer { flex: 1; }
.menu-btn { display: none !important; }
.user-chip { display: flex; align-items: center; gap: 9px; height: 36px; padding: 0 13px 0 4px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: 13px; font-weight: 600; }
.user-chip:hover { color: var(--ink); border-color: var(--line-2); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 650; color: #fff; font-size: 12px; background: var(--console); }
.content { padding: 4px 36px 56px; max-width: 1480px; }

/* ---------- 物理核热力图 ---------- */
.coremap { display: grid; grid-template-columns: repeat(var(--sockets, 2), minmax(0, 1fr)); gap: 7px; }
.cells { display: grid; grid-template-columns: repeat(var(--cols, 8), minmax(0, 1fr)); gap: 2px; }
.cells i { display: block; aspect-ratio: 1; border-radius: 1.5px; background: var(--cell); transition: background-color .6s ease; }
.node-card .coremap { margin-top: 11px; }
.socket-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--c-ink-3); }
.socket-h b { color: var(--c-ink-2); font-weight: 500; }

/* ---------- 总览控制台 ---------- */
.console { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 44px; padding: 30px 32px 28px; border-radius: 18px; background: var(--console); color: var(--c-ink); box-shadow: var(--shadow-lg); }
.console::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(55% 75% at 100% 0%, rgba(47, 91, 234, .2), transparent 62%), radial-gradient(40% 55% at 0% 100%, rgba(234, 115, 23, .09), transparent 60%); }
.console > * { position: relative; min-width: 0; }
.console-main { display: flex; flex-direction: column; }
.console .eyebrow { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--c-ink-2); }
.console .eyebrow .mono { color: var(--c-ink-3); font-size: 11.5px; margin-left: auto; }
.console .big { display: flex; align-items: baseline; gap: 10px; margin-top: 26px; font-variant-numeric: tabular-nums; }
.console .big b { font-size: 68px; line-height: .95; font-weight: 600; letter-spacing: -.045em; color: #fff; }
.console .big span { font-size: 26px; color: var(--c-ink-3); font-weight: 500; letter-spacing: -.02em; }
.console .big-label { margin-top: 12px; font-size: 13.5px; color: var(--c-ink-2); }
.console .big-label b { color: var(--c-ink); font-weight: 600; }
.console-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 28px; border-top: 1px solid var(--c-line); }
.console-stats > div { padding-top: 14px; min-width: 0; }
.console-stats > div + div { padding-left: 18px; border-left: 1px solid var(--c-line); }
.console-stats > div > span { display: block; font-size: 11.5px; color: var(--c-ink-3); }
.console-stats b { display: block; margin-top: 3px; font-size: 21px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.console-stats b small { font-size: 13px; font-weight: 500; color: var(--c-ink-2); margin-left: 2px; letter-spacing: 0; }
.console .actions { display: flex; gap: 10px; margin-top: auto; padding-top: 28px; flex-wrap: wrap; }
.console .coremap { gap: 18px; }
.console .socket { padding: 14px 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, .025); border: 1px solid var(--c-line); }
.console .cells { gap: 5px; }
.console .cells i { border-radius: 3.5px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; font-size: 12px; color: var(--c-ink-2); min-height: 18px; }
.map-legend .lg { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-variant-numeric: tabular-nums; }
.map-legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.map-legend b { color: var(--c-ink); font-weight: 600; }
.jc-0 { --jc: #5b8cff; } .jc-1 { --jc: #ff9a4d; } .jc-2 { --jc: #3dd6c3; } .jc-3 { --jc: #b98cff; }
.jc-4 { --jc: #ff6f96; } .jc-5 { --jc: #cfe05a; } .jc-6 { --jc: #56c8f5; } .jc-7 { --jc: #ffd166; }

/* ---------- 卡片与网格 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.card-h h3 { font-size: 14.5px; font-weight: 650; }
.card-h .tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-b { padding: 18px 20px 20px; }
.grid { display: grid; gap: 16px; }
.grid > *, .submit-layout > * { min-width: 0; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
.mt { margin-top: 16px; }
.section-label { display: flex; align-items: center; gap: 10px; margin: 30px 0 12px; font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: .04em; }
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- 按钮 ---------- */
.btn { --c: var(--ink); --bd: var(--line-2); --bgc: var(--surface); display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--bd); background: var(--bgc); color: var(--c); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .08s; }
.btn:hover { color: var(--c); --bd: #bfc5cf; }
.btn:active { transform: translateY(1px); }
.btn.primary { --c: #fff; --bd: var(--brand); --bgc: var(--brand); box-shadow: 0 1px 2px rgba(47, 91, 234, .35), inset 0 1px 0 rgba(255, 255, 255, .16); }
.btn.primary:hover { --bgc: var(--brand-ink); --bd: var(--brand-ink); }
.btn.dark { --c: #fff; --bd: var(--console); --bgc: var(--console); }
.btn.dark:hover { --bgc: #1d2536; --bd: #1d2536; }
.btn.light { --c: var(--console); --bd: #fff; --bgc: #fff; }
.btn.light:hover { --bgc: #e6ebf4; --bd: #e6ebf4; }
.btn.c-ghost { --c: #fff; --bd: rgba(255, 255, 255, .16); --bgc: rgba(255, 255, 255, .04); }
.btn.c-ghost:hover { --bgc: rgba(255, 255, 255, .1); --bd: rgba(255, 255, 255, .26); }
.btn.ghost { --bd: transparent; --bgc: transparent; }
.btn.ghost:hover { --bgc: var(--sunken); --bd: transparent; }
.btn.danger { --c: var(--bad); }
.btn.danger:hover { --bgc: var(--bad-soft); --bd: #f0c4c6; }
.btn.danger-solid { --c: #fff; --bd: var(--bad); --bgc: var(--bad); }
.btn.danger-solid:hover { --bgc: #c4323a; --bd: #c4323a; }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 14px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .4; pointer-events: none; }
.icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--ink-3); cursor: pointer; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--sunken); color: var(--ink); }
.icon-btn.danger:hover { background: var(--bad-soft); color: var(--bad); }
.icon-btn[disabled] { opacity: .3; pointer-events: none; }

/* ---------- 徽标 / 状态 ---------- */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 650; letter-spacing: .02em; white-space: nowrap; }
.badge.xs { height: 18px; padding: 0 6px; font-size: 10.5px; border-radius: 5px; vertical-align: 1px; }
.t-castep { color: var(--castep); background: var(--castep-soft); }
.t-cp2k { color: var(--cp2k-ink); background: var(--cp2k-soft); }
.t-mine { color: var(--ink-2); background: var(--sunken); }
.status { display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 9px 0 8px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.s-running { color: var(--brand); background: var(--brand-soft); }
.s-running::before { animation: live-b 1.6s infinite; }
@keyframes live-b { 0% { box-shadow: 0 0 0 0 rgba(47, 91, 234, .5); } 70% { box-shadow: 0 0 0 5px rgba(47, 91, 234, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 91, 234, 0); } }
.s-pending { color: var(--warn); background: var(--warn-soft); }
.s-done { color: var(--ok); background: var(--ok-soft); }
.s-failed { color: var(--bad); background: var(--bad-soft); }
.s-stopped, .s-missing, .s-cancelled { color: var(--mute); background: var(--mute-soft); }
.tico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; font-family: var(--mono); font-weight: 700; font-size: 10px; letter-spacing: -.01em; color: var(--mute); background: var(--mute-soft); }
.tico.castep { background: var(--castep-soft); color: var(--castep); }
.tico.cp2k { background: var(--cp2k-soft); color: var(--cp2k-ink); }

/* ---------- 指标卡 ---------- */
.metric { padding: 16px 18px 15px; display: flex; flex-direction: column; gap: 10px; min-height: 162px; }
.metric .top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.metric .top .ic { color: var(--ink-3); }
.metric .top .muted { margin-left: auto; font-weight: 500; font-size: 11px; font-family: var(--mono); }
.metric .val { display: flex; align-items: baseline; gap: 3px; }
.metric .val b { font-size: 34px; line-height: 1.05; font-weight: 600; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.metric .val span { color: var(--ink-3); font-size: 14px; font-weight: 500; }
.metric .foot { margin-top: auto; display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.metric .foot b { color: var(--ink-2); font-weight: 600; }
.spark { width: 100%; height: 38px; display: block; overflow: visible; }
.bar { height: 6px; border-radius: 99px; background: var(--sunken); overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--ink); transition: width .6s ease; }
.kv > div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px dashed var(--line); font-size: 13px; }
.kv > div:first-child { border-top: 0; padding-top: 0; }
.kv span { color: var(--ink-3); }
.kv b { font-weight: 600; font-variant-numeric: tabular-nums; }
.ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--sunken); color: var(--ink-2); }

/* ---------- 列表 ---------- */
.task-item { display: flex; align-items: center; gap: 13px; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--ink); transition: background .12s; }
.task-item:first-child { border-top: 0; }
a.task-item:hover { background: var(--surface-2); color: var(--ink); }
.task-item .grow { flex: 1; min-width: 0; }
.task-item .tname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-item .tmeta { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-item .tmeta b { color: var(--ink-2); font-weight: 600; }
.q-item { box-shadow: inset 3px 0 0 var(--jc, transparent); }
.mini-counts { display: flex; gap: 14px; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.mini-counts b { color: var(--ink); font-weight: 650; margin-right: 3px; }
.empty { padding: 44px 20px; text-align: center; color: var(--ink-3); font-size: 13px; }
.empty .ic { color: #c5cad3; margin-bottom: 10px; }
.empty b { display: block; color: var(--ink-2); margin-bottom: 3px; font-size: 14px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--ink-3); letter-spacing: .04em; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { padding-left: 20px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 14px; }
.tbl td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr.link { cursor: pointer; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .name { font-weight: 600; max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .name small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.tbl .acts { display: flex; gap: 2px; justify-content: flex-end; }
.tbl tr.mine td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.jid { font-family: var(--mono); font-size: 12px; color: var(--ink-2); background: var(--sunken); padding: 2px 7px; border-radius: 6px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--sunken); }
.seg a, .seg button { border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 12.5px; color: var(--ink-3); padding: 5px 12px; border-radius: 7px; cursor: pointer; }
.seg a:hover, .seg button:hover { color: var(--ink); }
.seg .on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(13, 18, 28, .1), 0 0 0 1px rgba(13, 18, 28, .04); }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.fchip:hover { border-color: var(--line-2); }
.fchip i { font-style: normal; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.fchip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.fchip.on i { color: rgba(255, 255, 255, .6); }
.search { position: relative; margin-left: auto; }
.search input { width: 240px; height: 34px; padding-left: 34px; }
.search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--ink-3); }
.input { height: 40px; padding: 0 13px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); font: inherit; font-size: 14px; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; width: 100%; }
.input::placeholder { color: #aab1bd; }
.input:hover { border-color: #c3c9d2; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 91, 234, .14); }
.input.err { border-color: #e9989c; box-shadow: 0 0 0 3px rgba(220, 63, 70, .08); }
.input.ok { border-color: #8ed2b1; }
.field-msg { font-size: 12px; min-height: 18px; color: var(--ink-3); }
.field-msg.err { color: var(--bad); }
.field-msg.ok { color: var(--ok); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ink-2); font-size: 13px; }
.check input { width: 15px; height: 15px; margin: 0; accent-color: var(--brand); }

/* ---------- 提交页 ---------- */
.submit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 16px; align-items: start; }
.step { padding: 22px 24px 24px; }
.step + .step { border-top: 1px solid var(--line); }
.step-h { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.step-n { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: .04em; }
.step-h h3 { font-size: 15px; }
.step-h .muted { margin-left: auto; font-size: 12.5px; }
.prog-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.prog { position: relative; display: flex; gap: 14px; padding: 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; text-align: left; font: inherit; color: inherit; }
.prog:hover { border-color: #bfc5cf; }
.prog .logo { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.prog.castep .logo { background: var(--castep-soft); color: var(--castep); }
.prog.cp2k .logo { background: var(--cp2k-soft); color: var(--cp2k); }
.prog b { font-size: 15px; display: block; }
.prog p { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; padding-right: 20px; }
.prog .req { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.prog .req code { font-size: 11px; padding: 2px 7px; border-radius: 5px; background: var(--sunken); color: var(--ink-2); }
.prog .tick { position: absolute; top: 14px; right: 14px; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; color: transparent; }
.prog.castep.on { border-color: var(--castep); box-shadow: 0 0 0 3px rgba(47, 91, 234, .12); }
.prog.cp2k.on { border-color: var(--cp2k); box-shadow: 0 0 0 3px rgba(234, 115, 23, .13); }
.prog.castep.on .tick { background: var(--castep); border-color: var(--castep); color: #fff; }
.prog.cp2k.on .tick { background: var(--cp2k); border-color: var(--cp2k); color: #fff; }
.dropzone { position: relative; border-radius: 12px; border: 1.5px dashed var(--line-2); background: var(--surface-2); padding: 30px 20px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover { border-color: #aab3c2; }
.dropzone.drag { border-color: var(--brand); background: var(--brand-soft); }
.dropzone .bub { width: 46px; height: 46px; border-radius: 12px; margin: 0 auto 12px; display: grid; place-items: center; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.dropzone b { font-size: 14.5px; display: block; }
.dropzone p { color: var(--ink-3); font-size: 12.5px; margin-top: 3px; }
.dropzone .links { margin-top: 14px; display: flex; gap: 8px; justify-content: center; }
.file-table { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 7px 8px 7px 12px; border-top: 1px solid var(--line); font-size: 13px; }
.file-row:first-child { border-top: 0; }
.file-row .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12.5px; }
.file-row .fsize { color: var(--ink-3); font-size: 12px; width: 72px; text-align: right; font-variant-numeric: tabular-nums; }
.file-head { display: flex; justify-content: space-between; padding: 8px 12px; background: var(--surface-2); font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.role { font-size: 11px; font-weight: 650; padding: 2px 7px; border-radius: 5px; white-space: nowrap; }
.r-cell { background: var(--castep-soft); color: var(--castep); }
.r-param { background: #f1edfd; color: #6a45d8; }
.r-inp { background: var(--cp2k-soft); color: var(--cp2k-ink); }
.r-pot { background: #e5f5f2; color: #0f8577; }
.r-other { background: var(--mute-soft); color: var(--mute); }
.r-skip { background: var(--bad-soft); color: var(--bad); }
.checklist { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.checklist div { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); }
.checklist .dot { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--mute-soft); color: var(--ink-3); }
.checklist .ok .dot { background: var(--ok-soft); color: var(--ok); }
.checklist .no .dot { background: var(--bad-soft); color: var(--bad); }
.checklist code { font-size: 12px; background: var(--sunken); padding: 1px 6px; border-radius: 5px; }
.cores-box { display: flex; align-items: center; gap: 18px; }
.cores-num { width: 104px !important; height: 48px !important; text-align: center; font-size: 21px !important; font-weight: 650; font-variant-numeric: tabular-nums; }
.range { flex: 1; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 99px; outline: none; background: linear-gradient(90deg, var(--brand) var(--fill, 10%), var(--sunken) var(--fill, 10%)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 1px solid var(--line-2); box-shadow: 0 1px 4px rgba(13, 18, 28, .25); cursor: grab; }
.range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 1px solid var(--line-2); box-shadow: 0 1px 4px rgba(13, 18, 28, .25); cursor: grab; }
.presets { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.presets button { height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; font-variant-numeric: tabular-nums; }
.presets button:hover { border-color: var(--line-2); color: var(--ink); }
.presets button.on { border-color: var(--ink); color: #fff; background: var(--ink); }
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 10px; font-size: 12.5px; margin-top: 14px; }
.callout.info { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.callout.warn { background: var(--warn-soft); color: #845400; }
.callout.bad { background: var(--bad-soft); color: #a3242b; }
.callout .ic { margin-top: 1px; }
.callout ul { margin: 4px 0 0; padding-left: 18px; }
.summary-card { position: sticky; top: 92px; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--line); font-size: 13px; }
.sum-row:first-child { border-top: 0; padding-top: 0; }
.sum-row > span:first-child { color: var(--ink-3); }
.sum-row > span:last-child { font-weight: 600; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
details.script { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
details.script summary { cursor: pointer; padding: 10px 13px; font-size: 13px; font-weight: 600; color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: 8px; background: var(--surface-2); }
details.script summary::-webkit-details-marker { display: none; }
.code { margin: 0; padding: 14px 16px; background: var(--console); color: #cdd8ec; font-size: 12px; line-height: 1.65; overflow: auto; max-height: 380px; white-space: pre; }
.code .c { color: #66748f; }
.code .k { color: #ffb47a; }
.code .v { color: #7fdcae; }
.upload-progress .bar { height: 6px; }
.upload-progress .bar i { background: var(--brand); }
.upload-progress .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-top: 6px; font-variant-numeric: tabular-nums; }

/* ---------- 任务详情 ---------- */
.detail-head { padding: 22px 24px; display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.big-ico { width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; flex: none; font-family: var(--mono); font-weight: 700; font-size: 12px; }
.big-ico.castep { background: var(--castep-soft); color: var(--castep); }
.big-ico.cp2k { background: var(--cp2k-soft); color: var(--cp2k-ink); }
.detail-head h2 { font-size: 21px; letter-spacing: -.02em; word-break: break-all; }
.detail-head .badges { display: flex; gap: 8px; margin-top: 7px; flex-wrap: wrap; align-items: center; }
.detail-head .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.meta-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.meta-grid > div { padding: 13px 20px; border-left: 1px solid var(--line); min-width: 0; }
.meta-grid > div:first-child { border-left: 0; padding-left: 24px; }
.meta-grid span { display: block; font-size: 11.5px; color: var(--ink-3); }
.meta-grid b { display: block; font-size: 15px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta-grid b.live { color: var(--brand); }
.tabs { display: flex; gap: 2px; padding: 0 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { position: relative; border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 13px; color: var(--ink-3); padding: 13px 12px; cursor: pointer; display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; }
.tabs button:hover, .tabs button.on { color: var(--ink); }
.tabs button.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ink); }
.tabs .cnt { font-size: 11px; background: var(--sunken); color: var(--ink-3); padding: 0 7px; border-radius: 99px; }
.tab-panel { display: none; }
.tab-panel.on { display: block; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fact { padding: 11px 13px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.fact span { display: block; font-size: 11.5px; color: var(--ink-3); }
.fact b { display: block; margin-top: 2px; font-family: var(--mono); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.chart-box { position: relative; height: 300px; }
.chart-box svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart-tip { position: absolute; pointer-events: none; background: var(--console); color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 7px; white-space: nowrap; transform: translate(-50%, -130%); opacity: 0; transition: opacity .1s; font-family: var(--mono); box-shadow: var(--shadow-md); }
.log-box { background: var(--console); border-radius: 12px; overflow: hidden; border: 1px solid #000; }
.log-head { display: flex; align-items: center; gap: 12px; padding: 9px 12px; background: var(--console-2); border-bottom: 1px solid var(--c-line); color: var(--c-ink-2); font-size: 12.5px; flex-wrap: wrap; }
.log-head .dots { display: flex; gap: 6px; }
.log-head .dots i { width: 10px; height: 10px; border-radius: 50%; background: #3a4458; }
.log-head select { background: var(--console); color: var(--c-ink); border: 1px solid #2a3449; border-radius: 7px; height: 30px; padding: 0 8px; font: inherit; font-size: 12.5px; max-width: 280px; }
.log-head .check { color: var(--c-ink-2); font-size: 12.5px; }
.log-head .spacer { flex: 1; }
.log-head .btn { --c: var(--c-ink); --bd: #2a3449; --bgc: var(--console); }
.log-head .btn:hover { --bgc: var(--console-3); --bd: #36425a; }
.log-body { margin: 0; padding: 14px 16px; color: #cdd8ec; font-family: var(--mono); font-size: 12px; line-height: 1.6; height: 520px; overflow: auto; white-space: pre; tab-size: 4; }
.log-body.full { height: calc(100vh - 230px); min-height: 400px; }
.hl-err { color: #ff8a8f; }
.hl-ok { color: #7fdcae; }
.hl-k { color: #ffc47a; }

/* ---------- Toast & Modal ---------- */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 280px; max-width: 420px; display: flex; gap: 10px; align-items: flex-start; padding: 12px 13px; border-radius: 12px; background: var(--console); color: var(--c-ink); box-shadow: var(--shadow-lg); font-size: 13.5px; animation: toast-in .35s cubic-bezier(.2, .9, .3, 1.2); }
.toast .ti { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.toast.success .ti { background: rgba(43, 212, 138, .16); color: #4fdc9c; }
.toast.error .ti { background: rgba(255, 100, 108, .16); color: #ff8a8f; }
.toast.info .ti, .toast.message .ti { background: rgba(110, 150, 255, .18); color: #9db6ff; }
.toast .x { margin-left: auto; color: var(--c-ink-3); cursor: pointer; border: 0; background: none; padding: 0; }
.toast .x:hover { color: #fff; }
.toast.out { animation: toast-out .25s forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }
.modal-mask { position: fixed; inset: 0; z-index: 90; background: rgba(11, 16, 25, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-mask.show { display: flex; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 420px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 22px; animation: pop .25s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
.m-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--bad-soft); color: var(--bad); margin-bottom: 14px; }
.m-ico.warn { background: var(--warn-soft); color: var(--warn); }
.modal h3 { font-size: 16px; }
.modal p { color: var(--ink-2); margin-top: 6px; font-size: 13.5px; }
.m-acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 22px; }

/* ---------- 登录页 ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); background: var(--surface); }
.login-art { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 38px 52px 46px; background: var(--console); color: var(--c-ink); }
.login-art::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(60% 55% at 85% 20%, rgba(47, 91, 234, .24), transparent 65%), radial-gradient(45% 45% at 5% 100%, rgba(234, 115, 23, .12), transparent 60%); }
.login-art > * { position: relative; }
.login-art .top { display: flex; align-items: center; gap: 11px; }
.login-art .top img { width: 36px; height: 36px; border-radius: 9px; }
.login-art .top b { display: block; font-size: 15px; font-weight: 650; color: #fff; }
.login-art .top small { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; color: var(--c-ink-3); }
.login-chip { margin: auto 0; padding: 40px 0; width: 100%; max-width: 500px; }
.login-chip .coremap { gap: 18px; }
.login-chip .socket { padding: 14px 14px 16px; border: 1px solid var(--c-line); border-radius: 14px; background: rgba(255, 255, 255, .025); }
.login-chip .cells { gap: 5px; }
.login-chip .cells i { border-radius: 3.5px; }
.login-chip .cells i.a, .login-chip .cells i.b { animation: cell 7s ease-in-out infinite; animation-delay: var(--d, 0s); }
.login-chip .cells i.a { --on: rgba(91, 140, 255, .9); }
.login-chip .cells i.b { --on: rgba(255, 154, 77, .9); }
@keyframes cell { 0%, 100% { background-color: var(--cell); } 35%, 70% { background-color: var(--on); } }
.login-art .copy h1 { font-size: 34px; line-height: 1.2; font-weight: 650; letter-spacing: -.035em; color: #fff; }
.login-art .copy p { margin-top: 12px; color: var(--c-ink-2); font-size: 15px; }
.spec-line { display: flex; flex-wrap: wrap; row-gap: 6px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--c-line); font-family: var(--mono); font-size: 12px; color: var(--c-ink-3); }
.spec-line span + span::before { content: "·"; margin: 0 10px; color: rgba(255, 255, 255, .22); }
.login-form-side { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-card { width: 100%; max-width: 352px; }
.login-brand { display: none; align-items: center; gap: 12px; margin-bottom: 36px; }
.login-brand img { width: 40px; height: 40px; border-radius: 10px; }
.login-brand b { display: block; font-size: 16px; }
.login-brand small { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); letter-spacing: .1em; }
.login-card h2 { font-size: 28px; letter-spacing: -.035em; }
.login-card .lead { color: var(--ink-3); margin: 6px 0 28px; font-size: 13.5px; }
.login-card form { display: flex; flex-direction: column; gap: 16px; }
.login-card .btn.lg { margin-top: 6px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 42px; }
.pw-wrap .icon-btn { position: absolute; right: 4px; top: 4px; }
.error-box { max-width: 500px; margin: 60px auto; text-align: center; padding: 40px; }
.code-n { font-size: 64px; font-weight: 650; letter-spacing: -.05em; color: var(--ink); font-variant-numeric: tabular-nums; }
.scrim { position: fixed; inset: 0; background: rgba(11, 16, 25, .45); z-index: 35; display: none; }
.scrim.show { display: block; }

/* ---------- 响应式 ---------- */
@media (max-width: 1280px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .meta-grid > div:nth-child(4) { border-left: 0; padding-left: 24px; }
  .meta-grid > div:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media (max-width: 1100px) {
  .tbl .name { max-width: 240px; }
  .g-main, .submit-layout { grid-template-columns: minmax(0, 1fr); }
  .summary-card { position: static; }
}
@media (max-width: 960px) {
  .console { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .console .actions { margin-top: 0; }
  .console-map { max-width: 520px; }
}
@media (max-width: 880px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid !important; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .topbar { min-height: 64px; }
  .topbar h1 { font-size: 19px; }
  .login-page { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-brand { display: flex; }
  .prog-cards, .g-2, .facts { grid-template-columns: minmax(0, 1fr); }
  #ovGrid { grid-template-columns: minmax(0, 1fr) !important; }
  .detail-head .acts { margin-left: 0; width: 100%; }
  .search { margin-left: 0; width: 100%; }
  .search input { width: 100%; }
  .console { padding: 22px 20px; }
  .console .big b { font-size: 54px; }
  .user-chip span:not(.avatar) { display: none; }
  .user-chip { padding: 0 4px; }
  .hide-md { display: none; }
}
@media (max-width: 560px) {
  .g-4 { grid-template-columns: 1fr; }
  .console .coremap { gap: 10px; }
  .console .socket { padding: 10px; }
  .console .cells { gap: 3px; }
  .console-stats b { font-size: 18px; }
  .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta-grid > div { border-left: 0 !important; padding-left: 20px !important; border-top: 1px solid var(--line); }
  .hide-sm { display: none; }
  .cores-box { flex-direction: column; align-items: stretch; }
  .cores-num { width: 100% !important; }
  .mini-counts { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.q-item .tmeta { white-space: normal; }
