/* ============================================================
   捏朵云 · 全局样式
   逻辑分辨率 1600×900（16:9），由 #stage transform 等比缩放
   ============================================================ */

:root {
  --cream: #F7EEDF;
  --paper: #FBF6EC;
  --ink: #5A4A40;
  --ink-soft: #8B6F47;
  --outline: #8B6248;
  --track: #EFE2CC;

  --stage-w: 1600px;
  --stage-h: 900px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #E8DCC9;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

#viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

#stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--stage-w);
  height: var(--stage-h);
  transform: translate(-50%, -50%);
  transform-origin: 50% 50%;
  overflow: hidden;
  background: var(--cream);
  will-change: transform;
}

/* ---------- 场景通用 ---------- */
.scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .36s ease-in-out;
}

.scene.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

.scene__bg {
  position: absolute;
  inset: 0;
  background-position: 50% 50%;
  background-repeat: no-repeat;
  background-size: var(--stage-w) var(--stage-h);
}

/* ---------- P00 加载 ---------- */
.scene__bg--loading {
  background-image: url("../assets/scenes/loading_16x9.png");
}

/* 设计图内已烘焙一条静态进度条，这里用与背景同色的遮片盖住，
   再把可动的进度条画在同一位置（位置从原图量取） */
.loading-patch {
  position: absolute;
  left: 420px;
  top: 648px;
  width: 760px;
  height: 120px;
  background: linear-gradient(180deg, #F8ECD8 0%, #F8ECD7 55%, #F7EBD5 100%);
}

.loading-progress {
  position: absolute;
  left: 487px;
  top: 737px;
  width: 624px;
  height: 25px;
  border-radius: 13px;
  background: var(--track);
}

.loading-progress__fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  border-radius: 13px;
  background: linear-gradient(180deg, #FBD37A 0%, #F7C962 100%);
}

.loading-progress__knob {
  position: absolute;
  left: 0;
  bottom: 7px;
  width: 80px;
  height: 60px;
  transform: translateX(-50%);
  filter: drop-shadow(0 3px 0 rgba(139, 98, 72, .10));
}

.loading-progress__knob svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* ---------- P01 天台（占位） ---------- */
.scene__bg--hub {
  background-image: url("../assets/scenes/hub.jpg");
}

.hub-cta {
  position: absolute;
  left: 380px;
  top: 764px;
  width: 640px;
  height: 88px;
  padding: 0;
  border: 0;
  background: url("../assets/ui_kit/ui_btn_primary_jiedan_2x.png") 0 0 / 100% 100% no-repeat;
  cursor: pointer;
  transition: transform .1s ease, filter .1s ease;
}

.hub-cta:hover { transform: translateY(-2px); }
.hub-cta:active { transform: translateY(2px); filter: brightness(.97); }

.hub-hint {
  position: absolute;
  left: 380px;
  top: 866px;
  width: 640px;
  margin: 0;
  text-align: center;
  font-size: 18px;
  line-height: 1;
  color: var(--ink-soft);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease;
}

.hub-hint.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 背景图里已经画好客人卡与老奶奶，这里铺两块透明热区，
   让「点卡片 / 点人」与「接单」等价（AC-02） */
.hub-spot {
  position: absolute;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 28px;
  cursor: pointer;
  transition: background .16s ease;
}

.hub-spot:hover { background: rgba(255, 253, 247, .16); }
.hub-spot:active { background: rgba(255, 253, 247, .26); }

.hub-spot--card {
  left: 86px;
  top: 148px;
  width: 516px;
  height: 235px;
}

/* 今日客人立牌：盖住原画里烘焙的老奶奶，随订单换人。
   上移但宽度不变，保持对原画人物的覆盖；底部止于 540，避免撞烘焙图标条（top 586） */
.hub-guest {
  position: absolute;
  left: 1060px;
  top: 170px;
  width: 320px;
  height: 400px;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  transform: none;
  transition: transform .16s ease, filter .16s ease;
  filter: drop-shadow(0 18px 22px rgba(90, 74, 64, .18));
}

/* 金币 capsule 在 y=64~124，立牌 y=170 起 → gap 46px，物理不重叠 */

.hub-guest:hover { transform: translateY(-4px); filter: drop-shadow(0 22px 30px rgba(90, 74, 64, .22)); }
.hub-guest:active { transform: translateY(1px); }

/* 完全删掉 ::before 白卡、::after 木托、__tape 胶带、__tag 徽章 */

.hub-guest__photo {
  position: relative;
  z-index: 1;
  display: block;
  width: 290px;
  height: 310px;
  margin: 0 auto 4px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.hub-guest__photo .customer-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}

.hub-guest__name {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}

.hub-guest__role {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.3;
  color: #9A8674;
}

/* ============================================================
   P04 捏云界面（S1）
   ============================================================ */
.scene--craft { overflow: hidden; }

.craft-sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    #D9D3F0 0%,
    #E9DAEC 26%,
    #F5E3DC 54%,
    #F9EAD6 78%,
    #FAEDDA 100%);
}

.craft-glow {
  position: absolute;
  left: 580px;
  top: 190px;
  width: 640px;
  height: 520px;
  background: radial-gradient(closest-side,
    rgba(255, 255, 255, .62) 0%,
    rgba(255, 255, 255, .22) 55%,
    rgba(255, 255, 255, 0) 100%);
}

.craft-shadow {
  position: absolute;
  left: 690px;
  top: 664px;
  width: 420px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(closest-side,
    rgba(139, 98, 72, .16) 0%,
    rgba(139, 98, 72, 0) 100%);
}

/* 云体光影层：垫在轮廓层下面，只负责体积和投影 */
#shade-canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--stage-w);
  height: var(--stage-h);
  pointer-events: none;
  will-change: transform;
}

#cloud-canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--stage-w);
  height: var(--stage-h);
  cursor: none;
  touch-action: none;
}

/* 喷壶颜色层：画在云体之上，用 CSS clip-path 裁成云形 */
#paint-canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--stage-w);
  height: var(--stage-h);
  pointer-events: none;
  will-change: transform;
}

/* 装饰贴纸层：平时只负责显示，进入装饰模式才接收拖动 */
#decor-canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--stage-w);
  height: var(--stage-h);
  pointer-events: none;
  will-change: transform;
}

.scene--craft.is-decorating #decor-canvas {
  pointer-events: auto;
  cursor: grab;
}

.scene--craft.is-decorating #decor-canvas:active {
  cursor: grabbing;
}

.craft-ui {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.craft-back {
  position: absolute;
  left: 48px;
  top: 40px;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: rgba(255, 253, 247, .92);
  background-image: url("../assets/icons_cut/ui_icon_back_2x.png");
  background-position: center;
  background-size: 56% 56%;
  background-repeat: no-repeat;
  cursor: pointer;
  pointer-events: auto;
  transition: transform .1s ease, box-shadow .1s ease;
  box-shadow: 0 4px 14px rgba(90, 74, 64, .18);
  z-index: 3;
}

.craft-back:hover { transform: scale(1.06); }
.craft-back:active { transform: scale(.96); }

.craft-bubble {
  position: absolute;
  right: 64px;
  top: 132px;
  width: 480px;
  height: 256px;
  /* 自带尖角尾巴的对话纸条；放在右上，尾巴指向中间云朵 */
  padding: 24px 28px 18px 32px;
  background: #FFFDF7 url("../assets/ui_kit/ui_bubble_order_2x.png") 0 0 / 100% 100% no-repeat;
  border: 2px solid rgba(139, 98, 72, .16);
  border-radius: 22px;
  box-shadow: 0 10px 24px rgba(90, 74, 64, .10);
  pointer-events: none;
  z-index: 3;
}

/* 对话气泡 — 向左上尖角指向云朵 */
.craft-bubble::before {
  content: '';
  position: absolute;
  left: -20px;
  bottom: 32px;
  width: 0;
  height: 0;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-right: 22px solid #FFFDF7;
  filter: drop-shadow(-1px 0 0 rgba(139, 98, 72, .16));
}

.craft-bubble__who {
  position: absolute;
  right: 28px;
  top: 26px;
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.craft-bubble__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
  border: 0;
}

.craft-bubble__avatar .customer-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 12%;
}

.craft-bubble__name {
  font-size: 14px;
  line-height: 1.2;
  color: var(--ink-soft);
  white-space: nowrap;
}

.craft-bubble__title {
  margin: 0 0 10px;
  padding-right: 92px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}

.craft-bubble__line {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.35;
  color: #7A6555;
}

.craft-bubble__tiny {
  margin: 0;
  font-size: 13px;
  line-height: 1.3;
  color: #9A8674;
}

.craft-guide {
  position: absolute;
  left: 80px;
  top: 414px;
  width: 480px;
  padding: 16px 20px 17px;
  border-radius: 20px;
  background: rgba(255, 253, 247, .78);
  border: 1px solid rgba(139, 98, 72, .14);
  box-shadow: 0 8px 22px rgba(90, 74, 64, .08);
  pointer-events: none;
}

.craft-guide__title {
  margin: 0 0 7px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-soft);
}

.craft-guide__text {
  margin: 0;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
}

/* ---------- 工具光标（DOM，跟随指针） ---------- */
.craft-cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease;
}

.craft-cursor.is-visible { opacity: 1; }

.craft-cursor--hand {
  border: 1.5px dashed rgba(139, 98, 72, .48);
  background: rgba(255, 255, 255, .16);
}

.craft-cursor--scissors {
  width: 52px;
  height: 52px;
  border: 1.5px dashed rgba(139, 98, 72, .72);
  background: rgba(255, 253, 247, .16);
}

.craft-cursor--scissors::before,
.craft-cursor--scissors::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 1.5px;
  border-radius: 2px;
  background: rgba(139, 98, 72, .78);
}

.craft-cursor--scissors::before { transform: translate(-50%, -50%) rotate(45deg); }
.craft-cursor--scissors::after { transform: translate(-50%, -50%) rotate(-45deg); }

