/**
 * EnglishPro 练习页（听写 / 翻译 / 口语）— 简约布局
 * 需在 /css/common.css 之后引入。
 */

/* --- 页面骨架 --- */
body {
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    color: var(--text-main, var(--color-black));
}

.main-content {
    flex: 1;
    width: 100%;
    max-width: min(880px, 100%);
    margin: 0 auto;
    padding: clamp(72px, 12vw, 96px) clamp(16px, 4vw, 28px) clamp(40px, 8vw, 64px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    position: relative;
    z-index: 1;
    gap: 0;
}

.practice-header {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: clamp(16px, 3vw, 24px);
}

.header-title {
    font-size: clamp(1.25rem, 3.2vw, 1.65rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    text-align: center;
    color: var(--text-main, var(--color-black));
    margin: 0;
    line-height: 1.3;
}

/* --- 控制栏 --- */
.controls-row {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px 12px;
    margin-bottom: clamp(18px, 3vw, 28px);
}

.level-select-wrapper {
    position: relative;
}

select#level-select {
    appearance: none;
    -webkit-appearance: none;
    min-height: 44px;
    padding: 0 40px 0 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-color, #fff);
    color: var(--text-main);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.06));
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select#level-select:hover {
    border-color: rgba(116, 123, 255, 0.45);
}

select#level-select:focus {
    border-color: var(--accent, rgb(116, 123, 255));
    box-shadow: 0 0 0 3px rgba(116, 123, 255, 0.15);
}

select#level-select option {
    background: #fff;
    color: var(--text-main);
    font-size: 0.875rem;
}

.level-select-wrapper::after {
    content: "▾";
    font-size: 0.65rem;
    color: var(--text-muted, #6b7280);
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* 翻译页：ctrl-pill / ctrl-item */
.ctrl-pill,
.ctrl-item {
    min-height: 44px;
    padding: 0 16px;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-color, #fff);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ctrl-item:hover {
    border-color: rgba(116, 123, 255, 0.35);
}

select#level-select.ctrl-pill,
select#level-select.ctrl-item {
    padding-right: 40px;
    display: inline-block;
    vertical-align: middle;
}

#current-level-display {
    display: none;
    min-height: 44px;
    padding: 0 16px;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: #0369a1;
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.25);
    border-radius: 10px;
    box-shadow: none;
    line-height: 44px;
}

#daily-progress {
    min-height: 44px;
    padding: 0 16px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: #047857;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: none;
}

#daily-progress.ctrl-pill,
#daily-progress.ctrl-item {
    display: none;
}

.notebook-btn {
    cursor: pointer;
    gap: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
}

.practice-ref-row {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.notebook-btn:hover {
    border-color: rgba(116, 123, 255, 0.4);
    background: rgba(116, 123, 255, 0.04);
}

.level-display {
    background: var(--bg-color);
    color: var(--text-main);
    min-width: auto;
}

/* 中译英：当前级别用中性白底，与英译中区分开 */
#current-level-display.level-display {
    color: var(--text-main);
    background: var(--bg-color);
    border-color: var(--border-color);
}

.daily-progress.ctrl-item {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.35);
    color: #047857;
}

.daily-progress.ctrl-item:hover {
    border-color: rgba(16, 185, 129, 0.5);
}

