.share-entry { gap: 6px; }
.share-entry img { flex: 0 0 17px; }
.preview-panel { padding: clamp(14px, 2vw, 24px); }

/* 左：文化印记素材库（单列，贴页面最左）　右：横版登船票画布 */
.ticket-studio {
  display: grid; grid-template-columns: 244px minmax(0, 1fr);
  gap: clamp(16px, 1.8vw, 28px); align-items: start;
}
.library {
  min-width: 0; padding: 14px;
  border: 1px solid #e5d6b9; border-radius: 12px;
  background: linear-gradient(155deg, #fcf8ee, #f3ebd8);
}
.library-head h3 { font-size: 18px; letter-spacing: .04em; }
.library-head p { margin-top: 4px; color: var(--subtle); font-size: 12.5px; line-height: 1.62; }
.library .seal-pages { margin: 10px 0 10px; }
/* 单列：一枚印记一行，左图右字，右侧直接点「看故事」 */
.library .seals { grid-template-columns: minmax(0, 1fr); gap: 7px; }
.library .seal-card { position: relative; grid-template-columns: minmax(0, 1fr); align-items: center; }
.library .seal-pick {
  grid-template-columns: 50px minmax(0, 1fr); align-items: center; justify-items: start;
  gap: 0 9px; padding: 9px 10px; text-align: left;
  line-height: 1.28; cursor: grab; user-select: none;
}
.library .seal-pick img { width: 50px; }
.library .seal-pick-copy { min-width: 0; padding-right: 26px; }
.library .seal-pick-copy strong { font-size: 14.5px; white-space: nowrap; }
.library .seal-pick-copy small { font-size: 11.5px; white-space: nowrap; }
.library .seal-pick-state { position: absolute; top: 7px; right: 8px; font-size: 14px; }
.library .seal-card .seal-story {
  position: absolute; right: 5px; bottom: 6px; min-height: 22px; padding: 0 5px; font-size: 11.5px;
}
.library .seal-pages .btn { padding-inline: 7px; font-size: 12px; }
.library .seal-card.is-dragging { opacity: .55; }
.library .seal-card.is-dragging .seal-pick { cursor: grabbing; }
.library-foot {
  display: flex; justify-content: space-between; gap: 8px;
  margin-top: 10px; padding-top: 9px; border-top: 1px dashed #e0d3b8;
  color: var(--subtle); font-size: 11.5px;
}
.library-foot b { color: var(--bronze); }
.canvas { min-width: 0; display: grid; justify-items: stretch; align-content: start; }
/* 画布、填写区同宽居中，票面四周留出深色衬底 */
.canvas > * { width: 100%; }
.canvas-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.canvas-head h3 { font-size: 17px; letter-spacing: .04em; }
.canvas-head .canvas-note { color: var(--subtle); font-size: 12px; white-space: nowrap; }
.stamping-preview { position: relative; min-width: 0; }
.preview-drop {
  position: relative; display: grid; place-items: center; padding: clamp(8px, 1vw, 15px);
  background: radial-gradient(ellipse at top, #325747, #1b362c);
  border: 1px solid #365a4b; border-radius: 10px;
  transition: border-color .18s, box-shadow .18s;
}
.preview-drop.is-dragging { border-color: #edc98a; border-style: dashed; }
.preview-drop.is-over { border-color: #edc98a; box-shadow: 0 0 0 2px #c49053; }
.preview-drop::after {
  content: "松手盖章"; position: absolute; right: 12px; top: 12px; z-index: 9;
  padding: 4px 10px; border: 1px solid #e8be81; border-radius: 5px;
  background: #163c33; color: #fff0d2; font-size: 13px; font-weight: 700;
  opacity: 0; pointer-events: none;
}
.preview-drop.is-over::after { opacity: 1; }
.studio-foot { margin-top: 18px; }
.studio-foot .field { margin-top: 0; }
.stamp-tap-tip { display: none; }

@media (max-width: 900px) {
  /* 手机：画布 → 素材库 → 填写与生成 */
  .ticket-studio { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .canvas { display: contents; }
  .canvas-head { order: 1; }
  .stamping-preview { order: 2; }
  .library { order: 3; }
  .ticket-workbench { order: 4; }
}
@media (pointer: coarse) {
  .stamp-drag-tip { display: none; }
  .stamp-tap-tip { display: inline; }
  .culture .seal-pick { cursor: pointer; }
}

.preview-tools {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 34px;
  padding-top: 4px; color: var(--subtle); font-size: 13px;
}
.preview-tools .btn { min-height: 28px; padding-block: 2px; }

/* ---------- 出票动效：票机 + 纸带推进 ---------- */
.stamping-preview.is-printing .preview-drop { border-color: #c9a46a; box-shadow: 0 0 0 1px #c9a46a4d, inset 0 0 34px #0d241d66; }

.print-machine {
  position: absolute; z-index: 6; pointer-events: none;
  border: 1px solid #7d9a85; border-radius: 14px;
  background:
    repeating-linear-gradient(180deg, #ffffff08 0 2px, #ffffff00 2px 5px),
    linear-gradient(158deg, #34594c, #17302a 72%);
  box-shadow: 0 16px 32px #06140f59, inset 0 1px 0 #ffffff2e, inset 0 0 0 1px #ffffff12, inset 0 0 0 4px #0f2620;
  opacity: 0; transform: translateX(-16px) scale(.95);
  transition: opacity .28s ease, transform .34s cubic-bezier(.2,.75,.3,1);
}
.print-machine.is-in { opacity: 1; transform: translateX(0) scale(1); }
.print-machine.is-out { opacity: 0; transform: translateX(-22px) scale(.96); }
.print-machine::before {
  content: ""; position: absolute; left: 14px; right: 14px; top: 9px; height: 5px; border-radius: 3px;
  background: linear-gradient(90deg, #b58c50, #f0d9a8 45%, #c9a46a);
  box-shadow: 0 1px 3px #05130e80;
}
.print-machine::after {
  content: ""; position: absolute; right: -5px; top: 0; bottom: 0; width: 10px;
  background: linear-gradient(90deg, #0a1a1580, #0a1a1500);
}
.print-machine-slot {
  position: absolute; right: -7px; top: 50%; width: 13px; height: 76%; transform: translateY(-50%);
  border-radius: 7px; background: linear-gradient(90deg, #06130f, #12302a 70%, #0a1a15);
  box-shadow: inset 0 0 7px #000000, 0 0 0 1px #6f8d78, 0 0 16px #e8c78b3d;
}
.print-machine-slot::after {
  content: ""; position: absolute; left: 3px; right: 3px; top: 6%; bottom: 6%;
  border-radius: 5px; background: linear-gradient(180deg, #ffeecb00, #ffeecb2e 22%, #ffeecb00 55%);
  animation: slot-glow 1.15s ease-in-out infinite;
}
.print-machine-led {
  position: absolute; right: 12px; top: 24px; width: 7px; height: 7px; border-radius: 50%;
  background: #8ee0b0; box-shadow: 0 0 9px #8ee0b0; animation: led-blink .9s ease-in-out infinite;
}
.print-machine-frame {
  position: absolute; inset: 7px; border: 1px solid #ffffff17; border-radius: 10px; pointer-events: none;
}
.print-machine-vent {
  position: absolute; left: 14px; right: 14px; top: 34%; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, #ffffff00, #ffffff2e, #ffffff00);
}
.print-machine-brand {
  position: absolute; left: 12px; top: 40px; writing-mode: vertical-rl;
  color: #d9bc7e; font: 700 13px/1 var(--serif); letter-spacing: .26em; opacity: .78;
}
.print-machine-base {
  position: absolute; left: -6px; right: -6px; bottom: -6px; height: 9px; border-radius: 5px;
  background: linear-gradient(90deg, #7d5c31, #d9bc7e 42%, #b18f56);
  box-shadow: 0 4px 10px #05130e59;
}
.print-machine.is-flat .print-machine-base { display: none; }
.print-machine-mark {
  position: absolute; left: 50%; bottom: 14px; width: 34px; height: 34px; transform: translateX(-50%);
  display: grid; place-items: center; border-radius: 6px;
  background: #a7523a; color: #ffeecd; font: 700 20px/1 var(--serif);
  box-shadow: inset 0 0 0 2px #d09171, 0 2px 6px #05130e66;
}
.print-head {
  position: absolute; z-index: 5; width: 19px; margin-left: -9.5px; pointer-events: none;
  border-radius: 4px;
  background: linear-gradient(90deg, #ffe9bf00, #ffe9bf59 30%, #fff7ddcc 50%, #ffe9bf59 70%, #ffe9bf00);
  box-shadow: 0 0 18px #ffd79a80;
}
.print-head::after {
  content: ""; position: absolute; top: 6%; bottom: 6%; left: 50%; width: 2px; margin-left: -1px;
  border-radius: 2px; background: #fff6dc;
  box-shadow: 0 0 12px #ffcf8f, 0 0 28px #ffb85c;
}
.print-head.is-flat {
  width: auto; margin-left: 0;
  background: linear-gradient(180deg, #ffe9bf00, #ffe9bf59 30%, #fff7ddcc 50%, #ffe9bf59 70%, #ffe9bf00);
}
.print-head.is-flat::after {
  top: 50%; bottom: auto; left: 4%; right: 4%; width: auto; height: 2px; margin: -1px 0 0;
}
@keyframes slot-glow { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes led-blink { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }

/* 横放票机：竖版票面（手机）时从上方出纸 */
.print-machine.is-flat::after { display: none; }
.print-machine.is-flat .print-machine-slot {
  left: 10px; right: 10px; top: auto; bottom: -5px; width: auto; height: 11px; transform: none;
  border-radius: 7px; background: linear-gradient(180deg, #06130f, #12302a 70%, #0a1a15);
}
.print-machine.is-flat .print-machine-slot::after {
  left: 5%; right: 5%; top: 2px; bottom: 2px;
  background: linear-gradient(90deg, #ffeecb00, #ffeecb33 24%, #ffeecb00 56%);
}
.print-machine.is-flat .print-machine-brand {
  left: 16px; top: 50%; transform: translateY(-50%);
  writing-mode: horizontal-tb; letter-spacing: .2em;
}
.print-machine.is-flat .print-machine-mark {
  left: auto; right: 16px; bottom: 50%; transform: translateY(50%);
  width: 30px; height: 30px; font-size: 17px;
}
.print-machine.is-flat .print-machine-led { left: 50%; right: auto; top: 11px; margin-left: -3px; }

@media (max-width: 560px) {
  .print-machine-mark { width: 28px; height: 28px; font-size: 16px; bottom: 11px; }
}

.stamp-flight {
  z-index: 80; position: fixed; pointer-events: none; width: 64px; height: 64px; object-fit: contain;
  filter: drop-shadow(0 8px 7px #46221851);
}
.stamp-landing { z-index: 8; }
.stamp-landing .stamp-ink { animation: imprint-lands 780ms cubic-bezier(.18,.68,.23,.99) var(--delay,0ms) both; }
.stamp-sparks { position: absolute; pointer-events: none; width: 1px; height: 1px; left: 50%; top: 44%; color: #ab3c29; }
.stamp-sparks::before, .stamp-sparks::after {
  content: ""; position: absolute; inset: -23px; border: 2px solid #a7442f; border-radius: 50%;
  animation: ink-ring 425ms ease-out calc(var(--delay,0ms) + 250ms) both;
}
.stamp-sparks::before { border-color: #d3a766; animation-delay: calc(var(--delay,0ms) + 315ms); }
.stamp-sparks i {
  position: absolute; top: 0; left: 0; width: 6px; height: 3px; background: currentColor; border-radius: 65% 40%;
  animation: ink-particle 430ms ease-out calc(var(--delay,0ms) + 250ms) both;
}
.stamp-sparks i:nth-child(3n) { color: #c99452; width: 4px; height: 4px; }
@keyframes imprint-lands {
  0% { transform: translate(0,-44px) scale(1.9) rotate(-17deg); filter: blur(.6px) drop-shadow(0 14px 11px #361c1370); opacity: 0; }
  19% { opacity: 1; }
  33% { transform: translate(0,4px) scale(1.18,.72) rotate(var(--seal-tilt)); filter: drop-shadow(0 2px 3px #37120f69); }
  48% { transform: translate(0,-4px) scale(.95,1.1) rotate(var(--seal-tilt)); }
  67% { transform: translate(0,0) scale(1.04,.99) rotate(var(--seal-tilt)); }
  100% { transform: rotate(var(--seal-tilt)); filter: none; opacity: 1; }
}
@keyframes ink-ring { from { transform: scale(.5); opacity: .8; } to { transform: scale(2.14); opacity: 0; } }
@keyframes ink-particle {
  from { transform: rotate(var(--angle)) translateX(8px) scale(.4); opacity: .85; }
  to { transform: rotate(var(--angle)) translateX(var(--reach)) scale(.2); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .stamp-landing .stamp-ink, .stamp-sparks::before, .stamp-sparks::after, .stamp-sparks i { animation: none; }
  .stamp-sparks { display: none; }
}
