/* ============================================================
   出门抽一张 — Visual System (Theme A 复古小票)
   1:1 移植自 uiux/styles.css + drawflow.css
   暖纸感 · 轻盈 · 像一张好看的小票
   ============================================================ */

:root {
  color-scheme: light;

  /* Brand */
  --brand-yellow: #f4d35e;
  --brand-yellow-deep: #e7bd3a;
  --accent-orange: #ee6c4d;
  --accent-green: #3a7d44;
  --accent-blue: #2f6690;
  --accent-purple: #8d5a97;

  /* Paper / neutrals */
  --paper: #f7f0e0;
  --paper-2: #efe6d2;
  --ink: #211f1b;
  --ink-soft: #5b554a;
  --ink-faint: #9b9483;
  --line: #d9cfb8;

  /* Receipt (Theme A) tokens */
  --rcpt-paper: #fbf7ec;
  --rcpt-ink: #1d1c1a;
  --rcpt-ink-2: #1f3a5f;
  --rcpt-accent: #f4d35e;

  --shadow-card: 0 1px 2px rgba(40, 34, 20, 0.08), 0 12px 32px -12px rgba(40, 34, 20, 0.28);
  --shadow-soft: 0 2px 14px -6px rgba(40, 34, 20, 0.22);

  --font-cn: "Noto Sans SC", system-ui, -apple-system, "PingFang SC", sans-serif;
  --font-serif-cn: "Noto Serif SC", ui-serif, "Songti SC", serif;
  --font-mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-hand: "ZCOOL KuaiLe", "Ma Shan Zheng", "Noto Sans SC", cursive;

  --safe-top: max(16px, env(safe-area-inset-top));
  --safe-bottom: max(22px, env(safe-area-inset-bottom));
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  height: 100%;
  overflow: hidden;
  /* 禁止双指捏合 / 双击放大，仅保留平移与滚动 */
  touch-action: pan-x pan-y;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-cn);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(72% 52% at 16% 46%, rgba(244, 211, 94, 0.16), transparent 72%),
    radial-gradient(circle at 88% 78%, rgba(238, 108, 77, 0.08), transparent 42%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

[hidden] {
  display: none !important;
}

/* 纸张噪点 */
.grain {
  position: relative;
}

.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.04;
  mix-blend-mode: multiply;
  border-radius: inherit;
}

/* ============ App shell：移动端全屏一列 ============ */
.app-root {
  position: fixed;
  inset: 0;
  margin: 0 auto;
  width: min(520px, 100%);
  display: flex;
  flex-direction: column;
}

/* 每屏主体填满 foot 以上的空间；foot 常驻底部不随屏切换重建 */
.df-stage {
  position: relative;
  flex: 1;
  min-height: 0;
}

/* ============================================================
   DrawFlow（df-*）— 四步流程
   ============================================================ */
.df {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  font-family: var(--font-cn);
}

/* 牛皮纸托盘页（抽卡 / 出门 / 小票）：整屏含顶栏统一为托盘色，
   避免顶栏(#f7f0e0)与内容托盘(#efe7d4)、iOS 状态栏之间出现分层。
   状态栏底色由 app.js 在切屏时同步为同一色。 */
.df--draw,
.df--receipt {
  background: #efe7d4;
}

.df-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--safe-top) 18px 2px;
  flex: 0 0 auto;
}

.df-brand {
  display: block;
  height: 80px;
  width: auto;
  object-fit: contain;
}

.df-offline {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--accent-green);
}

.df-history-link {
  border: 1px solid var(--line);
  background: rgba(251, 247, 236, 0.68);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 4px 10px;
  font-family: var(--font-cn);
  font-size: 12px;
  font-weight: 700;
}

.df-bar-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.df-foot-minor {
  text-align: center;
  padding: 4px 0 2px;
}

.df-clear-minor {
  border: none;
  background: none;
  color: var(--ink-faint);
  font-family: var(--font-cn);
  font-size: 11px;
  padding: 4px 8px;
  cursor: pointer;
}

.df-more-wrap {
  position: relative;
}

.df-more-btn {
  border: none;
  background: none;
  color: var(--accent-orange);
  font-family: var(--font-cn);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  cursor: pointer;
}

.df-more-drop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 72px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  z-index: 100;
}

.df-more-item {
  border: none;
  background: none;
  color: var(--ink-soft);
  font-family: var(--font-cn);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 12px;
  text-align: left;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}

.df-more-item:active {
  background: var(--line);
}

.df--draw .df-offline,
.df--receipt .df-offline {
  color: var(--ink-faint);
}

.df-back {
  border: none;
  background: none;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0;
  font-family: var(--font-cn);
}

.df-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 18px 20px;
  -webkit-overflow-scrolling: touch;
}

.df-scroll::-webkit-scrollbar {
  width: 0;
}

/* ============ 历史票根 ============ */
.df-scroll--history {
  padding-top: 8px;
}

.hist-listview {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hist-item,
.hist-empty,
.hist-ticket {
  width: 100%;
  border: 1.5px solid var(--line);
  background: var(--rcpt-paper);
  color: var(--ink);
  box-shadow: var(--shadow-card);
}

.hist-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 15px;
  text-align: left;
}

.hist-item b,
.hist-ticket-head b {
  font-family: var(--font-serif-cn);
  font-size: 19px;
  line-height: 1.2;
}

.hist-date,
.hist-meta,
.hist-ticket-head span,
.hist-ticket-head em,
.hist-cardno,
.hist-cardcat {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--accent-orange);
  font-style: normal;
}

.hist-meta,
.hist-ticket-head em {
  color: var(--ink-faint);
}

.hist-note {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
}

