/* 字云通关 - 样式表 */
/* 针对一年级儿童设计：极简、护眼、超大点击区 */

:root {
  --bg-color: #F0F9F0;
  --primary-color: #4CAF50;
  --primary-dark: #388E3C;
  --error-color: #E53935;
  --success-color: #43A047;
  --text-color: #333333;
  --text-light: #666666;
  --white: #FFFFFF;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --radius: 16px;
  --font-kai: "楷体", "楷体_GB2312", "KaiTi", "STKaiti", serif;
}

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

html, body {
  height: 100%;
  font-family: var(--font-kai);
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

/* ========== 通用容器 ========== */
.container {
  width: 100%;
  max-width: 800px;
  text-align: center;
}

/* ========== 标题 ========== */
.title {
  font-size: 2.5rem;
  color: var(--primary-dark);
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
  font-size: 1.2rem;
  color: var(--text-light);
  margin-bottom: 30px;
}

/* ========== 卡片 ========== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

/* ========== 按钮 ========== */
.btn {
  display: inline-block;
  padding: 16px 32px;
  font-size: 1.3rem;
  font-family: var(--font-kai);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 200px;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--white);
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

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

.btn-large {
  padding: 20px 40px;
  font-size: 1.5rem;
  min-width: 250px;
}

/* ========== 输入框 ========== */
.input-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.input-field {
  width: 100px;
  padding: 12px;
  font-size: 1.3rem;
  font-family: var(--font-kai);
  text-align: center;
  border: 2px solid var(--primary-color);
  border-radius: var(--radius);
  outline: none;
}

.input-field:focus {
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.input-label {
  font-size: 1.2rem;
  color: var(--text-light);
}

/* ========== 模式切换 ========== */
.mode-switch {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 25px;
}

.mode-btn {
  padding: 12px 24px;
  font-size: 1.1rem;
  font-family: var(--font-kai);
  border: 2px solid var(--primary-color);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

/* ========== 测试页面 ========== */
.test-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.progress-info {
  font-size: 1.1rem;
  color: var(--text-light);
}

.replay-btn {
  padding: 10px 20px;
  font-size: 1rem;
  background: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}

.replay-btn:hover {
  background: var(--primary-dark);
}

.question-area {
  margin: 20px 0;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.question-char {
  font-size: 60px;
  color: var(--primary-color);
  margin-bottom: 10px;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* ========== 选项按钮 ========== */
.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 600px;
  margin: 0 auto;
}

.option-btn {
  padding: 30px;
  font-size: 80px;
  font-family: var(--font-kai);
  background: var(--white);
  border: 3px solid #E0E0E0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 150px;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.option-btn:disabled {
  cursor: default;
}

.option-btn.correct {
  background: #C8E6C9;
  border-color: var(--success-color);
  animation: pulse 0.3s ease;
}

.option-btn.wrong {
  background: #FFCDD2;
  border-color: var(--error-color);
}

.option-btn.show-correct {
  background: #C8E6C9;
  border-color: var(--success-color);
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* ========== 生字本 ========== */
.words-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.word-item {
  padding: 20px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.word-item:hover {
  transform: translateY(-3px);
}

.word-char {
  font-size: 48px;
  margin-bottom: 5px;
}

.word-pinyin {
  font-size: 14px;
  color: var(--text-light);
}

.word-count {
  position: absolute;
  top: 5px;
  right: 8px;
  font-size: 12px;
  color: var(--error-color);
  background: #FFEBEE;
  padding: 2px 6px;
  border-radius: 8px;
}

.word-actions {
  margin-top: 10px;
}

.word-action-btn {
  padding: 5px 12px;
  font-size: 0.9rem;
  background: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

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

/* ========== 结果页面 ========== */
.result-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  text-align: center;
}

.result-title {
  font-size: 2rem;
  color: var(--primary-dark);
  margin-bottom: 20px;
}

.result-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin: 30px 0;
}

.stat-item {
  text-align: center;
}

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

.stat-label {
  font-size: 1rem;
  color: var(--text-light);
}

.new-words-section {
  margin-top: 30px;
  text-align: left;
}

.new-words-title {
  font-size: 1.2rem;
  color: var(--error-color);
  margin-bottom: 15px;
}

.new-words-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.new-word-tag {
  padding: 8px 16px;
  background: #FFEBEE;
  color: var(--error-color);
  border-radius: 20px;
  font-size: 1.2rem;
}

/* ========== 导航按钮 ========== */
.nav-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
  flex-wrap: wrap;
}

/* ========== 统计进度条 ========== */
.progress-bar {
  width: 100%;
  height: 20px;
  background: #E0E0E0;
  border-radius: 10px;
  overflow: hidden;
  margin: 15px 0;
}

.progress-fill {
  height: 100%;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.stats-summary {
  display: flex;
  justify-content: space-around;
  margin-top: 20px;
  padding: 15px;
  background: var(--bg-color);
  border-radius: var(--radius);
}

.stats-item {
  text-align: center;
}

.stats-value {
  font-size: 1.5rem;
  color: var(--primary-color);
  font-weight: bold;
}

.stats-label {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* ========== 隐藏状态 ========== */
.hidden {
  display: none !important;
}

/* ========== 响应式 ========== */
@media (max-width: 600px) {
  .title {
    font-size: 2rem;
  }

  .question-char {
    font-size: 100px;
  }

  .option-btn {
    font-size: 60px;
    padding: 25px;
    min-height: 120px;
  }

  .options-grid {
    gap: 15px;
  }

  .result-stats {
    flex-direction: column;
    gap: 20px;
  }

  .words-list {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
}
