/* =========================================================
   发票工坊 · 样式表
   色彩：墨黑底 + 米白字 + 朱砂红强调 + 纸张米辅
   字体：思源宋体 (display) + 思源黑体 (body) + JetBrains Mono
   ========================================================= */

:root {
  --ink-0:   #0A0A0C;
  --ink-1:   #0F0F12;
  --ink-2:   #16161A;
  --ink-3:   #1E1E24;
  --ink-4:   #2A2A32;
  --line:    #2F2F38;
  --line-2:  #3A3A44;
  --paper:   #F5F1E8;
  --paper-2: #E8E0CC;
  --paper-3: #D8CFB7;
  --text:    #F5F1E8;
  --text-2:  #B5B0A4;
  --text-3:  #7A766C;
  --accent:  #C8462E;
  --accent-2:#E85F44;
  --accent-soft: #B53E27;
  --shadow-lg: 0 24px 48px -16px rgba(0,0,0,.55), 0 4px 12px rgba(0,0,0,.25);
  --shadow-md: 0 8px 24px -8px rgba(0,0,0,.4);
  --shadow-sm: 0 2px 6px rgba(0,0,0,.25);
  --radius:  10px;
  --radius-sm: 6px;
  --font-display: "Noto Serif SC", "Songti SC", "STSong", serif;
  --font-body:    "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", Consolas, monospace;
  --left-w: 360px;
  --appbar-h: 56px;
  --action-h: 64px;
}

/* 亮色主题 */
body.theme-light {
  --ink-0:   #F2F0EB;
  --ink-1:   #FFFFFF;
  --ink-2:   #FAFAF7;
  --ink-3:   #F0EEE9;
  --ink-4:   #E0DED8;
  --line:    #E5E3DE;
  --line-2:  #D5D3CD;
  --paper:   #1A1A1A;
  --paper-2: #2A2A2A;
  --paper-3: #3A3A3A;
  --text:    #1A1A1A;
  --text-2:  #4A4A4A;
  --text-3:  #8A8A8A;
  --accent:  #C8462E;
  --accent-2:#B83A22;
  --accent-soft: #A83418;
  --shadow-lg: 0 24px 48px -16px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.08);
  --shadow-md: 0 8px 24px -8px rgba(0,0,0,.1);
  --shadow-sm: 0 2px 6px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }
*::selection { background: var(--accent); color: #fff; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--ink-0);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

body {
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(200,70,46,.06), transparent 60%),
    radial-gradient(900px 600px at 100% 100%, rgba(200,70,46,.05), transparent 60%),
    var(--ink-0);
}

/* 主题图标切换 */
.theme-icon--sun { display: none; }
.theme-icon--moon { display: block; }
body.theme-light .theme-icon--sun { display: block; }
body.theme-light .theme-icon--moon { display: none; }

button { font-family: inherit; cursor: pointer; }
input, select, button { font-family: inherit; font-size: inherit; }
kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 6px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--ink-3);
  color: var(--text-2);
}

/* ============== 顶部标题栏 ============== */
.appbar {
  height: var(--appbar-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent), var(--ink-1);
  position: relative;
  z-index: 5;
}

.appbar__left { display: flex; align-items: center; gap: 12px; }
.appbar__center { display: flex; justify-content: center; }
.appbar__right { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }

.logo {
  display: flex; align-items: baseline; gap: 8px;
  color: var(--text);
}
.logo__text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: .12em;
}
.logo__sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.appbar__hint {
  color: var(--text-3);
  font-size: 12px;
  letter-spacing: .04em;
}
.appbar__count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  padding: 4px 10px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--ink-2);
}

.iconbtn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  transition: all .15s ease;
}
.iconbtn:hover { color: var(--text); background: var(--ink-3); border-color: var(--line-2); }
.iconbtn:active { transform: scale(.96); }

/* ============== 主体三栏 ============== */
.workspace {
  height: calc(100vh - var(--appbar-h) - var(--action-h));
  display: grid;
  grid-template-columns: var(--left-w) 1fr;
  overflow: hidden;
}

