:root {
  color-scheme: dark;
  --bg: #080e1a;
  --panel: rgba(15, 24, 40, 0.88);
  --panel-strong: #101b2e;
  --border: rgba(158, 183, 220, 0.13);
  --border-strong: rgba(158, 183, 220, 0.24);
  --text: #f3f7ff;
  --muted: #8493ab;
  --muted-strong: #aab8ce;
  --blue: #4385ff;
  --cyan: #3de2d0;
  --green: #55d890;
  --amber: #f5b951;
  --danger: #ff6e76;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.017) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.017) 1px, transparent 1px),
    radial-gradient(circle at 10% -10%, #173563 0%, transparent 34%),
    var(--bg);
  background-size: 42px 42px, 42px 42px, auto, auto;
  color: var(--text);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.drop-zone:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.hidden {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.23;
  pointer-events: none;
}

.ambient-one {
  width: 420px;
  height: 420px;
  right: -190px;
  top: 20%;
  background: #146bc7;
}

.ambient-two {
  width: 320px;
  height: 320px;
  left: 12%;
  bottom: -240px;
  background: #0bb39c;
}

.topbar {
  width: min(1540px, calc(100% - 48px));
  height: 94px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  gap: 13px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 10px);
  grid-template-rows: repeat(2, 10px);
  gap: 4px;
  width: 36px;
  height: 36px;
  padding: 6px;
  border: 1px solid rgba(73, 148, 255, 0.72);
  border-radius: 10px;
  box-shadow: inset 0 0 16px rgba(54, 126, 255, 0.16), 0 0 24px rgba(54, 126, 255, 0.12);
  transform: rotate(45deg);
}

.brand-mark span {
  border-radius: 2px;
  background: linear-gradient(135deg, #67a4ff, #3de2d0);
}

.brand-mark span:nth-child(2),
.brand-mark span:nth-child(3) {
  opacity: 0.45;
}

.brand strong {
  display: block;
  font-size: 18px;
  letter-spacing: 0.04em;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: #71829b;
  font-family: Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
}

.engine-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(9, 16, 29, 0.5);
  color: var(--muted-strong);
  font-size: 12px;
  backdrop-filter: blur(12px);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
}

.engine-pill.offline .status-dot {
  background: var(--danger);
  box-shadow: 0 0 12px var(--danger);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(380px, 0.75fr);
  gap: 18px;
  width: min(1540px, calc(100% - 48px));
  min-height: calc(100vh - 122px);
  margin: 0 auto;
  padding-bottom: 28px;
}

.panel {
  min-height: 680px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.canvas-panel {
  display: flex;
  flex-direction: column;
  padding: 26px;
}

.result-panel {
  display: flex;
  flex-direction: column;
  padding: 24px 22px 20px;
  overflow: hidden;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
}

.panel-heading h1,
.panel-heading h2 {
  margin: 3px 0 0;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.eyebrow {
  margin: 0;
  color: #5f7da8;
  font-family: Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.heading-actions {
  display: flex;
  gap: 9px;
}

.primary-button,
.ghost-button,
.select-button,
.export-button,
.icon-button {
  border: 0;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.primary-button {
  padding: 10px 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3479f5, #3e95ff);
  color: white;
  font-size: 12px;
  font-weight: 650;
  box-shadow: 0 7px 22px rgba(47, 120, 246, 0.25);
}

.ghost-button {
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted-strong);
  font-size: 12px;
}

.primary-button:hover,
.ghost-button:hover,
.select-button:hover,
.export-button:hover {
  transform: translateY(-1px);
}

.ghost-button:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.button-icon {
  margin-right: 4px;
  color: var(--cyan);
}

.drop-zone {
  position: relative;
  flex: 1;
  min-height: 540px;
  overflow: hidden;
  border: 1px dashed rgba(125, 157, 203, 0.3);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(21, 42, 72, 0.24), transparent 46%),
    rgba(5, 11, 22, 0.38);
  cursor: pointer;
}

.drop-zone.dragover {
  border-color: var(--blue);
  background-color: rgba(41, 96, 185, 0.08);
}

.drop-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
}

.drop-content h2 {
  margin: 30px 0 8px;
  font-size: 18px;
  font-weight: 600;
}

.drop-content p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.upload-illustration {
  position: relative;
  width: 126px;
  height: 112px;
}

.upload-sheet {
  position: absolute;
  width: 76px;
  height: 94px;
  border-radius: 11px;
  border: 1px solid rgba(83, 145, 236, 0.34);
}

.sheet-back {
  left: 21px;
  top: 4px;
  transform: rotate(-9deg);
  background: rgba(28, 59, 105, 0.18);
}

.sheet-front {
  left: 33px;
  top: 10px;
  overflow: hidden;
  padding: 18px 13px;
  background: linear-gradient(160deg, rgba(24, 62, 116, 0.6), rgba(11, 25, 47, 0.94));
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.32), inset 0 1px rgba(255, 255, 255, 0.08);
  transform: rotate(4deg);
}

.scan-line {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 20px;
  height: 1px;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: scan 2.8s ease-in-out infinite;
}

.text-line {
  display: block;
  height: 3px;
  margin-bottom: 9px;
  border-radius: 4px;
  background: rgba(134, 173, 226, 0.35);
}

.w-60 {
  width: 60%;
}

.w-90 {
  width: 90%;
}

.w-72 {
  width: 72%;
}

.upload-arrow {
  position: absolute;
  right: 4px;
  bottom: 2px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(82, 154, 255, 0.52);
  border-radius: 50%;
  background: #142743;
  color: #73adff;
  font-family: Consolas, monospace;
  font-size: 22px;
  box-shadow: 0 8px 28px rgba(23, 91, 188, 0.35);
}

.select-button {
  margin-top: 24px;
  padding: 10px 20px;
  border: 1px solid rgba(82, 145, 255, 0.38);
  border-radius: 9px;
  background: rgba(53, 113, 217, 0.15);
  color: #a7c8ff;
  font-size: 12px;
  font-weight: 650;
}

.paste-hint {
  margin-top: 12px;
  color: #596b85;
  font-size: 10px;
}

.url-import {
  width: min(390px, 88%);
  margin-top: 28px;
}

.url-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: #53657e;
  font-size: 9px;
}

