:root {
  font:
    16px/1.5 -apple-system,
    BlinkMacSystemFont,
    'PingFang SC',
    'Microsoft YaHei',
    'Noto Sans CJK SC',
    sans-serif;
  color: #26332f;
  --ink: #26332f;
  --green: #216854;
  --deep: #1b5446;
  --muted: #65726c;
  --line: #dce2dd;
  --wash: #eef4ef;
  --side: 188px;
  --right: 282px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #fff;
  overflow: hidden;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid #248471;
  outline-offset: 3px;
}
button:disabled:not(.primary) {
  opacity: 0.37;
}
button,
[role='button'] {
  -webkit-tap-highlight-color: transparent;
}
button i,
.brand i {
  pointer-events: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}
i[data-icon] {
  font-style: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
i[data-icon] svg {
  width: 1.12rem;
  height: 1.12rem;
  display: block;
}
button {
  border: 0;
  background: transparent;
}
.app-head {
  height: 68px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px;
  background: #fff;
  position: relative;
  z-index: 3;
}
.brand,
.head-actions,
.button,
.file-name,
.history,
.side-title,
.side-title > div,
.tools,
.stage-foot,
.pager,
.zoom,
.local-note,
.section-heading,
.scan-icon,
.help,
.icon,
.apply-row,
.dialog-actions,
.key-row {
  display: flex;
  align-items: center;
}
.brand {
  gap: 10px;
  white-space: nowrap;
}
.brand img {
  display: block;
}
.brand strong {
  font-size: 1.48rem;
  letter-spacing: 0.07em;
  line-height: 1;
  font-weight: 720;
}
.brand > i {
  height: 19px;
  width: 1px;
  background: #d4ddd6;
  margin: 0 3px 0 7px;
}
.brand > span {
  color: #5c6962;
  font-size: 0.92rem;
  letter-spacing: 0.035em;
}
.head-actions {
  gap: 10px;
}
.button {
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 7px;
  font-weight: 570;
  font-size: 0.9rem;
  white-space: nowrap;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.button.white {
  background: white;
  border: 1px solid #cdd6cf;
  box-shadow: 0 1px 2px #192f2509;
}
.button.white:hover {
  background: #f4f7f4;
  border-color: #adbdb1;
}
.primary {
  color: #fff;
  background: var(--green);
  border: 1px solid var(--green);
}
.primary:hover:not(:disabled) {
  background: var(--deep);
  border-color: var(--deep);
}
.primary:disabled {
  background: #e1eae3;
  color: #648372;
  border-color: #d4e0d6;
}
.layout {
  height: calc(100vh - 68px);
  height: calc(100dvh - 68px);
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr) var(--right);
}
.side {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.pages {
  border-right: 1px solid var(--line);
  background: #fbfcfa;
}
.side-title {
  height: 56px;
  min-height: 56px;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}
.side-title > div {
  gap: 8px;
}
.side-title i {
  color: #63726a;
}
.side-title i svg {
  width: 17px;
  height: 17px;
}
.side-title h2 {
  font-weight: 620;
  font-size: 0.94rem;
  letter-spacing: 0.025em;
}
.count,
.tag,
.type-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  line-height: 1.35;
  border-radius: 5px;
}
.count {
  margin-left: 1px;
  padding: 1px 7px;
  background: #e8eee8;
  color: #5b6a60;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.icon {
  justify-content: center;
  flex-shrink: 0;
  width: 33px;
  height: 33px;
  padding: 0;
  border-radius: 5px;
  color: #4f6157;
}
.icon:hover:not(:disabled),
#zoom-fit:hover {
  background: #eaf0e9;
}
.small {
  width: 29px;
  height: 29px;
}
.small i svg {
  width: 16px;
  height: 16px;
}
.mobile-close,
.pages-toggle,
.inspector-toggle {
  display: none;
}
.pages nav {
  flex: 1;
  overflow: auto;
  scrollbar-width: thin;
  padding: 16px 12px 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.thumb {
  width: 100%;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 6px;
  padding: 8px 6px 7px;
  color: #69766d;
  flex: none;
  border-radius: 7px;
  font-size: 0.79rem;
  line-height: 1.4;
}
.thumb:hover {
  background: #edf2ed;
}
.thumb-frame {
  width: 96px;
  aspect-ratio: 540/708;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  box-shadow:
    0 1px 4px #23352822,
    0 0 0 1px #cdd5ce;
  border-radius: 1px;
  position: relative;
}
.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.thumb img:not([src]) {
  visibility: hidden;
}
.thumb.current {
  color: var(--green);
  font-weight: 650;
  background: #eaf1eb;
}
.thumb.current .thumb-frame {
  outline: 2px solid #45816b;
  outline-offset: 2px;
}
.thumb.current .thumb-frame:after {
  content: '';
  position: absolute;
  right: -5px;
  top: -5px;
  border: 2px solid #f0f5ef;
  background: #36725d;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.help {
  gap: 9px;
  border-top: 1px solid var(--line);
  height: 46px;
  min-height: 46px;
  padding: 0 19px;
  color: #5d6d62;
  width: 100%;
  text-align: left;
  font-size: 0.84rem;
}
.help:hover {
  background: #edf2eb;
}
.help i:last-child {
  margin-left: auto;
}
.help i:last-child svg {
  width: 14px;
}
.workspace {
  display: grid;
  grid-template-rows: 56px minmax(0, 1fr) 46px;
  min-width: 0;
  min-height: 0;
}
.file-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 21px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.file-name {
  gap: 10px;
  min-width: 0;
}
.file-icon {
  display: flex;
  color: #597168;
}
.file-name h1 {
  font-size: 0.99rem;
  font-weight: 580;
  letter-spacing: 0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tag {
  background: #f4f2eb;
  color: #786a54;
  border: 1px solid #e8e3d7;
  padding: 1px 7px;
  white-space: nowrap;
}
.history {
  gap: 2px;
}
.stage {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background-color: #e9eeea;
  background-image: radial-gradient(#c8d2c9 0.72px, transparent 0.85px);
  background-size: 15px 15px;
}
.tools-position {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px 8px 13px;
  flex-shrink: 0;
}
.tools {
  background: #fff;
  gap: 3px;
  border: 1px solid #d4ddd5;
  border-radius: 9px;
  padding: 4px;
  box-shadow: 0 2px 7px #2037290c;
}
.tool {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 5px;
  color: #516159;
  font-size: 0.875rem;
  line-height: 20px;
  white-space: nowrap;
}
.tool:hover {
  background: #f2f5f1;
}
.tool.active {
  background: #e2eee5;
  color: #215c48;
  font-weight: 630;
}
.tool i svg {
  width: 16px;
  height: 16px;
}
.paper-scroll {
  overflow: auto;
  min-height: 0;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: #bac8bb transparent;
  overscroll-behavior: contain;
}
.paper-position {
  width: max-content;
  min-width: 100%;
  padding: 4px 28px 35px;
  display: flex;
  justify-content: center;
}
.paper {
  position: relative;
  flex: none;
  background: #fff;
  box-shadow:
    0 2px 6px #23392922,
    0 9px 23px #243a2b12,
    0 0 0 1px #d1d8cf;
  isolation: isolate;
}
.paper img {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-drag: none;
}
.paper #hits {
  position: absolute;
  inset: 0;
}
.hit,
.drag-box {
  position: absolute;
  border: 1px solid transparent;
  min-width: 0;
  min-height: 0;
  border-radius: 1px;
  padding: 0;
  margin: 0;
  line-height: 1;
}
.hit {
  cursor: text;
  background: transparent;
}
.hit:hover {
  border-color: #5b957c;
  background: #68a98f12;
}
.hit.selected {
  border-color: #357e65;
  background: #63aa8610;
  outline: 1px solid #fff3;
}
.hit.selected:before,
.hit.selected:after {
  content: '';
  position: absolute;
  width: 4px;
  height: 4px;
  background: #fff;
  border: 1px solid #357e65;
}
.hit.selected:before {
  left: -3px;
  top: -3px;
}
.hit.selected:after {
  right: -3px;
  bottom: -3px;
}
.hit.pending {
  border: 1px dashed #36785e;
}
.paper[data-mode='add'],
.paper[data-mode='area'] {
  cursor: crosshair;
}
.paper[data-mode='area'] {
  touch-action: none;
}
.paper:not([data-mode='edit']) .hit {
  pointer-events: none;
}
.drag-box {
  background: #4b9d7936;
  border: 1px dashed #245c49;
  pointer-events: none;
}
.tool-hint,
.loading,
.notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 8px;
  font-size: 0.86rem;
  box-shadow: 0 3px 12px #1a38271f;
}
.tool-hint {
  pointer-events: none;
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: #f7faf6ed;
  color: #345b47;
  padding: 7px 13px;
  white-space: nowrap;
  border: 1px solid #c5d4c8;
}
.loading {
  position: absolute;
  inset: 85px auto auto 50%;
  transform: translateX(-50%);
  background: #fff;
  padding: 11px 16px;
  white-space: nowrap;
}
.spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid #c4d5c7;
  border-top-color: var(--green);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.stage-foot {
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 0 15px;
  background: #fafbf8;
  color: #55665b;
}
.pager,
.zoom {
  gap: 3px;
}
.pager span,
#zoom-fit {
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}
.pager span {
  min-width: 65px;
  text-align: center;
}
.zoom {
  gap: 4px;
}
#zoom-fit {
  padding: 4px 5px;
  border-radius: 4px;
  min-width: 46px;
}
.zoom-divider {
  height: 15px;
  width: 1px;
  background: var(--line);
  margin: 0 3px;
}
.inspector {
  border-left: 1px solid var(--line);
}
.inspector-scroll {
  flex: 1;
  overflow: auto;
  scrollbar-width: thin;
}
.settings {
  padding: 23px 20px 22px;
}
.section-heading {
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 22px;
}
h3 {
  font-size: 0.98rem;
  font-weight: 620;
  letter-spacing: 0.025em;
}
.type-tag {
  font-size: 0.75rem;
  background: #edf3ec;
  color: #4e725e;
  padding: 2px 8px;
}
.inspector label,
#password-form label {
  display: block;
  color: #4f6055;
  font-size: 0.84rem;
  font-weight: 540;
  margin-bottom: 7px;
}
textarea,
select,
input[type='number'],
input[type='password'] {
  outline: none;
}
.inspector textarea,
.select-wrap,
.number-wrap,
.color-wrap,
#password {
  border: 1px solid #cfd8d1;
  border-radius: 6px;
  background: #fff;
}
.inspector textarea {
  display: block;
  width: 100%;
  min-height: 80px;
  max-height: 180px;
  resize: vertical;
  padding: 10px 11px;
  color: #2c3933;
  line-height: 1.6;
  font-size: 0.95rem;
  margin-bottom: 16px;
}
.inspector textarea:focus,
.select-wrap:focus-within,
.number-wrap:focus-within,
.color-wrap:focus-within,
#password:focus {
  border-color: #518c70;
  box-shadow: 0 0 0 2px #62997625;
}
.select-wrap,
.number-wrap,
.color-wrap {
  display: flex;
  align-items: center;
  height: 37px;
}
.select-wrap {
  position: relative;
}
.select-wrap i {
  pointer-events: none;
  position: absolute;
  color: #6a796d;
}
.select-wrap i:first-child {
  left: 10px;
}
.select-wrap i:last-child {
  right: 9px;
}
.select-wrap i:last-child svg {
  width: 14px;
}
.select-wrap select {
  background: transparent;
  border: 0;
  appearance: none;
  width: 100%;
  height: 100%;
  padding: 0 32px;
  font-size: 0.88rem;
}
.pair {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 12px;
  margin-top: 15px;
}
.pair > div {
  min-width: 0;
}
.number-wrap input {
  border: 0;
  background: transparent;
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 0 0 9px;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.number-wrap span {
  padding-right: 8px;
  color: #77867a;
  font-size: 0.78rem;
}
.color-wrap {
  padding: 0 7px;
  gap: 6px;
  cursor: pointer;
}
.color-wrap input {
  width: 20px;
  height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}
.color-wrap input::-webkit-color-swatch-wrapper {
  padding: 2px 0;
}
.color-wrap input::-webkit-color-swatch {
  border: 1px solid #20362420;
  border-radius: 3px;
}
.color-wrap span {
  font:
    0.72rem/1.2 ui-monospace,
    SFMono-Regular,
    monospace;
  color: #4c5a51;
}
.swatches {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
}
.swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  padding: 0;
  border: 1px solid #253a2b20;
  background: var(--sample);
  position: relative;
}
.swatch.selected:after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 1px solid #76977d;
  border-radius: 50%;
}
.apply-row {
  gap: 8px;
  margin-top: 21px;
}
.apply-row > .button {
  flex: 1;
}
.trash {
  height: 38px;
  width: 38px;
  border: 1px solid var(--line);
  color: #7c817a;
}
.trash:hover:not(:disabled) {
  color: #a84a3d;
  background: #f9efec;
}
.scan-card {
  display: grid;
  grid-template-columns: 34px 1fr;
  column-gap: 10px;
  margin: 0 16px 25px;
  padding: 15px;
  background: #f2f5ef;
  border: 1px solid #dce6d9;
  border-radius: 9px;
}
.scan-icon {
  align-self: start;
  width: 32px;
  height: 32px;
  justify-content: center;
  background: #e2ecdf;
  border-radius: 7px;
  color: #4e7459;
}
.scan-icon i svg {
  width: 19px;
  height: 19px;
}
.scan-copy h3 {
  font-size: 0.9rem;
  margin: 3px 0 7px;
}
.scan-copy p,
.empty-selection,
.ocr-status,
.help-content p {
  font-size: 0.83rem;
  line-height: 1.65;
  color: #647267;
}
.scan-card > .button {
  grid-column: 1/-1;
  margin-top: 12px;
  height: 34px;
  font-size: 0.83rem;
  color: #365b45;
  background: #fcfdf9;
}
.ocr-status {
  grid-column: 1/-1;
  margin-top: 9px;
}
.local-note {
  justify-content: center;
  gap: 7px;
  min-height: 46px;
  border-top: 1px solid var(--line);
  color: #65786a;
  font-size: 0.8rem;
  background: #fbfcf9;
}
.local-note i svg {
  width: 15px;
  height: 15px;
}
.error {
  font-size: 0.82rem;
  color: #a14532;
  line-height: 1.5;
  margin-top: 9px;
}
.notice {
  position: fixed;
  z-index: 15;
  left: 50%;
  bottom: 59px;
  transform: translateX(-50%);
  padding: 10px 16px;
  background: #283e32;
  color: white;
  width: max-content;
  max-width: min(90vw, 640px);
  text-align: center;
}
.shade {
  position: fixed;
  inset: 0;
  background: #22372b4a;
  z-index: 4;
}
.drop {
  position: fixed;
  inset: 8px;
  z-index: 20;
  display: grid;
  place-items: center;
  background: #e4efe5ee;
  color: #23543d;
  border: 2px dashed #57876d;
  border-radius: 12px;
  pointer-events: none;
}
.drop > div {
  display: grid;
  justify-items: center;
  gap: 12px;
}
.drop svg {
  width: 40px !important;
  height: 40px !important;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 23px;
  width: min(92vw, 435px);
  color: var(--ink);
  box-shadow: 0 15px 70px #142e2840;
}
dialog::backdrop {
  background: #18332c55;
}
dialog h2 {
  font-size: 1.13rem;
}
.dialog-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.help-content p,
dialog > p {
  margin: 13px 0;
}
.help-content strong {
  color: var(--ink);
}
.key-row {
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 9px 0;
  font-size: 0.82rem;
}
kbd {
  font:
    0.78rem ui-monospace,
    monospace;
  color: #48604b;
  background: #edf1ea;
  padding: 3px 6px;
  border-radius: 4px;
}
.help-content details {
  padding-top: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}
