/* ============================================
   《腌笃鲜》维基百科 - Responsive Styles
   ============================================ */

@media (max-width: 1024px) {
  .layout {
    padding: 16px 12px 32px;
  }

  .reading-position-text {
    padding-left: 284px;
  }

  .content-card {
    padding: 28px 24px;
  }

  .sidebar {
    width: 220px;
    min-width: 220px;
  }
}

@media (max-width: 768px) {
  html {
    scroll-padding-top: 102px;
  }

  .chapter-nav-inner {
    justify-content: flex-start;
    padding: 0 58px;
  }

  .chapter-nav-pages {
    flex: 1 1 auto;
    scroll-snap-type: x proximity;
  }

  .book-switcher summary {
    min-height: 43px;
    padding: 10px 9px;
  }

  .book-switcher summary strong {
    font-size: 13px;
  }

  .book-switcher-menu {
    position: fixed;
    top: 51px;
    left: 58px;
  }

  .chapter-nav-link {
    padding: 12px 14px 11px;
    font-size: 13px;
    scroll-snap-align: center;
  }

  .chapter-nav-link::after {
    left: 14px;
    right: 14px;
  }

  .hero {
    min-height: 46vh;
    padding: 40px 20px 36px;
  }

  .hero-title {
    font-size: 1.8rem;
    letter-spacing: 0;
  }

  .hero-title-row {
    gap: 6px;
  }

  .hero-title-row::before {
    flex-basis: 46px;
  }

  .hero-seal {
    width: 46px;
    height: 46px;
    border-radius: 3px;
    top: 3px;
  }

  .hero-subtitles {
    right: 12px;
    gap: 10px;
  }

  .hero-subtitle {
    font-size: 0.9rem;
    letter-spacing: 0;
  }

  .hero-torn-edge {
    height: 26px;
  }

  .hero-btn {
    padding: 10px 28px;
    font-size: 15px;
    letter-spacing: 0;
  }

  .hero-actions {
    gap: 8px;
  }

  .sidebar-toggle {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 270px;
    min-width: 270px;
    height: 100vh;
    max-height: 100vh;
    z-index: 160;
    border-radius: 0;
    visibility: hidden;
    pointer-events: none;
    transition: left var(--transition-normal), visibility 0s linear 0.3s;
    box-shadow: var(--shadow-float);
  }

  .sidebar-header {
    min-height: 40px;
    padding-left: 64px;
    align-items: center;
  }

  .sidebar.open {
    left: 0;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }

  .sidebar-overlay.visible {
    display: block;
  }

  .layout {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding: 12px 8px 24px;
    gap: 0;
  }

  .reading-position-text {
    padding-right: 24px;
    padding-left: 24px;
  }

  .main-content,
  .content-card,
  .md-body {
    width: 100%;
    min-width: 0;
  }

  .content-card {
    padding: 20px 16px;
  }

  .md-body h1 {
    font-size: 27px;
  }

  .md-body h2 {
    margin: 0 0 28px;
    padding: 0;
    font-size: 26px;
  }

  .md-body h2::before {
    margin-bottom: 7px;
    font-size: 15px;
    letter-spacing: 0.16em;
  }

  .md-body h3 {
    margin: 56px 0 14px;
    padding-bottom: 8px;
    font-size: 18px;
  }

  .md-body h3::before {
    margin-right: 9px;
    font-size: 15px;
  }

  .md-body h4 {
    margin: 26px 0 10px;
    font-size: 15px;
  }

  .md-body > h5 {
    margin-top: 21px;
    font-size: 13.5px;
  }

  .md-body > h6 {
    margin-top: 18px;
    font-size: 12.5px;
  }

  .recipe-strip {
    --recipe-icon-size: 44px;
    gap: 6px 7px;
    margin-left: 0;
    padding: 7px 8px;
  }

  .recipe-part {
    gap: 6px;
  }

  .recipe-token {
    width: 58px;
  }

  .recipe-item-name {
    font-size: 10px;
  }

  .recipe-operator {
    font-size: 14px;
  }

  .recipe-arrow {
    font-size: 18px;
  }

  .prize-pool-overview {
    margin-top: 20px;
    padding: 16px;
  }

  .prize-pool-heading {
    margin-bottom: 12px;
    padding-bottom: 11px;
  }

  .md-body .prize-pool-heading h5 {
    font-size: 16px;
  }

  .prize-pool-grid {
    grid-template-columns: 1fr;
  }

  .prize-tier-wide {
    grid-column: auto;
  }

  .prize-tier {
    padding: 14px 14px 13px;
  }

  .prize-tier-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .prize-tier-meta {
    justify-content: flex-start;
  }

  .prize-tier-unlocks {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .wheel-compat-grid {
    grid-template-columns: 1fr;
  }

  .wheel-compat-card {
    padding: 15px 16px 14px;
  }

  .md-body table {
    font-size: 12.5px;
  }

  .md-body thead th,
  .md-body tbody td {
    padding: 8px 10px;
  }

  /* 窄屏：表格恢复横向滚动，表头吸顶让位 */
  .table-outer {
    overflow-x: auto;
  }

  .md-body thead th {
    top: 0;
  }

  .faq-item summary {
    gap: 9px;
    min-height: 54px;
  }

  .faq-answer {
    padding: 0 4px 14px 44px;
  }


  .back-to-top {
    right: 12px;
    bottom: 20px;
    width: 38px;
    height: 38px;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
  }

  .jieyun-filter {
    padding: 8px 10px;
  }

  .jieyun-filter-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "input clear"
      "status status";
    gap: 5px 8px;
  }

  .jieyun-filter-input {
    grid-area: input;
  }

  .jieyun-filter-status {
    grid-area: status;
  }

  .jieyun-filter-clear {
    grid-area: clear;
  }

  .jieyun-table-outer {
    display: none;
  }

  .jieyun-card-list {
    display: grid;
    gap: 10px;
    margin-top: 10px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.5rem;
  }

  /* 超小屏仅保留一联竖排副标题，避免溢出 */
  .hero-subtitle {
    font-size: 0.85rem;
    letter-spacing: 0;
  }

  .hero-subtitle + .hero-subtitle {
    display: none;
  }

  .hero-btn {
    padding: 10px 24px;
    font-size: 14px;
  }

  .hero-actions {
    width: min(100%, 300px);
  }

  .content-card {
    padding: 16px 12px;
  }

  .reading-position-text {
    padding-right: 20px;
    padding-left: 20px;
  }

  .md-body table {
    font-size: 12px;
  }

  .copy-btn {
    opacity: 1;
  }
}

@media (max-width: 360px) {
  .hero-content {
    width: 100%;
    padding: 1rem;
  }

  .hero-title {
    font-size: 1.35rem;
  }

  .hero-title-row::before,
  .hero-seal,
  .hero-subtitles {
    display: none;
  }
}
