/* 全局重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Microsoft Yahei", Arial, sans-serif;
}

body {
  background-color: #f5f7fa;
  padding: 20px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 30px;
}

/* 头部样式 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.header h1 {
  color: #333;
  font-size: 24px;
}

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

.stats span {
  margin-left: 15px;
}

/* 核心区域：左右分栏 */
.core-area {
  display: flex;
  gap: 20px;
  height: calc(100vh - 150px);
}

/* 左侧列表区域 */
.list-section {
  flex: 2;
  overflow-y: auto;
}

/* 右侧练习区域 */
.practice-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.practice-card {
  width: 100%;
  max-width: 450px;
  background: #f9f9f9;
  border-radius: 8px;
  padding: 25px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.practice-title {
  font-size: 20px;
  color: #333;
  margin-bottom: 20px;
  text-align: center;
  padding-bottom: 10px;
  border-bottom: 2px solid #409eff;
}

/* 练习设置 */
.practice-settings {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.practice-settings select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  outline: none;
}

.practice-settings button {
  padding: 8px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: #fff;
}

#start-practice {
  background-color: #409eff;
}

#start-practice:hover {
  background-color: #337ecc;
}

#reset-practice {
  background-color: #f56c6c;
}

#reset-practice:hover {
  background-color: #e45656;
}

/* 练习统计 */
.practice-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 10px;
  background-color: #e8f4fc;
  border-radius: 4px;
  color: #666;
}

/* 题目区域 */
.question-area {
  margin-bottom: 20px;
  padding: 20px;
  background-color: #fff;
  border-radius: 4px;
  border: 1px solid #eee;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.question-area .tip {
  color: #999;
  text-align: center;
}

.question-area .question {
  color: #333;
  font-weight: 600;
}

.question-area .correct {
  color: #67c23a;
  font-size: 14px;
  margin-top: 10px;
}

.question-area .wrong {
  color: #f56c6c;
  font-size: 14px;
  margin-top: 10px;
}

/* 答题区域 */
.answer-area {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
}

.answer-area input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  outline: none;
}

.answer-area input:focus {
  border-color: #409eff;
}

.answer-area button {
  padding: 0 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#submit-answer {
  background-color: #67c23a;
  color: #fff;
}

#submit-answer:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

#next-question {
  background-color: #409eff;
  color: #fff;
}

#next-question:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* 错题本 */
.wrong-book {
  border-top: 1px solid #eee;
  padding-top: 20px;
}

.wrong-book h3 {
  font-size: 16px;
  color: #333;
  margin-bottom: 10px;
}

.wrong-list {
  max-height: 150px;
  overflow-y: auto;
  padding: 10px;
  background-color: #fff;
  border-radius: 4px;
  border: 1px solid #eee;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.6;
}

#review-wrong {
  padding: 8px 15px;
  border: none;
  border-radius: 4px;
  background-color: #909399;
  color: #fff;
  cursor: pointer;
}

#review-wrong:hover {
  background-color: #73767a;
}

/* 搜索框样式 */
.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
}

.search-box input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
}

.search-box input:focus {
  border-color: #409eff;
}

.search-box button {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

#search-btn {
  background-color: #409eff;
  color: #fff;
}

#search-btn:hover {
  background-color: #337ecc;
}

#reset-btn {
  background-color: #67c23a;
  color: #fff;
}

#reset-btn:hover {
  background-color: #529b2e;
}

/* 词汇列表样式 */
.vocab-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* 大类面板 */
.category-panel {
  border: 1px solid #eee;
  border-radius: 6px;
  overflow: hidden;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background-color: #e8f4fc;
  cursor: pointer;
  font-weight: 600;
  color: #333;
}

.category-header:hover {
  background-color: #d8eafc;
}

.category-header .toggle-icon {
  font-size: 16px;
  color: #409eff;
  transition: transform 0.3s;
}

.category-header .toggle-icon.rotate {
  transform: rotate(90deg);
}

/* 子类列表 */
.subcategory-list {
  padding: 10px 20px;
  display: none; /* 默认折叠 */
}

.subcategory-item {
  margin-bottom: 15px;
}

.subcategory-title {
  font-size: 16px;
  color: #409eff;
  margin-bottom: 10px;
  padding-left: 10px;
  border-left: 3px solid #409eff;
}

/* 词汇网格 */
.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  padding: 10px;
  background-color: #f9f9f9;
  border-radius: 4px;
}

.vocab-item {
  padding: 8px 12px;
  background-color: #fff;
  border: 1px solid #eee;
  border-radius: 4px;
  font-size: 14px;
}

.vocab-item .word {
  font-weight: 600;
  color: #333;
  margin-right: 8px;
}

.vocab-item .meaning {
  color: #666;
}

/* 响应式适配 */
@media (max-width: 992px) {
  .core-area {
    flex-direction: column;
    height: auto;
  }

  .practice-section {
    margin-top: 30px;
  }
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .search-box, .practice-settings {
    flex-direction: column;
  }

  .vocab-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .answer-area {
    flex-direction: column;
  }
}