/* 数据库技术期末模拟考试 - 毛玻璃风格 */

/* ====== 全局变量 ====== */
:root {
  --primary: #4F46E5;
  --primary-light: #818CF8;
  --primary-dark: #3730A3;
  --accent: #10B981;
  --accent-wrong: #EF4444;
  --accent-warning: #F59E0B;

  --bg: #F1F5F9;
  --bg-card: rgba(255, 255, 255, 0.75);
  --bg-solid: #ffffff;
  --bg-soft: #F8FAFC;

  --text-primary: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;

  --border: rgba(148, 163, 184, 0.25);
  --border-strong: rgba(148, 163, 184, 0.4);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ====== 重置 ====== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* 背景装饰 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(79, 70, 229, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 85% 80%, rgba(16, 185, 129, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(129, 140, 248, 0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

/* 选中文本 */
::selection {
  background: var(--primary-light);
  color: white;
}

/* ====== 页面切换 ====== */
.page {
  display: none;
  min-height: 100vh;
}
.page.active {
  display: block;
  animation: pageIn 0.4s ease;
}

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

/* ====== Toast 提示 ====== */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  color: white;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

.toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-success {
  background: rgba(16, 185, 129, 0.95);
}

.toast-error {
  background: rgba(239, 68, 68, 0.95);
}

.toast-info {
  background: rgba(79, 70, 229, 0.95);
}

/* ====== 开始页面 ====== */
.start-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px;
}

.start-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  box-shadow: var(--shadow-xl);
  text-align: center;
  margin-bottom: 24px;
}

.start-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 20px;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

.start-icon svg {
  width: 36px;
  height: 36px;
  color: white;
}

.start-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.start-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.start-info {
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 32px;
  text-align: left;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
}
.info-row:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.info-key {
  font-size: 14px;
  color: var(--text-secondary);
}

.info-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* 模式选择 */
.mode-selector,
.count-selector,
.order-selector {
  margin-bottom: 28px;
  text-align: left;
}

.mode-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mode-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mode-option input {
  display: none;
}

.mode-card {
  padding: 20px 16px;
  background: var(--bg-solid);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  position: relative;
}

.mode-card:hover {
  border-color: var(--primary-light);
  background: rgba(79, 70, 229, 0.02);
}

.mode-option input:checked + .mode-card {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.05);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.mode-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  border-radius: 10px;
}

.mode-icon svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.mode-option input:checked + .mode-card .mode-icon {
  background: var(--primary);
}

.mode-option input:checked + .mode-card .mode-icon svg {
  color: white;
}

.mode-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.mode-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ====== 题型选择器 ====== */
.type-selector {
  margin-bottom: 28px;
  text-align: left;
}

.type-selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.type-selector-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.selected-count {
  font-weight: 500;
  color: var(--primary);
}

.toggle-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.type-selector.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

.type-selector-content {
  overflow: hidden;
  max-height: 600px;
  transition: max-height 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.3s ease,
              margin-top 0.3s ease;
  opacity: 1;
  margin-top: 12px;
}

.type-selector.collapsed .type-selector-content {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

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

.type-option input {
  display: none;
}

.type-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.type-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: transparent;
  transition: background 0.25s ease;
}

.type-card:hover {
  border-color: var(--border-strong);
  transform: translateX(4px);
  background: var(--bg-solid);
}

.type-option input:checked + .type-card {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.04);
  box-shadow: 0 2px 12px rgba(79, 70, 229, 0.1);
}

.type-option input:checked + .type-card::before {
  background: var(--primary);
}