.hist-empty {
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hist-empty b {
  font-family: var(--font-serif-cn);
  font-size: 20px;
}

.hist-empty span {
  color: var(--ink-faint);
  font-size: 13px;
}

.hist-detail {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hist-back {
  align-self: flex-start;
  border: none;
  background: none;
  color: var(--ink-soft);
  padding: 4px 0;
  font-weight: 700;
}

.hist-ticket {
  padding: 16px;
}

.hist-ticket-head {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}

.hist-list {
  display: flex;
  flex-direction: column;
}

.hist-cardrow {
  display: grid;
  grid-template-columns: 28px 44px 1fr 42px;
  align-items: center;
  gap: 8px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}

.hist-cardtask {
  font-family: var(--font-cn);
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
}

.hist-thumb {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  overflow: hidden;
}

.hist-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hist-check {
  justify-self: center;
  width: 30px;
  height: 30px;
  border: 1.5px dashed var(--ink-faint);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-faint);
  font-weight: 900;
}

.hist-detail-note {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-family: var(--font-serif-cn);
  font-style: italic;
  line-height: 1.55;
}

/* ============ 设置 ============ */
.df-scroll--settings {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding-top: 8px;
}

.set-card,
.set-done,
.set-dialog {
  border: 1.5px solid var(--line);
  background: var(--rcpt-paper);
  color: var(--ink);
  box-shadow: var(--shadow-card);
}

.set-card {
  padding: 15px;
}

.set-head,
.set-kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.set-head span {
  font-family: var(--font-serif-cn);
  font-weight: 900;
  font-size: 20px;
}

.set-head b,
.set-kv b {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--accent-orange);
  text-align: right;
}

.set-card p {
  margin: 10px 0 0;
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 1.55;
}

.set-kv {
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px dashed var(--line);
}

.set-kv span {
  color: var(--ink-soft);
  font-size: 13px;
}

.set-danger {
  border: 1.5px solid #b75542;
  background: #fff7f0;
  color: #b75542;
  border-radius: 999px;
  padding: 9px 16px;
  font-family: var(--font-cn);
  font-size: 13px;
  font-weight: 900;
}

.set-danger--wide {
  width: 100%;
  margin-top: 14px;
}

.set-done {
  padding: 12px 14px;
  color: var(--accent-green);
  font-weight: 900;
}

.set-mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  background: rgba(35, 31, 25, 0.32);
  z-index: 20;
}

.set-dialog {
  width: 100%;
  padding: 18px;
}

.set-dialog b {
  display: block;
  font-family: var(--font-serif-cn);
  font-size: 21px;
}

.set-dialog p {
  margin: 9px 0 16px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}

.set-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

/* 反馈弹窗：复用 set-dialog 的纸面卡片，补一个可输入的多行框 */
.fb-input {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 14px;
  padding: 11px 12px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-cn);
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  -webkit-appearance: none;
}

.fb-input:focus {
  outline: none;
  border-color: var(--accent-orange);
}

.fb-input::placeholder {
  color: var(--ink-faint);
}

/* 首屏问候：站酷快乐体手写，像随手写在票据上的一句话 */
.df-q {
  font-family: var(--font-hand);
  font-weight: 400;
  font-size: 38px;
  line-height: 1.12;
  margin: 10px 0 12px;
  letter-spacing: 0.02em;
  transform: rotate(-1.5deg);
  transform-origin: left center;
}

.df-sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 22px;
}

.df-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 11px;
}

/* ============ 起手式票根（A0 票面 × A2 网格） ============ */
.tk-zone {
  position: relative;
  margin-top: 12px;
  padding-bottom: 3px;
  padding-right: 3px;
}

.tk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.tk-grid.is-ghost {
  visibility: hidden;
}

.tk {
  position: relative;
  text-align: left;
  background: var(--rcpt-paper);
  border: 1.5px solid var(--line);
  border-radius: 5px;
  padding: 0 0 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(40, 34, 20, 0.08);
  transition: all 0.14s;
  font-family: var(--font-cn);
}

.tk:hover {
  border-color: var(--ink-faint);
}

.tk.is-on {
  background: var(--brand-yellow);
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}

.tk.is-on .tk-perf {
  opacity: 0.22;
}

.tk.is-on .tk-admit {
  color: #8a6210;
}

.tk.is-on .tk-name {
  color: var(--ink);
}

.tk.is-on .tk-meta {
  color: #7c6a35;
}

.tk.is-on .tk-seal {
  opacity: 0.9;
}

.tk-perf {
  display: block;
  height: 8px;
  background: repeating-linear-gradient(90deg, #1d1c1a 0 6px, transparent 6px 12px);
  opacity: 0.14;
}

.tk-admit {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  color: #b07a2a;
  padding: 9px 12px 0;
  white-space: nowrap;
}

.tk-name {
  display: block;
  font-family: var(--font-serif-cn);
  font-weight: 900;
  font-size: 19px;
  line-height: 1.3;
  color: var(--ink);
  padding: 4px 12px 1px;
}

.tk-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  padding: 2px 12px 22px;
}

/* 票角印章：放大盖在右下角，越界部分被 .tk 的 overflow:hidden 裁掉（"重"档出血） */
.tk-admit,
.tk-name,
.tk-meta {
  position: relative;
  z-index: 1;
}

.tk-seal {
  position: absolute;
  right: -16px;
  bottom: -16px;
  width: 96px;
  height: 96px;
  mix-blend-mode: multiply;
  opacity: 0.82;
  pointer-events: none;
  z-index: 0;
}

.tk-seal svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tk-seal--down {
  transform: rotate(-6deg);
}

.tk-seal--date {
  transform: rotate(-4deg);
}

.tk-seal--friend {
  transform: rotate(-6deg);
}

.tk-seal--travel {
  transform: rotate(-4deg);
}

.tk-seal--reboot {
  transform: rotate(-8deg);
}

.tk-seal--custom {
  transform: rotate(-12deg);
}

/* AI 票展开：占满整个票根网格区域 */
.tk-expand {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--rcpt-paper);
  border: 1.5px solid var(--ink);
  border-radius: 5px;
  box-shadow: 3px 3px 0 var(--accent-orange);
  overflow: hidden;
}

