:root {
  --blue: #0b63f6;
  --blue-dark: #0850c9;
  --blue-soft: #e8f0ff;
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #14161a;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --line: #ebedf0;
  --green: #12a150;
  --green-soft: #e7f7ee;
  --red: #e5484d;
  --red-soft: #fdecec;
  --amber: #f59e0b;
  --amber-soft: #fff5e5;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 18px rgba(16, 24, 40, .06);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}
body { font-size: 16px; line-height: 1.5; }

.screen { min-height: 100vh; min-height: 100dvh; }
.hidden { display: none !important; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
h1, h2, h3, p { margin: 0; }

/* ---------------- 登录 ---------------- */
.login-screen {
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--safe-top) + 24px) 26px calc(var(--safe-bottom) + 24px);
  background: linear-gradient(170deg, #eef3ff 0%, #f7f8fa 45%, #f4f5f7 100%);
}
.login-inner { width: 100%; max-width: 360px; text-align: center; }
.app-logo {
  width: 80px; height: 80px; margin: 0 auto 20px;
  background: #fff; border-radius: 24px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 28px rgba(11, 99, 246, .16);
}
.app-logo svg { width: 48px; height: 48px; }
.login-title { font-size: 28px; font-weight: 700; letter-spacing: -.5px; }
.login-sub { color: var(--text-2); font-size: 14.5px; margin-top: 8px; }

.pin-box { margin: 30px 0 10px; }
.pin-box input {
  width: 100%; height: 60px; border-radius: 16px;
  border: 1.5px solid var(--line); background: #fff;
  text-align: center; font-size: 26px; font-weight: 600;
  letter-spacing: 9px; color: var(--text);
  outline: none; transition: border-color .18s, box-shadow .18s;
}
.pin-box input::placeholder { font-size: 15px; letter-spacing: 0; font-weight: 400; color: var(--text-3); }
.pin-box input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(11, 99, 246, .1); }

.login-error { color: var(--red); font-size: 13.5px; min-height: 20px; margin-bottom: 6px; }
.login-hint { color: var(--text-3); font-size: 12.5px; margin-top: 20px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; border-radius: 14px;
  transition: transform .12s, background .18s, opacity .18s;
  white-space: nowrap;
}
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:active { background: var(--blue-dark); }
.btn.big { width: 100%; height: 56px; font-size: 17px; }
.btn.ghost { background: var(--blue-soft); color: var(--blue); }
.btn[disabled] { opacity: .5; pointer-events: none; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 22px; line-height: 1;
}
.icon-btn:active { background: #eceef1; }

/* ---------------- 顶栏 ---------------- */
.main-screen { display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-top) + 14px) 20px 12px;
  background: rgba(244, 245, 247, .9);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}
.brand { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }
.topbar-right { display: flex; align-items: center; gap: 6px; }
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 0 3px rgba(245, 158, 11, .15);
  transition: background .2s, box-shadow .2s;
}
.dot.online { background: var(--green); box-shadow: 0 0 0 3px rgba(18, 161, 80, .15); }
.dot.offline { background: var(--red); box-shadow: 0 0 0 3px rgba(229, 72, 77, .15); }

/* ---------------- 打印机卡片 ---------------- */
.printer-card {
  margin: 0 20px 14px;
  padding: 15px 17px 16px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.pc-head { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.pc-label {
  font-size: 12px; font-weight: 600; letter-spacing: .6px;
  color: var(--text-3); text-transform: uppercase;
}
.pdot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(18, 161, 80, .14);
}
.printer-card.warn .pdot { background: var(--amber); box-shadow: 0 0 0 3px rgba(245, 158, 11, .16); }
.printer-card.bad .pdot { background: var(--red); box-shadow: 0 0 0 3px rgba(229, 72, 77, .16); }
.pc-name {
  font-size: 17.5px; font-weight: 650; color: var(--text-1);
  line-height: 1.3; word-break: break-word;
}
.pc-state { margin-top: 4px; font-size: 13.5px; color: var(--text-3); }
.pswitch { margin-left: auto; color: var(--blue); font-weight: 600; font-size: 13px; }
.printer-card.tappable:active { background: #f6f7f9; }

.content { flex: 1; padding: 0 20px calc(var(--safe-bottom) + 32px); }

/* ---------------- 两个功能入口 ---------------- */
.func-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.func-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 18px 16px 16px;
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); text-align: left;
  transition: transform .12s, box-shadow .18s;
}
.func-card:active { transform: scale(.975); box-shadow: 0 2px 8px rgba(16, 24, 40, .08); }
.func-icon {
  width: 40px; height: 40px; border-radius: 12px; margin-bottom: 9px;
  background: var(--blue-soft); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
}
.func-card strong { font-size: 16.5px; font-weight: 650; letter-spacing: -.2px; }
.func-card em { font-style: normal; font-size: 12.5px; color: var(--text-3); line-height: 1.35; }

