/* Adapted from GPTAuthBridge. Copyright (c) 2026 Dehujiaogeli. MIT, see LICENSE. */
:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #f0f4f5;
  --line: #d9e1e4;
  --line-strong: #b9c8ce;
  --text: #142126;
  --muted: #64747c;
  --accent: #24505a;
  --accent-strong: #173941;
  --accent-soft: #e3f0f2;
  --success: #1e6b50;
  --danger: #a33b3b;
  --warning: #8a5a14;
  --shadow: 0 16px 44px rgba(20, 33, 38, 0.08);
  --radius: 8px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: "Inter", "Avenir Next", "Helvetica Neue", "PingFang SC", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  font-family: var(--sans);
  color: var(--text);
  background:
    repeating-linear-gradient(135deg, transparent 0 18px, rgba(20, 33, 38, 0.018) 18px 19px),
    linear-gradient(180deg, rgba(36, 80, 90, 0.045), transparent 280px),
    var(--bg);
}

button,
input,
textarea {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button {
  border: 0;
}

.app {
  width: min(1280px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 28px;
}

.evaluation-login {
  max-width: 380px;
  margin: 16vh auto 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.evaluation-login h1 { margin: 0; font-size: 24px; }
.evaluation-login p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.evaluation-login form { display: grid; gap: 10px; }
.evaluation-login label { margin-top: 4px; font-size: 13px; }
.evaluation-login input { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 6px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 13px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.button-primary {
  background: var(--accent);
  color: #fff;
}

.button-primary:hover {
  background: var(--accent-strong);
}
.button-secondary,
.button-ghost {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.button-secondary:hover,
.button-ghost:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
body.is-model-evaluation { background: #f5f7f8; }
.is-model-evaluation .app { width: min(1440px, calc(100vw - 48px)); padding-top: 28px; }
.evaluation-workbench { --eval-blue: #305d85; --eval-wash: #eef4f8; font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif; }
.evaluation-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.evaluation-heading h1 { margin: 0 0 8px; font-size: 28px; letter-spacing: -.6px; }
.evaluation-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.evaluation-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.evaluation-sidebar { min-width: 0; }
.evaluation-import { margin-top: 12px; padding: 16px; background: white; border: 1px solid var(--line); border-radius: 10px; }
.evaluation-import h2 { margin: 0 0 6px; font-size: 15px; }
.evaluation-import p, .evaluation-import summary { margin: 8px 0; font-size: 12px; line-height: 1.6; }
.evaluation-import p { color: var(--muted); overflow-wrap: anywhere; }
.evaluation-import p:empty { display: none; }
.evaluation-import summary { cursor: pointer; }
.evaluation-import-actions { display: grid; gap: 6px; }
.evaluation-import-actions small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.evaluation-import-actions small:empty { display: none; }
.evaluation-model-settings { margin-top: 10px; font-size: 12px; }
.evaluation-model-settings summary { cursor: pointer; color: var(--accent); }
.evaluation-model-settings label { margin-top: 10px; }
.evaluation-model-settings textarea { width: 100%; margin-top: 6px; padding: 8px; border: 1px solid var(--line-strong); border-radius: 6px; font: 12px/1.6 var(--mono); resize: vertical; }
.evaluation-model-settings small { display: block; margin: 4px 0 8px; color: var(--muted); line-height: 1.6; }
.evaluation-model-settings > div { display: flex; gap: 8px; }
.evaluation-model-settings p { margin: 6px 0 0; }
.evaluation-import-actions button { flex: auto; padding: 8px; font-size: 12px; }
#evaluation-import-unavailable { color: var(--warning); }
#evaluation-history-list { max-height: 190px; overflow: auto; list-style: none; padding: 0; margin: 0; }
#evaluation-history-list li { display: grid; gap: 3px; border-top: 1px solid var(--line); padding: 7px 0; overflow-wrap: anywhere; font-size: 12px; }
#evaluation-history-list small { color: var(--muted); }
#evaluation-form { padding: 20px; background: white; border: 1px solid var(--line); border-radius: 10px; }
#evaluation-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
#evaluation-fields > legend { padding: 0; margin-bottom: 18px; font-weight: 700; font-size: 15px; }
#evaluation-fields label { display: grid; gap: 7px; color: var(--text); font-size: 12px; font-weight: 600; }
#evaluation-fields input:not([type=radio]), #evaluation-fields select { min-width: 0; width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; background: white; color: var(--text); padding: 10px 11px; font-size: 13px; }
#evaluation-fields input:focus-visible, #evaluation-fields select:focus-visible { outline: 2px solid var(--eval-blue); outline-offset: 2px; }
.evaluation-source { margin: 16px 0 20px; }
.evaluation-source[hidden] { display: none; }
.evaluation-source p { font-size: 13px; margin: 0 0 6px; color: var(--success); font-weight: 600; }
.evaluation-source small { display: block; font-size: 12px; line-height: 1.7; color: var(--muted); }
#evaluation-api-source label { margin-bottom: 12px; }
.evaluation-text-button { padding: 0; background: none; color: var(--eval-blue); font-size: 12px; cursor: pointer; }
.evaluation-text-button:disabled { color: var(--muted); cursor: default; opacity: .6; }
.evaluation-question-summary { display: grid; gap: 10px; margin: 22px 0; font-size: 12px; }
.evaluation-question-summary > span { color: var(--muted); }
.evaluation-question-summary strong { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.evaluation-question-summary small { font-weight: 400; color: var(--muted); }
#evaluation-form .button { width: 100%; }
.evaluation-stop { margin-top: 8px; }
.evaluation-queue-heading { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 10px; }
.evaluation-queue-heading h2 { font-size: 13px; margin: 0; }
.evaluation-queue-heading span, .evaluation-queue-empty { font-size: 12px; color: var(--muted); }
.evaluation-queue { display: grid; gap: 6px; max-height: 500px; overflow: auto; padding: 2px; }
.evaluation-task { padding: 12px; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 7px; cursor: pointer; display: grid; gap: 6px; min-width: 0; }
.evaluation-task[aria-pressed=true] { border-color: #a9c4d7; background: var(--eval-wash); }
.evaluation-task:hover { background: #e9eef1; }
.evaluation-task strong { font-size: 13px; }
.evaluation-task small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.evaluation-task-status { font-size: 11px; color: var(--eval-blue); }
.evaluation-task[data-state=error] .evaluation-task-status, .evaluation-task[data-state=wrong_answer] .evaluation-task-status { color: var(--danger); }
.evaluation-task[data-state=passed] .evaluation-task-status { color: var(--success); }
.evaluation-stage { min-width: 0; }
.evaluation-run-status { margin-bottom: 18px; }
.evaluation-run-status > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.evaluation-run-status p { margin: 0 0 10px; font-size: 13px; line-height: 1.6; }
.evaluation-run-status span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.evaluation-run-status progress { display: block; width: 100%; height: 5px; accent-color: var(--accent); border: 0; border-radius: 3px; overflow: hidden; background: var(--line); }
.evaluation-run-status progress::-webkit-progress-bar { background: var(--line); }
.evaluation-run-status progress::-webkit-progress-value { background: var(--accent); }
.evaluation-viewer { background: white; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.evaluation-viewer-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 24px 16px; }
.evaluation-viewer-heading h2 { font-size: 19px; margin: 0 0 7px; }
.evaluation-viewer-heading p { color: var(--muted); font-size: 12px; margin: 0; overflow-wrap: anywhere; }
.evaluation-badge { font-size: 11px; white-space: nowrap; background: var(--eval-wash); color: var(--eval-blue); padding: 6px 9px; border-radius: 5px; }
.evaluation-badge[data-state=error], .evaluation-badge[data-state=wrong_answer] { color: var(--danger); background: #fff0f0; }
.evaluation-steps { display: flex; list-style: none; margin: 4px 24px 0; padding: 0; }
.evaluation-steps li { flex: 1; padding: 9px 0; color: var(--muted); font-size: 11px; border-bottom: 2px solid var(--line); }
.evaluation-steps li[data-done=true] { color: var(--accent); border-color: var(--accent); }
.evaluation-steps li[aria-current=step] { font-weight: 700; color: var(--eval-blue); border-color: var(--eval-blue); }
.evaluation-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 0; padding: 18px 24px; }
.evaluation-metrics dt { color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.evaluation-metrics dd { margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.evaluation-view-tabs { display: flex; justify-content: space-between; align-items: center; padding: 0 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.evaluation-view-tabs [role=tablist] { display: flex; gap: 24px; }
.evaluation-view-tabs [role=tab] { background: none; padding: 13px 0; font-size: 12px; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; }
.evaluation-view-tabs [aria-selected=true] { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.evaluation-preview-surface { position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: #f5f8fa; }
.evaluation-preview-surface iframe { position: absolute; top: 0; left: 0; width: 1024px; height: 768px; border: 0; transform-origin: top left; background: white; }
.evaluation-preview-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 24px; text-align: center; }
.evaluation-preview-empty[hidden] { display: none; }
.evaluation-preview-empty svg { width: 180px; color: #7296a9; margin-bottom: 20px; }
.evaluation-preview-empty h3 { font-weight: 500; font-size: 18px; margin: 0 0 10px; color: #405e6d; }
.evaluation-preview-empty p { color: var(--muted); font-size: 12px; line-height: 1.8; margin: 0; }
#evaluation-output { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; height: 440px; overflow: auto; padding: 22px 24px; color: #253f52; background: #f7fafc; font: 12px/1.8 var(--mono); }
.evaluation-output-note { margin: 0; padding: 12px 24px; color: var(--muted); font-size: 11px; line-height: 1.7; border-top: 1px solid var(--line); }
.evaluation-case-error { margin: 0; padding: 12px 24px; background: #fff3f1; color: var(--danger); font-size: 12px; }
.evaluation-prompt { padding: 14px 24px; border-top: 1px solid var(--line); font-size: 12px; }
.evaluation-prompt summary { cursor: pointer; color: var(--muted); }
.evaluation-prompt p { white-space: pre-wrap; line-height: 1.8; max-width: 75ch; }
.evaluation-preview-dialog { width: min(1100px, calc(100vw - 32px)); max-height: 94vh; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: auto; }
.evaluation-preview-dialog::backdrop { background: #14212699; }
.evaluation-preview-dialog header { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; gap: 20px; }
.evaluation-preview-dialog h2 { font-size: 16px; margin: 0; }
.evaluation-preview-dialog .evaluation-preview-surface { max-width: calc(110vh - 80px); margin: auto; }
.evaluation-workbench button:focus-visible { outline: 2px solid var(--eval-blue); outline-offset: 2px; }
@media (max-width: 900px) {
  .evaluation-layout { grid-template-columns: 260px minmax(0, 1fr); gap: 16px; }
  .evaluation-live-label { display: none; }
  .evaluation-metrics { gap: 8px; padding: 16px; }
  .evaluation-viewer-heading, .evaluation-view-tabs { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 680px) {
  .is-model-evaluation .app { width: calc(100vw - 24px); padding-top: 18px; }
  .evaluation-heading { margin-bottom: 18px; }
  .evaluation-heading h1 { font-size: 24px; }
  .evaluation-heading p { font-size: 12px; line-height: 1.7; }
  .evaluation-layout { grid-template-columns: minmax(0, 1fr); }
  .evaluation-queue { max-height: 210px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .evaluation-metrics { gap: 6px; }
  .evaluation-metrics dd { font-size: 12px; }
  .evaluation-steps { margin-left: 16px; margin-right: 16px; }
  #evaluation-output { height: 320px; padding: 16px; }
}
/* Keep the result on screen; configuration and diagnostics are secondary. */
.is-model-evaluation .app { padding-top: 14px; padding-bottom: 12px; }
.evaluation-heading { margin-bottom: 12px; }
.evaluation-heading h1 { font-size: 22px; margin-bottom: 4px; }
.evaluation-heading p { font-size: 12px; }
.evaluation-layout { height: calc(100dvh - var(--evaluation-top, 52px) - 38px); min-height: 400px; gap: 18px; grid-template-columns: 280px minmax(0,1fr); }
.evaluation-sidebar { height: 100%; overflow: auto; scrollbar-width: thin; padding-right: 4px; }
.evaluation-stage { display: flex; flex-direction: column; min-height: 0; height: 100%; width: 100%; }
.evaluation-run-status { flex: none; margin-bottom: 10px; }
.evaluation-run-status p { margin-bottom: 5px; font-size: 12px; }
.evaluation-viewer { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.evaluation-viewer-heading { padding: 12px 16px; flex: none; }
.evaluation-viewer-heading h2 { font-size: 17px; margin-bottom: 4px; }
.evaluation-viewer-heading p { font-size: 11px; }
.evaluation-viewer-heading > div { min-width: 0; flex: 1; }
.evaluation-viewer-heading p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#evaluation-task-select { max-width: 35%; min-width: 0; padding: 6px; border: 1px solid var(--line); border-radius: 5px; font-size: 11px; background: white; color: var(--muted); }
.evaluation-view-tabs { padding: 0 16px; flex: none; gap: 10px; flex-wrap: wrap; }
.evaluation-view-tabs [role=tab] { padding: 10px 0; }
.evaluation-preview-actions { display: flex; align-items: center; gap: 16px; }
#evaluation-preview-pane, #evaluation-output-pane { flex: 1; min-height: 0; overflow: hidden; }
#evaluation-preview-pane[hidden], #evaluation-output-pane[hidden] { display: none; }
.evaluation-preview-surface { height: 100%; aspect-ratio: auto; }
.evaluation-preview-surface iframe { left: 50%; top: 50%; transform-origin: center; }
.evaluation-preview-hit { position: absolute; inset: 0; width: 100%; height: 100%; background: transparent; cursor: zoom-in; }
.evaluation-preview-hit:disabled { pointer-events: none; }
.evaluation-output-note { padding: 6px 16px; font-size: 11px; flex: none; }
.evaluation-diagnostics, .evaluation-prompt { border-top: 1px solid var(--line); padding: 8px 16px; font-size: 11px; flex: none; }
.evaluation-diagnostics summary { cursor: pointer; color: var(--muted); }
.evaluation-diagnostics summary span { float: right; font-variant-numeric: tabular-nums; }
.evaluation-diagnostics .evaluation-steps { margin: 6px 0 0; }
.evaluation-diagnostics .evaluation-metrics { padding: 10px 0 0; }
.evaluation-prompt { display: none; }
#evaluation-output { height: 100%; padding: 18px 22px; background: #fff; white-space: normal; font: 14px/1.8 "Segoe UI", "Microsoft YaHei UI", sans-serif; color: var(--text); }
#evaluation-output.is-source { white-space: pre-wrap; font: 12px/1.7 var(--mono); background: #f7fafc; }
.evaluation-markdown > :first-child { margin-top: 0; }
.evaluation-markdown h1, .evaluation-markdown h2, .evaluation-markdown h3 { font-size: 1.2em; line-height: 1.5; margin: 20px 0 10px; }
.evaluation-markdown p { margin: 8px 0 14px; }
.evaluation-markdown ul, .evaluation-markdown ol { padding-left: 1.6em; }
.evaluation-markdown pre { overflow: auto; padding: 12px; border-radius: 6px; background: var(--surface-soft); }
.evaluation-markdown code { font-family: var(--mono); font-size: .9em; background: var(--surface-soft); }
.evaluation-markdown blockquote { margin: 12px 0; padding-left: 14px; border-left: 3px solid var(--line-strong); color: var(--muted); }
.evaluation-markdown table { border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; }
.evaluation-markdown th, .evaluation-markdown td { border: 1px solid var(--line); padding: 7px 12px; }
.evaluation-markdown a { color: var(--eval-blue); }
.evaluation-preview-dialog .evaluation-preview-surface { height: min(76dvh, 75vw); max-width: none; }
.evaluation-preview-dialog header { justify-content: flex-end; }
.evaluation-preview-dialog header h2 { margin-right: auto; }
@media (max-width: 680px) {
  .evaluation-layout { display: flex; flex-direction: column; height: auto; min-height: 0; }
  .evaluation-stage { order: -1; height: calc(100dvh - var(--evaluation-top, 180px) - 95px); min-height: 390px; }
  .evaluation-sidebar { width: 100%; height: auto; overflow: visible; }
  .evaluation-heading p, .evaluation-output-note { display: none; }
  .evaluation-heading { margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
  .evaluation-heading-actions { width: 100%; justify-content: flex-start; }
  .evaluation-heading-actions .button { padding: 8px 10px; font-size: 12px; }
  .evaluation-view-tabs [role=tablist] { gap: 14px; }
  .evaluation-preview-actions { gap: 12px; }
  .evaluation-preview-dialog header { flex-wrap: wrap; gap: 10px; }
  .evaluation-preview-dialog .evaluation-preview-surface { height: 64dvh; }
}
#evaluation-fields .evaluation-optional-question { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; cursor: pointer; }
#evaluation-fields .evaluation-optional-question input { width: 15px; height: 15px; padding: 0; margin: 0; accent-color: var(--accent); }
.evaluation-optional-question small, #evaluation-concurrency { color: var(--muted); font-weight: 400; font-size: 11px; }
[hidden], #evaluation-fields label[hidden] { display: none !important; }
#evaluation-api-url { display: block; color: var(--accent); background: var(--surface-soft); padding: 10px; border-radius: 6px; font: 12px/1.5 var(--mono); overflow-wrap: anywhere; user-select: all; }
#evaluation-key-note, #evaluation-email-note { margin: -6px 0 14px; }
#evaluation-custom-label { margin-top: 10px; }
.evaluation-prompt { display: block; max-height: 28%; overflow: auto; }
.evaluation-markdown { scrollbar-width: thin; }
@media (max-width: 680px) {
  .evaluation-stage { order: 0; }
  .evaluation-workbench[data-has-jobs] .evaluation-stage { order: -1; }
  .evaluation-viewer-heading { gap: 8px; }
}