.tk-close {
  position: absolute;
  top: 16px;
  right: 10px;
  z-index: 2;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.12s;
  padding: 0;
}

.tk-close:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.tk-input {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: none;
  background: transparent;
  padding: 12px 44px 10px 13px;
  font-family: var(--font-cn);
  font-size: 16px;
  line-height: 1.6;
  resize: none;
  color: var(--ink);
}

.tk-input:focus {
  outline: none;
}

.tk-hint {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  padding: 0 12px 12px;
}

.tk-hint.is-ok {
  color: var(--accent-green);
}

.tk-hint.is-fallback {
  color: var(--accent-orange);
}

/* 手机端：自定义 AI 输入框聚焦（软键盘弹出）时才压矮，腾出空间让下方选项可见；失焦后恢复。
   仅触摸设备生效，电脑（pointer: fine）即使 focus 也不变化。 */
@media (pointer: coarse) {
  .tk-zone:has(.tk-input:focus) .tk-grid.is-ghost {
    height: 140px;
  }
}

/* ============ 快捷控制：墨水圈选（圈一圈 / 划掉） ============ */
.df-quick {
  margin-top: 16px;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
}

.ink-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
  flex-wrap: wrap;
}

.ink-lab {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-faint);
  flex: 0 0 32px;
}

.ink-opt {
  position: relative;
  border: none;
  background: none;
  padding: 7px 6px;
  font-family: var(--font-cn);
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.12s;
}

.ink-opt:hover {
  color: var(--ink);
}

.ink-opt.is-on {
  color: var(--accent-orange);
  font-weight: 900;
}

.ink-ring {
  position: absolute;
  inset: 0 -3px;
  width: calc(100% + 6px);
  height: 100%;
  pointer-events: none;
}

