:root {
  --ink: #1f2933;
  --muted: #7a817c;
  --paper: #f6f4ef;
  --card: #ffffff;
  --surface: #ffffff;
  --line: #e7e3da;
  --line-soft: #efebe3;
  --green: #087a4b;
  --green-soft: #eef5f1;
  --green-dark: #06633d;
  --busy: #b45309;
  --busy-soft: #fff7ed;
  --fail: #b91c1c;
  --fail-soft: #fef2f2;
  --radius: 12px;
  --radius-lg: 14px;
  --control-h: 38px;
  --shadow: none;
  --shadow-hover: 0 4px 14px rgba(31, 41, 51, 0.06);
  --assist: #f3f6f4;
  --max: 1120px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

button, input { font: inherit; }

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 60px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6), 0 4px 16px rgba(31, 41, 55, 0.04);
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  max-width: var(--max);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: white;
  font-weight: 700;
  font-size: 17px;
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

h1 {
  margin: 1px 0 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.ghost, .btn-outline, .text-link {
  color: var(--ink);
  text-decoration: none;
}

.ghost, .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--control-h);
  padding: 0 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  background: white;
  border: 1px solid var(--line);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.ghost:hover, .btn-outline:hover {
  border-color: #d4cbbd;
  background: #faf8f4;
}

.btn-outline {
  color: var(--green-dark);
  border-color: #b7d8c6;
  background: white;
}

.btn-outline:hover {
  background: var(--green-soft);
  border-color: var(--green);
}

.nav-exit {
  color: var(--muted);
}

.layout {
  display: grid;
  gap: 18px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 24px 56px;
}

.page-intro {
  margin-bottom: 2px;
}

.page-intro h2 {
  font-size: 22px;
  letter-spacing: -0.02em;
}

.page-intro .lead {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 12px;
}

.stat-card .label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.stat-card .value {
  margin: 4px 0 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  color: var(--ink);
}

.stat-card .hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 24px 24px;
}

.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.lead {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.section-block + .section-block {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}

.section-label {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}

.launch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 12px;
}

.param-list {
  display: grid;
  gap: 12px;
}

