/* 2026.08.22-4 · 移动端阅读流：章节罗盘、时间线分层与卡片渐进展开。 */
@media (max-width: 820px), (max-height: 540px) and (pointer: coarse) {
  body.classic-shell .bazi-reader-workspace.has-mobile-reading-flow,
  body.classic-shell .peer-reader-workspace.has-mobile-reading-flow {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
  }

  body.classic-shell .bazi-reader-workspace.has-mobile-reading-flow > .bazi-reader-workspace__stage,
  body.classic-shell .peer-reader-workspace.has-mobile-reading-flow > .peer-reader-workspace__stage {
    width: 100% !important;
    min-width: 0 !important;
    grid-column: 1 / -1 !important;
  }

  body.classic-shell .bazi-reader-workspace.has-mobile-reading-flow > .bazi-reader-workspace__rail,
  body.classic-shell .peer-reader-workspace.has-mobile-reading-flow > .peer-reader-workspace__rail {
    display: none !important;
  }

  body.classic-shell .mobile-reader-compass {
    position: sticky;
    top: calc(62px + env(safe-area-inset-top));
    z-index: 132;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(128px, 42%);
    gap: 5px 10px;
    align-items: center;
    width: 100%;
    margin: 0 0 10px;
    padding: 9px 11px 7px;
    border: 1px solid rgba(202, 174, 91, 0.24);
    border-radius: 14px;
    background: rgba(6, 15, 22, 0.94);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(16px);
  }

  body.classic-shell .mobile-reader-compass__copy { min-width: 0; }

  body.classic-shell .mobile-reader-compass__eyebrow {
    display: block;
    margin-bottom: 1px;
    color: rgba(202, 174, 91, 0.72);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.16em;
  }

  body.classic-shell .mobile-reader-compass__current {
    display: block;
    overflow: hidden;
    color: rgba(244, 239, 223, 0.94);
    font-size: 13px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.classic-shell .mobile-reader-compass__select-wrap {
    position: relative;
    min-width: 0;
  }

  body.classic-shell .mobile-reader-compass__select {
    width: 100%;
    min-height: 44px;
    padding: 0 28px 0 10px;
    border: 1px solid rgba(202, 174, 91, 0.32);
    border-radius: 10px;
    color: #f4e8bd;
    background: rgba(202, 174, 91, 0.09);
    font: inherit;
    font-size: 12px;
  }

  body.classic-shell .mobile-reader-compass__select-wrap::after {
    position: absolute;
    top: 50%;
    right: 10px;
    color: rgba(202, 174, 91, 0.78);
    content: '⌄';
    pointer-events: none;
    transform: translateY(-58%);
  }

  body.classic-shell .mobile-reader-compass__progress {
    grid-column: 1 / -1;
    height: 2px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
  }

  body.classic-shell .mobile-reader-compass__progress > i {
    display: block;
    width: var(--mobile-reading-progress, 16.666%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #8fc6ba, #caae5b);
    transition: width 180ms ease;
  }

  body.classic-shell .mobile-timeline-switcher {
    display: grid;
    gap: 8px;
    margin: 0 0 12px;
    padding: 11px;
    border: 1px solid rgba(202, 174, 91, 0.2);
    border-radius: 15px;
    background: linear-gradient(145deg, rgba(12, 25, 34, 0.93), rgba(7, 14, 20, 0.96));
  }

  body.classic-shell .mobile-timeline-switcher__label {
    color: rgba(235, 225, 197, 0.68);
    font-size: 10px;
    letter-spacing: 0.14em;
  }

  body.classic-shell .mobile-timeline-switcher__options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  body.classic-shell .mobile-timeline-switcher button,
  body.classic-shell .mobile-deck-toggle {
    min-height: 44px;
    border: 1px solid rgba(202, 174, 91, 0.18);
    border-radius: 10px;
    color: rgba(237, 232, 216, 0.76);
    background: rgba(255, 255, 255, 0.025);
    font: inherit;
    font-size: 12px;
  }

  body.classic-shell .mobile-timeline-switcher button.is-active {
    border-color: rgba(202, 174, 91, 0.7);
    color: #f5e7b3;
    background: linear-gradient(145deg, rgba(202, 174, 91, 0.2), rgba(202, 174, 91, 0.07));
    box-shadow: inset 0 0 0 1px rgba(202, 174, 91, 0.08);
  }

  body.classic-shell .mobile-card-deck:not(.is-expanded) > .dayun-card:nth-child(n + 5) {
    display: none !important;
  }

  body.classic-shell .mobile-deck-toggle {
    display: block;
    width: 100%;
    margin: 9px 0 4px;
    color: #d7c483;
    background: rgba(202, 174, 91, 0.055);
  }

  body.classic-shell .has-mobile-timeline-flow [hidden],
  body.classic-shell .mobile-card-deck[hidden],
  body.classic-shell .mobile-deck-toggle[hidden] {
    display: none !important;
  }

  body.classic-shell .has-mobile-reading-flow .bazi-reader-stage__head,
  body.classic-shell .has-mobile-reading-flow .peer-reader-stage__head {
    margin-top: 0 !important;
  }

  body.classic-shell [data-reader-deep="timeline"],
  body.classic-shell #fortuneChartSection,
  body.classic-shell #dailySection {
    scroll-margin-top: 128px;
  }
}

@media (max-width: 360px) {
  body.classic-shell .mobile-reader-compass {
    top: calc(66px + env(safe-area-inset-top));
    grid-template-columns: 1fr;
  }

  body.classic-shell .mobile-reader-compass__progress { grid-column: 1; }

  body.classic-shell .mobile-timeline-switcher__options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 460px) and (max-width: 820px) {
  body.classic-shell .mobile-timeline-switcher__options {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-height: 540px) and (pointer: coarse) {
  body.classic-shell .top-nav-shell__bar { min-height: 58px !important; }

  body.classic-shell .top-nav-shell .top-nav .nav-home,
  body.classic-shell .top-nav-shell .top-nav > .nav-item.active,
  body.classic-shell .top-nav-shell .top-nav .nav-more {
    min-height: 44px !important;
  }

  body.classic-shell .mobile-reader-compass {
    top: calc(58px + env(safe-area-inset-top));
    grid-template-columns: minmax(0, 1fr) minmax(150px, 36%);
    padding-top: 7px;
    padding-bottom: 6px;
  }

  body.classic-shell .mobile-reader-compass__eyebrow { display: none; }

  body.classic-shell .mobile-timeline-switcher {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  body.classic-shell .mobile-timeline-switcher__options {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 821px) and (min-height: 541px),
       (min-width: 821px) and (pointer: fine) {
  .mobile-reader-compass,
  .mobile-timeline-switcher,
  .mobile-deck-toggle {
    display: none !important;
  }
}




