/* AI出题助手 - 左右布局样式 */

.quiz-generator-container {
  display: flex;
  gap: 24px;
  height: calc(100vh - 140px);
  min-height: 600px;
}

/* ==================== 左侧配置面板 ==================== */
.quiz-config-panel {
  width: 380px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.config-card {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 生成按钮固定底部 */
.generate-action {
  flex-shrink: 0;
  padding: 16px 20px;
  background: #fff;
  border-top: 1px solid var(--border-color, #e9ecef);
  display: flex;
  gap: 12px;
}

.config-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color, #e9ecef);
  background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
}

.config-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #2d3436);
  display: flex;
  align-items: center;
  gap: 8px;
}

.config-header h3 i {
  color: var(--primary, #4a90d9);
}

.config-form {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* OCR选项样式 */
.ocr-option {
  margin-top: 12px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid var(--border-color, #e9ecef);
}

.ocr-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary, #2d3436);
}

.ocr-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.ocr-hint {
  margin: 6px 0 0 24px;
  font-size: 12px;
  color: var(--text-secondary, #636e72);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group > label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary, #2d3436);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-group > label i {
  color: var(--primary, #4a90d9);
  font-size: 14px;
}

.form-group > label .required {
  color: #e17055;
}

.form-hint {
  font-size: 12px;
  color: var(--text-secondary, #636e72);
}

.content-textarea {
  resize: vertical;
  min-height: 120px;
  font-size: 14px;
  line-height: 1.6;
}

/* ==================== 上传区域 ==================== */
.upload-zone {
  border: 2px dashed #ddd;
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafafa;
}

.upload-zone:hover {
  border-color: var(--primary, #4a90d9);
  background: #f0f7ff;
}

.upload-zone.drag-over {
  border-color: var(--primary, #4a90d9);
  background: #e8f4fd;
}

.upload-zone i {
  font-size: 32px;
  color: var(--primary, #4a90d9);
  margin-bottom: 8px;
  display: block;
}

.upload-zone p {
  margin: 0 0 4px 0;
  font-size: 14px;
  color: var(--text-primary, #2d3436);
}

.upload-zone .upload-hint {
  font-size: 12px;
  color: var(--text-secondary, #636e72);
}

/* 已上传文件列表 */
.uploaded-files {
  margin-top: 12px;
  border: 1px solid var(--border-color, #e9ecef);
  border-radius: 8px;
  overflow: hidden;
}

.files-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #f8f9fa;
  border-bottom: 1px solid var(--border-color, #e9ecef);
  font-size: 13px;
  font-weight: 500;
}

.btn-clear-files {
  background: none;
  border: none;
  color: #e17055;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
}

.btn-clear-files:hover {
  background: #fde8e8;
}

.file-list {
  max-height: 120px;
  overflow-y: auto;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
}

.file-item:last-child {
  border-bottom: none;
}

.file-item .file-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  overflow: hidden;
}

.file-item .file-name i {
  color: var(--primary, #4a90d9);
}

.file-item .file-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item .btn-remove-file {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

.file-item .btn-remove-file:hover {
  color: #e17055;
  background: #fde8e8;
}

/* 解析按钮 */
.btn-parse {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  background: #fff;
  border: 2px solid var(--primary, #4a90d9);
  border-radius: 8px;
  color: var(--primary, #4a90d9);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-parse:hover {
  background: var(--primary, #4a90d9);
  color: #fff;
}

.btn-parse:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 解析进度 */
.parse-progress {
  margin-top: 12px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary, #636e72);
  margin-bottom: 8px;
}

.progress-track {
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary, #4a90d9), #6c5ce7);
  width: 0%;
  transition: width 0.3s;
}

/* 右侧解析进度 */
.parse-progress-right {
  margin: 15px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid var(--border-color, #e9ecef);
}

/* 解析结果容器 */
.parsed-results-container {
  padding: 5px;
}

.parsed-file-item {
  margin-bottom: 12px;
  border: 1px solid var(--border-color, #e9ecef);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.parsed-file-item:last-child {
  margin-bottom: 0;
}

.parsed-file-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #f8f9fa;
  user-select: none;
  transition: background 0.2s;
  border: none;
  gap: 10px;
}

.parsed-file-header:hover {
  background: #e9ecef;
}

/* 删除解析结果按钮 */
.btn-delete-parsed {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-secondary, #636e72);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-delete-parsed:hover {
  background: #fee2e2;
  color: #e17055;
}

.parsed-file-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  cursor: pointer;
}

.parsed-file-status {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.parsed-file-icon {
  font-size: 20px;
  color: var(--primary, #4a90d9);
}

.parsed-file-name {
  font-weight: 500;
  color: var(--text-primary, #2d3436);
  font-size: 14px;
}

.parsed-file-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-success {
  background: #d4edda;
  color: #00b894;
}

.status-error {
  background: #f8d7da;
  color: #e17055;
}

.toggle-icon {
  font-size: 16px;
  color: var(--text-secondary, #636e72);
  transition: transform 0.2s;
}

.toggle-icon.expanded {
  transform: rotate(90deg);
}

.parsed-file-content {
  padding: 16px;
  border-top: 1px solid var(--border-color, #e9ecef);
  background: #fff;
  display: none;
  max-height: 400px;
  overflow-y: auto;
}

.parsed-file-content.show {
  display: block;
}

.content-editor {
  width: 100%;
  min-height: 200px;
  max-height: 400px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary, #2d3436);
  background: #fff;
  border: 1px solid var(--border-color, #e9ecef);
  border-radius: 6px;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.content-editor:focus {
  outline: none;
  border-color: var(--primary, #4a90d9);
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.content-stats {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
  font-size: 12px;
  color: var(--text-secondary, #636e72);
}

.error-message {
  color: #e17055;
  font-size: 13px;
  padding: 10px;
  background: #fde8e8;
  border-radius: 6px;
}

/* 题型配置网格 */
.question-type-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.type-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #f8f9fa;
  border-radius: 8px;
  transition: all 0.2s;
}

.type-item:hover {
  background: #f0f4f8;
}

.type-header {
  flex: 1;
}

.type-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary, #2d3436);
}

.type-checkbox input[type="checkbox"] {
  display: none;
}

.type-checkbox .checkbox-mark {
  width: 18px;
  height: 18px;
  border: 2px solid #ddd;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.type-checkbox input:checked + .checkbox-mark {
  background: var(--primary, #4a90d9);
  border-color: var(--primary, #4a90d9);
}

.type-checkbox input:checked + .checkbox-mark::after {
  content: '✓';
  color: #fff;
  font-size: 12px;
  font-weight: bold;
}

.type-count {
  display: flex;
  align-items: center;
  gap: 4px;
}

.type-count input {
  width: 48px;
  height: 32px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  appearance: textfield;
  -moz-appearance: textfield;
}

/* 隐藏数字输入框的上下箭头 */
.type-count input::-webkit-outer-spin-button,
.type-count input::-webkit-inner-spin-button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}

.type-count input:disabled {
  background: #e9ecef;
  color: #999;
}

.count-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: #e9ecef;
  color: var(--text-primary, #2d3436);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.2s;
}

.count-btn:hover {
  background: var(--primary, #4a90d9);
  color: #fff;
}

/* 难度滑块 */
.difficulty-slider {
  padding: 8px 0;
}

.difficulty-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-secondary, #636e72);
}

.difficulty-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary, #4a90d9);
}

.difficulty-range {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(to right, #00b894, #fdcb6e, #e17055);
  border-radius: 3px;
  outline: none;
}

.difficulty-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #fff;
  border: 3px solid var(--primary, #4a90d9);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.difficulty-marks {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 11px;
  color: #999;
  padding: 0 2px;
}

/* 生成按钮 */
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
}

.btn-generate,
.btn-append {
  flex: 1;
  padding: 14px 20px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s;
}

.btn-generate {
  background: linear-gradient(135deg, var(--primary, #4a90d9) 0%, #6c5ce7 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(74, 144, 217, 0.3);
}

.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 144, 217, 0.4);
}

.btn-generate:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-generate.is-generating {
  background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
  animation: generating-pulse 1.5s ease-in-out infinite;
}

.btn-generate.is-generating:disabled {
  opacity: 1;
}

@keyframes generating-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.btn-append {
  background: #fff;
  color: var(--primary, #4a90d9);
  border: 2px solid var(--primary, #4a90d9);
}

.btn-append:hover:not(:disabled) {
  background: var(--primary, #4a90d9);
  color: #fff;
}

.btn-append:disabled,
.btn-append.is-generating {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f8f9fa;
  border-color: #dee2e6;
  color: #6c757d;
}

/* Token消耗统计 */
.token-stats {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #636e72;
}

.token-stats i {
  color: #ffc107;
}

/* 文件解析Token消耗显示 */
.content-stats .bi-lightning {
  color: #ffc107;
}

/* 历史记录链接 */
.history-link {
  text-align: center;
}

.history-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary, #636e72);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s;
}

.history-link a:hover {
  color: var(--primary, #4a90d9);
}

/* ==================== 右侧结果面板 ==================== */
.quiz-result-panel {
  flex: 1;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.result-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color, #e9ecef);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
}

/* 右侧标签切换 */
.result-tabs {
  display: flex;
  gap: 4px;
}

.tab-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary, #636e72);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.tab-btn:hover {
  background: #f0f0f0;
  color: var(--text-primary, #2d3436);
}

.tab-btn.active {
  background: var(--primary, #4a90d9);
  color: #fff;
}

.question-badge {
  background: #e17055;
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.tab-btn.active .question-badge {
  background: rgba(255, 255, 255, 0.3);
}

/* 右侧操作按钮 */
.result-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid #cfe2ff;
  border-radius: 8px;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-export:hover:not(:disabled) {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e40af;
}

.btn-export:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-history {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #f8f9fa;
  border: 1px solid var(--border-color, #e9ecef);
  border-radius: 8px;
  color: var(--text-secondary, #636e72);
  font-size: 13px;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-history:hover {
  background: #fff;
  border-color: var(--primary, #4a90d9);
  color: var(--primary, #4a90d9);
}

.task-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #2d3436);
}

.task-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 20px;
  background: #e8f4fd;
  color: var(--primary, #4a90d9);
}

.task-status.completed {
  background: #d4edda;
  color: #00b894;
}

.task-status.failed {
  background: #f8d7da;
  color: #e17055;
}

.task-status i {
  font-size: 8px;
}

.task-stats {
  display: flex;
  gap: 16px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary, #636e72);
}

.stat-item i {
  color: var(--primary, #4a90d9);
}

/* 题目列表 */
.question-list {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--text-secondary, #636e72);
}

.empty-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #f0f4f8 0%, #e8f4fd 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.empty-icon i {
  font-size: 36px;
  color: var(--primary, #4a90d9);
}

.empty-state h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
  color: var(--text-primary, #2d3436);
}

.empty-state p {
  margin: 0;
  font-size: 14px;
  max-width: 300px;
}

/* 加载状态 */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
}

.loading-spinner {
  margin-bottom: 20px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e9ecef;
  border-top-color: var(--primary, #4a90d9);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state p {
  font-size: 15px;
  color: var(--text-secondary, #636e72);
  margin: 0 0 16px 0;
}

.loading-progress {
  width: 200px;
  height: 4px;
  background: #e9ecef;
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary, #4a90d9), #6c5ce7);
  width: 0%;
  transition: width 0.3s;
  animation: progress-pulse 2s ease-in-out infinite;
}

@keyframes progress-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* 题目卡片容器 */
.questions-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 题目卡片 */
.question-card {
  background: #fff;
  border: 1px solid var(--border-color, #e9ecef);
  border-radius: 10px;
  padding: 16px;
  transition: all 0.2s;
}

.question-card:hover {
  border-color: var(--primary, #4a90d9);
  box-shadow: 0 4px 12px rgba(74, 144, 217, 0.1);
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.question-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.question-number {
  width: 28px;
  height: 28px;
  background: var(--primary, #4a90d9);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

.question-type {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #e8f4fd;
  color: var(--primary, #4a90d9);
}

.question-type.single { background: #e8f4fd; color: #4a90d9; }
.question-type.multiple { background: #f3e8fd; color: #6c5ce7; }
.question-type.true_false { background: #e8fdf4; color: #00b894; }
.question-type.fill_blank { background: #fdf8e8; color: #fdcb6e; }
.question-type.short_answer { background: #fde8e8; color: #e17055; }

.question-difficulty {
  font-size: 12px;
  color: var(--text-secondary, #636e72);
}

.question-actions {
  display: flex;
  gap: 8px;
}

.question-actions button {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: #f8f9fa;
  color: var(--text-secondary, #636e72);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.question-actions button:hover {
  background: var(--primary, #4a90d9);
  color: #fff;
}

.question-actions button.btn-delete:hover {
  background: #e17055;
}

.question-content {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary, #2d3436);
  margin-bottom: 12px;
}

.question-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 14px;
}

.option-item.correct {
  background: #d4edda;
  color: #00b894;
}

.option-label {
  font-weight: 600;
  color: var(--primary, #4a90d9);
}

.question-answer {
  padding: 10px 12px;
  background: #d4edda;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 8px;
}

.question-answer strong {
  color: #00b894;
}

.question-explanation {
  padding: 10px 12px;
  background: #fff8e8;
  border-radius: 6px;
  font-size: 13px;
  color: #856404;
  border-left: 3px solid #fdcb6e;
}

/* ==================== 模态框 ==================== */
#deleteModal,
#editModal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none !important;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  /* 覆盖base.css中的visibility和opacity */
  visibility: visible;
  opacity: 1;
}

#deleteModal.active,
#editModal.active {
  display: flex !important;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-content.modal-sm {
  max-width: 400px;
}

.modal-content.modal-lg {
  max-width: 700px;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color, #e9ecef);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary, #636e72);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background: #f8f9fa;
  color: var(--text-primary, #2d3436);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color, #e9ecef);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.form-row .form-group {
  margin-bottom: 0;
}

.col-3 { flex: 0 0 25%; }
.col-6 { flex: 0 0 50%; }

.btn-secondary,
.btn-primary,
.btn-danger {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-secondary {
  background: #f8f9fa;
  color: var(--text-primary, #2d3436);
}

.btn-secondary:hover {
  background: #e9ecef;
}

.btn-primary {
  background: var(--primary, #4a90d9);
  color: #fff;
}

.btn-primary:hover {
  background: #3a7bc8;
}

.btn-danger {
  background: #e17055;
  color: #fff;
}

.btn-danger:hover {
  background: #d63031;
}

/* 编辑选项 */
.edit-option-item {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.edit-option-item input {
  flex: 1;
}

.edit-option-item .btn-remove-option {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 6px;
  background: #f8f9fa;
  color: #e17055;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.edit-option-item .btn-remove-option:hover {
  background: #fde8e8;
}

.btn-add-option {
  padding: 8px 12px;
  border: 1px dashed #ddd;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary, #636e72);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.btn-add-option:hover {
  border-color: var(--primary, #4a90d9);
  color: var(--primary, #4a90d9);
}

/* ==================== 题目分类显示样式 ==================== */
.question-type-section {
  margin-bottom: 24px;
}

.type-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
  border-radius: 8px;
  margin-bottom: 12px;
  border-left: 3px solid var(--primary, #4a90d9);
  cursor: pointer;
  transition: background 0.2s;
}

.type-section-header:hover {
  background: linear-gradient(135deg, #f0f1f2 0%, #f8f9fa 100%);
}

.section-toggle-icon {
  font-size: 14px;
  color: var(--text-secondary, #636e72);
  transition: transform 0.2s;
}

.question-type-section.collapsed .section-toggle-icon {
  transform: rotate(-90deg);
}

.question-type-section.collapsed .type-section-questions {
  display: none;
}

.type-section-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary, #2d3436);
}

.type-section-count {
  font-size: 13px;
  color: var(--text-secondary, #636e72);
  background: #e9ecef;
  padding: 2px 8px;
  border-radius: 10px;
}

.type-section-questions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 题目卡片编辑样式 */
.question-card {
  background: #fff;
  border: 1px solid var(--border-color, #e9ecef);
  border-radius: 10px;
  padding: 16px;
  transition: box-shadow 0.2s;
}

.question-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.question-card .question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.question-header-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.content-input-inline {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color, #e9ecef);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  transition: border-color 0.2s;
}

.content-input-inline:focus {
  outline: none;
  border-color: var(--primary, #4a90d9);
}

/* 简答题/填空题多行输入框 */
.content-textarea-inline {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color, #e9ecef);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  transition: border-color 0.2s;
  resize: vertical;
  min-height: 60px;
  font-family: inherit;
}

.content-textarea-inline:focus {
  outline: none;
  border-color: var(--primary, #4a90d9);
}

/* 长内容题目的header布局调整 */
.question-header-inline.long-content {
  align-items: flex-start;
}

.question-header-inline.long-content .question-number {
  margin-top: 8px;
}

.question-header-inline.long-content .btn-delete-small {
  margin-top: 8px;
}

.question-card .question-number {
  width: 28px;
  height: 28px;
  background: var(--primary, #4a90d9);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

.btn-delete-small {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-secondary, #636e72);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-delete-small:hover {
  background: #fee2e2;
  color: #e17055;
}

/* 题目内容编辑 */
.question-content-edit {
  margin-bottom: 12px;
}

.content-input,
.answer-textarea,
.explanation-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color, #e9ecef);
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.4;
  transition: border-color 0.2s;
}

.content-input {
  font-weight: 500;
}

.explanation-textarea {
  resize: vertical;
  min-height: 60px;
}

.answer-textarea {
  resize: vertical;
  min-height: 100px;
}

.content-input:focus,
.answer-textarea:focus,
.explanation-textarea:focus {
  outline: none;
  border-color: var(--primary, #4a90d9);
}

/* 选项编辑 */
.question-options-edit {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.option-edit-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.option-edit-item .option-label {
  width: 24px;
  font-weight: 600;
  color: var(--text-secondary, #636e72);
}

.option-edit-item .option-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color, #e9ecef);
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.option-edit-item .option-input:focus {
  outline: none;
  border-color: var(--primary, #4a90d9);
}

.option-edit-item.correct .option-input {
  border-color: #00b894;
  background: #f0fff4;
}

.option-edit-item:not(.correct) .option-input {
  border-color: var(--border-color, #e9ecef);
  background: #fff;
}

.correct-checkbox {
  cursor: pointer;
  display: flex;
  align-items: center;
}

.correct-checkbox input[type="checkbox"] {
  display: none;
}

.correct-checkbox i {
  font-size: 20px;
  color: #ccc;
  transition: color 0.2s;
}

.correct-checkbox input:checked + i {
  color: #00b894;
}

.correct-checkbox input:not(:checked) + i {
  color: #ccc;
}

/* 判断题选项 */
.true-false-options {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}

.tf-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border-color, #e9ecef);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.tf-option input[type="radio"] {
  display: none;
}

.tf-option.selected,
.tf-option:has(input:checked) {
  background: #f0fff4;
  border-color: #00b894;
  color: #00b894;
}

/* 答案和解析编辑 */
.answer-edit,
.explanation-edit {
  margin-bottom: 12px;
}

.answer-edit label,
.explanation-edit label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary, #636e72);
  margin-bottom: 6px;
}

.explanation-textarea {
  background: #fafafa;
}

/* 响应式 */
@media (max-width: 992px) {
  .quiz-generator-container {
    flex-direction: column;
    height: auto;
  }

  .quiz-config-panel {
    width: 100%;
  }

  .quiz-result-panel {
    min-height: 500px;
  }
}