.type-option input:checked + .type-card.type-card-judge::before {
  background: linear-gradient(180deg, #8B5CF6 0%, #7C3AED 100%);
}
.type-option input:checked + .type-card.type-card-choice::before {
  background: linear-gradient(180deg, #3B82F6 0%, #2563EB 100%);
}
.type-option input:checked + .type-card.type-card-fill::before {
  background: linear-gradient(180deg, #F59E0B 0%, #D97706 100%);
}
.type-option input:checked + .type-card.type-card-essay::before {
  background: linear-gradient(180deg, #EC4899 0%, #DB2777 100%);
}
.type-option input:checked + .type-card.type-card-code::before {
  background: linear-gradient(180deg, #10B981 0%, #059669 100%);
}

.type-card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--bg-solid);
  border: 1px solid var(--border);
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.type-card-icon svg {
  width: 22px;
  height: 22px;
  color: var(--text-secondary);
  transition: all 0.25s ease;
}

.type-card-judge .type-card-icon { background: rgba(139, 92, 246, 0.08); border-color: rgba(139, 92, 246, 0.2); }
.type-card-judge .type-card-icon svg { color: #8B5CF6; }
.type-card-choice .type-card-icon { background: rgba(59, 130, 246, 0.08); border-color: rgba(59, 130, 246, 0.2); }
.type-card-choice .type-card-icon svg { color: #3B82F6; }
.type-card-fill .type-card-icon { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.2); }
.type-card-fill .type-card-icon svg { color: #F59E0B; }
.type-card-essay .type-card-icon { background: rgba(236, 72, 153, 0.08); border-color: rgba(236, 72, 153, 0.2); }
.type-card-essay .type-card-icon svg { color: #EC4899; }
.type-card-code .type-card-icon { background: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.2); }
.type-card-code .type-card-icon svg { color: #10B981; }

.type-option input:checked + .type-card .type-card-icon {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.type-card-info {
  flex: 1;
  min-width: 0;
}

.type-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.type-card-count {
  font-size: 12px;
  color: var(--text-secondary);
}

.type-card-check {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 2px solid var(--border);
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.type-card-check svg {
  width: 14px;
  height: 14px;
  color: transparent;
  transition: all 0.25s ease;
}

.type-option input:checked + .type-card .type-card-check {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.1);
}

.type-option input:checked + .type-card .type-card-check svg {
  color: white;
}

/* 快捷操作按钮 */
.type-quick-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.type-quick-btn {
  flex: 1;
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.type-quick-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.05);
  transform: translateY(-1px);
}

.type-quick-btn:active {
  transform: translateY(0);
}

/* 数量选择 */
.count-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.count-btn {
  padding: 12px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.count-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.count-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* 顺序选择 */
.order-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.order-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-solid);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.order-btn svg {
  width: 18px;
  height: 18px;
}

.order-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.order-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* 开始按钮 */
.start-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 32px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
  margin-top: 8px;
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.start-btn:active {
  transform: translateY(0);
}

.start-btn svg {
  width: 20px;
  height: 20px;
}

/* 数据导入导出 */
.data-import-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.import-btn,
.export-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.import-btn:hover,
.export-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(79, 70, 229, 0.05);
  transform: translateY(-1px);
}

.import-btn svg,
.export-btn svg {
  width: 16px;
  height: 16px;
}

/* 提示 */
.start-notes {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-md);
}

.notes-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.notes-title svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

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

.notes-list li {
  position: relative;
  padding-left: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.notes-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
}

/* ====== 答题页面 ====== */
.quiz-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: white;
  background: linear-gradient(135deg, var(--accent) 0%, #059669 100%);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.header-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.header-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.header-submit-btn svg {
  width: 16px;
  height: 16px;
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1000px;
  margin: 0 auto;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.back-btn:hover {
  background: var(--bg-soft);
  color: var(--text-primary);
}

.back-btn svg {
  width: 16px;
  height: 16px;
}

.header-title h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.mode-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  background: var(--primary);
  color: white;
  border-radius: 9999px;
}

.progress-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-text {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.progress-bar-mini {
  width: 100px;
  height: 4px;
  background: var(--bg-soft);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.timer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.timer svg {
  width: 14px;
  height: 14px;
}

/* 题目主区域 */
.quiz-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 24px 100px;
}

.question-container {
  animation: fadeIn 0.4s ease;
}

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

.question-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 24px;
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.question-type {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  border-radius: 9999px;
}

.type-judge { background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%); }
.type-choice { background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%); }
.type-fill { background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%); }
.type-essay { background: linear-gradient(135deg, #EC4899 0%, #DB2777 100%); }
.type-code { background: linear-gradient(135deg, #10B981 0%, #059669 100%); }

.question-number {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.question-text {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 24px;
}

/* 判断题 */
.judge-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.judge-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  background: var(--bg-solid);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.judge-btn svg {
  width: 22px;
  height: 22px;
}

.judge-btn.judge-true:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(16, 185, 129, 0.04);
}

.judge-btn.judge-false:hover:not(:disabled) {
  border-color: var(--accent-wrong);
  color: var(--accent-wrong);
  background: rgba(239, 68, 68, 0.04);
}

.judge-btn.selected.judge-true {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.judge-btn.selected.judge-false {
  background: var(--accent-wrong);
  border-color: var(--accent-wrong);
  color: white;
}

.judge-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

/* 选择题 */
.choice-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-btn {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  font-family: var(--font-body);
  font-size: 14px;
  text-align: left;
  color: var(--text-primary);
  background: var(--bg-solid);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.choice-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.03);
}

.choice-btn.selected {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.06);
}

.choice-btn.correct {
  border-color: var(--accent);
  background: rgba(16, 185, 129, 0.08);
}

.choice-btn.wrong {
  border-color: var(--accent-wrong);
  background: rgba(239, 68, 68, 0.08);
}

.choice-btn:disabled {
  cursor: not-allowed;
}

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

.choice-btn.selected .choice-mark {
  background: var(--primary);
  color: white;
}

.choice-btn.correct .choice-mark {
  background: var(--accent);
  color: white;
}

.choice-btn.wrong .choice-mark {
  background: var(--accent-wrong);
  color: white;
}

.choice-text {
  flex: 1;
  line-height: 1.6;
  padding-top: 3px;
}

/* 填空题 */
.fill-input {
  width: 100%;
  padding: 14px 18px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-solid);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.15s ease;
  margin-bottom: 12px;
}

.fill-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.fill-input.correct {
  border-color: var(--accent);
  background: rgba(16, 185, 129, 0.04);
}

.fill-input.wrong {
  border-color: var(--accent-wrong);
  background: rgba(239, 68, 68, 0.04);
}

.fill-input:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

.fill-submit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: white;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.fill-submit:hover:not(:disabled) {
  background: var(--primary-dark);
}

.fill-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 简答题 */
.essay-input {
  width: 100%;
  min-height: 160px;
  padding: 16px 18px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-solid);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  resize: vertical;
  transition: all 0.15s ease;
  margin-bottom: 12px;
}

.essay-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.essay-input:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

/* 答案揭示 */
.answer-reveal {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px dashed var(--border);
  animation: fadeIn 0.3s ease;
}

.reveal-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 9999px;
  margin-bottom: 12px;
}

.reveal-status.correct {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent);
}

.reveal-status.wrong {
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-wrong);
}

.reveal-status svg {
  width: 14px;
  height: 14px;
}

.reveal-block {
  padding: 14px 18px;
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}

.reveal-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.reveal-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  white-space: pre-wrap;
  line-height: 1.7;
}