/* ============== 左侧面板 ============== */
.panel--left {
  background: var(--ink-1);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}
.panel--left::-webkit-scrollbar { width: 8px; }
.panel--left::-webkit-scrollbar-thumb { background: var(--ink-4); border-radius: 4px; }
.panel--left::-webkit-scrollbar-track { background: transparent; }

/* 上传区 */
.dropzone {
  margin: 18px 18px 8px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(200,70,46,.03), transparent),
    var(--ink-2);
  transition: all .2s ease;
  position: relative;
}
.dropzone.is-drag {
  border-color: var(--accent);
  background: rgba(200,70,46,.06);
  transform: scale(1.005);
}
.dropzone__inner {
  padding: 28px 16px 22px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.dropzone__icon {
  color: var(--text-3);
  margin-bottom: 10px;
  transition: color .2s ease;
}
.dropzone.is-drag .dropzone__icon { color: var(--accent); }
.dropzone__title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text);
}
.dropzone__hint {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--text-3);
}
.dropzone__btn {
  padding: 8px 18px;
  background: var(--ink-3);
  color: var(--text);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: .06em;
  transition: all .15s ease;
}
.dropzone__btn:hover { border-color: var(--accent); color: var(--accent-2); }

/* 设置 */
.settings {
  margin: 12px 18px 8px;
  padding: 16px 14px 14px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.section-title {
  margin: 0 0 12px;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.section-title svg { color: var(--accent); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 10px;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field--full { grid-column: 1 / -1; }
.field__label {
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--ink-3);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 13px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%238A8A8A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><polyline points='1 1 6 6 11 1'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 7px;
  padding-right: 28px;
  transition: border-color .15s;
}
.select:hover, .select:focus { border-color: var(--accent); outline: none; }

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}
.seg--3 { grid-template-columns: 1fr 1fr 1fr; }
.seg__btn {
  background: transparent;
  border: 0;
  color: var(--text-2);
  padding: 6px 4px;
  font-size: 12px;
  border-radius: 4px;
  letter-spacing: .04em;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  transition: all .15s ease;
}
.seg__btn:hover { color: var(--text); }
.seg__btn.is-active {
  background: var(--ink-1);
  color: var(--accent-2);
  box-shadow: var(--shadow-sm);
}

.range {
  display: grid;
  grid-template-columns: 1fr 32px;
  align-items: center;
  gap: 8px;
}
.range input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  width: 100%;
  height: 24px;
}
.range input[type=range]::-webkit-slider-runnable-track {
  height: 4px; background: var(--ink-3); border-radius: 999px;
}
.range input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px; height: 14px;
  background: var(--accent);
  border-radius: 50%;
  margin-top: -5px;
  box-shadow: 0 0 0 3px rgba(200,70,46,.15);
  cursor: pointer;
}
.range__val {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  background: var(--ink-3);
  border-radius: 4px;
  padding: 3px 0;
}

