@font-face {
  font-family: 'ResourceHanRoundedCN';
  src: url('../assets/fonts/ResourceHanRoundedCN.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'ResourceHanRoundedCN';
  src: url('../assets/fonts/ResourceHanRoundedCNBold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'ToneFont';
  src: url('../assets/fonts/Tone.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --brand-orange: #FF6B2C;
  --brand-orange-light: #FFF3EC;
  --brand-yellow: #FFB800;
  --brand-blue: #3B82F6;
  --brand-purple: #7C5CFC;
  --brand-green: #10B981;
  --bg-Warm: #F7F9FC;
  --text-main: #1E293B;
  --text-sub: #64748B;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100% !important;
  -moz-text-size-adjust: 100% !important;
  -ms-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
}

html,
body {
  margin: 0;
  padding: 0;
  -webkit-text-size-adjust: 100% !important;
  -moz-text-size-adjust: 100% !important;
  -ms-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: 'ResourceHanRoundedCN', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: radial-gradient(circle at 15% 15%, #FFF5EB 0%, #EEF4FF 55%, #F4F0FF 100%);
  color: var(--text-main);
  height: 100%;
  min-height: 100%;
  width: 100%;
  overflow: hidden;
}

.app-shell-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start !important;
  height: var(--app-height, 100dvh);
  max-height: var(--app-height, 100dvh);
  min-height: 0;
  width: 100%;
  padding: 0 !important;
  margin-top: 0 !important;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-device-frame {
  background: #F6F8FD;
  border-radius: 32px;
  box-shadow: 0 24px 60px rgba(30, 41, 59, 0.14), 0 0 0 6px rgba(255, 255, 255, 0.85);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
  transition: max-width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
              width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-radius 0.35s ease;
}

/* 1. 手机竖屏模式 (mode-phone)：严格限制为 440px 手机居中视口，顶部零留白紧贴浏览器上沿 */
.app-device-frame.mode-phone {
  width: 100% !important;
  max-width: 440px !important;
  height: var(--app-height, 100dvh) !important;
  max-height: var(--app-height, 100dvh) !important;
  border-radius: 0 0 24px 24px !important;
  margin: 0 auto !important;
  box-shadow: 0 24px 60px rgba(30, 41, 59, 0.14), 0 0 0 6px rgba(255, 255, 255, 0.85) !important;
}

/* 竖屏模式下的绘本卡片与二级目录专属缩放适配 (使廖彩杏等纵向/横向封面完整呈现且绝不切割遮挡) */
.mode-phone .catalog-sub-page {
  padding: 0.65rem !important;
}

.mode-phone .catalog-sidebar {
  width: 78px !important;
  min-width: 78px !important;
  max-width: 78px !important;
}

.mode-phone .catalog-sidebar-btn {
  padding: 0.5rem 0.35rem !important;
  font-size: 11.5px !important;
  min-height: 38px !important;
  text-align: center !important;
  justify-content: center !important;
  white-space: normal !important;
  line-height: 1.3 !important;
  word-break: break-word !important;
}

.mode-phone .catalog-sidebar-btn > span:first-child {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.book-cover-box {
  height: 210px !important;
  min-height: 210px !important;
  width: 100% !important;
  min-width: 0 !important;
}

.mode-phone .book-cover-box {
  height: 210px !important;
  min-height: 210px !important;
  width: 100% !important;
  min-width: 0 !important;
}

.book-cover-box img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  display: block !important;
}

.book-card-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0.75rem !important;
  width: 100% !important;
  min-width: 0 !important;
}

.book-card-grid > .ls-card {
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  overflow: hidden !important;
}

.mode-phone .book-card-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0.75rem !important;
  width: 100% !important;
}

/* 2. 平板横版模式 (mode-pad)：展开为 1240px 大气平板/电脑宽屏视口 */
.app-device-frame.mode-pad {
  width: 98% !important;
  max-width: 1240px !important;
  height: calc(var(--app-height, 100dvh) - 12px) !important;
  max-height: min(920px, calc(var(--app-height, 100dvh) - 12px)) !important;
  border-radius: 26px !important;
  margin: 0 auto !important;
  box-shadow: 0 24px 60px rgba(30, 41, 59, 0.14), 0 0 0 6px rgba(255, 255, 255, 0.85) !important;
}

/* 平板横版模式下的绘本卡片：仅在宽屏电脑/平板横向时多列排布；竖屏/手机下始终为单列一行一本 */
@media (min-width: 769px) {
  .mode-pad .book-card-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)) !important;
    gap: 1.1rem !important;
    width: 100% !important;
  }
}

