/* ===== CSS Reset & Variables ===== */
:root {
  --primary: #00B894;
  --primary-light: #55EFC4;
  --primary-dark: #00A381;
  --secondary: #0984E3;
  --secondary-light: #74B9FF;
  --accent: #FDCB6E;
  --accent-dark: #F39C12;
  --background: #F8FAFB;
  --surface: #FFFFFF;
  --text-primary: #2D3436;
  --text-secondary: #636E72;
  --text-muted: #B2BEC3;
  --border: #DFE6E9;
  --border-light: #F1F3F4;
  --success: #00B894;
  --warning: #FDCB6E;
  --error: #E17055;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.2s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--background);
  min-height: 100vh;
}

/* ===== Header ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  color: var(--primary);
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-tabs {
  display: flex;
  gap: 4px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.nav-tab svg {
  width: 18px;
  height: 18px;
}

.nav-tab:hover {
  background: var(--background);
  color: var(--text-primary);
}

.nav-tab.active {
  background: var(--primary);
  color: white;
}

.header-right {
  display: flex;
  align-items: center;
}

.stats {
  display: flex;
  gap: 24px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 16px;
  background: var(--background);
  border-radius: var(--radius-md);
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ===== Main Layout ===== */
.main-content {
  display: grid;
  grid-template-columns: 260px 1fr 240px;
  gap: 24px;
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
  min-height: calc(100vh - 64px);
}

/* ===== Sidebar ===== */
.sidebar {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  height: fit-content;
  position: sticky;
  top: 88px;
  box-shadow: var(--shadow-sm);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.sidebar-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.btn-reset {
  padding: 4px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-reset:hover {
  border-color: var(--error);
  color: var(--error);
}

.filter-group {
  margin-bottom: 24px;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-title svg {
  width: 16px;
  height: 16px;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.checkbox-item:hover {
  background: var(--background);
}

.checkbox-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.difficulty-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.difficulty-badge.easy {
  background: #E8F8F5;
  color: #00B894;
}

.difficulty-badge.medium {
  background: #FEF9E7;
  color: #F39C12;
}

.difficulty-badge.hard {
  background: #FDEDEC;
  color: #E74C3C;
}

.search-box {
  display: flex;
  gap: 8px;
}

.search-box input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.1);
}

.search-btn {
  padding: 10px 12px;
  border: none;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.search-btn:hover {
  background: var(--primary-dark);
}

.search-btn svg {
  width: 18px;
  height: 18px;
}

/* ===== Content Area ===== */
.content-area {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

/* ===== Upload Zone ===== */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--surface);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(0, 184, 148, 0.03);
}

.upload-content {
  pointer-events: none;
}

.upload-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  border-radius: 50%;
}

.upload-icon svg {
  width: 100%;
  height: 100%;
  color: white;
}

.upload-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.upload-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.upload-formats {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.format-tag {
  padding: 4px 12px;
  background: var(--background);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Upload Progress */
.upload-progress {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.progress-title {
  font-weight: 500;
}

.progress-percent {
  color: var(--primary);
  font-weight: 600;
}

.progress-bar {
  height: 8px;
  background: var(--background);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

/* ===== Question List Header ===== */
.question-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
}

.list-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.result-count {
  color: var(--text-secondary);
  font-size: 14px;
}

.result-count strong {
  color: var(--text-primary);
  font-weight: 600;
}

.select-all {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
}

.select-all input {
  accent-color: var(--primary);
}

.btn-add-selected {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  background: var(--secondary);
  color: white;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.btn-add-selected:hover {
  background: #0770C2;
}

.btn-add-selected svg {
  width: 16px;
  height: 16px;
}

/* ===== Question Grid ===== */
.question-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.question-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 2px solid transparent;
}

.question-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.question-card.selected {
  border-color: var(--primary);
  background: rgba(0, 184, 148, 0.02);
}

.question-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.question-card-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.badge-subject {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: white;
}

.badge-type {
  background: var(--secondary);
  color: white;
}

.badge-difficulty {
  color: white;
}

.badge-difficulty.easy {
  background: #00B894;
}

.badge-difficulty.medium {
  background: #F39C12;
}

.badge-difficulty.hard {
  background: #E74C3C;
}

.question-card-select {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
}

.question-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.question-card-actions {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.btn-card-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-card-action:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-card-action.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.btn-card-action.primary:hover {
  background: var(--primary-dark);
}

.btn-card-action.danger:hover {
  border-color: var(--error);
  color: var(--error);
}

.btn-card-action svg {
  width: 14px;
  height: 14px;
}

/* ===== Question Card Extended Styles ===== */
.question-card-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-favorite {
  padding: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-favorite:hover {
  color: var(--accent);
}

.btn-favorite.active {
  color: var(--accent);
}

.btn-favorite svg {
  width: 18px;
  height: 18px;
}

.question-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.tag {
  padding: 2px 8px;
  background: var(--background);
  color: var(--text-secondary);
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.tag-more {
  background: var(--secondary-light);
  color: white;
  border-color: transparent;
}

.question-source {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.question-meta > div {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.question-folder {
  color: var(--secondary) !important;
}

.question-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.question-score {
  display: flex;
  align-items: center;
  gap: 6px;
}

.score-label {
  font-size: 12px;
  color: var(--text-muted);
}

.score-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.question-card-actions {
  display: flex;
  gap: 6px;
}

.question-card-actions .btn-card-action {
  flex: 1;
  min-width: 50px;
}

.question-card-actions .btn-card-action:last-child {
  flex: 0;
  padding: 8px 10px;
}

/* ===== Grade Filter ===== */
.filter-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 0;
}

/* ===== Favorites Filter Button ===== */
.btn-favorites-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.btn-favorites-filter:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-favorites-filter.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ===== Folder Tree ===== */
.folder-tree {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.folder-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
  color: var(--text-secondary);
  position: relative;
}

.folder-item:hover {
  background: var(--background);
  color: var(--text-primary);
}

.folder-item.active {
  background: rgba(0, 184, 148, 0.1);
  color: var(--primary);
  font-weight: 500;
}

.folder-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.folder-item span:first-of-type {
  flex: 1;
}

.folder-count {
  font-size: 11px;
  padding: 2px 6px;
  background: var(--background);
  border-radius: 10px;
  color: var(--text-muted);
}

.folder-item.active .folder-count {
  background: var(--primary);
  color: white;
}

.folder-action {
  opacity: 0;
  padding: 2px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.folder-item:hover .folder-action {
  opacity: 1;
}

.folder-action:hover {
  background: var(--error);
  color: white;
}

.folder-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}

.folder-add-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(0, 184, 148, 0.05);
}

/* ===== Exam Assistant ===== */
.exam-assistant {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--primary-light);
}

.assistant-header {
  margin-bottom: 16px;
}

.assistant-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}

.assistant-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.assistant-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.assistant-field {
  flex: 1;
  min-width: 150px;
}

.assistant-field label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.assistant-field select,
.assistant-field input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.assistant-field select:focus,
.assistant-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.1);
}

.difficulty-distribution {
  background: var(--background);
  border-radius: var(--radius-md);
  padding: 16px;
}

.difficulty-distribution > label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-weight: 500;
}

.dist-hint {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: normal;
}

.dist-label.easy {
  color: #00B894;
}

.dist-label.medium {
  color: #F39C12;
}

.dist-label.hard {
  color: #E74C3C;
}

.distribution-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.distribution-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dist-label {
  width: 40px;
  font-size: 13px;
  color: var(--text-secondary);
}

.distribution-item input[type="range"] {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  background: var(--border);
  border-radius: 3px;
  outline: none;
}

.distribution-item input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
}

.dist-value {
  width: 40px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-align: right;
}

.btn-assistant {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(0, 184, 148, 0.3);
}

.btn-assistant:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 184, 148, 0.4);
}

