* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #fafdf7; color: #333; max-width: 640px; margin: 0 auto; padding: 14px 14px 40px; }

.phead { display: flex; align-items: center; gap: 12px; padding: 6px 0 14px; }
.phead h2 { font-size: 20px; }
.pback { color: #58a700; text-decoration: none; font-size: 13px; font-weight: 600; }

.pstats { display: flex; gap: 8px; margin-bottom: 14px; }
.pstat { flex: 1; background: #fff; border: 1px solid #edf3e7; border-radius: 12px; padding: 10px 4px; text-align: center; }
.pstat .v { font-size: 18px; font-weight: 800; }
.pstat .k { font-size: 10px; color: #8a9a80; margin-top: 2px; }

.pmodes { display: flex; flex-direction: column; gap: 10px; }
.pmode { display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  background: #fff; border: 2px solid #e8f0e0; border-radius: 14px; padding: 14px 16px;
  cursor: pointer; transition: border-color .12s; text-align: left; }
.pmode:active { border-color: #58cc02; }
.pmode .t { font-size: 16px; font-weight: 800; }
.pmode .d { font-size: 12px; color: #8a9a80; }

.qcard { background: #fff; border: 2px solid #e8f0e0; border-radius: 16px; padding: 18px 16px; }
.qmeta { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.qbadge { font-size: 12px; font-weight: 700; color: #1a5fa8; background: #eef6ff; border-radius: 8px; padding: 3px 9px; }
.qpos { font-size: 12px; color: #aab; margin-left: auto; }
.qcombo { font-size: 12px; font-weight: 800; color: #ff9600; }

.audio-row { display: flex; gap: 10px; justify-content: center; margin: 8px 0 16px; }
.abtn { background: #1cb0f6; color: #fff; border: none; border-bottom: 4px solid #1899d6;
  border-radius: 12px; font-size: 15px; font-weight: 800; padding: 12px 22px; cursor: pointer; }
.abtn.slow { background: #ffb020; border-bottom-color: #e0a020; font-size: 13px; padding: 12px 16px; }
.abtn:active { transform: translateY(2px); border-bottom-width: 2px; }

.answerslot { min-height: 52px; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start;
  border-bottom: 2px dashed #dde7d4; padding-bottom: 8px; margin-bottom: 14px; }
.wordbank { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-bottom: 16px; }
.word { background: #fff; border: 2px solid #e5e5e5; border-bottom-width: 4px; border-radius: 10px;
  padding: 7px 13px; font-size: 15px; cursor: pointer; }
.word.used { opacity: .25; pointer-events: none; }
.word.inchip { background: #ddf4ff; border-color: #84d8ff; }
.word.inchip:hover { background: #c8ecff; }

.qprompt { font-size: 18px; font-weight: 600; text-align: center; margin: 6px 0 14px; line-height: 1.5; }
.qprompt.big { font-size: 22px; }
.typebox { width: 100%; border: 2px solid #dde7d4; border-radius: 12px; padding: 12px;
  font-size: 16px; outline: none; resize: none; margin-bottom: 14px; }
.typebox:focus { border-color: #58cc02; }

.dirhint { font-size: 12px; color: #1a5fa8; background: #eef6ff; border-radius: 8px;
  padding: 4px 10px; margin: -6px 0 10px; display: inline-block; }

.qid { font-size: 10px; color: #b0b8aa; margin: -8px 0 10px; cursor: pointer; user-select: none; }
.qid code { background: #f4f7f0; border-radius: 4px; padding: 1px 5px; font-size: 10px; }
.qid.copied { color: #58cc02; }
.qid.copied code { background: #f0ffe0; }

.qctrl { display: flex; gap: 10px; justify-content: flex-end; }
.qctrl.center { justify-content: center; }
.qbtn { border-radius: 12px; font-size: 15px; font-weight: 800; padding: 12px 22px; cursor: pointer; border: none; }
.qbtn.primary { background: #58cc02; color: #fff; border-bottom: 4px solid #61e002; }
.qbtn.primary:disabled { opacity: .4; cursor: default; }
.qbtn.ghost { background: #e5e5e5; color: #afafaf; border-bottom: 4px solid #d8d8d8; }

.imggrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.imgopt { background: #fff; border: 3px solid #e5e5e5; border-radius: 14px; padding: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.imgopt img { width: 80%; max-height: 90px; object-fit: contain; }
.imgopt span { font-size: 15px; font-weight: 700; }
.imgopt.right { border-color: #58cc02; background: #f0ffe0; }
.imgopt.wrong { border-color: #ff4b4b; background: #fff0f0; animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.feedback { text-align: center; padding: 18px 0 8px; }
.feedback.good { color: #58a700; font-size: 17px; font-weight: 700; }
.feedback.bad { color: #ea2b2b; font-size: 15px; }
.feedback .ftr { display: block; color: #8a9a80; font-size: 13px; font-weight: 400; margin-top: 5px; }
.feedback .qbtn { margin-top: 14px; }

.result { text-align: center; }
.result h2 { margin-bottom: 14px; }
.rstats { display: flex; gap: 8px; margin-bottom: 16px; }
.wronglist { text-align: left; margin-bottom: 14px; }
.tocheader { font-size: 13px; font-weight: 800; color: #4b5b43; margin: 10px 0 6px; }
.wrow { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px;
  background: #fafdf7; border-radius: 8px; margin-bottom: 4px; font-size: 14px; }
.wrow .ww { font-weight: 700; }
.wrow .wo { color: #8a9a80; }

.spin { text-align: center; color: #8a9a80; padding: 40px 0; font-size: 14px; }