.reveal-value.user-answer {
  color: var(--accent-wrong);
}

.explanation-block {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.08)) !important;
  border: 1px solid rgba(99, 102, 241, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: slideUpFade 0.4s ease;
}

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

.explanation-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.explanation-icon {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.explanation-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.3px;
}

.explanation-content {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-primary);
  opacity: 0.9;
}

/* 导航区 */
/* 收缩按钮 - 仅移动端显示 */
.nav-collapse-btn {
  display: none;
}

.quiz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.nav-btn svg {
  width: 16px;
  height: 16px;
}

.nav-btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.nav-btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  color: white;
}

.nav-right-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-btn-submit {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.nav-btn-submit:hover:not(:disabled) {
  background: #059669;
  border-color: #059669;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.submit-row {
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.mobile-nav-btn {
  display: none;
}

.submit-row .nav-btn-submit {
  padding: 8px 28px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-md);
}

.nav-dots-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.dots-filter {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 2px;
}

.filter-chip {
  padding: 4px 10px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.question-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  align-content: flex-start;
  max-width: 100%;
  max-height: 64px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px;
  scrollbar-width: thin;
}

.question-dot {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-solid);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.question-dot::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: transparent;
  transition: all 0.2s ease;
}

.question-dot.type-judge::after { background: #8B5CF6; }
.question-dot.type-choice::after { background: #3B82F6; }
.question-dot.type-fill::after { background: #F59E0B; }
.question-dot.type-essay::after { background: #EC4899; }
.question-dot.type-code::after { background: #10B981; }

.question-dot:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.1);
}

.question-dot.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.question-dot.answered {
  background: var(--bg-soft);
  border-color: var(--border-strong);
  color: var(--text-secondary);
}

.question-dot.hidden {
  opacity: 0.25;
  filter: grayscale(0.6);
}

.question-dot.hidden:hover {
  opacity: 0.7;
  filter: none;
}

.question-dot.correct {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.question-dot.wrong {
  background: var(--accent-wrong);
  border-color: var(--accent-wrong);
  color: white;
}

/* ====== 结果页面 ====== */
.result-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px;
}

.result-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  box-shadow: var(--shadow-xl);
  text-align: center;
  margin-bottom: 24px;
}

.result-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent) 0%, #059669 100%);
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.result-icon svg {
  width: 40px;
  height: 40px;
  color: white;
}

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

.result-grade {
  display: inline-block;
  padding: 6px 20px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--accent) 0%, #059669 100%);
  border-radius: 9999px;
  margin-bottom: 32px;
}