/* --- 题目区 --- */
.source-card {
    position: relative;
    background: var(--bg-color, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--ep-r, 14px);
    padding: clamp(24px, 5vw, 40px);
    margin-bottom: 20px;
    text-align: center;
    width: 100%;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.en-text {
    font-size: clamp(1.15rem, 2.8vw, 1.45rem);
    color: var(--text-main);
    line-height: 1.55;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
    margin-bottom: 0;
    text-shadow: none;
}

.cn-text {
    font-size: clamp(1.1rem, 2.6vw, 1.35rem);
    color: var(--text-main);
    line-height: 1.65;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-shadow: none;
}

.interactive-word {
    cursor: pointer;
    border-bottom: 1px dotted rgba(0, 0, 0, 0.22);
    padding-bottom: 1px;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.interactive-word:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.notebook-highlight {
    color: var(--accent) !important;
    border-bottom: 2px solid rgba(116, 123, 255, 0.45) !important;
}

/* --- 输入 --- */
.input-wrapper {
    width: 100%;
    max-width: 100%;
    margin-bottom: 20px;
}

textarea {
    width: 100%;
    min-height: 160px;
    padding: clamp(16px, 3vw, 22px);
    background: var(--bg-color, #fff);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: clamp(1rem, 2.2vw, 1.125rem);
    color: var(--text-main);
    line-height: 1.55;
    resize: vertical;
    font-family: var(--font-body, inherit);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(116, 123, 255, 0.12);
}

textarea::placeholder {
    color: #9ca3af;
    font-size: 0.95em;
}

/* --- 操作按钮 --- */
.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    margin-top: 4px;
}

.btn {
    flex: 1;
    min-width: 120px;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.02em;
    border: 1px solid var(--border-color);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.btn-skip {
    background: var(--bg-color);
    color: var(--text-main);
}

.btn-skip:hover {
    background: var(--card-bg, #f3f4f6);
    border-color: #d1d5db;
}

.btn-submit {
    background: var(--accent);
    color: #fff;
    border-color: transparent;
}

.btn-submit:hover {
    filter: brightness(1.05);
}

.btn-next {
    background: #ecfdf5;
    color: #065f46;
    border-color: rgba(16, 185, 129, 0.35);
    display: none;
}

.btn-next:hover {
    background: #d1fae5;
}

.btn-local {
    background: rgba(116, 123, 255, 0.12);
    color: #3730a3;
    border-color: rgba(116, 123, 255, 0.35);
}

.btn-local:hover {
    background: rgba(116, 123, 255, 0.18);
}

.btn-error-analysis {
    display: none;
    flex: 1;
    background: #fff7ed;
    color: #9a3412;
    border-color: rgba(234, 88, 12, 0.35);
}

.btn-error-analysis:hover {
    background: #ffedd5;
}

/* --- Toast & 正解 --- */
.result-toast {
    position: fixed;
    top: 96px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 22px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9375rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, top 0.25s ease;
    z-index: 2000;
    box-shadow: var(--shadow-hard);
}

.result-toast.show {
    opacity: 1;
    top: 108px;
}

.result-toast.success {
    background: rgba(209, 250, 229, 0.98);
    color: #065f46;
}

.result-toast.error {
    background: rgba(254, 226, 226, 0.98);
    color: #991b1b;
}

.correct-answer-box {
    margin-top: 20px;
    padding: 18px 20px;
    width: 100%;
    background: var(--card-bg, #f9fafb);
    border-radius: 12px;
    text-align: center;
    border: 1px dashed var(--border-color);
    display: none;
    box-shadow: none;
}

/* --- 听写 --- */
.dictation-play-row {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 16px 20px;
    margin-bottom: 24px;
}

.speed-select-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.speed-select-wrap .speed-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

#speed-select {
    appearance: none;
    -webkit-appearance: none;
    min-height: 40px;
    padding: 0 32px 0 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-main);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    box-shadow: var(--shadow-sm);
}

#speed-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(116, 123, 255, 0.12);
}

.play-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(116, 123, 255, 0.15), rgba(116, 123, 255, 0.05));
    border: 1px solid rgba(116, 123, 255, 0.4);
    color: var(--text-main);
    font-size: 1.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.play-btn:hover {
    transform: scale(1.04);
    box-shadow: var(--shadow-hard-hover);
}

.play-btn:active {
    transform: scale(0.97);
}

.play-btn.playing {
    opacity: 0.75;
    pointer-events: none;
}

.hint-section {
    width: 100%;
    max-width: min(720px, 100%);
    margin: 0 auto 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.btn-show-hint {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
}

.btn-show-hint:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.dictation-page .cn-display {
    font-size: clamp(1rem, 2.4vw, 1.2rem);
    color: var(--text-muted);
    font-weight: 500;
    text-align: center;
    min-height: 1.25em;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.dictation-page .cn-display.visible {
    opacity: 1;
    transform: translateY(0);
}

.dictation-page .input-wrapper {
    max-width: min(720px, 100%);
    margin-left: auto;
    margin-right: auto;
}

/* --- 口语 --- */
.play-btn-lg {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(116, 123, 255, 0.2), rgba(116, 123, 255, 0.06));
    border: 1px solid rgba(116, 123, 255, 0.45);
    cursor: pointer;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.25;
    padding: 8px;
    text-align: center;
}

.play-btn-lg:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-hard-hover);
}

.play-btn-lg:active {
    transform: scale(0.97);
}

.question-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.question-revealed {
    opacity: 1 !important;
    font-size: clamp(1.1rem, 2.6vw, 1.35rem) !important;
    transition: opacity 0.4s ease;
}

.source-container {
    width: 100%;
    max-width: min(720px, 100%);
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    margin-bottom: 20px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.speaking-audio-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 16px 0 8px;
}

.tts-btn {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tts-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.mic-btn {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(116, 123, 255, 0.22), rgba(116, 123, 255, 0.06));
    border: 1px solid rgba(116, 123, 255, 0.45);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-sm);
    margin-bottom: 0 !important;
    position: relative;
}

.mic-btn:hover {
    transform: scale(1.03);
}

.mic-btn:active {
    transform: scale(0.96);
}