/* 竖版模式下隐藏今日任务与补充题单/周作业各项下方的灰色说明小字，避免排版凌乱 */
.mode-phone .hide-in-phone-mode {
  display: none !important;
}

/* 学习中心首页主网格：默认与竖屏/手机下强制单列全宽展示；仅在平板/电脑横屏模式且屏幕宽度 >= 769px 时才展示两列并排 */
.home-main-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0.75rem !important;
  align-items: start !important;
  width: 100% !important;
}

.mode-phone .home-main-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0.75rem !important;
  align-items: start !important;
  width: 100% !important;
}

/* 仅在横版模式且电脑/平板宽屏 (宽度 >= 769px) 时才两列并排 */
@media (min-width: 769px) {
  .mode-pad .home-main-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1rem !important;
    align-items: start !important;
    width: 100% !important;
  }
}

.mode-phone .worksheets-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.45rem !important;
}

.mode-phone .worksheet-item-card {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0.5rem 0.65rem !important;
  gap: 0.5rem !important;
}

.mode-pad .worksheets-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 0.5rem !important;
}

/* 针对真实手机小屏 (宽度 <= 480px 满屏自适应) */
@media (max-width: 480px) {
  .app-shell-wrapper {
    padding: 0 !important;
    justify-content: flex-start !important;
  }
  .app-device-frame.mode-phone,
  .app-device-frame.mode-pad {
    border-radius: 0 !important;
    box-shadow: none !important;
    height: var(--app-height, 100dvh) !important;
    max-height: var(--app-height, 100dvh) !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .book-card-grid,
  .mode-phone .book-card-grid,
  .mode-pad .book-card-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0.75rem !important;
  }
}

/* 竖屏方向与窄屏移动设备下强制分级绘本单列排布（严格一行一本绘本） */
@media (orientation: portrait), (max-width: 768px) {
  .home-main-grid,
  .mode-phone .home-main-grid,
  .mode-pad .home-main-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0.75rem !important;
    width: 100% !important;
  }
  .book-card-grid,
  .mode-phone .book-card-grid,
  .mode-pad .book-card-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0.75rem !important;
    width: 100% !important;
  }
}

