/* ============ Base ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --paper: #fdfdfb;
  --ink: #1c1d1f;
  --desk: #f2f0ec;
  --lcd: #3ddc84;
  --accent: #111214;
  --hand: 'Caveat', 'Noto Sans SC', cursive;
  --type: 'Special Elite', 'Courier New', monospace;
  --lcd-font: 'Share Tech Mono', monospace;
  --sans: 'Inter', 'Noto Sans SC', -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--desk);
  color: var(--ink);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

/* ============ Hero / Desk ============ */
.hero {
  position: relative;
  height: 100vh;
  height: 100dvh;
  min-height: 560px;
  overflow: hidden;
}

.desk {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 38%, #f7f5f1 0%, #efede8 55%, #e6e3dc 100%);
}
.desk::after {           /* vignette */
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(90% 75% at 50% 45%, transparent 60%, rgba(60,55,45,.14) 100%);
  pointer-events: none;
}

.scene {
  position: absolute;
  inset: -4%;
  will-change: transform;
  transform: scale(1.06);
}

/* ---------- Documents ---------- */
.doc {
  position: absolute;
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  background: var(--paper);
  box-shadow:
    0 1px 2px rgba(40,36,28,.10),
    0 6px 14px rgba(40,36,28,.10),
    0 18px 40px rgba(40,36,28,.12);
  transition: box-shadow .25s ease;
  will-change: transform, left, top;
}
.doc.dragging {
  cursor: grabbing;
  box-shadow:
    0 2px 4px rgba(40,36,28,.12),
    0 18px 34px rgba(40,36,28,.18),
    0 40px 80px rgba(40,36,28,.22);
  transition: none;
}
.doc.returning {
  transition: left .45s cubic-bezier(.22,1.4,.36,1), top .45s cubic-bezier(.22,1.4,.36,1), transform .45s ease;
}
.doc.shredded { pointer-events: none; }