.stepper {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.stepper__btn {
  background: transparent; border: 0; color: var(--text-2);
  font-size: 16px; line-height: 1;
  transition: all .15s;
}
.stepper__btn:hover { color: var(--accent-2); background: var(--ink-2); }
.stepper input {
  background: transparent; border: 0; color: var(--text);
  text-align: center; font-family: var(--font-mono);
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.linkbtn {
  margin-top: 12px;
  background: transparent; border: 0; padding: 0;
  color: var(--text-3);
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
  letter-spacing: .04em;
  transition: color .15s;
}
.linkbtn:hover { color: var(--accent-2); }

/* 缩略图 */
.thumbs-section {
  margin: 8px 18px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 160px;
}
.thumbs-section__count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  background: var(--ink-3);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.thumbs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  overflow-y: auto;
  max-height: 360px;
  padding-right: 4px;
}
.thumbs::-webkit-scrollbar { width: 6px; }
.thumbs::-webkit-scrollbar-thumb { background: var(--ink-4); border-radius: 3px; }
.thumbs__empty {
  text-align: center;
  padding: 30px 0;
  color: var(--text-3);
}
.thumbs__empty p { margin: 4px 0; font-size: 12px; }
.thumbs__empty-hint { font-size: 11px; opacity: .7; }

.thumb {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: all .2s ease;
  animation: thumbIn .35s cubic-bezier(.2,.7,.3,1.2) both;
}
@keyframes thumbIn {
  from { opacity: 0; transform: translateY(6px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.thumb:hover { border-color: var(--line-2); background: var(--ink-3); }
.thumb__index {
  position: absolute;
  top: -6px; left: -6px;
  width: 20px; height: 20px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--ink-1);
  z-index: 1;
}
.thumb__img {
  width: 44px; height: 44px;
  object-fit: cover;
  background: #fff;
  border-radius: 4px;
  display: block;
}
.thumb__meta { min-width: 0; }
.thumb__name {
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.thumb__sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  display: flex; gap: 6px; margin-top: 2px;
}
.thumb__sub b { color: var(--text-2); font-weight: 500; }
.thumb__actions {
  display: flex; gap: 2px;
}
.thumb__btn {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0;
  color: var(--text-3);
  border-radius: 4px;
  transition: all .15s;
}
.thumb__btn:hover { color: var(--accent-2); background: var(--ink-2); }
.thumb__btn.danger:hover { color: #ff6b6b; }

/* ============== 中间预览舞台 ============== */
.stage {
  position: relative;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 2px, transparent 2px 8px),
    var(--ink-0);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.stage__toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--ink-1);
  z-index: 2;
}
.stage__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .12em;
  margin-right: 10px;
}
.stage__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: .04em;
}
.stage__zoom {
  display: flex; align-items: center; gap: 4px;
}
.stage__zoom span {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  min-width: 36px;
  text-align: center;
}

.stage__viewport {
  flex: 1;
  overflow: auto;
  padding: 32px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.stage__viewport::-webkit-scrollbar { width: 10px; height: 10px; }
.stage__viewport::-webkit-scrollbar-thumb { background: var(--ink-4); border-radius: 5px; }
.stage__viewport::-webkit-scrollbar-track { background: transparent; }

.stage__pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  transform-origin: top center;
  transition: transform .2s ease;
}

.page {
  background: #fff;
  position: relative;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: pageIn .4s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.page__index {
  position: absolute;
  top: -22px; left: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--text-3);
  text-transform: uppercase;
}
.page__index::before {
  content: "—";
  margin-right: 6px;
  color: var(--accent);
}

.page__slot {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.page__img {
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
}

/* ============== 底部操作栏 ============== */
.actionbar {
  height: var(--action-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  border-top: 1px solid var(--line);
  background: var(--ink-1);
  position: relative;
  z-index: 5;
}
.actionbar__left, .actionbar__right { display: flex; align-items: center; gap: 12px; }
.actionbar__stat {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: .04em;
}

.ghostbtn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  font-size: 13px;
  letter-spacing: .04em;
  transition: all .15s ease;
}
.ghostbtn:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--text-2);
}
.ghostbtn:disabled { opacity: .35; cursor: not-allowed; }

.primarybtn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 22px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .12em;
  font-family: var(--font-display);
  transition: all .15s ease;
  box-shadow: 0 4px 12px -2px rgba(200,70,46,.4);
}
.primarybtn:hover:not(:disabled) {
  background: var(--accent-2);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -2px rgba(200,70,46,.55);
}
.primarybtn:active { transform: translateY(0); }
.primarybtn:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }

