* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 16px;
}
.app {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  min-height: 90vh;
  position: relative;
}
.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 32px 20px 24px;
  text-align: center;
}
.header h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 2px;
}
.header p {
  font-size: 14px;
  opacity: 0.9;
}

.page {
  display: none;
  padding: 20px;
  padding-bottom: 80px;
}
.page.active {
  display: block;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #667eea;
  font-size: 14px;
  margin-bottom: 16px;
  cursor: pointer;
  font-weight: 500;
}
.page-title {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin-bottom: 16px;
}

/* 考试方案首页 */
.scheme-section-title {
  font-size: 16px;
  color: #555;
  margin: 8px 0 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.scheme-card {
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
  position: relative;
  margin-bottom: 12px;
}
.scheme-card:hover,
.scheme-card:active {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
  border-color: #667eea;
}
.scheme-card h3 {
  font-size: 17px;
  color: #333;
  margin-bottom: 4px;
  font-weight: 600;
}
.scheme-card p {
  font-size: 13px;
  color: #888;
}
.scheme-card .scheme-arrow {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #667eea;
  font-size: 22px;
}
.scheme-card .scheme-badge {
  display: inline-block;
  background: #667eea;
  color: #fff;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  margin-top: 8px;
}
.scheme-card.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #f0f0f0;
}
.scheme-card.disabled:hover,
.scheme-card.disabled:active {
  transform: none;
  box-shadow: none;
  border-color: transparent;
}
.scheme-card.disabled .scheme-badge {
  background: #999;
}

/* 书目首页 */
.section-title {
  font-size: 16px;
  color: #555;
  margin: 20px 0 12px;
  font-weight: 600;
}
.book-grid {
  display: grid;
  gap: 12px;
}
.book-card {
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
  position: relative;
}
.book-card:hover,
.book-card:active {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
  border-color: #667eea;
}
.book-card h3 {
  font-size: 17px;
  color: #333;
  margin-bottom: 6px;
  font-weight: 600;
}
.book-card .book-meta {
  font-size: 13px;
  color: #888;
}
.book-card .book-arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #667eea;
  font-size: 20px;
}

