:root {
  font:
    14px -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    sans-serif;
  color: #243347;
  background: #eef2f6;
  font-synthesis: none;
  --blue: #315de8;
  --muted: #728096;
  --border: #dce3eb;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
select {
  font: inherit;
}
button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  border-radius: 7px;
  padding: 9px 12px;
  transition: background 0.15s;
}
button:hover {
  background: #e8edf4;
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 3px solid #92b2ff;
  outline-offset: 3px;
}
button.primary {
  background: var(--blue);
  color: white;
  font-weight: 550;
}
button.primary:hover {
  background: #244bc7;
}
.outlined {
  border: 1px solid var(--border);
  background: white;
}
button span {
  margin-left: 9px;
}
[hidden] {
  display: none !important;
}
.topbar {
  height: 92px;
  padding: 0 36px;
  display: flex;
  align-items: center;
  gap: 32px;
  border-bottom: 1px solid var(--border);
  background: #f7f9fb;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.6px;
}
.brand small {
  display: block;
  font-size: 10px;
  font-weight: 450;
  letter-spacing: 2.5px;
  color: var(--muted);
  margin-top: 5px;
}
.logo {
  display: grid;
  place-items: center;
  position: relative;
  color: var(--blue);
  background: white;
  border: 1px solid #d6dfef;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  font: 700 28px Georgia;
}
.logo span {
  position: absolute;
  font: 15px Georgia;
  bottom: 6px;
  right: 4px;
}
.local-note {
  font-size: 12px;
  color: #647386;
  display: flex;
  gap: 7px;
  align-items: center;
}
.local-note i {
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background: #217568;
}
.top-actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
}
main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 228px;
  gap: 24px;
  padding: 28px 32px 16px;
  max-width: 1760px;
  margin: auto;
}
.workspace {
  min-width: 0;
}
.sourcebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 45px;
  margin-bottom: 17px;
}
.sourcebar > div:last-child {
  display: flex;
  align-items: center;
  gap: 9px;
}
.source-info {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-size: 12px;
}
.source-info #source-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a4afbf;
  flex: none;
}
.dot.live {
  background: #217568;
}
#dimensions {
  font: 10px monospace;
  color: var(--muted);
  white-space: nowrap;
}
.tools {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  background: white;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  padding: 11px 14px;
  min-height: 58px;
}
.modes {
  display: flex;
  align-items: center;
  gap: 5px;
}
.modes button {
  font-size: 16px;
  padding: 7px 12px;
  color: #657287;
}
.modes button span {
  font-size: 12px;
}
.modes button.active {
  background: #eaf0ff;
  color: var(--blue);
  font-weight: 600;
}
.tool-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}
.stage-shell {
  background: #e6ebf2;
  min-height: 450px;
  height: calc(100vh - 325px);
  max-height: 900px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 26px;
  border: 1px solid var(--border);
  position: relative;
}
.empty {
  width: 100%;
  height: 100%;
  min-height: 380px;
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 5px 18px #24334707;
  position: relative;
  padding: 26px;
}
.empty:before,
.empty:after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: #b7c9f3;
}
.empty:before {
  left: 14px;
  top: 14px;
  border-left: 1px solid;
  border-top: 1px solid;
}
.empty:after {
  right: 14px;
  bottom: 14px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}