.result-grade.good {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.result-grade.fail {
  background: linear-gradient(135deg, var(--accent-wrong) 0%, #DC2626 100%);
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.stat-item {
  padding: 20px 12px;
  background: var(--bg-soft);
  border-radius: var(--radius-md);
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.action-btn svg {
  width: 16px;
  height: 16px;
}

.action-btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.action-btn-primary:hover {
  background: var(--primary-dark);
  color: white;
}

/* 结果分析区域 */
.result-breakdown {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.analysis-section {
  background: var(--bg-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-md);
  padding: 20px;
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.analysis-section:nth-child(1) { animation-delay: 0.1s; }
.analysis-section:nth-child(2) { animation-delay: 0.2s; }
.analysis-section:nth-child(3) { animation-delay: 0.3s; }

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

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 16px 0;
}

.section-title svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.wrong-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 20px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  background: var(--accent-wrong);
  border-radius: 10px;
  margin-left: 8px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  margin-bottom: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  transition: all 0.2s ease;
}

.section-header:hover {
  opacity: 0.8;
}

.section-header .section-title {
  margin-bottom: 0;
}

.toggle-icon {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  transition: transform 0.3s ease;
}

.section-header.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

/* 题型分析图表 */
.type-chart {
  width: 100%;
}

.chart-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chart-bar-item {
  width: 100%;
}

.bar-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.bar-wrapper {
  display: flex;
  height: 24px;
  background: var(--bg-solid);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 6px;
}

.bar-correct {
  height: 100%;
  border-radius: 12px 0 0 12px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
}

.bar-wrong {
  height: 100%;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.3), rgba(239, 68, 68, 0.15));
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

.bar-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
}

.bar-stats .stat-correct {
  color: var(--accent);
  font-weight: 500;
}

.bar-stats .stat-wrong {
  color: var(--accent-wrong);
  font-weight: 500;
}

.bar-stats .stat-total {
  color: var(--text-secondary);
}

/* 成绩明细表格 */
.stats-table-container {
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.stats-table thead th {
  text-align: left;
  padding: 12px 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-solid);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.stats-table tbody tr:hover {
  background: var(--bg-soft);
}

.stats-table tbody tr:last-child td {
  border-bottom: none;
}

.stats-table tfoot td {
  padding: 14px;
  font-weight: 600;
  background: var(--bg-solid);
  border-top: 2px solid var(--border);
  color: var(--text-primary);
}

.type-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

.text-correct {
  color: var(--accent);
  font-weight: 500;
}

.text-wrong {
  color: var(--accent-wrong);
  font-weight: 500;
}

.text-muted {
  color: var(--text-muted);
  font-weight: 500;
}

.table-rate {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 120px;
}

.rate-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-solid);
  border-radius: 4px;
  overflow: hidden;
}

.rate-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.rate-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 40px;
  text-align: right;
}