.mic-btn.listening {
    animation: ep-pulse-mic 1.4s ease-in-out infinite;
    background: linear-gradient(145deg, #fecaca, #fca5a5);
    border-color: rgba(220, 38, 38, 0.45);
}

@keyframes ep-pulse-mic {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35);
    }
    50% {
        box-shadow: 0 0 0 14px rgba(239, 68, 68, 0);
    }
}

.speaking-controls-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
    max-width: 520px;
    margin: 0 auto 18px;
    flex-wrap: wrap;
}

.speaking-controls-row .mic-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.btn-play-draft.speaking-side-hidden,
.btn-tencent-score.speaking-side-hidden {
    display: none !important;
}

.btn-play-draft {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(52, 199, 89, 0.25), rgba(52, 199, 89, 0.08));
    border: 1px solid rgba(22, 163, 74, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease;
    flex-shrink: 0;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-main);
    padding: 8px;
    text-align: center;
}

.btn-play-draft:hover:not(:disabled) {
    transform: scale(1.03);
}

.btn-play-draft:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-tencent-score {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    padding: 8px;
    background: var(--accent);
    color: #fff;
    border: 1px solid rgba(116, 123, 255, 0.5);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease;
    flex-shrink: 0;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.btn-tencent-score:hover:not(:disabled) {
    transform: scale(1.03);
    filter: brightness(1.06);
}

.btn-tencent-score:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.transcript-wrapper {
    width: 100%;
    max-width: min(720px, 100%);
    margin: 0 auto 20px;
    position: relative;
}

.transcript-box {
    width: 100%;
    padding: 18px 20px;
    font-size: clamp(1rem, 2.2vw, 1.15rem);
    background: var(--bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    visibility: hidden;
}

.transcript-box.recording {
    border-color: rgba(52, 199, 89, 0.55);
    box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.12);
    visibility: visible;
}

.transcript-box.has-text {
    visibility: visible;
}

.ref-btn {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ref-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
    z-index: 4000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.ref-modal-content {
    background: var(--bg-color);
    width: 90%;
    max-width: 560px;
    border-radius: 14px;
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.96);
    transition: transform 0.25s ease;
}

.modal-overlay.show .ref-modal-content {
    transform: scale(1);
}

.ref-item {
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
}

.ref-item:last-child {
    border-bottom: none;
}

.ref-en {
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 6px;
    line-height: 1.5;
}

.ref-cn {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.speaking-page .score-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 14px 0;
}

.speaking-page .score-item {
    background: var(--card-bg, #f9fafb);
    padding: 10px 12px;
    border-radius: 10px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.speaking-page .score-item .score-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 600;
}

.speaking-page .score-item .score-val {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-main);
    float: right;
}

.speaking-page .score-denom {
    font-size: 1.125rem;
    color: var(--text-muted);
    font-weight: 600;
}

.speaking-page .score-meta-footer {
    text-align: right;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 8px;
    font-weight: 500;
}

.speaking-page .score-bar {
    height: 4px;
    background: rgba(0, 0, 0, 0.06);
    margin-top: 6px;
    border-radius: 2px;
    overflow: hidden;
}

.speaking-page .score-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 1s ease-out;
}

.speaking-page .ai-comment {
    text-align: left;
    margin-top: 14px;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--text-main);
    font-weight: 500;
    padding: 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.speaking-page .ai-suggestions {
    text-align: left;
    margin-top: 10px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
    padding: 12px;
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    background: var(--bg-color);
}

