:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-subtle: #f8f9fa;
  --line: #dde2e7;
  --line-strong: #c9d0d7;
  --text: #20252b;
  --muted: #68717c;
  --sidebar: #171a1f;
  --sidebar-muted: #a8b0ba;
  --blue: #2864dc;
  --blue-soft: #e8f0ff;
  --green: #16865a;
  --green-soft: #e3f4ec;
  --amber: #b86808;
  --amber-soft: #fff1d8;
  --red: #c43c3c;
  --red-soft: #fde8e7;
  --cyan: #147d8e;
  --cyan-soft: #e2f3f5;
  --shadow: 0 1px 2px rgba(26, 33, 41, 0.05);
  --shadow-raised: 0 8px 22px rgba(31, 42, 55, 0.08);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible {
  outline: 2px solid rgba(40, 100, 220, 0.48);
  outline-offset: 2px;
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--sidebar);
  color: #fff;
  padding: 22px 14px 16px;
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 22px;
  border-bottom: 1px solid #30353c;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 1px solid #4d5968;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #7fa7ff;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.3s var(--ease-out);
}

.brand:hover .brand-mark {
  color: #a6c0ff;
  border-color: #7086a4;
  transform: translateY(-1px);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 14px;
  line-height: 1.3;
}

.brand small {
  color: var(--sidebar-muted);
  margin-top: 3px;
  font-size: 11px;
}

.nav-list {
  padding-top: 18px;
  display: grid;
  gap: 4px;
}

.nav-item {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--sidebar-muted);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  cursor: pointer;
  text-align: left;
  transition: color 0.18s ease, background-color 0.18s ease, transform 0.2s var(--ease-out);
}

.nav-item:hover {
  color: #fff;
  background: #22272e;
  transform: translateX(2px);
}

.nav-item.is-active {
  color: #fff;
  background: #2b3139;
  box-shadow: inset 3px 0 0 #6d9cff;
}

.nav-item .icon {
  transition: transform 0.2s var(--ease-out), color 0.2s ease;
}

.nav-item:hover .icon,
.nav-item.is-active .icon {
  color: #91b2ff;
  transform: scale(1.05);
}

.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid #30353c;
  padding: 16px 8px 0;
}

.collector-state {
  display: flex;
  align-items: center;
  gap: 9px;
}

.collector-state strong,
.collector-state small {
  display: block;
}

.collector-state strong {
  font-size: 12px;
}

