
.app { width: 100%; max-width: 700px; margin: 0 auto; }

/* 头部 */
.quiz-header { text-align: center; padding: 0 0 16px; }
.quiz-header h1 { font-size: 20px; font-weight: 700; color: #5A8A6C; letter-spacing: 1px; }
.quiz-header .sub { font-size: 12px; color: #aaa; margin-top: 4px; }

/* 进度条 */
.progress-wrap { margin-bottom: 20px; }
.progress-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.progress-num { font-size: 13px; font-weight: 600; color: #5A8A6C; }
.progress-right { font-size: 12px; color: #bbb; }
.progress-track { height: 8px; background: #e8ede9; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #5A8A6C, #6fa882); border-radius: 4px; transition: width 0.4s ease; }
.progress-dots { display: flex; justify-content: space-between; margin-top: 10px; padding: 0 2px; }
.progress-dot { width: 10px; height: 10px; border-radius: 50%; background: #e0e5e1; transition: all 0.3s; }
.progress-dot.done { background: #5A8A6C; }
.progress-dot.current { background: #5A8A6C; transform: scale(1.4); box-shadow: 0 0 8px rgba(90,138,106,0.4); }
.progress-dot.wrong { background: #c0392b; }

/* 卡片 */
.card {
  background: #fff; border: 1px solid #D4E5DB; border-radius: 16px;
  padding: 36px 28px 28px; text-align: center; min-height: 220px;
  display: flex; flex-direction: column; align-items: center;
  box-shadow: 0 2px 16px rgba(90,138,106,0.06);
}
.card-number { font-size: 13px; font-weight: 700; color: #5A8A6C; letter-spacing: 2px; margin-bottom: 12px; }
.card-label {
  display: inline-block; background: #E8F5EC; color: #5A8A6C; font-size: 12px;
  padding: 5px 16px; border-radius: 10px; letter-spacing: 1px;
}
.card-question { font-size: 19px; font-weight: 600; color: #333; line-height: 1.7; margin-bottom: 28px; padding: 0 4px; }
.card-answer { max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease; border-top: 1px dashed transparent; }
.card-answer.show { max-height: 500px; opacity: 1; padding-top: 18px; border-top-color: #D4E5DB; margin-top: 4px; }
.answer-label { font-size: 13px; color: #5A8A6C; margin-bottom: 10px; font-weight: 500; letter-spacing: 1px; }
.answer-text { font-size: 20px; font-weight: 700; color: #333; line-height: 1.7; }
.answer-extra { font-size: 13px; color: #999; margin-top: 10px; }

/* 汉字大字 */
.hanzi-display {
  font-size: 56px; font-weight: 900; color: #333;
  margin: 20px 0 10px; line-height: 1.2;
  font-family: "STKaiti","KaiTi","楷体",serif;
}

/* 拼音输入行 */
.pinyin-row {
  display: flex; gap: 6px; justify-content: center; margin: 8px 0;
  flex-wrap: wrap;
}
.pinyin-cell {
  width: 36px; height: 42px; text-align: center; font-size: 20px;
  border: 2px solid #d0d8d3; border-radius: 8px; outline: none;
  font-family: inherit; text-transform: lowercase;
  transition: border-color 0.15s, background 0.15s;
}
.pinyin-cell:focus { border-color: #5A8A6C; box-shadow: 0 0 0 3px rgba(90,138,106,0.1); }

/* 声调选择 */
.tone-row { margin: 8px 0; }
.tone-select {
  padding: 8px 16px; border-radius: 8px; border: 2px solid #d0d8d3;
  font-size: 14px; font-family: inherit; outline: none; cursor: pointer;
  background: #fff; min-width: 160px; text-align: center;
}
.tone-select:focus { border-color: #5A8A6C; }

/* 英语单词输入行 */
.word-row {
  display: flex; gap: 5px; justify-content: center; margin: 12px 0;
  flex-wrap: wrap; align-items: center;
}
.word-cell {
  width: 32px; height: 40px; text-align: center; font-size: 18px;
  border: 2px solid #d0d8d3; border-radius: 8px; outline: none;
  font-family: inherit; text-transform: lowercase;
  transition: border-color 0.15s, background 0.15s;
}
.word-cell:focus { border-color: #5A8A6C; box-shadow: 0 0 0 3px rgba(90,138,106,0.1); }
.word-cell.revealed {
  background: #E8F5EC; border-color: #5A8A6C; color: #5A8A6C;
  font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.word-space { width: 16px; height: 40px; flex-shrink: 0; }

/* 按钮 */
.btn-group { display: flex; gap: 12px; margin-top: 20px; }
.btn {
padding: 15px 20px; border-radius: 12px; font-size: 15px;
  cursor: pointer; border: none; transition: all 0.2s;
  font-family: inherit; letter-spacing: 0.5px;
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: linear-gradient(135deg, #5A8A6C, #6fa882); color: #fff; box-shadow: 0 3px 12px rgba(90,138,106,0.2); }
.btn-primary:hover { box-shadow: 0 4px 16px rgba(90,138,106,0.3); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.btn-outline { background: #fff; color: #5A8A6C; border: 1px solid #5A8A6C; }
.btn-outline:hover { background: #E8F5EC; }
.btn-success { background: linear-gradient(135deg, #5A8A6C, #6fa882); color: #fff; box-shadow: 0 3px 12px rgba(90,138,106,0.2); }
.btn-danger { background: #fff; color: #c0392b; border: 1px solid #e0b4b4; }
.btn-danger:hover { background: #fdf2f2; }
.btn-ghost { background: transparent; color: #999; border: 1px solid #e0e0e0; padding: 10px 16px; font-size: 13px; }
.btn-ghost:hover { background: #f5f5f5; color: #666; }
.btn-block { flex: none; width: 100%; }

/* 开始页 */
.start-card {
  background: #fff; border: 1px solid #D4E5DB;
  padding: 36px 28px; text-align: center; box-shadow: 0 2px 16px rgba(90,138,106,0.06);
}
.start-card .icon { font-size: 48px; margin-bottom: 10px; display: block; }
.start-card h2 { font-size: 20px; color: #333; margin-bottom: 6px; }
.start-card .desc { font-size: 13px; color: #999; margin-bottom: 20px; line-height: 1.8; }

/* 题库选择 */
.bank-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; text-align: left; }

/* 分类分组 */
.category-group {
  border: 1px solid #e0e5e1; border-radius: 10px; overflow: hidden;
  background: #fafcfa; margin-bottom: 8px;
}
.category-header {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  cursor: pointer; user-select: none; background: #f0f4f1;
  transition: background 0.15s;
}
.category-header:hover { background: #e8ede9; }
.cat-arrow { font-size: 10px; color: #999; width: 14px; text-align: center; flex-shrink: 0; }
.cat-name { font-size: 15px; font-weight: 700; color: #333; }
.cat-count { font-size: 11px; color: #aaa; }
.cat-selected { font-size: 11px; color: #5A8A6C; background: #E8F5EC; padding: 2px 8px; border-radius: 10px; font-weight: 600; margin-left: auto; }
.cat-body { padding: 4px 8px 8px; }

/* 年级分组 */
.grade-group {
  border: 1px solid #e8ede9; border-radius: 10px; overflow: hidden;
  background: #fff; margin-bottom: 6px;
}
.grade-header {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  cursor: pointer; user-select: none; transition: background 0.15s;
}
.grade-header:hover { background: #fafcfa; }
.grade-arrow { font-size: 10px; color: #999; width: 14px; text-align: center; flex-shrink: 0; }
.grade-name { font-size: 14px; font-weight: 700; color: #333; }
.grade-count { font-size: 11px; color: #aaa; }
.grade-selected { font-size: 11px; color: #5A8A6C; background: #E8F5EC; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.grade-all-btn {
  margin-left: auto; padding: 3px 12px; border-radius: 12px; font-size: 11px;
  border: 1px solid #ccc; background: #fff; color: #666; cursor: pointer;
  font-family: inherit; transition: all 0.15s; flex-shrink: 0;
}
.grade-all-btn:hover { border-color: #5A8A6C; color: #5A8A6C; }
.grade-body {
  display: grid; gap: 6px;
  padding: 4px 10px 10px; border-top: 1px solid #f0f4f1;
}
.bank-row {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border: 1px solid #e8ede9; border-radius: 8px; cursor: pointer;
  transition: all 0.15s; background: #fafcfa;
}
.bank-row:hover { border-color: #c8d8cc; }
.bank-row input[type="checkbox"] {
  appearance: none; width: 16px; height: 16px; border: 1px solid #ccc;
  border-radius: 4px; flex-shrink: 0; cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.bank-row input[type="checkbox"]:checked { background: #5A8A6C; border-color: #5A8A6C; }
.bank-row input[type="checkbox"]:checked::after { content: '✓'; color: #fff; font-size: 11px; }
.bank-row .bn { font-size: 13px; color: #333; flex: 1; }

/* 题数选择器 */
.count-selector {
  display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
  padding: 12px 0; border-top: 1px solid #f0f0f0; flex-wrap: wrap;
}
.count-label { font-size: 13px; color: #999; white-space: nowrap; }
.count-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.count-pill {
  padding: 5px; border-radius: 10px; font-size: 13px;
  border: 1px solid #e0e0e0; background: #fff; color: #999; cursor: pointer;
  transition: all 0.15s; font-family: inherit;
}
.count-pill:hover { border-color: #5A8A6C; color: #5A8A6C; }
.count-pill.active { background: #5A8A6C; color: #fff; border-color: #5A8A6C; }
.count-custom {
  width: 80px; padding: 6px 8px; border-radius: 10px; font-size: 13px;
  border: 1px solid #e0e0e0; background: #fff; color: #333; text-align: center;
  font-family: inherit; outline: none; transition: border-color 0.15s;
}
.count-custom:focus { border-color: #5A8A6C; }
.count-custom::placeholder { color: #ccc; }

/* 结果页 */
.result-card {
  background: #fff; border: 1px solid #D4E5DB; border-radius: 16px;
  padding: 36px 28px; text-align: center; box-shadow: 0 2px 16px rgba(90,138,106,0.06);
}
.result-ring {
  display: inline-flex; align-items: center; justify-content: center;
  width: 120px; height: 120px; border-radius: 50%; margin-bottom: 16px;
}
.result-ring.perfect { background: #eafaf1; border: 4px solid #27ae60; }
.result-ring.good { background: #ecf5ef; border: 4px solid #5A8A6C; }
.result-ring.ok { background: #fef9f0; border: 4px solid #e67e22; }
.result-ring.low { background: #fdf2f2; border: 4px solid #c0392b; }
.result-score { font-size: 42px; font-weight: 700; line-height: 1; }
.result-score.perfect { color: #27ae60; }
.result-score.good { color: #5A8A6C; }
.result-score.ok { color: #e67e22; }
.result-score.low { color: #c0392b; }
.result-label { font-size: 15px; color: #666; margin: 0 0 4px; font-weight: 500; }
.result-msg { font-size: 14px; color: #999; margin-bottom: 24px; }
.result-stats { display: flex; justify-content: center; gap: 24px; margin-bottom: 24px; }
.result-stat { text-align: center; }
.result-stat .val { font-size: 22px; font-weight: 700; }
.result-stat .val.green { color: #5A8A6C; }
.result-stat .val.red { color: #c0392b; }
.result-stat .lbl { font-size: 12px; color: #999; margin-top: 2px; }
.wrong-list { text-align: left; border-top: 1px solid #f0f0f0; padding-top: 20px; margin-top: 4px; }
.wrong-list h3 { font-size: 15px; color: #c0392b; margin-bottom: 14px; font-weight: 600; }
.wrong-item { background: #fdf5f5; border: 1px solid #f5e0e0; border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
.wrong-item .wn { font-size: 11px; color: #c0392b; font-weight: 600; margin-bottom: 4px; }
.wrong-item .wl { display: inline-block; font-size: 11px; background: #fff; color: #5A8A6C; padding: 2px 10px; border-radius: 10px; margin-bottom: 6px; font-weight: 600; }
.wrong-item .q { font-size: 14px; color: #333; margin-bottom: 6px; font-weight: 500; }
.wrong-item .a { font-size: 14px; color: #5A8A6C; font-weight: 600; }
.wrong-item .e { font-size: 12px; color: #999; margin-top: 4px; }

.topbar { align-items: center; justify-content: space-between; margin-bottom: 10px; }
.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* 响应式 */
@media (max-width: 768px) {
  .app { max-width: 100%; }
  .card { padding: 28px 20px 24px; min-height: 200px; }
  .hanzi-display { font-size: 44px; }
  .pinyin-cell { width: 30px; height: 36px; font-size: 17px; }
  .word-cell { width: 28px; height: 36px; font-size: 16px; }
  .word-cell.revealed { width: 28px; height: 36px; font-size: 16px; }
  .start-card,.result-card { padding: 28px 20px; }
  .result-score { font-size: 38px; }
  .result-ring { width: 100px; height: 100px; }
  .btn { padding: 7px 8px; font-size: 12px; }
  .quiz-header h1 { font-size: 14px; }
}

/* 单输入框（手机优化，替代逐字母格子） */
.quiz-input {
  width: 100%; height: 52px; border: 2px solid #ddd;
  border-radius: 12px; text-align: center; font-size: 24px;
  outline: none; box-sizing: border-box; font-family: inherit;
  margin: 10px 0; transition: border-color 0.15s;
  -webkit-appearance: none;
}
.quiz-input:focus { border-color: #5A8A6C; box-shadow: 0 0 0 3px rgba(90,138,106,0.1); }
