@charset "UTF-8";
:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #202938;
  background: #f6f7f9;
  font-synthesis: none;
  --border: #dfe3e9;
  --muted: #687387;
  --accent: #245a9c;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
[hidden] { display: none !important; }
button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #a4bfe1;
  outline-offset: 3px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
main { max-width: 1100px; margin: 0 auto; padding: 34px 28px 48px; }
.page-header { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
h1 { font-size: 24px; font-weight: 600; line-height: 1.4; margin: 0; }
.language-switcher { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.language-switcher a { color: inherit; text-decoration: none; }
.language-switcher a:hover, .language-switcher a[aria-current="page"] { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 18px; }
h3 { font-size: 13px; font-weight: 600; margin: 0; }
.workspace { display: grid; grid-template-columns: 1.05fr 1fr; gap: 24px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 24px; min-width: 0; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset:disabled .dropzone, fieldset:disabled .reference-upload { pointer-events: none; }
.dropzone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 240px;
  background: #fafbfc;
  border: 1px dashed #bac4d2;
  border-radius: 7px;
  overflow: hidden;
  cursor: pointer;
}
.dropzone:hover, .dropzone.is-dragover { background: #f1f5fa; border-color: var(--accent); }
.dropzone:focus-within, .reference-upload:focus-within { outline: 3px solid #a4bfe1; outline-offset: 3px; }
.upload-placeholder { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.upload-placeholder svg { width: 30px; height: 30px; stroke: #78879b; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 6px; }
.upload-placeholder strong { color: var(--accent); font-size: 14px; font-weight: 500; }
.upload-placeholder > span { color: var(--muted); font-size: 12px; }
#image-preview { width: 100%; height: 100%; object-fit: contain; }
.replace-image { position: absolute; bottom: 12px; right: 12px; font-size: 12px; padding: 7px 12px; border: 1px solid var(--border); background: #fffffff0; border-radius: 5px; }
.field-help { font-size: 11px; color: var(--muted); line-height: 1.8; margin: 9px 0 0; overflow-wrap: anywhere; }
.field-label { display: block; font-size: 13px; font-weight: 500; margin: 22px 0 9px; }
.field-label > span, .optional { font-size: 11px; font-weight: 400; color: #7d8796; margin-left: 7px; }
textarea, input[type=text] { width: 100%; border: 1px solid #d3dae4; border-radius: 6px; color: #202938; background: #fff; padding: 10px 12px; font-size: 13px; line-height: 1.7; }
textarea { display: block; resize: vertical; min-height: 92px; max-height: 260px; }
textarea::placeholder, input::placeholder { color: #949dac; }
.references-section { border-top: 1px solid var(--border); margin-top: 22px; padding-top: 18px; }
summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 500; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary > span:first-child::before { content: "›"; display: inline-block; width: 15px; color: #78869a; }
details[open] summary > span:first-child::before { transform: rotate(90deg); }
#reference-count { font-size: 11px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.reference-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 12px; }
.reference-row { display: flex; align-items: center; gap: 10px; }
.reference-upload { position: relative; display: grid; place-items: center; height: 58px; width: 66px; flex-shrink: 0; border: 1px dashed #bbc6d4; border-radius: 5px; background: #fafbfc; overflow: hidden; cursor: pointer; }
.reference-upload img { height: 100%; width: 100%; object-fit: cover; }
.reference-placeholder { font-size: 10px; color: var(--accent); }
.reference-name-label { flex: 1; min-width: 0; color: var(--muted); font-size: 11px; }
.reference-name-label input { margin-top: 4px; padding: 6px 9px; font-size: 12px; }
.remove-reference { border: 0; background: none; color: #687387; font-size: 11px; padding: 8px 0 8px 3px; }
.secondary-button { border: 1px solid #cbd5e2; border-radius: 6px; background: #fff; color: #34435a; padding: 9px 13px; font-size: 12px; white-space: nowrap; }
.secondary-button:hover:not(:disabled) { background: #f3f6fa; }
#add-reference { margin-top: 12px; }
.primary-button { width: 100%; border: 1px solid var(--accent); border-radius: 6px; padding: 12px 18px; color: #fff; background: var(--accent); font-size: 13px; font-weight: 500; margin-top: 24px; }
.primary-button:hover:not(:disabled) { background: #1b4d88; }
.error-message { border: 1px solid #f0d5d3; border-radius: 6px; padding: 11px 13px; margin: 15px 0 0; background: #fff6f5; color: #a13932; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; }
#result-status { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.empty-state, .loading-state { min-height: 190px; display: flex; align-items: center; justify-content: center; gap: 12px; color: #8792a3; font-size: 13px; }
.spinner { height: 18px; width: 18px; border: 2px solid #dce3ed; border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-fields { margin: 0; }
.result-fields > div + div { margin-top: 22px; }
dt { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
dt > span { color: #909aaa; margin-left: 6px; font-size: 10px; }
dd { margin: 0; font-size: 23px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.result-fields > div + div dd { font-size: 15px; font-weight: 400; }
.result-fields .confidence-value { font-size: 19px; font-weight: 500; font-variant-numeric: tabular-nums; }
.correction-form { border-top: 1px solid var(--border); padding-top: 20px; margin-top: 24px; }
.correction-form .field-label { margin-top: 0; }
.correction-controls { display: flex; gap: 8px; }
.correction-controls input { min-width: 0; padding: 8px 10px; font-size: 12px; }
.json-section { border-top: 1px solid var(--border); padding-top: 20px; margin-top: 24px; }
.json-section .section-heading { margin-bottom: 10px; }
#copy-json { border: 0; background: none; color: var(--accent); font-size: 11px; padding: 4px 0 4px 10px; }
pre { margin: 0; background: #f7f8fa; border: 1px solid #e8ebef; border-radius: 6px; color: #425066; padding: 14px; font: 11px/1.85 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 310px; overflow: auto; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); background: #273448; color: #fff; font-size: 12px; line-height: 1.7; padding: 11px 17px; border-radius: 6px; margin: 0; z-index: 10; }
@media (min-width: 800px) { .output-panel { position: sticky; top: 24px; } }
@media (max-width: 760px) { main { padding: 24px 18px 32px; } .page-header { align-items: flex-start; margin-bottom: 18px; } h1 { font-size: 22px; } .workspace { grid-template-columns: 1fr; gap: 18px; } .panel { padding: 21px; } .dropzone { height: 220px; } .empty-state, .loading-state { min-height: 120px; } }
@media (max-width: 380px) { main { padding-left: 12px; padding-right: 12px; } .panel { padding: 17px; } .correction-controls { flex-wrap: wrap; } .correction-controls input { flex: 1; min-width: 110px; } .reference-row { gap: 7px; } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