.help-content a {
  color: var(--green);
}
#password {
  padding: 9px 10px;
  width: 100%;
}
#password-form label {
  margin-top: 16px;
}
.dialog-actions {
  justify-content: flex-end;
  gap: 8px;
  margin-top: 19px;
}
.dialog-actions .button {
  padding: 0 12px;
}
[hidden] {
  display: none !important;
}
@media (min-width: 1550px) {
  :root {
    --side: 210px;
    --right: 306px;
  }
  .thumb-frame {
    width: 110px;
  }
  .settings {
    padding: 25px;
  }
  .scan-card {
    margin: 0 21px 25px;
  }
}
@media (max-width: 1140px) {
  :root {
    --side: 147px;
    --right: 254px;
  }
  .side-title {
    padding: 0 15px;
  }
  .pages nav {
    padding: 14px 8px;
  }
  .settings {
    padding: 19px 15px;
  }
  .scan-card {
    margin: 0 11px 19px;
    padding: 12px;
  }
  .file-bar {
    padding: 0 15px;
  }
  .paper-position {
    padding-left: 20px;
    padding-right: 20px;
  }
  .pair {
    gap: 8px;
  }
  .tool {
    padding: 6px 9px;
  }
}
@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) var(--right);
  }
  .pages {
    display: none;
  }
  .pages-toggle {
    display: flex;
  }
  .pages.open {
    display: flex;
    position: fixed;
    z-index: 5;
    top: 0;
    left: 0;
    bottom: 0;
    width: 190px;
    box-shadow: 4px 0 18px #17322124;
  }
  .side.open .mobile-close {
    display: flex;
  }
  .pages.open .thumb-frame {
    width: 106px;
  }
}
@media (max-width: 680px) {
  .app-head {
    height: 56px;
    padding: 0 12px;
  }
  .brand {
    gap: 6px;
  }
  .brand img {
    width: 31px;
    height: 31px;
  }
  .brand strong {
    font-size: 1.2rem;
  }
  .brand > i,
  .brand > span {
    display: none;
  }
  .head-actions {
    gap: 6px;
  }
  .head-actions .button {
    font-size: 0.82rem;
    height: 34px;
    padding: 0 10px;
    gap: 5px;
  }
  .head-actions i svg {
    width: 15px;
  }
  .layout {
    height: calc(100dvh - 56px);
    grid-template-columns: minmax(0, 1fr);
  }
  .inspector {
    display: none;
  }
  .inspector.open {
    display: flex;
    position: fixed;
    z-index: 5;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(85vw, 310px);
    box-shadow: -4px 0 18px #17322124;
  }
  .inspector-toggle {
    display: flex;
  }
  .workspace {
    grid-template-rows: 48px minmax(0, 1fr) 42px;
  }
  .file-bar {
    padding: 0 8px;
  }
  .file-name {
    gap: 6px;
  }
  .file-name h1 {
    font-size: 0.88rem;
  }
  .file-icon {
    display: none;
  }
  .tools-position {
    padding: 9px 4px;
  }
  .tools {
    padding: 3px;
  }
  .tool {
    padding: 5px 8px;
    font-size: 0.79rem;
    gap: 4px;
  }
  .tool i svg {
    width: 14px;
  }
  .paper-position {
    padding: 3px 12px 24px;
  }
  .stage-foot {
    padding: 0 8px;
  }
  .tool-hint {
    font-size: 0.76rem;
    white-space: normal;
    text-align: center;
    width: max-content;
    max-width: 92%;
  }
  .side-title {
    min-height: 51px;
    height: 51px;
  }
  .notice {
    bottom: 49px;
  }
  .dialog-actions {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.01ms !important;
    transition: none !important;
  }
}

#properties[data-object-text='true'] :is(label[for='font'], .select-wrap, .pair, .swatches) {
  display: none;
}