.url-divider::before,
.url-divider::after {
  height: 1px;
  flex: 1;
  background: rgba(133, 160, 199, 0.1);
  content: "";
}

.url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(3, 9, 19, 0.42);
}

.url-row input {
  min-width: 0;
  padding: 6px 7px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #c7d6ec;
  font-family: Consolas, monospace;
  font-size: 10px;
}

.url-row input::placeholder {
  color: #4c5d75;
}

.url-button {
  padding: 7px 11px;
  border: 1px solid rgba(74, 140, 255, 0.3);
  border-radius: 7px;
  background: rgba(49, 111, 226, 0.14);
  color: #91baff;
  font-size: 9px;
  cursor: pointer;
}

.url-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.image-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  cursor: default;
}

#overlayCanvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  box-shadow: 0 16px 55px rgba(0, 0, 0, 0.42);
  cursor: crosshair;
}

.canvas-status {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border: 1px solid rgba(95, 151, 238, 0.25);
  border-radius: 999px;
  background: rgba(7, 15, 29, 0.9);
  color: #b9cbed;
  font-size: 11px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(14px);
}

.spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(72, 147, 255, 0.23);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.coordinate-tip {
  position: fixed;
  z-index: 20;
  padding: 5px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: rgba(5, 10, 20, 0.94);
  color: #9fb9de;
  font-family: Consolas, monospace;
  font-size: 10px;
  pointer-events: none;
}

.bottom-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 15px 2px 0;
  color: #63738b;
  font-size: 10px;
}

.bottom-hints span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hint-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.hint-dot.green {
  background: var(--green);
}

.hint-dot.blue {
  background: var(--blue);
}

