/* Dialogs */

dialog {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  max-width: none;
  max-height: none;
}

dialog::backdrop {
  background: rgba(14, 20, 16, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

dialog[open] {
  animation: dialogFade 220ms ease;
}

dialog[open] .modal-card {
  animation: modalRise 420ms var(--ease-out) both;
}

@keyframes dialogFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalRise {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: auto;
}

.modal[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-card {
  display: flex;
  flex-direction: column;
  width: min(760px, calc(100vw - 48px));
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  border: 1px solid rgba(24, 35, 30, 0.22);
  background: var(--paper);
  box-shadow: 0 40px 100px -26px rgba(6, 12, 8, 0.65);
  color: var(--ink);
}

.import-card {
  width: min(980px, calc(100vw - 48px));
}

.modal-small .modal-card {
  width: min(490px, calc(100vw - 36px));
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex: none;
  padding: 29px 34px 23px;
  border-bottom: 1px solid var(--line);
}

.modal-head.compact {
  padding: 26px 29px 21px;
}

.modal-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
}

.modal-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 35px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.18;
}

.modal-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 37px;
  height: 37px;
  margin-top: 1px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.modal-close:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: rgba(24, 35, 30, 0.035);
}

.import-views {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.import-view {
  padding: 32px 34px;
}

.import-view-initial {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.75fr);
  gap: clamp(28px, 4vw, 48px);
}

/* Drop zone */

.drop-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  padding: 30px;
  border: 1px dashed rgba(24, 35, 30, 0.32);
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 255, 255, 0.72), transparent 55%),
    rgba(250, 247, 240, 0.48);
  text-align: center;
  cursor: pointer;
  transition: background-color 220ms ease, border-color 220ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--accent);
  background-color: rgba(250, 247, 240, 0.8);
}

.drop-zone.is-dragging {
  box-shadow: inset 0 0 0 1px rgba(184, 75, 49, 0.3);
}

.drop-corner {
  position: absolute;
  width: 13px;
  height: 13px;
  border-color: var(--accent);
  border-style: solid;
  opacity: 0.55;
}

.drop-corner-tl { top: 9px; left: 9px; border-width: 1px 0 0 1px; }
.drop-corner-tr { top: 9px; right: 9px; border-width: 1px 1px 0 0; }
.drop-corner-bl { bottom: 9px; left: 9px; border-width: 0 0 1px 1px; }
.drop-corner-br { bottom: 9px; right: 9px; border-width: 0 1px 1px 0; }

.drop-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 96px;
  margin-bottom: 22px;
  border: 1px solid var(--line-strong);
  background: var(--paper-hi);
  color: var(--ink);
  font-size: 33px;
  box-shadow: 6px 6px 0 rgba(24, 35, 30, 0.06);
  transition: transform 300ms var(--ease-out);
}

.drop-zone:hover .drop-icon {
  transform: translateY(-4px) rotate(-1deg);
}

.drop-icon i {
  position: absolute;
  right: -12px;
  bottom: -12px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--paper-hi);
  font-family: var(--sans);
  font-size: 19px;
  font-style: normal;
}

.drop-zone h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.drop-zone p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.drop-zone p span {
  padding-bottom: 2px;
  border-bottom: 1px solid var(--accent);
  color: var(--accent);
}

.drop-zone small {
  margin-top: 18px;
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.02em;
}

/* Import side panel */

.import-aside {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 8px 0 0;
}

.aside-label {
  margin: 0 0 19px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
}

.import-steps {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.import-steps li {
  display: flex;
  gap: 15px;
}

.import-steps li > span {
  flex: none;
  padding-top: 1px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.07em;
}

.import-steps strong {
  display: block;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
}

.import-steps p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.sample-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: auto;
  padding: 16px 0 2px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.03em;
  text-align: left;
  transition: color 180ms ease;
}

.sample-button:hover {
  color: var(--accent);
}

/* Inspect / error states */

.import-view-inspecting,
.import-view-error {
  display: grid;
  place-items: center;
  min-height: 390px;
}

.inspecting-state,
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 390px;
  text-align: center;
}

.document-pulse {
  position: relative;
  display: grid;
  place-items: center;
  width: 77px;
  height: 98px;
  margin-bottom: 28px;
  border: 1px solid var(--line-strong);
  background: var(--paper-hi);
  color: var(--accent);
  font-size: 33px;
}