.craft-cursor--spray {
  width: 40px;
  height: 40px;
  border: 1.5px dashed rgba(139, 98, 72, .5);
  background: rgba(169, 214, 229, .3);
  background: color-mix(in srgb, var(--brush, #A9D6E5) 32%, transparent);
}

/* ---------- 喷壶调色板 ---------- */
.craft-palette {
  position: absolute;
  left: 96px;
  top: 642px;
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 24px;
  background: rgba(255, 253, 247, .84);
  border: 1px solid rgba(139, 98, 72, .16);
  box-shadow: 0 8px 22px rgba(90, 74, 64, .10);
  pointer-events: auto;
}

.craft-palette[hidden] { display: none; }

.palette-swatch {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid rgba(139, 98, 72, .18);
  border-radius: 50%;
  background: var(--swatch, #FFFDF7);
  cursor: pointer;
  transition: transform .1s ease, box-shadow .15s ease;
}

.palette-swatch:hover { transform: translateY(-2px); }

.palette-swatch.is-selected {
  border-color: rgba(139, 98, 72, .52);
  box-shadow: 0 0 0 3px rgba(246, 214, 120, .55);
}

.craft-toolbar {
  position: absolute;
  left: 96px;
  top: 740px;
  display: flex;
  gap: 14px;
  padding: 16px;
  border-radius: 24px;
  background: rgba(255, 253, 247, .72);
  border: 1px solid rgba(139, 98, 72, .14);
  box-shadow: 0 10px 26px rgba(90, 74, 64, .10);
  pointer-events: auto;
  z-index: 10;
}

.tool-slot {
  position: relative;
  pointer-events: auto;
  width: 112px;
  height: 112px;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: none;
  cursor: pointer;
  transition: transform .1s ease;
}

.tool-slot__icon {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 24px;
}

.tool-slot:hover { transform: translateY(-2px); }

.tool-slot--selected {
  transform: translateY(-4px);
  box-shadow: 0 0 0 4px rgba(246, 214, 120, .30), 0 8px 18px rgba(229, 176, 72, .26);
}

.tool-slot--locked { cursor: not-allowed; }

.tool-slot--locked .tool-slot__icon {
  filter: grayscale(.75);
  opacity: .52;
}

.tool-slot__lock {
  position: absolute;
  right: -8px;
  top: -8px;
  width: 36px;
  height: 36px;
}

.tool-slot__price {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(90, 74, 64, .70);
  font-size: 13px;
  line-height: 1.4;
  color: #FFFDF7;
  white-space: nowrap;
}

.tool-slot__price[hidden] { display: none; }

.craft-submit {
  position: absolute;
  left: 880px;
  top: 752px;
  width: 640px;
  height: 88px;
  padding: 0;
  border: 0;
  background: url("../assets/ui_kit/ui_btn_primary_jiuzheyang_2x.png") 0 0 / 100% 100% no-repeat;
  cursor: pointer;
  pointer-events: auto;
  transition: transform .1s ease, filter .1s ease;
}

.craft-submit:hover { transform: translateY(-2px); }
.craft-submit:active { transform: translateY(2px); filter: brightness(.97); }

/* ---------- 云朵装饰 ---------- */

.craft-decor-toggle {
  position: absolute;
  right: 48px;
  top: 92px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 24px;
  border: 1px solid rgba(139, 98, 72, .18);
  border-radius: 999px;
  background: rgba(255, 253, 247, .82);
  box-shadow: 0 10px 22px rgba(90, 74, 64, .10);
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.craft-decor-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(90, 74, 64, .14);
}

.craft-decor-toggle.is-open {
  background: #FFF6E4;
  box-shadow: 0 0 0 3px rgba(246, 214, 120, .35);
}

.craft-decor-toggle__spark {
  color: #E9A93F;
  font-size: 20px;
  line-height: 1;
}

.decor-panel {
  position: absolute;
  right: 48px;
  top: 164px;
  width: 360px;
  padding: 20px 22px 18px;
  border-radius: 24px;
  background: rgba(255, 253, 247, .94);
  border: 1px solid rgba(139, 98, 72, .14);
  box-shadow: 0 18px 40px rgba(90, 74, 64, .16);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.decor-panel[hidden] { display: none; }

.decor-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.decor-panel__title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.decor-done {
  height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: #F2C65C;
  color: #6B4A2F;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.decor-done:hover { filter: brightness(1.03); }

.decor-tabs { display: flex; gap: 8px; }

.decor-tab {
  flex: 1;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: #F4EADA;
  color: var(--ink-soft);
  font-size: 16px;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}

.decor-tab.is-active {
  background: #FFF3D6;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(139, 98, 72, .16);
}

.decor-pane[hidden] { display: none; }

.decor-pane__hint {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: #9A8674;
}

.decor-colors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.decor-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 0 8px;
  border: 0;
  border-radius: 16px;
  background: #FBF5EA;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: box-shadow .12s ease;
}

.decor-swatch::before {
  content: "";
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--swatch);
  border: 1px solid rgba(139, 98, 72, .20);
  box-shadow: inset 0 -4px 8px rgba(90, 74, 64, .06);
}

.decor-swatch.is-selected { box-shadow: 0 0 0 2px rgba(233, 169, 63, .55); }
.decor-swatch.is-selected::before { border-color: rgba(233, 169, 63, .8); }

.decor-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.decor-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0 4px;
  border: 0;
  border-radius: 14px;
  background: #FBF5EA;
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
}

.decor-item:hover { background: #FFF3D6; }

.decor-item__preview {
  width: 56px;
  height: 56px;
}

.decor-item__label { line-height: 1; }

/* 付费装饰：未拥有时灰化 + 价格角标 */
.decor-item.is-locked { background: #EFE6D6; }
.decor-item.is-locked .decor-item__preview { opacity: .55; filter: grayscale(.7); }
.decor-item.is-locked .decor-item__label { color: #A9957C; }
.decor-item__price {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #E9A93F;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  box-shadow: 0 1px 3px rgba(139, 98, 72, .25);
}
.decor-item__price[hidden] { display: none; }
.decor-item.is-locked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: rgba(139, 98, 72, .55);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M7 10V8a5 5 0 0 1 10 0v2h1a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2z' fill='black'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M7 10V8a5 5 0 0 1 10 0v2h1a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2z' fill='black'/></svg>") center / contain no-repeat;
}

@keyframes decorShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.decor-item.is-shake { animation: decorShake .42s ease; }

.decor-panel__foot { display: flex; gap: 10px; }

.decor-remove,
.decor-clear {
  flex: 1;
  height: 40px;
  border: 1px solid rgba(139, 98, 72, .16);
  border-radius: 12px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
}

.decor-remove:disabled { opacity: .45; cursor: default; }

/* ---------- 水晶球成品 ---------- */

.crystal-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: rgba(80, 62, 52, .28);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: auto;
}

.crystal-overlay[hidden] { display: none; }
.crystal-overlay.is-open { opacity: 1; }

.crystal {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: crystal-float 4s ease-in-out infinite;
}

.crystal__ball {
  position: relative;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 26%,
    rgba(255, 255, 255, .95),
    rgba(226, 240, 248, .50) 42%,
    rgba(198, 222, 238, .28) 70%,
    rgba(150, 186, 208, .35) 100%);
  border: 2px solid rgba(255, 255, 255, .75);
  box-shadow:
    0 0 0 8px rgba(255, 255, 255, .16),
    0 26px 60px rgba(70, 52, 44, .32),
    inset 0 -20px 50px rgba(150, 186, 208, .32);
  overflow: hidden;
}

.crystal__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.crystal__shine {
  position: absolute;
  left: 12%;
  top: 10%;
  width: 32%;
  height: 22%;
  border-radius: 50%;
  background: linear-gradient(140deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0));
  transform: rotate(-24deg);
  filter: blur(2px);
}

.crystal__spark {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #FFF6D8;
  box-shadow: 0 0 12px 4px rgba(255, 236, 170, .85);
  animation: crystal-twinkle 2.4s ease-in-out infinite;
}

.crystal__spark--a { right: 14%; top: 24%; }
.crystal__spark--b { left: 18%; bottom: 22%; animation-delay: 1.1s; }

.crystal__base {
  width: 260px;
  height: 46px;
  margin-top: -18px;
  border-radius: 0 0 40% 40% / 0 0 100% 100%;
  background: linear-gradient(#C9A277, #9A724F);
  box-shadow: 0 14px 26px rgba(70, 52, 44, .28);
}

.crystal__base::before {
  content: "";
  display: block;
  width: 300px;
  height: 22px;
  margin-left: -20px;
  border-radius: 50%;
  background: linear-gradient(#E7CFA9, #C9A277);
}

.crystal__hint {
  margin: 0;
  font-size: 15px;
  letter-spacing: .04em;
  color: rgba(255, 253, 247, .92);
}

@keyframes crystal-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes crystal-twinkle {
  0%, 100% { opacity: .25; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

.craft-toast {
  position: absolute;
  left: 50%;
  top: 26px;
  transform: translate(-50%, -8px);
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(255, 253, 247, .92);
  border: 1px solid rgba(139, 98, 72, .16);
  font-size: 16px;
  color: #7A6555;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.craft-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* P03 准备阶段：抽屉浮层盖住时先收起捏云 UI */
.craft-ui { transition: opacity .2s ease; }
.scene--craft.is-prepping .craft-ui {
  opacity: 0;
  pointer-events: none;
}

/* ============================================================
   P02 订单气泡 / P03 工具面板（S2 浮层）
   ============================================================ */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  opacity: 0;
  transition: opacity .3s ease;
}

.overlay[hidden] { display: none; }
.overlay.is-open { opacity: 1; }

.overlay__mask { position: absolute; inset: 0; }

.overlay--order .overlay__mask {
  background: rgba(90, 74, 64, .08);
}

.overlay--tools .overlay__mask {
  background: rgba(90, 74, 64, .10);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

/* ---------- P02 订单气泡 ---------- */
.order-card {
  position: absolute;
  left: 160px;
  top: 170px;
  width: 1280px;
  height: 540px;
  border-radius: 34px;
  overflow: hidden;
  background: #FFFDF7 url("../assets/ui_kit/ui_bubble_order_2x.png") 0 0 / 100% 100% no-repeat;
  border: 2px solid rgba(139, 98, 72, .28);
  box-shadow: 0 18px 50px rgba(90, 74, 64, .20),
              inset 0 0 0 2px rgba(255,255,255,.65);
  opacity: 0;
  transform: translateY(42px);
  transition: transform .35s cubic-bezier(.2, .85, .3, 1), opacity .28s ease;
}

.overlay.is-open .order-card {
  opacity: 1;
  transform: translateY(0);
}

/* 「换一单」：先向左轻滑淡出，再换文案滑回（0.25s 一轮） */
.overlay.is-open .order-card.is-swapping {
  opacity: 0;
  transform: translateX(-28px);
  transition-duration: .14s;
}

.order-card__avatar {
  position: absolute;
  left: 0;
  top: 0;
  width: 340px;
  height: 100%;
  overflow: visible;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* 立绘无框无底：透明 PNG 直接站在卡片左侧 */
.order-card__avatar .customer-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 8px 18px rgba(90, 74, 64, .18));
}

.order-card__name {
  position: absolute;
  left: 360px;
  top: 468px;
  width: 300px;
  margin: 0;
  text-align: left;
}

.order-card__name-main {
  display: inline-block;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}

.order-card__name-role {
  display: inline-block;
  margin-left: 12px;
  font-size: 13px;
  line-height: 1.3;
  color: #9A8674;
}

.order-card__body {
  position: absolute;
  left: 360px;
  top: 44px;
  right: 52px;
  padding: 22px 26px 22px;
  border-radius: 22px;
  background: rgba(255,255,255,.52);
  border: 1px solid rgba(139, 98, 72, .14);
  box-shadow: none;
}

/* 对话气泡尖角 — 指向左侧立绘（现在不需要了，body 变成半透明贴在大卡片上） */
.order-card__body::before {
  content: none;
}

.order-card__line {
  margin: 0;
  min-height: 84px;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}

.order-card__meta {
  margin: 4px 0 0;
  font-size: 22px;
  line-height: 1.4;
  color: var(--ink-soft);
}

.order-card__actions {
  position: absolute;
  left: 304px;
  right: 52px;
  bottom: 48px;
  height: 72px;
  display: flex;
  gap: 24px;
}

.order-btn {
  flex: 1;
  height: 72px;
  padding: 0;
  border: 0;
  background-position: 0 0;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  cursor: pointer;
  transition: transform .1s ease, filter .1s ease;
}

.order-btn--secondary { background-image: url("../assets/ui_kit/ui_btn_secondary_huanyidan_2x.png"); }
.order-btn--primary { background-image: url("../assets/ui_kit/ui_btn_primary_jiexia_2x.png"); }

.order-btn:hover { transform: translateY(-2px); }
.order-btn:active { transform: translateY(1px); filter: brightness(.97); }

/* ---------- P03 工具面板 ---------- */
.tool-drawer {
  position: absolute;
  left: 300px;
  bottom: 0;
  width: 1000px;
  height: 500px;
  padding: 38px 56px;
  background: #FFFDF7;
  border: 2px solid rgba(139, 98, 72, .18);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -18px 50px rgba(90, 74, 64, .16);
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.2, .85, .3, 1);
  pointer-events: auto;
  z-index: 10;
}

.overlay.is-open .tool-drawer {
  transform: translateY(0);
}

.tool-drawer__title {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  color: var(--ink);
}

.tool-drawer__hint {
  margin: 8px 0 0;
  font-size: 17px;
  color: #8B7563;
}

.tool-drawer__back {
  position: absolute;
  right: 56px;
  top: 42px;
  padding: 6px 0;
  border: 0;
  background: none;
  font-size: 18px;
  color: var(--ink-soft);
  cursor: pointer;
}

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

.tool-drawer__slots {
  position: absolute;
  left: 56px;
  right: 56px;
  top: 148px;
  display: flex;
  justify-content: center;
  gap: 24px;
}

.drawer-slot {
  position: relative;
  width: 128px;
  padding: 0;
  border: 0;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform .1s ease;
  pointer-events: auto;
  z-index: 10;
}

.drawer-slot:hover { transform: translateY(-2px); }

.drawer-slot__icon {
  width: 112px;
  height: 112px;
  border-radius: 24px;
}

.drawer-slot__name {
  margin-top: 10px;
  font-size: 18px;
  line-height: 1.2;
  color: var(--ink);
}

.drawer-slot__note {
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.2;
  color: #9A8674;
}

.drawer-slot.is-selected .drawer-slot__icon {
  box-shadow: 0 0 0 4px rgba(246, 214, 120, .34), 0 8px 18px rgba(229, 176, 72, .26);
}

.drawer-slot.is-locked,
.drawer-slot.is-soon { cursor: not-allowed; }

.drawer-slot.is-locked .drawer-slot__icon,
.drawer-slot.is-soon .drawer-slot__icon {
  filter: grayscale(.72);
  opacity: .55;
}

.drawer-slot__lock {
  position: absolute;
  right: -6px;
  top: -6px;
  width: 36px;
  height: 36px;
}

.drawer-slot__placeholder {
  width: 112px;
  height: 112px;
  border: 2px dashed rgba(139, 98, 72, .34);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: rgba(139, 98, 72, .48);
}

.drawer-start {
  position: absolute;
  left: 50%;
  bottom: 40px;
  width: 520px;
  height: 72px;
  padding: 0;
  border: 0;
  background: url("../assets/ui_kit/ui_btn_primary_kaishi_2x.png") 0 0 / 100% 100% no-repeat;
  transform: translateX(-50%);
  cursor: pointer;
  transition: transform .1s ease, filter .1s ease;
}

.drawer-start:hover { transform: translateX(-50%) translateY(-2px); }
.drawer-start:active { transform: translateX(-50%) translateY(1px); filter: brightness(.97); }

.drawer-toast {
  position: absolute;
  left: 50%;
  bottom: 130px;
  padding: 9px 20px;
  border-radius: 999px;
  background: rgba(255, 253, 247, .96);
  border: 1px solid rgba(139, 98, 72, .18);
  font-size: 16px;
  color: #7A6555;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 6px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.drawer-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ============================================================
   S4 金币 HUD
   ============================================================ */
.coin-pill {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 60px;
  padding: 0 24px 0 16px;
  border-radius: 999px;
  background: rgba(255, 253, 247, .96);
  border: 1px solid rgba(139, 98, 72, .16);
  box-shadow: 0 8px 20px rgba(90, 74, 64, .14);
  font-size: 26px;
  line-height: 1;
  color: var(--ink);
  pointer-events: none;
  z-index: 5;
}

/* 天台背景里自带「金币 $ 123」字样，用胶囊整块盖住，避免出现两个余额 */
.coin-pill--hub {
  left: 1160px;
  top: 64px;
  width: 400px;
  height: 68px;
  justify-content: flex-end;
  padding: 0 28px 0 30px;
  /* 必须是实色，否则背景图里烘焙的「金币 $ 123」会透出来 */
  background: #FFFDF7;
}

.coin-pill--hub .coin-pill__label {
  margin-right: auto;
  font-size: 24px;
  color: var(--ink-soft);
}

.coin-pill--craft { right: 220px; top: 40px; }

.coin-pill__icon { width: 40px; height: 40px; }

.coin-pill__value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   P08 设置浮层
   ============================================================ */
.overlay--settings { z-index: 11; }

.overlay--settings .overlay__mask {
  background: rgba(90, 74, 64, .18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.settings-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 620px;
  padding: 42px 52px 32px;
  margin: -300px 0 0 -310px;
  border-radius: 26px;
  background: #FFFDF7;
  border: 2px solid rgba(139, 98, 72, .18);
  box-shadow: 0 26px 70px rgba(90, 74, 64, .22);
  opacity: 0;
  transform: translateY(30px) scale(.97);
  transition: opacity .3s ease, transform .34s cubic-bezier(.2, .85, .3, 1);
}

.overlay.is-open .settings-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.settings-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}

.settings-panel__title {
  margin: 0;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--ink);
}

.settings-close {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #F4E9D7;
  font-size: 22px;
  color: #9A8674;
  cursor: pointer;
  transition: transform .1s ease, background .1s ease;
}

.settings-close:hover { background: #EADBC0; transform: scale(1.05); }
.settings-close:active { transform: scale(.95); }

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 82px;
  padding: 0 18px;
  border-radius: 18px;
  background: rgba(247, 238, 223, .6);
  border: 1px solid rgba(139, 98, 72, .10);
}

.settings-row__icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #FFFDF7;
  border: 1px solid rgba(139, 98, 72, .14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
}

.settings-row__body { flex: 1; min-width: 0; }

.settings-row__title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}

.settings-row__hint {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.settings-switch {
  flex: 0 0 auto;
  position: relative;
  width: 84px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #E1D4BE;
  cursor: pointer;
  transition: background .2s ease;
}

.settings-switch::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #FFFDF7;
  box-shadow: 0 3px 8px rgba(90, 74, 64, .20);
  transition: transform .24s cubic-bezier(.2, .8, .3, 1);
}

.settings-switch[aria-pressed="true"] {
  background: #E5BE6D;
}

.settings-switch[aria-pressed="true"]::after {
  transform: translateX(38px);
}

.settings-panel__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(139, 98, 72, .10);
}

.settings-clear {
  height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid rgba(192, 112, 100, .35);
  background: #FFFDF7;
  color: #B65C50;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  transition: background .1s ease, transform .1s ease;
}

.settings-clear:hover { background: #FCECE8; transform: translateY(-1px); }
.settings-clear:active { transform: translateY(1px); }

.settings-panel__version {
  margin: 0;
  font-size: 13px;
  letter-spacing: .08em;
  color: #B5A58F;
}

/* ============================================================
   P05 结算浮层
   ============================================================ */
.overlay--result { z-index: 12; }

.overlay--result .overlay__mask {
  background: rgba(90, 74, 64, .14);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

/* ---------- P09 对话模式（经典视觉小说） ---------- */
.overlay--dialog {
  z-index: 20;
}

/* 深色模糊遮罩，让后台天台/画布变得朦胧 */
.dialog-mask {
  position: absolute;
  inset: 0;
  background: rgba(60, 48, 40, .42);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
          backdrop-filter: blur(8px) saturate(1.1);
  pointer-events: none;
}

/* 左上返回按钮，和 craft-back / match-back 同款圆形白 */
.dialog-back {
  position: absolute;
  left: 48px;
  top: 40px;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: rgba(255, 253, 247, .92);
  background-image: url("../assets/icons_cut/ui_icon_back_2x.png");
  background-position: center;
  background-size: 56% 56%;
  background-repeat: no-repeat;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(90, 74, 64, .18);
  z-index: 23;
  transition: transform .1s ease;
}
.dialog-back:hover { transform: scale(1.06); }

/* 对话立绘：透明 PNG 直接浮在遮罩上，无框无底 */
.dialog-portrait {
  position: absolute;
  left: 96px;
  bottom: 132px;
  width: 560px;
  height: 760px;
  z-index: 21;
  pointer-events: none;
}

.dialog-portrait .customer-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 10px 24px rgba(0,0,0,.22));
  animation: dialog-portrait-in .55s cubic-bezier(.2, .85, .3, 1);
}

@keyframes dialog-portrait-in {
  0%   { opacity: 0; transform: translateY(24px) scale(.98); }
  100% { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* 名字条：贴在立绘右上的小标签 */
.dialog-namebar {
  position: absolute;
  left: 664px;
  bottom: 760px;
  padding: 8px 20px;
  border-radius: 999px;
  background: rgba(255, 253, 247, .94);
  border: 1px solid rgba(139, 98, 72, .18);
  box-shadow: 0 4px 10px rgba(90, 74, 64, .12);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  z-index: 22;
  opacity: 0;
  transform: translateY(8px);
  animation: dialog-namebar-in .4s ease .18s forwards;
}

@keyframes dialog-namebar-in {
  to { opacity: 1; transform: translateY(0); }
}

.dialog-namebar__dot { margin: 0 10px; color: #B99A80; }
.dialog-namebar__role { color: #8E7A68; font-weight: 400; font-size: 14px; }

/* 底部对话气泡：居中的大卡片 */
.dialog-box {
  position: absolute;
  left: 50%;
  bottom: 56px;
  width: 1280px;
  height: 180px;
  margin-left: -640px;
  padding: 28px 36px 42px;
  border-radius: 28px;
  background: #FFFDF7;
  border: 2px solid rgba(139, 98, 72, .22);
  box-shadow: 0 18px 40px rgba(90, 74, 64, .20);
  z-index: 22;
  opacity: 0;
  transform: translateY(16px);
  animation: dialog-box-in .45s cubic-bezier(.2, .85, .3, 1) .28s forwards;
  cursor: pointer; /* 整格可点击推进对白 */
}

@keyframes dialog-box-in {
  to { opacity: 1; transform: translateY(0); }
}

.dialog-text {
  margin: 0;
  font-size: 24px;
  line-height: 1.7;
  color: var(--ink);
  /* 打字机效果：整行淡入 */
  animation: dialog-text-flash .05s ease;
}

/* 句间短暂闪烁反馈（点击后才触发） */
.dialog-box.is-advancing .dialog-text {
  animation: dialog-text-flash .22s ease;
}
@keyframes dialog-text-flash {
  0%   { opacity: .45; transform: translateY(3px); }
  100% { opacity: 1;    transform: translateY(0);    }
}

/* 右下角 ▼ 提示点击推进 */
.dialog-caret {
  position: absolute;
  right: 32px;
  bottom: 14px;
  font-size: 14px;
  color: #B99A80;
  animation: dialog-caret-bob 1.2s ease-in-out infinite;
}
@keyframes dialog-caret-bob {
  0%, 100% { opacity: .45; transform: translateY(0); }
  50%      { opacity: 1;   transform: translateY(4px); }
}

/* 最后一句时，气泡变按钮 — 直接把整格换成大按钮感 */
.dialog-box.is-final { cursor: pointer; }
.dialog-box.is-final .dialog-caret { animation: none; color: #E85C6A; }

/* 「好！就这单」按钮（叠在对话气泡下方或替换气泡） */
.dialog-accept {
  position: absolute;
  left: 50%;
  bottom: 260px; /* 比 dialog-box 高 24px，叠在它上面一点 */
  height: 72px;
  padding: 0 48px;
  margin-left: -140px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, #E85C6A, #D94452);
  color: #FFFDF7;
  font-size: 22px;
  font-weight: 600;
  box-shadow: 0 10px 26px rgba(232, 92, 106, .32);
  cursor: pointer;
  z-index: 22;
  opacity: 0;
  transform: translateY(10px) scale(.95);
  animation: dialog-accept-in .4s cubic-bezier(.2, .85, .3, 1) .6s forwards;
  transition: filter .12s ease;
}
.dialog-accept:hover { filter: brightness(1.06); }
.dialog-accept:active { transform: translateY(10px) scale(.94); }

@keyframes dialog-accept-in {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 对话模式下 coin-pill 自动缩到右下最小化 */
.stage.is-dialog-mode .coin-pill {
  left: auto !important;
  right: 40px;
  top: 80px;
  height: 44px;
  padding: 0 16px 0 12px;
  font-size: 20px;
  z-index: 24; /* 永远最顶 */
}
.stage.is-dialog-mode .coin-pill__icon { width: 28px; height: 28px; }
.stage.is-dialog-mode .coin-pill__label { display: none; }

/* 对话模式下隐藏所有底部按钮/图标 */
.stage.is-dialog-mode .hub-spot,
.stage.is-dialog-mode .hub-match,
.stage.is-dialog-mode .hub-cta,
.stage.is-dialog-mode .hub-draft {
  display: none;
}

.result-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 760px;
  height: 720px;
  margin: -360px 0 0 -380px;
  border-radius: 24px;
  background: #FFFDF7;
  border: 2px solid rgba(139, 98, 72, .18);
  box-shadow: 0 26px 70px rgba(90, 74, 64, .22);
  text-align: center;
  opacity: 0;
  transform: translateY(44px) scale(.97);
  transition: opacity .32s ease, transform .38s cubic-bezier(.2, .85, .3, 1);
}

.overlay.is-open .result-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.result-card__title {
  margin: 40px 0 0;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--ink);
}

.result-card__for {
  position: absolute;
  left: 30px;
  top: 28px;
  margin: 0;
  padding: 7px 16px;
  border-radius: 999px;
  background: #FDF0D2;
  border: 1px solid rgba(139, 98, 72, .22);
  font-size: 15px;
  line-height: 1.2;
  color: #8B6F47;
}

.result-card__for[hidden] { display: none; }

.result-thumb-wrap {
  position: relative;
  width: 480px;
  height: 360px;
  margin: 14px auto 0;
}

.result-thumb {
  display: block;
  width: 100%;
  height: 100%;
}

/* 成形柔光：0.6s 横向扫过一次，透明度 0→30%→0 */
.result-glow {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 246, 214, .9), rgba(255, 246, 214, 0));
  opacity: 0;
  pointer-events: none;
}

.overlay.is-open .result-glow {
  animation: resultSweep .6s .4s ease-out 1;
}

@keyframes resultSweep {
  0%   { opacity: 0; transform: translateX(-46%) scale(.90); }
  45%  { opacity: .55; }
  100% { opacity: 0; transform: translateX(46%) scale(1.05); }
}

.result-card__line {
  margin: 6px 40px 0;
  min-height: 44px;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .4s ease, transform .4s ease;
}

.result-card.is-revealed .result-card__line {
  opacity: 1;
  transform: translateY(0);
}

.result-card__coins {
  margin: 10px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 30px;
  font-weight: 600;
  color: #B97F2E;
  opacity: 0;
  transition: opacity .3s ease;
}

.result-card.is-revealed .result-card__coins { opacity: 1; }

.result-card__coin-icon { width: 40px; height: 40px; }

.result-card__coin-unit {
  font-size: 22px;
  font-weight: 500;
  color: var(--ink-soft);
}

.result-card__actions {
  position: absolute;
  left: 56px;
  right: 56px;
  bottom: 56px;
  display: flex;
  gap: 24px;
  opacity: .4;
  pointer-events: none;
  transition: opacity .25s ease;
}

.result-card.is-ready .result-card__actions {
  opacity: 1;
  pointer-events: auto;
}

.result-btn {
  flex: 1;
  height: 72px;
  padding: 0;
  border: 0;
  background-position: 0 0;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  cursor: pointer;
  transition: transform .1s ease, filter .1s ease;
}

.result-btn--secondary { background-image: url("../assets/ui_kit/ui_btn_secondary_zaiznie_2x.png"); }
.result-btn--primary { background-image: url("../assets/ui_kit/ui_btn_primary_shoucang_2x.png"); }

.result-btn:hover { transform: translateY(-2px); }
.result-btn:active { transform: translateY(1px); filter: brightness(.97); }

.result-toast {
  position: absolute;
  left: 50%;
  bottom: 148px;
  padding: 9px 20px;
  border-radius: 999px;
  background: rgba(255, 253, 247, .96);
  border: 1px solid rgba(139, 98, 72, .18);
  font-size: 16px;
  color: #7A6555;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 6px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.result-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ============================================================
   换背景 / 背景装饰
   ============================================================ */
.result-thumb-wrap { position: relative; }
.result-thumb { touch-action: none; }

/* 浮层里的预览画布：换背景 / 贴贴纸都在这块上生效 */
.bg-preview-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.bg-preview {
  width: 340px;
  height: 255px;
  border-radius: 16px;
  background: #FFFDF7;
  border: 2px solid #E4CCA3;
  box-shadow: 0 6px 18px rgba(139, 98, 72, .14);
  touch-action: none;
  cursor: grab;
}
.bg-preview:active { cursor: grabbing; }

.overlay--bg {
  z-index: 16;
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay--bg .overlay__mask {
  background: rgba(90, 74, 64, .14);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.overlay--bg .bg-card {
  position: relative;
  width: 920px;
  max-height: 812px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #FFFDF7 0%, #FBF2E2 100%);
  border: 2px solid #E4CCA3;
  border-radius: 26px;
  box-shadow: 0 18px 50px rgba(100, 70, 40, .25);
  padding: 22px 26px 20px;
  box-sizing: border-box;
}

.bg-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.bg-card__title {
  margin: 0;
  flex: 1;
  font-size: 26px;
  font-weight: 800;
  color: #6B4A38;
}
.coin-pill--bg {
  position: static;
  height: 38px;
  padding: 0 14px 0 10px;
  font-size: 18px;
  border-radius: 999px;
}
.coin-pill--bg .coin-pill__icon { width: 24px; height: 24px; }
.bg-card__close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #F1E0C4;
  color: #8B6248;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.bg-card__close:hover { background: #E4CCA3; }

.bg-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.bg-tab {
  padding: 8px 22px;
  border: 0;
  border-radius: 999px;
  background: #F1E0C4;
  color: #8B6248;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.bg-tab.is-active { background: #E9A93F; color: #fff; }

.bg-pane { flex: 1; min-height: 0; overflow: auto; }
.bg-pane[hidden] { display: none; }

.bg-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 4px;
}
.bg-pane[data-pane="scene"] .bg-grid { grid-template-columns: repeat(5, 1fr); }
.bg-pane[data-pane="decor"] .bg-grid { grid-template-columns: repeat(6, 1fr); }

.bg-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
  border: 2px solid transparent;
  border-radius: 16px;
  background: #FFFDF7;
  cursor: pointer;
}
.bg-item:hover { background: #FFF3D6; }
.bg-item.is-selected { border-color: #E9A93F; background: #FFF3D6; }
.bg-item.is-locked { background: #EFE6D6; }
.bg-item.is-locked .bg-item__label { color: #A9957C; }
.bg-item.is-locked .bg-item__preview { opacity: .6; filter: grayscale(.6); }

.bg-item__preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  display: block;
  box-shadow: inset 0 0 0 1px rgba(139, 98, 72, .12);
}
.bg-item__preview--decor {
  width: 56px;
  height: 56px;
  aspect-ratio: auto;
  box-shadow: none;
}
.bg-item__label { font-size: 13px; font-weight: 700; color: #6B4A38; }

.bg-item__price {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #E9A93F;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(139, 98, 72, .3);
}
.bg-item__price[hidden] { display: none; }

.bg-item.is-locked::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 10px;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: rgba(139, 98, 72, .6);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M7 10V8a5 5 0 0 1 10 0v2h1a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2z' fill='black'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M7 10V8a5 5 0 0 1 10 0v2h1a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2z' fill='black'/></svg>") center / contain no-repeat;
}
.bg-item.is-shake { animation: decorShake .42s ease; }

.bg-pane__hint {
  margin: 10px 4px 0;
  font-size: 13px;
  color: #A9957C;
  text-align: center;
}

.bg-card__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.bg-decor-remove {
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: #F3D7D7;
  color: #A45A5A;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.bg-decor-remove[hidden] { display: none; }
.bg-decor-remove:hover { background: #EBB8B8; }
.bg-card__done {
  margin-left: auto;
  padding: 10px 34px;
  border: 0;
  border-radius: 999px;
  background: #8FAE7B;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(120, 150, 100, .3);
}
.bg-card__done:hover { background: #7E9C6A; }

.bg-toast {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translate(-50%, -10px);
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 253, 247, .96);
  border: 1px solid rgba(139, 98, 72, .18);
  font-size: 14px;
  color: #7A6555;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.bg-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* 结算时收起捏云 UI */
.scene--craft.is-settling .craft-ui {
  opacity: 0;
  pointer-events: none;
}

/* ============================================================
   S5 相册入口 + 订单 / 设置（天台底部烘焙图标上的透明热区）
   三枚图标横向排开：订单 / 相册 / 设置
   ============================================================ */
.hub-spot--order {
  left: 1048px;
  top: 586px;
  width: 146px;
  height: 196px;
  border-radius: 24px;
}

.hub-spot--album {
  left: 1206px;
  top: 586px;
  width: 146px;
  height: 196px;
  border-radius: 24px;
}

.hub-spot--setting {
  left: 1364px;
  top: 586px;
  width: 146px;
  height: 196px;
  border-radius: 24px;
}

/* ============================================================
   P06 云朵相册
   ============================================================ */
.scene--album,
.scene--album-detail { overflow: hidden; }

.album-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 620px at 14% -10%, rgba(255, 255, 255, .88), rgba(255, 255, 255, 0) 70%),
    radial-gradient(760px 520px at 96% 112%, rgba(246, 228, 168, .45), rgba(246, 228, 168, 0) 72%),
    linear-gradient(180deg, #FAF4E8 0%, #F6EDDD 58%, #F2E6D2 100%);
}

.album-back,
.album-detail-back {
  position: absolute;
  left: 48px;
  top: 40px;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  background: url("../assets/ui_kit/ui_icon_back_2x.png") 0 0 / 100% 100% no-repeat;
  cursor: pointer;
  z-index: 3;
  transition: transform .1s ease;
}

.album-back:hover,
.album-detail-back:hover { transform: scale(1.06); }

.album-back:active,
.album-detail-back:active { transform: scale(.96); }

.album-title {
  position: absolute;
  left: 136px;
  top: 42px;
  margin: 0;
  font-size: 38px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink);
}

.album-count {
  position: absolute;
  right: 120px;
  top: 54px;
  font-size: 20px;
  letter-spacing: .08em;
  color: var(--ink-soft);
}

/* AC-28：空态不显示「共 0 朵」 */
.scene--album.is-empty .album-count { display: none; }

.album-grid-wrap {
  position: absolute;
  left: 120px;
  top: 176px;
  width: 1360px;
  height: 700px;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(3, 400px);
  gap: 28px 60px;
  width: 100%;
  height: 100%;
  padding: 8px 20px 24px;
  overflow-y: auto;
  align-content: start;
  scrollbar-width: none;
}

.album-grid::-webkit-scrollbar { width: 0; height: 0; }

.album-card {
  position: relative;
  width: 400px;
  padding: 16px 16px 18px;
  border: 1px solid rgba(139, 98, 72, .16);
  border-radius: 18px;
  background: #FFFDF7;
  box-shadow: 0 10px 24px rgba(90, 74, 64, .10);
  transform: rotate(var(--tilt, 0deg));
  transition: transform .22s ease, box-shadow .22s ease;
  text-align: left;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  align-self: start;
}

.album-card:hover {
  transform: rotate(0) translateY(-6px);
  box-shadow: 0 18px 34px rgba(90, 74, 64, .16);
  z-index: 2;
}

.album-card__photo {
  display: block;
  width: 368px;
  height: 214px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(180deg, #EAF2F7 0%, #F4F0E6 100%);
}

.album-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.album-card__name {
  display: block;
  margin-top: 14px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-card__date {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  letter-spacing: .04em;
  color: var(--ink-soft);
}

/* 刚收进来的那朵：暖色描边，方便一眼找到 */
.album-card.is-new {
  box-shadow: 0 0 0 4px rgba(246, 214, 120, .55), 0 16px 32px rgba(229, 176, 72, .25);
}

.album-empty {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.scene--album.is-empty .album-empty { display: flex; }
.scene--album.is-empty .album-grid { display: none; }

.album-empty__icon {
  width: 132px;
  height: 132px;
  opacity: .9;
}

.album-empty__title {
  margin: 22px 0 0;
  font-size: 30px;
  font-weight: 600;
  color: var(--ink);
}

.album-empty__sub {
  margin: 10px 0 0;
  font-size: 18px;
  color: var(--ink-soft);
}

.album-empty__btn,
.detail-save {
  padding: 0;
  border: 0;
  background: url("../assets/ui_kit/ui_btn_primary_default_2x.png") 0 0 / 100% 100% no-repeat;
  cursor: pointer;
  transition: transform .1s ease, filter .1s ease;
}

.album-empty__btn {
  margin-top: 34px;
  width: 320px;
  height: 78px;
}

.album-empty__btn span,
.detail-save span {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: .1em;
  color: #7A5426;
}

.album-empty__btn:hover,
.detail-save:hover { transform: translateY(-2px); }

.album-empty__btn:active,
.detail-save:active { transform: translateY(1px); filter: brightness(.97); }

/* ============================================================
   P07 相册详情
   ============================================================ */
.detail-card {
  position: absolute;
  left: 132px;
  top: 112px;
  width: 704px;
  height: 686px;
  padding: 22px 22px 0;
  border-radius: 24px;
  background: #FFFDF7;
  border: 1px solid rgba(139, 98, 72, .16);
  box-shadow: 0 20px 50px rgba(90, 74, 64, .16);
  transform: rotate(-1.2deg);
}

.detail-photo {
  width: 660px;
  height: 498px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #E9F1F6 0%, #F6F1E6 100%);
  cursor: grab;
  touch-action: none;
}

.detail-photo:active { cursor: grabbing; }

.detail-photo__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  will-change: transform;
  transition: transform .38s cubic-bezier(.2, .8, .3, 1);
}

.detail-photo__img.is-dragging { transition: none; }

.detail-meta {
  padding: 18px 22px 0;
  text-align: center;
}

.detail-name {
  padding: 2px 10px 6px;
  border: 0;
  border-bottom: 2px dashed rgba(139, 98, 72, .35);
  background: none;
  font: inherit;
  font-size: 34px;
  font-weight: 600;
  color: var(--ink);
  cursor: text;
}

.detail-name:hover { border-bottom-color: rgba(139, 98, 72, .62); }
.detail-name:focus { outline: none; }

.detail-name-input {
  width: 420px;
  height: 64px;
  padding: 0 26px;
  border: 0;
  background: url("../assets/ui_kit/ui_field_input_2x.png") 0 0 / 100% 100% no-repeat;
  font: inherit;
  font-size: 30px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  outline: none;
}

.detail-date {
  margin: 10px 0 0;
  font-size: 16px;
  letter-spacing: .06em;
  color: var(--ink-soft);
}

.detail-photo-hint {
  margin: 8px 0 0;
  font-size: 14px;
  color: #A08B78;
}

.detail-panel {
  position: absolute;
  left: 900px;
  top: 150px;
  width: 560px;
  padding: 38px 42px 42px;
  border-radius: 24px;
  background: rgba(255, 253, 247, .80);
  border: 1px solid rgba(139, 98, 72, .14);
  box-shadow: 0 14px 34px rgba(90, 74, 64, .08);
}

.detail-label {
  margin: 0;
  font-size: 16px;
  letter-spacing: .22em;
  color: #A08B78;
}

.detail-quote {
  margin: 16px 0 0;
  min-height: 132px;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--ink);
}

.detail-from {
  margin: 14px 0 0;
  font-size: 16px;
  color: var(--ink-soft);
}

.detail-save {
  margin-top: 36px;
  width: 360px;
  height: 80px;
}

.detail-save span {
  font-size: 27px;
  letter-spacing: .14em;
}

/* 相册详情里的「换个背景」：次级按钮，奶油底 + 细边框 */
.detail-bg {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  width: 360px;
  height: 80px;
  padding: 0;
  border: 2px solid #E4CCA3;
  border-radius: 999px;
  background: rgba(255, 253, 247, .92);
  box-shadow: 0 8px 20px rgba(139, 98, 72, .12);
  cursor: pointer;
  font: inherit;
  transition: transform .1s ease, filter .1s ease;
}
.detail-bg span {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: .14em;
  color: #8B6248;
}
.detail-bg:hover { transform: translateY(-2px); }
.detail-bg:active { transform: translateY(1px); filter: brightness(.97); }
.detail-bg[hidden] { display: none; }

.detail-toast {
  position: absolute;
  left: 50%;
  bottom: 48px;
  padding: 9px 20px;
  border-radius: 999px;
  background: rgba(255, 253, 247, .96);
  border: 1px solid rgba(139, 98, 72, .18);
  font-size: 16px;
  color: #7A6555;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 6px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.detail-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ============================================================
   S6 中断恢复
   ============================================================ */
.hub-draft {
  position: absolute;
  left: 660px;
  top: 54px;
  width: 440px;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border: 1px solid rgba(139, 98, 72, .16);
  border-radius: 999px;
  background: rgba(255, 253, 247, .94);
  box-shadow: 0 10px 24px rgba(90, 74, 64, .12);
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .16s ease;
}

.hub-draft[hidden] { display: none; }

.hub-draft:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(90, 74, 64, .16);
}

.hub-draft:active { transform: translateY(1px); }

.hub-draft__icon {
  flex: 0 0 auto;
  width: 44px;
  height: 32px;
}

.hub-draft__text {
  font-size: 19px;
  font-weight: 600;
  white-space: nowrap;
}

.hub-draft__go {
  margin-left: auto;
  font-size: 15px;
  letter-spacing: .06em;
  color: #B98A3E;
}

/* P04 返回确认 */
.overlay--leave { z-index: 13; }

.leave-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 680px;
  padding: 40px 40px 36px;
  border-radius: 24px;
  background: #FFFDF7;
  border: 2px solid rgba(139, 98, 72, .16);
  box-shadow: 0 22px 56px rgba(90, 74, 64, .18);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -46%) scale(.97);
  transition: opacity .28s ease, transform .32s cubic-bezier(.2, .85, .3, 1);
}

.overlay--leave.is-open .leave-card {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.leave-card__title {
  margin: 0;
  font-size: 30px;
  font-weight: 600;
  color: var(--ink);
}

.leave-card__sub {
  margin: 12px 0 0;
  font-size: 17px;
  color: var(--ink-soft);
}

.leave-card__actions {
  display: flex;
  gap: 24px;
  margin-top: 32px;
}

.leave-btn {
  flex: 1;
  height: 76px;
  padding: 0;
  border: 0;
  background-position: 0 0;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  cursor: pointer;
  transition: transform .1s ease, filter .1s ease;
}

.leave-btn--secondary { background-image: url("../assets/ui_kit/ui_btn_secondary_default_2x.png"); }
.leave-btn--primary { background-image: url("../assets/ui_kit/ui_btn_primary_default_2x.png"); }

.leave-btn span {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: .08em;
}

.leave-btn--secondary span { color: #7A6555; }
.leave-btn--primary span { color: #7A5426; }

.leave-btn:hover { transform: translateY(-2px); }
.leave-btn:active { transform: translateY(1px); filter: brightness(.97); }

/* 结算里的「今日首单 ×2」 */
.result-card__bonus {
  margin: 4px 0 0;
  font-size: 15px;
  letter-spacing: .12em;
  color: #B97F2E;
  opacity: 0;
  transition: opacity .3s ease;
}

.result-card.is-revealed .result-card__bonus { opacity: 1; }
.result-card__bonus[hidden] { display: none; }

/* ============================================================
   S7 视觉打磨
   ============================================================ */

/* ---------- P01 天台氛围：灯串暖光呼吸 + 光斑缓慢漂移 ---------- */
.hub-ambient {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hub-ambient__lamp {
  position: absolute;
  left: 0;
  right: 0;
  top: -140px;
  height: 440px;
  background: radial-gradient(58% 82% at 50% 0%,
    rgba(255, 216, 138, .26) 0%,
    rgba(255, 216, 138, .10) 46%,
    rgba(255, 216, 138, 0) 100%);
  animation: lampBreathe 7.5s ease-in-out infinite alternate;
}

.hub-ambient__blob {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(closest-side,
    rgba(255, 230, 170, .32) 0%,
    rgba(255, 230, 170, .11) 52%,
    rgba(255, 230, 170, 0) 100%);
  filter: blur(4px);
  will-change: transform;
}

.hub-ambient__blob--a {
  left: 940px;
  top: -70px;
  width: 520px;
  height: 520px;
  animation: ambientDriftA 26s ease-in-out infinite alternate;
}

.hub-ambient__blob--b {
  left: 60px;
  top: 330px;
  width: 620px;
  height: 620px;
  opacity: .6;
  animation: ambientDriftB 34s ease-in-out infinite alternate;
}

@keyframes lampBreathe {
  from { opacity: .72; }
  to   { opacity: 1; }
}

@keyframes ambientDriftA {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-64px, 26px, 0) scale(1.07); }
}

@keyframes ambientDriftB {
  from { transform: translate3d(0, 0, 0) scale(1.04); }
  to   { transform: translate3d(52px, -30px, 0) scale(1); }
}

/* ---------- P04 云体柔光缓慢呼吸 ---------- */
.craft-glow {
  transform-origin: 50% 50%;
  animation: craftGlow 9s ease-in-out infinite alternate;
  will-change: transform, opacity;
}

@keyframes craftGlow {
  from { opacity: .86; transform: scale(1); }
  to   { opacity: 1;   transform: scale(1.04); }
}

/* ---------- P04 订单气泡轻轻上浮 ---------- */
.scene--craft.is-active .craft-bubble {
  animation: bubbleRise .35s ease-out both;
}

@keyframes bubbleRise {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- P05 成形云缓落 + 按钮按压统一 ---------- */
.overlay.is-open .result-thumb {
  animation: thumbSettle .55s .1s cubic-bezier(.2, .85, .3, 1) both;
}

@keyframes thumbSettle {
  from { opacity: .35; transform: translateY(-14px) scale(.96); }
  to   { opacity: 1;   transform: translateY(0) scale(1); }
}

.result-btn:active { transform: translateY(2px); filter: brightness(.96); }

/* ============================================================
   S7 云朵对对碰（P10）
   ============================================================ */
.hub-match {
  position: absolute;
  left: 86px;
  top: 664px;
  width: 278px;
  height: 104px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  border: 1px solid rgba(139, 98, 72, .16);
  border-radius: 24px;
  background: rgba(255, 253, 247, .94);
  box-shadow: 0 10px 24px rgba(90, 74, 64, .12);
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .16s ease;
}

.hub-match:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(90, 74, 64, .16);
}

.hub-match:active { transform: translateY(1px); }

.hub-match__icon {
  flex: 0 0 auto;
  width: 70px;
  height: 62px;
}

.hub-match__icon svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hub-match__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  white-space: nowrap;
}

.hub-match__text b {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .02em;
}

.hub-match__text small {
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--ink-soft);
}

.scene--match { overflow: hidden; }

.match-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(820px 560px at 8% -12%, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 70%),
    radial-gradient(720px 520px at 94% 108%, rgba(246, 228, 168, .5), rgba(246, 228, 168, 0) 72%),
    radial-gradient(600px 420px at 78% 8%, rgba(169, 214, 229, .28), rgba(169, 214, 229, 0) 70%),
    linear-gradient(180deg, #FAF4E8 0%, #F6EDDD 58%, #F2E6D2 100%);
}

.match-glow {
  position: absolute;
  left: 1080px;
  top: -160px;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 236, 190, .7) 0%, rgba(255, 236, 190, 0) 68%);
  filter: blur(6px);
  pointer-events: none;
}

.match-back {
  position: absolute;
  left: 48px;
  top: 40px;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: rgba(255, 253, 247, .92);
  background-image: url("../assets/icons_cut/ui_icon_back_2x.png");
  background-position: center;
  background-size: 56% 56%;
  background-repeat: no-repeat;
  cursor: pointer;
  z-index: 3;
  transition: transform .1s ease, box-shadow .1s ease;
  box-shadow: 0 4px 14px rgba(90, 74, 64, .18);
}

.match-back:hover { transform: scale(1.06); }
.match-back:active { transform: scale(.96); }

.match-title {
  position: absolute;
  left: 136px;
  top: 34px;
  margin: 0;
  font-size: 38px;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--ink);
}

.match-sub {
  position: absolute;
  left: 138px;
  top: 94px;
  margin: 0;
  font-size: 17px;
  letter-spacing: .04em;
  color: var(--ink-soft);
}

.coin-pill--match {
  right: 48px;
  top: 44px;
  background: #FFFDF7;
}

.coin-pill--match .coin-pill__label {
  margin-right: 6px;
  font-size: 20px;
  color: var(--ink-soft);
}

.match-stats {
  position: absolute;
  right: 48px;
  top: 118px;
  display: flex;
  gap: 12px;
  z-index: 2;
}

.match-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  height: 52px;
  padding: 0 20px;
  border-radius: 999px;
  background: rgba(255, 253, 247, .9);
  border: 1px solid rgba(139, 98, 72, .14);
  box-shadow: 0 6px 16px rgba(90, 74, 64, .08);
  line-height: 52px;
}

.match-stat__label {
  font-size: 16px;
  letter-spacing: .06em;
  color: var(--ink-soft);
}

.match-stat__value {
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.match-board {
  position: absolute;
  left: 337px;
  top: 196px;
  width: 926px;
  height: 608px;
  display: grid;
  grid-template-columns: repeat(4, 212px);
  grid-template-rows: repeat(3, 188px);
  gap: 22px 26px;
}

.match-card {
  width: 212px;
  height: 188px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  perspective: 900px;
  -webkit-perspective: 900px;
  transition: transform .16s ease;
}

.match-card:hover { transform: translateY(-4px); }
.match-card:active { transform: translateY(-1px) scale(.985); }

.match-card__inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .38s cubic-bezier(.2, .8, .3, 1);
}

.match-card.is-flipped .match-card__inner,
.match-card.is-matched .match-card__inner {
  transform: rotateY(180deg);
}

.match-card.is-matched .match-card__inner {
  transform: rotateY(180deg) scale(.965);
}

.match-card__face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  background: #FFFDF7;
  border: 2px solid rgba(139, 98, 72, .16);
  box-shadow: 0 12px 24px rgba(90, 74, 64, .12);
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.match-card__back {
  background: linear-gradient(180deg, #FFFDF7 0%, #FBF1DF 100%);
}

.match-card__front {
  transform: rotateY(180deg);
  background: linear-gradient(180deg, #FFFDF7 0%, #FCF3E4 100%);
}

.match-card__art {
  display: block;
  width: 190px;
  height: 171px;
}

.match-card.is-matched {
  cursor: default;
  animation: matchPop .44s ease;
}

.match-card.is-matched .match-card__front {
  border-color: rgba(185, 138, 62, .5);
  box-shadow:
    0 0 0 4px rgba(246, 201, 91, .22),
    0 12px 24px rgba(90, 74, 64, .10);
}

.match-card.is-wrong { animation: matchShake .4s ease; }
.match-card.is-wrong .match-card__face {
  border-color: rgba(217, 129, 147, .5);
}

@keyframes matchPop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@keyframes matchShake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-7px); }
  50%      { transform: translateX(7px); }
  75%      { transform: translateX(-4px); }
}

.match-hint {
  position: absolute;
  left: 0;
  right: 0;
  top: 840px;
  margin: 0;
  text-align: center;
  font-size: 16px;
  letter-spacing: .05em;
  color: var(--ink-soft);
}

.match-result {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.match-result[hidden] { display: none; }

.match-result__mask {
  position: absolute;
  inset: 0;
  background: rgba(90, 74, 64, .16);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .26s ease;
}

.match-result.is-open .match-result__mask { opacity: 1; }

.match-result__card {
  position: relative;
  width: 640px;
  padding: 48px 48px 40px;
  border-radius: 26px;
  background: #FFFDF7;
  border: 2px solid rgba(139, 98, 72, .18);
  box-shadow: 0 26px 70px rgba(90, 74, 64, .22);
  text-align: center;
  opacity: 0;
  transform: translateY(30px) scale(.96);
  transition: opacity .3s ease, transform .34s cubic-bezier(.2, .85, .3, 1);
}

.match-result.is-open .match-result__card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.match-result__title {
  margin: 0;
  font-size: 36px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--ink);
}

.match-result__line {
  margin: 14px 0 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.match-result__summary {
  margin: 26px 0 0;
  font-size: 20px;
  color: var(--ink-soft);
}

.match-result__summary b {
  font-size: 30px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.match-result__summary b.match-result__coins {
  color: #B97F2E;
}

.match-result__actions {
  display: flex;
  gap: 20px;
  margin-top: 34px;
}

.match-result__again,
.match-result__home {
  flex: 1;
  height: 72px;
  border-radius: 999px;
  font: inherit;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .06em;
  cursor: pointer;
  transition: transform .1s ease, filter .1s ease;
}

.match-result__again {
  border: 0;
  background: linear-gradient(180deg, #FBD37A 0%, #F7C962 100%);
  color: #6B4A22;
  box-shadow: 0 8px 18px rgba(185, 138, 62, .26);
}

.match-result__home {
  border: 2px solid rgba(139, 98, 72, .2);
  background: #FFFDF7;
  color: var(--ink);
}

.match-result__again:hover,
.match-result__home:hover { transform: translateY(-2px); }

.match-result__again:active,
.match-result__home:active { transform: translateY(1px); filter: brightness(.97); }

@media (prefers-reduced-motion: reduce) {
  .hub-ambient__lamp,
  .hub-ambient__blob,
  .craft-glow,
  .scene--craft.is-active .craft-bubble,
  .overlay.is-open .result-thumb,
  .overlay.is-open .result-glow,
  .match-card.is-matched,
  .match-card.is-wrong {
    animation: none !important;
  }

  .match-card__inner { transition-duration: .01s; }

  .scene { transition-duration: .01s; }
}

/* ============================================================
   P11 关卡选择 / P12 背景故事
   ============================================================ */

/* ---------- 天台左上角关卡入口 ---------- */
.hub-levels {
  position: absolute;
  left: 86px;
  top: 62px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 26px 0 18px;
  border: 1px solid rgba(139, 98, 72, .16);
  border-radius: 999px;
  background: rgba(255, 253, 247, .94);
  box-shadow: 0 10px 24px rgba(90, 74, 64, .12);
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  z-index: 2;
  transition: transform .12s ease, box-shadow .16s ease;
}

.hub-levels:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(90, 74, 64, .16);
}

.hub-levels:active { transform: translateY(1px); }

.hub-levels__icon {
  display: flex;
  width: 40px;
  height: 40px;
}

.hub-levels__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.hub-levels__label {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .04em;
}

.hub-levels__value {
  font-size: 16px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* ---------- 关卡列表浮层 ---------- */
.overlay--levels { z-index: 22; }

.levels-mask {
  position: absolute;
  inset: 0;
  background: rgba(60, 48, 40, .34);
  -webkit-backdrop-filter: blur(7px) saturate(1.05);
          backdrop-filter: blur(7px) saturate(1.05);
}

.levels-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1240px;
  padding: 40px 48px 44px;
  border-radius: 30px;
  background: #FFFDF7;
  border: 2px solid rgba(139, 98, 72, .18);
  box-shadow: 0 26px 68px rgba(90, 74, 64, .22);
  opacity: 0;
  transform: translate(-50%, -46%) scale(.97);
  transition: opacity .28s ease, transform .32s cubic-bezier(.2, .85, .3, 1);
}

.overlay--levels.is-open .levels-panel {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.levels-title {
  margin: 0;
  font-size: 34px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink);
}

.levels-sub {
  margin: 8px 0 0;
  font-size: 17px;
  letter-spacing: .05em;
  color: var(--ink-soft);
}

.levels-close {
  position: absolute;
  right: 24px;
  top: 24px;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(139, 98, 72, .08);
  font-size: 26px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .14s ease, transform .12s ease;
}

.levels-close:hover { background: rgba(139, 98, 72, .16); transform: scale(1.06); }
.levels-close:active { transform: scale(.94); }

.levels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px 24px;
  margin-top: 26px;
}

.level-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 238px;
  padding: 18px 18px 16px;
  border: 2px solid rgba(139, 98, 72, .14);
  border-radius: 22px;
  background: linear-gradient(180deg, #FFFDF7 0%, #FBF1DF 100%);
  box-shadow: 0 8px 20px rgba(90, 74, 64, .08);
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: transform .14s ease, box-shadow .18s ease, border-color .18s ease;
}

.level-card:hover {
  transform: translateY(-5px);
  border-color: rgba(185, 138, 62, .38);
  box-shadow: 0 16px 32px rgba(90, 74, 64, .16);
}

.level-card:active { transform: translateY(-1px); }

.level-card__no {
  position: absolute;
  left: 16px;
  top: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(139, 98, 72, .1);
  font-size: 15px;
  font-weight: 600;
  line-height: 30px;
  text-align: center;
  color: var(--ink-soft);
}

.level-card__art {
  display: block;
  width: 100%;
  height: 122px;
  margin-top: 4px;
  overflow: hidden;
}

.level-card__art .customer-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}

.level-card__title {
  margin-top: 8px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: .04em;
}

.level-card__who {
  margin-top: 4px;
  font-size: 14px;
  color: var(--ink-soft);
}

.level-card__state {
  margin-top: 8px;
  padding: 3px 14px;
  border-radius: 999px;
  background: rgba(139, 98, 72, .08);
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--ink-soft);
}

.level-card.is-cleared {
  border-color: rgba(126, 170, 118, .42);
}

.level-card.is-cleared .level-card__no {
  background: #7EAA76;
  color: #FFFDF7;
}

.level-card.is-cleared .level-card__state {
  background: rgba(126, 170, 118, .16);
  color: #5E8B57;
}

.level-card.is-locked {
  filter: grayscale(1);
  opacity: .52;
  cursor: not-allowed;
  box-shadow: none;
}

.level-card.is-locked:hover {
  transform: none;
  border-color: rgba(139, 98, 72, .14);
  box-shadow: none;
}

/* ---------- 关卡背景故事（视觉小说式） ---------- */
.overlay--story { z-index: 26; }

.story-bg {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: scale(1.06);
  filter: blur(3px) saturate(1.06) brightness(.94);
}

.story-dim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      rgba(22, 18, 16, .42) 0%,
      rgba(22, 18, 16, .12) 34%,
      rgba(18, 15, 13, .34) 64%,
      rgba(14, 12, 10, .84) 100%);
  pointer-events: none;
}

.story-portrait {
  position: absolute;
  right: 24px;
  bottom: 34px;
  width: 660px;
  height: 760px;
  z-index: 1;
  pointer-events: none;
}

.story-portrait .customer-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, .34));
  animation: storyPortraitIn .6s cubic-bezier(.2, .85, .3, 1) both;
}