.speaking-page .level-badge {
    justify-content: center;
    align-items: center;
    font-size: 0.9375rem;
    color: var(--text-main);
    font-weight: 500;
    background: var(--bg-color);
    padding: 0 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    min-height: 44px;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

/* --- 翻译：错题分析 & 评分 --- */
.error-analysis-box {
    margin-top: 20px;
    padding: 20px 22px;
    width: 100%;
    background: var(--bg-color);
    border-radius: 12px;
    text-align: left;
    border: 1px solid var(--border-color);
    display: none;
    box-shadow: var(--shadow-sm);
}

.error-analysis-box .ea-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #c2410c;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-analysis-box .ea-section {
    margin-bottom: 14px;
    padding: 12px 14px;
    background: var(--card-bg, #f9fafb);
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

.error-analysis-box .ea-section:last-child {
    margin-bottom: 0;
}

.error-analysis-box .ea-section-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 6px;
}

.error-analysis-box .ea-section-content {
    font-size: 0.9375rem;
    color: #374151;
    line-height: 1.65;
}

.error-analysis-box .ea-section.answer-section {
    border-left-color: rgba(116, 123, 255, 0.55);
}

.error-analysis-box .ea-section.answer-section .ea-section-title {
    color: #4338ca;
}

.result-box {
    width: 100%;
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: clamp(20px, 4vw, 28px);
    box-shadow: var(--shadow-sm);
    text-align: center;
    color: var(--text-main);
}

.result-header {
    margin-bottom: 20px;
}

.total-score {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 700;
    color: var(--accent);
    line-height: 1.1;
    margin-bottom: 6px;
    text-shadow: none;
}

.result-header .score-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.score-grid-new {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 22px;
    width: 100%;
}

.score-card {
    background: var(--card-bg, #f9fafb);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: background 0.2s ease;
}

.score-card:hover {
    background: rgba(116, 123, 255, 0.06);
}

.score-card .sc-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.score-card .sc-val {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-main);
}

.comment-section {
    background: var(--card-bg, #f3f4f6);
    border-radius: 12px;
    padding: 18px 20px;
    text-align: left;
    border: 1px solid var(--border-color);
    width: 100%;
}

.ref-block {
    margin-bottom: 12px;
    font-size: 0.9375rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    line-height: 1.55;
}

.ref-block:last-of-type {
    border-bottom: none;
}

.ref-block .ref-heading {
    font-weight: 700;
    color: var(--text-main);
}

.ref-text-content {
    color: var(--text-main);
    font-size: 0.9375rem;
    font-weight: 500;
}

.comment-block {
    font-size: 0.9375rem;
    color: #374151;
    line-height: 1.65;
}

.comment-block .comment-heading {
    font-weight: 700;
    color: var(--text-main);
}

.teacher-comment-body {
    line-height: 1.65;
    color: #374151;
    font-size: 0.9375rem;
    font-weight: 500;
}

#ai-meta.ai-meta-line {
    text-align: right;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 8px;
    font-weight: 500;
}

.icon {
    margin-right: 8px;
    font-size: 1rem;
}

/* Quick score toggle */
.quick-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.quick-toggle input {
    display: none;
}

.toggle-slider {
    width: 38px;
    height: 22px;
    border-radius: 11px;
    background: #e5e7eb;
    position: relative;
    transition: background 0.25s ease;
}

.toggle-slider::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: left 0.25s ease;
}

.quick-toggle input:checked + .toggle-slider {
    background: var(--accent);
}

.quick-toggle input:checked + .toggle-slider::after {
    left: 19px;
}

.toggle-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.quick-toggle input:checked ~ .toggle-label {
    color: var(--accent);
}

/* Word popup */
.word-popup {
    position: absolute;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 18px;
    min-width: 200px;
    max-width: min(50vw, 360px);
    width: max-content;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    color: var(--text-main);
    display: none;
    text-align: left;
}

.word-popup h4 {
    margin: 0 0 8px 0;
    color: var(--accent);
    font-size: 1.25rem;
    font-weight: 600;
}

.word-popup .pos {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-style: italic;
}

.word-popup .def {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #374151;
}

.word-popup .status {
    font-size: 0.8125rem;
    color: #059669;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Notebook sidebar */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 1999;
    display: none;
    backdrop-filter: blur(4px);
}

.notebook-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: min(360px, 92vw);
    height: 100vh;
    background: var(--bg-color);
    z-index: 2000;
    padding: 20px;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.08);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.notebook-sidebar.open {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.notebook-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;
}

.word-card {
    background: var(--card-bg, #f9fafb);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    position: relative;
}

.word-card .head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.word-card .w {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
}

.word-card .p {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: ui-monospace, monospace;
    display: block;
    margin-bottom: 6px;
}

.word-card .d {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.45;
    margin-bottom: 10px;
}

.word-card .btn-remove {
    display: block;
    width: 100%;
    text-align: center;
    padding: 8px 0;
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8125rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.word-card .btn-remove:hover {
    background: rgba(239, 68, 68, 0.14);
}

/* 中译英：提示 */
.hint-btn {
    background: var(--bg-color);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.8125rem;
    cursor: pointer;
}

.hint-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.hint-card {
    width: 100%;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 18px;
    text-align: left;
    animation: ep-fade-in 0.3s ease-out;
    box-shadow: var(--shadow-sm);
}

@keyframes ep-fade-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- 响应式 --- */
@media (max-width: 600px) {
    .action-bar {
        flex-direction: column-reverse;
    }

    .action-bar .quick-toggle {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .controls-row {
        flex-direction: column;
        align-items: stretch;
    }

    .ctrl-pill,
    .ctrl-item {
        width: 100%;
    }

    select#level-select {
        width: 100%;
    }

    .score-grid-new {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .dictation-play-row {
        flex-direction: column;
    }

    .play-btn {
        width: 64px;
        height: 64px;
        font-size: 1.5rem;
    }

    .play-btn-lg {
        width: 88px;
        height: 88px;
        font-size: 0.85rem;
    }

    .mic-btn,
    .btn-play-draft,
    .btn-tencent-score {
        width: 76px;
        height: 76px;
        font-size: 0.8rem;
    }

    .speaking-controls-row {
        gap: 12px;
    }
}
