#page {
  width: calc(100dvh * 414 / 896);
  max-width: none;
  min-height: 0;
  background: #5f5f5f;
}
.live-frame { display: block; width: 100%; max-width: none; height: 100dvh; }
.live-frame .frame-control { background: transparent; }
.live-frame [data-name="底部操作"] > .frame-control { background: #1a1f28; }
.live-frame [data-name="底部操作"] .frame-primary { background: #ffe501; }
.live-frame .game-slot { display: flex; }
.live-frame #game {
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 12px 12px 16px;
  background: transparent;
  color: white;
}
.live-frame #status { color: #1e232a; }
.live-frame #hint { color: #fff; }
.live-frame #rules { background: #fff; color: #1e232a; }
.live-mine #game { padding-bottom: 4px; }
.live-mine #stage { flex: 1 1 0; min-height: 110px; }
.live-mine #stage canvas {
  width: 100%;
  height: 100%;
  background: #eadcc9;
  touch-action: manipulation;
}
.mine-worker {
  position: absolute;
  left: 57%; bottom: calc(100% - (43 / 310) * 100% + 2px);
  width: 22%; height: calc((43 / 310) * 100% - 4px);
  max-width: 54px;
  pointer-events: none; user-select: none;
}
#feed .sample-search-input {
  min-width: 0;
  width: 100%;
  color: #1a1f28;
  background: transparent;
}
#feed .sample-search-button { background: #ff2020; }
#feed .sample-empty { width: 100%; text-align: center; padding: 28px 8px; }

/* Commerce library typography. Framework HTML archives retain the source preview. */
.commerce-number { font-family: Kuaishou, sans-serif; font-weight: 600; }
.live-frame h1, .jade-rewards h2, #dialog h2 {
  font: 500 17px/22px "PingFang SC", sans-serif;
}
.live-frame #hint, #dialog p, #dialog li {
  font: 400 14px/20px "PingFang SC", sans-serif;
}
#dialog #dialog-title { line-height: 20px; }
#dialog #continue {
  font: 500 16px/22px "PingFang SC", sans-serif;
}
#status b {
  font: 600 24px/28px Kuaishou, sans-serif;
  font-variant-numeric: tabular-nums;
}
.live-jade #game { padding: 9px 12px 7px; }
.jade-counter {
  display: grid; grid-template-rows: auto 1fr auto; gap: 7px;
  width: 100%; min-height: 0; height: 100%; padding: 9px 10px 7px;
  color: #24271e; border: 1px solid #dfdbca; border-radius: 14px;
  background: #f4efe0;
}
.jade-counter-head { display: flex; align-items: center; justify-content: space-between; min-height: 34px; gap: 8px; }
.live-jade #status {
  display: flex; align-items: center; min-height: 34px;
  margin: 0; padding: 3px 10px; border-radius: 17px; background: #fffdf7;
}
.remaining-line { font: 400 13px/28px "PingFang SC", sans-serif; white-space: nowrap; transform: translateY(-2.5px); }
.remaining-line > span { line-height: 18px; }
/* With a shared baseline, the 24px numeral ink center sits 3.6px above the 13px CJK ink. */
.remaining-line > b { display: inline-block; margin-inline: 4px; transform: translateY(3.6px); }

