/* 明大官网排版修复 — 2026-09-17
 * 只修排版/适配，不动内容。加载顺序：在 assets/index-DIJdHGfP.css 之后。
 * 要点：镜像站多处 grid 用内联 style（三亚校区卡 520px 居中、校区图片 2 列），
 * 内联优先级高于媒体查询，窄屏打不平 → 这里用 !important 按断点压平。
 */

/* 1) 顶部导航：4 字标题不再拆成 3+1 两行；放不下整行可横向滑动 */
.nav-links a,
.nav-cta { white-space: nowrap; }
.nav-links {
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nav-links::-webkit-scrollbar { display: none; }
@media (min-width: 901px) {
  .nav-links { gap: 14px; }
  .nav { gap: 10px; }
  .nav-links a { font-size: .88rem; }
}

/* 1b) 900-1140（iPad 横屏等）：10 个链接放不下，收进汉堡菜单 */
@media (max-width: 1140px) and (min-width: 901px) {
  .nav-links { display: none; }
  .menu-btn { display: block; }
}

/* 2) 校区部分：三亚卡与海口卡同列同宽对齐（覆盖内联 520px 居中） */
#campus .addr-grid[style] {
  grid-template-columns: repeat(3, 1fr) !important;
  max-width: none !important;
  margin: 0 !important;
}

/* 3) 窄屏：所有内联 grid 统一压平，消除横向溢出 */
@media (max-width: 900px) {
  #campus .addr-grid[style],
  .gallery-grid[style] { grid-template-columns: 1fr !important; }
}

/* 3b) 统计格：1fr 被 min-content（大号数字）撑破 → 用 minmax 锁死 */
.data-hero { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .data-hero { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
.data-hero .stat { min-width: 0; }
.data-hero .stat .num { white-space: nowrap; }

/* 4) 标题断词改善（"教明白/双轨制"不再被硬拆到下一行孤字） */
h1, h2, h3 { text-wrap: balance; }

/* 5) 拉起 FAB 上移，避让站点自带的右下角橙色浮动按钮 */
#md-launch-fab { bottom: 5.5rem !important; }

/* 6) 兜底：杜绝任何原因导致的页面横向滚动 */
html, body { overflow-x: clip; }

/* 7) 首屏统计条：窄屏 4 格并排太挤（描述文字被拆行），改 2×2 */
@media (max-width: 640px) {
  .hero-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
  .hero-stats .hs { border-right: 1px dashed rgba(26, 95, 180, .12); }
  .hero-stats .hs:nth-child(2n) { border-right: none; }
  .hero-stats .hs:nth-child(-n+2) { border-bottom: 1px dashed rgba(26, 95, 180, .12); }
}

/* 8) 小屏首屏标题字号收敛（43px 大字导致"教明白"被拆出孤字行） */
@media (max-width: 640px) {
  .hero h1 { font-size: 2.05rem; }
}

/* 9) 地址长文本避免末字孤行（pretty 防孤字，CJK 渐进增强） */
.addr-card .row span:last-child,
.addr-card .row p { text-wrap: pretty; }

/* 10) 移动端拉起 FAB 缩小，减少对内容的遮挡 */
@media (max-width: 640px) {
  #md-launch-fab { font-size: .78rem; padding: .5rem .85rem; bottom: 5.2rem; }
}