@keyframes storyPortraitIn {
  from { opacity: 0; transform: translateY(26px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.story-chapter {
  position: absolute;
  left: 56px;
  top: 44px;
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .12em;
  color: #FFF6E6;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .45);
  z-index: 3;
  pointer-events: none;
}

.story-skip {
  position: absolute;
  right: 52px;
  top: 40px;
  height: 44px;
  padding: 0 22px;
  border: 1px solid rgba(255, 246, 230, .38);
  border-radius: 999px;
  background: rgba(24, 20, 18, .42);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  font: inherit;
  font-size: 16px;
  letter-spacing: .1em;
  color: #FFF6E6;
  cursor: pointer;
  z-index: 4;
  transition: background .14s ease, transform .12s ease;
}

.story-skip:hover { background: rgba(24, 20, 18, .62); transform: translateY(-2px); }
.story-skip:active { transform: translateY(1px); }

.story-name {
  position: absolute;
  left: 246px;
  bottom: 262px;
  padding: 8px 26px;
  border-radius: 12px 12px 4px 4px;
  background: linear-gradient(180deg, rgba(52, 42, 36, .94) 0%, rgba(34, 27, 23, .94) 100%);
  border: 1px solid rgba(232, 196, 132, .55);
  border-bottom: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .1em;
  color: #FFE9C2;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .4);
  z-index: 4;
  pointer-events: none;
}

.story-name[hidden] { display: none; }

.story-box {
  position: absolute;
  left: 50%;
  bottom: 78px;
  width: 1180px;
  min-height: 176px;
  margin-left: -590px;
  padding: 30px 44px 46px;
  border-radius: 20px;
  background: rgba(24, 20, 18, .84);
  border: 1px solid rgba(255, 240, 214, .18);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .36), inset 0 1px 0 rgba(255, 246, 230, .1);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  cursor: pointer;
  z-index: 3;
}

.story-text {
  margin: 0;
  font-size: 28px;
  line-height: 1.72;
  letter-spacing: .02em;
  color: #F3EAE0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .3);
  min-height: 48px;
}

.story-text.is-fade { animation: storyTextIn .3s ease both; }

@keyframes storyTextIn {
  from { opacity: .25; transform: translateY(6px); }
  to   { opacity: 1;   transform: translateY(0); }
}

.story-caret {
  position: absolute;
  right: 34px;
  bottom: 18px;
  font-size: 15px;
  color: rgba(255, 233, 194, .8);
  animation: storyCaretBob 1.2s ease-in-out infinite;
}

.story-caret[hidden] { display: none; }

@keyframes storyCaretBob {
  0%, 100% { opacity: .4; transform: translateY(0); }
  50%      { opacity: 1;   transform: translateY(4px); }
}

.story-start {
  position: absolute;
  right: 28px;
  bottom: 18px;
  height: 56px;
  padding: 0 32px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #FBD37A 0%, #F7C962 100%);
  box-shadow: 0 8px 20px rgba(185, 138, 62, .4);
  font: inherit;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .08em;
  color: #6B4A22;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}

.story-start[hidden] { display: none; }
.story-start:hover { transform: translateY(-2px); }
.story-start:active { transform: translateY(1px); filter: brightness(.97); }

/* ============================================================
   UI 兜底：原 ui_kit 图片缺失，这里统一用 CSS 画按钮
   ============================================================ */

/* ---------- 天台：订单卡 / 右侧三个入口 ---------- */
.hub-spot--card,
.hub-spot--order,
.hub-spot--album,
.hub-spot--setting {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 253, 247, .92);
  border: 2px solid rgba(139, 98, 72, .14);
  box-shadow: 0 10px 24px rgba(90, 74, 64, .12);
  -webkit-backdrop-filter: blur(3px);
          backdrop-filter: blur(3px);
  transition: transform .14s ease, box-shadow .18s ease, background .16s ease;
}

.hub-spot--card:hover,
.hub-spot--order:hover,
.hub-spot--album:hover,
.hub-spot--setting:hover {
  background: #FFFDF7;
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(90, 74, 64, .18);
}

.hub-spot--card:active,
.hub-spot--order:active,
.hub-spot--album:active,
.hub-spot--setting:active { transform: translateY(-1px); }

.hub-spot__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
}

.hub-spot__icon svg,
.hub-spot__icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hub-spot--card .hub-spot__icon {
  width: 72px;
  height: 52px;
}

.hub-spot__label {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--ink);
}

