/* 全站底部导航。新旧页面都加载这份样式，所以它不依赖 base.css，也不改旧页面的基础样式。 */
.star-dock {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  width: min(calc(100vw - 20px), 440px);
  padding: 6px;
  border: 1px solid #e9e0cc;
  border-radius: 24px;
  background: rgba(255, 253, 247, .95);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 2px 6px rgba(74, 58, 28, .08), 0 14px 34px rgba(74, 58, 28, .17);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}
.star-dock a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 54px;
  border-radius: 18px;
  color: #6b6456;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .15s ease, color .15s ease, transform .12s ease;
}
.star-dock a:active { transform: scale(.95); }
.star-dock a:hover { color: #2b2721; }
.star-dock a[aria-current="page"] { background: #fbe6dd; color: #a33019; }
.star-dock svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.star-dock a[aria-current="page"] svg { stroke-width: 2.4; }

/* 给底部导航留位置 */
body { padding-bottom: calc(92px + env(safe-area-inset-bottom)) !important; }

/* 旧页面原来的多套导航统一收起，只留这一套 */
.mobile-nav,
.main-nav,
.portal-mobile-nav,
.bottom-nav { display: none !important; }

/* 旧页面里悬浮的小狐狸让开底部导航 */
.study-tools { bottom: calc(96px + env(safe-area-inset-bottom)) !important; }

/* 专注做题时收起导航，避免误触 */
body.reader-open .star-dock,
body.math-quiz-active .star-dock,
body.phet-open .star-dock { display: none; }
body.reader-open,
body.math-quiz-active,
body.phet-open { padding-bottom: env(safe-area-inset-bottom) !important; }

@media print {
  .star-dock { display: none !important; }
  body { padding-bottom: 0 !important; }
}
