@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;
}

body {
  margin: 0;
  padding: 0;
  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);
  min-height: 100vh;
  overflow-x: hidden;
}

.app-shell-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 12px;
  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 8px rgba(255, 255, 255, 0.85);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  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: 94vh !important;
  max-height: 900px !important;
  border-radius: 32px !important;
  margin: 0 auto !important;
  box-shadow: 0 24px 60px rgba(30, 41, 59, 0.14), 0 0 0 8px rgba(255, 255, 255, 0.85) !important;
}

/* 竖屏模式下的绘本卡片与二级目录专属缩放适配 (使廖彩杏等纵向封面完整呈现且整体紧凑) */
.mode-phone .catalog-sub-page {
  padding: 0.65rem !important;
}

.mode-phone .catalog-sidebar {
  width: 76px !important;
  min-width: 76px !important;
  max-width: 76px !important;
}

.mode-phone .catalog-sidebar-btn {
  padding: 0.45rem 0.2rem !important;
  font-size: 11px !important;
  text-align: center !important;
  justify-content: center !important;
}

.book-cover-box {
  height: 190px !important;
  min-height: 190px !important;
}

.mode-phone .book-cover-box {
  height: 180px !important;
  min-height: 180px !important;
}

.mode-phone .book-card-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 0.75rem !important;
}

/* 2. 平板横版模式 (mode-pad)：展开为 1240px 大气平板/电脑宽屏视口 */
.app-device-frame.mode-pad {
  width: 96% !important;
  max-width: 1240px !important;
  height: 94vh !important;
  max-height: 900px !important;
  border-radius: 28px !important;
  margin: 0 auto !important;
  box-shadow: 0 24px 60px rgba(30, 41, 59, 0.14), 0 0 0 8px rgba(255, 255, 255, 0.85) !important;
}

/* 平板横版模式下的绘本卡片：充分利用横向视野，一行排布 3 ~ 4 本绘本 (整齐饱满对齐) */
.mode-pad .book-card-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)) !important;
  gap: 1.1rem !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: 100vh !important;
    max-height: 100vh !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .mode-phone .book-card-grid {
    grid-template-columns: 1fr !important;
  }
  .mode-pad .book-card-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.65rem !important;
  }
}

.app-scroll-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 92px;
  scroll-behavior: smooth;
}

.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: transform 0.2s ease, box-shadow 0.2s ease;
}

.ls-card: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: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 76px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  z-index: 40;
}

.ls-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #64748B;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 16px;
  transition: all 0.2s ease;
}

.ls-nav-item.active {
  color: #FF5522;
  font-weight: 700;
  background: #FFF3EC;
}

.ls-nav-item.center-clockin {
  transform: translateY(-14px);
  background: linear-gradient(135deg, #FF7A33 0%, #FF4511 100%);
  color: #FFFFFF !important;
  padding: 10px 18px;
  border-radius: 22px;
  box-shadow: 0 8px 20px rgba(255, 85, 34, 0.38);
}
