:root {
  color-scheme: light;
  --bg: #f4f5f2;
  --panel: #ffffff;
  --panel-soft: #f9faf7;
  --text: #222831;
  --muted: #667085;
  --line: #d8ddd2;
  --ok: #127047;
  --bad: #b42318;
  --warn: #9a5b00;
  --info: #1b5aa6;
  --accent: #0f766e;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}
.brand { font-weight: 800; color: var(--text); text-decoration: none; letter-spacing: 0; }
.topbar-subtitle, .muted, .tiny { color: var(--muted); }
.topbar-action { margin-left: auto; }
.tiny { margin-top: 4px; font-size: 12px; line-height: 1.45; max-width: 620px; overflow-wrap: anywhere; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0; }
.model-chain { display: inline-block; max-width: 420px; font-size: 12px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.page { max-width: 1240px; margin: 0 auto; padding: 24px; }
.hero-band {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0 20px;
}
.hero-band h1 { margin: 0 0 10px; font-size: 32px; line-height: 1.18; letter-spacing: 0; }
.section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 18px;
}
.density-section { padding: 16px; }
.section-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
h1, h2 { margin: 0 0 12px; letter-spacing: 0; }
h2 { font-size: 18px; }
p { margin: 0 0 10px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; min-width: 960px; border-collapse: collapse; background: #fff; }
.compact-wrap table { min-width: 0; }
.ops-table th, .ops-table td { padding: 9px 10px; }
.ops-table th { white-space: nowrap; }
.ops-table td:nth-child(1) { width: 190px; }
.ops-table td:nth-child(2) { width: 92px; }
.ops-table td:nth-child(3) { width: 150px; }
.ops-table td:nth-child(4) { width: 110px; }
.ops-table td:nth-child(5) { width: 185px; color: var(--muted); font-size: 13px; }
.failure-text { display: block; max-width: 520px; color: var(--bad); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.compact-table { min-width: 0; font-size: 13px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--panel-soft); color: var(--muted); font-size: 12px; font-weight: 700; }
tr:last-child td { border-bottom: 0; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef1f5;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.status-success { background: #e6f4ed; color: var(--ok); }
.status-failed { background: #fdeceb; color: var(--bad); }
.status-warning, .status-unknown, .status-not_run { background: #fff4d6; color: var(--warn); }
.status-running { background: #e8f1ff; color: var(--info); }
.grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 18px; }
.tool-grid, .actions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.quota-grid, .quota-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.metric {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-soft);
}
.metric span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.metric strong { font-size: 24px; line-height: 1.2; }
.metric small { color: var(--muted); overflow-wrap: anywhere; }
.quota-tile, .action-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}
.quota-tile span, .action-meta span:first-child { color: var(--muted); font-size: 12px; font-weight: 800; }
.quota-tile strong { font-size: 19px; line-height: 1.2; }
.quota-tile small { color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; }
.action-card { grid-template-columns: 1fr auto; align-items: start; }
.action-meta { display: flex; justify-content: space-between; gap: 12px; grid-column: 1 / -1; }
.action-meta span:last-child, .action-meta a { text-align: right; overflow-wrap: anywhere; }
.tool-tile {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--text);
  background: var(--panel-soft);
}
.tool-tile:hover { text-decoration: none; border-color: #aeb8ad; }
.tool-tile span { font-weight: 800; }
.tool-tile small { grid-column: 1 / -1; color: var(--muted); line-height: 1.45; }
.line-item, .service-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 11px 0;
}
.line-item:first-of-type, .service-row:first-child { border-top: 0; }
.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; }
.right { text-align: right; }
.button, button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}
.button.primary {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}
.ghost-button { background: transparent; }
input[type="password"] {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}
.login-panel {
  max-width: 520px;
  margin: 72px auto 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 24px;
}
.login-form { display: grid; gap: 10px; margin-top: 20px; }
.form-error { color: var(--bad); font-size: 13px; }
.details { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; margin: 16px 0 24px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.danger-zone { border: 1px solid #f2c4c2; border-radius: 8px; padding: 16px; margin-bottom: 24px; background: #fffafa; }
.danger-zone label { display: block; margin: 10px 0 14px; }
.notice { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 12px 0; background: #f9fafb; }
pre { overflow: auto; background: #101828; color: #edf2f7; border-radius: 8px; padding: 16px; max-height: 420px; }

@media (max-width: 860px) {
  .page { padding: 16px; }
  .hero-band, .section-header { flex-direction: column; }
  .grid, .tool-grid, .actions-grid, .metric-grid, .quota-grid, .quota-strip, .service-grid { grid-template-columns: 1fr; }
  .compact-wrap table { min-width: 760px; }
  .details { grid-template-columns: 1fr; }
  .topbar-subtitle { display: none; }
}