.result-heading {
  flex: 0 0 auto;
  margin-bottom: 14px;
}

.result-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.translate-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(70, 151, 255, 0.3);
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(45, 112, 227, 0.2), rgba(38, 206, 190, 0.09));
  color: #a7caff;
  font-size: 9px;
  font-weight: 650;
  cursor: pointer;
}

.translate-trigger:hover {
  border-color: rgba(90, 167, 255, 0.56);
  color: white;
}

.translate-trigger > span {
  font-family: Consolas, monospace;
  font-size: 8px;
}

.icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: transparent;
  color: #72839d;
  font-size: 21px;
}

.icon-button:not(:disabled):hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.icon-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.empty-results {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 44px;
  text-align: center;
}

.result-symbol {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 19px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.025);
  color: #5478a7;
  font-family: Georgia, serif;
  font-size: 30px;
}

.empty-results strong {
  font-size: 14px;
  font-weight: 600;
}

.empty-results p {
  max-width: 250px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.results-content {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-card {
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.022);
}

.stat-card span {
  display: block;
  color: #71849f;
  font-size: 9px;
}

.stat-card strong {
  display: block;
  margin-top: 4px;
  font-family: "Segoe UI", sans-serif;
  font-size: 18px;
  font-weight: 650;
}

.stat-card.wide {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.stat-card.wide span {
  flex: 1;
}

.stat-card.wide strong {
  font-size: 14px;
}

.stat-card.wide small {
  color: #60728d;
  font-family: Consolas, monospace;
  font-size: 9px;
}

.translation-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  padding: 8px 9px;
  border: 1px solid rgba(66, 204, 175, 0.17);
  border-radius: 9px;
  background: linear-gradient(90deg, rgba(31, 168, 139, 0.08), rgba(40, 97, 195, 0.05));
}

.translation-ready {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: #7bd9c1;
  font-size: 9px;
}

.translation-ready-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 9px rgba(61, 226, 208, 0.65);
}

.language-switch {
  display: flex;
  flex: 0 0 auto;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(3, 9, 18, 0.38);
}

.language-button {
  padding: 4px 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #667a96;
  font-size: 8px;
  cursor: pointer;
}

.language-button.active {
  background: rgba(68, 133, 239, 0.18);
  color: #acd0ff;
}

.translated-image-button {
  display: flex;
  width: 100%;
  min-height: 30px;
  margin-top: 7px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(63, 213, 183, 0.2);
  border-radius: 8px;
  background: rgba(35, 159, 136, 0.07);
  color: #83d7c3;
  font-size: 9px;
  cursor: pointer;
}

.translated-image-button:hover {
  border-color: rgba(63, 213, 183, 0.4);
  background: rgba(35, 159, 136, 0.12);
}

.translated-image-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.tabs {
  display: flex;
  gap: 18px;
  margin-top: 18px;
  border-bottom: 1px solid var(--border);
}

.tab {
  position: relative;
  padding: 0 0 10px;
  border: 0;
  background: transparent;
  color: #667994;
  font-size: 11px;
  cursor: pointer;
}

.tab.active {
  color: var(--text);
}

.tab.active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--blue);
  content: "";
}

.filter-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 13px 0 10px;
}

.selection-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(110, 151, 209, 0.11);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
}

.select-all-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #8fa4c1;
  font-size: 9px;
  cursor: pointer;
}

.select-all-control input,
.translation-select input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: #4c91ff;
  cursor: pointer;
}

.selection-count {
  color: #617997;
  font-family: Consolas, monospace;
  font-size: 8px;
  white-space: nowrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(2, 7, 16, 0.34);
  color: #667994;
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 11px;
}

.search-box input::placeholder {
  color: #56677f;
}

.threshold-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #657994;
  font-size: 9px;
}

.threshold-control b {
  color: #99b9e8;
  font-family: Consolas, monospace;
  font-weight: 500;
}

.threshold-control input {
  width: 45%;
  height: 3px;
  accent-color: var(--blue);
  cursor: pointer;
}

