:root {
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #d7e4f1;
  background: #08121d;
  font-size: 13px;
  line-height: 1.5;
  --muted: #87a2ba;
  --border: #263d54;
  --surface: #0d1b2b;
  --accent: #2ad39a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 25px; }
h2 { font-size: 14px; font-weight: 650; }
h3 { font-size: 12px; font-weight: 600; }
button, input { font: inherit; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 12px; border: 1px solid transparent; border-radius: 6px;
  font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer;
}
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, a:focus-visible { outline: 2px solid #6ae6bb; outline-offset: 3px; }
.primary { background: var(--accent); color: #06291d; }
.primary:hover { background: #54e1b1; }
.secondary { background: #173454; border-color: #345677; color: #bddbfb; }
.secondary:hover { background: #214363; }
.quiet { background: #14283d; border-color: #2c455e; color: #bcd0e5; }
.quiet:hover { background: #203951; }
.confirm-dialog {
  width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto;
  padding: 24px; border: 1px solid #38536b; border-radius: 12px;
  color: #d7e4f1; background: var(--surface); box-shadow: 0 24px 90px #0009;
}
.confirm-dialog::backdrop { background: #020911b8; backdrop-filter: blur(3px); }
.confirm-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.confirm-heading .eyebrow { letter-spacing: 1px; font-size: 11px; }
.confirm-heading h2 { font-size: 21px; line-height: 1.4; margin-top: 4px; }
.confirm-close { padding: 0; width: 30px; height: 30px; font-size: 22px; font-weight: 400; }
.confirm-description { color: #a6bed4; margin-top: 14px; font-size: 13px; }
.confirm-details { padding: 14px; margin: 18px 0; border: 1px solid var(--border); border-radius: 7px; background: #081725; }
.confirm-details div { display: grid; grid-template-columns: 86px minmax(0,1fr); gap: 12px; }
.confirm-details div + div { margin-top: 9px; }
.confirm-details dt { color: var(--muted); }
.confirm-details dd { margin: 0; color: #e0ecf6; overflow-wrap: anywhere; }
.confirm-steps { margin: 0 0 18px; padding-left: 22px; color: #bcd0e3; }
.confirm-steps li + li { margin-top: 7px; }
.confirm-steps li::marker { color: var(--accent); font-weight: 600; }
.confirm-impact { padding: 12px 14px; border: 1px solid #685337; border-radius: 7px; background: #2a241b; color: #efcf9b; font-size: 12px; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.confirm-actions button { min-width: 90px; padding: 10px 15px; }
.confirm-dialog.destructive #confirm-accept { background: #cf5269; color: #fff; }
.confirm-dialog.destructive #confirm-accept:hover { background: #df6b7e; }
.muted, .hint, .detail { color: var(--muted); }
label { display: block; color: #aac0d5; font-size: 11px; }
input {
  display: block; width: 100%; min-width: 0; margin-top: 5px; padding: 7px 9px;
  border: 1px solid #2b435c; border-radius: 5px; background: #081725; color: #dfebf7;
}
input:focus { outline: 2px solid #2ad39a45; border-color: var(--accent); }
.pill, .tag, .job-state {
  display: inline-block; padding: 3px 8px; border-radius: 5px;
  font-size: 10px; line-height: 1.6; background: #183048; color: #a7c4de;
}
.pill { border: 1px solid #2b435a; font-size: 11px; white-space: nowrap; }
.pill.running { color: #ffd0dd; border-color: #7c4255; background: #552939; }
.brand-icon { display: block; width: 32px; height: 32px; object-fit: contain; }
.brand { display: flex; gap: 11px; align-items: center; flex-shrink: 0; }
.brand span { display: block; color: #96b2cc; font-size: 10px; }
.brand strong { display: block; font-size: 15px; font-weight: 650; }
#dashboard { min-height: 100dvh; padding: 12px; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
  min-height: 62px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); margin-bottom: 10px;
}
.header-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.workspace { display: grid; gap: 10px; }
.run-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 7px; background: #0c1c2a;
}
.run-banner strong { display: block; font-size: 12px; color: #b8d5ef; }
.run-banner span:not(.pill) { display: block; font-size: 10px; color: #88a8c5; }
.run-banner.success { border-color: #236b58; background: #0a2525; }
.run-banner.success strong { color: #80e7c2; }
.run-banner.failed, .run-banner.interrupted { border-color: #784151; background: #281b29; }
.run-banner.failed strong, .run-banner.interrupted strong { color: #ffb2c3; }
#notice { margin-left: auto; color: #96eacb; font-size: 11px; }
.overview { display: flex; gap: 10px; flex-wrap: wrap; }
.overview article {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 9px 12px; min-width: 0;
}
.overview .installation { flex: 1.1; }
.overview .service-overview { flex: 1.3; }
.overview .resource-overview { flex: .85; }
.overview strong { font-size: 14px; font-weight: 650; }
.overview .muted { font-size: 11px; }
.overview .detail { margin-left: auto; font-size: 10px; }
.resource-overview.warning { border-color: #6c5838; }
.resource-overview.warning strong, .hint.warning { color: #e9c37e; }
.services { display: flex; gap: 5px; flex-wrap: wrap; }
.service { padding: 3px 7px; border-radius: 4px; background: #223449; color: #abc0d4; font-size: 11px; }
.service.good { background: #14372f; color: #64dfb4; }
.service.bad { background: #4b2837; color: #ffb1c2; }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: 8px; padding: 13px; background: var(--surface); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-heading .muted { font-size: 10px; }
.left-stack { display: grid; gap: 10px; min-height: 0; }
.git-panel { display: flex; flex-direction: column; min-height: 0; }
.table-wrap { overflow: auto; min-height: 0; flex: 1; }
table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 12px; }
th { font-size: 11px; font-weight: 600; text-align: left; padding: 9px 7px; border-bottom: 1px solid #2b435a; color: #88a8c5; }
th:first-child { width: 17%; } th:last-child { width: 15%; }
td { padding: 13px 7px; border-bottom: 1px solid #22394e; vertical-align: middle; }
td strong { font-size: 12px; display: block; }
td small { display: block; font-size: 10px; color: #87a8c7; margin-top: 5px; }
.commit-summary { display: flex; gap: 7px; align-items: center; min-width: 0; }
.commit-summary code { font: 10px Consolas, monospace; color: #96c6f3; flex: none; }
.commit-summary span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-note { flex-shrink: 0; padding-top: 10px; color: #7e9ab4; font-size: 10px; }
.delivery-grid { display: grid; grid-template-columns: minmax(160px,.8fr) minmax(0,1.2fr); gap: 16px; }
.build-section { border-right: 1px solid #263c50; padding-right: 16px; }
.fields { display: flex; gap: 8px; margin: 9px 0 11px; }
.fields label:first-child { flex: 1; min-width: 0; }
.fields label:last-child { width: 76px; }
.build-section button { width: 100%; }
.hint { font-size: 10px; margin-top: 8px; line-height: 1.5; }
.artifact-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#artifact-name { display: block; margin: 6px 0 3px; font: 600 12px/1.5 Consolas,"Microsoft YaHei",monospace; overflow-wrap: anywhere; }
#artifact-info { font-size: 10px; }
.artifact-details { display: grid; gap: 2px; font-size: 10px; color: #94aec6; margin: 6px 0 9px; }
.artifact-details code { font: 10px Consolas,monospace; color: #b1cbe1; }
.checksum-line { display: flex; gap: 5px; min-width: 0; white-space: nowrap; }
#checksum { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.artifact .actions { flex-wrap: nowrap; }
.artifact .actions button, .artifact .button { padding: 7px 9px; font-size: 11px; }
.manifest-link { margin-left: auto; color: #88b9e5; font-size: 10px; text-decoration: none; white-space: nowrap; }
.manifest-link:hover { color: #c3e3ff; text-decoration: underline; }
.jobs-panel { display: flex; flex-direction: column; min-height: 0; }
.jobs-panel .section-heading>div:first-child>span { display: block; margin-top: 3px; }
.compact button { padding: 6px 8px; font-size: 11px; }
.job-grid { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 10px; border-top: 1px solid #22394f; padding-top: 10px; min-height: 0; flex: 1; }
.job-list { overflow: auto; min-height: 0; }
.job { display: block; width: 100%; text-align: left; white-space: normal; background: #102237; border-color: #253c53; color: #d6e5f4; padding: 9px; margin-bottom: 7px; }
.job:hover { background: #19334d; }
.job.selected { background: #193852; border-color: #456a8c; }
.job .row { display: flex; align-items: start; justify-content: space-between; gap: 5px; flex-wrap: wrap; }
.job strong { font-size: 11px; }
.job p { font-size: 10px; font-weight: 400; color: #8eaac3; margin-top: 6px; }
.job-state { padding: 2px 5px; white-space: nowrap; }
.job-state.success { background: #143b31; color: #65dfb2; }
.job-state.failed, .job-state.interrupted { background: #512b3b; color: #ffa5bb; }
.job-state.running, .job-state.queued { background: #21415f; color: #a0d2ff; }
.log-area { display: flex; flex-direction: column; background: #081625; border: 1px solid #28425c; border-radius: 6px; min-width: 0; min-height: 0; }
.log-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 10px; border-bottom: 1px solid #263d54; font-size: 10px; flex-shrink: 0; }
.log-heading>span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-heading .muted { flex-shrink: 0; font-size: 9px; }
pre { font: 11px/1.85 Consolas,monospace; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; padding: 11px; min-height: 0; overflow: auto; flex: 1; color: #cce1f5; }
footer { font-size: 9px; color: #7792ab; text-align: center; }
.init-form { display: flex; gap: 10px; align-items: end; }
.init-form label { flex: 1; }
.login { max-width: 390px; margin: 12vh auto; background: var(--surface); padding: 32px; border: 1px solid var(--border); border-radius: 12px; }
.login .brand-icon { margin-bottom: 22px; }
.eyebrow { color: #8bb0d2; letter-spacing: 2px; font-size: 10px; margin-bottom: 6px; }
.login form { margin-top: 24px; }
.login label { margin-bottom: 16px; font-size: 12px; }
.login button { width: 100%; margin-top: 5px; }
#login-error { color: #ffa6ba; font-size: 12px; margin-top: 12px; }
* { scrollbar-width: thin; scrollbar-color: #35526d #0b1a29; }
@media (min-width: 1000px) and (min-height: 700px) {
  #dashboard { height: 100dvh; display: flex; flex-direction: column; gap: 10px; }
  .topbar { flex-shrink: 0; margin: 0; }
  .workspace { flex: 1; min-height: 0; grid-template-columns: minmax(0,1.05fr) minmax(0,1fr); grid-template-rows: 48px 48px minmax(0,1fr) 14px; }
  .run-banner { grid-column: 1/-1; grid-row: 1; }
  .overview { grid-column: 1/-1; grid-row: 2; flex-wrap: nowrap; }
  .left-stack { grid-column: 1; grid-row: 3; grid-template-rows: minmax(160px,1fr) 224px; }
  .jobs-panel { grid-column: 2; grid-row: 3; }
  footer { grid-column: 1/-1; grid-row: 4; align-self: center; }
  .workspace:has(.initialization:not([hidden])) { grid-template-rows: 48px 48px 106px minmax(0,1fr) 14px; }
  .initialization { grid-column: 1/-1; grid-row: 3; }
  .workspace:has(.initialization:not([hidden])) .left-stack, .workspace:has(.initialization:not([hidden])) .jobs-panel { grid-row: 4; }
  .workspace:has(.initialization:not([hidden])) footer { grid-row: 5; }
}
@media (min-width: 1000px) and (max-width: 1350px) {
  .overview .detail { display: none; }
  .job-grid { grid-template-columns: 130px minmax(0,1fr); }
  .delivery-grid { grid-template-columns: minmax(150px,.75fr) minmax(0,1.25fr); gap: 12px; }
  .build-section { padding-right: 12px; }
  .artifact .actions { flex-wrap: wrap; gap: 5px; }
  .manifest-link { margin-left: 0; }
  .commit-summary { display: block; }
  .commit-summary span { display: block; font-size: 11px; margin-top: 3px; }
}
@media (max-width: 999px), (max-height: 699px) {
  .workspace { grid-template-columns: 1fr; }
  .left-stack { grid-template-rows: auto auto; }
  .overview article { flex-basis: 100%; }
  .git-panel table { min-width: 620px; }
  .jobs-panel { height: 390px; }
  .init-form { flex-wrap: wrap; }
  .init-form label { flex-basis: 40%; }
}
@media (max-width: 600px) {
  #dashboard { padding: 8px; }
  .topbar { align-items: start; flex-wrap: wrap; padding: 12px; }
  .header-right { justify-content: flex-start; gap: 6px; width: 100%; }
  .header-right button { padding: 7px 9px; font-size: 11px; }
  .header-right .pill { margin-right: auto; }
  .delivery-grid { grid-template-columns: 1fr; }
  .build-section { border-right: 0; border-bottom: 1px solid #263c50; padding-right: 0; padding-bottom: 12px; }
  .artifact .actions { flex-wrap: wrap; }
  .job-grid { grid-template-columns: 110px minmax(0,1fr); }
  .jobs-panel .section-heading { flex-wrap: wrap; }
  .run-banner { align-items: start; flex-wrap: wrap; }
  #notice { flex-basis: 100%; margin-left: 0; }
  .login { margin: 8vh 16px; }
}