.document-pulse i {
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(184, 75, 49, 0.25);
  animation: pulseFrame 1.8s ease-out infinite;
}

@keyframes pulseFrame {
  0% { opacity: 0.7; transform: scale(0.94); }
  80%, 100% { opacity: 0; transform: scale(1.1); }
}

.inspecting-state h3,
.error-state h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
}

.inspecting-state > p:last-of-type,
.error-state > p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.indeterminate-line {
  position: relative;
  width: 170px;
  height: 1px;
  margin-top: 25px;
  overflow: hidden;
  background: var(--line);
}

.indeterminate-line::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 42%;
  height: 1px;
  background: var(--accent);
  animation: indeterminate 1.4s ease-in-out infinite;
}

@keyframes indeterminate {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(340%); }
}

.error-mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 24px;
  border: 1px solid rgba(184, 75, 49, 0.4);
  border-radius: 50%;
  color: var(--accent);
  font-size: 26px;
}

.error-state .btn {
  margin-top: 27px;
}

/* Ready */

.import-view-ready {
  display: grid;
  grid-template-columns: minmax(200px, 0.68fr) minmax(0, 1.32fr);
  gap: clamp(35px, 5vw, 66px);
  min-height: 420px;
  padding-top: 35px;
  padding-bottom: 38px;
}

.ready-cover-wrap,
.processing-cover-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ready-cover {
  position: relative;
  width: min(100%, 236px);
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 1px solid rgba(24, 35, 30, 0.24);
  background: var(--paper-deep);
  box-shadow:
    9px 9px 0 -1px #ded6c8,
    9px 9px 0 0 rgba(24, 35, 30, 0.18),
    0 26px 36px -25px rgba(24, 35, 30, 0.52);
  transform: rotate(-1.4deg);
}

.ready-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ready-cover-tape {
  position: absolute;
  top: -9px;
  left: 50%;
  width: 61px;
  height: 18px;
  background: rgba(230, 218, 192, 0.74);
  border: 1px solid rgba(24, 35, 30, 0.055);
  transform: translateX(-50%) rotate(1.3deg);
  mix-blend-mode: multiply;
}

.cover-caption {
  margin: 24px 0 0;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.12em;
}

.cover-caption span {
  color: var(--accent);
}

.import-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.form-kicker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.form-kicker-row .modal-kicker {
  margin: 0;
}

.ready-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #557763;
  font-size: 9px;
}

.ready-dot i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #557763;
  box-shadow: 0 0 0 3px rgba(85, 119, 99, 0.1);
}

.import-form h3 {
  margin: 11px 0 25px;
  font-family: var(--serif);
  font-size: clamp(27px, 3vw, 36px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field > span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.field input {
  width: 100%;
  padding: 8px 0 11px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(22px, 2.3vw, 29px);
  font-weight: 500;
  letter-spacing: -0.015em;
  transition: border-color 180ms ease;
}

.field input:focus {
  border-color: var(--accent);
}

.file-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: rgba(250, 247, 240, 0.55);
}

.file-summary-icon {
  color: var(--accent);
  font-size: 25px;
}

.file-summary-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.file-summary-main strong {
  overflow: hidden;
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-summary-main span {
  margin-top: 1px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.07em;
}

.import-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 18px;
  margin-top: 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.import-facts span + span::before {
  content: "·";
  margin-right: 18px;
  color: var(--faint);
}

.import-facts strong {
  color: var(--ink-soft);
  font-weight: 600;
}

.form-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 19px 0 0;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.7;
}

.form-note [data-icon] {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

/* Processing */

.import-view-processing {
  display: grid;
  grid-template-columns: minmax(180px, 0.65fr) minmax(0, 1.35fr);
  gap: clamp(35px, 5vw, 66px);
  min-height: 430px;
  align-items: center;
  padding-top: 38px;
  padding-bottom: 40px;
}

.processing-cover-wrap {
  position: relative;
}

.processing-cover {
  position: relative;
  width: min(100%, 218px);
  aspect-ratio: 3 / 4;
  background: var(--paper-deep);
  border: 1px solid rgba(24, 35, 30, 0.22);
  box-shadow:
    8px 8px 0 -1px #ded6c8,
    8px 8px 0 0 rgba(24, 35, 30, 0.15),
    0 25px 36px -25px rgba(24, 35, 30, 0.5);
}

.processing-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
}

.processing-badge {
  position: absolute;
  right: -11px;
  bottom: 17px;
  padding: 8px 12px;
  background: var(--accent);
  color: var(--paper-hi);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  box-shadow: 0 8px 18px rgba(88, 34, 21, 0.2);
  animation: badgeFloat 2.4s ease-in-out infinite;
}

@keyframes badgeFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.processing-info {
  max-width: 460px;
}

.processing-info h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(29px, 3.2vw, 38px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.16;
}

.processing-info > p:nth-of-type(1) {
  margin: 8px 0 30px;
  color: var(--muted);
  font-size: 11px;
}

.progress-readout {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 11px;
}

.progress-readout strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 39px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}

