/* 全链路演示：响应式收紧（不改文案，只修布局碰撞与溢出） */

/* —— 平板：文案与商品卡并排，避免正文被挡住 —— */
@media (max-width: 1100px) and (min-width: 761px) {
  .story-intro {
    left: 4vw;
    right: auto;
    max-width: min(44vw, 420px);
    top: 13vh;
  }
  .story-intro h1 {
    font-size: clamp(40px, 5.2vw, 58px);
    line-height: 1.08;
  }
  .intro-copy {
    width: auto;
    max-width: 100%;
    font-size: 14px;
    line-height: 1.7;
  }
  .scene-copy {
    left: 4vw;
    width: min(40vw, 360px);
  }
  .scene-copy h2 {
    font-size: clamp(30px, 3.4vw, 44px);
    line-height: 1.14;
  }
  .scene-copy > p:last-child {
    width: auto;
    max-width: 100%;
  }
  .product-actor {
    width: min(26vw, 220px);
  }
  .scanner {
    left: 46%;
    right: 4vw;
    width: auto;
    min-width: 0;
    max-width: 48vw;
    height: 54vh;
    min-height: 300px;
  }
  .extracted-data {
    right: 3.5vw;
    width: 132px;
    padding-left: 18px;
  }
  .language-field,
  .site-construction,
  .campaign-console,
  .route-world,
  .memory-ledger {
    left: 40vw;
    right: 3vw;
  }
  .stage-footer {
    left: 4vw;
    right: 4vw;
  }
}

/* —— 手机：文案在上、视觉在下，禁止横向溢出 —— */
@media (max-width: 760px) {
  .story-stage {
    min-height: 100dvh;
    height: 100dvh;
  }

  .story-intro {
    top: calc(var(--yb-header-offset, 72px) + 10px);
    left: 18px;
    right: 18px;
    max-width: none;
    z-index: 25;
  }
  .story-intro h1 {
    font-size: clamp(30px, 8.4vw, 40px);
    line-height: 1.14;
    letter-spacing: -.03em;
  }
  .intro-copy {
    width: auto;
    max-width: 100%;
    margin-top: 14px;
    font-size: 14px;
    line-height: 1.7;
  }

  .scene-copy {
    left: 18px !important;
    right: 18px !important;
    top: calc(var(--yb-header-offset, 72px) + 12px) !important;
    width: auto !important;
    z-index: 22;
  }
  .scene-scan .scene-copy {
    top: calc(var(--yb-header-offset, 72px) + 12px) !important;
  }
  .scene-copy h2 {
    font-size: clamp(26px, 7.2vw, 34px);
    line-height: 1.18;
  }
  .scene-copy > p:last-child {
    width: auto !important;
    max-width: 100%;
    margin-top: 12px;
    font-size: 13px !important;
    line-height: 1.7 !important;
  }

  .product-actor {
    width: min(46vw, 168px);
    z-index: 28;
  }
  .product-id,
  .product-label b {
    font-size: 11px;
  }
  .product-label small {
    font-size: 10px;
  }
  .actor-line {
    display: none;
  }

  .scanner {
    left: 18px;
    right: 18px;
    top: auto;
    bottom: 14vh;
    width: auto;
    min-width: 0;
    max-width: none;
    height: min(38vh, 300px);
    min-height: 220px;
    border-radius: 18px;
  }
  .scanner::before {
    inset: 9%;
  }
  .scanner::after {
    inset: 22%;
  }
  .extracted-data {
    display: none;
  }

  .language-field {
    left: 16px;
    right: 16px;
    top: 36vh;
    bottom: 11vh;
    grid-template-columns: 1fr 48px 1fr;
    gap: 10px;
  }
  .language-side {
    min-height: 0;
    padding: 16px 14px;
  }
  .language-side strong {
    font-size: 15px;
    margin-top: 14px;
  }
  .language-side p {
    font-size: 11px !important;
  }

  .site-construction {
    left: 16px;
    right: 16px;
    top: 36vh;
    width: auto;
    height: auto;
    bottom: 11vh;
  }
  .site-hero-copy h3 {
    font-size: 22px;
  }

  .campaign-console {
    left: 14px;
    right: 14px;
    top: 34vh;
    bottom: 10vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .route-world {
    left: 14px;
    right: 14px;
    top: 34vh;
    bottom: 10vh;
  }
  .route-card {
    width: min(32%, 120px);
  }

  .memory-ledger {
    left: 14px;
    right: 14px;
    top: 32vh;
    bottom: 9vh;
  }

  /* 章节导航：手机改为底部横向条，可滑动 */
  .chapter-nav {
    display: flex !important;
    top: auto;
    bottom: 58px;
    right: 0;
    left: 0;
    width: auto;
    height: auto;
    transform: none;
    flex-direction: row;
    align-items: center;
    gap: 0;
    padding: 0 10px 0 14px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    z-index: 55;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .92) 28%);
  }
  .chapter-nav::-webkit-scrollbar {
    display: none;
  }
  .chapter-progress {
    display: none;
  }
  .chapter-nav button {
    flex: 0 0 auto;
    min-width: 72px;
    padding: 10px 8px 12px;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }
  .chapter-nav button span {
    opacity: 1;
    transform: none;
    font-size: 10px;
    white-space: nowrap;
  }
  .chapter-nav button::before {
    position: static;
    width: 8px;
    height: 8px;
    margin: 0 0 2px;
  }

  .stage-footer {
    left: 16px;
    right: 16px;
    bottom: 14px;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: end;
  }
  .stage-footer p small {
    display: none;
  }
  .scroll-track {
    display: none;
  }

  .growth-branch {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 72px 18px 56px;
  }
  .creator-branch {
    min-height: 420px;
    padding: 0;
    border-radius: 18px;
    overflow: hidden;
  }
  .creator-visual {
    clip-path: none;
    border-radius: 18px;
    min-height: 420px;
  }
  .creator-map {
    display: none;
  }
  .creator-copy {
    left: 14px;
    right: 14px;
    bottom: 14px;
    width: auto;
    max-width: none;
    padding: 18px 16px;
  }
  .creator-branch strong {
    font-size: clamp(28px, 8vw, 36px);
  }
  .creator-copy > p {
    font-size: 13px;
    line-height: 1.65;
  }
  .creator-signal {
    font-size: 10px;
    margin-top: 12px;
  }

  .closing {
    padding: 72px 20px 88px;
    text-align: left;
  }
  .closing h2 {
    font-size: clamp(36px, 10vw, 48px);
    line-height: 1.12;
  }
}

/* —— 小屏手机再收一点 —— */
@media (max-width: 540px) {
  .story-intro h1 {
    font-size: 30px;
  }
  .scanner {
    bottom: 16vh;
    height: min(34vh, 260px);
    min-height: 200px;
  }
  .product-actor {
    width: min(48vw, 148px);
  }
  .language-field,
  .site-construction,
  .campaign-console,
  .route-world,
  .memory-ledger {
    top: 38vh;
  }
  .chapter-nav {
    bottom: 52px;
  }
  .chapter-nav button {
    min-width: 64px;
  }
}

/* —— 矮屏桌面：压低视觉高度，避免裁切 —— */
@media (max-height: 760px) and (min-width: 761px) {
  .story-stage {
    min-height: 100dvh;
  }
  .story-intro {
    top: 11vh;
  }
  .story-intro h1 {
    font-size: clamp(40px, 4.6vw, 64px);
  }
  .scanner {
    top: 16%;
    height: 58vh;
    min-height: 280px;
  }
  .scene-copy {
    top: 16vh;
  }
}