.eyebrow {
  color: #8492a5;
  font-size: 11px;
  letter-spacing: 3px;
  margin-bottom: 17px;
}
.empty h1 {
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 550;
  letter-spacing: 1px;
  line-height: 1.5;
  margin: 0 0 15px;
}
.highlight {
  position: relative;
  background: #dce8ff;
  padding: 0 3px;
}
.caret {
  position: absolute;
  right: -2px;
  top: 3px;
  bottom: 3px;
  width: 2px;
  background: var(--blue);
}
.caret:before,
.caret:after {
  content: "";
  position: absolute;
  height: 5px;
  width: 5px;
  border-radius: 50%;
  background: var(--blue);
  right: -1.5px;
}
.caret:after {
  bottom: 0;
}
.empty p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
  margin: 0 0 20px;
}
.empty-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.gesture {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 24px 0 20px;
  color: #8793a6;
  font-size: 10px;
}
.gesture svg {
  width: 50px;
}
.empty small {
  font-size: 10px;
  color: #96a0af;
}
kbd {
  font:
    10px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  background: #f3f5f8;
  border: 1px solid #d9e1ea;
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 3px 5px;
  white-space: nowrap;
}
.frame {
  position: relative;
  flex: none;
  box-shadow: 0 4px 22px #24334715;
  background: white;
  line-height: 0;
  touch-action: none;
}
#picture {
  display: block;
  width: 100%;
  height: 100%;
}
#words {
  position: absolute;
  inset: 0;
  user-select: text;
  cursor: text;
  overflow: hidden;
}
.ocr-line {
  position: absolute;
  white-space: pre;
  line-height: 1;
  color: transparent;
  user-select: text;
}
.ocr-word {
  position: absolute;
  display: inline-block;
  white-space: pre;
  color: transparent;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  transform-origin: top left;
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 400;
  user-select: text;
  cursor: text;
}
.ocr-word::selection {
  background: #4b8dff70;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
#selector {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  touch-action: none;
  overflow: hidden;
  background: #24334706;
}
#selection-box {
  position: absolute;
  border: 1px solid #315de8;
  box-shadow: 0 0 0 9999px #172c4940;
  pointer-events: none;
  background: #315de805;
}
#selection-box:after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  right: -3px;
  bottom: -3px;
  background: white;
  border: 1px solid var(--blue);
}
.actionbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 53px;
  background: white;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  padding: 8px 16px;
  font-size: 12px;
}
.status-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  line-height: 1.5;
}
.status-indicator {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8c9db4;
  flex: none;
}
.status-indicator.busy {
  background: #315de8;
  animation: pulse 1s infinite;
}
.status-indicator.ready {
  background: #217568;
}
.actionbar > div:not(.status-wrap) {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-shrink: 0;
}
.actionbar label {
  font-size: 11px;
  color: #728096;
}
.actionbar select {
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 5px;
  background: white;
  color: #243347;
}
.bottom-notes {
  font-size: 10px;
  color: #8290a3;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.6;
  min-height: 38px;
}
.bottom-notes > span {
  margin-right: auto;
}
.bottom-notes button {
  font-size: 10px;
  padding: 6px;
}
.rail {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-top: 5px;
}
.rail-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  height: 44px;
}
.rail h2 {
  font-size: 13px;
  margin: 0;
  font-weight: 550;
}
.rail-heading > span {
  font:
    11px ui-monospace,
    monospace;
  color: #92a0b2;
}
#captures {
  overflow: auto;
  max-height: calc(100vh - 265px);
  padding: 20px 0;
}
.captures-empty {
  text-align: center;
  padding: 70px 0 100px;
  color: #8491a3;
}
.corner-icon {
  display: block;
  font-size: 33px;
  color: #a2b3cd;
  margin-bottom: 15px;
}
.captures-empty p {
  font-size: 13px;
  line-height: 1.8;
}
.captures-empty small {
  font-size: 10px;
}
.rail-bottom {
  font-size: 10px;
  color: #94a0b2;
  line-height: 1.7;
  border-top: 1px solid var(--border);
  padding-top: 15px;
  margin-top: auto;
}
.rail-bottom p {
  margin: 4px 0;
}
.capture-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 12px;
}
.capture-card img {
  display: block;
  max-width: 100%;
  max-height: 135px;
  margin: auto;
  object-fit: contain;
  background: #edf0f4;
  cursor: zoom-in;
}
.capture-meta {
  display: flex;
  justify-content: space-between;
  color: #7c899c;
  font: 10px monospace;
  padding: 10px 3px 3px;
}
.capture-card .capture-actions {
  display: flex;
  justify-content: flex-end;
}
.capture-actions button {
  font-size: 11px;
  padding: 6px 9px;
}
footer {
  display: flex;
  justify-content: space-between;
  color: #91a0b2;
  font:
    10px ui-monospace,
    monospace;
  letter-spacing: 1px;
  padding: 5px 36px 20px;
  max-width: 1760px;
  margin: auto;
}
footer b {
  font-weight: 400;
  color: #b0b9c7;
  margin-left: 9px;
}
#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #243347;
  color: white;
  border-radius: 9px;
  padding: 12px 20px;
  box-shadow: 0 5px 30px #15253822;
  font-size: 13px;
  z-index: 30;
  max-width: 90vw;
  line-height: 1.7;
}
dialog {
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 580px;
  width: calc(100vw - 36px);
  padding: 26px;
  color: #243347;
  box-shadow: 0 20px 70px #23364b25;
}
dialog::backdrop {
  background: #24334760;
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dialog-heading h2 {
  font-size: 20px;
  margin: 0;
}
dialog p,
dialog li {
  font-size: 13px;
  line-height: 1.9;
  color: #67758a;
}
dialog ol {
  padding-left: 20px;
}
dialog li {
  padding-left: 5px;
  margin: 14px 0;
}
.shortcuts {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-width: 1100px) {
  main {
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 17px;
    padding: 22px;
  }
  .topbar {
    padding: 0 22px;
  }
  .local-note {
    display: none;
  }
  .tool-actions {
    gap: 0;
  }
  #refresh {
    display: none;
  }
  .sourcebar .text-button {
    display: none;
  }
  .stage-shell {
    padding: 18px;
  }
  .source-info #source-name {
    max-width: 150px;
  }
  #dimensions {
    display: none;
  }
}
@media (max-width: 850px) {
  main {
    display: block;
    padding: 16px;
  }
  .topbar {
    height: 76px;
    padding: 0 16px;
    gap: 10px;
  }
  .top-actions {
    gap: 0;
    font-size: 12px;
  }
  .brand {
    font-size: 17px;
  }
  .local-note {
    display: none;
  }
  .stage-shell {
    height: 57vh;
    min-height: 390px;
    padding: 12px;
  }
  .empty {
    padding: 20px 10px;
  }
  .rail {
    padding-top: 24px;
  }
  .rail-heading {
    height: 30px;
  }
  #captures {
    display: flex;
    gap: 12px;
    max-height: none;
    overflow: auto;
  }
  .capture-card {
    min-width: 180px;
    width: 180px;
  }
  .captures-empty {
    padding: 15px 0;
    text-align: left;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .captures-empty p {
    margin: 0;
  }
  .corner-icon {
    margin: 0;
  }
  .rail-bottom {
    margin: 0;
  }
  .tools {
    padding: 9px 7px;
  }
  .modes button {
    padding: 7px 9px;
  }
  .tool-actions button {
    padding: 8px;
    font-size: 11px;
  }
  .actionbar {
    flex-wrap: wrap;
    padding: 10px;
  }
  .bottom-notes {
    flex-wrap: wrap;
  }
  .sourcebar .primary {
    font-size: 12px;
    padding: 10px;
  }
  .source-info #source-name {
    max-width: 140px;
  }
  footer {
    padding: 16px;
    gap: 16px;
    font-size: 9px;
  }
  .empty-actions {
    gap: 6px;
  }
  .empty-actions button {
    padding: 10px;
    font-size: 12px;
  }
}
@media (max-width: 420px) {
  .brand small {
    font-size: 9px;
  }
  .logo {
    width: 34px;
    height: 34px;
  }
  .top-actions #help {
    display: none;
  }
  .source-info #source-name {
    max-width: 110px;
  }
  .modes button span {
    margin-left: 4px;
  }
  .gesture {
    gap: 5px;
  }
  .tool-actions #pause {
    font-size: 10px;
  }
  .empty h1 {
    font-size: 28px;
  }
}