/* 错题列表 */
.wrong-section .breakdown-list {
  max-height: 500px;
  overflow-y: auto;
  padding-right: 8px;
  margin-top: 16px;
  transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
}

.wrong-section .breakdown-list.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  overflow: hidden;
}

.breakdown-list::-webkit-scrollbar {
  width: 6px;
}

.breakdown-list::-webkit-scrollbar-track {
  background: var(--bg-soft);
  border-radius: 3px;
}

.breakdown-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.breakdown-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.wrong-type-group {
  margin-bottom: 16px;
}

.wrong-type-group:last-child {
  margin-bottom: 0;
}

.wrong-type-header {
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 0;
  margin-bottom: 8px;
}

.breakdown-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.breakdown-item:hover {
  border-color: var(--primary);
  transform: translateX(2px);
}

.breakdown-item:last-child {
  margin-bottom: 0;
}

.breakdown-q {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.5;
}

.breakdown-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-wrong);
  background: rgba(239, 68, 68, 0.1);
  border-radius: 6px;
}

.breakdown-text {
  flex: 1;
  line-height: 1.5;
}

.breakdown-answer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  padding-left: 34px;
}

.user-ans {
  color: var(--accent-wrong);
  background: rgba(239, 68, 68, 0.08);
  padding: 4px 10px;
  border-radius: 4px;
}

.correct-ans {
  color: var(--accent);
  background: rgba(16, 185, 129, 0.08);
  padding: 4px 10px;
  border-radius: 4px;
}

.unanswered-tag {
  color: var(--text-muted);
  background: var(--bg-soft);
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 500;
}

/* 全部正确状态 */
.all-correct {
  text-align: center;
  padding: 32px 20px;
}

.all-correct-icon {
  font-size: 48px;
  margin-bottom: 12px;
  animation: bounce 1s ease infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.all-correct-text {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* 响应式 */
@media (max-width: 640px) {
  .result-breakdown {
    padding: 16px;
    gap: 16px;
  }

  .analysis-section {
    padding: 16px;
  }

  .stats-table {
    font-size: 12px;
  }

  .stats-table thead th,
  .stats-table tbody td,
  .stats-table tfoot td {
    padding: 10px 8px;
  }

  .table-rate {
    min-width: 80px;
  }

  .breakdown-answer {
    padding-left: 0;
  }
}

/* ====== 解析弹窗 ====== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 720px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 温馨提示弹窗 */
.welcome-modal-content {
  max-width: 420px;
  text-align: center;
  padding: 32px 28px;
}

.welcome-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.1);
  border: 2px solid rgba(245, 158, 11, 0.2);
  border-radius: 50%;
  color: #F59E0B;
}

.welcome-icon svg {
  width: 32px;
  height: 32px;
}

.welcome-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.welcome-text {
  text-align: left;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 24px;
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  padding: 16px;
}

.welcome-text p {
  margin-bottom: 10px;
}

.welcome-text p:last-child {
  margin-bottom: 0;
}