/* ===== Badge Grade ===== */
.badge-grade {
  background: var(--secondary);
  color: white;
}

.badge-score {
  background: var(--accent);
  color: #333;
  font-size: 11px;
  padding: 2px 6px;
}

/* ===== Form Improvements ===== */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
  min-width: 120px;
}

/* ===== Modal Improvements ===== */
.modal {
  max-height: 90vh;
  overflow-y: auto;
}

.modal-body {
  max-height: calc(90vh - 120px);
  overflow-y: auto;
  padding-right: 10px;
}

/* ===== Empty State Improvements ===== */
.empty-state.show {
  display: flex;
}

.exam-empty.hidden {
  display: none;
}

.exam-empty:not(.hidden) {
  display: flex;
}

/* ===== Exam Stats Improvement ===== */
.exam-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 20px;
  background: var(--background);
  border-radius: var(--radius-md);
  min-width: 80px;
}

.exam-stat .stat-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.exam-stat .stat-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== Folder Tree Improvement ===== */
.folder-item {
  cursor: pointer;
}

.folder-item:hover {
  background: var(--background);
}

.folder-item.active {
  background: rgba(0, 184, 148, 0.1);
  font-weight: 500;
}

/* ===== Toast Animation ===== */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.toast.show {
  animation: slideIn 0.3s ease-out;
}

.toast.hiding {
  animation: slideOut 0.3s ease-out;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .main-content {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .action-panel {
    display: none;
  }
}

/* ===== Edit Modal Extended ===== */
.modal .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.modal .form-group input,
.modal .form-group textarea,
.modal .form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
  font-family: inherit;
}