/* ============== 弹层 ============== */
.modal {
  position: fixed; inset: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.modal[hidden] { display: none; }
.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  animation: fadeIn .2s ease;
}
.modal__panel {
  position: relative;
  background: var(--ink-1);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  max-width: 480px;
  width: calc(100% - 40px);
  box-shadow: var(--shadow-lg);
  animation: panelIn .3s cubic-bezier(.2,.7,.3,1.2);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes panelIn {
  from { opacity: 0; transform: scale(.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.modal__head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .12em;
}
.modal__body {
  padding: 18px 22px 22px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.8;
}
.modal__body ol { padding-left: 18px; margin: 0 0 14px; }
.modal__body li { margin-bottom: 6px; }
.modal__body strong { color: var(--text); font-weight: 600; }
.modal__tip {
  margin: 14px 0 0;
  padding: 10px 12px;
  background: var(--ink-2);
  border-left: 2px solid var(--accent);
  font-size: 12px;
  color: var(--text-2);
  border-radius: 4px;
}

/* ============== PDF 导入弹层 ============== */
.modal--pdf { z-index: 200; }
.modal__panel--wide {
  max-width: 880px;
  width: calc(100% - 40px);
  height: min(82vh, 720px);
  display: flex;
  flex-direction: column;
}
.modal__head-left { display: flex; flex-direction: column; gap: 2px; }
.modal__sub {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: .04em;
}
.modal__toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--ink-2);
}
.modal__toolbar-left { display: flex; gap: 6px; }
.modal__toolbar-right { display: flex; align-items: center; gap: 12px; }
.modal__count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
}

.chipbtn {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--text-2);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: .04em;
  transition: all .15s;
}
.chipbtn:hover { color: var(--text); border-color: var(--text-2); }
.chipbtn.is-active {
  color: var(--accent-2);
  border-color: var(--accent);
  background: rgba(200,70,46,.08);
}

.modal__body--scroll {
  flex: 1;
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.modal__foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--ink-2);
}

.pdf-pages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  align-content: flex-start;
}
.pdf-pages::-webkit-scrollbar { width: 10px; }
.pdf-pages::-webkit-scrollbar-thumb { background: var(--ink-4); border-radius: 5px; }
.pdf-pages::-webkit-scrollbar-track { background: transparent; }

.pdf-pages__loading {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 0;
  color: var(--text-3);
  gap: 12px;
}
.pdf-pages__loading p { margin: 0; font-size: 13px; }
.pdf-pages__error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--accent-2);
  font-size: 13px;
}

.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--line-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pdf-page {
  position: relative;
  background: var(--ink-2);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: all .15s ease;
  animation: thumbIn .3s cubic-bezier(.2,.7,.3,1.2) both;
}
.pdf-page:hover { border-color: var(--line-2); }
.pdf-page.is-selected {
  border-color: var(--accent);
  background: rgba(200,70,46,.06);
}
.pdf-page__canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  pointer-events: none;
}
.pdf-page__check {
  position: absolute;
  top: 8px; right: 8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--ink-1);
  border: 2px solid var(--line-2);
  display: flex; align-items: center; justify-content: center;
  color: transparent;
  transition: all .15s;
}
.pdf-page.is-selected .pdf-page__check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.pdf-page__index {
  position: absolute;
  bottom: 6px; left: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text);
  background: rgba(0,0,0,.65);
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: .04em;
}

/* ============== 打印容器（屏幕不可见） ============== */
.print-area {
  position: absolute;
  left: -99999px;
  top: 0;
}

/* ============== 打印样式 ============== */
@page {
  size: var(--print-paper, A4);
  margin: 0;
}

@media print {
  html, body {
    background: #fff !important;
    color: #000;
    overflow: visible !important;
    height: auto !important;
  }
  .appbar, .panel--left, .stage, .actionbar, .modal { display: none !important; }
  .workspace { display: block !important; height: auto !important; }
  .print-area {
    position: static !important;
    left: 0 !important;
  }
  .print-page {
    width: var(--print-w, 210mm);
    height: var(--print-h, 297mm);
    page-break-after: always;
    break-after: page;
    position: relative;
    overflow: hidden;
    background: #fff;
  }
  .print-page:last-child { page-break-after: auto; break-after: auto; }
  .print-slot {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
  .print-slot img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
  }
}

/* ============== 响应式 ============== */
@media (max-width: 1100px) {
  :root { --left-w: 320px; }
  .appbar__hint { display: none; }
}
@media (max-width: 900px) {
  .workspace { grid-template-columns: 280px 1fr; }
  .appbar__center { display: none; }
}