.ink-opt--avoid.is-on {
  color: #a23c22;
  font-weight: 700;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

/* 底部 CTA */
/* 常驻底栏：统一结构 [sum 单行] + [actions 一行按钮]，全 App 高度恒定 */
.df-foot {
  flex: 0 0 auto;
  padding: 12px 18px var(--safe-bottom);
  border-top: 1px solid var(--line);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.df-foot-sum {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.df-foot-actions {
  display: flex;
  gap: 9px;
}

/* 单/多按钮都填满整行；固定按钮行高 48px → 无论字号 foot 高度像素级不变 */
.df-foot-actions .df-cta {
  flex: 1;
  width: auto;
}

.df-foot-actions .df-ghost {
  flex: 0 0 auto;
}

.df-foot-actions>.df-cta,
.df-foot-actions>.df-ghost,
.df-foot-actions>.df-share-btn {
  min-height: 48px;
  padding-top: 0;
  padding-bottom: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.df-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 14px;
  font-family: var(--font-cn);
  font-weight: 700;
  font-size: 15.5px;
  cursor: pointer;
  transition: all 0.14s;
}

.df-cta:hover:not(:disabled) {
  background: #000;
}

.df-cta:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.df-cta-ic {
  font-size: 16px;
}

.df-cta--sm {
  flex: 1;
  padding: 13px;
  font-size: 14px;
  background: var(--brand-yellow);
  color: var(--ink);
  border: 1.5px solid var(--ink);
}

.df-cta--sm:hover:not(:disabled) {
  background: var(--brand-yellow);
  filter: brightness(0.94);
}

.df-ghost {
  padding: 13px 18px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  font-family: var(--font-cn);
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
}

/* 出票口：仅打印动画期间存在，结束后平滑收起 */
.df-print {
  text-align: center;
  overflow: hidden;
  max-height: 40px;
  padding: 4px 0 10px;
  transition: max-height 0.45s ease 0.1s, padding 0.45s ease 0.1s, opacity 0.3s ease;
}

.df-print.is-gone {
  max-height: 0;
  padding: 0;
  opacity: 0;
}

.df-print-l {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
}

/* 吐票动画：整卷从出票口下方匀减速滑出 */
.roll-window.is-printing {
  overflow: hidden;
}

.roll-window.is-printing .roll {
  animation: roll-feed 1.9s cubic-bezier(0.3, 0.55, 0.3, 1) both;
}

@keyframes roll-feed {
  from {
    transform: translateY(-101%);
  }

  to {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .roll-window.is-printing .roll {
    animation: none;
  }

  /* 出票口不再隐藏：吐票动画虽关，仍短暂显示「已为你印好 N 张」给出反馈，
     由 scheduleDrawPrintCleanup() 的定时器兜底收起（无动画时 animationend 不触发）。 */
}

/* 第二页→第三页：出门页逐段轻轻浮现（整卷淡入 + 每段错峰上移） */
.df--out.is-entering .roll {
  animation: roll-fade-in 0.4s ease both;
}

@keyframes roll-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.seg--enter {
  animation: seg-rise-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes seg-rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* 第三页→小票：小票自上而下打印显影（高度无关，避免长票飞入） */
.ps-window {
  display: flex;
  justify-content: center;
  width: 100%;
}

.ps-window.is-printing {
  overflow: hidden;
}

.ps-window.is-printing .ps {
  animation: ps-print 2.2s cubic-bezier(0.3, 0.55, 0.3, 1) both;
}

@keyframes ps-print {
  from {
    clip-path: inset(0 0 100% 0);
    opacity: 0.55;
    transform: translateY(-6px);
  }

  to {
    clip-path: inset(0 0 0 0);
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {

  .df--out.is-entering .roll,
  .seg--enter {
    animation: none;
  }

  .ps-window.is-printing .ps {
    animation: none;
  }

  /* 出票口同上：不隐藏「小票打印中」，由 scheduleReceiptPrintCleanup() 定时器兜底收起。 */
}

.df-scroll--draw,
.df-scroll--rcpt {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}

.df-scroll--rcpt {
  align-items: center;
  background: #efe7d4;
}

.df-scroll--draw>*,
.df-scroll--rcpt>* {
  flex: 0 0 auto;
}

/* ============ 第二页：一联票（印在同一卷纸上） ============ */
.df-scroll--roll {
  padding: calc(var(--safe-top) - 4px) 26px 24px;
  background: #efe7d4;
}

.roll {
  filter: drop-shadow(0 10px 22px rgba(40, 34, 20, 0.28));
}

.roll-body {
  background: var(--rcpt-paper);
}

.roll-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 1.5px solid var(--rcpt-ink);
}

.roll-head b {
  font-family: var(--font-serif-cn);
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.02em;
}

.roll-head span {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #b07a2a;
}

.seg {
  padding: 12px 16px 13px;
}

.seg-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.seg-no {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #b07a2a;
}

.seg-cat {
  font-size: 11.5px;
  font-weight: 700;
}

.seg-seal {
  margin-left: auto;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 1.5px dashed var(--rcpt-ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-8deg);
  opacity: 0.85;
}

.seg-seal svg {
  width: 16px;
  height: 16px;
}

.seg-task {
  font-family: var(--font-serif-cn);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.55;
  margin: 7px 0 5px;
  color: var(--rcpt-ink);
  text-wrap: pretty;
}

.seg-hint {
  font-size: 11.5px;
  line-height: 1.45;
  margin: 0 0 5px;
  color: var(--ink-faint);
}

.seg-acts {
  display: flex;
  gap: 16px;
  margin-top: 6px;
}

.seg-acts button {
  border: none;
  background: none;
  padding: 0 0 1px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  border-bottom: 1px dashed var(--ink-faint);
  cursor: pointer;
}

.seg-acts button:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.seg-acts button.is-on {
  color: #a23c22;
  border-bottom-color: #a23c22;
  text-decoration: line-through;
}

/* 段间撕票孔：虚线 + 左右半圆缺口（缺口色 = 滚动区背景） */
.seg-perf {
  position: relative;
  height: 0;
  border-top: 2px dashed #cfc3a6;
  margin: 0 7px;
}

.seg-perf::before,
.seg-perf::after {
  content: "";
  position: absolute;
  top: -7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #efe7d4;
}

.seg-perf::before {
  left: -14px;
}

.seg-perf::after {
  right: -14px;
}

/* ============ 第三页：出门中（每张任务=卷纸上的盖章段） ============ */
.seg--do.is-done {
  background: #f4efe1;
}

.seg--do.is-muted {
  opacity: 0.5;
}

.seg--do.is-muted .seg-task {
  text-decoration: line-through;
  text-decoration-color: var(--ink-faint);
}

/* 盖章圆：完成后实线绿章 + 对勾 */
.seg-seal.is-stamped {
  border-style: solid;
  border-color: var(--accent-green);
  color: var(--accent-green);
  opacity: 1;
  transform: rotate(-8deg);
}

.seg-seal.is-stamped i {
  font-style: normal;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
}

/* 待盖章位：虚线方框，点一下=盖章拍证据 */
.seg-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  margin: 9px 0 5px;
  padding: 11px;
  background: none;
  border: 1.5px dashed var(--rcpt-ink);
  border-radius: 4px;
  font-family: var(--font-cn);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  color: var(--rcpt-ink);
  cursor: pointer;
  transition: background 0.14s, transform 0.1s;
}

.seg-slot:hover {
  background: rgba(29, 28, 26, 0.05);
}

.seg-slot:active {
  background: rgba(29, 28, 26, 0.09);
  transform: scale(0.997);
}

.seg-slot-ic {
  width: 17px;
  height: 17px;
  display: inline-flex;
}

.seg-slot-ic svg {
  width: 100%;
  height: 100%;
}

/* 盖章按钮 + 右侧「无图打卡」小方块同一行 */
.seg-slot-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin: 9px 0 5px;
}

.seg-slot-row .seg-slot {
  flex: 1;
  width: auto;
  margin: 0;
}

.seg-noimg {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  background: none;
  border: 1.5px dashed var(--ink-faint);
  border-radius: 4px;
  font-family: var(--font-cn);
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}

.seg-noimg:hover {
  border-color: var(--rcpt-ink);
  color: var(--rcpt-ink);
  background: rgba(29, 28, 26, 0.04);
}

.seg-noimg:active {
  background: rgba(29, 28, 26, 0.08);
}

.seg-note {
  width: 100%;
  min-height: 62px;
  margin: 7px 0 4px;
  padding: 9px 11px;
  background: none;
  border: 1.5px dashed var(--ink-faint);
  border-radius: 4px;
  font-family: var(--font-cn);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--rcpt-ink);
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}

.seg-note:focus {
  border-color: var(--rcpt-ink);
  background: rgba(29, 28, 26, .03);
}

.seg-note-text {
  font-family: var(--font-cn);
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 5px 0 3px;
}

.ps-item-note {
  display: block;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 2px 0;
}

/* 已盖章行：缩略图 + 撤销 */
.seg-stamped {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 9px 0 3px;
}

.seg-thumb {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1.5px solid var(--rcpt-ink);
  overflow: hidden;
  background: #e7dcc2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: var(--accent-green);
}

.seg-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.seg-thumb i {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 16px;
  height: 16px;
  background: var(--accent-green);
  color: #fff;
  font-size: 9px;
  font-style: normal;
  display: flex;
  align-items: center;
  justify-content: center;
}

.seg-thumb--check {
  background: #f3efe2;
}

.seg-stamped-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 10px;
}

.seg-stamped-meta button {
  border: none;
  background: none;
  padding: 0 0 1px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-orange);
  border-bottom: 1px dashed var(--accent-orange);
  cursor: pointer;
}

.seg-stamped-meta button:hover {
  filter: brightness(0.85);
}

/* 跳过态：留白说明 + 恢复 */
.seg-skip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 7px 0 3px;
}

