/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

.app {
  max-width: 768px;
  margin: 0 auto;
  min-height: 100vh;
  background-color: #fff;
}

/* 导航栏 */
.navbar {
  display: flex;
  justify-content: space-around;
  background-color: #fff;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-item {
  padding: 15px 20px;
  text-decoration: none;
  color: #666;
  font-size: 16px;
  transition: color 0.3s;
}

.nav-item.active {
  color: #1890ff;
  border-bottom: 2px solid #1890ff;
}

.nav-item:hover {
  color: #1890ff;
}

/* 主要内容 */
.main-content {
  padding: 15px;
}

/* 卡片 */
.card {
  background-color: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card h2 {
  font-size: 18px;
  margin-bottom: 15px;
  color: #333;
}

.card h3 {
  font-size: 16px;
  margin-bottom: 10px;
  color: #666;
}

/* 按钮 */
.btn {
  display: inline-block;
  padding: 12px 24px;
  font-size: 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
}

.btn-primary {
  background-color: #1890ff;
  color: #fff;
}

.btn-primary:hover {
  background-color: #40a9ff;
}

.btn-primary:disabled {
  background-color: #d9d9d9;
  cursor: not-allowed;
}

.btn-secondary {
  background-color: #f5f5f5;
  color: #666;
}

.btn-secondary:hover {
  background-color: #e8e8e8;
}

/* 今日训练卡片 */
.today-card {
  text-align: center;
}

.today-info {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.today-info span {
  font-size: 14px;
  color: #666;
}

/* 天数选择网格 */
.day-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.day-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  background: #f5f5f5;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s;
  border: 2px solid transparent;
}

.day-btn:hover {
  background: #e6f7ff;
  border-color: #1890ff;
}

.day-btn.completed {
  background: #f6ffed;
  border-color: #52c41a;
}

.day-num {
  font-size: 20px;
  font-weight: bold;
  color: #333;
}

.day-label {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

.today-info .day,
.today-info .level {
  font-weight: bold;
  color: #1890ff;
}

/* 能力概览 */
.mastery-item {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.skill-name {
  width: 60px;
  font-size: 14px;
  color: #666;
}

.mastery-bar {
  flex: 1;
  height: 8px;
  background-color: #f0f0f0;
  border-radius: 4px;
  margin: 0 10px;
  overflow: hidden;
}

.mastery-fill {
  height: 100%;
  background-color: #1890ff;
  border-radius: 4px;
  transition: width 0.3s;
}

.mastery-value {
  width: 40px;
  font-size: 14px;
  color: #666;
  text-align: right;
}

/* 训练页 */
.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.question-number {
  font-size: 16px;
  color: #666;
}

.question-type {
  font-size: 12px;
  padding: 4px 8px;
  background-color: #e6f7ff;
  color: #1890ff;
  border-radius: 4px;
}

/* 音频播放器 */
.audio-player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px;
  background-color: #f5f5f5;
  border-radius: 8px;
  margin-bottom: 15px;
}

.play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background-color: #1890ff;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.play-btn:hover {
  background-color: #40a9ff;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background-color: #e8e8e8;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: #1890ff;
  border-radius: 3px;
  transition: width 0.1s;
}

.time {
  font-size: 12px;
  color: #999;
  min-width: 80px;
  text-align: right;
}

/* 问题文本 */
.question-text {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #333;
}

/* 选项列表 */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.option-item {
  display: flex;
  align-items: center;
  padding: 15px;
  background-color: #f5f5f5;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.option-item:hover {
  background-color: #e6f7ff;
}

.option-item.selected {
  background-color: #1890ff;
  color: #fff;
}

.option-item.correct {
  background-color: #52c41a;
  color: #fff;
}

.option-item.wrong {
  background-color: #ff4d4f;
  color: #fff;
}

.option-label {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: #fff;
  color: #1890ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-right: 15px;
}

.option-item.selected .option-label {
  background-color: #fff;
  color: #1890ff;
}

.option-item.correct .option-label {
  background-color: #fff;
  color: #52c41a;
}

.option-item.wrong .option-label {
  background-color: #fff;
  color: #ff4d4f;
}

.option-text {
  font-size: 16px;
}

/* 结果卡片 */
.result-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.result-icon {
  font-size: 36px;
}

.result-header.correct .result-icon {
  color: #52c41a;
}

.result-header.wrong .result-icon {
  color: #ff4d4f;
}

.result-text {
  font-size: 20px;
  font-weight: bold;
}

/* 解析 */
.explanation {
  padding: 15px;
  background-color: #f6ffed;
  border-radius: 8px;
  margin-bottom: 15px;
  font-size: 14px;
}

/* 关键听力点 */
.key-points {
  margin-bottom: 15px;
}

.key-points h4 {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}

.key-points ul {
  list-style: none;
  padding: 0;
}

.key-points li {
  padding: 8px 12px;
  background-color: #e6f7ff;
  border-radius: 4px;
  margin-bottom: 5px;
  font-size: 14px;
}

/* 词汇 */
.vocab {
  margin-bottom: 15px;
}

.vocab h4 {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}

.vocab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vocab-item {
  padding: 6px 12px;
  background-color: #fff7e6;
  border-radius: 4px;
  font-size: 14px;
}

/* 中文解释 */
.chinese-notes {
  padding: 15px;
  background-color: #f9f9f9;
  border-radius: 8px;
  font-size: 14px;
  color: #666;
}

/* 结果操作 */
.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.result-actions .btn {
  flex: 1;
}

/* 精听页 */
.intensive-header {
  text-align: center;
}

.intensive-header .subtitle {
  color: #666;
  font-size: 14px;
}

.progress-card {
  padding: 15px;
}

.step-info {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
  text-align: center;
}

/* 大播放按钮 */
.play-btn-large {
  width: 80px;
  height: 80px;
  font-size: 24px;
  margin: 0 auto 15px;
  display: block;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.controls .btn {
  width: auto;
  padding: 8px 16px;
  font-size: 14px;
}

/* Transcript */
.transcript-content {
  font-size: 16px;
  line-height: 1.8;
  color: #333;
}

/* 关键句 */
.key-sentences {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.key-sentence {
  padding: 12px;
  background-color: #f6ffed;
  border-radius: 6px;
  font-size: 14px;
}

.key-sentence.high {
  border-left: 3px solid #52c41a;
}

.key-sentence.medium {
  border-left: 3px solid #faad14;
}

/* 词汇卡片 */
.vocab-card .vocab-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vocab-card .vocab-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vocab-word {
  font-weight: bold;
}

.vocab-phonetic {
  color: #999;
  font-size: 12px;
}

/* 跟读卡片 */
.practice-card {
  text-align: center;
}

.recording-status {
  margin-top: 10px;
  font-size: 14px;
  color: #ff4d4f;
}

/* 进度页 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.stat-item {
  text-align: center;
  padding: 15px;
  background-color: #f5f5f5;
  border-radius: 8px;
}

.stat-value {
  display: block;
  font-size: 24px;
  font-weight: bold;
  color: #1890ff;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 12px;
  color: #666;
}

/* 雷达图 */
.radar-card {
  text-align: center;
}

#radar-chart {
  margin: 0 auto;
}

/* 能力详情 */
.mastery-detail-item {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.mastery-detail-name {
  width: 70px;
  font-size: 14px;
  color: #666;
}

.mastery-detail-bar {
  flex: 1;
  height: 10px;
  background-color: #f0f0f0;
  border-radius: 5px;
  margin: 0 10px;
  overflow: hidden;
}

.mastery-detail-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.3s;
}

.mastery-detail-fill.high {
  background-color: #52c41a;
}

.mastery-detail-fill.medium {
  background-color: #faad14;
}

.mastery-detail-fill.low {
  background-color: #ff4d4f;
}

.mastery-detail-value {
  width: 40px;
  font-size: 14px;
  color: #666;
  text-align: right;
}

/* 薄弱项 */
.weak-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.weak-item {
  padding: 8px 16px;
  background-color: #fff1f0;
  color: #ff4d4f;
  border-radius: 20px;
  font-size: 14px;
}

.weak-tip {
  font-size: 14px;
  color: #666;
}

/* 图表容器 */
.chart-container {
  overflow-x: auto;
}

/* 语速控制 */
.speed-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
  padding: 10px;
  background-color: #f5f5f5;
  border-radius: 8px;
}

.speed-label {
  font-size: 14px;
  color: #666;
}

.speed-btn {
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid #d9d9d9;
  background-color: #fff;
  color: #666;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.speed-btn:hover {
  border-color: #1890ff;
  color: #1890ff;
}

.speed-btn.active {
  background-color: #1890ff;
  color: #fff;
  border-color: #1890ff;
}

/* 听力文本部分 */
.transcript-section {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.transcript-section h4 {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}

.transcript-content {
  display: none;
  padding: 15px;
  background-color: #f9f9f9;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.8;
  color: #333;
  margin-bottom: 10px;
}

.transcript-content.show {
  display: block;
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

/* 跟读练习部分 */
.read-along-section {
  margin-top: 15px;
  padding: 15px;
  background-color: #f6f6f6;
  border-radius: 8px;
}

.read-along-section h4 {
  font-size: 14px;
  color: #333;
  margin-bottom: 8px;
}

.read-along-tip {
  font-size: 13px;
  color: #999;
  margin-bottom: 12px;
}

.read-along-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.read-along-controls .btn {
  flex: 1;
}

.recording-status {
  text-align: center;
  font-size: 14px;
  color: #ff4d4f;
  margin-bottom: 10px;
}

.recording-status.recording {
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.read-along-result {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.read-along-result p {
  font-size: 13px;
  color: #666;
  margin-bottom: 5px;
}

.read-along-result audio {
  width: 100%;
  margin-bottom: 15px;
}

/* 响应式 */
@media (max-width: 480px) {
  .navbar {
    flex-direction: column;
  }
  
  .nav-item {
    text-align: center;
    padding: 12px;
  }
  
  .today-info {
    flex-direction: column;
    gap: 10px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .result-actions {
    flex-direction: column;
  }
  
  .speed-control {
    flex-wrap: wrap;
  }
  
  .read-along-controls {
    flex-direction: column;
  }
}

/* 可点击单词 */
.clickable-word {
  cursor: pointer;
  padding: 2px 1px;
  border-radius: 3px;
  transition: background-color 0.2s;
}

.clickable-word:hover {
  background-color: #e6f7ff;
  color: #1890ff;
}

.clickable-word.in-vocab {
  background-color: #fff7e6;
  color: #fa8c16;
  border-bottom: 1px dashed #fa8c16;
}

/* 生词弹窗 */
.vocab-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.vocab-popup-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.vocab-popup-actions .btn {
  flex: 1;
  width: auto;
  padding: 8px 12px;
  font-size: 14px;
}

/* 生词本页面 */
.vocab-count {
  font-size: 14px;
  color: #999;
  margin-bottom: 15px;
}

.vocab-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background-color: #f9f9f9;
  border-radius: 8px;
  margin-bottom: 8px;
}

.vocab-entry-word {
  font-size: 16px;
  font-weight: bold;
  color: #333;
}

.vocab-entry-meaning {
  font-size: 14px;
  color: #666;
  margin-top: 2px;
}

.vocab-entry-remove {
  padding: 4px 10px;
  font-size: 12px;
  background: #fff1f0;
  color: #ff4d4f;
  border: 1px solid #ffa39e;
  border-radius: 4px;
  cursor: pointer;
}

.vocab-entry-remove:hover {
  background: #ff4d4f;
  color: #fff;
}

.vocab-empty {
  text-align: center;
  color: #999;
  font-size: 14px;
  padding: 40px 0;
}

/* 词典弹窗 */
.vocab-popup {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 320px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  position: relative;
}

.vocab-popup-x {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  color: #999;
  cursor: pointer;
  line-height: 1;
}

.vocab-popup-x:hover {
  color: #333;
}

.dict-loading {
  text-align: center;
  color: #999;
  padding: 20px 0;
  font-size: 14px;
}

.dict-word {
  font-size: 24px;
  font-weight: bold;
  color: #333;
  margin-bottom: 2px;
}

.dict-phonetic {
  font-size: 15px;
  color: #1890ff;
  margin-bottom: 4px;
  font-style: italic;
}

.dict-pos {
  font-size: 13px;
  color: #fa8c16;
  margin-bottom: 12px;
  font-weight: bold;
}

.dict-defs {
  margin-bottom: 10px;
}

.dict-def {
  font-size: 14px;
  color: #333;
  line-height: 1.6;
  padding: 4px 0;
  border-bottom: 1px solid #f0f0f0;
}

.dict-def:last-child {
  border-bottom: none;
}

.dict-example {
  font-size: 13px;
  color: #666;
  padding: 8px 12px;
  background: #f9f9f9;
  border-radius: 6px;
  margin-bottom: 10px;
  line-height: 1.5;
}

.dict-synonyms {
  font-size: 13px;
  color: #52c41a;
  margin-bottom: 8px;
}

.dict-label {
  font-weight: bold;
  color: #666;
}

.dict-cn {
  padding: 6px 10px;
  background: #fff7e6;
  border-radius: 6px;
  margin-bottom: 12px;
}

.dict-cn-text {
  font-size: 14px;
  color: #fa8c16;
  font-weight: bold;
}