/* 今日推荐 */
.today-box {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 20px;
  color: #fff;
  margin-bottom: 8px;
}
.today-box h3 {
  font-size: 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.today-box p {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 14px;
  line-height: 1.5;
}
.today-btn {
  background: #fff;
  color: #667eea;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.today-btn:active {
  transform: scale(0.98);
}

/* 继续学习 */
.continue-box {
  background: #f8f9ff;
  border: 2px solid #e0e4ff;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  cursor: pointer;
}
.continue-box h4 {
  font-size: 14px;
  color: #667eea;
  margin-bottom: 4px;
}
.continue-box p {
  font-size: 13px;
  color: #666;
}

/* 书籍详情页模式选择 */
.mode-list {
  display: grid;
  gap: 12px;
}
.mode-item {
  background: #f8f9fa;
  border-radius: 16px;
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}
.mode-item:hover,
.mode-item:active {
  border-color: #667eea;
  background: #f8f9ff;
}
.mode-item h4 {
  font-size: 16px;
  color: #333;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mode-item p {
  font-size: 13px;
  color: #888;
  line-height: 1.4;
}

/* 章节选择 */
.chapter-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.chapter-item {
  padding: 16px;
  background: #f8f9fa;
  border-radius: 14px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}
.chapter-item:hover,
.chapter-item:active {
  border-color: #667eea;
  background: #f8f9ff;
  transform: translateY(-1px);
}
.chapter-item h4 {
  font-size: 15px;
  color: #333;
  margin-bottom: 4px;
  font-weight: 600;
}
.chapter-item p {
  font-size: 12px;
  color: #888;
}

/* 抽背页面 */
.study-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.study-mode-tag {
  font-size: 12px;
  color: #667eea;
  background: #f0f2ff;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
}
.progress-bar {
  background: #e9ecef;
  height: 6px;
  border-radius: 3px;
  margin-bottom: 20px;
  overflow: hidden;
}
.progress-fill {
  background: linear-gradient(90deg, #667eea, #764ba2);
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}

/* 核心卡片 */
.card-box {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 32px 24px;
  color: #fff;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.25);
  position: relative;
}
.card-concept {
  font-size: 13px;
  opacity: 0.85;
  margin-bottom: 10px;
  text-align: center;
  letter-spacing: 1px;
}
.card-question {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.6;
  text-align: center;
}
.card-answer-box {
  display: none;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}
.card-answer-box.show {
  display: block;
}
.card-answer {
  font-size: 14.5px;
  line-height: 1.8;
  text-align: left;
}
.card-answer strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}
.card-meta {
  margin-top: 12px;
  font-size: 11px;
  opacity: 0.7;
  text-align: center;
}

/* 查看答案按钮 */
.reveal-btn {
  width: 100%;
  padding: 14px;
  background: #f0f2ff;
  color: #667eea;
  border: 2px solid #667eea;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
}
.reveal-btn:active {
  transform: scale(0.98);
}

/* 评级按钮 */
.rate-btns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.rate-btn {
  padding: 14px 6px;
  border-radius: 12px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.rate-btn:active {
  transform: scale(0.95);
}
.rate-know {
  background: #d4edda;
  color: #155724;
}
.rate-vague {
  background: #fff3cd;
  color: #856404;
}
.rate-dont {
  background: #f8d7da;
  color: #721c24;
}

/* 翻题导航 */
.question-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}
.nav-btn {
  padding: 12px 6px;
  border-radius: 12px;
  border: 2px solid #e0e4ff;
  background: #f8f9ff;
  color: #667eea;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.nav-btn:hover,
.nav-btn:active {
  border-color: #667eea;
  background: #f0f2ff;
}
.nav-btn:active {
  transform: scale(0.98);
}
.nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: #e9ecef;
  background: #f8f9fa;
  color: #adb5bd;
}
.nav-counter {
  font-size: 14px;
  color: #888;
  text-align: center;
  font-weight: 500;
  white-space: nowrap;
  padding: 0 4px;
  min-width: 60px;
}

/* 收藏按钮 */
.fav-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fav-btn.active {
  background: rgba(255, 215, 0, 0.9);
  color: #333;
}

/* 收藏列表 */
.fav-list {
  display: grid;
  gap: 10px;
}
.fav-item {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  border: 2px solid transparent;
}
.fav-item:hover {
  border-color: #667eea;
}
.fav-item h4 {
  font-size: 14px;
  color: #333;
  margin-bottom: 4px;
}
.fav-item span {
  font-size: 12px;
  color: #888;
}

/* 空状态 */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: #888;
}
.empty h3 {
  margin-bottom: 8px;
  color: #555;
  font-size: 16px;
}
.empty p {
  font-size: 13px;
}

/* 基础响应式 */
@media (min-width: 768px) {
  body {
    padding: 40px 20px;
  }
  .app {
    min-height: auto;
  }
}

/* 小屏手机保护 */
@media (max-width: 480px) {
  #header-scheme > div:first-child {
    font-size: 32px !important;
    letter-spacing: 6px !important;
  }
  #header-scheme > div:nth-child(2) {
    padding: 8px 18px !important;
  }
  #header-scheme > div:nth-child(2) > div {
    font-size: 18px !important;
    letter-spacing: 2px !important;
  }
  .card-question {
    font-size: 17px;
  }
  .rate-btn {
    font-size: 12px;
    padding: 12px 4px;
  }
  .nav-btn {
    font-size: 13px;
    padding: 10px 4px;
  }
  .nav-counter {
    font-size: 13px;
    min-width: 52px;
  }
  .question-nav {
    gap: 6px;
  }
  .card-box {
    padding: 28px 20px;
    min-height: 220px;
  }
  .scheme-card {
    padding: 18px 16px;
  }
  .book-card {
    padding: 18px 16px;
  }
  .mode-item {
    padding: 16px;
  }
  .chapter-item {
    padding: 14px;
  }
}

/* 超小屏额外保护 */
@media (max-width: 360px) {
  #header-scheme > div:first-child {
    font-size: 28px !important;
    letter-spacing: 4px !important;
  }
  .rate-btn {
    font-size: 11px;
    padding: 10px 2px;
  }
  .nav-btn {
    font-size: 12px;
  }
  .card-question {
    font-size: 16px;
  }
}

/* 平板端：768px–1199px */
@media (min-width: 768px) and (max-width: 1199px) {
  body {
    padding: 24px;
  }
  .app {
    max-width: 700px;
    min-height: auto;
  }
  .card-box {
    min-height: 280px;
  }
}

/* 电脑端：≥1200px */
@media (min-width: 1200px) {
  body {
    padding: 40px 20px;
  }
  .app {
    max-width: 760px;
    min-height: auto;
  }
  .card-box {
    min-height: 300px;
  }
}
