/* ===== CSS Variables ===== */
:root {
  --primary: #4f46e5;
  --primary-light: #818cf8;
  --primary-dark: #3730a3;
  --success: #10b981;
  --success-light: #d1fae5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --info: #3b82f6;
  --info-light: #dbeafe;
  --bg: #f0f2f5;
  --bg-card: #ffffff;
  --text: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: 0.2s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== Header ===== */
.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  font-size: 24px;
}

.header-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-info {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 12px;
  background: var(--primary-light);
  color: white;
  border-radius: 20px;
  white-space: nowrap;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.btn-primary:disabled {
  background: #c7d2fe;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-secondary {
  background: var(--info-light);
  color: var(--info);
}

.btn-secondary:hover {
  background: #bfdbfe;
}

.btn-outline {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #eef2ff;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

/* ===== Pages ===== */
.page {
  display: none;
  animation: fadeIn 0.3s ease;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.main {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* ===== Welcome Page ===== */
.welcome-container {
  text-align: center;
  padding: 40px 20px;
}

.welcome-icon {
  font-size: 72px;
  margin-bottom: 16px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.welcome-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.welcome-desc {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.welcome-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
  transition: all var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.feature-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.feature-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.feature-card p {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== Settings Page ===== */
.settings-container {
  max-width: 700px;
  margin: 0 auto;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.setting-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.setting-group:last-child {
  border-bottom: none;
}

.setting-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.setting-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* Mode Options */
.mode-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.mode-option {
  cursor: pointer;
}

.mode-option input {
  display: none;
}

.mode-card {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 12px;
  text-align: center;
  transition: all var(--transition);
}

.mode-option input:checked + .mode-card {
  border-color: var(--primary);
  background: #eef2ff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.mode-card:hover {
  border-color: var(--primary-light);
}

.mode-icon {
  font-size: 28px;
  margin-bottom: 6px;
}

.mode-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.mode-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Category List */
.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  background: var(--bg);
}

.category-tag:hover {
  border-color: var(--primary-light);
}

.category-tag.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.category-tag input {
  display: none;
}

/* Range Input */
.range-group {
  padding: 8px 0;
}

.range-input {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 3px;
  outline: none;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
  transition: transform var(--transition);
}

.range-input::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.range-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.range-total {
  color: var(--text-muted);
}

/* Toggle Switch */
.toggle-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toggle-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
}

.toggle-item:last-child {
  border-bottom: none;
}

.toggle-label {
  font-size: 14px;
  color: var(--text);
}

.toggle-item input {
  display: none;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: #d1d5db;
  border-radius: 12px;
  transition: background var(--transition);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: var(--shadow-sm);
}

.toggle-item input:checked + .toggle-switch {
  background: var(--primary);
}

.toggle-item input:checked + .toggle-switch::after {
  transform: translateX(20px);
}

/* Settings Actions */
.settings-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  gap: 16px;
}

/* ===== Quiz Page ===== */
.quiz-container {
  max-width: 750px;
  margin: 0 auto;
}

.quiz-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.quiz-progress {
  flex: 1;
}

.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 4px;
  transition: width 0.4s ease;
  width: 0%;
}

.progress-text {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

.quiz-meta {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.meta-item {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  padding: 4px 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

/* Question Card */
.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.question-badge {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.badge-type, .badge-category {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.badge-type {
  background: var(--primary);
  color: white;
}

.badge-category {
  background: var(--info-light);
  color: var(--info);
}

.question-text {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 24px;
}

/* Options */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.option-item:hover:not(.disabled) {
  border-color: var(--primary-light);
  background: #f5f3ff;
}

.option-item.selected {
  border-color: var(--primary);
  background: #eef2ff;
}

.option-item.correct {
  border-color: var(--success);
  background: var(--success-light);
}

.option-item.wrong {
  border-color: var(--danger);
  background: var(--danger-light);
}

.option-item.disabled {
  cursor: default;
  opacity: 0.8;
}

.option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  background: var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.option-item.selected .option-letter {
  background: var(--primary);
  color: white;
}

.option-item.correct .option-letter {
  background: var(--success);
  color: white;
}

.option-item.wrong .option-letter {
  background: var(--danger);
  color: white;
}

.option-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  padding-top: 2px;
}

/* Explanation Card */
.explanation-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}

.explanation-card.correct-card {
  border-left: 4px solid var(--success);
}

.explanation-card.wrong-card {
  border-left: 4px solid var(--danger);
}

.explanation-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.explanation-icon {
  font-size: 24px;
}

.explanation-title {
  font-size: 16px;
  font-weight: 700;
}

.correct-card .explanation-title {
  color: var(--success);
}

.wrong-card .explanation-title {
  color: var(--danger);
}

.correct-answer {
  font-size: 14px;
  font-weight: 600;
  color: var(--success);
  margin-bottom: 8px;
  padding: 8px 12px;
  background: var(--success-light);
  border-radius: var(--radius-sm);
}

.explanation-text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
}

/* Quiz Actions */
.quiz-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* ===== Result Page ===== */
.result-container {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.result-header {
  margin-bottom: 32px;
}

.result-icon {
  font-size: 72px;
  margin-bottom: 12px;
}

.result-container .result-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.result-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
}

.result-score {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.score-circle {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.score-circle::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 8px solid var(--border);
}

.score-circle::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 8px solid transparent;
  border-top-color: var(--primary);
  border-right-color: var(--primary);
  transform: rotate(0deg);
  animation: none;
}

.score-number {
  font-size: 48px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.score-unit {
  font-size: 18px;
  color: var(--text-muted);
  font-weight: 600;
}

.score-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.score-detail {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 14px 20px;
  text-align: center;
  min-width: 100px;
}

.score-detail.correct {
  background: var(--success-light);
}

.score-detail.wrong {
  background: var(--danger-light);
}

.detail-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.detail-value {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.score-detail.correct .detail-value {
  color: var(--success);
}

.score-detail.wrong .detail-value {
  color: var(--danger);
}

/* Result Categories */
.result-categories {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
  text-align: left;
}

.result-categories h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
}

.category-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.category-stat-name {
  width: 140px;
  flex-shrink: 0;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-stat-bar {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.category-stat-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.category-stat-value {
  width: 50px;
  text-align: right;
  font-weight: 600;
  color: var(--text);
}

/* Result Questions */
.result-questions {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  text-align: left;
}

.result-questions h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
}

.result-q-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  line-height: 1.5;
}

.result-q-item:last-child {
  border-bottom: none;
}

.result-q-status {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.result-q-text {
  flex: 1;
  color: var(--text);
}

.result-q-answer {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.3s ease;
}

.modal-lg {
  max-width: 680px;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  color: var(--text-secondary);
}

.modal-close:hover {
  background: var(--danger-light);
  color: var(--danger);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Import Tabs */
.import-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 4px;
}

.import-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.import-tab.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.import-panel {
  display: none;
}

.import-panel.active {
  display: block;
}

.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg);
}

.upload-area:hover, .upload-area.dragover {
  border-color: var(--primary);
  background: #eef2ff;
}

.upload-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.upload-area p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.upload-hint {
  font-size: 12px !important;
  color: var(--text-muted) !important;
}

.upload-area .file-name {
  font-size: 14px;
  color: var(--primary);
  font-weight: 600;
  margin-top: 8px;
}

.import-textarea {
  width: 100%;
  min-height: 200px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 13px;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition);
  line-height: 1.5;
}

.import-textarea:focus {
  border-color: var(--primary);
}

.import-status {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
}

.import-status.success {
  background: var(--success-light);
  color: var(--success);
}

.import-status.error {
  background: var(--danger-light);
  color: var(--danger);
}

/* Help Section */
.help-section {
  margin-bottom: 20px;
}

.help-section:last-child {
  margin-bottom: 0;
}

.help-section h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.help-section ol, .help-section ul {
  padding-left: 20px;
  margin-bottom: 8px;
}

.help-section li {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.help-section p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.help-section code {
  background: var(--info-light);
  color: var(--info);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 72px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 360px;
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.error {
  border-left: 4px solid var(--danger);
}

.toast.info {
  border-left: 4px solid var(--info);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(30px); }
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .header {
    padding: 0 12px;
    height: 52px;
  }

  .header-title {
    font-size: 15px;
  }

  .main {
    padding: 16px 10px;
  }

  .welcome-icon {
    font-size: 56px;
  }

  .welcome-title {
    font-size: 22px;
  }

  .welcome-actions {
    flex-direction: column;
    align-items: center;
  }

  .feature-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .mode-options {
    grid-template-columns: 1fr;
  }

  .quiz-header {
    flex-direction: column;
    gap: 10px;
  }

  .quiz-meta {
    width: 100%;
    justify-content: space-between;
  }

  .question-card {
    padding: 20px 16px;
  }

  .question-text {
    font-size: 16px;
  }

  .result-score {
    flex-direction: column;
    gap: 24px;
  }

  .result-actions {
    flex-direction: column;
    align-items: center;
  }

  .result-actions .btn {
    width: 100%;
  }

  .settings-actions {
    flex-direction: column;
  }

  .settings-actions .btn {
    width: 100%;
  }
}
