:root { color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.55 system-ui, "PingFang SC", "Microsoft YaHei", "Noto Sans JP", sans-serif; background: #0f172a; color: #e2e8f0; }
a { color: #93c5fd; text-decoration: none; } a:hover { text-decoration: underline; }
code { background: #1e293b; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.muted { color: #94a3b8; } .small { font-size: 12px; }

/* 布局 */
.app { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }
.side { background: #1e293b; border-right: 1px solid #334155; padding: 16px 12px; position: sticky; top: 0; height: 100vh; }
.side .brand { font-weight: 700; font-size: 16px; padding: 4px 8px 14px; display: flex; align-items: center; gap: 8px; }
.side .brand .dot { width: 10px; height: 10px; border-radius: 50%; background: #3b82f6; }
.side nav a { display: block; padding: 8px 10px; border-radius: 8px; color: #cbd5e1; }
.side nav a.active, .side nav a:hover { background: #334155; color: #fff; text-decoration: none; }
.side .foot { position: absolute; bottom: 14px; left: 12px; right: 12px; }
.main { padding: 20px 26px; min-width: 0; }
.main h1 { font-size: 20px; margin: 0 0 14px; display: flex; align-items: center; gap: 12px; }
.main h1 .actions { margin-left: auto; display: flex; gap: 8px; }
.flash { background: #1d4ed8; color: #fff; padding: 8px 12px; border-radius: 8px; margin-bottom: 14px; }
.flash.err, .notice.err { background: #7f1d1d; }
.notice { background: #1e293b; border: 1px solid #334155; padding: 10px 12px; border-radius: 8px; margin: 10px 0; }

/* 卡片/统计 */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.card { background: #1e293b; border: 1px solid #334155; border-radius: 10px; padding: 14px 16px; }
.card .num { font-size: 26px; font-weight: 700; }
.card .lbl { color: #94a3b8; font-size: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .grid2 { grid-template-columns: 1fr; } .app { grid-template-columns: 1fr; } .side { position: static; height: auto; } }

/* 表格 */
table { width: 100%; border-collapse: collapse; background: #1e293b; border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid #334155; vertical-align: top; }
th { color: #94a3b8; font-weight: 600; font-size: 12px; background: #172033; }
tr:last-child td { border-bottom: none; }
td.mono, .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }

/* 状态标签 */
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: #334155; color: #e2e8f0; }
.tag.pending { background: #475569; } .tag.dispatched { background: #7c3aed; } .tag.running { background: #2563eb; }
.tag.success { background: #15803d; } .tag.error { background: #b91c1c; } .tag.canceled { background: #78350f; }
.tag.online { background: #15803d; } .tag.offline { background: #475569; }

/* 表单 */
form.stack label, .stack label { display: block; margin: 10px 0 4px; color: #94a3b8; font-size: 13px; }
input[type=text], input[type=password], input[type=number], input[type=url], select, textarea {
  width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid #334155; background: #0f172a; color: #e2e8f0; font: inherit;
}
textarea { min-height: 120px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
textarea.tall { min-height: 360px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn { display: inline-block; padding: 7px 14px; border-radius: 8px; border: none; background: #3b82f6; color: #fff; cursor: pointer; font: inherit; }
.btn.ghost { background: #334155; } .btn.danger { background: #b91c1c; } .btn.small { padding: 4px 10px; font-size: 12px; }
.btn:hover { filter: brightness(1.1); }
form.inline { display: inline; }

/* 日志 */
.log { background: #020617; border-radius: 10px; padding: 10px 12px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; max-height: 520px; overflow: auto; white-space: pre-wrap; }
.log .warn { color: #eab308; } .log .error { color: #f87171; } .log .info { color: #cbd5e1; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumbs img { max-width: 260px; border-radius: 8px; border: 1px solid #334155; }

/* 登录页 */
body.auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
body.auth .card { width: 420px; max-width: 92vw; }
body.auth h1 { margin-top: 0; }
