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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  font-size: 14px;
  -webkit-tap-highlight-color: transparent;
}

.app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 20px;
}

/* ===== 顶部栏 ===== */
.header {
  background: #4A90E2;
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header h1 {
  font-size: 18px;
  font-weight: 500;
}

.back-btn {
  font-size: 20px;
  cursor: pointer;
  min-width: 30px;
}

/* ===== 卡片 ===== */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* ===== 按钮 ===== */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 15px;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: opacity 0.2s;
}

.btn:active { opacity: 0.8; }

.btn-primary {
  background: #4A90E2;
  color: #fff;
}

.btn-success {
  background: #52c41a;
  color: #fff;
}

.btn-warning {
  background: #faad14;
  color: #fff;
}

/* ===== 标签 ===== */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  margin-right: 6px;
}

.tag-primary {
  background: #e6f7ff;
  color: #1890ff;
}

.tag-success {
  background: #f6ffed;
  color: #52c41a;
}

.tag-warning {
  background: #fff7e6;
  color: #faad14;
}

/* ===== 统计 ===== */
.stats-row {
  display: flex;
  justify-content: space-around;
}

.stats-item {
  text-align: center;
}

.stats-num {
  font-size: 28px;
  font-weight: bold;
  color: #4A90E2;
}

.stats-label {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

/* ===== 年级选择 ===== */
.grade-selector {
  display: flex;
  justify-content: center;
  margin: 0 12px 12px;
}

.grade-btn {
  padding: 8px 24px;
  font-size: 14px;
  color: #666;
  background: #f0f0f0;
  border-radius: 20px;
  margin: 0 6px;
  border: none;
  cursor: pointer;
}

.grade-btn.active {
  background: #4A90E2;
  color: #fff;
}

/* ===== 预览 ===== */
.preview-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
}

.preview-item:last-child {
  border-bottom: none;
}

/* ===== 导航 ===== */
.nav-grid {
  display: flex;
  justify-content: space-around;
  margin: 12px;
}

.nav-item {
  background: #fff;
  border-radius: 12px;
  padding: 20px 30px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  cursor: pointer;
}

.nav-icon {
  font-size: 28px;
  margin-bottom: 6px;
}

.nav-text {
  font-size: 13px;
  color: #666;
}

/* ===== 进度条 ===== */
.progress-bar {
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  margin: 12px;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: #4A90E2;
  border-radius: 2px;
  transition: width 0.3s;
}

.progress-text {
  position: absolute;
  right: 0;
  top: -20px;
  font-size: 12px;
  color: #999;
}

/* ===== 选项 ===== */
.option-item {
  padding: 14px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 10px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.option-item:hover {
  border-color: #4A90E2;
}

.option-item.selected {
  border-color: #4A90E2;
  background: #e6f7ff;
}

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

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

/* ===== 结果 ===== */
.result-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: bold;
}

.result-badge.correct {
  background: #f6ffed;
  color: #52c41a;
}

.result-badge.wrong {
  background: #fff1f0;
  color: #ff4d4f;
}

/* ===== 标签页 ===== */
.tab-bar {
  display: flex;
  background: #fff;
  border-radius: 12px;
  margin: 12px;
  overflow: hidden;
}

.tab-item {
  flex: 1;
  text-align: center;
  padding: 14px 0;
  font-size: 15px;
  color: #666;
  cursor: pointer;
  position: relative;
}

.tab-item.active {
  color: #4A90E2;
  font-weight: bold;
}

.tab-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 30%;
  width: 40%;
  height: 3px;
  background: #4A90E2;
  border-radius: 2px;
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: #999;
}

/* ===== 菜单项 ===== */
.menu-item {
  display: flex;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
}

.menu-item:last-child {
  border-bottom: none;
}