.hub-spot--card .hub-spot__label { font-size: 28px; }

.hub-spot__sub {
  margin-top: -4px;
  font-size: 15px;
  letter-spacing: .04em;
  color: var(--ink-soft);
}

/* ---------- 天台：接单按钮 ---------- */
.hub-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #FBD681 0%, #F4BE55 100%);
  border-radius: 999px;
  box-shadow: 0 12px 26px rgba(185, 138, 62, .3), inset 0 1px 0 rgba(255, 255, 255, .55);
  font: inherit;
  font-size: 34px;
  font-weight: 600;
  letter-spacing: .28em;
  text-indent: .28em;
  color: #6B4A22;
}

/* ---------- 今日客人：名字与身份 ---------- */
.hub-guest__name {
  display: block;
  width: fit-content;
  margin: 8px auto 0;
  padding: 3px 18px;
  border-radius: 999px;
  background: rgba(255, 253, 247, .95);
  border: 1px solid rgba(139, 98, 72, .18);
  z-index: 3;
}

.hub-guest__role {
  display: block;
  width: fit-content;
  margin: 6px auto 0;
  padding: 3px 14px;
  border-radius: 999px;
  background: #FFFDF7;
  border: 1px solid rgba(139, 98, 72, .18);
  box-shadow: 0 4px 10px rgba(90, 74, 64, .1);
  z-index: 3;
  font-size: 15px;
  font-weight: 500;
  color: #6B4A22;
}

