/* ===================================================================
   平板 · 适配层（2026-11-28）
   ---------------------------------------------------------------
   生效范围：769px ≤ 视口宽 ≤ 1180px
     - 平板竖屏：iPad 810 / 820 / 834，Android 800 / 900 / 1024
     - 平板横屏：iPad 1024 / 1080 / 1112 / 1180
   不覆盖：手机（≤768，见 style.css 与 mobile-landscape.css）
           桌面（≥1181）
   本文件必须排在 style.css / mobile-landscape.css 之后加载。
   =================================================================== */
@media (min-width: 769px) and (max-width: 1180px) {

  /* ---------- 1. 宽表格：改成自身横向滚动，不再把页面撑出屏幕 ---------- */
  /* .heir-table 最小 920px、.servant-table 最小 980px，
     在 769–980 的竖屏平板上必然超出视口，靠容器滚动兜住 */
  #official-view,
  #child-view,
  #servant-view,
  #cold-view,
  #ties-view {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .official-table-wrap,
  .official-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 表头不折行：1112 宽下「表字 / 年岁 / 荣宠」会被压成两行 */
  .heir-table th,
  .servant-table th,
  .official-table th {
    white-space: nowrap;
  }
}

/* ---------- 4. 开局页：平板横屏铺满视口，去掉 960×460 造成的上下大黑边 ---------- */
/* opening.css 在本文件之后加载，故用 html 前缀提高特异性 */
@media (min-width: 769px) and (max-width: 1180px) and (orientation: landscape) {
  html #opening-root.mobile .stage {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
  }
}

@media (min-width: 769px) and (max-width: 980px) {
  /* ---------- 2. 选秀：右侧详情收窄，中间栏不被挤扁 ---------- */
  .select-main {
    grid-template-columns: 160px minmax(0, 1fr) 300px;
    gap: 0.65rem;
  }
}

/* ---------- 3. 触控平板：热区与输入字号对齐手机标准 ---------- */
@media (min-width: 769px) and (max-width: 1180px) and (pointer: coarse) {

  /* 平板是手指操作，按钮不能沿用桌面的紧凑尺寸 */
  button,
  .btn,
  .btn-primary,
  .btn-secondary,
  .btn-small,
  .btn-block,
  .btn-back,
  .btn-danger,
  .btn-icon,
  .btn-ascend,
  .btn-continue,
  .btn-restore-sub,
  .status-next-btn,
  .location-float-btn,
  [role="button"],
  input[type="submit"],
  input[type="button"] {
    min-height: max(2.5rem, 44px);
  }

  /* 图标类圆形控件 40px 即可，不必撑到 44px */
  .btn-icon,
  .location-float-btn,
  .tab-close,
  .modal-close {
    min-width: 2.5rem;
    min-height: 2.5rem;
  }

  /* iOS 输入框字号低于 16px 时，聚焦会自动放大整页 */
  input,
  textarea,
  select {
    font-size: 1rem !important;
  }
}
