/* 学习页（背单词）—— 只做视觉层，DOM 契约与 JS 逻辑不变 */

.quiz-card { padding: 24px 18px 20px; }

/* ---------- 单词 ---------- */
.word {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.25;
    margin: 4px 0 10px;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    word-break: break-word;
}

.speak-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 auto 18px;
    padding: 8px 16px;
    min-height: 36px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--r-pill);
    background: var(--brand-soft);
    border: 1px solid var(--brand-border);
    color: var(--brand);
    box-shadow: none;
}

.speak-btn:hover {
    background: var(--brand-hover);
    color: var(--brand);
    box-shadow: none;
}

/* ---------- 选项 ---------- */
.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
}

.option {
    padding: 15px 16px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--r);
    background: var(--surface);
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all .18s var(--ease);
}

.option:hover {
    border-color: var(--brand);
    background: var(--brand-soft);
    transform: translateY(-1px);
}

.option.correct {
    border-color: var(--success);
    background: var(--success-soft);
    color: var(--success-text);
    font-weight: 600;
}

.option.wrong {
    border-color: var(--danger);
    background: var(--danger-soft);
    color: var(--danger-text);
}

/* ---------- 结果与错题信息 ---------- */
.result {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    min-height: 24px;
    color: var(--text-2);
}

.error-info {
    display: none;
    margin-top: 12px;
    padding: 14px 16px;
    background: var(--danger-soft);
    border: 1px solid var(--danger-border);
    border-radius: var(--r-sm);
    text-align: left;
    font-size: 14px;
    line-height: 1.6;
    color: var(--danger-text-2);
}

.error-info.show { display: block; }

/* ---------- 看词回想（recall） ---------- */
#recall-area {
    text-align: center;
}

.recall-word {
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -.02em;
    margin-bottom: 4px;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    word-break: break-word;
}

.recall-pron {
    font-size: 15px;
    color: var(--text-3);
    margin-bottom: 16px;
}

/* ⚠️ recall-buttons / recall-hint 由 JS 用 style.display 切换，
      因此容器保持 block，弹性布局放在按钮上 */
.recall-buttons button {
    display: block;
    width: 100%;
    margin: 8px 0;
    border-radius: var(--r);
}

.recall-buttons button:first-child {
    background: var(--success);
    box-shadow: 0 10px 22px -12px rgba(16, 185, 129, .6);
}

.recall-buttons button:first-child:hover { background: var(--success-strong); }

.recall-buttons button:not(:first-child):not(:last-child) {
    background: var(--surface-2);
    color: var(--text-2);
    border-color: var(--border);
    box-shadow: none;
}

.recall-buttons button:not(:first-child):not(:last-child):hover {
    background: var(--surface-3);
    color: var(--text);
}

.recall-buttons button:last-child {
    background: var(--danger);
    box-shadow: 0 10px 22px -12px rgba(239, 68, 68, .6);
}

.recall-buttons button:last-child:hover { background: var(--danger-strong); }

.recall-hint {
    margin-top: 16px;
    padding: 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
}

.recall-example {
    font-size: 15px;
    color: var(--text-2);
    font-style: italic;
    margin-bottom: 12px;
    line-height: 1.6;
}

.recall-hint button {
    margin: 4px;
    padding: 10px 18px;
    min-height: 42px;
    font-size: 14px;
}

.recall-hint button:first-child {
    background: var(--success);
    box-shadow: 0 8px 18px -10px rgba(16, 185, 129, .6);
}

.recall-hint button:last-child {
    background: var(--danger);
    box-shadow: 0 8px 18px -10px rgba(239, 68, 68, .6);
}

/* ---------- 自动评级条（P1） ---------- */
/* ⚠️ .rating-bar 由 JS 用 style.display 切换 → 容器保持 block，弹性布局放在 .rating-inner */
.rating-bar {
    margin-top: 14px;
}

.rating-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
}

.rating-note {
    font-size: 13px;
    color: var(--text-2);
}

