:root {
  color-scheme: light dark;
  --page:#f8f5f0;
  --surface:#fffdf9;
  --inset:#f1ede7;
  --text:#303044;
  --muted:#6e6a75;
  --accent:#34356a;
  --on-accent:#fff;
  --selected:#ebe8f1;
  --border:#dfd8cf;
  --success:#426f54;
  --error:#a23f46;
  --warning:#8b5b1c;
  --shadow:0 18px 60px #30283d0d;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--page);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  min-height: 44px;
  border-radius: 9px;
  border: 1px solid transparent;
  padding: 9px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 550;
  transition: background .15s, box-shadow .15s;
}
button:disabled {
  opacity: .45;
  cursor: default;
}
button:not(:disabled):hover {
  filter: brightness(.97);
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
}
input::placeholder {
  color: var(--muted);
  opacity: 1;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--muted);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -.7px;
  line-height: 1.4;
}
h2 {
  font-size: 17px;
  font-weight: 650;
}
h3 {
  font-size: 17px;
}
code,
pre {
  font-family:
    ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  font-size: 12px;
}
code {
  overflow-wrap: anywhere;
}
.primary {
  background: var(--accent);
  color: var(--on-accent);
}
.secondary {
  background: var(--surface);
  border-color: var(--border);
}
.quiet {
  background: transparent;
  color: var(--muted);
}
.quiet:hover {
  background: var(--inset);
}
.wide {
  width: 100%;
  justify-content: space-between;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 650;
  color: var(--muted);
}
.message {
  min-height: 28px;
  font-size: 13px;
  color: var(--muted);
  margin: 10px 0;
}
.error {
  color: var(--error) !important;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: serif;
  font-size: 23px;
}
.brand strong {
  display: block;
  font-size: 19px;
  letter-spacing: 2px;
  font-weight: 650;
  line-height: 1.4;
}
.brand div > span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1px;
}
.login-view {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(
      ellipse at 15% 15%,
      var(--selected),
      transparent 50%),
    var(--page);
}
.login-card {
  width: min(100%, 440px);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 22px;
  padding: 40px;
  box-shadow: var(--shadow);
}
.login-intro {
  margin: 48px 0 32px;
}
.login-intro h1 {
  font-size: 34px;
  line-height: 1.5;
  margin: 10px 0;
}
.login-intro p {
  color: var(--muted);
}
.password-wrap {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
}
.password-wrap input {
  min-width: 0;
  border: none;
  background: transparent;
}
.password-wrap button {
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  flex-shrink: 0;
}
.login-foot {
  border-top: 1px solid var(--border);
  padding-top: 22px;
  margin-top: 30px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.app-shell {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  min-height: 100svh;
}
.sidebar {
  padding: 28px 16px 20px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.sidebar .brand {
  padding: 0 8px 36px;
}
.nav-heading {
  padding: 0 12px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 1px;
}
.nav-heading span {
  font-variant-numeric: tabular-nums;
}
nav .group-name {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
  margin: 24px 12px 6px;
}
nav button {
  width: 100%;
  justify-content: flex-start;
  background: transparent;
  padding: 10px 12px;
  margin: 1px 0;
  gap: 10px;
  font-size: 13px;
  font-weight: 450;
  color: var(--muted);
}
nav button:before {
  content: "";
  width: 6px;
  height: 6px;
  border: 1px solid currentColor;
  border-radius: 2px;
  opacity: .65;
}
nav button:hover {
  background: var(--inset);
}
nav button[aria-current=page] {
  background: var(--selected);
  color: var(--accent);
  font-weight: 650;
}
nav button[aria-current=page]:before {
  background: currentColor;
}
.sidebar-note {
  margin-top: auto;
  padding: 32px 12px 0;
  color: var(--muted);
  font-size: 11px;
}
.sidebar-note p {
  padding: 10px 0 0 15px;
  line-height: 1.8;
}
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  margin-right: 6px;
}
.workspace {
  min-width: 0;
}
.topbar {
  height: 73px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  font-size: 12px;
  color: var(--muted);
}
.divider {
  color: var(--border);
  margin: 0 10px;
}
.operator {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mode {
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
}
.operator button {
  font-size: 12px;
}
main {
  max-width: 1480px;
  margin: auto;
  padding: 38px 36px 28px;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.page-heading h1 {
  margin: 6px 0 8px;
}
.page-heading p {
  color: var(--muted);
  font-size: 13px;
}
.page-heading button {
  flex-shrink: 0;
  font-size: 12px;
}
.context-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  color: var(--muted);
  padding: 24px 0 18px;
  flex-wrap: wrap;
}
.context-strip > span:first-child {
  color: var(--text);
}
.scope-label {
  margin-left: auto;
}
.data-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 4px 18px #30283d03;
}
.panel-heading {
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.panel-heading h2 {
  margin-bottom: 4px;
}
.panel-heading code {
  color: var(--muted);
  font-size: 11px;
}
.count-label {
  padding: 4px 10px;
  background: var(--inset);
  border-radius: 6px;
  white-space: nowrap;
  font-size: 11px;
  color: var(--muted);
}
.query-form {
  padding: 18px 24px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: color-mix(in srgb, var(--inset) 45%, var(--surface));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.query-form > div:first-child {
  width: 150px;
  flex-shrink: 0;
}
.query-value {
  flex: 1;
  min-width: 100px;
}
.query-form button {
  font-size: 12px;
}
.query-message {
  font-size: 12px;
  color: var(--muted);
  padding: 0 24px;
  overflow-wrap: anywhere;
}
.query-message:not(:empty) {
  padding-top: 14px;
  padding-bottom: 14px;
}
.table-scroll {
  overflow: auto;
  min-height: 80px;
  max-height: max(260px, calc(100svh - 430px));
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  font-size: 12px;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--inset) 40%, var(--surface));
  font-weight: 550;
  color: var(--muted);
  font-size: 11px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  height: 63px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
td code {
  font-size: 11px;
}
td:first-child,
th:first-child {
  padding-left: 24px;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: color-mix(in srgb, var(--selected) 35%, var(--surface));
}
td .quiet {
  font-size: 12px;
  color: var(--accent);
  padding: 8px;
  min-width: 44px;
}
.badge {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--inset);
  color: var(--muted);
}
.badge.good {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 9%, var(--surface));
}
.badge.warn {
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 9%, var(--surface));
}
.badge.bad {
  color: var(--error);
  background: color-mix(in srgb, var(--error) 9%, var(--surface));
}
.empty-state {
  text-align: center;
  min-height: 240px;
  padding: 45px 24px 50px;
  color: var(--muted);
}
.empty-state svg {
  color: var(--border);
  margin-bottom: 12px;
}
.empty-state h3 {
  color: var(--text);
  margin-bottom: 7px;
}
.empty-state p {
  font-size: 12px;
  max-width: 400px;
  margin: auto;
  line-height: 1.8;
}
.pagination {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  color: var(--muted);
}
.pagination > div {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pagination button {
  font-size: 11px;
  min-height: 40px;
  padding: 8px 12px;
}
.workspace-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  font-size: 11px;
  color: var(--muted);
  flex-wrap: wrap;
}
.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 5;
  background: var(--surface);
  padding: 12px;
  color: var(--accent);
}
.skip:focus {
  top: 12px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
dialog {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  width: min(700px, calc(100vw - 32px));
  max-height: 85svh;
  padding: 28px;
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: #15132270;
  backdrop-filter: blur(3px);
}
.detail-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.detail-heading h2 {
  font-size: 23px;
  margin-top: 6px;
}
.detail-id {
  display: block;
  color: var(--muted);
  margin-top: 18px;
  word-break: break-all;
}
dl {
  margin: 20px 0;
}
dl > div {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  border-bottom: 1px solid var(--border);
  padding: 13px 0;
  font-size: 13px;
}
dt {
  color: var(--muted);
}
dt small {
  display: block;
  font: 10px ui-monospace, monospace;
  margin-top: 4px;
  word-break: break-all;
}
dd {
  margin: 0;
  overflow-wrap: anywhere;
}
summary {
  cursor: pointer;
  padding: 12px 0;
  font-size: 12px;
  color: var(--accent);
}
pre {
  white-space: pre-wrap;
  word-break: break-all;
  padding: 18px;
  background: var(--inset);
  border-radius: 8px;
}
body:has(dialog[open]) {
  overflow: hidden;
}
[hidden] {
  display: none !important;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page:#1b1a21;
    --surface:#27252f;
    --inset:#302d39;
    --text:#f4f0eb;
    --muted:#bbb5c4;
    --accent:#ccc8f3;
    --on-accent:#26243f;
    --selected:#3b374b;
    --border:#4a4455;
    --success:#a5d2b3;
    --error:#f3aaa9;
    --warning:#e5bf79;
    --shadow:0 18px 60px #0003;
  }
}
@media (min-width: 1200px) {
  .sidebar {
    position: sticky;
    top: 0;
    height: 100svh;
    overflow-y: auto;
  }
  main {
    padding-top: 48px;
  }
  .data-panel {
    margin-top: 4px;
  }
}
@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 186px minmax(0, 1fr);
  }
  .sidebar {
    padding-left: 10px;
    padding-right: 10px;
  }
  .topbar {
    padding: 0 24px;
  }
  main {
    padding: 28px 24px;
  }
  .query-form {
    flex-wrap: wrap;
  }
  .query-form > div:first-child {
    width: 130px;
  }
  .query-form .query-value {
    min-width: 170px;
  }
  .query-form button {
    margin-top: 2px;
  }
  .panel-heading,
  .query-form {
    padding-left: 18px;
    padding-right: 18px;
  }
  .scope-label {
    display: none;
  }
  .pagination {
    padding: 14px 18px;
    flex-wrap: wrap;
  }
}
@media (max-width: 640px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    padding: 18px 16px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .sidebar .brand {
    padding: 0 0 16px;
  }
  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 21px;
  }
  .brand strong {
    font-size: 17px;
  }
  .nav-heading,
  .sidebar-note,
  nav .group-name {
    display: none;
  }
  nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 6px;
  }
  nav button {
    width: auto;
    white-space: nowrap;
    padding: 9px 12px;
  }
  nav button:before {
    display: none;
  }
  .topbar {
    height: 58px;
    padding: 0 18px;
  }
  main {
    padding: 24px 16px;
  }
  .page-heading {
    align-items: flex-start;
    gap: 12px;
  }
  .page-heading h1 {
    font-size: 26px;
  }
  .page-heading button {
    padding: 8px 12px;
    font-size: 11px;
    margin-top: 8px;
  }
  .page-heading p {
    font-size: 12px;
  }
  .context-strip {
    gap: 8px;
    padding: 20px 0 14px;
  }
  .context-strip code {
    font-size: 10px;
  }
  .query-form {
    gap: 10px;
  }
  .query-form > div:first-child {
    width: 100%;
  }
  .query-form .query-value {
    flex-basis: 100%;
  }
  .query-form .primary {
    flex: 1;
  }
  .pagination > div {
    width: 100%;
    justify-content: space-between;
  }
  .pagination button {
    min-height: 44px;
  }
  .workspace-foot {
    font-size: 10px;
  }
  dialog {
    padding: 20px;
  }
  dl > div {
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 12px;
  }
  .login-card {
    padding: 30px;
  }
  .login-intro {
    margin-top: 36px;
  }
  .login-intro h1 {
    font-size: 30px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