.detection-list {
  flex: 1;
  min-height: 150px;
  max-height: calc(100vh - 545px);
  overflow: auto;
  padding-right: 3px;
  scrollbar-color: #2d405d transparent;
  scrollbar-width: thin;
}

.detection-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  flex: 1;
  min-width: 0;
  gap: 9px;
  align-items: center;
  width: 100%;
  margin-bottom: 6px;
  padding: 9px 10px;
  border: 1px solid rgba(139, 165, 203, 0.08);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.detection-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.translation-select {
  display: grid;
  width: 20px;
  height: 32px;
  flex: 0 0 20px;
  place-items: center;
}

.translation-select.unavailable {
  opacity: 0.2;
}

.detection-item:hover,
.detection-item.selected {
  border-color: rgba(74, 139, 255, 0.45);
  background: rgba(42, 98, 194, 0.1);
  transform: translateX(2px);
}

.detection-index {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(78, 142, 255, 0.25);
  border-radius: 6px;
  background: rgba(45, 104, 209, 0.09);
  color: #7baaff;
  font-family: Consolas, monospace;
  font-size: 9px;
}

.detection-copy {
  min-width: 0;
}

.detection-text {
  display: block;
  overflow: hidden;
  color: #dce7f8;
  font-size: 11px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detection-meta {
  display: block;
  margin-top: 3px;
  color: #5d708b;
  font-family: Consolas, monospace;
  font-size: 8px;
}

.confidence-badge {
  padding: 3px 5px;
  border-radius: 5px;
  background: rgba(82, 210, 148, 0.08);
  color: #6bcb9a;
  font-family: Consolas, monospace;
  font-size: 8px;
}

.confidence-badge.medium {
  background: rgba(242, 180, 75, 0.08);
  color: var(--amber);
}

.confidence-badge.low {
  background: rgba(255, 100, 112, 0.08);
  color: #ef7b85;
}

.list-empty {
  padding: 28px 15px;
  color: #5d6e87;
  font-size: 10px;
  text-align: center;
}

.fulltext-view {
  flex: 1;
  min-height: 200px;
  padding-top: 13px;
}

#fullText {
  width: 100%;
  height: 100%;
  min-height: 265px;
  max-height: calc(100vh - 480px);
  resize: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: 0;
  background: rgba(3, 8, 17, 0.45);
  color: #cedbee;
  font-family: "Microsoft YaHei UI", sans-serif;
  font-size: 12px;
  line-height: 1.8;
  padding: 13px;
}

.export-row {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.export-button {
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: #8fa3c0;
  font-size: 9px;
}

.export-button:hover {
  border-color: rgba(78, 141, 255, 0.35);
  color: var(--text);
}

.export-button.accent {
  border-color: rgba(56, 132, 255, 0.28);
  background: rgba(49, 114, 233, 0.12);
  color: #9ac4ff;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  max-width: min(380px, calc(100vw - 48px));
  padding: 11px 15px;
  border: 1px solid rgba(104, 151, 218, 0.25);
  border-radius: 10px;
  background: rgba(11, 22, 39, 0.96);
  color: #cdd9ea;
  font-size: 11px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.34);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-color: rgba(255, 103, 112, 0.3);
  color: #ffabb0;
}

.translate-dialog {
  width: min(470px, calc(100vw - 32px));
  padding: 27px;
  border: 1px solid rgba(116, 162, 231, 0.24);
  border-radius: 18px;
  background:
    radial-gradient(circle at 85% -10%, rgba(42, 105, 211, 0.22), transparent 35%),
    #0d1829;
  color: var(--text);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.62);
}

.translate-dialog::backdrop {
  background: rgba(1, 5, 12, 0.7);
  backdrop-filter: blur(7px);
}

.translate-dialog[open] {
  animation: dialog-in 180ms ease-out;
}

.dialog-accent {
  position: absolute;
  top: 18px;
  right: 78px;
  left: 78px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(74, 144, 255, 0.4), transparent);
}

