/* Compact desktop composition: one-screen service terminal. */
@media (min-width: 761px) {
  html, body { height: 100%; overflow: hidden; }
  .shell { height: 100dvh; min-height: 0; }
  .topbar { height: 68px; flex: 0 0 68px; }
  .hero { height: 172px; flex: 0 0 172px; padding: 26px 0 24px; grid-template-columns: 0.9fr 1.1fr; }
  .hero h1 { font-size: clamp(32px, 4.2vw, 58px); line-height: 1; letter-spacing: -.075em; margin: 0; justify-self: end; white-space: nowrap; }
  .hero-copy { max-width: 350px; margin: 16px 0 0; font-size: 13px; line-height: 1.5; }
  .workspace { min-height: 0; flex: 1 1 auto; }
  .panel { min-height: 0; padding: 22px 24px; }
  .panel-head { margin-bottom: 22px; }
  .redeem-panel { display: flex; flex-direction: column; }
  .redeem-panel .hint { margin-top: auto; }
  .status-panel { display: flex; flex-direction: column; }
  .empty-state, .loading-state { flex: 1; height: auto; min-height: 0; }
  .status-panel #session-view { overflow: hidden; }
  .phone-card, .code-card { padding: 13px 16px; }
  .phone-card strong { font-size: 24px; }
  .code-card strong { font-size: 34px; min-height: 40px; }
  .origin-card { padding: 10px 14px; }
  .meta-grid { margin: 12px 0; }
  .meta-grid div { padding-top: 9px; padding-bottom: 9px; }
  .actions { margin-top: 4px; }
  .microcopy { margin-top: 10px; }
  footer { flex: 0 0 34px; padding: 10px 0 12px; }
}

@media (max-height: 760px) and (min-width: 761px) {
  .hero { height: 132px; flex-basis: 132px; padding-top: 18px; padding-bottom: 16px; }
  .hero h1 { font-size: 46px; }
  .panel { padding-top: 16px; padding-bottom: 16px; }
  .panel-head { margin-bottom: 14px; }
  .panel h2 { font-size: 24px; }
  .muted { margin-bottom: 18px; }
  .primary { margin-top: 18px; padding: 12px 16px; }
}

@media (max-width: 760px) {
  .hero h1 { font-size: clamp(34px, 13vw, 58px); line-height: .95; white-space: normal; }
}

@media (min-width: 761px) {
  .hero {
    height: 154px;
    flex-basis: 154px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 18px 24px;
    text-align: center;
  }
  .hero .eyebrow { text-align: center; }
  .hero h1 {
    font-size: clamp(30px, 3.3vw, 46px);
    line-height: 1;
    justify-self: auto;
    text-align: center;
  }
  .hero-copy {
    max-width: 520px;
    margin: 0 auto;
    text-align: center;
  }
}

@media (max-height: 760px) and (min-width: 761px) {
  .hero { height: 122px; flex-basis: 122px; padding-top: 12px; padding-bottom: 12px; gap: 6px; }
  .hero h1 { font-size: 36px; }
}

/* 品牌首屏：桌面端以横向广告牌突出形象图，同时保留紧凑的一屏操作空间。 */
@media (min-width: 761px) {
  .hero {
    height: 154px;
    flex-basis: 154px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 148px;
    align-items: center;
    gap: 34px;
    padding: 10px 12px 10px 24px;
    text-align: left;
  }
  .hero-message { min-width: 0; }
  .hero .eyebrow, .hero h1, .hero-copy { text-align: left; }
  .hero h1 {
    margin: 8px 0 6px;
    font-size: clamp(34px, 3.4vw, 48px);
    line-height: .95;
    justify-self: auto;
  }
  .hero-copy { max-width: 620px; margin: 0; }
  .shop-cta {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 9px;
    padding: 6px 9px;
    color: var(--ink);
    background: var(--acid);
    border: 1px solid var(--ink);
    box-shadow: 3px 3px 0 var(--ink);
    text-decoration: none;
    transform: rotate(-.5deg);
    transition: transform .18s ease, box-shadow .18s ease;
  }
  .shop-cta span { font: 9px 'DM Mono', monospace; color: #49600d; letter-spacing: .08em; text-transform: uppercase; }
  .shop-cta strong { font-size: 11px; }
  .shop-cta b { color: var(--coral); font-size: 14px; }
  .shop-cta:hover, .shop-cta:focus-visible { transform: translateY(-2px) rotate(-.5deg); box-shadow: 5px 5px 0 var(--ink); outline: none; }
  .hero-brand-card {
    position: relative;
    width: 138px;
    height: 138px;
    margin: 0;
    transform: rotate(2deg);
  }
  .hero-brand-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 2px solid var(--ink);
    box-shadow: 7px 7px 0 var(--acid);
  }
  .hero-brand-card figcaption {
    position: absolute;
    left: -16px;
    right: -10px;
    bottom: 8px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 9px;
    background: var(--ink);
    color: var(--cream);
    border: 1px solid var(--cream);
    transform: rotate(-4deg);
    white-space: nowrap;
  }
  .hero-brand-card figcaption span {
    color: var(--acid);
    font: 9px 'DM Mono', monospace;
  }
  .hero-brand-card figcaption strong { font-size: 10px; }
}

/* 移动端将品牌图作为完整商品封面展示，避免文案和操作区拥挤。 */
@media (max-width: 760px) {
  .hero { display: grid; grid-template-columns: 1fr; gap: 26px; padding: 42px 0 38px; }
  .hero h1 { margin: 14px 0 16px; }
  .hero-copy { max-width: 440px; margin: 0; }
  .shop-cta { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-top: 18px; padding: 11px 12px; color: var(--ink); background: var(--acid); border: 1px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); text-decoration: none; transform: rotate(-1deg); }
  .shop-cta span { font: 9px 'DM Mono', monospace; color: #49600d; letter-spacing: .08em; }
  .shop-cta strong { font-size: 12px; line-height: 1.35; }
  .shop-cta b { color: var(--coral); font-size: 18px; }
  .hero-brand-card { position: relative; width: min(78vw, 330px); margin: 0 auto; transform: rotate(1.5deg); }
  .hero-brand-card img { display: block; width: 100%; height: auto; border: 2px solid var(--ink); box-shadow: 10px 10px 0 var(--acid); }
  .hero-brand-card figcaption { position: absolute; left: -10px; right: -10px; bottom: 12px; display: flex; justify-content: center; gap: 8px; padding: 10px; background: var(--ink); color: var(--cream); border: 1px solid var(--cream); transform: rotate(-3deg); }
  .hero-brand-card figcaption span { color: var(--acid); font: 10px 'DM Mono', monospace; }
  .hero-brand-card figcaption strong { font-size: 12px; }
}

/* 低高度桌面继续保持一屏完成核销，品牌图随首屏等比收紧。 */
@media (max-height: 760px) and (min-width: 761px) {
  .hero { height: 122px; flex-basis: 122px; grid-template-columns: minmax(0, 1fr) 112px; gap: 24px; padding-top: 7px; padding-bottom: 7px; }
  .hero h1 { margin: 5px 0 4px; font-size: 36px; }
  .hero-copy { font-size: 12px; }
  .shop-cta { margin-top: 5px; padding-top: 4px; padding-bottom: 4px; }
  .hero-brand-card { width: 108px; height: 108px; }
  .hero-brand-card figcaption { left: -12px; right: -8px; bottom: 6px; padding: 5px 7px; }
  .hero-brand-card figcaption strong { font-size: 9px; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-brand-card { animation: brand-float 4s ease-in-out infinite; }
  @keyframes brand-float { 50% { translate: 0 -4px; } }
}