.seg-skip span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
}

.seg-skip button {
  border: none;
  background: none;
  padding: 0 0 1px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-soft);
  border-bottom: 1px dashed var(--ink-faint);
  cursor: pointer;
}

.seg-skip button:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* 卷纸底部：生成锁屏壁纸入口 */
.seg-wall {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 14px 16px;
  background: none;
  border: none;
  font-family: var(--font-cn);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--rcpt-ink);
  cursor: pointer;
  transition: background 0.14s;
}

.seg-wall:hover {
  background: rgba(29, 28, 26, 0.05);
}

.seg-wall:active {
  background: rgba(29, 28, 26, 0.09);
}

.seg-wall-ic {
  font-size: 15px;
  line-height: 1;
}

/* 脉冲：进页后跳 3 次吸引注意，之后静止 */
@keyframes wall-pulse {
  0% {
    opacity: 1;
    transform: scale(1);
  }

  40% {
    opacity: 0.7;
    transform: scale(0.97);
  }

  60% {
    opacity: 1;
    transform: scale(1.03);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.seg-wall--pulse {
  animation: wall-pulse 0.72s ease-in-out 3;
}

/* 底栏小入口（wallEntry=mini 时兜底） */
/* 底栏「分享」按钮：emoji + 文字，紧凑常驻在「修改」与「生成小票」之间 */
.df-share-btn {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 16px;
  gap: 6px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  font-family: var(--font-cn);
  font-weight: 700;
  font-size: 14.5px;
  color: var(--ink);
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s;
}

.df-share-btn:hover {
  background: rgba(29, 28, 26, 0.05);
}

.df-share-btn:active {
  background: rgba(29, 28, 26, 0.09);
}

/* 壁纸弹窗：遮罩 + 纸卡片 */
.wall-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20, 18, 14, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: wall-fade 0.18s ease;
}

@keyframes wall-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* 分享弹窗重渲染时关掉入场动画，避免弹窗被重建后重播淡入「闪一下」 */
.wall-mask.is-static,
.wall-pop.is-static {
  animation: none;
}

.wall-pop {
  width: min(340px, 100%);
  background: var(--rcpt-paper);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.5);
  padding: 26px 22px 20px;
  text-align: center;
  animation: wall-rise 0.2s cubic-bezier(0.2, 0.7, 0.3, 1);
}

@keyframes wall-rise {
  from {
    transform: translateY(12px) scale(0.98);
    opacity: 0;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

.wall-pop-ic {
  font-size: 30px;
  line-height: 1;
  margin-bottom: 10px;
}

.wall-pop-title {
  font-family: var(--font-serif-cn);
  font-weight: 900;
  font-size: 18px;
  margin: 0 0 8px;
  color: var(--ink);
}

.wall-pop-text {
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0 0 18px;
  text-align: left;
}

/* 分享弹窗里的二维码：居中、白底留白，方便朋友扫码 */
.share-pop-qr {
  width: 168px;
  height: 168px;
  margin: 2px auto 18px;
  padding: 12px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  box-sizing: border-box;
}

.share-pop-qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.share-pop-qr--ph {
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: dashed;
}

.share-pop-qr--ph span {
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-faint);
  text-align: center;
}

/* 分享弹窗里的链接行：可复制的 URL + 复制按钮 */
.share-pop-url {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin: 0 0 16px;
}

.share-pop-url-text {
  flex: 1;
  min-width: 0;
  padding: 9px 11px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-soft);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-pop-copy {
  flex: 0 0 auto;
  padding: 0 16px;
  background: var(--ink);
  color: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  font-family: var(--font-cn);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.14s;
}

.share-pop-copy:hover {
  background: #000;
}

.share-pop-copy.is-done {
  background: var(--brand-yellow);
  color: var(--ink);
}

.wall-pop-acts {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.wall-pop-acts .df-cta {
  width: 100%;
}

.wall-skip {
  border: none;
  background: none;
  font-family: var(--font-cn);
  font-size: 13px;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 6px;
}

.wall-skip:hover {
  color: var(--ink-soft);
}

.df-card {
  position: relative;
  background: #fbf7ec;
  border: 1.5px solid #e2d8bf;
  border-radius: 6px;
  padding: 13px 15px 13px 18px;
  overflow: hidden;
}

.df-card-tab {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
}

.df-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.df-card-ic {
  width: 24px;
  height: 24px;
  display: inline-flex;
}

.df-card-ic svg {
  width: 100%;
  height: 100%;
}

.df-card-head b {
  font-size: 13px;
  font-weight: 700;
}

.df-card-no {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
}

.df-card-task {
  font-size: 15px;
  line-height: 1.45;
  margin: 9px 0 11px;
  color: var(--ink);
  text-wrap: pretty;
}

.df-card-hint {
  font-size: 12px;
  line-height: 1.45;
  margin: -5px 0 11px;
  color: var(--ink-faint);
}

.df-card-mini {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.df-card-mini button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 12px;
  font-family: var(--font-cn);
  font-size: 11.5px;
  color: var(--ink-soft);
  cursor: pointer;
}

.df-card-mini button:hover {
  border-color: var(--ink-faint);
}

.df-card-mini button.is-on {
  border-color: var(--accent-orange);
  background: #f3ddd6;
  color: #a23c22;
}

/* 出门中 */
.df-prog {
  height: 4px;
  background: #e2d8bf;
  margin: 0 18px;
  border-radius: 2px;
  overflow: hidden;
  flex: 0 0 auto;
}

.df-prog span {
  display: block;
  height: 100%;
  background: var(--accent-green);
  transition: width 0.3s;
}

.df-do {
  margin-bottom: 0;
}

.df-do.is-done {
  background: #f3efe2;
}

.df-do.is-muted {
  opacity: 0.55;
}

.df-stat {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
}

.df-stat.ok {
  color: var(--accent-green);
}

.df-stat.sk {
  color: var(--ink-faint);
  font-weight: 400;
}

.df-shoot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 11px;
  background: var(--brand-yellow);
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  font-family: var(--font-cn);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
  margin-bottom: 9px;
  transition: all 0.1s;
}

.df-shoot:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}

