:root {
  color-scheme: light;
  --bg: oklch(1 0 0);
  --surface: oklch(.977 .004 268);
  --surface-strong: oklch(.955 .008 268);
  --ink: oklch(.28 .024 268);
  --muted: oklch(.49 .025 268);
  --border: oklch(.865 .012 268);
  --primary: oklch(.51 .16 265);
  --primary-hover: oklch(.45 .16 265);
  --selected: oklch(.953 .023 265);
  --error: oklch(.47 .17 25);
  --error-bg: oklch(.97 .015 25);
  --success: oklch(.43 .095 165);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; height: 100dvh; overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
button, select, summary, input[type=checkbox] { cursor: pointer; }
button { color: inherit; border: 1px solid var(--border); background: var(--bg); border-radius: 6px; min-height: 36px; padding: 7px 12px; transition: background 160ms ease, border-color 160ms ease; }
button:hover:not(:disabled) { background: var(--surface-strong); }
button:disabled { opacity: .45; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
input, textarea, select { border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--ink); min-width: 0; }
input:not([type=checkbox]), textarea { width: 100%; padding: 9px 11px; }
textarea { resize: vertical; line-height: 1.6; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:disabled, textarea:disabled { background: var(--surface-strong); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); flex-shrink: 0; margin: 0; }
select { padding: 7px 8px; min-height: 36px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
h1 { font-size: 17px; font-weight: 650; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
[hidden] { display: none !important; }
.app-header { height: 66px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-icon { background: var(--primary); color: var(--bg); width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; font-size: 23px; }
.divider { height: 18px; border-left: 1px solid var(--border); margin: 0 4px; }
.header-subtitle { font-size: 13px; color: var(--muted); }
.connection { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.connection[data-state=success] .status-dot { background: var(--success); }
.connection[data-state=error] .status-dot { background: var(--error); }
.workspace { display: grid; grid-template-columns: 326px minmax(0, 1fr); height: calc(100dvh - 66px); min-height: 0; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 24px 22px 20px; min-height: 0; }
#searchForm { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.form-fields { flex: 1; min-height: 0; overflow-y: auto; padding: 0 4px 2px; margin: 0 -4px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.panel-title h2 { font-size: 16px; }
.form-section { padding-bottom: 22px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.form-section h3 { margin-bottom: 15px; }
label:not(.checkbox-row), .label-row { display: block; margin: 14px 0 7px; font-size: 12px; font-weight: 550; }
.form-section > label:first-child { margin-top: 0; }
.label-note { color: var(--muted); font-weight: 400; margin-left: 3px; }
.label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; }
.label-row label { margin: 0; }
.required { color: var(--error); }
.two-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.hint { color: var(--muted); font-size: 11px; line-height: 1.7; margin-top: 7px; }
.text-button { padding: 2px 4px; min-height: 30px; background: transparent; border-color: transparent; color: var(--primary); font-size: 12px; white-space: nowrap; }
.advanced { margin-top: 15px; }
.advanced summary { font-size: 12px; color: var(--muted); min-height: 30px; padding: 5px 0; }
.advanced .checkbox-row { margin: 9px 0; font-size: 12px; }
#requestBody { font-size: 11px; }
#requestBody[readonly] { color: var(--muted); background: var(--surface-strong); }
.checkbox-row { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.primary { background: var(--primary); border-color: var(--primary); color: var(--bg); font-weight: 550; }
.primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.query-button { width: 100%; min-height: 41px; font-size: 14px; flex-shrink: 0; margin-top: 16px; }
.query-button > span { font-size: 19px; margin-right: 6px; }
.main { padding: 30px 30px 0; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.main > :not(.records) { flex-shrink: 0; }
.results-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 23px; }
.results-header h2 { font-size: 21px; margin-bottom: 9px; }
.subtle { color: var(--muted); font-size: 12px; line-height: 1.7; }
.field-badge { background: var(--surface); border: 1px solid var(--border); border-radius: 5px; padding: 6px 8px; font-family: ui-monospace, Consolas, monospace; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.selection-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 15px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); min-height: 65px; padding: 12px 0; }
.select-page, .selection-counter { font-size: 12px; white-space: nowrap; }
.selection-counter { border-left: 1px solid var(--border); padding-left: 16px; color: var(--muted); }
.selection-counter strong { font-size: 15px; color: var(--primary); font-variant-numeric: tabular-nums; padding: 0 3px; }
.export-button { margin-left: auto; display: flex; align-items: center; gap: 9px; font-size: 12px; }
.export-button > span:first-child { font-size: 19px; line-height: 16px; }
#exportCount { border-left: 1px solid oklch(1 0 0 / .35); padding-left: 9px; min-width: 21px; }
.notice, .error { border-radius: 6px; padding: 12px 14px; font-size: 12px; line-height: 1.7; margin-top: 16px; overflow-wrap: anywhere; }
.notice { color: var(--primary); background: var(--selected); }
.error { color: var(--error); background: var(--error-bg); border: 1px solid oklch(.84 .08 25); }
.records { flex: 1; min-height: 0; overflow-y: auto; padding: 0 5px; margin: 0 -5px; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 12px 56px; min-height: 100%; }
.empty-icon { width: 62px; height: 62px; border-radius: 12px; background: var(--surface-strong); display: grid; place-items: center; color: var(--muted); font-size: 37px; margin-bottom: 22px; }
.empty-state h3 { font-size: 17px; margin-bottom: 12px; }
.empty-state p { font-size: 12px; color: var(--muted); line-height: 1.9; }
.empty-steps { display: flex; flex-wrap: wrap; justify-content: center; gap: 11px; margin-top: 26px; font-size: 11px; color: var(--muted); }
.record { padding: 25px 0; border-bottom: 1px solid var(--border); }
.record-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 13px; }
.record-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.record-title h3 { font-size: 14px; }
.record-index { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; min-width: 22px; }
.record-meta { display: flex; flex-wrap: wrap; gap: 6px 13px; color: var(--muted); font-size: 11px; margin: 6px 0 0 30px; overflow-wrap: anywhere; }
.status-tag { font-size: 10px; border: 1px solid var(--border); background: var(--surface); padding: 3px 6px; border-radius: 4px; color: var(--muted); }
.image-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.image-card { min-width: 0; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; transition: border-color 160ms ease, background 160ms ease; }
.image-card:hover { border-color: var(--muted); }
.image-card.selected { border-color: var(--primary); outline: 1px solid var(--primary); background: var(--selected); }
.image-select { position: relative; display: block !important; margin: 0 !important; cursor: pointer; }
.image-surface { background: var(--surface-strong); aspect-ratio: 16 / 10; display: grid; place-items: center; position: relative; overflow: hidden; }
.image-surface img { width: 100%; height: 100%; object-fit: contain; position: absolute; inset: 0; }
.image-check { position: absolute; top: 9px; left: 9px; z-index: 1; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 5px; background: var(--bg); border: 1px solid var(--border); }
.frame-label { position: absolute; right: 8px; bottom: 8px; border-radius: 4px; background: oklch(.2 .01 268 / .85); color: var(--bg); padding: 4px 6px; font-size: 10px; }
.image-placeholder { color: var(--muted); font-size: 11px; padding: 35px 15px; line-height: 1.7; text-align: center; }
.image-placeholder.failed { color: var(--error); }
.image-caption { padding: 9px 10px 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; font-size: 11px; }
.image-actions { padding: 0 6px 5px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.selection-label { font-size: 10px; color: var(--muted); }
.selected .selection-label { color: var(--primary); }
.image-actions .text-button { font-size: 11px; }
.no-images { background: var(--surface); color: var(--muted); font-size: 12px; padding: 20px; border-radius: 5px; }
.pagination { background: var(--bg); border-top: 1px solid var(--border); padding: 16px 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 13px; z-index: 2; }
.page-info { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-variant-numeric: tabular-nums; }
.page-info small { color: var(--muted); font-size: 10px; }
.page-controls { display: flex; align-items: center; gap: 7px; font-size: 11px; flex-wrap: wrap; }
.page-controls label { margin: 0; font-size: 11px; }
.page-controls select { font-size: 11px; margin-right: 5px; }
.page-button { min-width: 34px; min-height: 34px; padding: 6px 9px; }
#prevPage, #nextPage, #firstPage { font-size: 19px; line-height: 18px; }
.current-page { margin: 0 5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.jump-form { display: flex; align-items: center; gap: 7px; margin-left: 7px; }
#jumpPage { width: 53px; min-height: 34px; padding: 6px; font-size: 11px; }
.preview-dialog { width: min(1200px, 94vw); max-height: 94vh; border: 1px solid var(--border); border-radius: 10px; padding: 18px; color: var(--ink); background: var(--bg); }
.preview-dialog::backdrop { background: oklch(.15 .01 268 / .75); }
.preview-heading { display: flex; gap: 16px; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.preview-heading h2 { font-size: 14px; overflow-wrap: anywhere; }
.preview-dialog > img { display: block; width: 100%; max-height: 72vh; object-fit: contain; background: var(--surface-strong); }
.preview-dialog > p { margin-top: 10px; overflow-wrap: anywhere; }
.loading-block { height: 180px; margin: 25px 0; background: var(--surface-strong); border-radius: 6px; animation: loading 1.1s ease-in-out infinite alternate; }
@keyframes loading { to { opacity: .4; } }
@media (min-width: 1600px) { .main { padding-left: 45px; padding-right: 45px; } .image-grid { gap: 20px; } }
@media (max-width: 1100px) { .workspace { grid-template-columns: 294px minmax(0, 1fr); } .sidebar { padding: 22px 18px; } .main { padding: 25px 22px 0; } .image-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .selection-note { display: none; } .pagination { align-items: flex-start; } }
@media (max-width: 760px) { .workspace { display: block; } .sidebar { border-right: 0; border-bottom: 1px solid var(--border); } .app-header { padding: 0 18px; height: 60px; } .header-subtitle, .divider { display: none; } .main { padding: 23px 18px 0; } .form-section { padding-bottom: 18px; margin-bottom: 17px; } .panel-title { margin-bottom: 16px; } .empty-state { min-height: 330px; padding: 65px 8px; } .records { min-height: 330px; } .selection-toolbar { gap: 11px; } .selection-counter { padding-left: 11px; } .pagination { position: static; } .field-badge { font-size: 10px; } .page-controls { gap: 5px; } .jump-form { margin-left: 0; } .record-meta { margin-left: 0; } }
@media (max-width: 440px) { .image-grid { grid-template-columns: minmax(0, 1fr); } .selection-toolbar { gap: 10px; } .selection-counter { border: 0; padding-left: 0; } #clearSelection { margin-left: auto; } .export-button { margin-left: 0; width: 100%; justify-content: center; } .record-heading { flex-wrap: wrap; } .jump-form { margin-top: 8px; flex-basis: 100%; } }
@media (max-width: 760px) { body { height: auto; overflow: auto; } .workspace { height: auto; } .form-fields, .records { overflow: visible; } #searchForm { height: auto; } .pagination { margin-top: 24px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