.welcome-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.welcome-confirm-btn {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.welcome-confirm-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

.welcome-confirm-btn:active {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-close:hover {
  background: var(--bg-soft);
}

.modal-close svg {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

.review-item {
  padding: 16px;
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.review-item:last-child {
  margin-bottom: 0;
}

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

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

.review-q {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.review-q .type-tag {
  padding: 2px 8px;
  font-size: 10px;
  color: white;
  border-radius: 4px;
}

.review-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.review-answer {
  font-size: 13px;
  color: var(--text-secondary);
}

.review-answer .label {
  color: var(--text-muted);
  margin-right: 6px;
}

.review-answer .value {
  font-weight: 600;
  color: var(--accent);
}

.review-explanation {
  margin-top: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(168, 85, 247, 0.06));
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: slideUpFade 0.3s ease;
}

.review-explanation-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.1);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.review-explanation-header svg {
  width: 16px;
  height: 16px;
}

.review-explanation-content {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-primary);
  opacity: 0.88;
}

/* ====== 响应式 ====== */
@media (max-width: 768px) {
  .start-container,
  .quiz-main,
  .result-container {
    padding: 16px 12px 160px;
  }

  .start-card,
  .result-card {
    padding: 32px 24px;
  }

  .start-title {
    font-size: 24px;
  }

  .mode-options,
  .order-options {
    grid-template-columns: 1fr;
  }

  .count-options {
    grid-template-columns: repeat(2, 1fr);
  }

  .quiz-header {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
  }

  .header-left,
  .header-right {
    gap: 8px;
  }

  .header-title h2 {
    font-size: 14px;
  }

  .progress-bar-mini {
    display: none;
  }

  .header-submit-btn {
    padding: 6px 14px;
    font-size: 12px;
    gap: 4px;
  }

  .header-submit-btn svg {
    width: 14px;
    height: 14px;
  }

  .judge-options {
    grid-template-columns: 1fr;
  }

  .result-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .quiz-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 8px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 4px 12px calc(10px + env(safe-area-inset-bottom));
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, padding 0.3s ease;
  }

  /* 收缩按钮 */
  .nav-collapse-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
  }

  .nav-collapse-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
  }

  /* 收缩状态 */
  .quiz-nav.collapsed .nav-collapse-btn svg {
    transform: rotate(180deg);
  }

  .quiz-nav.collapsed .dots-filter,
  .quiz-nav.collapsed .question-dots {
    display: none;
  }

  .quiz-nav.collapsed {
    gap: 0;
    padding-top: 4px;
  }

  /* 移动端：顶部的上一题/下一题移到底部操作栏 */
  .quiz-nav > .nav-btn {
    display: none;
  }

  .quiz-nav > .nav-right-group {
    display: none;
  }

  .nav-dots-wrap {
    width: 100%;
    order: 1;
    gap: 8px;
  }

  /* 筛选栏：横向滚动 */
  .dots-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 0;
    gap: 6px;
  }

  .dots-filter::-webkit-scrollbar {
    display: none;
  }

  .filter-chip {
    flex-shrink: 0;
    font-size: 12px;
    padding: 6px 14px;
  }

  .question-dots {
    order: 2;
    width: 100%;
    max-height: 40px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .question-dots::-webkit-scrollbar {
    display: none;
  }

  .question-dot {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    font-size: 10px;
  }

  .submit-row {
    order: 3;
    padding-top: 4px;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
  }

  .mobile-nav-btn {
    display: inline-flex !important;
    flex: 1;
    justify-content: center;
    padding: 12px 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  /* 题型卡片移动端优化 */
  .type-card {
    padding: 12px 14px;
    gap: 12px;
  }

  .type-card-icon {
    width: 40px;
    height: 40px;
  }

  .type-card-icon svg {
    width: 20px;
    height: 20px;
  }

  .type-card-name {
    font-size: 14px;
  }

  .type-card-count {
    font-size: 12px;
  }

  /* 操作按钮组移动端优化 */
  .type-actions {
    flex-wrap: wrap;
  }

  .type-actions button {
    flex: 1;
    min-width: 70px;
    font-size: 12px;
    padding: 6px 10px;
  }

  /* 开始按钮移动端优化 */
  #start-btn {
    height: 48px;
    font-size: 15px;
  }

  /* 考试信息卡片移动端优化 */
  .exam-info {
    padding: 16px;
  }

  .info-row {
    font-size: 13px;
  }

  /* 题目卡片移动端优化 */
  .question-card {
    padding: 20px 16px;
  }

  .question-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .question-number {
    font-size: 13px;
  }

  .type-tag {
    font-size: 11px;
    padding: 3px 8px;
  }

  .question-text {
    font-size: 15px;
    line-height: 1.6;
  }

  /* 选择题选项移动端优化 */
  .choice-options {
    gap: 10px;
  }

  .choice-option {
    padding: 12px 14px;
    font-size: 14px;
  }

  .choice-letter {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }

  /* 判断题选项移动端优化 */
  .judge-options {
    gap: 10px;
  }

  .judge-option {
    padding: 14px;
    font-size: 14px;
  }

  .judge-option svg {
    width: 24px;
    height: 24px;
  }

  /* 填空题输入框移动端优化 */
  .fill-blank-input {
    min-width: 100px;
    font-size: 14px;
  }

  /* 简答题/代码题输入框移动端优化 */
  textarea {
    font-size: 14px;
    min-height: 120px;
  }

  /* 筛选栏移动端优化 */
  .filter-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -16px;
    padding: 0 16px;
  }

  .filter-bar::-webkit-scrollbar {
    display: none;
  }

  .filter-chip {
    flex-shrink: 0;
    font-size: 12px;
    padding: 6px 14px;
  }

  /* 结果页移动端优化 */
  .result-score {
    font-size: 48px;
  }

  .result-stats {
    gap: 10px;
  }

  .stat-item {
    padding: 14px 10px;
  }

  .stat-value {
    font-size: 20px;
  }

  .stat-label {
    font-size: 11px;
  }

  /* 结果按钮组移动端优化 */
  .result-actions {
    flex-direction: column;
  }

  .btn-large {
    height: 48px;
    font-size: 15px;
  }

  /* 解析弹窗移动端优化 */
  .modal-content {
    margin: 20px 10px;
    max-height: calc(100vh - 40px);
    border-radius: var(--radius-lg);
  }

  .modal-header {
    padding: 16px 20px;
  }

  .modal-body {
    padding: 16px 20px;
  }

  .review-item {
    padding: 14px;
  }

  /* 提示信息移动端优化 */
  .tips-list {
    font-size: 13px;
  }

  .tips-list li {
    padding-left: 20px;
  }

  /* 进度条移动端优化 */
  .progress-wrapper {
    padding: 0 16px;
  }

  .progress-text {
    font-size: 12px;
  }

  /* 头部标题移动端优化 */
  .header-title h2 {
    font-size: 14px;
  }

  .header-title span {
    font-size: 11px;
  }

  /* 导航按钮移动端优化 */
  .nav-btn {
    padding: 10px 14px;
    font-size: 13px;
  }

  .nav-btn svg {
    width: 18px;
    height: 18px;
  }
}

