/* 每日英语 H5 — 公众号内使用，样式对齐小程序 */
:root {
    --primary: #2b5fe0;
    --primary-dark: #1e4bc0;
    --bg: #f4f6fa;
    --card: #ffffff;
    --text: #2b2f36;
    --muted: #8a9099;
    --border: #eceff4;
    --green: #17a673;
    --red: #e5484d;
    --orange: #e8892b;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; position: relative; }

.topbar {
    position: sticky; top: 0; z-index: 20;
    height: 48px; display: flex; align-items: center; justify-content: center;
    background: var(--primary); color: #fff;
    box-shadow: 0 2px 8px rgba(43,95,224,.18);
}
.topbar-title { font-size: 17px; font-weight: 600; }
.topbar-back {
    position: absolute; left: 8px; top: 0; height: 48px; width: 44px;
    background: none; border: 0; color: #fff; font-size: 30px; cursor: pointer;
}

.page { padding: 14px 14px 78px; min-height: calc(100vh - 126px); }

.card {
    background: var(--card); border-radius: 14px;
    padding: 16px; margin-bottom: 14px;
    box-shadow: 0 2px 10px rgba(20,40,80,.05);
}
.muted { color: var(--muted); }
.section-title { font-size: 16px; font-weight: 600; display: block; margin-bottom: 10px; }
.state-box, .empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.error-box { border-left: 3px solid var(--red); color: var(--red); }

button { font-family: inherit; cursor: pointer; border: 0; border-radius: 10px; }
.primary-btn {
    display: block; width: 100%; padding: 13px; margin-top: 10px;
    background: var(--primary); color: #fff; font-size: 16px; font-weight: 600;
}
.primary-btn:disabled { background: #b7c4e8; cursor: default; }
.secondary-btn { padding: 12px 16px; background: #eef2fb; color: var(--primary); font-size: 15px; }
.danger-btn { display: block; width: 100%; padding: 11px; background: #fdecec; color: var(--red); font-size: 14px; margin-top: 10px; }
.nav-row { display: flex; gap: 10px; margin-top: 16px; }
.nav-row button { flex: 1; }
.nav-row .secondary-btn { flex: 0 0 34%; }

/* 首页 */
.greeting { font-size: 20px; font-weight: 700; margin: 6px 0 2px; }
.date-line { color: var(--muted); font-size: 13px; }
.stat-row { display: flex; gap: 10px; }
.stat-box { flex: 1; text-align: center; padding: 14px 6px; }
.stat-num { font-size: 26px; font-weight: 700; color: var(--primary); display: block; line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--muted); }
.badge { font-size: 12px; padding: 2px 10px; border-radius: 20px; float: right; }
.badge.done { background: #e3f6ef; color: var(--green); }
.badge.doing { background: #fff2e3; color: var(--orange); }
.today-desc { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.result-line { margin-top: 12px; padding: 10px; background: #f7f9fd; border-radius: 8px; font-size: 14px; }

/* 做题页 */
.phase-tabs { display: flex; gap: 6px; }
.phase-tab {
    flex: 1; text-align: center; padding: 8px 0; font-size: 13px;
    background: #eef2fb; color: var(--muted); border-radius: 8px;
}
.phase-tab.active { background: var(--primary); color: #fff; font-weight: 600; }
.study-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.study-head .phase-tabs { flex: 1; }
.timer { font-size: 13px; color: var(--muted); white-space: nowrap; }
.passage { font-size: 15px; line-height: 2; color: var(--text); margin-top: 8px; }
.hl-word {
    color: var(--orange); border-bottom: 1px dashed var(--orange);
    cursor: pointer; font-weight: 600;
}
.line-text { white-space: pre-wrap; }
.trans-toggle {
    margin-top: 12px; padding: 9px; text-align: center; font-size: 13px;
    color: var(--primary); background: #f2f5fd; border-radius: 8px; cursor: pointer;
}
.trans-box {
    margin-top: 10px; padding: 12px; background: #fffaf0;
    border-radius: 8px; border: 1px solid #f6e7c8;
}
.trans-label { display: block; font-size: 12px; color: var(--orange); font-weight: 600; margin-bottom: 6px; }
.trans-text { font-size: 14px; line-height: 1.9; color: #5a5040; }
.passage-hint { margin-top: 10px; font-size: 12px; color: var(--muted); }
.q-head { display: flex; gap: 8px; align-items: flex-start; }
.q-num {
    flex: 0 0 24px; height: 24px; line-height: 24px; text-align: center;
    background: var(--primary); color: #fff; border-radius: 6px; font-size: 13px;
}
.q-text { font-weight: 600; font-size: 15px; flex: 1; }
.options { margin-top: 10px; }
.option {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer;
}
.option.selected { border-color: var(--primary); background: #f2f5fd; }
.option.is-right { border-color: var(--green); background: #eaf8f2; }
.option.is-wrong { border-color: var(--red); background: #fdeeee; }
.option-letter {
    flex: 0 0 26px; height: 26px; line-height: 26px; text-align: center;
    background: #eef2fb; color: var(--primary); border-radius: 6px; font-weight: 600;
}
.option.selected .option-letter { background: var(--primary); color: #fff; }
.option.is-right .option-letter { background: var(--green); color: #fff; }
.option.is-wrong .option-letter { background: var(--red); color: #fff; }
.option-text { flex: 1; font-size: 14px; }
.opt-mark { font-weight: 700; }
.opt-mark.right { color: var(--green); }
.opt-mark.wrong { color: var(--red); }
.feedback { margin-top: 10px; padding: 12px; border-radius: 8px; border-left: 3px solid; }
.feedback.ok { background: #eaf8f2; border-color: var(--green); }
.feedback.no { background: #fdeeee; border-color: var(--red); }
.feedback-head { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.fb-icon { font-size: 16px; }
.fb-answer { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 13px; }
.fb-explain { display: block; margin-top: 6px; font-size: 13px; line-height: 1.7; color: #4a5058; }

/* 补全对话 */
.dialogue-situation { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.dialogue-body { margin-top: 8px; }
.dialogue-line { margin-bottom: 8px; font-size: 15px; line-height: 2; }
.speaker { color: var(--primary); font-weight: 600; }
.blank-mark { color: var(--orange); font-weight: 700; background: #fff5e8; padding: 0 4px; border-radius: 4px; }
.opt-pool-card { background: #f8faff; }
.opt-pool { display: grid; gap: 6px; }
.opt-pool-item { display: flex; gap: 8px; font-size: 14px; }
.opt-pool-letter { color: var(--primary); font-weight: 600; flex: 0 0 18px; }

/* 结果页 */
.score-hero { text-align: center; padding: 20px 12px; }
.score-num { font-size: 48px; font-weight: 800; color: var(--primary); line-height: 1; }
.score-sub { color: var(--muted); font-size: 14px; margin-top: 6px; }
.score-earn { color: var(--green); font-weight: 600; margin-top: 8px; font-size: 15px; }
.trans-group-title { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 4px; color: var(--primary); }
.trans-para { font-size: 13px; line-height: 1.9; color: #5a5040; }
.review-group-title { display: block; font-weight: 600; font-size: 15px; margin: 16px 0 8px; padding-left: 8px; border-left: 3px solid var(--primary); }
.review-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.review-item:last-child { border-bottom: 0; }
.answer-line { display: block; font-size: 13px; margin-top: 4px; }
.answer-line.right { color: var(--green); }
.answer-line.wrong { color: var(--red); }

/* 兑换/家长 */
.amount-box { text-align: center; padding: 16px; }
.amount-num { font-size: 36px; font-weight: 800; color: var(--primary); }
.field-label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
.input {
    width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 10px;
    font-size: 16px; background: #fff; color: var(--text);
}
.record { padding: 12px 0; border-bottom: 1px solid var(--border); }
.record:last-child { border-bottom: 0; }
.record-row { display: flex; justify-content: space-between; align-items: center; }
.record-title { font-weight: 600; }
.record-sub { font-size: 12px; color: var(--muted); }
.status-tag { font-size: 12px; padding: 2px 10px; border-radius: 20px; }
.status-pending { background: #fff2e3; color: var(--orange); }
.status-approved { background: #e3f6ef; color: var(--green); }
.status-rejected { background: #fdecec; color: var(--red); }
.actions { display: flex; gap: 8px; margin-top: 8px; }
.actions button { flex: 1; padding: 8px; font-size: 13px; }
.btn-approve { background: #e3f6ef; color: var(--green); }
.btn-reject { background: #fdecec; color: var(--red); }
.sub-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.sub-tab { flex: 1; padding: 9px; text-align: center; background: #eef2fb; color: var(--muted); border-radius: 8px; font-size: 14px; }
.sub-tab.active { background: var(--primary); color: #fff; font-weight: 600; }

.tabbar {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 560px; height: 58px;
    background: #fff; border-top: 1px solid var(--border);
    display: flex; z-index: 20;
    padding-bottom: env(safe-area-inset-bottom);
}
.tab-item { flex: 1; text-align: center; padding: 8px 0; color: var(--muted); }
.tab-item.active { color: var(--primary); }
.tab-icon { display: block; font-size: 20px; line-height: 1.2; }
.tab-label { font-size: 11px; }

.toast {
    position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
    background: rgba(30,34,40,.9); color: #fff; padding: 10px 18px;
    border-radius: 8px; font-size: 14px; z-index: 100; max-width: 86%; text-align: center;
}
@media (max-width: 360px) { .phase-tab { font-size: 12px; } }
