:root {
    color-scheme: light;
    --bg: #f3f5f7;
    --surface: #ffffff;
    --surface-muted: #f7f9fb;
    --border: #d8dee6;
    --text: #18212b;
    --muted: #657283;
    --primary: #0f6cbd;
    --primary-hover: #115ea3;
    --success: #107c10;
    --warning: #8a4b08;
    --danger: #b42318;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font: 14px/1.5 "Segoe UI", "Microsoft YaHei", sans-serif; letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.shell { display: grid; min-height: 100vh; grid-template-columns: 220px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 18px 12px; border-right: 1px solid var(--border); background: #17212b; color: #edf2f6; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px 18px; font-size: 17px; font-weight: 700; }
.brand-mark { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 6px; background: #1683d8; font-size: 12px; }
.nav { display: grid; gap: 4px; }
.nav a { padding: 9px 11px; border-radius: 5px; color: #cdd6df; }
.nav a:hover, .nav a.active { background: #2a3948; color: #fff; }
.sidebar-footer { position: absolute; right: 12px; bottom: 18px; left: 12px; }
.sidebar-footer button { width: 100%; border-color: #526170; color: #e5ebf0; background: transparent; }
.main { min-width: 0; }
.topbar { display: flex; min-height: 58px; align-items: center; justify-content: space-between; padding: 0 26px; border-bottom: 1px solid var(--border); background: var(--surface); }
.topbar strong { font-size: 15px; }
.content { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 24px 0 42px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 24px; }
.page-head p { margin: 5px 0 0; color: var(--muted); }
.button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 7px; padding: 7px 14px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); color: var(--text); font-weight: 600; }
.button:hover { background: var(--surface-muted); }
.button.primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.button.primary:hover { background: var(--primary-hover); }
.button.danger { border-color: #efb4ae; color: var(--danger); }
.button.small { min-height: 32px; padding: 4px 9px; font-size: 13px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.metric { padding: 17px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.metric span { display: block; color: var(--muted); }
.metric strong { display: block; margin-top: 5px; font-size: 27px; }
.panel { border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.panel-head { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 18px; border-bottom: 1px solid var(--border); }
.panel-head h2 { margin: 0; font-size: 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 15px; border-bottom: 1px solid #e8ecf0; text-align: left; vertical-align: middle; }
th { background: var(--surface-muted); color: #4d5967; font-size: 12px; font-weight: 700; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 7px; }
.status { display: inline-flex; min-height: 24px; align-items: center; padding: 2px 8px; border-radius: 999px; background: #edf1f4; color: #465361; font-size: 12px; font-weight: 700; }
.status.ready, .status.succeeded { background: #e8f5e9; color: var(--success); }
.status.warned, .status.blocked, .status.timed_out { background: #fff4df; color: var(--warning); }
.status.error, .status.failed { background: #fdecea; color: var(--danger); }
.status.checking, .status.queued, .status.deploying, .status.submitted { background: #e8f2fc; color: var(--primary); }
.empty { padding: 38px 20px; color: var(--muted); text-align: center; }
.form { display: grid; gap: 20px; }
.section { padding: 18px; border-bottom: 1px solid var(--border); }
.section:last-child { border-bottom: 0; }
.section h2 { margin: 0 0 4px; font-size: 16px; }
.section > p { margin: 0 0 16px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { min-width: 0; }
.field.full { grid-column: 1 / -1; }
label { display: block; margin-bottom: 6px; font-weight: 600; }
input, select, textarea { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #b9c2cc; border-radius: 5px; background: #fff; color: var(--text); }
textarea { min-height: 126px; resize: vertical; font-family: Consolas, monospace; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid #a9d5f7; outline-offset: 1px; }
.help { margin-top: 5px; color: var(--muted); font-size: 12px; }
.toggle-row { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: 18px; min-height: 18px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 18px; }
.alert { margin-bottom: 16px; padding: 11px 13px; border: 1px solid; border-radius: 5px; }
.alert.success { border-color: #a9d5ad; background: #edf8ee; color: #165d1b; }
.alert.error { border-color: #efb4ae; background: #fff0ef; color: var(--danger); }
.detail-list { display: grid; grid-template-columns: 180px minmax(0, 1fr); }
.detail-list dt, .detail-list dd { margin: 0; padding: 11px 16px; border-bottom: 1px solid #e8ecf0; }
.detail-list dt { color: var(--muted); font-weight: 600; }
.login-shell { display: grid; min-height: 100vh; place-items: center; padding: 22px; }
.login { width: min(390px, 100%); padding: 24px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.login h1 { margin: 0 0 6px; font-size: 22px; }
.login p { margin: 0 0 20px; color: var(--muted); }
.login .button { width: 100%; margin-top: 16px; }
.code { overflow-wrap: anywhere; font-family: Consolas, monospace; font-size: 12px; }
@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; }
    .sidebar-footer { position: static; margin-top: 12px; }
    .nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .nav a { text-align: center; }
    .metrics, .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .content { width: calc(100% - 24px); padding-top: 16px; }
    .topbar { padding: 0 14px; }
    .page-head { flex-direction: column; }
    .nav, .metrics, .grid, .grid.two { grid-template-columns: 1fr; }
    .page-head .button { width: 100%; }
    .detail-list { grid-template-columns: 1fr; }
    .detail-list dt { padding-bottom: 3px; border-bottom: 0; }
    .detail-list dd { padding-top: 3px; }
}