/* 小屏手机（480px以下） */
@media (max-width: 480px) {
  .start-card,
  .result-card {
    padding: 24px 18px;
  }

  .start-title {
    font-size: 20px;
  }

  .start-subtitle {
    font-size: 12px;
  }

  .section-title {
    font-size: 15px;
  }

  .count-options {
    grid-template-columns: 1fr;
  }

  .question-text {
    font-size: 14px;
  }

  .result-score {
    font-size: 40px;
  }

  .result-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .type-card {
    padding: 10px 12px;
  }

  .type-card-icon {
    width: 36px;
    height: 36px;
  }

  .type-card-name {
    font-size: 13px;
  }

  .type-card-count {
    font-size: 11px;
  }

  .choice-option {
    padding: 10px 12px;
    font-size: 13px;
  }

  .choice-letter {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }

  .quiz-header {
    padding: 10px 12px;
  }

  .question-card {
    padding: 16px 14px;
  }

  .modal-content {
    margin: 10px 8px;
    max-height: calc(100vh - 20px);
  }

  .modal-header {
    padding: 12px 16px;
  }

  .modal-body {
    padding: 12px 16px;
  }
}


/* ==================== 答题历史记录样式 ==================== */

/* 历史记录按钮 */
.history-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.history-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.history-btn svg {
  width: 16px;
  height: 16px;
}