/* 针对 iPad 横屏及高度紧凑视口 (高度 <= 860px)，零外边距浪费，确保底部按钮与导航栏 100% 完整可见 */
@media (max-height: 860px) {
  .app-shell-wrapper {
    padding: 0 !important;
  }
  .app-device-frame.mode-pad {
    width: 100% !important;
    max-width: 100% !important;
    height: var(--app-height, 100dvh) !important;
    max-height: var(--app-height, 100dvh) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  .app-device-frame.mode-phone {
    height: var(--app-height, 100dvh) !important;
    max-height: var(--app-height, 100dvh) !important;
    border-radius: 20px !important;
    box-shadow: 0 12px 32px rgba(30, 41, 59, 0.14), 0 0 0 3px rgba(255, 255, 255, 0.85) !important;
  }
  .app-top-header {
    padding-top: 3px !important;
    padding-bottom: 3px !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .ls-bottom-nav {
    min-height: 58px !important;
    padding-top: 3px !important;
    padding-bottom: max(6px, env(safe-area-inset-bottom, 6px)) !important;
  }
  .ls-nav-item.center-clockin {
    min-height: 46px !important;
    transform: translateY(-4px) !important;
    padding: 4px 12px !important;
  }
}

/* 顶部操作栏全端基础与防雾化遮挡保障（彻底消除顶部空白，页面紧贴浏览器上沿） */
.app-top-header {
  background: #ffffff !important;
  background-color: #ffffff !important;
  opacity: 1 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding-top: 3px !important;
  padding-bottom: 3px !important;
  padding-left: 10px !important;
  padding-right: 10px !important;
  position: relative;
  z-index: 30;
}

/* 独立桌面运行 (standalone) 模式：零顶部留白 */
html.is-pwa-standalone,
body.is-pwa-standalone {
  background: #ffffff !important;
  background-color: #ffffff !important;
}
.is-pwa-standalone .app-shell-wrapper {
  padding: 0 !important;
  justify-content: flex-start !important;
  background: #ffffff !important;
}
.is-pwa-standalone .app-device-frame.mode-phone,
.is-pwa-standalone .app-device-frame.mode-pad {
  height: var(--app-height, 100dvh) !important;
  max-height: var(--app-height, 100dvh) !important;
  margin-top: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.is-pwa-standalone .app-top-header {
  padding-top: 3px !important;
  padding-bottom: 3px !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

@media all and (display-mode: standalone) {
  html,
  body {
    background: #ffffff !important;
    background-color: #ffffff !important;
  }
  .app-top-header {
    padding-top: 3px !important;
    padding-bottom: 3px !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .app-shell-wrapper {
    padding: 0 !important;
    justify-content: flex-start !important;
    background: #ffffff !important;
  }
  .app-device-frame.mode-phone,
  .app-device-frame.mode-pad {
    height: var(--app-height, 100dvh) !important;
    max-height: var(--app-height, 100dvh) !important;
    margin-top: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
}

@media all and (display-mode: fullscreen) {
  .app-top-header {
    padding-top: 3px !important;
    padding-bottom: 3px !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .app-shell-wrapper {
    padding-top: 0 !important;
    justify-content: flex-start !important;
  }
  .app-device-frame.mode-phone,
  .app-device-frame.mode-pad {
    height: var(--app-height, 100dvh) !important;
    max-height: var(--app-height, 100dvh) !important;
    margin-top: 0 !important;
  }
}

.app-scroll-body {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 24px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  transform: translateZ(0);
}

.app-scroll-body::-webkit-scrollbar {
  width: 6px;
}

.app-scroll-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

/* Custom Animations */
@keyframes floatSlow {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}

@keyframes pulseRing {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 107, 44, 0.6); }
  70% { transform: scale(1); box-shadow: 0 0 0 14px rgba(255, 107, 44, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 107, 44, 0); }
}

@keyframes popIn {
  0% { opacity: 0; transform: scale(0.88) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.animate-float {
  animation: floatSlow 3.2s ease-in-out infinite;
}

.animate-pulse-ring {
  animation: pulseRing 1.8s infinite;
}

.animate-pop {
  animation: popIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Cards & Buttons */
.ls-card {
  background: #FFFFFF;
  border-radius: 22px;
  box-shadow: 0 6px 20px rgba(30, 41, 59, 0.05);
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.ls-card:hover {
  box-shadow: 0 10px 24px rgba(30, 41, 59, 0.07);
}

.book-card-grid > .ls-card:hover,
.ls-card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(30, 41, 59, 0.08);
}

.ls-btn-primary {
  background: linear-gradient(135deg, #FF7A33 0%, #FF5522 100%);
  color: #FFFFFF;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(255, 92, 40, 0.32);
  transition: all 0.18s ease;
  border: none;
  cursor: pointer;
}

.ls-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(255, 92, 40, 0.42);
}

.ls-btn-primary:active {
  transform: translateY(1px);
}

/* Calendar Day Cell */
.calendar-day {
  aspect-ratio: 1;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  position: relative;
  transition: all 0.18s ease;
  user-select: none;
}

.calendar-day.checked {
  background: linear-gradient(135deg, #FFF3EC 0%, #FFE4D4 100%);
  border: 1.5px solid #FF8B55;
  color: #D9480F;
  font-weight: 700;
}

.calendar-day.today {
  border: 2px solid #FF5522;
  box-shadow: 0 0 0 3px rgba(255, 85, 34, 0.16);
}

.calendar-day.missed {
  background: #FFF5F5;
  border: 1px dashed #FCA5A5;
  color: #EF4444;
  cursor: pointer;
}

/* Word Highlight in Point-Read */
.point-word {
  display: inline-block;
  padding: 2px 5px;
  margin: 1px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.point-word:hover {
  background: rgba(59, 130, 246, 0.14);
  color: #2563EB;
  transform: scale(1.06);
}

.point-word.speaking-now {
  background: #FF6B2C;
  color: #FFFFFF !important;
  transform: scale(1.08);
  box-shadow: 0 4px 10px rgba(255, 107, 44, 0.35);
}

/* Bottom Navigation */
.ls-bottom-nav {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  min-height: 64px;
  height: auto;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 6px max(6px, env(safe-area-inset-bottom, 6px));
  z-index: 40;
  box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.04);
}

.ls-nav-group {
  display: flex;
  align-items: center;
  height: 100%;
}

.ls-nav-group.ls-nav-left,
.ls-nav-group.ls-nav-right {
  flex: 1 1 0%;
  min-width: 0;
  justify-content: space-evenly;
}

.ls-nav-group.ls-nav-center {
  flex: 0 0 auto;
  justify-content: center;
  padding: 0 2px;
}

.ls-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #64748B;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 12px;
  transition: all 0.2s ease;
  user-select: none;
}

.ls-nav-item span {
  white-space: nowrap;
  line-height: 1.15;
}

.ls-nav-item.active {
  color: #15803D;
  font-weight: 700;
  background: transparent;
}

/* ── 底部导航 emoji 图标容器（设计稿 PowerUp 风格） ── */
.bnav-icon {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  background: #F1F5F9;
  border: 1.5px solid #E2E8F0;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.ls-nav-item.active .bnav-icon {
  background: linear-gradient(180deg, #9BE849, #52B818);
  color: #fff;
  border-color: #DCFCE7;
  box-shadow: 0 3px 0 #36850B;
}

.ls-nav-item.center-clockin {
  transform: translateY(-8px);
  background: linear-gradient(135deg, #FF7A33 0%, #FF4511 100%);
  color: #FFFFFF !important;
  min-height: 52px;
  min-width: 58px;
  padding: 6px 14px;
  border-radius: 20px;
  box-shadow: 0 8px 20px rgba(255, 85, 34, 0.38);
  white-space: nowrap;
  font-weight: 800;
  border: 3px solid rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ls-nav-item.center-clockin:active {
  transform: translateY(-4px) scale(0.97);
}

.ls-nav-item.center-clockin span {
  color: #FFFFFF !important;
  font-size: 12px;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* 手机竖屏模式优化 (mode-phone) */
.mode-phone .ls-bottom-nav {
  min-height: 58px;
  padding: 2px 2px max(5px, env(safe-area-inset-bottom, 5px));
}

.mode-phone .ls-nav-group.ls-nav-left,
.mode-phone .ls-nav-group.ls-nav-right {
  gap: 1px;
}

.mode-phone .ls-nav-item {
  font-size: 10.5px;
  padding: 3px 2px;
  gap: 1px;
}

.mode-phone .ls-nav-item img {
  width: 20px;
  height: 20px;
}

.mode-phone .bnav-icon {
  width: 28px;
  height: 28px;
  font-size: 15px;
  border-radius: 9px;
}

.mode-phone .ls-nav-item.center-clockin {
  min-height: 48px;
  min-width: 54px;
  padding: 5px 11px;
  transform: translateY(-7px);
}

.mode-phone .ls-nav-item.center-clockin img {
  width: 23px;
  height: 23px;
}

.mode-phone .ls-nav-item.center-clockin span {
  font-size: 11px;
}

/* 平板/横屏模式优化 (mode-pad) */
.mode-pad .ls-bottom-nav {
  min-height: 66px;
  padding: 4px 16px max(8px, env(safe-area-inset-bottom, 8px));
  max-width: 900px;
  margin: 0 auto;
  border-radius: 18px 18px 0 0;
  border-left: 1px solid rgba(226, 232, 240, 0.8);
  border-right: 1px solid rgba(226, 232, 240, 0.8);
}

.mode-pad .ls-nav-group.ls-nav-left,
.mode-pad .ls-nav-group.ls-nav-right {
  gap: 14px;
}

.mode-pad .ls-nav-item {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  gap: 3px;
}

.mode-pad .ls-nav-item img {
  width: 24px;
  height: 24px;
}

.mode-pad .bnav-icon {
  width: 36px;
  height: 36px;
  font-size: 19px;
  border-radius: 12px;
}

.mode-pad .ls-nav-item.center-clockin {
  min-height: 54px;
  min-width: 66px;
  padding: 6px 18px;
  transform: translateY(-9px);
}

.mode-pad .ls-nav-item.center-clockin img {
  width: 26px;
  height: 26px;
}

.mode-pad .ls-nav-item.center-clockin span {
  font-size: 13px;
}

/* 教师端 / 教务端 / 校长端 顶部状态栏与工具栏整齐排版 */
.staff-header-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.staff-selector-group {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.staff-links-group {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.staff-select-pill {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
  outline: none;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-view-pill,
.staff-action-pill, .header-action-pill {
  height: 28px;
  padding: 0 9px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
}

.staff-action-pill {
  width: 100%;
  min-width: 0;
  padding: 0 4px;
}

/* 平板横屏模式下，教师/教务/校长工具栏自动舒展为单行左右排布 */
.mode-pad .staff-header-bar {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.mode-pad .staff-selector-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.mode-pad .staff-select-pill {
  width: auto;
  max-width: 175px;
}

.mode-pad .staff-links-group {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.mode-pad .staff-action-pill {
  width: auto;
  padding: 0 10px;
}

/* 老师 / 教务 / 校长端 全屏展开面板样式与收起控制（默认严格隐藏，仅老师/教务/校长点击展开时显示） */
#btn-toggle-staff-bar {
  display: none !important;
}

.app-top-header.is-staff-header #btn-toggle-staff-bar {
  display: inline-flex !important;
}

.staff-fullscreen-overlay,
#staff-header-bar {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  z-index: 9999 !important;
  background: #f8fafc !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  padding: max(14px, env(safe-area-inset-top, 14px)) 14px max(28px, env(safe-area-inset-bottom, 28px)) 14px !important;
  box-sizing: border-box !important;
  display: none !important;
  animation: popIn 0.18s ease-out;
}

/* 确保所有功能模态弹窗始终处于全屏工作台菜单 (#staff-header-bar z-index:9999) 之上，点击模块直接弹出而不关闭工作台跳回首页 */
#syycqa-modal-root > .fixed,
#syycqa-template-studio-modal > .fixed,
#ts-overlay,
#syycqa-referral-modal {
  z-index: 10050 !important;
}

#syycqa-toast-container {
  z-index: 10100 !important;
}

.app-top-header.is-staff-header.staff-menu-open #staff-header-bar {
  display: block !important;
}

.app-top-header.staff-tags-collapsed #staff-header-bar,
.app-top-header.is-staff-header #header-collapsible-top-pills {
  display: none !important;
}

/* 课程资源顶部板块胶囊与二级分类胶囊：自适应内容宽度，严禁被 Flex 压缩导致文字超出背景气泡 */
/* 顶部 8 大板块、子模块、分级与单元、首页打卡日期横向滚动条全端防压扁与流畅滑动手势保障 */
.catalog-top-modules-bar,
.catalog-sub-scroll-bar,
.catalog-level-scroll-bar,
.unit-scroll-bar,
.word-unit-scroll-bar,
.checkin-date-scroll-bar,
#checkin-date-pills-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-x !important;
  overscroll-behavior-x: contain !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  padding-left: 4px !important;
  padding-right: 4px !important;
  min-height: 54px !important;
}

.catalog-top-modules-bar::-webkit-scrollbar,
.catalog-sub-scroll-bar::-webkit-scrollbar,
.catalog-level-scroll-bar::-webkit-scrollbar,
.unit-scroll-bar::-webkit-scrollbar,
.word-unit-scroll-bar::-webkit-scrollbar,
.checkin-date-scroll-bar::-webkit-scrollbar,
#checkin-date-pills-row::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.catalog-top-pill,
.catalog-sub-pill,
.catalog-level-pill,
.catalog-unit-pill,
.unit-scroll-bar > button,
.word-unit-scroll-bar > button,
.catalog-sub-scroll-bar > button,
.catalog-level-scroll-bar > button,
.catalog-top-modules-bar > button,
.checkin-date-scroll-bar > button,
#checkin-date-pills-row > button {
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
  width: max-content !important;
  min-width: max-content !important;
  max-width: none !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  touch-action: pan-x pan-y !important;
  pointer-events: auto !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

.catalog-top-pill {
  padding: 0 16px !important;
  height: 38px !important;
  min-height: 38px !important;
  font-size: 13px !important;
  border-radius: 14px !important;
}

.catalog-sub-pill {
  padding: 0 16px !important;
  height: 38px !important;
  min-height: 38px !important;
  font-size: 13px !important;
  border-radius: 12px !important;
}

.catalog-level-pill {
  padding: 0 14px !important;
  height: 36px !important;
  min-height: 36px !important;
  font-size: 12px !important;
  border-radius: 12px !important;
}

.catalog-unit-pill {
  padding: 0 14px !important;
  height: 38px !important;
  min-height: 38px !important;
  font-size: 12px !important;
  border-radius: 12px !important;
}

.catalog-top-pill img,
.catalog-top-pill span,
.catalog-sub-pill span,
.catalog-level-pill span,
.catalog-unit-pill span {
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

/* 移动端 WebView 极致流畅与沉浸式体验优化 */
.app-scroll-body {
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain;
  touch-action: pan-y !important;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: scroll-position;
}

@media (max-width: 640px) {
  .app-shell-wrapper {
    padding: 0 !important;
  }
  .app-device-frame.mode-phone {
    max-width: 100% !important;
    height: var(--app-height, 100vh) !important;
    max-height: var(--app-height, 100vh) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
}

/* 隐藏横向滚动条保留流畅滑动 */
.no-scrollbar::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
.no-scrollbar {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
}

/* 教材专属单元与级别胶囊样式防压扁 */
.catalog-unit-pill,
.catalog-level-pill {
  touch-action: pan-x pan-y !important;
  -webkit-tap-highlight-color: transparent !important;
  pointer-events: auto !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  flex-shrink: 0 !important;
}

/* 确保原版教材分享说明与海报浮层始终位于白板模态框(10050)之上 */
#wb-share-success-modal,
#poster-saved-overlay,
#poster-action-sheet-overlay,
#poster-fullscreen-overlay {
  z-index: 10095 !important;
}