.launch {
  display: flex;
  flex-direction: column;
  min-height: 158px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.launch:hover {
  border-color: #d7e8de;
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.launch.is-wide {
  min-height: auto;
}

.launch.is-running {
  border-color: #f0d2a8;
  background: #fffdf8;
}

.launch-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.launch-desc {
  margin: 0;
  flex: 1;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.launch-actions {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
}

.param-box {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--assist);
}

.param-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.param-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 14px;
}

.param-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field span {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.field input,
.search-row input {
  height: var(--control-h);
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.field input {
  width: 148px;
}

.field input:focus,
.search-row input:focus {
  background: white;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(8, 122, 75, 0.1);
  outline: none;
}

.pill, .state, .tag {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.pill.on, .state.idle, .tag-success {
  background: var(--green-soft);
  color: var(--green-dark);
}

.state.busy, .tag-running {
  background: var(--busy-soft);
  color: var(--busy);
}

.tag-failed {
  background: var(--fail-soft);
  color: var(--fail);
}

.state {
  font-size: 13px;
  padding: 6px 12px;
}

button.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  height: var(--control-h);
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--green);
  color: white;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

button.primary:hover:not(:disabled) {
  background: var(--green-dark);
}

button.primary:active:not(:disabled) {
  transform: translateY(1px);
}

button.primary:disabled {
  background: #b7c7be;
  cursor: not-allowed;
}

button.primary.is-busy {
  min-width: 96px;
  gap: 8px;
  background: var(--busy);
}

button.primary.is-busy::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.alert {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--busy-soft);
  color: var(--busy);
  font-size: 14px;
}

.log-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.log-box-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.log {
  min-height: 120px;
  max-height: 240px;
  overflow: auto;
  margin: 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: #1f2937;
  color: #f3f4f6;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.search-row input {
  flex: 1 1 280px;
  background: white;
}

.subhead {
  margin: 18px 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.table-shell {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: white;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 0 16px;
  height: 46px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  font-size: 13.5px;
}

th {
  height: 42px;
  background: #f8f7f3;
  color: var(--muted);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tbody tr:last-child td { border-bottom: 0; }

tbody tr:hover td { background: #fafaf8; }

.num, .when {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 13px;
}

.project {
  color: var(--ink);
  font-weight: 600;
}

.count, .col-count {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.count {
  color: var(--ink);
  font-weight: 600;
}

.cell-status { min-width: 92px; }

.downloads { position: relative; }

.download-menu {
  position: relative;
  display: inline-block;
}

.download-menu > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #b7d8c6;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.download-menu > summary::-webkit-details-marker { display: none; }

.download-menu[open] > summary {
  background: #d9efe4;
}

.download-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 5;
  min-width: 148px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  box-shadow: 0 10px 28px rgba(31, 41, 55, 0.12);
}

.download-panel a {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

.download-panel a:hover {
  background: var(--green-soft);
  color: var(--green-dark);
}

.text-link {
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 600;
}

.fail-note {
  display: block;
  margin-top: 4px;
  color: var(--fail);
  font-size: 11px;
  max-width: 220px;
  line-height: 1.4;
  word-break: break-word;
}

.empty {
  margin: 0;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  background: #faf8f4;
  border-radius: 12px;
}

/* login */
.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 28px 20px;
  background: var(--paper);
}

.login-shell {
  width: min(880px, 100%);
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  border: 1px solid #e8e4db;
  border-radius: 28px;
  overflow: hidden;
  background: white;
  box-shadow: 0 10px 36px rgba(31, 41, 51, 0.06);
  animation: login-rise 0.4s ease both;
}

@keyframes login-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-aside {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-height: 520px;
  padding: 48px 36px 36px;
  overflow: hidden;
  background: linear-gradient(165deg, #0b7a4b 0%, #116f49 100%);
  color: #f7f3ea;
}

.login-aside-glow {
  position: absolute;
  width: 320px;
  height: 320px;
  right: -80px;
  top: -60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.login-aside-glow::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  left: -40px;
  bottom: -180px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.login-aside-grid {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.9) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.9) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.login-aside-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  width: 100%;
}

.login-aside .mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
  margin-bottom: 28px;
}

.login-aside .eyebrow {
  color: rgba(247, 243, 234, 0.78);
  font-size: 12px;
}

.login-aside h1 {
  margin: 10px 0 0;
  font-size: 32px;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.2;
}

.login-aside-text {
  margin: 16px 0 0;
  max-width: 26ch;
  color: rgba(247, 243, 234, 0.82);
  font-size: 14px;
  line-height: 1.65;
}

.login-aside-foot {
  margin-top: auto;
  padding-top: 40px;
  color: rgba(247, 243, 234, 0.55);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 40px 42px;
  background: #fffefb;
}

.login-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.login-card-head h2 {
  margin: 14px 0 0;
  font-size: 34px;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-weight: 700;
}

.login-card .lead {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

.login-form { margin-top: 28px; }

.login-card label {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.login-card input:not(.otp-box) {
  width: 100%;
  height: 44px;
  border: 1px solid #e8e4db;
  border-radius: 10px;
  padding: 0 14px;
  background: white;
  box-shadow: none;
}

.login-card input:not(.otp-box):focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(8, 122, 75, 0.12);
  outline: none;
}

.otp-boxes {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.otp-box {
  width: 100%;
  height: 52px;
  border: 1px solid #e8e4db;
  border-radius: 10px;
  background: white;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  padding: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.otp-box:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(8, 122, 75, 0.12);
  outline: none;
}

.otp-timer {
  margin-top: 16px;
}

.otp-timer-track {
  height: 3px;
  border-radius: 999px;
  background: #efebe3;
  overflow: hidden;
}

.otp-timer-bar {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0b7a4b, #1a9a63);
  transition: width 0.25s linear;
}

.otp-timer-text {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.login-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.login-hint.center {
  margin-top: 14px;
  text-align: center;
}

.login-card button.primary {
  width: 100%;
  margin-top: 20px;
  height: 46px;
  border-radius: 10px;
  font-size: 15px;
}

.login-card button.primary:disabled {
  background: #c5d4cb;
  cursor: not-allowed;
}

.totp-shell { width: min(920px, 100%); }

.totp-panel {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 18px;
  align-items: center;
  margin-top: 8px;
  padding: 16px;
  border: 1px solid #e8e4db;
  border-radius: 12px;
  background: #faf9f6;
}

.totp-qr {
  width: 168px;
  height: 168px;
  border-radius: 10px;
  background: white;
  border: 1px solid #e8e4db;
}

.totp-label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.totp-secret {
  display: block;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  background: white;
  border: 1px solid #e8e4db;
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0.04em;
  word-break: break-all;
}

.totp-steps {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 720px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-aside { min-height: auto; padding: 32px 28px 28px; }
  .login-aside-foot { padding-top: 24px; }
  .login-card { padding: 32px 24px 28px; }
  .login-card-head h2 { font-size: 28px; }
  .totp-panel { grid-template-columns: 1fr; justify-items: center; }
  .totp-meta { width: 100%; }
  .otp-box { height: 46px; font-size: 18px; }
}

.login-points {
  margin: 22px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line-soft);
  list-style: none;
  display: grid;
  gap: 8px;
}

.login-points li {
  position: relative;
  padding-left: 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.login-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

@media (max-width: 1100px) {
  .launch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .param-actions { margin-left: 0; width: 100%; }
  .field input { width: 100%; min-width: 140px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-aside { min-height: auto; padding: 28px 24px; }
  .login-aside h1 { font-size: 28px; }
  .login-card { padding: 28px 24px 26px; }
}

@media (max-width: 640px) {
  .topbar { height: auto; }
  .topbar-inner {
    flex-wrap: wrap;
    padding: 12px 16px;
    height: auto;
    gap: 10px;
  }
  .top-actions { width: 100%; justify-content: space-between; }
  .layout { padding: 16px 16px 48px; }
  .panel { padding: 18px 16px 20px; }
  .launch-grid, .stats-grid { grid-template-columns: 1fr; }
  h1 { font-size: 18px; }
  .login-body { padding: 16px; }
  .login-shell { border-radius: 20px; }
}
.desk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.desk-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
  padding: 18px 18px 16px;
  border: 1px solid rgba(47, 111, 237, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(47, 111, 237, 0.08), rgba(47, 111, 237, 0.02) 42%, #fff 42%);
  box-shadow: 0 10px 28px rgba(23, 43, 77, 0.06);
}

.desk-card.is-running {
  border-color: rgba(217, 119, 6, 0.45);
  background:
    linear-gradient(180deg, rgba(245, 158, 11, 0.16), rgba(245, 158, 11, 0.04) 42%, #fff 42%);
}

.desk-card .launch-desc {
  min-height: 3.2em;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef3ff;
  color: #24407a;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.desk-card .launch-actions {
  margin-top: auto;
}