.progress-readout strong small {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.progress-readout > span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.progress-track {
  height: 2px;
  overflow: hidden;
  background: rgba(24, 35, 30, 0.13);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 350ms var(--ease-out);
}

.processing-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 19px;
  margin-top: 18px;
  color: var(--faint);
  font-size: 9px;
}

.processing-checklist span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 200ms ease;
}

.processing-checklist i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
}

.processing-checklist .is-active {
  color: var(--accent);
}

.processing-checklist .is-active i {
  opacity: 1;
  animation: dotPulse 1s ease infinite;
}

.processing-checklist .is-done {
  color: #557763;
}

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(184, 75, 49, 0.3); }
  50% { box-shadow: 0 0 0 4px rgba(184, 75, 49, 0); }
}

/* Footer + small modals */

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex: none;
  padding: 16px 34px;
  border-top: 1px solid var(--line);
  background: rgba(232, 225, 213, 0.35);
}

.modal-footer-note {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.07em;
}

.modal-footer-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}

.modal-footer .btn {
  min-height: 42px;
  font-size: 11px;
}

.modal-footer.inline {
  padding: 0;
  border-top: 0;
  background: transparent;
  justify-content: flex-end;
}

.modal-simple-body {
  padding: 26px 29px 28px;
  overflow-y: auto;
}

.confirm-copy {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.95;
}

.confirm-copy strong {
  color: var(--ink);
  font-weight: 500;
}

.modal-simple-body .modal-footer {
  margin-top: 28px;
}

/* Shared library */

.shared-body {
  padding: 27px 29px 29px;
}

.shared-loading {
  margin: 0;
  padding: 30px 0 22px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 17px;
  text-align: center;
}

.shared-intro {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 25px;
}

.shared-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(250, 247, 240, 0.55);
  color: var(--accent);
}

.shared-mark [data-icon] {
  font-size: 16px;
}

.shared-mark.is-error {
  color: var(--accent-deep);
  border-color: rgba(184, 75, 49, 0.28);
  background: rgba(184, 75, 49, 0.06);
}

.shared-intro h3 {
  margin: 1px 0 7px;
  font-family: var(--serif);
  font-size: clamp(22px, 2.6vw, 27px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.shared-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.85;
}

.shared-form {
  display: grid;
  gap: 18px;
}

.shared-form .field input {
  padding: 7px 0 10px;
  font-family: var(--sans);
  font-size: 17px;
  letter-spacing: 0.08em;
}

.shared-error {
  margin: -4px 0 0;
  color: var(--accent-deep);
  font-size: 10px;
  line-height: 1.7;
}

.shared-form .modal-footer {
  margin-top: 7px;
}

.shared-connected {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid rgba(85, 119, 99, 0.22);
  background: rgba(85, 119, 99, 0.055);
  color: #4c6f59;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.shared-connected i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #66836e;
  box-shadow: 0 0 0 4px rgba(102, 131, 110, 0.1);
}

.shared-copy {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.9;
}

.shared-last {
  margin: 13px 0 0;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.07em;
}

.shared-account-actions {
  display: flex;
  gap: 9px;
  margin-top: 24px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}

.shared-account-actions .btn {
  flex: 1;
  min-height: 42px;
  font-size: 10px;
}

/* Search */

.modal-search {
  align-items: flex-start !important;
  padding-top: 9vh !important;
}

.modal-search .modal-card {
  width: min(650px, calc(100vw - 36px));
}

.search-dialog-body {
  padding: 23px 29px 29px;
}

.search-dialog-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 2px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--muted);
}

.search-dialog-field input {
  width: 100%;
  padding: 12px 0;
  border: 0;
  outline: none;
  background: transparent;
  font-family: var(--serif);
  font-size: 21px;
}