.df-shoot:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}

.df-shoot .ic {
  width: 16px;
  height: 16px;
  display: inline-flex;
}

.df-shoot .ic svg {
  width: 100%;
  height: 100%;
}

.df-done-row {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 2px;
}

.df-thumb {
  position: relative;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border: 1.5px solid var(--ink);
  overflow: hidden;
  background: #d8c9a6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.df-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.df-thumb i {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 17px;
  height: 17px;
  background: var(--accent-green);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  display: flex;
  align-items: center;
  justify-content: center;
}

.df-done-meta {
  font-size: 12px;
  color: var(--ink-soft);
}

.df-done-meta em {
  font-style: normal;
  color: var(--accent-orange);
  margin-left: 8px;
  cursor: pointer;
  text-decoration: underline;
}

.df-undo {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 14px;
  font-family: var(--font-cn);
  font-size: 11.5px;
  color: var(--ink-soft);
  cursor: pointer;
}

/* 小票步骤（留言框暂隐藏；按钮统一走 .df-foot-actions） */
.df-note {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  padding: 11px 13px;
  font-family: var(--font-cn);
  font-size: 13px;
  background: #fff;
  color: var(--ink);
}

.df-note:focus {
  outline: none;
  border-color: var(--ink);
}

/* ============================================================
   小票风格切换（chip）+ 新增风格预览：车票 / 胶片
   新风格自带"纸 / 胶片"底色，不随系统深浅变（导出同理）。
   ============================================================ */
.rcpt-styles {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 2px 0 4px;
}

.rcpt-chip {
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 6px 16px;
  font-family: var(--font-cn);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.14s;
}

.rcpt-chip:hover {
  border-color: var(--ink-faint);
  color: var(--ink);
}

.rcpt-chip.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* ============================================================
   小票定制 sheet（底部弹出）+ 控件
   ============================================================ */
/* 注意：定制项每次切换都会整页重渲染、sheet DOM 被重建，
   因此不能给 sheet 加入场动画（否则每次点选都重播滑入，很跳）。保持静态出现。 */
.rcpt-sheet-wrap {
  position: absolute;
  inset: 0;
  z-index: 70;
  background: rgba(20, 16, 12, 0.38);
  display: flex;
  align-items: flex-end;
}

.rcpt-sheet {
  width: 100%;
  background: var(--paper);
  border-radius: 22px 22px 0 0;
  padding: 20px 18px calc(var(--safe-bottom));
  max-height: 86%;
  overflow-y: auto;
}

/* 文案行：小标题在前，输入框紧随其后同行 */
.rc-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.rc-field-lab {
  flex: 0 0 auto;
  font-family: var(--font-cn);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
}

.rc-input {
  flex: 1;
  min-width: 0;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  padding: 9px 12px;
  font-family: var(--font-cn);
  font-size: 14px;
  background: #fff;
  color: var(--ink);
}

.rc-input:focus {
  outline: none;
  border-color: var(--ink);
}

/* 头部信息：4 列网格。第一行 时间(50%)+张数(50%)；第二行 地点(50%)+天气(25%)+心情(25%)。
   展开项在流内向下撑开（不被 sheet 滚动裁切），align-items:start 让同行其他项保持顶对齐。 */
.rc-selects {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
  align-items: start;
}

.rc-cell--half {
  grid-column: span 2;
}

.rc-cell--quarter {
  grid-column: span 1;
}

/* 天气/心情在 25% 窄列里，收紧内边距/字号让文字尽量放得下 */
.rc-cell--quarter .rc-dd-btn {
  padding: 10px 8px;
  font-size: 12px;
  gap: 4px;
}

.rc-input--place {
  width: 100%;
}

/* toggle 开关行 */
.rc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 2px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
}

.rc-row-lab {
  font-family: var(--font-cn);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}

.rc-toggle.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.rc-switch {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  flex: 0 0 auto;
  transition: background 0.16s;
}

.rc-switch i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.16s;
}