/* ---------- 主按钮（金） ---------- */
.craft-submit,
.drawer-start,
.order-btn--primary,
.result-btn--primary,
.leave-btn--primary,
.album-empty__btn,
.detail-save {
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: linear-gradient(180deg, #FBD681 0%, #F4BE55 100%);
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(185, 138, 62, .28), inset 0 1px 0 rgba(255, 255, 255, .5);
  font: inherit;
  font-weight: 600;
  letter-spacing: .16em;
  color: #6B4A22;
}

.craft-submit span,
.drawer-start span,
.order-btn--primary span,
.result-btn--primary span {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: .16em;
}

/* ---------- 次级按钮（米白） ---------- */
.order-btn--secondary,
.result-btn--secondary,
.leave-btn--secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: none;
  background-color: #FFFDF7;
  border: 2px solid rgba(139, 98, 72, .22);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(90, 74, 64, .1);
  font: inherit;
  font-weight: 600;
  letter-spacing: .12em;
}

.order-btn--secondary span,
.result-btn--secondary span {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: .12em;
  color: #7A6555;
}

/* ---------- 相册返回键 ---------- */
.album-back,
.album-detail-back {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 253, 247, .92);
  border: 2px solid rgba(139, 98, 72, .16);
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(90, 74, 64, .12);
}

