/* 全域設定 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
  overflow: hidden;
}

/* 主容器 */
.app-container {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f5f5f5;
  overflow: hidden;
}

/* 頂部區域 */
.top-section {
  flex-shrink: 0;
  background: #fff;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 20;
}

/* Logo 和頂部課次標籤區 */
.header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  gap: 15px;
  position: relative;
  min-height: 60px;
}

.logo {
  width: 140px;
  height: 80px;
  object-fit: contain;
  position: absolute;
  left: 0;
}

.lesson-tabs {
  display: flex;
  gap: 3%;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.lesson-tab {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #ddd;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.lesson-tab.active {
  border-color: #6B6B7D;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
  transform: scale(1.15);
  z-index: 1;
}

/* 導航點 */
.nav-dots-container {
  margin-top: 10px;
}

.nav-dots-wrapper {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 10px 0;
}

.nav-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ddd;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-dot:hover {
  background: #bbb;
  transform: scale(1.2);
}

.nav-dot.active {
  background: #333;
  width: 12px;
  height: 12px;
}

/* 內容區域 (手機版：垂直排列) */
.content-area {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* 左側冊次列表 (手機版) */
.sidebar {
  flex-shrink: 0;
  width: 80px;
  background: rgba(255,255,255,0.95);
  overflow-y: auto;
  padding: 10px 5px;
  box-shadow: 2px 0 8px rgba(0,0,0,0.1);
  z-index: 10;
}

.book-item {
  width: 70px;
  height: 90px;
  margin-bottom: 15px;
  background: #fff;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  overflow: hidden;
  position: relative;
}

.book-item:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.book-item.active {
  box-shadow: 0 0 0 3px #6B6B7D;
  transform: translateX(5px);
}

.book-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-item span {
  position: absolute;
  bottom: 5px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  color: #333;
  background: rgba(255,255,255,0.9);
  padding: 2px;
}

/* 課程滑動區域 */
.lesson-slider-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.lesson-wrapper {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  cursor: grab;
  touch-action: pan-x;
  user-select: none;
  overflow-y: auto;
}

.lesson-wrapper::-webkit-scrollbar {
  width: 8px;
}

.lesson-wrapper::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.3);
  border-radius: 4px;
}

.lesson-wrapper::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.1);
}

.lesson-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.6);
  pointer-events: none;
}

.lesson-wrapper:active {
  cursor: grabbing;
}

/* 課程內容 */
.lesson-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 20px 30px;
  position: relative;
  z-index: 1;
  gap: 3%;
}

.lesson-title {
  font-size: 23px;
  font-family: 'Georgia', serif;
  font-style: italic;
  color: #2c2c2c;
  text-align: center;
  text-shadow: 1px 1px 3px rgba(255,255,255,0.9);
  padding: 20px 30px;
  background: rgba(255,255,255,0.85);
  border-radius: 12px;
  max-width: 90%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  flex-shrink: 0;
}

/* 功能按鈕區域 */
.actions-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 400px;
  padding: 0 10px;
  flex-shrink: 0;
}

.action-row {
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.action-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.action-icon-wrapper {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

/* 不同按鈕的背景色 */
.action-icon-wrapper.article-bg {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
}

.action-icon-wrapper.vocab-bg {
  background: linear-gradient(135deg, #87CEEB 0%, #4682B4 100%);
}

.action-icon-wrapper.pattern-bg {
  background: linear-gradient(135deg, #FFB6C1 0%, #FF69B4 100%);
}

.action-icon-wrapper.blank-bg {
  background: linear-gradient(135deg, #98FB98 0%, #90EE90 100%);
}

.action-icon-wrapper.speaking-bg {
  background: linear-gradient(135deg, #DDA0DD 0%, #BA55D3 100%);
}

.action-icon-wrapper.test-bg {
  background: linear-gradient(135deg, #F0E68C 0%, #DAA520 100%);
}

.action-icon-wrapper.practice-bg {
  background: linear-gradient(135deg, #FFA07A 0%, #FF7F50 100%);
}

.action-icon-wrapper.review-bg {
  background: linear-gradient(135deg, #B0C4DE 0%, #6495ED 100%);
}

.action-icon {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.btn-action {
  padding: 8px 20px;
  font-size: 15px;
  font-weight: bold;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  background: linear-gradient(135deg, #FFF8DC 0%, #FFEFD5 100%);
  color: #333;
  white-space: nowrap;
  min-width: 80px;
}

.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.25);
}

/* 桌機版響應式設計 (螢幕寬度 > 768px) */
@media (min-width: 769px) {
  .app-container {
    max-width: 1200px;
    margin: 0 auto;
  }

  /* 內容區域改為水平排列 */
  .content-area {
    flex-direction: row;
  }

  /* 左側冊次列表 (桌機版) */
  .sidebar {
    width: 215px;
    padding: 20px 10px;
  }

  .book-item {
    width: 180px;
    height: 120px;
    margin-bottom: 20px;
  }

  .book-item span {
    font-size: 16px;
    padding: 5px;
  }

  /* 課程區域居中，有最大寬度 */
  .lesson-slider-container {
    max-width: 800px;
    margin: 0 auto;
  }

  .lesson-title {
    font-size: 28px;
    padding: 24px;
  }

  /* 課次圓圈放大 */
  .lesson-tab {
    width: 65px;
    height: 65px;
    font-size: 16px;
    gap: 15px;
  }

  .lesson-tab.active {
    transform: scale(1.2);
  }

  /* 功能按鈕改為 4x2 網格 */
  .actions-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 600px;
  }

  .action-row {
    display: contents;
  }

  .action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .action-icon-wrapper {
    width: 90px;
    height: 90px;
  }

  .action-icon {
    width: 68px;
    height: 68px;
  }

  .btn-action {
    font-size: 16px;
    padding: 8px 20px;
    min-width: 90px;
  }
}

/* 手機版響應式 (螢幕寬度 < 480px) */
@media (max-width: 480px) {
  .logo {
    display: none;
  }

  .top-section {
    padding: 10px 15px;
  }

  .header {
    margin-bottom: 8px;
    min-height: 50px;
  }

  .lesson-tab {
    width: 45px;
    height: 45px;
    font-size: 12px;
  }

  .lesson-tab.active {
    transform: scale(1.1);
  }

  .nav-dots-container {
    margin-top: 5px;
  }

  .lesson-title {
    font-size: 22px;
    padding: 15px;
  }
  
  .food-icon-wrapper {
    width: 60px;
    height: 60px;
  }
  
  .food-icon {
    width: 45px;
    height: 45px;
  }
  
  .btn-article,
  .btn-vocab {
    font-size: 16px;
    padding: 12px 20px;
  }

  .book-item {
    width: 65px;
    height: 85px;
  }
}

/* 捲軸美化 */
.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}