.rc-toggle.is-on .rc-switch {
  background: var(--accent-green, #3a7d44);
}

.rc-toggle.is-on .rc-switch i {
  transform: translateX(18px);
}

/* 自定义下拉（日期 / 照片数 / 天气 / 心情）：按钮与展开项同款配色、同款字体 */
.rc-dd {
  position: relative;
}

.rc-dd-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  padding: 10px 13px;
  font-family: var(--font-cn);
  font-weight: 700;
  font-size: 13px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.rc-dd-cur {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rc-dd-caret {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--ink-faint);
  transition: transform 0.16s;
}

.rc-dd.is-open .rc-dd-btn {
  border-color: var(--ink);
}

.rc-dd.is-open .rc-dd-caret {
  transform: rotate(180deg);
}

.rc-dd-list {
  margin-top: 5px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}

.rc-dd-opt {
  display: block;
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 10px 13px;
  font-family: var(--font-cn);
  font-weight: 700;
  font-size: 13px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.rc-dd-opt:last-child {
  border-bottom: none;
}

.rc-dd-opt:hover {
  background: rgba(40, 34, 20, 0.05);
}

.rc-dd-opt.is-on {
  background: var(--ink);
  color: var(--paper);
}

/* ============ 复古车票预览（撕齿票根 + 座位号 + 排码） ============ */
.tkr {
  background: #f3ead2;
  color: #23201a;
  border-radius: 4px;
  box-shadow: 0 10px 24px -8px rgba(40, 34, 20, 0.35);
  overflow: hidden;
}

.tkr-perf {
  height: 12px;
  background:
    radial-gradient(circle at 8px 0, transparent 0 6px, #f3ead2 6px) repeat-x;
  background-size: 16px 12px;
}

.tkr-perf--top {
  background-position: 0 -6px;
}

.tkr-perf--bot {
  background-position: 0 6px;
}

.tkr-main {
  padding: 16px 18px 14px;
}

.tkr-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.tkr-line {
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #9a3324;
}

.tkr-title {
  display: block;
  font-family: var(--font-serif-cn);
  font-weight: 900;
  font-size: 21px;
  line-height: 1.1;
  margin-top: 5px;
}

.tkr-head-r {
  text-align: right;
  flex: 0 0 auto;
}

.tkr-no {
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.tkr-date {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #6f6552;
  margin-top: 4px;
}

.tkr-rule {
  height: 0;
  border-top: 2px solid #23201a;
  box-shadow: 0 3px 0 -2px #9a3324;
  margin: 12px 0;
}

.tkr-rows {
  display: flex;
  flex-direction: column;
}

.tkr-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed #c9b98f;
}

.tkr-row:last-child {
  border-bottom: none;
}

.tkr-seat {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  color: #9a3324;
  flex: 0 0 30px;
  padding-top: 2px;
}

.tkr-thumb {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border: 1.5px solid #23201a;
  overflow: hidden;
  background: #e3d6b3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tkr-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tkr-thumb--ico {
  background: #23201a;
  padding: 12px;
}

.tkr-thumb--ico svg {
  width: 100%;
  height: 100%;
}

.tkr-rowbody {
  flex: 1;
  min-width: 0;
}

.tkr-rowcat {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  color: #9a3324;
}

.tkr-rowcat em {
  font-style: normal;
  color: #6f6552;
  font-weight: 400;
}

.tkr-rowtask {
  display: block;
  font-family: var(--font-serif-cn);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.45;
  margin-top: 4px;
  text-wrap: pretty;
}

.tkr-rownote {
  display: block;
  font-family: var(--font-cn);
  font-style: italic;
  font-size: 11.5px;
  line-height: 1.5;
  color: #6f6552;
  margin-top: 3px;
}

.tkr-note {
  font-family: var(--font-serif-cn);
  font-style: italic;
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.5;
  margin: 10px 0 0;
  text-wrap: pretty;
}

.tkr-stub {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-top: 2px dashed #23201a;
}

.tkr-stub-k {
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: #9a3324;
}

.tkr-stub-l b {
  display: block;
  font-family: var(--font-serif-cn);
  font-weight: 900;
  font-size: 17px;
  margin: 4px 0;
}

.tkr-stub-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #6f6552;
}

.tkr-stub-r {
  text-align: right;
  flex: 0 0 auto;
}

.tkr-stub-r svg {
  display: block;
  opacity: 0.9;
}

.tkr-stub-r span {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: #6f6552;
  margin-top: 3px;
}

/* ============ 胶片底片预览（边孔 + 帧号 + 暗调） ============ */
.fs {
  background: #17150f;
  color: #ece4cf;
  border-radius: 4px;
  box-shadow: 0 10px 26px -8px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  padding: 14px 0 16px;
}

.fs-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 0 22px 12px;
}

.fs-head-brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #d8a657;
}

.fs-head-no {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #9a927f;
  white-space: nowrap;
}

/* 日期 · 张数 · 天气 · 心情：单独一行、不换行（与热敏一致） */
.fs-headmeta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #9a927f;
  padding: 0 22px 12px;
  margin-top: -6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fs-headmeta>div+div {
  margin-top: 2px;
}

.fs-strip {
  position: relative;
  padding: 0 28px;
}

.fs-holes {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
}

.fs-holes i {
  width: 14px;
  height: 10px;
  background: #000;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px #2c2820;
}

.fs-frames {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 6px 0;
}

.fs-frame {
  background: #0b0a07;
  border: 1px solid #3a352a;
}

.fs-frame-no {
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  color: #d8a657;
  padding: 5px 8px 3px;
}

.fs-frame-img {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #050403;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fs-frame-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.82) contrast(1.05) saturate(0.92);
}

/* 定制：胶片帧比例（original=原图比例，方/4:3 走 cover） */
.fs-frame-img.fs-ratio-square {
  aspect-ratio: 1 / 1;
}

.fs-frame-img.fs-ratio-43 {
  aspect-ratio: 4 / 3;
}

.fs-frame-img.fs-ratio-original {
  aspect-ratio: auto;
}

.fs-frame-img.fs-ratio-original img {
  height: auto;
}

.fs-frame-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(10, 9, 6, 0.22);
  pointer-events: none;
}

.fs-frame-ico {
  width: 40px;
  height: 40px;
  opacity: 0.5;
}

.fs-frame-ico svg {
  width: 100%;
  height: 100%;
}

.fs-frame-cap {
  padding: 9px 10px 11px;
}

.fs-frame-cat {
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #d8a657;
}

.fs-frame-task {
  display: block;
  font-family: var(--font-serif-cn);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.45;
  margin-top: 4px;
  color: #ece4cf;
  text-wrap: pretty;
}

.fs-frame-note {
  display: block;
  font-family: var(--font-cn);
  font-style: italic;
  font-size: 11.5px;
  line-height: 1.5;
  color: #9a927f;
  margin-top: 3px;
}

.fs-note {
  font-family: var(--font-serif-cn);
  font-style: italic;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.5;
  color: #ece4cf;
  margin: 14px 0 0;
  padding: 0 28px;
  text-wrap: pretty;
}

.fs-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 28px 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.fs-foot span:first-child {
  color: #d8a657;
  font-weight: 700;
}

.fs-foot span:last-child {
  color: #9a927f;
}

/* ============================================================
   Setup 填满布局 — 票根网格 + 设置项填满一屏，不滚动
   ============================================================ */
.df-scroll--setup {
  display: flex;
  flex-direction: column;
  overflow-y: hidden;
  padding-bottom: 10px;
}

