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

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f3ff;
  color: #2d2a3a;
  min-height: 100vh;
}

#app { max-width: 560px; margin: 0 auto; padding: 20px 16px 40px; }

.hidden { display: none !important; }

h1 { font-size: 22px; margin-bottom: 4px; }
.sub { font-size: 13px; color: #7a6f96; margin-bottom: 20px; }
.head-row { display: flex; justify-content: space-between; align-items: flex-start; }
.head-row .btn { margin-top: 4px; }

/* 进度 */
.progress-card { background: #fff; border-radius: 14px; padding: 16px; box-shadow: 0 4px 16px rgba(80,60,160,.08); margin-bottom: 16px; }
.progress-text { font-size: 14px; margin-bottom: 10px; }
.progress-bar { height: 8px; background: #ece7fb; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg,#7c5cff,#b28bff); border-radius: 999px; transition: width .3s; }

/* 待复习提示 */
.due-banner { background: #fff7e6; color: #b26a00; border-radius: 12px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; display: none; }

/* 按钮 */
.btn { display: inline-block; border: none; cursor: pointer; border-radius: 12px; padding: 12px 18px; font-size: 15px; transition: .15s; }
.btn.primary { background: linear-gradient(90deg,#7c5cff,#9a6bff); color: #fff; width: 100%; font-weight: 600; }
.btn.primary:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: #7a6f96; width: 100%; margin-top: 10px; }
.btn.outline { background: #fff; border: 1.5px solid #d9cfff; color: #5a4bd0; }
.btn.small { padding: 6px 12px; width: auto; font-size: 13px; }

/* 词表 */
.word-list { list-style: none; margin: 16px 0; }
.word-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: #fff; border-radius: 10px; margin-bottom: 8px; font-size: 15px; box-shadow: 0 2px 8px rgba(80,60,160,.05); }
.word-item.done { background: #eefaf0; }
.wi-left { font-weight: 600; }
.wi-right { color: #7a6f96; font-size: 13px; }
.word-item.done .wi-right { color: #2f9e44; }

/* 复习门 */
.review-card { background: #fff; border-radius: 16px; padding: 24px 20px; text-align: center; box-shadow: 0 6px 20px rgba(80,60,160,.1); }
.review-card h2 { font-size: 20px; margin-bottom: 12px; }
.review-count { font-size: 16px; margin-bottom: 6px; }
.review-note { font-size: 13px; color: #7a6f96; margin-bottom: 16px; }
.review-list { text-align: left; margin-bottom: 16px; max-height: 200px; overflow: auto; }
.review-list .rw { display: inline-block; background: #f5f3ff; border-radius: 8px; padding: 4px 10px; margin: 3px; font-size: 13px; }

/* 记忆宫殿 */
.palace-card { background: #fff; border-radius: 16px; padding: 14px; box-shadow: 0 6px 20px rgba(80,60,160,.1); margin-bottom: 12px; }
#palace-svg { width: 100%; height: auto; display: block; }
.node-current { animation: pulse 1.6s ease-in-out infinite; }
.char { animation: bob 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.palace-hint { text-align: center; font-size: 13px; color: #7a6f96; margin-bottom: 12px; }

/* 学习卡 */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.learn-progress { font-size: 13px; color: #7a6f96; }
.card { background: #fff; border-radius: 16px; padding: 28px 20px; text-align: center; box-shadow: 0 6px 20px rgba(80,60,160,.1); margin-bottom: 16px; }
.word { font-size: 34px; font-weight: 700; margin-bottom: 8px; }
.phonetic { color: #7a6f96; font-size: 14px; margin-bottom: 16px; }
.meaning { font-size: 18px; margin-bottom: 10px; }
.example { font-size: 14px; color: #7a6f96; font-style: italic; margin-bottom: 18px; }

/* 测验 */
.quiz-title { font-size: 17px; margin-bottom: 16px; text-align: center; }
.quiz-speak { margin-bottom: 14px; }
.options { display: grid; gap: 10px; }
.option { background: #fff; border: 1.5px solid #e5defc; text-align: left; }
.option:active { border-color: #7c5cff; }
.spell-meaning { text-align: center; font-size: 16px; margin-bottom: 14px; }
.spell-input { width: 100%; padding: 12px 14px; font-size: 16px; border: 1.5px solid #e5defc; border-radius: 12px; margin-bottom: 14px; outline: none; }
.spell-input:focus { border-color: #7c5cff; }
.spell-submit { margin-bottom: 10px; }

/* 反馈 */
.feedback { text-align: center; font-size: 16px; padding: 18px; border-radius: 12px; margin-bottom: 14px; }
.feedback.right { background: #eefaf0; color: #2f9e44; }
.feedback.wrong { background: #fdeeee; color: #d93025; }

/* 设置 */
.settings-card { text-align: left; padding: 20px; }
.field { display: block; margin-bottom: 16px; }
.field-label { display: block; font-size: 13px; color: #7a6f96; margin-bottom: 6px; }
.input { width: 100%; padding: 11px 12px; font-size: 15px; border: 1.5px solid #e5defc; border-radius: 12px; outline: none; background: #fff; }
.input:focus { border-color: #7c5cff; }
.radio-row { display: flex; gap: 18px; }
.radio { font-size: 14px; display: flex; align-items: center; gap: 6px; }

/* 奖励 */
.reward-card { text-align: center; padding: 28px 20px; }
.reward-emoji { font-size: 52px; margin-bottom: 8px; }
.reward-card h2 { font-size: 20px; margin-bottom: 14px; }
.reward-line { font-size: 15px; margin-bottom: 8px; color: #4a4166; }
.photo-preview { margin: 14px 0; text-align: center; }
.photo-preview img { max-width: 100%; max-height: 260px; border-radius: 12px; }

/* 奖励记录 */
.section-title { font-size: 16px; margin: 20px 0 10px; }
.reward-history { margin-top: 4px; }
.reward-item { display: flex; justify-content: space-between; align-items: center; background: #fff; border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; box-shadow: 0 2px 8px rgba(80,60,160,.05); }
.reward-info { flex: 1; font-size: 14px; color: #4a4166; }
.reward-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; margin-left: 10px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px); background: rgba(40,32,64,.92); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; opacity: 0; transition: .25s; z-index: 999; max-width: 90%; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