.album-back svg,
.album-detail-back svg {
  display: block;
  width: 62%;
  height: 62%;
}

/* ---------- 相册详情输入框 ---------- */
.detail-name-input {
  background: #FFFDF7;
  border: 2px solid rgba(139, 98, 72, .22);
  border-radius: 16px;
  font: inherit;
  font-size: 22px;
  color: var(--ink);
}


/* ---------- 装饰模式：要求气泡让位给装饰面板 ---------- */
.craft-bubble {
  transition: opacity .18s ease, transform .18s ease;
}

.scene--craft.is-decorating .craft-bubble {
  animation: none;
  opacity: 0;
  transform: translateY(-10px) scale(.98);
  pointer-events: none;
  visibility: hidden;
}

/* 装饰面板挪到气泡原来的位置上方一点，避免和「装饰」按钮挤在一起 */
.scene--craft.is-decorating .decor-panel {
  top: 160px;
  z-index: 5;
}

/* ---------- 天台入口：云朵点点乐 ---------- */
.hub-game {
  position: absolute;
  left: 86px;
  top: 786px;
  width: 278px;
  height: 96px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border: 1px solid rgba(139, 98, 72, .16);
  border-radius: 24px;
  background: linear-gradient(160deg, #FFFDF7 0%, #FFF6E2 100%);
  box-shadow: 0 10px 24px rgba(90, 74, 64, .12);
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .16s ease;
}

.hub-game:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(90, 74, 64, .16);
}