.rating-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rating-btn {
    flex: 1 1 88px;
    min-height: 44px;
    padding: 8px 12px;
    font-size: 14px;
    background: var(--surface);
    color: var(--text-2);
    border-color: var(--brand-border-strong);
    box-shadow: none;
}

.rating-btn.on {
    background: var(--grad);
    color: var(--surface);          /* 品牌底上的白字，走变量不硬编码 */
    border-color: transparent;
}

.rating-btn.off {
    opacity: .45;
}

.rating-hint {
    margin: 0;
    font-size: 12px;
    color: var(--text-3);
}

/* ---------- 学习阶段进度提示（P1 修订） ---------- */
/* ⚠️ .stage-tip 由 JS 用 style.display 切换 → 这里保持 block，不设 flex / grid */
.stage-tip {
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .02em;
    color: var(--text-3);
    text-align: center;
}

/* ---------- 单词详情 ---------- */
.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
}

.btn-row button { flex: 1 1 140px; }

.word-line {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.02em;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 2px;
    word-break: break-word;
}

.pron-line {
    font-size: 15px;
    color: var(--text-3);
    margin-bottom: 14px;
}

.meanings-line {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 6px;
}

.meanings-line.extra {
    color: var(--brand);
    border-top: 1px dashed var(--border-strong);
    padding-top: 10px;
    margin-top: 10px;
    font-size: 15px;
}

.detail-example {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-3);
    font-style: italic;
    line-height: 1.6;
}

.deeper-btn {
    margin-top: 12px;
    padding: 9px 16px;
    min-height: 38px;
    font-size: 13px;
    background: var(--brand-soft);
    color: var(--brand);
    border: 1px solid var(--brand-border);
    box-shadow: none;
}

.deeper-btn:hover { background: var(--brand-hover); box-shadow: none; }

/* ---------- 造句 ---------- */
#sentence-area { text-align: center; }

.sentence-task {
    font-size: 16px;
    font-weight: 600;
    color: var(--brand);
    margin-bottom: 14px;
    line-height: 1.6;
}

#sentence-input {
    display: block;
    width: 100%;
    min-height: 96px;
    margin-bottom: 14px;
    resize: vertical;
    line-height: 1.6;
}

#submit-sentence { width: 100%; max-width: 240px; }

.sentence-result {
    margin-top: 14px;
    font-size: 15px;
    line-height: 1.8;
    text-align: left;
    min-height: 40px;
}

.sentence-result .pass { color: var(--success); font-weight: 600; }
.sentence-result .fail { color: var(--danger); font-weight: 600; }

#back-btn {
    margin-top: 12px;
}

/* ---------- 统计 ---------- */
.stats-area {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 18px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--sh-sm);
}

.stat-label {
    font-size: 12px;
    color: var(--text-3);
    font-weight: 500;
}

.stat-value {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -.02em;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- 完成态出口（TD-2 复习入口） ---------- */
.done-actions {
    margin-top: 14px;
    text-align: center;
}

.review-btn {
    padding: 13px 22px;
    font-size: 15px;
}

/* ---------- 移动端 ---------- */
@media (max-width: 600px) {
    .quiz-card { padding: 20px 14px 18px; }
    .word { font-size: 29px; }
    .recall-word { font-size: 32px; }
    .word-line { font-size: 24px; }
    .option { padding: 13px 14px; font-size: 15px; }
    .stats-area { gap: 8px; }
    .stat-value { font-size: 19px; }
    .btn-row button { flex: 1 1 100%; }
}

/* ---------- 复习模式横幅（reviewMode 时显示） ---------- */
/* ⚠️ 由 JS style.display 切换的容器：只做块级样式，不设 flex/grid */
.review-banner {
    padding: 12px 16px;
    background: var(--sun-tint);
    border: 2px dashed var(--sun);
    border-radius: var(--r);
    color: var(--sun-ink);
    font-weight: 800;
    font-size: 14px;
    text-align: center;
}