.live-jade #stage {
  min-height: 0; display: grid; align-items: center; padding: 6px 8px 5px;
  border-radius: 9px; border-bottom: 4px solid #49362b; background: #82614a;
}
.jade-rocks { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.jade-rock {
  min-width: 0;
  padding: 4px 5px 7px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #f4f5ef;
  color: #1a1f28;
  font: 500 13px/18px "PingFang SC", sans-serif;
  touch-action: none;
  user-select: none;
}
.jade-rock[aria-pressed="true"] { border-color: #ffe501; }
.jade-rock[aria-pressed="true"]:disabled { opacity: 1; }
.jade-rock canvas, .jade-rewards canvas {
  width: 100%; height: auto; aspect-ratio: 152 / 98; background: transparent;
}
.jade-rock progress { display: block; width: 68%; height: 6px; margin: 4px auto 0; accent-color: #278260; }
.jade-empty { padding: 36px 0; text-align: center; }
.jade-rewards { padding: 12px 8px 14px; width: 100%; background: white; }
.jade-rewards h2 { margin: 0 4px 8px; }
.jade-rewards ul { list-style: none; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 5px; }
.jade-rewards li {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 1px 8px; border-radius: 8px; background: #f6f7f2; white-space: nowrap;
}
.jade-rewards canvas { width: 49px; }
.jade-rewards strong { font: 500 13px/18px "PingFang SC", sans-serif; }
.jade-rewards small { font: 400 11px/18px "PingFang SC", sans-serif; }
.coupon-amount { display: inline-flex; align-items: baseline; gap: 2px; color: #b72121; white-space: nowrap; }
.coupon-amount b { font: 600 22px/1 Kuaishou, sans-serif; }
.coupon-amount span { font: 600 13px/18px "PingFang SC", sans-serif; }
.jade-rock progress { appearance: none; border: 0; border-radius: 6px; overflow: hidden; background: #dce3db; }
.jade-rock progress::-webkit-progress-bar { background: #dce3db; }
.jade-rock progress::-webkit-progress-value { background: #278260; border-radius: 6px; }
.jade-rock progress::-moz-progress-bar { background: #278260; border-radius: 6px; }

/* Shared sheets keep the title, content and decision in distinct regions. */
#dialog {
  width: min(100%, max(320px, calc(100dvh * 414 / 896)));
  padding: 0 0 max(12px, env(safe-area-inset-bottom));
  max-height: min(82dvh,760px);
  overflow: auto;
  background: #fff;
}
#dialog[open] { animation: sheet-in .18s ease-out both; }
@keyframes sheet-in { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.sheet-header {
  position: sticky; top: 0; z-index: 1;
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center;
  min-height: 60px; padding-inline: 10px; background: white;
  border-bottom: 1px solid #eef0f3;
}
#dialog #dialog-title { grid-column: 2; text-align: center; }
.sheet-header .close { float: none; display: grid; place-items: center; color: #545e6d; }
#dialog-body { padding: 16px 16px 4px; }
#dialog-body > p:first-child { margin-top: 0; }
#dialog-body .sheet-summary { color: #1a1f28; }
#dialog-body .sheet-note { color: #596477; font-size: 13px; text-align: center; }
#dialog .sheet-steps, #dialog .sheet-list { list-style: none; padding: 0; }
.sheet-steps { counter-reset: step; display: grid; gap: 14px; }
.sheet-steps li { counter-increment: step; display: grid; grid-template-columns: 24px 1fr; column-gap: 8px; }
.sheet-steps li::before {
  content: counter(step); grid-row: span 2; width: 24px; height: 24px; line-height: 24px;
  text-align: center; border-radius: 50%; background: #f0f2f5; color: #353f50;
  font-family: Kuaishou, sans-serif;
}
.sheet-steps strong, .sheet-list strong, .sheet-empty strong, .sheet-subhead { font-weight: 600; }
.sheet-steps li > span { color: #596477; }
.sheet-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 0; border-bottom: 1px solid #eef0f3;
}
.sheet-list small { display: block; color: #596477; font-size: 12px; }
.sheet-empty { padding: 22px 6px; text-align: center; background: #f5f6f8; border-radius: 12px; margin-top: 12px; }
.sheet-empty p { color: #596477; }
.sheet-subhead { margin-top: 14px; font-size: 15px; }
.sheet-actions { display: grid; gap: 8px; margin-top: 16px; }
.sheet-actions.split { grid-template-columns: 1fr 1fr; }
#dialog .sheet-actions button { min-height: 48px; margin: 0; font: 600 16px/22px "PingFang SC", sans-serif; }
#dialog .sheet-actions .primary { background: #ffe501; color: #11192d; border-radius: 10px; }
#dialog .sheet-actions .secondary { border-radius: 10px; }
#dialog > [data-inspect-control] { width: calc(100% - 32px); margin-inline: 16px; }
.mine-result { padding: 14px; text-align: center; border-radius: 12px; background: #fff7d8; }
.mine-result > strong { font-size: 34px; line-height: 1; }
.mine-result > strong small { font: 500 14px/20px "PingFang SC", sans-serif; padding-left: 3px; }

.live-frame h1 { font-size: 18px; line-height: 24px; font-weight: 600; }
.live-frame [data-name="底部操作"] .frame-primary:disabled { opacity: .56; }
.live-frame [data-name="底部操作"] .frame-primary:active:enabled { filter: brightness(.94); }
.jade-advisor { display: flex; align-items: center; gap: 8px; min-height: 53px; }
.jade-keeper { flex: 0 0 54px; height: 53px; }
.character-placeholder { position: relative; display: block; color: #867b6a; }
.character-placeholder.mine-worker { position: absolute; }
.character-placeholder::before, .character-placeholder::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%); background: currentColor;
}
.character-placeholder::before { bottom: 52%; width: min(42%,20px); aspect-ratio: 1; border-radius: 50%; }
.character-placeholder::after { bottom: 0; width: min(74%,34px); height: 46%; border-radius: 10px 10px 3px 3px; }
.jade-speech {
  position: relative; flex: 1; min-width: 0; padding: 5px 9px;
  border-radius: 8px; border: 1px solid #d8decd; background: #fbfcf5;
}
.jade-speech strong { color: #36553f; font: 600 12px/16px "PingFang SC", sans-serif; }
.live-jade #hint { min-height: 0; padding: 0; color: #3c443b; font-size: 13px; line-height: 18px; }
.live-jade #hint.is-ready { color: #18563c; font-weight: 600; }
.jade-rock { position: relative; padding: 3px 5px 6px; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.jade-rock[aria-pressed="true"] { transform: translateY(-3px); box-shadow: 0 4px 0 #2229; background: #fffbe3; }
.jade-rock:active { transform: translateY(-1px); }
.rock-check {
  display: none; position: absolute; top: 5px; right: 5px;
  width: 20px; height: 20px; border-radius: 50%; background: #ffe501;
}
.rock-check::after {
  content: ""; position: absolute; width: 9px; height: 5px; inset: 6px auto auto 5px;
  border-left: 2px solid #252616; border-bottom: 2px solid #252616; transform: rotate(-45deg);
}
.jade-rock[aria-pressed="true"] .rock-check { display: block; }
.jade-rock.rock-ready progress::-webkit-progress-value { background: #166244; }
.jade-rock.rock-opened progress { visibility: hidden; }
.jade-empty { padding: 23px 8px; border-radius: 12px; background: #f4f5ef; color: #1a1f28; }
.jade-empty p { font-size: 13px; margin-top: 6px; color: #596477; }

.live-mine #status {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr;
  gap: 9px 0; margin-top: 10px; padding: 10px 12px;
}
.mine-stat { display: grid; justify-items: center; grid-template-rows: 18px 28px; gap: 3px; min-width: 0; }
.stat-label { font: 500 12px/18px "PingFang SC", sans-serif; color: #4d5666; }
.mine-stat + .mine-stat { border-left: 1px solid #e6e8ec; }
.stat-value { display: flex; align-items: baseline; justify-content: center; gap: 3px; white-space: nowrap; }
.stat-value small, .stat-divider { font: 400 12px/18px "PingFang SC", sans-serif; color: #4d5666; }
.mine-stat.urgent .stat-label, .mine-stat.urgent b { color: #a52720; }
.mine-progress {
  grid-column: 1/-1; width: 100%; height: 4px; border: 0;
  appearance: none; overflow: hidden; border-radius: 4px; background: #e8ebef;
}
.mine-progress::-webkit-progress-bar { background: #e8ebef; }
.mine-progress::-webkit-progress-value { background: #806019; border-radius: 4px; }
.mine-progress::-moz-progress-bar { background: #806019; border-radius: 4px; }
.live-mine #hint { height: 32px; min-height: 32px; padding: 6px 0; }
@media (prefers-reduced-motion: reduce) {
  #dialog[open] { animation: none; }
  .jade-rock { transition: none; }
}


@media (max-width: 600px) {
  #page, #home { width: 100%; max-width: none; }
  #dialog { width: 100%; }
}

.live-frame #game > header { justify-content: center; text-align: center; }

.reward-brand { display: none; }
#dialog.reward-sheet {
  inset: 0; margin: auto; width: min(374px,calc(100% - 24px));
  max-height: calc(100dvh - 24px); padding: 0; border-radius: 0;
  color: #fef3e5; background: transparent;
}
#dialog.reward-sheet[open] { display: flex; flex-direction: column; align-items: center; gap: 8px; }
#dialog.reward-sheet::backdrop { background: rgb(22 17 13 / 75%); }
.reward-sheet .reward-brand {
  order: 0; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; color: #2c1303; background: #fff7f0;
  font: 600 14px/18px "PingFang SC", sans-serif;
}
.reward-brand img { width: 12px; height: 14px; }
.reward-sheet .sheet-header { display: contents; }
#dialog.reward-sheet #dialog-title { order: 1; margin: 0 0 8px; font: 700 26px/34px MiSans, "PingFang SC", sans-serif; }
#dialog.reward-sheet #dialog-body { order: 2; padding: 0; }
.reward-sheet .sheet-header form { order: 3; }
#dialog.reward-sheet .close {
  width: 44px; height: 44px; font-size: 0;
  background: transparent;
}
.sheet-header .close img, .reward-sheet .close span { display: none; }
.reward-sheet .close img { display: block; width: 40px; height: 40px; }
.reward-ticket {
  position: relative; isolation: isolate; width: 260px; height: 332px; display: grid; grid-template-rows: 218px 1fr;
  color: #541900; text-align: center;
}
.reward-ticket-art { position: absolute; inset: 0; width: 260px; height: 332px; z-index: -1; }
.reward-face { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 14px; }
#dialog .reward-face p { margin: 0; font-size: 16px; line-height: 22px; }
.reward-kind { font-weight: 600; }
.reward-amount { display: flex; align-items: baseline; gap: 3px; }
.reward-amount b { font: 600 66px/1 Kuaishou, sans-serif; }
.reward-amount span { font: 600 25px/30px "PingFang SC", sans-serif; }
.reward-unpriced { font: 700 38px/1.2 MiSans, "PingFang SC", sans-serif; }
.reward-cta { padding: 18px 40px 8px; }
#dialog .reward-cta .primary { margin: 0; min-height: 48px; border-radius: 6px; background: #f23030; font: 500 16px/22px "PingFang SC", sans-serif; }
#dialog .reward-cta p { color: #7e4635; font-size: 12px; line-height: 18px; }

.live-price #game {
  position: relative; display: grid; grid-template-rows: 36px 1fr 46px; gap: 8px;
  padding: 10px 12px 5px; background: #5f5f5f;
}
.live-price #game > header { justify-content: center; grid-row: 1; }
.live-price #status {
  position: absolute; top: 13px; right: 12px; display: inline-flex; align-items: center;
  margin: 0; padding: 2px 9px; background: #f0f1ef; color: #262c29; border-radius: 16px;
}
.live-price #status b { font-size: 20px; line-height: 26px; }
.price-shift-count { display: block; line-height: 26px; white-space: nowrap; transform: translateY(-2px); }
.price-shift-count > b { display: inline-block; transform: translateY(2.3px); }
.price-shift-count > span:first-child { margin-right: 5px; }
.price-count-divider { margin-inline: 3px; }
.live-price #stage { grid-row: 2; min-height: 0; }
.price-show {
  height: 100%; display: grid; grid-template-rows: minmax(0,1fr) auto; gap: 8px;
}
.price-product {
  min-height: 0; display: grid; grid-template-rows: minmax(0,1fr) auto auto; justify-items: center; gap: 7px;
  padding: 12px 8px 9px; border-radius: 12px; border: 1px solid #d5d8d4;
  background: #f1f2ef; color: #252a27;
}
.price-podium {
  position: relative; display: grid; place-items: center; width: min(78%,280px); min-height: 0;
  padding: 0 6px 13px;
}
.price-podium::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 24px; border-radius: 50%;
  background: #d2d6d0;
}
.price-shirt {
  position: relative; z-index: 1; display: block; width: min(100%,190px);
  height: min(100%,175px); background: #777f78;
  clip-path: polygon(28% 5%,39% 1%,44% 8%,50% 11%,56% 8%,61% 1%,72% 5%,98% 25%,86% 45%,75% 36%,75% 94%,25% 94%,25% 36%,14% 45%,2% 25%);
}
.price-product-label { text-align: center; }
.price-product strong { font: 600 18px/24px "PingFang SC", sans-serif; }
.price-product-label p { font: 400 13px/18px "PingFang SC", sans-serif; color: #535b55; }
.price-tag-spot {
  min-height: 30px; min-width: 106px; display: flex; justify-content: center; align-items: baseline; gap: 4px;
  padding: 4px 10px; border: 1px solid #bdc4bd; border-radius: 5px; background: #fff; color: #414b43;
  font: 500 13px/20px "PingFang SC", sans-serif;
}
.price-tag-spot b { font: 600 18px/20px Kuaishou, sans-serif; }
.price-tag-spot.is-preview { border-color: #f1c473; }
.price-tag-spot.is-checked { background: #ffe5ab; border-color: #efb65b; color: #4b2a1f; animation: price-reveal .26s ease-out; }
@keyframes price-reveal { from { transform: scale(.91); } to { transform: scale(1); } }
.price-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.price-options button {
  min-height: 48px; padding: 4px; border: 2px solid transparent; border-radius: 8px;
  background: #f6f7f5; color: #272c29; font: 500 13px/18px "PingFang SC", sans-serif;
}
.price-options b { font: 600 15px/18px Kuaishou, sans-serif; }
.price-options button[aria-pressed="true"] { border-color: #ffe501; background: #ffed9e; }
.price-options button.actual-band { border-color: #257151; color: #12583c; background: #e8f4ea; opacity: 1; }
.price-manager {
  grid-row: 3; display: flex; align-items: center; gap: 7px; padding: 3px 9px 3px 4px;
  border-radius: 8px; background: #f0f1ef; color: #262c29;
}
.price-clerk { flex: 0 0 34px; height: 31px; color: #7e867f; }
.price-manager-voice strong { color: #3e4841; font: 600 12px/16px "PingFang SC", sans-serif; }
.live-price #hint { min-height: 0; padding: 0; color: #333c36; font: 400 13px/18px "PingFang SC", sans-serif; }
@media (prefers-reduced-motion: reduce) { .price-tag-spot.is-checked { animation: none; } }

#dialog.packet-sheet .reward-brand { display: none; }
.packet-ticket {
  position: relative; width: 260px; height: 332px; overflow: hidden;
  border-radius: 16px; background: #f23030; color: #fff6e6; text-align: center;
}
.packet-brand {
  position: relative; width: max-content; margin: 0 auto; height: 28px; padding: 0 5px;
  display: flex; gap: 4px; align-items: center; background: #ffffff33; font-size: 13px;
}
.packet-brand img { width: 12px; height: 14px; filter: brightness(0) invert(1); }
.packet-brand::before,.packet-brand::after {
  content: ""; position: absolute; top: 0; width: 25px; height: 28px;
  background: url(assets/reward/packet-brand-edge.svg) center / 100% 100% no-repeat;
}
.packet-brand::before { right: 100%; }
.packet-brand::after { left: 100%; transform: scaleX(-1); }
.packet-face { display: grid; justify-items: center; gap: 7px; padding-top: 36px; }
#dialog .packet-face p { margin: 0; }
.packet-base { position: absolute; bottom: 0; left: 0; width: 260px; height: 112px; }
#packet-confirm {
  position: absolute; z-index: 1; left: calc(50% - 40px); top: 198px; width: 80px; height: 80px;
  border-radius: 50%; background: #fff4d6; color: #a82221; font: 700 20px/26px MiSans,"PingFang SC",sans-serif;
}

.live-cashback #game { gap: 8px; padding: 10px 12px 7px; }
.live-cashback #status {
  margin: 0; min-height: 38px; justify-content: center; align-items: center; gap: 4px;
  padding: 4px 8px; color: #303731; background: #f6f4ec;
}
.live-cashback #stage {
  display: grid; place-items: center; flex: 1; min-height: 0;
  background: #f3efe3; border: 1px solid #dfdacb; border-radius: 10px;
}
.cashback-steps {
  display: grid; grid-template-columns: repeat(3,1fr); width: 100%; padding: 0 24px; color: #4b4d46;
}
.cashback-steps li { display: grid; justify-items: center; gap: 6px; position: relative; }
.cashback-steps li + li::before {
  content: ""; position: absolute; right: calc(50% + 18px); top: 15px; width: calc(100% - 36px); height: 2px; background: #d4d1c7;
}
.cashback-steps li.done + li::before { background: #876829; }
.cashback-steps li > span:first-child {
  width: 32px; height: 32px; display: grid; place-items: center;
  background: #e3ded0; color: #514934; border-radius: 50%; font: 600 17px/22px Kuaishou,sans-serif;
}
.cashback-steps li.done > span:first-child { background: #ffe501; color: #3b2d06; }
.cashback-steps small { font: 500 12px/18px "PingFang SC",sans-serif; }
.cashback-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.live-cashback #hint { min-height: 24px; text-align: center; padding: 0; font-size: 13px; }
.cashback-products { width: 100%; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 8px; }
.cashback-products article { min-width: 0; color: #1a1f28; }
.cashback-products img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.cashback-products h3 { margin: 5px 0; font: 500 15px/20px "PingFang SC",sans-serif; }
.cashback-products article > div { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.cashback-products .commerce-number { color: #bd2525; font-size: 20px; }
.cashback-buy { min-height: 44px; padding: 0 11px; border-radius: 8px; background: #bb2525; color: #fff; font-size: 13px; }
.cashback-buy:disabled { opacity: 1; background: #eeedf0; color: #515764; }
.cashback-preview { display: grid; grid-template-columns: 60px 1fr; gap: 10px; align-items: center; }
.cashback-preview img { width: 60px; height: 60px; border-radius: 6px; object-fit: cover; }
#dialog .cashback-payment { display: flex; justify-content: space-between; align-items: baseline; padding-top: 10px; border-top: 1px solid #e6e7e9; }
.cashback-payment strong { color: #bd2525; font-size: 22px; }

#dialog.result-modal {
  inset: 0; margin: auto; width: min(342px, calc(100% - 32px));
  max-height: calc(100dvh - 48px); border-radius: 16px; padding: 0;
}
#dialog.result-modal #dialog-body { padding: 12px 20px 20px; }
.result-modal .receipt-items { max-height: 30dvh; overflow-y: auto; overscroll-behavior: contain; }
.result-modal .receipt-items:not(:empty) { margin-block: 8px 14px; }
.result-modal .primary { background: #ffe501; color: #1a1f28; border-radius: 8px; }
#dialog.result-modal[open] { animation-name: result-appear; }
@keyframes result-appear { from { opacity: 0; } to { opacity: 1; } }
