/* 虚拟打印机 */
html, body { height: 100%; }
body { background: #ece6db; display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.top .grow { flex: 1; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { width: 36px; height: 36px; border-radius: 10px; background: var(--teal-700); color: #fbe7b5; display: flex; align-items: center; justify-content: center; }
.brand b { display: block; font-size: 16px; line-height: 1.2; }
.brand span { font-size: 12px; color: var(--ink-3); }
.conn { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); padding: 6px 12px; border-radius: 16px; background: var(--bg); }

.main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 380px; min-height: 0; }
.stage { display: flex; flex-direction: column; align-items: center; padding: 28px 20px 16px; min-width: 0; overflow: hidden; }
.hint { color: var(--ink-3); font-size: 13px; margin: 14px 0 0; text-align: center; }

/* 打印机 */
.printer { --pw: min(340px, calc((100vh - 330px) / 1.414)); position: relative; width: calc(var(--pw) + 120px); display: flex; flex-direction: column; align-items: center; }
.p-back { width: calc(var(--pw) + 30px); height: 34px; background: #e2ddd2; border-radius: 10px 10px 0 0; position: relative; display: flex; justify-content: center; }
.p-sheets { position: absolute; bottom: 0; width: calc(var(--pw) - 10px); height: 26px; background: #fff; border-radius: 2px 2px 0 0; box-shadow: 0 -2px 0 #f4f2ec, 0 -4px 0 #fff; }
.p-body {
  position: relative; z-index: 2; width: 100%; height: 150px; border-radius: 22px;
  background: linear-gradient(180deg, #fdfcf9 0%, #f1ede5 100%);
  box-shadow: 0 1px 0 #fff inset, 0 -2px 0 rgba(0,0,0,.04) inset, 0 18px 40px rgba(60, 50, 35, .18), 0 2px 6px rgba(60, 50, 35, .1);
}
.printer.busy .p-body { animation: hum .12s linear infinite alternate; }
@keyframes hum { from { transform: translateY(0); } to { transform: translateY(.6px); } }
.p-panel {
  position: absolute; right: 22px; top: 22px; display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 12px; background: #23302f; color: #cfe9e4; min-width: 170px;
}
.led { width: 10px; height: 10px; border-radius: 50%; background: #5bd08f; box-shadow: 0 0 8px rgba(91, 208, 143, .8); flex: none; }
.printer.busy .led { background: #f2b33d; box-shadow: 0 0 10px rgba(242, 179, 61, .9); animation: blink .45s infinite alternate; }
.printer.err .led { background: #ff6b5e; box-shadow: 0 0 10px rgba(255, 107, 94, .9); }
@keyframes blink { from { opacity: 1; } to { opacity: .35; } }
.p-screen { display: flex; flex-direction: column; line-height: 1.25; font-variant-numeric: tabular-nums; }
.p-screen b { font-size: 14px; color: #fff; }
.p-screen span { font-size: 11px; opacity: .75; }
.p-name { position: absolute; left: 26px; top: 28px; font-size: 13px; font-weight: 600; color: var(--teal-700); letter-spacing: 1px; }
.p-name::before { content: ""; display: block; width: 28px; height: 3px; border-radius: 2px; background: var(--teal-600); margin-bottom: 8px; }
.p-slot {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); width: calc(var(--pw) + 24px); height: 12px;
  border-radius: 6px; background: linear-gradient(180deg, #2a2724, #4a4540); box-shadow: 0 1px 0 #fff;
}
.p-out {
  position: relative; z-index: 1; margin-top: -32px; width: calc(var(--pw) + 40px); height: calc(var(--pw) * 1.414 + 40px);
  overflow: hidden; display: flex; justify-content: center;
}
.paper {
  position: absolute; top: 0; width: var(--pw); aspect-ratio: 1 / 1.414; background: #fff; cursor: pointer;
  box-shadow: 0 10px 30px rgba(60, 50, 35, .2), 0 1px 3px rgba(60, 50, 35, .15); border-radius: 2px;
  transform: translateY(-101%);
}
.paper img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.paper .pages { position: absolute; right: 8px; bottom: 8px; background: rgba(20, 30, 29, .75); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 10px; }
.paper .blank { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--ink-3); font-size: 14px; }
.paper.rest { transform: translateY(0); }
.paper.printing { animation: feed var(--dur, 3.6s) linear forwards; }
@keyframes feed {
  0% { transform: translateY(-101%); }
  14% { transform: translateY(-84%); } 20% { transform: translateY(-84%); }
  36% { transform: translateY(-60%); } 42% { transform: translateY(-60%); }
  60% { transform: translateY(-34%); } 66% { transform: translateY(-34%); }
  86% { transform: translateY(-8%); }
  100% { transform: translateY(0); }
}
.paper.away { transition: transform .6s ease-in, opacity .6s; transform: translateY(40%) rotate(-3deg); opacity: 0; }
.paper:hover { box-shadow: 0 14px 40px rgba(60, 50, 35, .28), 0 1px 3px rgba(60, 50, 35, .15); }

/* 任务列表 */
.side { background: var(--surface); border-left: 1px solid var(--line); padding: 18px 18px; overflow-y: auto; max-height: calc(100vh - 61px); }
.side-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.jobs { display: flex; flex-direction: column; gap: 10px; }
.job { display: flex; gap: 12px; padding: 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); cursor: pointer; transition: border-color .15s; }
.job:hover { border-color: var(--teal-200); }
.job.new { animation: jobIn .4s ease-out; border-color: var(--teal-200); background: var(--teal-50); }
@keyframes jobIn { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.job .jp { width: 48px; height: 66px; border-radius: 4px; background: #fff; border: 1px solid var(--line); overflow: hidden; flex: none; }
.job .jp img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.job .jb { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.job .jt { font-weight: 600; font-size: 14px; }
.job .jm { font-size: 12px; color: var(--ink-3); }
.job .je { font-size: 12px; color: var(--red); }
.job .jr { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.job .jr a { font-size: 12px; }

@media (max-width: 900px) {
  .main { grid-template-columns: 1fr; }
  .side { border-left: 0; border-top: 1px solid var(--line); max-height: none; }
}
.job .je.wait, .jobs .je.wait { color: #8a5d00; }