.hub-game:active { transform: translateY(1px); }

.hub-game__icon {
  flex: 0 0 auto;
  width: 64px;
  height: 56px;
}

.hub-game__icon svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hub-game__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  white-space: nowrap;
}

.hub-game__text b {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .02em;
}

.hub-game__text small {
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--ink-soft);
}

.stage.is-dialog-mode .hub-game { display: none; }

/* ---------- 云朵点点乐浮层 ---------- */
.overlay--clicker { z-index: 24; }

.clicker-mask {
  position: absolute;
  inset: 0;
  background: rgba(60, 48, 40, .34);
  -webkit-backdrop-filter: blur(7px) saturate(1.05);
          backdrop-filter: blur(7px) saturate(1.05);
}

.clicker-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1160px;
  height: 720px;
  margin: -360px 0 0 -580px;
  padding: 30px 40px 32px;
  border-radius: 32px;
  background: #FFFDF7;
  border: 2px solid rgba(139, 98, 72, .18);
  box-shadow: 0 26px 68px rgba(90, 74, 64, .24);
  opacity: 0;
  transform: translateY(18px) scale(.97);
  transition: opacity .28s ease, transform .32s cubic-bezier(.2, .85, .3, 1);
}

.overlay--clicker.is-open .clicker-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.clicker-close {
  position: absolute;
  right: 22px;
  top: 18px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #F4EADA;
  color: #8B6F47;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.clicker-close:hover { background: #EFE0C9; }

.clicker-head { text-align: center; }

.clicker-title {
  margin: 0;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink);
}

