/**
 * HistoryRiver Explore V0.1
 * 响应式布局适配（iPhone, iPad, Mac 浏览器）
 */

/* 移动端设备适配 (iPhone / 智能手机 <= 640px) */
@media screen and (max-width: 640px) {
  .museum-header-bar {
    height: 52px;
    padding: 0 12px;
  }

  .brand-logo-icon {
    width: 28px;
    height: 28px;
    font-size: 15px;
  }

  .brand-title-main {
    font-size: 15px;
  }

  .brand-subtitle {
    display: none; /* 移动端隐藏冗长副标题 */
  }

  .header-actions {
    gap: 6px;
  }

  .btn-header-action {
    padding: 5px 9px;
    font-size: 11px;
  }

  .btn-header-action .action-text-full {
    display: none; /* 按钮文字紧凑化，仅显示核心文案 */
  }

  /* 城市抽屉切换为移动端原生底部抽屉 (Bottom Sheet) */
  .city-detail-drawer {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 58vh;
    border-radius: 18px 18px 0 0;
    border-right: none;
    border-left: none;
    border-bottom: none;
    transform: translateY(105%);
    padding-bottom: env(safe-area-inset-bottom, 12px);
  }

  .city-detail-drawer.is-open {
    transform: translateY(0);
  }

  .drawer-header {
    padding: 12px 16px 10px;
  }

  .drawer-city-title {
    font-size: 18px;
  }

  .drawer-body-scroll {
    padding: 12px 16px 14px;
    max-height: calc(58vh - 160px);
  }

  /* 底部年代时间轴停靠栏适配 */
  .timeline-floating-dock {
    bottom: max(10px, env(safe-area-inset-bottom, 10px));
    width: calc(100% - 16px);
    padding: 10px 14px 12px;
    border-radius: var(--radius-md);
    gap: 8px;
  }

  .timeline-header-row {
    gap: 6px;
  }

  .current-year-val {
    font-size: 18px;
  }

  .era-summary-bar {
    font-size: 10.5px;
    padding: 4px 8px;
    line-height: 1.4;
  }

  .milestone-chip {
    font-size: 10px;
    padding: 2px 7px;
  }

  /* 模态框移动端适配 */
  .history-modal-backdrop {
    padding: 10px;
  }

  .history-modal-dialog {
    max-height: 90vh;
    border-radius: var(--radius-md);
  }

  .modal-header-bar {
    padding: 14px 16px 10px;
  }

  .modal-main-title {
    font-size: 18px;
  }

  .modal-body-scroll {
    padding: 14px 16px;
  }

  .game-features-grid {
    grid-template-columns: 1fr; /* 单列排布 */
  }

  .modal-footer-bar {
    padding: 10px 16px;
  }
}

/* 平板设备适配 (iPad / iPad Mini / iPad Pro 641px - 1024px) */
@media screen and (min-width: 641px) and (max-width: 1024px) {
  .city-detail-drawer {
    width: 340px;
    top: 14px;
    right: 14px;
    max-height: calc(100% - 150px);
  }

  .timeline-floating-dock {
    width: calc(100% - 40px);
    max-width: 740px;
    bottom: 16px;
  }
}

/* 视口安全区保障（支持 iPhone 刘海屏与底横条） */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .museum-header-bar {
    padding-top: env(safe-area-inset-top, 0);
  }
}