.dialog-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dialog-heading h3 {
  margin: 3px 0 0;
  font-size: 19px;
  font-weight: 650;
}

.dialog-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(82, 149, 255, 0.32);
  border-radius: 12px;
  background: rgba(50, 111, 223, 0.12);
  color: #86b9ff;
  font-family: Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
}

.dialog-close {
  width: 30px;
  height: 30px;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: #71839d;
  font-size: 19px;
  cursor: pointer;
}

.dialog-description {
  margin: 20px 0 17px;
  color: #8fa1ba;
  font-size: 11px;
  line-height: 1.75;
}

.dialog-field span {
  display: block;
  margin-bottom: 7px;
  color: #b9c8dd;
  font-size: 10px;
  font-weight: 600;
}

.dialog-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(122, 157, 205, 0.2);
  border-radius: 9px;
  outline: 0;
  background: rgba(2, 8, 17, 0.5);
  color: #e8f1ff;
  font-family: Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.dialog-field input:focus {
  border-color: rgba(72, 143, 255, 0.6);
}

.dialog-field small {
  display: block;
  margin-top: 7px;
  color: #586b84;
  font-size: 8px;
}

.dialog-note {
  display: flex;
  gap: 8px;
  margin-top: 15px;
  padding: 10px;
  border: 1px solid rgba(133, 162, 206, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: #7386a0;
  font-size: 9px;
  line-height: 1.6;
}

.note-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--amber);
}

.dialog-status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  padding: 10px 11px;
  border: 1px solid rgba(74, 136, 237, 0.16);
  border-radius: 8px;
  background: rgba(42, 92, 179, 0.07);
  color: #93b5e5;
  font-size: 9px;
}

.dialog-selection-summary {
  margin-top: 12px;
  color: #7f9dc5;
  font-family: Consolas, monospace;
  font-size: 9px;
  text-align: right;
}

.dialog-status.error {
  border-color: rgba(255, 105, 115, 0.2);
  background: rgba(156, 45, 58, 0.08);
  color: #f1a0a7;
}

.dialog-status.error .spinner {
  display: none;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 21px;
}

.dialog-cancel,
.dialog-submit {
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
}

.dialog-cancel {
  border: 1px solid var(--border);
  background: transparent;
  color: #8395ae;
}

.dialog-submit {
  border: 1px solid rgba(86, 157, 255, 0.45);
  background: linear-gradient(135deg, #2f78ec, #3f93ff);
  color: white;
  box-shadow: 0 8px 24px rgba(40, 111, 230, 0.25);
}

.dialog-submit:disabled,
.dialog-cancel:disabled {
  cursor: wait;
  opacity: 0.55;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes scan {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.6;
  }
  50% {
    transform: translateY(55px);
    opacity: 1;
  }
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .panel {
    min-height: auto;
  }

  .result-panel {
    min-height: 620px;
  }

  .drop-zone {
    min-height: 520px;
  }

  .detection-list {
    max-height: 420px;
  }
}

@media (max-width: 620px) {
  .topbar,
  .workspace {
    width: calc(100% - 24px);
  }

  .topbar {
    height: 78px;
  }

  .brand small {
    display: none;
  }

  .engine-pill {
    padding: 8px 10px;
    font-size: 10px;
  }

  .canvas-panel,
  .result-panel {
    padding: 17px;
    border-radius: 16px;
  }

  .panel-heading {
    align-items: flex-start;
  }

  .panel-heading h1,
  .panel-heading h2 {
    font-size: 18px;
  }

  .drop-zone {
    min-height: 410px;
  }

  .heading-actions {
    flex-direction: column;
  }

  .ghost-button,
  .primary-button {
    padding: 8px 10px;
    font-size: 10px;
  }

  .bottom-hints {
    gap: 10px;
  }

  .bottom-hints span:last-child {
    display: none;
  }

  .detection-list {
    max-height: none;
    min-height: 260px;
  }

  #fullText {
    max-height: none;
  }
}
