/* 易慧天星 · 统一版式层
   目标：所有页面共用同一栏宽与同一套底栏尺寸，桌面端不再忽宽忽窄。 */

/* ── 桌面：统一栏宽，随屏幕分级放宽（手机 100% → 560 → 720） ── */
:root { --yh-w: 480px; --yh-hw: 240px; }
@media (min-width: 520px) { :root { --yh-w: 560px; --yh-hw: 280px; } }
@media (min-width: 900px) { :root { --yh-w: 720px; --yh-hw: 360px; } }

@media (min-width: 520px) {
  html { background: #e9e2d6; }
  body {
    max-width: var(--yh-w) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .05), 0 0 60px rgba(0, 0, 0, .10);
  }
  /* 固定定位的底栏同样收进这一栏 */
  .bottom-nav, div.tab, .tab-bar {
    left: 0 !important;
    right: 0 !important;
    width: auto !important;
    max-width: var(--yh-w) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    transform: none !important;
  }
  /* 右下角悬浮按钮贴着栏内右缘，而不是屏幕右缘 */
  button[style*="right:14px"], .share-fab, .fab {
    right: calc(50% - var(--yh-hw) + 14px) !important;
  }
}

/* ── 底部导航：统一高度与字号 ── */
.bottom-nav, div.tab, .tab-bar,
div[style*="position:fixed"][style*="bottom:0"][style*="max-width:480px"] {
  min-height: 56px !important;
  box-sizing: border-box !important;
  padding: 0 0 env(safe-area-inset-bottom, 0px) !important;
}

.bottom-nav .bn-item,
.bottom-nav .nav-item,
div.tab a,
button.tab {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  height: 56px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-sizing: border-box !important;
  text-align: center !important;
  font-size: 11px !important;
  line-height: 13px !important;
}

.bottom-nav .bn-icon,
.bottom-nav .ni,
div.tab a > span:first-child,
button.tab .ic {
  font-size: 20px !important;
  line-height: 22px !important;
  height: 22px !important;
  display: block !important;
}

.bottom-nav .bn-label,
.bottom-nav .nt {
  font-size: 11px !important;
  line-height: 13px !important;
  height: 13px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
}

/* 窄屏下大运/流月/流日等多列行改为横向滑动，避免每格被压缩到看不清 */
@media (max-width: 519px) {
  #dyRoot2 .dy-row:not(.dy-dayun-row),
  #dyL2 .dy-row,
  #dyM2 .dy-row,
  #dyH2 .dy-row {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  #dyRoot2 .dy-row::-webkit-scrollbar,
  #dyL2 .dy-row::-webkit-scrollbar,
  #dyM2 .dy-row::-webkit-scrollbar,
  #dyH2 .dy-row::-webkit-scrollbar { display: none; }
  #dyRoot2 .dy-row:not(.dy-dayun-row) .dy-item,
  #dyL2 .dy-row .dy-item,
  #dyM2 .dy-row .dy-item,
  #dyH2 .dy-row .dy-item {
    flex: 0 0 auto !important;
    min-width: 52px !important;
  }
}

/* 已安装为桌面应用时，窗口控件就在右上角，隐藏页内的刷新按钮避免误触 */
@media (display-mode: standalone), (display-mode: window-controls-overlay) {
  #refreshBtn { display: none !important; }
}

/* ── 统一正文基线字号（各页原本 14/15/17/18 混用） ── */
body { font-size: 16px !important; }

/* 内容不足一屏时也把底色铺满整栏，桌面端不会露出半截图 */
body { min-height: 100vh; box-sizing: border-box; }

/* ── 页面底部留白统一（避免内容被底栏压住） ── */
body {
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
}