/* 浏览器自带的清除按钮是系统蓝色，和纸感配色冲突，换成同一套的细十字 */
.search-dialog-field input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-left: 8px;
  background: center / 13px 13px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23887f6d' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M5 5l14 14M19 5L5 19'/%3E%3C/svg%3E");
  cursor: pointer;
}

.search-results {
  max-height: min(55vh, 470px);
  overflow-y: auto;
  margin-top: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.search-empty {
  margin: 0;
  padding: 35px 10px;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.8;
  text-align: center;
}

.search-result {
  display: flex;
  gap: 16px;
  width: 100%;
  padding: 15px 2px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.search-result:last-child {
  border-bottom: 1px solid var(--line);
}

.search-result:hover {
  background: rgba(250, 247, 240, 0.58);
}

.search-result-page {
  flex: none;
  width: 52px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.search-result-text {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.search-result-text mark {
  padding: 0 2px;
  background: var(--accent-soft);
  color: var(--ink);
}

/* Zoom */

.zoom-dialog {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #0e1310;
  color: var(--reader-ink);
}

.zoom-dialog[open] {
  display: flex;
  animation: fadeIn 200ms ease;
}

.zoom-dialog::backdrop {
  background: #0e1310;
}

.zoom-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
}

.zoom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  flex: none;
  padding: 16px clamp(18px, 3vw, 40px);
  border-bottom: 1px solid rgba(241, 237, 227, 0.1);
  background: rgba(14, 19, 16, 0.85);
}

.zoom-bar h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}

.zoom-bar .modal-kicker {
  margin-bottom: 3px;
}

.zoom-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zoom-tools > span {
  min-width: 45px;
  color: rgba(241, 237, 227, 0.48);
  font-family: var(--mono);
  font-size: 8px;
  text-align: center;
}

.zoom-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(241, 237, 227, 0.14);
  border-radius: 50%;
  background: transparent;
  color: rgba(241, 237, 227, 0.68);
  font-size: 16px;
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.zoom-button:hover {
  color: var(--reader-ink);
  border-color: rgba(241, 237, 227, 0.3);
  background: rgba(241, 237, 227, 0.06);
}

.zoom-button.close {
  margin-left: 8px;
}

.zoom-viewport {
  flex: 1;
  overflow: auto;
  padding: 32px;
  scrollbar-width: thin;
  scrollbar-color: rgba(241, 237, 227, 0.2) transparent;
}

.zoom-viewport img {
  display: block;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.48);
  -webkit-user-drag: none;
}

.zoom-note {
  flex: none;
  margin: 0;
  padding: 12px;
  border-top: 1px solid rgba(241, 237, 227, 0.08);
  color: rgba(241, 237, 227, 0.27);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  text-align: center;
}

/* Toasts */

.toast-root {
  position: fixed;
  bottom: 28px;
  left: 50%;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(460px, calc(100vw - 32px));
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(20, 30, 24, 0.94);
  color: #f5f1e8;
  box-shadow: 0 16px 38px -16px rgba(7, 12, 8, 0.7);
  font-size: 11px;
  letter-spacing: 0.02em;
  backdrop-filter: blur(10px);
  animation: toastIn 300ms var(--ease-out) both;
}

.toast.is-leaving {
  animation: toastOut 220ms ease both;
}

.toast [data-icon] {
  color: #a8c0ad;
  font-size: 15px;
}

.toast.is-error [data-icon] {
  color: #df8b78;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px) scale(0.98); }
}

.modal-close:disabled,
.modal-close[hidden] {
  pointer-events: none;
}

.modal-close:disabled {
  opacity: 0.35;
}

.import-footer .btn:disabled {
  cursor: wait;
  opacity: 0.55;
}

/* 超链接弹窗：URL 是长串，字号收小一点，别撑破小弹窗 */
.link-modal .modal-simple-body .field + .field {
  margin-top: 18px;
}

.link-modal .field input {
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0;
}

.link-modal .field input::placeholder {
  color: var(--faint);
}

.link-error {
  margin: 14px 0 0;
  color: var(--accent-deep);
  font-size: 10px;
  line-height: 1.7;
}

.link-note {
  margin: 16px 0 0;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.8;
}

.link-modal .modal-footer {
  margin-top: 22px;
}

.link-modal .modal-footer .btn-ghost:first-child {
  margin-right: auto;
}