.clicker-sub {
  margin: 6px 0 0;
  font-size: 16px;
  color: var(--ink-soft);
}

.clicker-hud {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 16px 6px 14px;
}

.clicker-score {
  flex: 0 0 auto;
  font-size: 18px;
  color: var(--ink-soft);
}

.clicker-score b {
  font-size: 26px;
  color: var(--ink);
}

.clicker-track {
  position: relative;
  flex: 1 1 auto;
  height: 14px;
  border-radius: 999px;
  background: #F0E5D4;
  overflow: hidden;
}

.clicker-time-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #F6D98B 0%, #F2C65C 100%);
  transition: width .12s linear;
}

.clicker-clock {
  flex: 0 0 52px;
  text-align: right;
  font-size: 18px;
  color: var(--ink-soft);
}

.clicker-field {
  position: relative;
  width: 100%;
  height: 490px;
  border-radius: 26px;
  overflow: hidden;
  background:
    radial-gradient(560px 320px at 16% 8%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 70%),
    radial-gradient(520px 300px at 88% 94%, rgba(246, 228, 168, .55), rgba(246, 228, 168, 0) 72%),
    linear-gradient(180deg, #E7E1F6 0%, #F6E7E2 46%, #FAEFDB 100%);
  border: 1px solid rgba(139, 98, 72, .12);
}

.clicker-tip {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  font-size: 20px;
  color: #8B6F47;
  white-space: nowrap;
}

.clicker-tip[hidden] { display: none; }

.clicker-cloud {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  will-change: transform;
  filter: drop-shadow(0 8px 14px rgba(90, 74, 64, .12));
  transition: filter .12s ease;
}

.clicker-cloud:hover { filter: drop-shadow(0 10px 18px rgba(90, 74, 64, .2)); }

.clicker-cloud svg {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.clicker-cloud.is-pop {
  pointer-events: none;
  animation: clicker-pop .22s ease-out forwards;
}

@keyframes clicker-pop {
  0%   { opacity: 1; }
  100% { opacity: 0; filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0)); }
}

.clicker-plus {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 26px;
  font-weight: 700;
  color: #E9A93F;
  pointer-events: none;
  animation: clicker-plus .7s ease-out forwards;
}

@keyframes clicker-plus {
  0%   { opacity: 0; transform: translate(-50%, -30%) scale(.8); }
  30%  { opacity: 1; transform: translate(-50%, -60%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -140%) scale(1); }
}

.clicker-start {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 320px;
  height: 78px;
  margin: 96px 0 0 -160px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #F9CE72 0%, #F0BC4C 100%);
  box-shadow: 0 12px 26px rgba(201, 151, 60, .28);
  color: #6B4A2F;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: .08em;
  cursor: pointer;
  transition: transform .1s ease, filter .1s ease;
}

.clicker-start:hover { transform: translateY(-2px); }
.clicker-start:active { transform: translateY(1px); filter: brightness(.97); }
.clicker-start[hidden] { display: none; }

.clicker-result {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 560px;
  margin: -120px 0 0 -280px;
  padding: 34px 32px 30px;
  border-radius: 28px;
  background: rgba(255, 253, 247, .97);
  border: 2px solid rgba(139, 98, 72, .16);
  box-shadow: 0 22px 54px rgba(90, 74, 64, .2);
  text-align: center;
}

.clicker-result[hidden] { display: none; }

.clicker-result__score {
  margin: 0;
  font-size: 30px;
  font-weight: 600;
  color: var(--ink);
}

.clicker-result__coin {
  margin: 12px 0 0;
  font-size: 22px;
  color: #C08A32;
}

.clicker-result__btns {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 26px;
}

.clicker-again,
.clicker-done {
  height: 56px;
  padding: 0 28px;
  border-radius: 999px;
  font-size: 19px;
  cursor: pointer;
}

.clicker-again {
  border: 1px solid rgba(139, 98, 72, .22);
  background: #FBF5EA;
  color: var(--ink);
}

.clicker-again:hover { background: #FFF3D6; }

.clicker-done {
  border: 0;
  background: linear-gradient(180deg, #F9CE72 0%, #F0BC4C 100%);
  box-shadow: 0 10px 22px rgba(201, 151, 60, .24);
  color: #6B4A2F;
  font-weight: 600;
}

.clicker-done:hover { filter: brightness(1.03); }

/* ---------- 天台背景：缓慢飘过的云 ---------- */
.hub-ambient__cloud {
  position: absolute;
  left: -300px;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 12px 20px rgba(201, 151, 90, .12));
  opacity: .6;
  will-change: transform;
}

.hub-ambient__cloud--a {
  top: 118px;
  width: 230px;
  opacity: .85;
  animation: hubCloudDrift 58s linear infinite;
}

.hub-ambient__cloud--b {
  top: 258px;
  width: 160px;
  opacity: .62;
  animation: hubCloudDrift 76s linear infinite -24s;
}

.hub-ambient__cloud--c {
  top: 34px;
  width: 120px;
  opacity: .5;
  animation: hubCloudDrift 92s linear infinite -60s;
}

@keyframes hubCloudDrift {
  from { transform: translateX(0); }
  to   { transform: translateX(2100px); }
}

/* ---------- 主页补充：每日签到 / 今日统计 ---------- */
.hub-checkin,
.hub-today {
  position: absolute;
  left: 86px;
  width: 278px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border: 1px solid rgba(139, 98, 72, .16);
  border-radius: 24px;
  background: linear-gradient(160deg, #FFFDF7 0%, #FFF6E2 100%);
  box-shadow: 0 10px 24px rgba(90, 74, 64, .12);
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .16s ease;
}

.hub-checkin { top: 408px; height: 104px; }
.hub-today   { top: 528px; height: 104px; }

.hub-checkin:hover,
.hub-today:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(90, 74, 64, .16);
}

.hub-checkin:active,
.hub-today:active { transform: translateY(1px); }

.hub-checkin__icon { flex: 0 0 auto; width: 52px; height: 52px; }
.hub-checkin__icon svg { display: block; width: 100%; height: 100%; }

.hub-today__icon { flex: 0 0 auto; width: 58px; height: 46px; }
.hub-today__icon svg { display: block; width: 100%; height: 100%; }

.hub-checkin__text,
.hub-today__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  white-space: nowrap;
}

.hub-checkin__text b,
.hub-today__text b {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .02em;
}

.hub-checkin__text small,
.hub-today__text small {
  font-size: 13px;
  letter-spacing: .02em;
  color: var(--ink-soft);
}

.hub-today__text i {
  font-style: normal;
  font-weight: 700;
  color: #C08A32;
}

.hub-checkin.is-claimed {
  background: linear-gradient(160deg, #F6F2E7 0%, #F0EADA 100%);
  cursor: default;
}

.hub-checkin.is-claimed .hub-checkin__title { color: #8B8574; }
.hub-checkin.is-claimed .hub-checkin__gift { stroke: #9AA57E; }

.hub-checkin.is-shake { animation: hubCheckinShake .32s ease; }

@keyframes hubCheckinShake {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-4px); }
  60% { transform: translateX(4px); }
}

.hub-checkin__fly {
  position: absolute;
  left: 50%;
  top: -6px;
  transform: translateX(-50%);
  font-size: 26px;
  font-weight: 700;
  color: #E9A93F;
  text-shadow: 0 2px 0 #FFFDF7;
  pointer-events: none;
  animation: hubCheckinFly 1s ease-out forwards;
}

@keyframes hubCheckinFly {
  0%   { opacity: 0; transform: translate(-50%, 8px); }
  25%  { opacity: 1; transform: translate(-50%, -6px); }
  100% { opacity: 0; transform: translate(-50%, -42px); }
}

.stage.is-dialog-mode .hub-checkin,
.stage.is-dialog-mode .hub-today,
.stage.is-dialog-mode .hub-easel { display: none; }

/* ---------- 主页补充：作品展示画架 ---------- */
.hub-easel {
  position: absolute;
  left: 430px;
  top: 416px;
  width: 250px;
  height: 286px;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: transform .16s ease;
}

.hub-easel:hover { transform: translateY(-4px); }

.hub-easel__board {
  position: absolute;
  left: 0;
  top: 0;
  width: 250px;
  height: 196px;
  padding: 12px;
  border-radius: 14px;
  background: #FFFDF7;
  border: 6px solid #C99B6B;
  box-shadow: 0 12px 26px rgba(90, 74, 64, .18), inset 0 0 0 1px rgba(139, 98, 72, .12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hub-easel__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hub-easel__img[hidden] { display: none; }

.hub-easel__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #B49B7E;
  font-size: 15px;
}

.hub-easel__empty[hidden] { display: none; }
.hub-easel__empty svg { width: 96px; height: 70px; }

.hub-easel__name {
  position: absolute;
  left: 50%;
  top: 206px;
  transform: translateX(-50%);
  padding: 4px 16px;
  border-radius: 999px;
  background: rgba(255, 253, 247, .92);
  border: 1px solid rgba(139, 98, 72, .18);
  font-size: 15px;
  color: var(--ink-soft);
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-easel__leg {
  position: absolute;
  top: 196px;
  width: 10px;
  height: 88px;
  border-radius: 5px;
  background: linear-gradient(180deg, #C99B6B 0%, #A67B4E 100%);
}

.hub-easel__leg--l { left: 44px; transform: rotate(10deg); }
.hub-easel__leg--r { right: 44px; transform: rotate(-10deg); }

/* ---------- 主页补充：桌上花瓶 ---------- */
.hub-vase {
  position: absolute;
  left: 768px;
  top: 496px;
  width: 64px;
  height: 96px;
  pointer-events: none;
  filter: drop-shadow(0 4px 6px rgba(90, 74, 64, .16));
}

.hub-vase svg { display: block; width: 100%; height: 100%; }

.hub-vase__plant {
  transform-origin: 40px 76px;
  animation: hubVaseSway 5.2s ease-in-out infinite;
}

@keyframes hubVaseSway {
  0%, 100% { transform: rotate(-2.2deg); }
  50%      { transform: rotate(2.2deg); }
}

/* ---------- 主页补充：栏杆上的小鸟 ---------- */
.hub-bird {
  position: absolute;
  width: 46px;
  height: 44px;
  pointer-events: none;
  animation: hubBirdHop 4.8s ease-in-out infinite;
}

.hub-bird svg { display: block; width: 100%; height: 100%; }

.hub-bird--a { left: 690px; top: 334px; }
.hub-bird--b {
  left: 946px;
  top: 300px;
  width: 42px;
  height: 40px;
  animation-delay: 2.1s;
}

@keyframes hubBirdHop {
  0%, 78%, 100% { transform: translateY(0); }
  84% { transform: translateY(-7px); }
  90% { transform: translateY(0); }
  94% { transform: translateY(-3px); }
}
