/* ============================================================
   闯多多 - 页面样式
   ============================================================ */

/* ==================== 登录/注册页 ==================== */
.login-page, .register-page {
  padding: 60px 24px 0;
}

.login-header {
  text-align: center;
  margin-bottom: 40px;
}

.login-header h1 {
  font-size: 32px;
  color: var(--primary);
  margin-bottom: 8px;
}

.login-header p {
  color: var(--text-light);
  font-size: 14px;
}

.login-form {
  max-width: 360px;
  margin: 0 auto;
}

.login-form .btn {
  margin-top: 20px;
  padding: 14px;
  font-size: 16px;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
}

.login-footer a {
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
}

/* ==================== 书架页 ==================== */
.book-list {
  padding: 12px 16px;
}

.book-item {
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.2s;
}

.book-item:active {
  transform: scale(0.98);
}

.book-cover {
  width: 64px;
  height: 86px;
  border-radius: 4px;
  background: #E8F0FE;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-right: 14px;
  overflow: hidden;
  flex-shrink: 0;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-info {
  flex: 1;
}

.book-name {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 4px;
}

/* ==================== 书籍详情页 ==================== */
.book-detail-content {
  padding: 20px 16px;
  padding-bottom: 80px;
}

.bd-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.bd-cover {
  text-align: center;
  margin-bottom: 16px;
}

.bd-cover img {
  max-width: 180px;
  max-height: 240px;
  border-radius: var(--radius);
}

.bd-description {
  font-size: 15px;
  color: #555;
  line-height: 1.8;
}

.book-detail-actions {
  padding: 16px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
}

/* ==================== 关卡列表页 ==================== */
.stage-list {
  padding: 12px 16px;
}

.stage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.2s;
}

.stage-item:active {
  transform: scale(0.98);
}

.stage-item .stage-main {
  flex: 1;
}

.stage-item .stage-name {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
}

.stage-item .stage-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-light);
}

.stage-item .reward {
  color: var(--warning);
  font-weight: 500;
}

.stage-item .difficulty-easy { color: var(--success); }
.stage-item .difficulty-medium { color: var(--warning); }
.stage-item .difficulty-hard { color: var(--danger); }

/* 通关关卡 */
.stage-passed {
  background: #e3f2fd !important;
  border: 1px solid #bbdefb;
  cursor: default;
}

.stage-passed:active {
  transform: none;
}

.stage-passed .stage-check {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
  margin-left: 12px;
}

/* 锁定关卡 */
.stage-locked {
  background: #f5f5f5 !important;
  opacity: 0.6;
  cursor: not-allowed;
}

.stage-locked:active {
  transform: none;
}

.stage-locked .stage-name,
.stage-locked .stage-meta {
  color: #bbb;
}

/* 可闯关关卡 */
.stage-active {
  cursor: pointer;
}

/* ==================== 答题页 ==================== */
.challenge-progress {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--card-bg);
  gap: 12px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s;
}

.progress-text {
  font-size: 13px;
  color: var(--text-light);
  white-space: nowrap;
}

.question-area {
  padding: 20px 16px;
}

.question-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.question-text {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 20px;
  line-height: 1.6;
}

.question-image {
  width: 100%;
  margin-bottom: 16px;
  border-radius: var(--radius);
  overflow: hidden;
}

.question-image img {
  width: 100%;
  display: block;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-item {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.option-item:hover {
  border-color: var(--primary);
}

.option-item.selected {
  border-color: var(--primary);
  background: #EBF3FC;
}

.option-key {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  margin-right: 12px;
  flex-shrink: 0;
}

.option-item.selected .option-key {
  background: var(--primary);
  color: #fff;
}

.option-text {
  flex: 1;
  font-size: 15px;
}

.challenge-actions {
  display: flex;
  gap: 12px;
  padding: 16px;
  justify-content: center;
}

/* ==================== 检查结果提示框 ==================== */
.check-result {
  margin-top: 16px;
  border-radius: var(--radius);
  padding: 14px 16px;
}

.check-result.correct {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
}

.check-result.wrong {
  background: #fce4ec;
  border: 1px solid #ef9a9a;
}

.check-result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.check-result.correct .check-result-header { color: #2e7d32; }
.check-result.wrong .check-result-header { color: #c62828; }

.check-icon {
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 700;
}

.check-result.correct .check-icon { background: #4caf50; }
.check-result.wrong .check-icon { background: #e53935; }

.check-explanation {
  font-size: 14px; color: #555; line-height: 1.6;
  padding-top: 8px; border-top: 1px solid rgba(0,0,0,0.08);
}

/* 选项正确/错误高亮 */
.option-item.opt-correct-result {
  border-color: #4caf50 !important;
  background: #e8f5e9 !important;
}
.option-item.opt-correct-result .option-key {
  background: #4caf50 !important; color: #fff !important;
}

.option-item.opt-wrong-result {
  border-color: #e53935 !important;
  background: #fce4ec !important;
}
.option-item.opt-wrong-result .option-key {
  background: #e53935 !important; color: #fff !important;
}

/* ==================== 结果页 ==================== */
.result-page {
  padding: 60px 24px;
}

.result-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 24px;
  text-align: center;
  margin-bottom: 24px;
}

.result-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.result-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 12px;
}

.result-accuracy {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.result-reward {
  font-size: 16px;
  color: var(--warning);
  margin-bottom: 8px;
}

.result-message {
  font-size: 14px;
  color: var(--text-light);
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ==================== 我的页 ==================== */
.my-page {
  padding-bottom: 24px;
}

.my-coins-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 20px 24px;
  margin: 16px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.my-coins-card .coins-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.my-coins-card .coins-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
}

.my-records {
  padding: 0 16px;
}

.my-records h3 {
  font-size: 16px;
  margin-bottom: 12px;
  padding-left: 4px;
}

.record-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
}

.record-item .record-book {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 6px;
}

.record-item .record-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-light);
}

.my-footer {
  padding: 24px 16px;
}

/* ==================== 答题解析 ==================== */
.analysis-area { padding: 0 16px 16px; }

.analysis-list { display: flex; flex-direction: column; gap: 12px; }

.analysis-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  border-left: 4px solid var(--border);
}

.analysis-item.analysis-correct { border-left-color: var(--success); }
.analysis-item.analysis-wrong { border-left-color: var(--danger); }

.analysis-q-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-light); margin-bottom: 8px;
}

.analysis-num { font-weight: 600; color: var(--text); }

.analysis-q-text {
  font-size: 15px; font-weight: 500; line-height: 1.6; margin-bottom: 12px;
}

.analysis-options { display: flex; flex-direction: column; gap: 8px; }

.analysis-option {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 6px; background: var(--bg); font-size: 14px;
}

.analysis-option .opt-key {
  width: 24px; height: 24px; border-radius: 50%; background: #ddd;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px; flex-shrink: 0;
}

.analysis-option.opt-correct { background: #e8f5e9; }
.analysis-option.opt-correct .opt-key { background: var(--success); color: #fff; }

.analysis-option.opt-wrong { background: #fce4ec; }
.analysis-option.opt-wrong .opt-key { background: var(--danger); color: #fff; }

.analysis-explanation {
  margin-top: 10px; padding: 10px 12px; background: #fff8e1;
  border-radius: 6px; font-size: 13px; color: #666; line-height: 1.6;
}