.modal .form-group input:focus,
.modal .form-group textarea:focus,
.modal .form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.1);
}

/* ===== Empty State ===== */
.empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state.show {
  display: flex;
}

.empty-icon {
  width: 80px;
  height: 80px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
}

/* ===== Exam Builder View ===== */
.exam-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  padding: 20px;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.exam-title-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 18px;
  font-weight: 600;
  outline: none;
  transition: var(--transition);
}

.exam-title-input:focus {
  border-color: var(--primary);
}

.exam-actions {
  display: flex;
  gap: 12px;
  margin-left: 16px;
}

.btn-action {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.btn-action:hover {
  border-color: var(--error);
  color: var(--error);
}

.btn-action svg {
  width: 16px;
  height: 16px;
}

.exam-preview {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  min-height: 300px;
}

.exam-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}

.exam-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stat-num {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
}

.stat-desc {
  font-size: 14px;
  color: var(--text-secondary);
}

.exam-question-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.exam-question-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--background);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.exam-question-item:hover {
  background: var(--border-light);
}

.exam-question-num {
  min-width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 13px;
  border-radius: 50%;
}

.exam-question-content {
  flex: 1;
}

.exam-question-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.exam-question-text {
  font-size: 14px;
  color: var(--text-primary);
}

.exam-question-remove {
  padding: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.exam-question-remove:hover {
  background: var(--error);
  color: white;
}

.exam-question-remove svg {
  width: 16px;
  height: 16px;
}

.exam-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
}

.exam-empty svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
}

.exam-empty.hidden {
  display: none;
}

/* ===== Export Options ===== */
.export-options {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.export-options h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.option-row {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.option-item input {
  accent-color: var(--primary);
}

.export-buttons {
  display: flex;
  gap: 12px;
}

.btn-export {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.btn-export:hover {
  border-color: var(--secondary);
  color: var(--secondary);
}

.btn-export.primary {
  background: var(--secondary);
  border-color: var(--secondary);
  color: white;
}

.btn-export.primary:hover {
  background: #0770C2;
}

.btn-export svg {
  width: 18px;
  height: 18px;
}

/* ===== Action Panel ===== */
.action-panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  height: fit-content;
  position: sticky;
  top: 88px;
  box-shadow: var(--shadow-sm);
}

.panel-section {
  margin-bottom: 24px;
}

.panel-section:last-child {
  margin-bottom: 0;
}

.panel-section h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.btn-quick {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 13px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 8px;
}

.btn-quick:last-child {
  margin-bottom: 0;
}

.btn-quick:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(0, 184, 148, 0.03);
}

.btn-quick svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

.btn-quick:hover svg {
  color: var(--primary);
}

.stats-card {
  background: var(--background);
  border-radius: var(--radius-md);
  padding: 12px;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
}

.stats-row:last-child {
  border-bottom: none;
}

.stats-row span:first-child {
  color: var(--text-secondary);
}

.stats-row span:last-child {
  font-weight: 600;
  color: var(--text-primary);
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow: auto;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.show .modal {
  transform: translateY(0);
}

.modal.modal-small {
  max-width: 400px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--background);
  color: var(--text-primary);
}

.modal-close svg {
  width: 20px;
  height: 20px;
}

.modal-body {
  padding: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
}

.btn-cancel {
  padding: 10px 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.btn-cancel:hover {
  background: var(--background);
}

.btn-save {
  padding: 10px 20px;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.btn-save:hover {
  background: var(--primary-dark);
}

.btn-delete {
  padding: 10px 20px;
  border: none;
  background: var(--error);
  color: white;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.btn-delete:hover {
  background: #C0392B;
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  transform: translateX(120%);
  transition: transform 0.3s ease;
  min-width: 280px;
}

.toast.show {
  transform: translateX(0);
}

.toast-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.toast.success .toast-icon {
  color: var(--success);
}

.toast.error .toast-icon {
  color: var(--error);
}

.toast.warning .toast-icon {
  color: var(--warning);
}

.toast.info .toast-icon {
  color: var(--secondary);
}

.toast-message {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
}

.toast-close {
  padding: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.toast-close:hover {
  background: var(--background);
  color: var(--text-primary);
}

.toast-close svg {
  width: 16px;
  height: 16px;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.question-card {
  animation: fadeIn 0.3s ease forwards;
}

/* Stagger animation for cards */
.question-card:nth-child(1) { animation-delay: 0ms; }
.question-card:nth-child(2) { animation-delay: 50ms; }
.question-card:nth-child(3) { animation-delay: 100ms; }
.question-card:nth-child(4) { animation-delay: 150ms; }
.question-card:nth-child(5) { animation-delay: 200ms; }
.question-card:nth-child(6) { animation-delay: 250ms; }

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.processing {
  animation: pulse 1.5s infinite;
}
