* { margin: 0; padding: 0; box-sizing: border-box; font-family: system-ui, -apple-system, sans-serif; }
body { background: #f5f7fa; color: #333; }
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }

header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.user-bar input { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; margin-right: 8px; }
button { padding: 8px 16px; background: #3b82f6; color: white; border: none; border-radius: 6px; cursor: pointer; transition: background 0.2s; }
button:hover { background: #2563eb; }
button:disabled { background: #9ca3af; cursor: not-allowed; }

.tabs { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 2px solid #e5e7eb; flex-wrap: wrap; }
.tab-btn { background: none; color: #666; border-radius: 0; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab-btn.active { color: #3b82f6; border-bottom-color: #3b82f6; }

.tab-content { display: none; }
.tab-content.active { display: block; }

.summary-card { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 20px; }
.stat-item { background: white; padding: 24px; border-radius: 12px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.stat-num { display: block; font-size: 32px; font-weight: 700; color: #3b82f6; }
.stat-label { color: #666; font-size: 14px; margin-top: 4px; }

.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chart-card { background: white; padding: 20px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.chart-card h3 { margin-bottom: 16px; font-size: 16px; }

/* 番茄钟 */
.pomodoro-card { background: white; padding: 24px; border-radius: 12px; margin-bottom: 20px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.pomodoro-timer { font-size: 48px; font-weight: 700; color: #3b82f6; margin-bottom: 16px; font-variant-numeric: tabular-nums; }
.pomodoro-controls { display: flex; gap: 10px; justify-content: center; margin-bottom: 12px; flex-wrap: wrap; }
.pomodoro-controls select { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; }
.pomodoro-task { color: #666; font-size: 14px; }

.task-header { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.task-header input, .task-header select { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; flex: 1; min-width: 120px; }
.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-item { background: white; padding: 16px; border-radius: 8px; display: flex; align-items: center; gap: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.task-item.completed { opacity: 0.6; text-decoration: line-through; }
.task-item .task-info { flex: 1; }
.task-item .task-sub { color: #3b82f6; font-weight: 600; margin-right: 8px; }
.task-item .task-meta { color: #666; font-size: 12px; margin-top: 4px; }

/* 错题本 */
.error-list { display: flex; flex-direction: column; gap: 10px; }
.error-item { background: white; padding: 16px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.error-item.mastered { opacity: 0.6; }
.error-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 8px; }
.error-subject { background: #fef3c7; color: #d97706; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.error-question { line-height: 1.6; margin-bottom: 8px; }
.error-analysis { background: #f0f9ff; padding: 12px; border-radius: 6px; margin-top: 8px; font-size: 14px; line-height: 1.6; }
.error-actions { display: flex; gap: 8px; margin-top: 10px; }
.error-actions button { padding: 4px 12px; font-size: 12px; }

.ai-actions { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.ai-input { display: flex; gap: 10px; margin-bottom: 16px; }
.ai-input textarea { flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 6px; min-height: 60px; resize: vertical; font-family: inherit; }
.ai-output { background: white; padding: 20px; border-radius: 12px; min-height: 120px; line-height: 1.8; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }

/* 提示框 */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-100px);
  background: #1f2937; color: white; padding: 12px 24px; border-radius: 8px;
  opacity: 0; transition: all 0.3s; z-index: 1000;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

@media (max-width: 768px) {
  .charts-grid, .summary-card { grid-template-columns: 1fr; }
  header { flex-direction: column; align-items: stretch; }
  .pomodoro-timer { font-size: 36px; }
}