/* ========== 弹窗 / 结果页 / 错题库 / 关于页 通用组件样式 ========== */

/* 弹窗遮罩 */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 540px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  animation: slideUp 0.25s;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* 结果页统计 */
.result-header {
  text-align: center;
  padding: 20px;
}

.result-score {
  font-size: 3.5rem;
  font-weight: 800;
  margin: 12px 0;
}

.result-score.excellent { color: var(--success); }
.result-score.good { color: var(--primary); }
.result-score.fair { color: var(--warning); }
.result-score.poor { color: var(--danger); }

.result-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.result-stat {
  text-align: center;
  padding: 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.result-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.result-stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* 逐题解析 */
.review-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.review-item.correct {
  border-left: 4px solid var(--success);
}

.review-item.wrong {
  border-left: 4px solid var(--danger);
}

.review-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.review-answer {
  font-size: 0.9rem;
  margin-top: 8px;
  padding: 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

/* 错题库 */
.wrongbank-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wrongbank-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.wrongbank-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.wrongbank-item-info {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.wrongbank-item-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* 关于页 */
.about-section {
  margin-bottom: 20px;
}

.about-section h3 {
  margin-bottom: 8px;
  color: var(--primary);
}

.about-section p {
  color: var(--text-secondary);
  line-height: 1.8;
}

.version-list {
  list-style: none;
}

.version-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.version-list li:last-child {
  border-bottom: none;
}

.version-date {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-right: 8px;
}

/* 文件导入区 */
.import-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 12px;
}

.import-zone:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.import-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.import-result {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-top: 8px;
}

.import-result.success {
  background: var(--success-light);
  color: var(--success);
}

.import-result.error {
  background: var(--danger-light);
  color: var(--danger);
}

/* 历史记录表格 */
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.history-table th,
.history-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.history-table th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text-secondary);
}

.history-table tr:hover td {
  background: var(--primary-light);
}

/* 工具栏 */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* 提示条 */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.alert-info { background: var(--primary-light); color: var(--primary-dark); }
.alert-success { background: var(--success-light); color: #1e7e34; }
.alert-warning { background: var(--warning-light); color: #856404; }
.alert-danger { background: var(--danger-light); color: #c62828; }

/* 退出确认弹窗统计网格 */
.logout-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}

.logout-stat {
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.logout-stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.logout-stat-value {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

/* 关于平台弹窗 */
.about-modal-section {
  margin-bottom: 14px;
}

.about-modal-h4 {
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 0.95rem;
}

.about-modal-section p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.7;
}

.about-modal-version {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
}

.about-modal-ver {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
}

.about-modal-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.about-modal-features {
  margin: 4px 0 0 16px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

.about-modal-changelog {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.about-modal-changelog-item {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.about-modal-changelog-item:last-child {
  border-bottom: none;
}
/* ========== 暗色模式适配 ========== */
[data-theme="dark"] .modal-overlay {
  background: rgba(0,0,0,0.7);
}
[data-theme="dark"] .modal-content {
  background: var(--bg-card);
  color: var(--text);
}
[data-theme="dark"] .history-table {
  color: var(--text);
}
[data-theme="dark"] .history-table td {
  color: var(--text-secondary);
}
[data-theme="dark"] .history-table tr:hover {
  background: #2a2a40;
}
[data-theme="dark"] input, [data-theme="dark"] select {
  background: var(--bg-input);
  color: var(--text);
  border-color: var(--border);
}
[data-theme="dark"] ::placeholder {
  color: var(--text-muted);
}