.collector-state small {
  margin-top: 3px;
  color: var(--sidebar-muted);
  font-size: 11px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.status-dot.status-ok {
  background: #3bc68a;
  box-shadow: 0 0 0 3px rgba(59, 198, 138, 0.14);
}

.collector-state .status-dot.status-ok {
  animation: collector-pulse 3.2s ease-in-out infinite;
}

.status-dot.status-warning {
  background: #d88a24;
  box-shadow: 0 0 0 3px rgba(216, 138, 36, 0.14);
}

.status-dot.status-danger {
  background: #d34b4b;
  box-shadow: 0 0 0 3px rgba(211, 75, 75, 0.14);
}

.workspace {
  min-width: 0;
}

.topbar {
  min-height: 78px;
  padding: 15px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 15;
  backdrop-filter: blur(10px);
}

.eyebrow,
.panel-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-label {
  color: var(--muted);
  font-size: 12px;
}

.segmented {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 2px;
  display: flex;
  background: var(--surface-subtle);
}

.segmented button {
  height: 28px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.segmented button.is-active {
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-weight: 600;
}

.segmented button:disabled {
  color: #a7afb8;
  cursor: not-allowed;
  opacity: 0.72;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.2s var(--ease-out), box-shadow 0.18s ease;
}

.icon-button:hover {
  background: var(--surface-subtle);
  border-color: #aeb8c2;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.icon-button.is-loading .icon {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

main {
  padding: 22px 28px 36px;
  max-width: 1680px;
  margin: 0 auto;
}

.demo-notice {
  min-height: 38px;
  border: 1px solid #e5c689;
  background: #fff8e9;
  color: #7e4b08;
  border-radius: 6px;
  margin-bottom: 16px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  animation: notice-enter 0.42s var(--ease-out) both;
}

.demo-notice[hidden] {
  display: none;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.view.is-active.is-entering > * {
  animation: view-enter 0.42s var(--ease-out) both;
  animation-delay: calc(var(--enter-index, 0) * 45ms);
}

.overview-band {
  min-height: 88px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

.overview-band::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--amber);
  opacity: 0.78;
}

.overall-state {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.state-symbol {
  width: 42px;
  height: 42px;
  border-radius: 7px;
  display: grid;
  place-items: center;
}

.state-symbol .icon {
  width: 22px;
  height: 22px;
}

.state-symbol.state-warning {
  color: var(--amber);
  background: var(--amber-soft);
  animation: warning-breathe 3.4s ease-in-out infinite;
}

.state-symbol.state-danger {
  color: var(--red);
  background: var(--red-soft);
}

.state-symbol.state-ok {
  color: var(--green);
  background: var(--green-soft);
}

.state-symbol.state-neutral {
  color: var(--muted);
  background: #edf0f3;
}

.overall-state p,
.overall-state strong,
.overall-state small {
  display: block;
  margin: 0;
}

.overall-state p {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 3px;
}

.overall-state strong {
  font-size: 16px;
}

.overall-state small {
  color: var(--muted);
  margin-top: 4px;
}

.overview-meta {
  display: flex;
  margin: 0;
}

.overview-meta div {
  min-width: 112px;
  padding: 0 16px;
  border-left: 1px solid var(--line);
}

.overview-meta dt {
  color: var(--muted);
  font-size: 11px;
}

.overview-meta dd {
  margin: 6px 0 0;
  font-weight: 700;
  font-size: 13px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric-grid-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric {
  min-height: 102px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 13px 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.22s var(--ease-out), border-color 0.2s ease, box-shadow 0.22s ease;
}

.metric.metric-enter {
  animation: card-enter 0.44s var(--ease-out) both;
  animation-delay: calc(var(--item-index, 0) * 34ms);
}

.metric:hover {
  border-color: #c5ced7;
  box-shadow: var(--shadow-raised);
  transform: translateY(-2px);
}

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.metric-icon {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--blue-soft);
  transition: transform 0.24s var(--ease-out), color 0.2s ease;
}

.metric:hover .metric-icon {
  color: #174fbf;
  transform: scale(1.07);
}

.metric-icon .icon {
  width: 15px;
  height: 15px;
}

.metric-value {
  font-size: 24px;
  line-height: 1;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.metric-foot {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.trend-up { color: var(--red); }
.trend-down { color: var(--green); }
.trend-ok { color: var(--green); }
.trend-flat { color: var(--muted); }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow);
  padding: 16px;
  transition: border-color 0.2s ease, box-shadow 0.22s ease, transform 0.22s var(--ease-out);
}

.panel:hover {
  border-color: #cbd3db;
  box-shadow: 0 5px 16px rgba(31, 42, 55, 0.065);
  transform: translateY(-1px);
}

.panel-wide {
  grid-column: span 2;
}

.panel-full {
  grid-column: 1 / -1;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-header h2,
.section-heading h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}

.chart-legend {
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.chart-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-line {
  width: 16px;
  height: 2px;
  display: inline-block;
}

.line-primary { background: var(--blue); }
.line-muted { background: #aeb7c1; }
.line-event {
  background: repeating-linear-gradient(90deg, var(--amber) 0 3px, transparent 3px 6px);
}

.chart-wrap {
  position: relative;
  height: 230px;
}

.chart-compact {
  height: 150px;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  display: block;
  background: #171a1f;
  color: #fff;
  border-radius: 5px;
  padding: 7px 9px;
  font-size: 11px;
  line-height: 1.55;
  box-shadow: 0 6px 18px rgba(20, 24, 30, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
  z-index: 3;
}

.chart-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.chart-tooltip strong,
.chart-tooltip span {
  display: block;
}

.chart-tooltip span {
  color: #c5ccd4;
  margin-top: 2px;
}

.panel-footer {
  border-top: 1px solid var(--line);
  padding-top: 11px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.text-button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--blue);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  transition: color 0.16s ease;
}

.text-button:hover {
  color: #164caf;
}

.text-button .icon {
  width: 14px;
  height: 14px;
  transition: transform 0.2s var(--ease-out);
}

.text-button:hover .icon {
  transform: translateX(2px);
}

.count-badge,
.status-chip {
  min-height: 24px;
  border-radius: 5px;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.count-danger,
.status-danger {
  color: var(--red);
  background: var(--red-soft);
}

.status-warning {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-ok {
  color: var(--green);
  background: var(--green-soft);
}

.count-neutral,
.status-neutral {
  color: #5e6873;
  background: #edf0f3;
}

.alert-list,
.release-list,
.source-list,
.event-list {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.alert-item,
.release-item,
.source-item,
.event-item {
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 9px 0;
  transition: background-color 0.16s ease, transform 0.18s var(--ease-out);
}

.alert-item:hover,
.release-item:hover,
.source-item:hover,
.event-item:hover {
  background: var(--surface-subtle);
  transform: translateX(2px);
}

.alert-item:first-child,
.release-item:first-child,
.source-item:first-child,
.event-item:first-child {
  border-top: 0;
}

.alert-icon,
.release-icon,
.source-icon {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.alert-icon .icon,
.release-icon .icon,
.source-icon .icon {
  width: 15px;
  height: 15px;
}

.alert-icon.severity-critical {
  color: var(--red);
  background: var(--red-soft);
  animation: critical-breathe 2.8s ease-in-out infinite;
}

.alert-icon.severity-warning {
  color: var(--amber);
  background: var(--amber-soft);
}

.release-icon {
  color: var(--blue);
  background: var(--blue-soft);
}

.source-icon {
  color: var(--cyan);
  background: var(--cyan-soft);
}

.alert-copy,
.release-copy,
.source-copy {
  min-width: 0;
  flex: 1;
}

.alert-copy strong,
.alert-copy small,
.release-copy strong,
.release-copy small,
.source-copy strong,
.source-copy small {
  display: block;
}

.alert-copy strong,
.release-copy strong,
.source-copy strong {
  max-width: 100%;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-copy small,
.release-copy small,
.source-copy small {
  max-width: 100%;
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runtime-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.runtime-summary div {
  background: var(--surface-subtle);
  border-radius: 5px;
  padding: 9px 10px;
}

.runtime-summary span,
.runtime-summary strong {
  display: block;
}

.runtime-summary span {
  color: var(--muted);
  font-size: 10px;
}

.runtime-summary strong {
  margin-top: 5px;
  font-size: 17px;
}

.order-table-wrap,
.release-table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  text-align: left;
  border-top: 1px solid var(--line);
  padding: 10px 8px;
  font-size: 11px;
  vertical-align: middle;
}

tbody tr {
  transition: background-color 0.16s ease;
}

tbody tr:hover {
  background: var(--surface-subtle);
}

th {
  border-top: 0;
  color: var(--muted);
  font-weight: 600;
}

td strong {
  font-size: 12px;
}

.mini-progress {
  height: 5px;
  border-radius: 3px;
  background: #e8ebee;
  overflow: hidden;
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transform-origin: left center;
  animation: progress-grow 0.62s var(--ease-out) both;
}

.mini-progress.warning span { background: var(--amber); }
.mini-progress.danger span { background: var(--red); }

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 16px;
}

.section-heading h2 {
  font-size: 19px;
}

.section-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.waterfall {
  display: grid;
  gap: 12px;
  padding: 8px 0 2px;
}

.waterfall-row {
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr) 70px;
  align-items: center;
  gap: 12px;
}

.waterfall-row strong {
  font-size: 11px;
}

.waterfall-track {
  height: 22px;
  background: #edf0f3;
  border-radius: 4px;
  overflow: hidden;
}

.waterfall-bar {
  height: 100%;
  border-radius: 4px;
  background: var(--blue);
  transform-origin: left center;
  animation: progress-grow 0.66s var(--ease-out) both;
}

.waterfall-row.warning .waterfall-bar { background: var(--amber); }
.waterfall-row.danger .waterfall-bar { background: var(--red); }

.waterfall-value {
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.service-grid,
.runtime-service-grid,
.infra-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.service-grid > .empty-state,
.infra-grid > .empty-state {
  grid-column: 1 / -1;
}

.service-cell,
.runtime-service,
.infra-cell {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-subtle);
  padding: 12px;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.2s var(--ease-out);
}

.service-cell:hover,
.runtime-service:hover,
.infra-cell:hover {
  background: #fff;
  border-color: #c6cfd8;
  transform: translateY(-1px);
}

.service-cell header,
.runtime-service header,
.infra-cell header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.service-cell h3,
.runtime-service h3,
.infra-cell h3 {
  margin: 0;
  font-size: 12px;
}

.service-cell dl,
.infra-cell dl {
  margin: 12px 0 0;
  display: grid;
  gap: 7px;
}

.service-cell dl div,
.infra-cell dl div {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
}

.service-cell dd,
.service-cell dt,
.infra-cell dd,
.infra-cell dt {
  margin: 0;
}

.service-cell dd,
.infra-cell dd {
  color: var(--text);
  font-weight: 700;
}

.quota-list {
  display: grid;
  gap: 9px;
}

.key-family-list {
  display: grid;
  gap: 12px;
}

.key-family-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 12px;
  align-items: center;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.key-family-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.key-family-row strong,
.key-family-row small {
  display: block;
}

.key-family-row small {
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}

.key-family-row > strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.key-family-row .mini-progress {
  grid-column: 1 / -1;
}

.quota-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 62px 62px;
  gap: 12px;
  align-items: center;
}

.quota-account {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.quota-value,
.quota-state {
  text-align: right;
  font-size: 11px;
}

.runtime-service-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.runtime-service {
  background: var(--surface);
  padding: 15px;
}

.runtime-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.runtime-metrics div {
  border-left: 2px solid var(--line-strong);
  padding-left: 8px;
}

.runtime-metrics span,
.runtime-metrics strong {
  display: block;
}

.runtime-metrics span {
  color: var(--muted);
  font-size: 10px;
}

.runtime-metrics strong {
  margin-top: 5px;
  font-size: 14px;
}

.infra-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.infra-cell {
  background: var(--surface);
  min-height: 150px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: 360px;
  background: #171a1f;
  color: #fff;
  border-radius: 6px;
  padding: 10px 13px;
  box-shadow: 0 12px 28px rgba(20, 24, 30, 0.25);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  font-size: 12px;
  z-index: 50;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.data-refreshed .metric-value,
.data-refreshed .overview-meta dd {
  animation: value-pop 0.36s var(--ease-out);
}

.empty-state {
  min-height: 120px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

@keyframes view-enter {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes notice-enter {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes progress-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes value-pop {
  0% { transform: translateY(2px); opacity: 0.7; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes collector-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(59, 198, 138, 0.14); }
  50% { box-shadow: 0 0 0 6px rgba(59, 198, 138, 0.04); }
}

@keyframes warning-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(184, 104, 8, 0); }
  50% { box-shadow: 0 0 0 5px rgba(184, 104, 8, 0.07); }
}

@keyframes critical-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196, 60, 60, 0); }
  50% { box-shadow: 0 0 0 4px rgba(196, 60, 60, 0.08); }
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-wide {
    grid-column: span 2;
  }

  .service-grid,
  .infra-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 12px;
  }

  .brand {
    padding: 0 2px 12px;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
    padding-top: 10px;
    scrollbar-width: thin;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    padding: 0 11px;
  }

  .sidebar-foot {
    display: none;
  }

  .topbar {
    position: static;
    align-items: flex-start;
    padding: 14px 16px;
    flex-direction: column;
    gap: 12px;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
    padding-bottom: 2px;
  }

  main {
    padding: 16px;
  }

  .overview-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .overview-meta {
    width: 100%;
  }

  .overview-meta div {
    min-width: 0;
    flex: 1;
    padding: 0 10px;
  }

  .overview-meta div:first-child {
    padding-left: 0;
    border-left: 0;
  }

  .metric-grid,
  .metric-grid-four,
  .runtime-service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel-wide,
  .panel-full {
    grid-column: auto;
  }

  .chart-wrap {
    height: 210px;
  }

  .service-grid,
  .infra-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .brand small {
    display: none;
  }

  .topbar-actions {
    gap: 9px;
  }

  .control-group {
    width: 100%;
    gap: 5px;
  }

  .control-label {
    display: none;
  }

  .control-group .segmented {
    width: 100%;
  }

  .control-group .segmented button {
    min-width: 0;
    flex: 1 1 0;
    padding-inline: 5px;
    white-space: normal;
    line-height: 1.15;
  }

  .topbar-actions > .icon-button {
    margin-left: auto;
  }

  .metric-grid,
  .metric-grid-four,
  .runtime-service-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .overview-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .overview-meta div {
    padding: 0 7px;
  }

  .overview-meta dd {
    font-size: 11px;
  }

  .panel {
    padding: 13px;
  }

  .panel-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .waterfall-row {
    grid-template-columns: 100px minmax(0, 1fr) 52px;
    gap: 8px;
  }

  .quota-row {
    grid-template-columns: 96px minmax(0, 1fr) 48px;
  }

  .quota-state {
    display: none;
  }

  .runtime-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  th:nth-child(3),
  td:nth-child(3) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== 新增：基线口径切换、慢 SQL、调度心跳、发布事件流、L2 钻取等 ===== */

.panel-header-tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.segmented-mini button {
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
}

.segmented.is-disabled {
  opacity: 0.55;
}

.segmented.is-disabled button {
  cursor: not-allowed;
}

.table-note {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  margin-top: 3px;
}

.runtime-metrics small {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.4;
  margin-top: 3px;
}

.runtime-metrics strong.runtime-sub {
  font-size: 11.5px;
  line-height: 1.45;
}

.pool-list {
  margin-top: 13px;
  border-top: 1px solid var(--line);
  padding-top: 11px;
  display: grid;
  gap: 8px;
}

.pool-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) minmax(0, 150px);
  align-items: center;
  gap: 10px;
}

.pool-name {
  font-size: 10.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pool-detail {
  color: var(--muted);
  font-size: 10px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runtime-foot {
  margin-top: 13px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.exit-badges {
  display: inline-flex;
  gap: 6px;
}

.exit-badge {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  color: var(--amber);
  background: var(--amber-soft);
  border-radius: 4px;
  padding: 2px 6px;
}

.runtime-note {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.event-timeline {
  display: grid;
}

.timeline-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 11px 0 11px 4px;
  border-top: 1px solid var(--line);
}

.timeline-item:first-child {
  border-top: 0;
}

.timeline-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.timeline-body {
  min-width: 0;
  flex: 1;
}

.timeline-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.timeline-head strong {
  font-size: 12px;
}

.timeline-body small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10.5px;
}

.timeline-body code,
td code {
  font-size: 10px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 4px;
}

.acceptance-target {
  font-size: 11px;
  font-weight: 700;
  padding-bottom: 8px;
}

.acceptance-footer {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 9px;
  color: var(--muted);
  font-size: 10.5px;
}

.drill-search {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drill-input-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-subtle);
  padding: 0 11px;
  height: 34px;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.drill-input-wrap:focus-within {
  border-color: var(--blue);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(40, 100, 220, 0.12);
}

.drill-input-wrap .icon {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.drill-input-wrap input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--text);
  outline: none;
}

.drill-input-wrap input::placeholder {
  color: #98a1ab;
}

.primary-button {
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  padding: 0 18px;
  cursor: pointer;
  transition: background-color 0.16s ease, transform 0.2s var(--ease-out), box-shadow 0.18s ease;
}

.primary-button:hover {
  background: #1e55c4;
  box-shadow: var(--shadow-raised);
  transform: translateY(-1px);
}

.drill-summary {
  margin: 0 0 14px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.drill-summary:empty {
  display: none;
}

.drill-summary div {
  background: var(--surface-subtle);
  border-radius: 5px;
  padding: 8px 10px;
  min-width: 0;
}

.drill-summary dt {
  color: var(--muted);
  font-size: 10px;
}

.drill-summary dd {
  margin: 4px 0 0;
  font-size: 11.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1180px) {
  .drill-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  .panel-header-tools {
    align-items: flex-start;
  }

  .drill-search {
    flex-direction: column;
    align-items: stretch;
  }

  .drill-search .segmented {
    overflow-x: auto;
  }

  .pool-row {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .pool-detail {
    grid-column: 1 / -1;
    text-align: left;
  }

  .drill-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
