/* 词汇营打卡练习系统 - 全局样式 */

:root {
  /* 主色调 - 蓝色 */
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: #dbeafe;

  /* 成功 - 绿色 */
  --success: #22c55e;
  --success-bg: #f0fdf4;
  --success-border: #86efac;

  /* 错误 - 红色 */
  --error: #ef4444;
  --error-bg: #fef2f2;
  --error-border: #fca5a5;

  /* 中性 - 灰色 */
  --gray: #6b7280;
  --gray-light: #f3f4f6;
  --gray-dark: #374151;

  /* 背景 */
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;

  /* 文字 */
  --text-primary: #111827;
  --text-secondary: #6b7280;

  /* 边框 */
  --border: #e5e7eb;
  --border-radius: 12px;

  /* 阴影 */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
               'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  color: var(--text-primary);
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

/* 卡片样式 */
.card {
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

/* 标题样式 */
h1 {
  color: var(--bg-primary);
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
  font-weight: 700;
}

h2 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 600;
}

h3 {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
  font-weight: 500;
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  text-align: center;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--gray-light);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--gray);
  color: white;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #16a34a;
  transform: translateY(-1px);
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-group {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* 输入框样式 */
.input-group {
  margin-bottom: 1.5rem;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.input-group input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.2s;
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.input-group input.correct {
  border-color: var(--success-border);
  background: var(--success-bg);
}

.input-group input.wrong {
  border-color: var(--error-border);
  background: var(--error-bg);
}

/* 反馈信息 */
.feedback {
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  font-weight: 500;
}

.feedback.success {
  background: var(--success-bg);
  border: 2px solid var(--success-border);
  color: var(--success);
}

.feedback.error {
  background: var(--error-bg);
  border: 2px solid var(--error-border);
  color: var(--error);
}

.correct-answer {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--success-bg);
  border: 2px dashed var(--success);
  border-radius: 8px;
  color: var(--success);
  font-weight: 600;
}

/* 进度条 */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--gray-light);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-hover));
  transition: width 0.3s ease;
}

/* 统计信息 */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-item {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* 列表样式 */
.word-list {
  list-style: none;
}

.word-item {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.word-item .word {
  font-weight: 600;
  color: var(--text-primary);
}

.word-item .meaning {
  color: var(--text-secondary);
}

/* 模式选择卡片 */
.mode-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.mode-card {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.mode-card:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.mode-card h3 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.mode-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .card {
    padding: 1.5rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .btn-group {
    flex-direction: column;
  }

  .mode-cards {
    grid-template-columns: 1fr;
  }
}

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

.fade-in {
  animation: fadeIn 0.3s ease;
}