/* 历史页面容器 */
.history-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
  min-height: 100vh;
}

/* 历史页面头部 */
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.history-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.clear-history-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: #ef4444;
  background: transparent;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.clear-history-btn:hover {
  background: #fef2f2;
  border-color: #ef4444;
}

.clear-history-btn svg {
  width: 15px;
  height: 15px;
}

/* 历史记录列表 */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 历史记录卡片 */
.history-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.history-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(99, 102, 241, 0.3);
}

.history-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.history-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.history-card-date {
  font-size: 12px;
  color: var(--text-muted);
}

.history-card-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.history-stat-item {
  text-align: center;
  padding: 10px;
  background: var(--bg-solid);
  border-radius: var(--radius-md);
}

.history-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.history-stat-value.correct {
  color: var(--accent);
}

.history-stat-value.accuracy {
  color: var(--primary);
}

.history-stat-value.time {
  color: #f59e0b;
}

.history-stat-label {
  font-size: 11px;
  color: var(--text-muted);
}

.history-card-mode {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 20px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}

/* 空状态 */
.history-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}

.history-empty.show {
  display: flex;
}

.empty-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  color: var(--text-muted);
  opacity: 0.3;
}

.empty-icon svg {
  width: 100%;
  height: 100%;
}

.history-empty p {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0 0 8px 0;
}

.history-empty span {
  font-size: 13px;
  color: var(--text-muted);
}

/* 历史详情弹窗 */
#history-detail-modal .modal-content {
  max-width: 800px;
}

.history-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-solid);
  border-radius: var(--radius-md);
}

.detail-summary-item {
  text-align: center;
}

.detail-summary-value {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.detail-summary-value.green { color: var(--accent); }
.detail-summary-value.red { color: #ef4444; }
.detail-summary-value.blue { color: var(--primary); }
.detail-summary-value.orange { color: #f59e0b; }

.detail-summary-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* 历史详情中的题目列表 */
.history-detail-questions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 8px;
}

.history-question-item {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.history-question-item.wrong {
  border-color: rgba(239, 68, 68, 0.3);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.03), transparent);
}

.history-question-item.correct {
  border-color: rgba(16, 185, 129, 0.3);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.03), transparent);
}

.hq-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.hq-number {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.hq-status {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 12px;
}

.hq-status.correct {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent);
}

.hq-status.wrong {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.hq-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
}

.hq-answer-row {
  display: flex;
  gap: 16px;
  font-size: 12px;
  margin-bottom: 8px;
}

.hq-user-answer {
  color: #ef4444;
}

.hq-user-answer.correct {
  color: var(--accent);
}

.hq-correct-answer {
  color: var(--accent);
}

/* 技巧建议区块 */
.tips-section {
  margin-top: 12px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), rgba(245, 158, 11, 0.08));
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: var(--radius-md);
}

.tips-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #d97706;
  margin-bottom: 8px;
}

.tips-title svg {
  width: 14px;
  height: 14px;
}

.tips-content {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.tips-content ul {
  margin: 6px 0 0 0;
  padding-left: 18px;
}

.tips-content li {
  margin-bottom: 4px;
}

/* 分析区块 */
.analysis-section {
  margin-top: 12px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
}

.analysis-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}

.analysis-title svg {
  width: 14px;
  height: 14px;
}

.analysis-content {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .history-container {
    padding: 16px;
  }

  .history-header {
    flex-wrap: wrap;
    gap: 12px;
  }

  .history-header h2 {
    font-size: 18px;
  }

  .history-card-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .history-detail-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .history-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
}
