:root {
  --bg: #0f1420; --panel: #172032; --panel2: #1e2a42; --line: #2a3a5a;
  --fg: #e6ecf7; --muted: #8ea0c4; --accent: #4da3ff; --accent2: #37d39b;
  --warn: #f0b429; --danger: #ff6b6b;
  --pending: #6b7a99; --running: #4da3ff; --done: #37d39b; --failed: #ff6b6b;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--fg);
  font: 14px/1.5 -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--danger); margin-top: 10px; font-size: 13px; }
h1, h3 { margin: 0; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 34px 30px; width: 340px; text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,.4);
}
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card input { width: 100%; margin: 18px 0 12px; }

/* 顶栏 */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 22px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-size: 17px; font-weight: 700; }
.badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.badge {
  background: var(--panel2); border: 1px solid var(--line); color: var(--muted);
  padding: 4px 10px; border-radius: 20px; font-size: 12px;
}
.badge.warn { color: var(--warn); border-color: var(--warn); }
.badge.danger { color: var(--danger); border-color: var(--danger); }

main { padding: 20px; max-width: 1180px; margin: 0 auto; }

/* 卡片 */
.cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.card .k { color: var(--muted); font-size: 13px; }
.card .v { font-size: 26px; font-weight: 700; margin-top: 6px; }

/* 进度 */
.progress { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 18px; }
.progress .row { display: flex; justify-content: space-between; margin-bottom: 8px; }
.bar { height: 12px; background: var(--panel2); border-radius: 8px; overflow: hidden; }
.fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .5s; }
.statusgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.scell { background: var(--panel2); border-radius: 10px; padding: 12px; text-align: center; border-left: 3px solid var(--line); }
.scell .sv { font-size: 20px; font-weight: 700; }
.scell .sn { color: var(--muted); font-size: 12px; }
.scell.pending { border-color: var(--pending); }
.scell.running { border-color: var(--running); }
.scell.done { border-color: var(--done); }
.scell.failed { border-color: var(--failed); }

/* 三栏 */
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 14px; margin-bottom: 18px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.panel h3 { font-size: 15px; margin-bottom: 12px; color: var(--fg); }

/* 条形 */
.bars .brow { display: grid; grid-template-columns: 74px 1fr 46px; align-items: center; gap: 8px; margin: 6px 0; }
.blab { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btrack { background: var(--panel2); border-radius: 6px; height: 14px; overflow: hidden; }
.bfill { display: block; height: 100%; background: var(--accent2); }
.bfill.blue { background: var(--accent); }
.bval { text-align: right; font-size: 12px; color: var(--fg); }

/* top 榜 */
.list { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow: auto; }
.list li { display: flex; justify-content: space-between; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.list .tname { cursor: pointer; color: var(--accent); }
.list .tname:hover { text-decoration: underline; }
.list .tcnt { color: var(--muted); }

/* 工具/筛选 */
.secthead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; }
.tools { display: flex; gap: 8px; }
.filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.input { background: var(--panel2); border: 1px solid var(--line); color: var(--fg); border-radius: 8px; padding: 8px 10px; font-size: 13px; }

/* 表格 */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
td.kw { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tbody tr:hover { background: var(--panel2); cursor: pointer; }
.pill { padding: 2px 8px; border-radius: 20px; font-size: 11px; color: #08101f; font-weight: 700; }
.pill.pending { background: var(--pending); color: #fff; }
.pill.running { background: var(--running); }
.pill.done { background: var(--done); }
.pill.failed { background: var(--failed); color: #fff; }

.pager { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 14px; }

/* 按钮 */
.btn { background: var(--accent); color: #06101f; border: none; border-radius: 8px; padding: 8px 14px; cursor: pointer; font-size: 13px; font-weight: 600; }
.btn:hover { filter: brightness(1.08); }
.btn.primary { width: 100%; padding: 10px; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.btn.tiny { padding: 3px 8px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: default; }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 20; }
.modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: min(760px, 92vw); max-height: 82vh; display: flex; flex-direction: column; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 700; }
.modal-body { padding: 14px 18px; overflow: auto; }
.cite { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.ci { color: var(--muted); min-width: 36px; font-size: 13px; padding-top: 2px; }
.cmain { flex: 1; min-width: 0; }
.ctitle { font-size: 15px; line-height: 1.5; font-weight: 600; color: var(--fg); }
.ctitle.en { color: #cfe0ff; font-weight: 500; }
.cmeta { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.ctype { display: inline-block; margin-left: 8px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; font-size: 11px; color: var(--accent2); vertical-align: 1px; }

@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .grid3 { grid-template-columns: 1fr; }
}