/* shared bits */
.ln { height: 4px; border-radius: 2px; background: #dcdcd6; margin: 5px 0; }
.ln.short { width: 62%; }
.stamp {
  position: absolute;
  font-family: var(--hand);
  font-weight: 700;
  border: 2px solid currentColor;
  border-radius: 6px;
  padding: 2px 10px;
  letter-spacing: .5px;
}

/* ---------- Invoice ---------- */
.invoice {
  width: 212px;
  padding: 14px 14px 12px;
  font-size: 7.5px;
  color: #2c2c2c;
}
.inv-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.inv-title { font-weight: 800; font-size: 10px; letter-spacing: .2px; }
.inv-page { color: #9a9a94; font-size: 6.5px; }
.inv-table { width: 100%; border-collapse: collapse; }
.inv-table td { padding: 1.6px 2px; }
.inv-table .th td { font-weight: 700; border-bottom: 1px solid #c9c9c2; font-size: 7px; }
.inv-table .amt { text-align: right; font-variant-numeric: tabular-nums; }
.inv-table tr.hl td { background: #fff3b0; }
.inv-table tr.circle .amt { position: relative; }
.inv-table tr.circle .amt::after {
  content: '';
  position: absolute;
  inset: -3px -7px -3px -7px;
  border: 1.4px solid #4a4a44;
  border-radius: 50%;
  transform: rotate(-4deg);
}
.inv-table .total td { font-weight: 800; border-top: 1.5px solid #55554f; padding-top: 4px; font-size: 8.5px; }

/* ---------- Polaroid ---------- */
.polaroid {
  width: 168px;
  padding: 10px 10px 6px;
  background: #fbfaf7;
}
.polaroid .photo {
  position: relative;
  height: 108px;
  overflow: hidden;
  background: linear-gradient(180deg, #f6c99b 0%, #eda97e 34%, #b98a76 58%, #5c4a44 100%);
  filter: saturate(.92);
}
.polaroid .sun {
  position: absolute; left: 30%; top: 26%;
  width: 46px; height: 46px; border-radius: 50%;
  background: radial-gradient(circle, #fff6e0 0%, rgba(255,240,200,.55) 40%, transparent 70%);
}
.polaroid .ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 34%;
  background: linear-gradient(180deg, #6b5145 0%, #3d2f2a 100%);
}
.polaroid .ground::before {
  content: ''; position: absolute; left: 0; right: 0; top: -7px; height: 8px;
  background: linear-gradient(90deg, transparent, rgba(255,225,170,.35) 45%, transparent);
}
.polaroid .van { position: absolute; left: 22%; bottom: 26%; width: 62px; height: 26px; }
.polaroid .van-body {
  position: absolute; left: 0; bottom: 5px; width: 44px; height: 17px;
  background: #2e2622; border-radius: 3px 6px 2px 2px;
}
.polaroid .van-cab {
  position: absolute; right: 4px; bottom: 5px; width: 15px; height: 12px;
  background: #2e2622; border-radius: 5px 7px 2px 1px;
}
.polaroid .van-cab::after {
  content: ''; position: absolute; right: 2px; top: 2px; width: 7px; height: 5px;
  background: rgba(255,214,150,.75); border-radius: 1px 3px 1px 1px;
}
.polaroid .wheel {
  position: absolute; bottom: 1px; width: 8px; height: 8px; border-radius: 50%;
  background: #17110e; box-shadow: inset 0 0 0 1.5px #4a3d35;
}
.polaroid .w1 { left: 8px; } .polaroid .w2 { right: 8px; }
.polaroid .caption {
  font-family: var(--hand);
  font-size: 15px;
  color: #4a4640;
  text-align: center;
  padding: 7px 0 3px;
}

/* ---------- Sticky ---------- */
.sticky {
  width: 132px;
  height: 128px;
  padding: 20px 14px;
  background: linear-gradient(180deg, #ffe873 0%, #ffdf4d 100%);
  box-shadow:
    0 1px 2px rgba(40,36,28,.10),
    0 8px 16px rgba(40,36,28,.14),
    0 20px 40px rgba(40,36,28,.12);
}
.sticky::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 12px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.06));
}
.sticky-big {
  font-family: var(--hand); font-weight: 700; font-size: 27px; color: #3a3324;
  line-height: 1; text-decoration: underline; text-underline-offset: 4px;
  transform: rotate(-1deg);
}
.sticky-small {
  font-family: var(--hand); font-size: 16px; color: #554c34;
  margin-top: 12px; font-style: italic; transform: rotate(-1deg);
}

/* ---------- Consulting agreement ---------- */
.agreement {
  width: 196px;
  padding: 16px 16px 14px;
  font-size: 8px;
  color: #33322e;
}
.ag-title { font-size: 10px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; margin-bottom: 9px; }
.ag-h { font-weight: 700; margin: 7px 0 2px; }
.sigs { display: flex; justify-content: space-between; margin-top: 14px; }
.sig { display: flex; flex-direction: column; gap: 3px; }
.sig-name { font-family: var(--hand); font-size: 15px; color: #5a5850; border-bottom: 1px solid #b9b7b0; padding-bottom: 1px; }
.sig-name.blue { color: #3552a4; transform: rotate(-2deg); }
.sig-role { font-size: 6px; color: #9a988f; }
.seal {
  position: absolute; right: 14px; bottom: 34px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid rgba(90,90,84,.5);
  opacity: .55;
}
.seal::after {
  content: ''; position: absolute; inset: 5px; border-radius: 50%;
  border: 1px dashed rgba(90,90,84,.6);
}

/* ---------- Wire confirmation ---------- */
.wire {
  width: 224px;
  padding: 14px 16px 12px;
  font-size: 8px;
  color: #2c2c2c;
}
.wire-head { display: flex; align-items: center; gap: 6px; margin-bottom: 9px; }
.wire-logo {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, #3b5ba9, #1c2f66);
  position: relative;
}
.wire-logo::after {
  content: ''; position: absolute; left: 3px; right: 3px; top: 7px; height: 2px;
  background: #fff; border-radius: 2px; transform: rotate(-14deg);
}
.wire-brand { font-weight: 800; font-size: 9px; line-height: 1.1; }
.wire-brand em { display: block; font-style: normal; font-weight: 400; font-size: 6.5px; color: #8d8d86; }
.wire-tag { margin-left: auto; font-size: 6.5px; color: #9a9a92; }
.wire-label { color: #8d8d86; font-size: 7px; }
.wire-amount { font-size: 21px; font-weight: 800; letter-spacing: .2px; margin: 1px 0 0; }
.wire-cur { color: #9a9a92; font-size: 6.5px; margin-bottom: 6px; }
.wire-row { padding: 1.5px 0; }
.wire-row.dim { color: #8d8d86; }
.stamp.approved {
  right: 12px; bottom: 30px;
  color: #3e9e5f;
  font-size: 14px;
  transform: rotate(-7deg);
  background: rgba(62,158,95,.06);
}
.barcode {
  margin-top: 10px; height: 14px;
  background: repeating-linear-gradient(90deg, #2c2c2c 0 1px, transparent 1px 3px, #2c2c2c 3px 4px, transparent 4px 7px);
  opacity: .8;
}

/* ---------- Internal memo ---------- */
.memo {
  width: 236px;
  padding: 16px 18px 14px;
  font-family: var(--type);
  font-size: 7.8px;
  line-height: 1.5;
  color: #2e2d29;
}
.clip {
  position: absolute; top: -16px; right: 26px;
  width: 18px; height: 44px;
  transform: rotate(8deg);
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.2));
}
.memo-title { font-size: 12px; font-weight: 700; letter-spacing: .3px; margin-bottom: 6px; }
.memo-meta p { display: flex; gap: 8px; }
.memo-meta b { width: 26px; font-weight: 700; }
.memo-rule { border-top: 1px solid #8d8b82; margin: 7px 0; }
.memo-body { margin-bottom: 4px; }
.redact {
  display: inline-block; height: 6.5px; vertical-align: -1px;
  background: #141311; border-radius: 1px;
}
.redact.w-s { width: 26px; } .redact.w-m { width: 40px; } .redact.w-l { width: 58px; }
.stamp.confidential {
  right: 16px; bottom: 12px;
  color: #c0392b;
  font-size: 15px;
  transform: rotate(-4deg);
  opacity: .9;
}

/* ---------- Shredder ---------- */
.shredder {
  position: absolute;
  left: 50%; top: 52%;
  width: 300px; height: 86px;
  transform: translate(-50%, -50%);
  background: linear-gradient(180deg, #3a3b40 0%, #26272b 45%, #1b1c1f 100%);
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.12),
    inset 0 -2px 4px rgba(0,0,0,.5),
    0 3px 6px rgba(30,28,24,.25),
    0 16px 36px rgba(30,28,24,.30);
  z-index: 5;
}
.shredder::before {      /* top face highlight */
  content: ''; position: absolute; left: 12px; right: 12px; top: 6px; height: 26px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), transparent);
  pointer-events: none;
}
.slot {
  position: absolute;
  left: 24px; right: 24px; top: 16px;
  height: 10px;
  background: #0b0b0d;
  border-radius: 5px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.9), inset 0 -1px 0 rgba(255,255,255,.07);
  transition: box-shadow .25s ease;
}
.slot i {
  position: absolute; inset: 2px 6px;
  border-radius: 3px;
  background: repeating-linear-gradient(90deg, #17181b 0 4px, #101114 4px 8px);
  opacity: .8;
}
.shredder.armed {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.12),
    inset 0 -2px 4px rgba(0,0,0,.5),
    0 3px 6px rgba(30,28,24,.25),
    0 16px 36px rgba(30,28,24,.30),
    0 0 0 3px rgba(255,170,46,.4),
    0 0 44px 6px rgba(255,170,46,.28);
}
.shredder.armed .slot {
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,.9),
    0 0 0 2px rgba(255,170,46,.85),
    0 0 24px 6px rgba(255,170,46,.65);
  animation: slotpulse .7s ease-in-out infinite;
}
.shredder.armed .slot i {
  background: repeating-linear-gradient(90deg, #4a2c10 0 4px, #e8a13c 4px 8px);
  opacity: .95;
}
@keyframes slotpulse {
  50% {
    box-shadow:
      inset 0 2px 4px rgba(0,0,0,.9),
      0 0 0 3px rgba(255,170,46,1),
      0 0 34px 10px rgba(255,170,46,.85);
  }
}
.shredder.busy .slot {
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,.9),
    0 0 0 2px rgba(232,185,60,.55),
    0 0 18px 4px rgba(232,185,60,.45);
}
.shred-brand {
  position: absolute; left: 26px; bottom: 14px;
  color: #c9c9cf; font-size: 13px; font-weight: 600; letter-spacing: .4px;
  opacity: .85;
}
.shred-panel {
  position: absolute; right: 24px; bottom: 12px;
  display: flex; align-items: center; gap: 10px;
}
.lcd {
  font-family: var(--lcd-font);
  font-size: 17px;
  color: var(--lcd);
  background: #0a140d;
  border-radius: 4px;
  padding: 3px 9px;
  letter-spacing: 3px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.8), 0 1px 0 rgba(255,255,255,.06);
  text-shadow: 0 0 6px rgba(61,220,132,.7);
  min-width: 44px;
  text-align: center;
}
.lcd.tick { animation: tick .3s ease; }
@keyframes tick {
  0% { opacity: .2; } 40% { opacity: 1; } 60% { opacity: .35; } 100% { opacity: 1; }
}
.led {
  width: 9px; height: 9px; border-radius: 50%;
  background: #2f9e63;
  box-shadow: 0 0 8px 2px rgba(61,220,132,.55), inset 0 -1px 2px rgba(0,0,0,.5);
  transition: background .2s, box-shadow .2s;
}
.led.armed {
  background: #e8b93c;
  box-shadow: 0 0 8px 2px rgba(232,185,60,.6), inset 0 -1px 2px rgba(0,0,0,.5);
}
.led.busy {
  background: #e8b93c;
  box-shadow: 0 0 8px 2px rgba(232,185,60,.6), inset 0 -1px 2px rgba(0,0,0,.5);
  animation: ledblink .3s steps(2, jump-none) infinite;
}
@keyframes ledblink {
  50% { opacity: .3; }
}
.shredder.busy {
  animation: judder .08s linear infinite;
}
@keyframes judder {
  0%, 100% { transform: translate(-50%, -50%); }
  25% { transform: translate(calc(-50% + 1px), calc(-50% + .5px)); }
  75% { transform: translate(calc(-50% - 1px), calc(-50% - .5px)); }
}

/* 出纸口的纸带：粉碎时保持纸张宽度吐出一小段，内容为原纸克隆随喂入滑动，底边撕成碎条 */
.shred-ribbon {
  position: absolute;
  z-index: 4; /* 顶部藏进机身下沿 */
  pointer-events: none;
  overflow: hidden; /* 内容克隆在内部滑动，只露出已卷入的一段 */
  box-shadow: 0 2px 5px rgba(30,28,24,.08);
}

.hint {
  position: absolute;
  left: 50%; top: 52%;
  transform: translate(-50%, 84px);
  font-size: 14px;
  color: #8b877c;
  letter-spacing: .5px;
  transition: opacity .25s ease;
  pointer-events: none;
  z-index: 6;
}

/* ---------- Confetti canvas ---------- */
#confetti {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 8;
}

/* ---------- Hero UI ---------- */
.hero-ui {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 32px;
  z-index: 10;
  pointer-events: none;
}
.hero-ui > * { pointer-events: auto; }
.brand-mark {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 17px; letter-spacing: .2px;
}
.bm-slot {
  width: 26px; height: 18px; border-radius: 5px;
  background: #1b1c1f;
  position: relative;
  box-shadow: 0 2px 5px rgba(30,28,24,.3);
}
.bm-slot::after {
  content: ''; position: absolute; left: 4px; right: 4px; top: 4px; height: 3px;
  background: #0a0a0c; border-radius: 2px;
}
.bm-sub { display: block; font-size: 10px; font-weight: 500; color: #8b877c; letter-spacing: 1.5px; text-transform: uppercase; }
.hero-actions { display: flex; align-items: center; gap: 12px; }
.counter-pill {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(30,28,24,.08);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12.5px;
  color: #55534c;
  box-shadow: 0 2px 8px rgba(30,28,24,.06);
}
.counter-pill b { font-variant-numeric: tabular-nums; }
.counter-pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--lcd);
  box-shadow: 0 0 6px rgba(61,220,132,.8);
}
.sound-toggle {
  font-family: var(--sans);
  font-size: 12.5px;
  color: #55534c;
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(30,28,24,.08);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(30,28,24,.06);
  transition: background .2s;
}
.sound-toggle:hover { background: #fff; }

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .shredder { width: 250px; height: 76px; }
}
@media (max-width: 640px) {
  .scene { inset: -20%; }
  .hero-ui { padding: 16px 18px; }
  .counter-pill { display: none; }
}

/* ============ 待办便利贴 ============ */
.sticky.note-pink   { background: linear-gradient(180deg, #ffc9d4 0%, #ffb3c3 100%); }
.sticky.note-blue   { background: linear-gradient(180deg, #c6e6ff 0%, #a9d8ff 100%); }
.sticky.note-green  { background: linear-gradient(180deg, #d2f3bf 0%, #b6e89c 100%); }
.sticky {
  display: flex; align-items: center; justify-content: center;
  padding: 14px 12px;
}
.hint { white-space: nowrap; }
.note-text {
  font-family: 'Caveat', 'Kaiti SC', 'STKaiti', 'KaiTi', 'Noto Sans SC', cursive;
  font-weight: 700;
  color: #3a3324;
  line-height: 1.2;
  text-align: center;
  word-break: break-word;
  overflow: hidden;
  max-height: 100%;
  transform: rotate(-1deg);
  pointer-events: none;
}

/* ============ 底部输入栏 ============ */
.todo-bar {
  position: absolute;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(520px, calc(100% - 32px));
  display: flex; gap: 8px;
  padding: 6px;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(30,28,24,.08);
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(30,28,24,.10);
  z-index: 10;
}
.todo-bar input {
  flex: 1; min-width: 0;
  font: 16px var(--sans);   /* 16px 防止 iOS 聚焦时自动放大 */
  color: var(--ink);
  border: 0; outline: 0; background: transparent;
  padding: 10px 12px;
}
.todo-bar input::placeholder { color: #a7a397; }
.todo-bar button {
  font: 600 15px var(--sans);
  color: #fff;
  background: #1b1c1f;
  border: 0; border-radius: 11px;
  padding: 0 18px;
  cursor: pointer;
}
.todo-bar button:active { transform: scale(.96); }
.queue-note {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(84px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 12.5px;
  color: #8b877c;
  z-index: 10;
  pointer-events: none;
}
.hero-ui { padding-top: calc(22px + env(safe-area-inset-top)); }
@media (max-width: 640px) {
  .hero-ui { padding-top: calc(14px + env(safe-area-inset-top)); }
  .counter-pill { display: flex; padding: 6px 11px; font-size: 12px; }
  .sound-toggle { padding: 6px 11px; font-size: 12px; }
  .bm-sub { display: none; }
  .hint { font-size: 19px; }
}