.df-scroll--setup .df-q {
  flex: 0 0 auto;
  font-size: 26px;
  margin: 0 0 6px;
}

/* 票根区撑开填满剩余空间；overflow:hidden 兜底，绝不压到下方设置项 */
.df-scroll--setup .tk-zone {
  flex: 1;
  min-height: 0;
  margin-top: 6px;
  overflow: hidden;
}

/* 网格撑满票根区高度；行高 = minmax(min-content, 1fr)：
   - 永不低于卡片自然高度 → 卡片绝不重叠
   - 有余量时行扩展，卡片随行拉伸（align-items:stretch）→ 行间缝隙恒为 9px，
     高度自适应屏幕，大屏不会出现过大的空隙 */
.df-scroll--setup .tk-grid {
  height: 100%;
  grid-auto-rows: minmax(min-content, 1fr);
  align-items: stretch;
}

/* 卡片随行拉伸后：用 flex 列把 meta 推到底部，内容上下铺开不挤在顶部 */
.df-scroll--setup .tk {
  display: flex;
  flex-direction: column;
  padding-bottom: 6px;
}

/* meta 推到底并紧贴卡片底边 */
.df-scroll--setup .tk-meta {
  margin-top: auto;
}

/* 压低票根卡片高度：收紧齿孔 / admit / 标题 / meta 的内边距与字号 */
.df-scroll--setup .tk-perf {
  height: 6px;
}

.df-scroll--setup .tk-admit {
  padding-top: 7px;
}

/* 标题字号随屏幕尺寸自适应（高度为主、宽度为辅），小屏 17 / 大屏封顶 25 */
.df-scroll--setup .tk-name {
  font-size: clamp(17px, 2.1vh + 1.6vw, 25px);
  padding-top: 3px;
  padding-bottom: 0;
}

.df-scroll--setup .tk-meta {
  padding-bottom: 0;
}

/* 设置项整组永远贴底（margin-top:auto 吸到滚动区底部）；行间距收紧 */
.df-scroll--setup .df-quick {
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: 6px;
}

/* 每个 config 一行；放不下时横向滑动，绝不换行；行间距收紧 */
.df-scroll--setup .ink-row {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 0;
  scrollbar-width: none;
}

.df-scroll--setup .ink-row::-webkit-scrollbar {
  height: 0;
}

.df-scroll--setup .ink-opt {
  flex: 0 0 auto;
  padding: 5px 6px;
}

/* 行标签横向滚动时固定可见 */
.df-scroll--setup .ink-lab {
  position: sticky;
  left: 0;
  background: var(--paper);
  z-index: 1;
}

/* 数量滑块行：标签 + 拖动条 + 当前值，不横向滚动 */
.df-scroll--setup .ink-row--range {
  align-items: center;
  overflow-x: visible;
  gap: 10px;
}

.ink-range {
  flex: 0 0 auto;
  width: 150px;
  max-width: 50%;
  height: 22px;
  margin: 0;
  background: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.ink-range::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  background: var(--line);
}

.ink-range::-moz-range-track {
  height: 3px;
  border-radius: 999px;
  background: var(--line);
}

.ink-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -8.5px;
  border-radius: 50%;
  background: var(--accent-orange);
  border: 2px solid var(--rcpt-paper);
  box-shadow: 0 1px 3px rgba(40, 34, 20, 0.3);
}

.ink-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-orange);
  border: 2px solid var(--rcpt-paper);
  box-shadow: 0 1px 3px rgba(40, 34, 20, 0.3);
}

.ink-range-val {
  flex: 0 0 auto;
  min-width: 42px;
  text-align: right;
  font-family: var(--font-cn);
  font-size: 14px;
  font-weight: 900;
  color: var(--accent-orange);
}

/* 小屏（窄或矮）：整体字号进一步收紧，保证一屏放得下 */
@media (max-width: 380px),
(max-height: 760px) {
  .df-scroll--setup .df-q {
    font-size: 22px;
    margin: 2px 0 4px;
  }

  .df-scroll--setup .tk-admit {
    font-size: 8px;
    padding-top: 6px;
  }

  .df-scroll--setup .tk-meta {
    font-size: 9px;
  }

  .df-scroll--setup .ink-opt {
    font-size: 13px;
    padding: 4px 6px;
  }

  .df-scroll--setup .ink-lab {
    font-size: 9px;
  }
}

/* ============ 扫码进入：选择「玩同一组」/「新开一组」 ============ */
.df--share {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* 分享选择页顶部品牌：与开屏页 .splash-brand-img 同款 logo、同样大小（260px）。
   占据画布上 2/5 并垂直居中，使 logo 落在上区中央，而非贴顶。 */
.se-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--safe-top) 18px 0;
  flex: 0 0 40%;
}

.se-brand-img {
  display: block;
  width: 260px;
  height: auto;
  object-fit: contain;
}

/* 下区占 3/5，整页不滚动：内容在该区内垂直居中、固定一屏 */
.df-scroll--share {
  flex: 0 0 60%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  justify-content: center;
}

.se-status {
  text-align: center;
  color: var(--ink-soft);
  font-size: 15px;
  padding: 40px 12px;
}

.se-status--err {
  color: var(--ink);
}

.se-card {
  background: var(--paper-2);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 18px 16px;
}

.se-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.se-card-no {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.se-lead {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.se-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.se-task {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 8px;
}

.se-task-no {
  font-family: var(--font-mono, monospace);
  font-size: 10.5px;
  color: var(--ink-faint);
}

.se-task-ic {
  display: inline-flex;
  width: 22px;
  height: 22px;
}

.se-task-ic svg {
  width: 100%;
  height: 100%;
}

.se-task-txt {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.4;
}

.se-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 扫码选择页无底部操作栏：按钮在内容区内，隐藏空 foot */
.df-foot--empty {
  display: none;
}