/* ---------------- 待打印 ---------------- */
.func-tip {
  margin: -4px 2px 16px; font-size: 12px; color: var(--text-3); line-height: 1.55;
}

.preview-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }

.file-card {
  background: var(--card); border-radius: 16px;
  box-shadow: var(--shadow); padding: 13px 14px 4px;
  animation: slideIn .22s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.file-head { display: flex; align-items: flex-start; gap: 12px; }

.thumb {
  width: 54px; height: 70px; border-radius: 8px; flex-shrink: 0;
  background: #f1f3f6; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
}
.thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.thumb .thumb-placeholder { font-size: 10px; font-weight: 700; color: var(--text-3); }

.preview-info { flex: 1; min-width: 0; }
.preview-name {
  font-size: 14.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.preview-meta { font-size: 12px; color: var(--text-3); margin-top: 3px; display: flex; align-items: center; gap: 8px; }
.preview-meta .preparing { color: var(--blue); }

.pv-open {
  flex-shrink: 0; height: 28px; padding: 0 11px; border-radius: 8px;
  background: var(--blue-soft); color: var(--blue);
  font-size: 12.5px; font-weight: 600;
}
.pv-open:active { background: #dbe8ff; }

.preview-remove {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 20px;
}
.preview-remove:active { background: #f1f2f4; }

/* 卡片内的份数 / 范围 */
.file-rows { margin-top: 9px; border-top: 1px solid var(--line); }
.file-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; min-height: 46px; }
.file-row + .file-row { border-top: 1px solid var(--line); }
.row-label { font-size: 14.5px; color: var(--text-2); flex-shrink: 0; }

.range-wrap { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.range-wrap .stepper { margin-left: 0; }
.range-input {
  width: 48px; height: 34px; text-align: center;
  font-size: 15px; font-weight: 600; color: var(--text);
  border: 1px solid var(--line); border-radius: 9px; background: #fafbfc;
  outline: none; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield; appearance: textfield;
}
.range-input::-webkit-outer-spin-button,
.range-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.range-input:focus { border-color: var(--blue); background: #fff; }
.range-sep { font-size: 13.5px; color: var(--text-3); }
.range-total { font-size: 12.5px; color: var(--text-3); }
.range-all {
  margin-left: auto; color: var(--blue); font-weight: 600; font-size: 14px;
  padding: 7px 4px;
}
.range-all:active { opacity: .6; }

/* 选项 */
.options {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 4px 18px; margin-bottom: 18px;
}
.opt-row {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 0;
}
.opt-row + .opt-row { border-top: 1px solid var(--line); }
.opt-label { font-size: 15px; font-weight: 500; width: 40px; flex-shrink: 0; }
.opt-value {
  font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums;
  width: 46px; text-align: right; flex-shrink: 0;
}
.opt-tip {
  margin: -6px 0 12px; padding-left: 54px;
  font-size: 12px; color: var(--text-3); line-height: 1.4;
}

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 4px; border-radius: 2px;
  background: #e6e9ee; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 2px 6px rgba(16, 24, 40, .22);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 2px 6px rgba(16, 24, 40, .22);
  cursor: pointer;
}

.stepper { display: flex; align-items: center; gap: 2px; background: #f4f5f7; border-radius: 11px; padding: 3px; margin-left: auto; }
.stepper-btn {
  width: 38px; height: 34px; border-radius: 9px; font-size: 19px;
  color: var(--text-2); display: flex; align-items: center; justify-content: center;
}
.stepper-btn:active { background: #fff; color: var(--blue); }
.stepper-value { min-width: 38px; text-align: center; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }

.print-btn {
  display: flex; width: 100%; height: 58px;
  margin-bottom: 8px; font-size: 18.5px; letter-spacing: 3px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(11, 99, 246, .28);
}
.text-btn {
  width: 100%; height: 46px; font-size: 15px;
  color: var(--text-3); font-weight: 500;
}

/* 打印机异常 */
.printer-warn {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; margin-bottom: 14px;
  background: var(--red-soft); border-radius: 14px;
  font-size: 13.5px; color: #b3141c; line-height: 1.45;
}
.printer-warn button {
  flex-shrink: 0; height: 32px; padding: 0 14px;
  background: var(--red); color: #fff; border-radius: 9px;
  font-size: 13px; font-weight: 600;
}

/* ---------------- 打印记录 ---------------- */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 22px 2px 10px;
}
.section-head h2 { font-size: 15px; font-weight: 700; color: var(--text-2); }

.job-list { display: flex; flex-direction: column; gap: 10px; }
.job-card {
  background: var(--card); border-radius: 15px; padding: 14px 15px;
  box-shadow: var(--shadow);
}
.job-top { display: flex; align-items: flex-start; gap: 11px; }
.job-main { flex: 1; min-width: 0; }
.job-name {
  font-size: 14.5px; font-weight: 600; margin-bottom: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.job-sub { font-size: 12px; color: var(--text-3); display: flex; gap: 7px; flex-wrap: wrap; }

.job-status-tag {
  font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 20px;
  flex-shrink: 0; background: #f1f2f4; color: var(--text-2);
}
.job-status-tag.pending,
.job-status-tag.rendering,
.job-status-tag.ready,
.job-status-tag.printing { background: var(--blue-soft); color: var(--blue); }
.job-status-tag.done { background: var(--green-soft); color: var(--green); }
.job-status-tag.error { background: var(--red-soft); color: var(--red); }
.job-status-tag.cancelled,
.job-status-tag.interrupted { background: #f1f2f4; color: var(--text-3); }

.job-progress {
  height: 3px; border-radius: 2px; background: #eef0f3;
  margin-top: 11px; overflow: hidden;
}
.job-progress-fill {
  height: 100%; border-radius: 2px; background: var(--blue);
  transition: width .35s ease;
}
.job-progress-fill.done { background: var(--green); }
.job-progress-fill.error { background: var(--red); }

.job-error {
  margin-top: 10px; padding: 9px 11px; border-radius: 10px;
  background: var(--red-soft); color: #b3141c; font-size: 12.5px; line-height: 1.45;
}

.empty-state { text-align: center; padding: 40px 0; color: var(--text-3); }
.empty-state.small { padding: 26px 0; }
.empty-state p { font-size: 13.5px; }

/* ---------------- 处理指引卡片 ---------------- */
.advice-card {
  margin-top: 12px; border-radius: 13px; padding: 14px 15px;
  background: var(--amber-soft);
  border: 1px solid rgba(245, 158, 11, .2);
  animation: slideIn .2s ease;
}
.advice-card.error { background: var(--red-soft); border-color: rgba(229, 72, 77, .2); }

.advice-head { display: flex; gap: 9px; }
.advice-mark {
  width: 19px; height: 19px; border-radius: 50%; flex-shrink: 0; margin-top: 1px;
  background: var(--amber); color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.advice-card.error .advice-mark { background: var(--red); }
.advice-titles { flex: 1; min-width: 0; }
.advice-title { font-size: 14px; font-weight: 700; color: #92400e; line-height: 1.4; }
.advice-card.error .advice-title { color: #b3141c; }
.advice-summary { font-size: 12.5px; color: #a16207; margin-top: 3px; line-height: 1.5; }
.advice-card.error .advice-summary { color: #a03038; }

.advice-steps { margin: 11px 0 0; padding-left: 19px; font-size: 13px; line-height: 1.7; color: #7c4a03; }
.advice-card.error .advice-steps { color: #8a2b30; }
.advice-steps li { margin-bottom: 3px; padding-left: 2px; }
.advice-steps li::marker { font-weight: 700; opacity: .6; }

.advice-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.adv-btn {
  height: 36px; padding: 0 16px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  background: #fff; color: var(--text);
  border: 1px solid rgba(0, 0, 0, .07);
  transition: transform .12s;
}
.adv-btn:active { transform: scale(.97); }
.adv-btn.primary { background: var(--blue); color: #fff; border-color: transparent; }
.advice-card.error .adv-btn.primary { background: var(--red); }
/* 「忽略」永远排在左边、样式更轻，避免和真正要做的操作抢注意力 */
.adv-btn.ghost { background: transparent; color: #6b7280; border-color: rgba(0, 0, 0, .12); font-weight: 500; }
.adv-btn.primary { margin-left: auto; }
.advice-locked { margin-top: 10px; font-size: 12.5px; line-height: 1.55; color: #8a2b30; opacity: .9; }

/* ---------------- 弹层 ---------------- */
.sheet-mask {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(16, 24, 40, .38);
  display: flex; align-items: flex-end;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 100%; background: #fff;
  border-radius: 22px 22px 0 0;
  padding-bottom: calc(var(--safe-bottom) + 8px);
  animation: slideUp .26s cubic-bezier(.32, .72, 0, 1);
  max-height: 84vh; display: flex; flex-direction: column;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 10px;
}
.sheet-head h3 { font-size: 17px; font-weight: 700; }
.sheet-body { padding: 0 14px 8px; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.menu-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 14px; border-radius: 13px; font-size: 16px; gap: 14px;
}
.menu-item:active { background: #f6f7f9; }
.menu-label { display: flex; flex-direction: column; gap: 2px; }
.menu-hint { font-size: 12px; color: var(--text-3); font-weight: 400; }
.menu-arrow { color: var(--text-3); font-size: 20px; }
.danger { color: var(--red); }
.menu-about { padding: 16px 14px 10px; color: var(--text-3); font-size: 12px; line-height: 1.7; }

.switch { position: relative; display: inline-block; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  display: block; width: 52px; height: 32px; border-radius: 16px;
  background: #dfe2e7; transition: background .2s; position: relative;
}
.switch-thumb {
  position: absolute; top: 3px; left: 3px; width: 26px; height: 26px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .2s cubic-bezier(.4, 0, .2, 1);
}
.switch input:checked + .switch-track { background: var(--blue); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(20px); }

/* 确认弹层 */
.confirm-sheet { padding-bottom: calc(var(--safe-bottom) + 18px); }
.confirm-body { padding: 0 20px 22px; font-size: 14.5px; color: var(--text-2); line-height: 1.7; }
.confirm-body strong { color: var(--text); font-weight: 600; }
.confirm-body .cf-list { margin: 10px 0 0; padding-left: 19px; }
.confirm-body .cf-list li { margin-bottom: 6px; }
.confirm-actions { display: flex; gap: 10px; padding: 0 20px 4px; }
.confirm-actions .btn { flex: 1; height: 50px; border-radius: 13px; font-size: 15.5px; }
.confirm-actions .btn.ghost { background: #f1f2f4; color: var(--text-2); }

/* ---------------- 提示 ---------------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + 44px);
  transform: translateX(-50%);
  background: rgba(20, 22, 26, .93); color: #fff;
  padding: 12px 22px; border-radius: 13px; font-size: 14px;
  z-index: 100; max-width: 86vw; text-align: center;
  animation: toastIn .22s ease;
  backdrop-filter: blur(8px);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.alert-bar {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 8px 20px 0; padding: 13px 15px;
  background: var(--red-soft); border-radius: 14px;
  border-left: 3px solid var(--red);
  animation: slideIn .22s ease;
}
.alert-body { flex: 1; min-width: 0; }
.alert-title { font-size: 14px; font-weight: 600; color: #b3141c; }
.alert-detail { font-size: 12.5px; color: #a03038; margin-top: 3px; line-height: 1.45; }
.alert-close { color: #b3141c; font-size: 21px; padding: 0 2px; line-height: 1; opacity: .6; }

.upload-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(16, 24, 40, .3);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}
.upload-box {
  width: 74%; max-width: 280px; background: #fff; border-radius: 20px;
  padding: 28px 22px 24px; text-align: center;
  box-shadow: 0 20px 48px rgba(0, 0, 0, .18);
}
.spinner {
  width: 34px; height: 34px; margin: 0 auto 16px;
  border: 3px solid #e6e9ee; border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.upload-title { font-size: 15.5px; font-weight: 600; }
.upload-sub { font-size: 13px; color: var(--text-3); margin-top: 6px; min-height: 18px; }

/* ---------------- 整页预览 ---------------- */
.preview-mask {
  position: fixed; inset: 0; z-index: 92;
  background: #0d0f12;
  display: flex; flex-direction: column;
}
.pv-top {
  display: flex; align-items: center; gap: 10px;
  padding: calc(var(--safe-top) + 12px) 16px 10px;
}
.pv-title {
  flex: 1; min-width: 0; color: #fff;
  font-size: 14.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pv-tabs {
  display: flex; flex-shrink: 0; gap: 2px; padding: 2px;
  background: rgba(255,255,255,.1); border-radius: 9px;
}
.pv-tab {
  padding: 5px 10px; border-radius: 7px;
  font-size: 12.5px; color: #aab1bd; white-space: nowrap;
}
.pv-tab.active { background: rgba(255,255,255,.9); color: #16181d; font-weight: 600; }
.pv-close {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 24px; line-height: 1; opacity: .85;
}
.pv-close:active { background: rgba(255,255,255,.1); }
.pv-stage {
  flex: 1; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 4px 12px;
}
.pv-stage img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; background: #fff; border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
  opacity: 0; transition: opacity .18s;
}
.pv-stage img.ready { opacity: 1; }
.pv-spinner {
  position: absolute; color: #8b93a1; font-size: 13px;
}
.pv-bottom {
  display: flex; align-items: center; justify-content: center; gap: 20px;
  padding: 10px 16px calc(var(--safe-bottom) + 16px);
}
.pv-nav {
  width: 58px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08); color: #fff; font-size: 26px; line-height: 1;
}
.pv-nav:active { background: rgba(255,255,255,.18); }
.pv-nav[disabled] { opacity: .22; pointer-events: none; }
.pv-counter {
  min-width: 68px; text-align: center;
  font-size: 14.5px; color: #c7ccd4; font-variant-numeric: tabular-nums;
}

/* ---------------- 打印效果（纸张预览） ---------------- */
.fx-stage {
  flex: 1; position: relative; overflow: hidden; min-height: 0;
  display: flex; align-items: center; justify-content: center;
}
/* 纸张本体：宽高由 JS 按可打印区域算出，永远保持真实长宽比 */
.fx-paper {
  position: relative; flex-shrink: 0;
  background: #fff; border-radius: 2px;
  box-shadow: 0 10px 34px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.09);
  overflow: hidden;
}
.fx-img {
  position: absolute; display: block;
  left: 0; top: 0; width: 100%; height: 100%;
  opacity: 0; transition: opacity .16s;
}
.fx-img.ready { opacity: 1; }
/* 虚线框：内容真正落在纸上的边界 */
.fx-frame {
  position: absolute; display: none; pointer-events: none;
  border: 1px dashed rgba(10,124,255,.85);
  box-shadow: 0 0 0 1px rgba(255,255,255,.55) inset;
  border-radius: 1px;
}
.fx-paper-tag {
  position: absolute; right: 5px; bottom: 4px;
  font-size: 10px; letter-spacing: .04em;
  color: #b9bec7; pointer-events: none;
}
.fx-spinner {
  position: absolute; color: #8b93a1; font-size: 13px;
  pointer-events: none;
}
.fx-panel {
  padding: 2px 18px 4px;
  display: flex; flex-direction: column; gap: 9px;
}
.fx-size {
  text-align: center;
  font-size: 15px; font-weight: 600; color: #fff;
  font-variant-numeric: tabular-nums;
}
.fx-size em {
  font-style: normal; font-size: 12px; font-weight: 400;
  color: #8b93a1; margin-left: 4px;
}
.fx-scale {
  display: flex; align-items: center; gap: 11px;
}
.fx-scale-label {
  font-size: 12.5px; color: #9aa2ae; flex-shrink: 0; width: 26px;
}
.fx-scale-val {
  font-size: 12.5px; color: #d7dbe2; flex-shrink: 0; width: 40px; text-align: right;
  font-variant-numeric: tabular-nums;
}
.fx-scale input[type="range"] {
  flex: 1; min-width: 0;
  -webkit-appearance: none; appearance: none;
  height: 3px; border-radius: 2px;
  background: rgba(255,255,255,.22);
  outline: none;
}
.fx-scale input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 5px rgba(0,0,0,.4);
}
.fx-hint {
  margin: 0; text-align: center;
  font-size: 11.5px; color: #6f7783; line-height: 1.4;
}

/* ---------------- 图片裁剪 ---------------- */
.crop-mask {
  position: fixed; inset: 0; z-index: 95;
  background: #0d0f12;
  display: flex; flex-direction: column;
}
.crop-top {
  display: flex; align-items: center; gap: 10px;
  padding: calc(var(--safe-top) + 12px) 16px 10px;
}
.crop-hint { flex: 1; color: #f0b429; font-size: 13px; font-weight: 600; }

.crop-stage {
  flex: 1; display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 6px 14px;
  touch-action: none;
}
.crop-canvas { position: relative; line-height: 0; touch-action: none; }
.crop-canvas canvas {
  width: 100%; height: 100%; display: block;
  -webkit-user-select: none; user-select: none;
}
.crop-box {
  position: absolute; box-sizing: border-box;
  border: 2px solid var(--blue);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .58);
  touch-action: none;
}
.ch {
  position: absolute; width: 34px; height: 34px;
  margin: -17px 0 0 -17px; touch-action: none;
}
.ch::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 15px; height: 15px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--blue);
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.ch[data-h="nw"] { left: 0;   top: 0;    cursor: nwse-resize; }
.ch[data-h="n"]  { left: 50%; top: 0;    cursor: ns-resize; }
.ch[data-h="ne"] { left: 100%;top: 0;    cursor: nesw-resize; }
.ch[data-h="e"]  { left: 100%;top: 50%;  cursor: ew-resize; }
.ch[data-h="se"] { left: 100%;top: 100%; cursor: nwse-resize; }
.ch[data-h="s"]  { left: 50%; top: 100%; cursor: ns-resize; }
.ch[data-h="sw"] { left: 0;   top: 100%; cursor: nesw-resize; }
.ch[data-h="w"]  { left: 0;   top: 50%;  cursor: ew-resize; }

.crop-bottom {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px calc(var(--safe-bottom) + 12px);
}
.crop-tool {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px;
  color: #c7ccd4; font-size: 11.5px; padding: 7px 0;
}
.crop-tool:active { color: #fff; }
.crop-done {
  flex: 0 0 104px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--blue); color: #fff;
  font-size: 16px; font-weight: 700; letter-spacing: 1px;
}
.crop-done:active { background: var(--blue-dark); }

/* ---------------- 上传浮层的取消按钮 ---------------- */
.upload-cancel {
  margin-top: 16px; padding: 9px 26px;
  border-radius: 999px;
  background: #f1f3f6; color: var(--text-2);
  font-size: 14px;
}
.upload-cancel:active { background: #e6e9ee; }

/* ---------------- 运行日志 ---------------- */
.log-sheet { height: 84vh; }
.log-tabs {
  display: flex; gap: 6px; padding: 0 20px 10px;
  flex-shrink: 0;
}
.log-tab {
  padding: 7px 14px; border-radius: 9px;
  background: #f1f3f6; color: var(--text-2);
  font-size: 13.5px;
}
.log-tab.active { background: var(--blue); color: #fff; font-weight: 600; }
.log-body {
  flex: 1; min-height: 0; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 14px; padding: 12px;
  background: #f7f8fa; border-radius: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px; line-height: 1.55; color: #39404a;
  white-space: pre-wrap; word-break: break-all;
}
.log-actions {
  display: flex; gap: 10px; padding: 12px 18px 4px;
  flex-shrink: 0;
}
.log-actions .btn { flex: 1; padding: 12px; font-size: 14.5px; }
