* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #f5f7fa;
  color: #333;
  min-height: 100vh;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* 顶部导航 */
.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.header h1 { font-size: 18px; font-weight: 600; }
.header .user-info { font-size: 14px; opacity: 0.9; }

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

/* 登录页 */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-box {
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  text-align: center;
}
.login-box .logo { font-size: 48px; margin-bottom: 12px; }
.login-box h2 { font-size: 22px; color: #333; margin-bottom: 8px; }
.login-box p { color: #888; font-size: 14px; margin-bottom: 28px; }

/* 表单 */
.form-group { margin-bottom: 16px; text-align: left; }
.form-group label { display: block; font-size: 14px; color: #555; margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 0.2s;
  outline: none;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: #667eea;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  width: 100%;
  padding: 12px;
  font-size: 16px;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-outline {
  background: transparent;
  border: 1.5px solid #667eea;
  color: #667eea;
}
.btn-outline:hover { background: #f0f0ff; }
.btn-danger { background: #ff4d4f; color: #fff; }
.btn-danger:hover { background: #ff7875; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* 任务列表 */
.task-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1.5px solid #e8e8e8;
  background: #fff;
  transition: all 0.2s;
}
.task-item.unlocked { cursor: pointer; }
.task-item.unlocked:hover { border-color: #667eea; box-shadow: 0 2px 8px rgba(102,126,234,0.15); }
.task-item.locked { opacity: 0.5; cursor: not-allowed; }
.task-item.completed { border-color: #52c41a; background: #f6ffed; }
.task-icon { font-size: 24px; margin-right: 14px; flex-shrink: 0; }
.task-info { flex: 1; }
.task-title { font-size: 16px; font-weight: 500; }
.task-status { font-size: 13px; color: #888; margin-top: 3px; }
.task-arrow { color: #bbb; font-size: 18px; }

/* 考试页 */
.exam-header {
  background: #fff;
  padding: 14px 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.timer {
  font-size: 20px;
  font-weight: 700;
  color: #667eea;
  font-variant-numeric: tabular-nums;
}
.timer.warning { color: #ff4d4f; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }

.question-block {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 14px;
  border: 1.5px solid #e8e8e8;
}
.question-block .q-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.q-num {
  background: #667eea;
  color: #fff;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 2px;
}
.q-type-tag {
  background: #f0f0ff;
  color: #667eea;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 2px;
}
.q-content { font-size: 15px; line-height: 1.6; flex: 1; }
.q-score { color: #888; font-size: 13px; flex-shrink: 0; margin-top: 2px; }

.options-list { list-style: none; }
.options-list li {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1.5px solid #e8e8e8;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.options-list li:hover { border-color: #667eea; background: #f8f8ff; }
.options-list li.selected { border-color: #667eea; background: #f0f0ff; }
.options-list li input { flex-shrink: 0; }

.subjective-input {
  width: 100%;
  min-height: 100px;
  padding: 10px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  resize: vertical;
  outline: none;
  font-family: inherit;
}
.subjective-input:focus { border-color: #667eea; }

/* 结果页 */
.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin: 0 auto 20px;
}
.score-circle .score-num { font-size: 36px; font-weight: 700; line-height: 1; }
.score-circle .score-label { font-size: 13px; opacity: 0.85; }

.answer-item {
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 10px;
  border-left: 4px solid #e8e8e8;
}
.answer-item.correct { border-left-color: #52c41a; background: #f6ffed; }
.answer-item.wrong { border-left-color: #ff4d4f; background: #fff2f0; }
.answer-item.subjective { border-left-color: #667eea; background: #f8f8ff; }

/* 弹窗 */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal h3 { font-size: 18px; margin-bottom: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* 提示 */
.alert {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 14px;
}
.alert-error { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffccc7; }
.alert-success { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }

/* 加载 */
.loading {
  text-align: center;
  padding: 40px;
  color: #888;
  font-size: 15px;
}

/* 底部操作栏 */
.bottom-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  padding: 12px 20px;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  display: flex;
  gap: 12px;
  justify-content: center;
}
.bottom-bar .btn { min-width: 140px; }

.page-content { padding-bottom: 80px; }
