.topbar {
    height: 64px;
    padding: 0 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    color: #1d1d1f;
    text-decoration: none;
}

.brand-logo {
    width: 36px;
    height: 36px;
}

.brand .brand-wordmark {
    font-size: 23px;
    font-weight: 900;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    font-size: 14px;
    color: #6e6e73;
}

.topbar-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-profile-btn {
    min-height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #0071e3;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
}

.layout {
    --sidebar-width: 240px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 44px 24px 80px;
    display: grid;
    grid-template-columns: var(--sidebar-width) 12px minmax(0, 1fr);
    gap: 14px;
}

.sidebar {
    position: sticky;
    top: 88px;  /* 当元素距离屏幕顶部只剩 88px 时，开始固定住不动 */
    align-self: start; /* 如果不写的话，默认是stretch */
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(18px);
    border-radius: 28px;
    padding: 16px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.06);
}

.resize-handle {
    position: sticky;
    top: 88px;
    align-self: stretch;
    min-height: 220px;
    border-radius: 999px;
    cursor: col-resize;
    transition: background 0.2s ease;
}

.resize-handle::before {
    content: "";
    width: 4px;
    height: 72px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.12);
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    transition: background 0.2s ease, height 0.2s ease;
}

.resize-handle:hover::before,
body.is-resizing .resize-handle::before {
    /* 当 body 拥有 is-resizing 类时，
    修改 resize-handle 的 before。 */
    height: 96px;
    background: #0071e3;
}

body.is-resizing {
    cursor: col-resize;
    /* 不允许用户在选择内容 */
    user-select: none;
}

.side-title {
    font-size: 13px;
    color: #86868b;
    margin: 8px 12px 14px;
}

.side-nav-item {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 14px 14px;
    border-radius: 16px;
    color: #555;
    cursor: pointer;
    font-size: 15px;
    transition: 0.25s;
}

.side-nav-item:hover {
    background: #f5f5f7;
}

.side-nav-item.active {
    background: #1d1d1f;
    color: white;
    font-weight: 600;
}

.lesson-header {
    background: white;
    border-radius: 34px;
    padding: 44px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.07);
    margin-bottom: 24px;
}

.lesson-badge {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    background: #e8f0ff;
    color: #0066cc;
    font-size: 14px;
    margin-bottom: 18px;
}

h1 {
    font-size: 54px;
    line-height: 1.08;
    letter-spacing: -0.05em;
    margin-bottom: 18px;
}

.lesson-desc {
    color: #6e6e73;
    font-size: 19px;
    line-height: 1.7;
    max-width: 760px;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.meta {
    padding: 10px 14px;
    border-radius: 999px;
    background: #f5f5f7;
    color: #555;
    font-size: 14px;
}

.panel {
    display: none;
    background: white;
    border-radius: 34px;
    padding: 38px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.06);
    scroll-margin-top: 88px;
}

.panel.active {
    display: block;
}

.goal-content {
    background: white;
    border-radius: 34px;
    padding: 38px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.06);
}

.panel h2 {
    font-size: 34px;
    letter-spacing: -0.04em;
    margin-bottom: 14px;
}

.panel-tip {
    color: #86868b;
    line-height: 1.7;
    margin-bottom: 24px;
}

.study-card {
    background: #f5f5f7;
    border-radius: 24px;
    padding: 24px 26px;
    margin: 18px 0;
    line-height: 1.9;
    color: #333;
    font-size: 17px;
}

.admin-inline-editable {
    cursor: text;
    transition: background 0.2s ease, box-shadow 0.2s ease, outline-color 0.2s ease;
}

.admin-inline-editable:hover {
    outline: 2px solid rgba(0, 113, 227, 0.16);
    outline-offset: 3px;
    background: #f8fbff;
}

.admin-inline-editor {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(0, 113, 227, 0.26);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
    color: #111827;
    font: inherit;
    line-height: inherit;
    resize: vertical;
}

.expression-term-editable .admin-inline-editor {
    font-size: 20px;
    font-weight: 800;
}

.lesson-admin-savebar {
    position: sticky;
    top: 92px;
    z-index: 18;
    margin-bottom: 18px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid rgba(18, 67, 119, 0.14);
    border-radius: 18px;
    background: rgba(242, 248, 255, 0.92);
    box-shadow: 0 14px 34px rgba(18, 67, 119, 0.12);
    backdrop-filter: blur(12px);
}

.lesson-admin-savebar strong,
.lesson-admin-editor-head strong {
    display: block;
    color: #124377;
    font-size: 14px;
    font-weight: 800;
}

.lesson-admin-savebar span,
.lesson-admin-editor-head span {
    color: #51606f;
    font-size: 13px;
    line-height: 1.6;
}

.lesson-admin-savebar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.lesson-admin-primary-btn,
.lesson-admin-secondary-btn,
.lesson-admin-danger-btn {
    min-height: 40px;
    border: none;
    border-radius: 999px;
    padding: 0 16px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.lesson-admin-primary-btn {
    background: #124377;
    color: #fff;
}

.lesson-admin-primary-btn:disabled,
.lesson-admin-secondary-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.lesson-admin-secondary-btn {
    background: rgba(18, 67, 119, 0.1);
    color: #124377;
}

.lesson-admin-danger-btn {
    background: rgba(180, 35, 24, 0.12);
    color: #b42318;
}

.lesson-admin-phonetic-dialog {
    width: min(760px, 100%);
}

.lesson-admin-phonetic-warning-list {
    display: grid;
    gap: 14px;
}

.lesson-admin-phonetic-warning-item {
    border: 1px solid rgba(18, 67, 119, 0.12);
    border-radius: 18px;
    padding: 16px 18px;
    background: rgba(242, 248, 255, 0.72);
}

.lesson-admin-phonetic-warning-index {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(18, 67, 119, 0.1);
    color: #124377;
    font-size: 13px;
    font-weight: 800;
}

.lesson-admin-phonetic-warning-en,
.lesson-admin-phonetic-warning-missing {
    margin: 12px 0 0;
    color: #1f2933;
    line-height: 1.7;
}

.lesson-admin-phonetic-warning-en {
    font-weight: 700;
}

.lesson-admin-phonetic-warning-missing {
    color: #51606f;
}

.lesson-admin-phonetic-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.lesson-admin-editor {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid rgba(18, 67, 119, 0.14);
    border-radius: 22px;
    background: rgba(242, 248, 255, 0.78);
}

.lesson-admin-editor-head {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.lesson-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.lesson-admin-field {
    display: grid;
    gap: 8px;
}

.lesson-admin-field-full {
    grid-column: 1 / -1;
}

.lesson-admin-field span {
    color: #124377;
    font-size: 13px;
    font-weight: 700;
}

.lesson-admin-field input,
.lesson-admin-field textarea {
    width: 100%;
    border: 1px solid rgba(18, 67, 119, 0.16);
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.94);
    color: #1f2933;
    font: inherit;
    line-height: 1.6;
    resize: vertical;
}

.lesson-admin-field input:focus,
.lesson-admin-field textarea:focus {
    outline: 2px solid rgba(18, 67, 119, 0.14);
    border-color: rgba(18, 67, 119, 0.32);
}

.lesson-admin-sentence-list,
.lesson-admin-expression-list {
    display: grid;
    gap: 14px;
}

.lesson-admin-sentence-card,
.lesson-admin-expression-card {
    border-radius: 18px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(18, 67, 119, 0.1);
}

.lesson-admin-sentence-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: flex-start;
}

.lesson-admin-sentence-index,
.lesson-admin-expression-head strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    border-radius: 999px;
    background: rgba(18, 67, 119, 0.1);
    color: #124377;
    font-weight: 800;
}

.lesson-admin-sentence-fields {
    display: grid;
    gap: 12px;
}

.lesson-admin-expression-group + .lesson-admin-expression-group {
    margin-top: 22px;
}

.lesson-admin-expression-group-head,
.lesson-admin-expression-head {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.lesson-admin-expression-group-head h4 {
    color: #124377;
    font-size: 16px;
    font-weight: 800;
}

.lesson-admin-empty {
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.84);
    color: #5f6b76;
}

textarea {
    width: 100%;
    min-height: 160px;
    border: none;
    outline: none;  /* 取消获取焦点时的外轮廓线 */
    resize: vertical; /* 只能上下调整高度，不能左右拉宽 */
    border-radius: 22px;
    padding: 22px;
    background: #f5f5f7;
    font-size: 16px;
    line-height: 1.7;
    font-family: inherit;
    margin-top: 18px;
}

.media-box {
    height: 400px;
    border-radius: 28px;
    background: linear-gradient(135deg, #111827, #1e3a8a);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 22px 0;
    position: relative;
    overflow: hidden;
}

.video-box {
    background: #111827;
}

.lesson-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain; /* 图片不会变形、裁剪 */
}

.play-circle {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
}

.blank {
    display: inline-block;
    min-width: 130px;
    padding: 2px 0px;
    color: #0071e3;
    font-weight: 700;
}

.dictation-entry {
    min-height: 360px;
    border: 1px solid #edf0f4;
    border-radius: 28px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 28px;
}

.dictation-entry h3 {
    font-size: 30px;
    margin-bottom: 14px;
    letter-spacing: -0.02em;
}

.dictation-entry p {
    max-width: 620px;
    color: #6b7280;
    line-height: 1.8;
}

.dictation-stage {
    min-height: 560px;
    border: 1px solid #edf0f4;
    border-radius: 28px;
    background: #fff;
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.dictation-stage[hidden] {
    /* 如果元素带有hidden属性就隐藏起来 */
    display: none;
}

.dictation-stage.fullscreen {
    --dictation-progress-top: 88px;
    --dictation-progress-height: 9px;
    --dictation-answer-gap-from-progress: 8px;
    --dictation-answer-top: calc(var(--dictation-progress-top) + var(--dictation-progress-height) + var(--dictation-answer-gap-from-progress));
    --dictation-answer-side-gap: 40px;
    --dictation-answer-safe-space: clamp(132px, 20vh, 240px);
    --dictation-burst-top: clamp(148px, 24vh, 250px);
    position: fixed;
    /* inset: 0 的意思是 top: 0; right: 0; bottom: 0; left: 0; */
    inset: 0;  
    z-index: 999;
    width: 100vw; /* 100%视口宽度 */
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 78% 18%, rgba(0, 113, 227, 0.08), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #fbfbfd 100%);
    color: #1d1d1f;
    border: none;
    border-radius: 0;
    box-shadow: none;
    grid-template-rows: 70px 92px minmax(0, 1fr) auto;
    isolation: isolate;
}

body.dictation-open {
    --dictation-progress-top: 88px;
    --dictation-progress-height: 9px;
    --dictation-answer-gap-from-progress: 8px;
    --dictation-answer-top: calc(var(--dictation-progress-top) + var(--dictation-progress-height) + var(--dictation-answer-gap-from-progress));
    --dictation-answer-side-gap: 40px;
    --dictation-answer-safe-space: clamp(132px, 20vh, 240px);
    --dictation-burst-top: clamp(148px, 24vh, 250px);
    overflow: hidden;
}

.lesson-title {
    display: flex;
    align-items: center;
    padding: 24px 28px 0;
}

.dictation-stage.fullscreen .lesson-title {
    gap: 10px;
    padding: 18px 84px 0 28px;
    color: #1d1d1f;
    font-weight: 800;
}

.dictation-stage.fullscreen .lesson-days {
    padding: 7px 11px;
    border-radius: 999px;
    background: #e8f0ff;
    color: #0066cc;
    font-size: 13px;
}

.dictation-stage.fullscreen .lesson-name {
    font-size: 18px;
}

.dictation-stage.fullscreen .lesson-title span:last-child {
    color: #6e6e73;
    font-size: 14px;
    font-weight: 700;
}

.dictation-progress {
    height: 8px;
    background: #edf0f4;
}

.dictation-stage.fullscreen .dictation-progress {
    position: absolute;
    top: 88px;
    left: 28px;
    right: 28px;
    height: 7px;
    background: #e5e7eb;
    border: 1px solid #d2d7df;
    border-radius: 999px;
}

.dictation-progress span {
    display: block;
    width: 25%;
    height: 100%;
    border-radius: 999px;
    background: #11b981;
    transition: width 0.25s ease;
}

.dictation-stage.fullscreen .dictation-progress span {
    background: linear-gradient(90deg, #0071e3, #a855f7);
}

.dictation-topbar {
    padding: 24px 28px 0;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    color: #7b8494;
}

.dictation-stage.fullscreen .dictation-topbar {
    position: relative;
    z-index: 80;
    margin-top: 0;
    padding: 24px 28px 0;
    grid-template-columns: 1fr auto;
    column-gap: 20px;
    color: #8e8e93;
}

.dictation-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 800;
}

.dictation-stage.fullscreen .dictation-stat {
    color: #8e8e93;
}

.stat-icon {
    font-size: 28px;
    line-height: 1;
    transform: translateY(-2px);
}

.dictation-tools {
    justify-self: end;
    display: flex;
    gap: 8px;
    padding: 8px;
    border: 1px solid #edf0f4;
    border-radius: 22px;
    box-shadow: 0 18px 50px rgba(17, 24, 39, 0.08);
    transform: translateY(4px);
}

.dictation-stage.fullscreen .dictation-tools {
    position: fixed;
    top: 106px;
    right: 28px;
    z-index: 20;
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(0, 0, 0, 0.07);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(18px);
    /* 出现小手、触摸权限交给js、拖拽时不能选择文字 */
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.dictation-stage.fullscreen #speakSentenceBtn {
    display: inline-flex;
}

.dictation-stage.fullscreen .dictation-tools.is-floating {
    right: auto;
}

.dictation-stage.fullscreen .dictation-tools.is-dragging {
    cursor: grabbing;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.14);
}

.dictation-stage.fullscreen .dictation-tools button,
.dictation-stage.fullscreen .dictation-tools select {
    cursor: pointer;
}

.speed-control {
    height: 42px;
    border-radius: 16px;
    background: #f5f5f7;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 800;
}

.dictation-stage.fullscreen .speed-control {
    background: #f5f5f7;
    color: #6e6e73;
}

.speed-control select {
    border: none;
    outline: none;
    background: transparent;
    color: #111827;
    cursor: pointer;
    font: inherit;
}

.dictation-stage.fullscreen .speed-control select {
    color: #1d1d1f;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 16px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: medium;
    line-height: 1;
    padding: 0;
}

.dictation-stage.fullscreen .icon-btn {
    color: #6e6e73;
}

.dictation-stage.fullscreen #speakSentenceBtn {
    padding-left: 2px;
}

.icon-btn:hover,
.icon-btn.active {
    background: #f5f5f7;
    color: #a855f7;
}

.dictation-stage.fullscreen .icon-btn:hover,
.dictation-stage.fullscreen .icon-btn.active {
    background: #f5f5f7;
    color: #0071e3;
}

.dictation-close {
    position: absolute;
    top: 18px;
    right: 20px;
    z-index: 8;
    background: #f5f5f7;
}

.dictation-stage.fullscreen .dictation-close {
    top: 18px;
    right: 24px;
    background: rgba(245, 245, 247, 0.9);
    backdrop-filter: blur(14px);
}

.dictation-main {
    min-height: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 42px 24px;
    margin-top: 20px;
    position: relative;
    z-index: 30;
}

.dictation-stage.fullscreen .dictation-main {
    min-height: 0;
    margin-top: 0;
    padding: clamp(28px, 5vh, 56px) 7vw clamp(28px, 5vh, 56px);
    justify-content: center;
    overflow-y: auto;
    gap: clamp(18px, 3vh, 32px);
}

.dictation-stage.fullscreen.is-reviewing .dictation-main {
    padding: clamp(28px, 5vh, 56px) 7vw clamp(28px, 5vh, 56px);
    justify-content: stretch;
}

.dictation-zh {
    color: #111827;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 30px;
}

.dictation-stage.fullscreen .dictation-zh {
    display: none;
}

.word-line {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: end;
    flex-wrap: wrap;
    gap: 14px;
}

.dictation-stage.fullscreen .word-line {
    max-width: 1120px;
    gap: 14px;
    margin-block: auto;
}

.word-line.is-reviewing {
    align-items: center;
}

.dictation-stage.fullscreen .word-line.is-reviewing {
    max-width: 1140px;
    flex: 1 1 auto;
    width: min(100%, 1140px);
    margin-block: 0;
    align-content: center;
    justify-content: center;
    align-items: center;
}

.word-slot {
    /* em是以当前元素的字体大小作为基准 */
    --word-font-size: clamp(24px, 4.5vw, 52px);
    font-size: var(--word-font-size);
    width: clamp(54px, calc(var(--letters) * 0.78em + 20px), 420px);
    min-height: 78px;
}

.dictation-stage.fullscreen .word-slot {
    --word-font-size: clamp(34px, 3.8vw, 56px);
    width: clamp(64px, calc(var(--letters) * 0.58em + 26px), 380px);
}

.word-input {
    width: 100%;
    border: none;
    border-bottom: 3px solid #d8dde6;
    outline: none;
    padding-bottom: 5px;
    background: transparent;
    color: #a0a5ae;
    caret-color: transparent;
    font-size: inherit;
    font-weight: 800;
    text-align: center;
}

.fixed-word-slot {
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
}

.fixed-word {
    width: 100%;
    border-bottom: 3px solid transparent;
    padding-bottom: 5px;
    color: #111827;
    font-size: inherit;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
}

.dictation-stage.fullscreen .fixed-word {
    color: #111827;
    font-weight: 700;
}

.dictation-stage.fullscreen .word-input {
    border-bottom-color: #d1d5db;
    color: #79797e;
    font-weight: 600;
}

.word-input.wrong, 
.dictation-stage.fullscreen .word-input.wrong {
    border-color: #ec4444;
    color: #ec4444;
}

.dictation-stage.fullscreen .word-input:focus,
.dictation-stage.fullscreen .word-input.focused {
    border-color: #0071e3;
    color: #0071e3;
}

.dictation-stage.fullscreen .word-input.locked,
.dictation-stage.fullscreen .word-input.locked:focus,
.dictation-stage.fullscreen .word-input.locked.focused {
    border-color: #d1d5db;
    color: #79797e;
}

.dictation-stage.fullscreen .word-input.wrong:focus,
.dictation-stage.fullscreen .word-input.wrong.focused {
    border-color: #0071e3;
    color: #0071e3;
}

.word-input.wrong.corrected:focus,
.word-input.wrong.corrected.focused,
.dictation-stage.fullscreen .word-input.wrong.corrected.focused,
.dictation-stage.fullscreen .word-input.wrong.corrected:focus {
    border-color: #0071e3;
    color: #0071e3;
}

.word-input.wrong.corrected,
.dictation-stage.fullscreen .word-input.wrong.corrected {
    border-color: #ae47fdf9;
    color: #ae47fdf9;
}

.word-input.shake {
    animation: wrongShake 0.34s ease both;
}

.word-input.revealed {
    border-color: #a855f7;
    color: #a855f7;
}

.dictation-stage.fullscreen .word-input.revealed {
    color: #a855f7;
    border-color: #a855f7;
}

@keyframes wrongShake {
    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(7px);
    }

    60% {
        transform: translateX(-5px);
    }

    80% {
        transform: translateX(4px);
    }
}

.answer-card {
    position: fixed;
    top: 110px;
    left: 50%;
    z-index: 120;
    min-width: 280px;
    max-width: calc(100vw - 80px);
    max-height: calc(100vh - 150px);
    max-height: calc(100dvh - 150px);
    padding: 14px 18px;
    border: 1px solid #d4dbe7;
    border-radius: 22px;
    background: #f8fbff;
    box-shadow: 0 18px 48px rgba(17, 24, 39, 0.08);
    transform: translateX(-50%);
    display: grid;
    justify-items: center;
    align-content: start;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.answer-card[hidden] {
    display: none;
}

.answer-card.floating-answer-card {
    top: var(--dictation-answer-top);
    background: rgba(248, 251, 255, 0.92);
    border-color: #cbd5e1;
    z-index: 2147483647;
    width: max-content;
    max-width: 1200px;
    max-height: none;
    overflow-y: visible;
    box-shadow: 0 22px 60px rgba(17, 24, 39, 0.14);
    backdrop-filter: blur(18px);
}

.dictation-stage.fullscreen .answer-card {
    top: var(--dictation-answer-top);
    background: rgba(248, 251, 255, 0.92);
    border-color: #cbd5e1;
    z-index: 120;
    width: max-content;
    max-width: 1200px;
    max-height: none;
    overflow-y: visible;
    box-shadow: 0 22px 60px rgba(17, 24, 39, 0.14);
    backdrop-filter: blur(18px);
}

.answer-card-words {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: end;
    flex-wrap: wrap;
    gap: 7px;
    align-content: flex-start;
}

.answer-word {
    min-width: 0;
    display: grid;
    gap: 5px;
    justify-items: center;
    margin-block: 5px;
}

.answer-phonetic-row {
    display: flex;
    justify-content: center;
    align-items: end;
    gap: 0px;
    flex-wrap: nowrap;
}

.answer-token-row {
    gap: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    padding: 5px 7px;
    border-radius: 10px;
    background: #2563eb;
    box-shadow: inset 0 -4px 0 rgba(168, 85, 247, 0.45);
}

.answer-phonetic,
.answer-meaning {
    padding: 2px 6px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #64748b;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
}

.answer-token {
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    box-shadow: none;
}

.dictation-review-card {
    width: min(100%, 1120px);
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto;
    gap: 50px;
    justify-items: center;
}

.review-card-words {
    align-self: center;
    gap: 9px;
    align-items: end;
}

.review-word .answer-phonetic,
.review-word .answer-meaning {
    padding: 2px 6px;
    font-size: 13px;
    font-weight: 600;
}

.review-word .answer-token {
    padding: 4px 4px;
    border-radius: 9px;
    font-size: 33px;
    font-weight: 700;
    background: #2563eb;
    box-shadow: inset 0 -4px 0 rgba(168, 85, 247, 0.45);
}

.review-sentence-zh {
    max-width: min(100%, 680px);
    color: #1d1d1f;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0;
}

.dictation-stage.fullscreen .review-sentence-zh {
    color: #1d1d1f;
}

.perfect-burst {
    pointer-events: none;  /* 鼠标点击穿透，图标不会挡住下边按钮 */
    opacity: 0;  /* 透明 */
    transform: translate(-50%, 16px) scale(0.9);  /* 缩小0.9倍，并向下16px */
    width: max-content;
    white-space: nowrap;
    color: #a855f7;
    font-size: clamp(42px, 8vw, 92px);
    font-weight: 950;
    letter-spacing: 0.02em;
    text-shadow: 0 18px 45px rgba(168, 85, 247, 0.28);
}

.floating-qualification-burst {
    position: fixed;
    top: var(--dictation-burst-top, clamp(148px, 24vh, 250px));
    left: 50%;
    z-index: 2147483647;
}

body.dictation-open .perfect-burst,
.dictation-stage.fullscreen .perfect-burst {
    color: #0071e3;
    text-shadow: 0 20px 55px rgba(0, 113, 227, 0.22);
}

body.dictation-open .perfect-burst.is-perfect,
.dictation-stage.fullscreen .perfect-burst.is-perfect {
    color: #ff8401;
    text-shadow: 0 20px 55px rgba(245, 194, 66, 0.32);
}

body.dictation-open .perfect-burst.is-great,
.dictation-stage.fullscreen .perfect-burst.is-great {
    color: #0071e3;
    text-shadow: 0 20px 55px rgba(0, 113, 227, 0.22);
}

.perfect-burst.show {
    /* both保留动画前后状态，更丝滑 */
    animation: perfectPop 0.9s ease both;
}

@keyframes perfectPop {
    0% {
        opacity: 0;
        transform: translate(-50%, 20px) scale(0.82);
    }

    24% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1.08);
    }

    70% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -18px) scale(0.96);
    }
}

.dictation-footer {
    position: relative;
    z-index: 7;
    padding: 0 28px 26px;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 56px;
    align-items: center;
    gap: 18px;
}

.dictation-stage.fullscreen .dictation-footer {
    padding: 0 8vw 30px;
    grid-template-columns: 56px minmax(0, 1fr) 56px;
}

.dictation-stage.fullscreen .dictation-footer .dictation-actions {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
}

#nextSentenceBtn {
    grid-column: 3;
    justify-self: end;
}

.arrow-btn {
    width: 56px;
    height: 56px;
    border: none;
    background: transparent;
    color: #425066;
    cursor: pointer;
    font-size: 58px;
    line-height: 0.7;
}

.dictation-stage.fullscreen .arrow-btn {
    color: #6e6e73;
    font-size: 54px;
}

.arrow-btn:disabled {
    /* 被禁用，鼠标变成禁止符号 */
    opacity: 0.28;
    cursor: not-allowed;
}

.dictation-actions {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 0;
}

.dictation-stage.fullscreen .dictation-actions {
    position: static;
    left: auto;
    bottom: auto;
    z-index: auto;
    transform: none;
    gap: 28px;
    align-items: center;
    flex-wrap: nowrap;
}

.mini-action {
    border: 1px solid #d8dde6;
    border-radius: 14px;
    background: white;
    color: #425066;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 800;
}

.dictation-stage.fullscreen .mini-action {
    border: none;
    background: transparent;
    color: #424245;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border-radius: 14px;
    transition: color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.shortcut {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.shortcut kbd {
    min-width: 42px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #1d1d1f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: 800 14px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), inset 0 -1px 0 rgba(0, 0, 0, 0.04);
}

.mini-action.primary {
    background: #111827;
    border-color: #111827;
    color: white;
}

.dictation-stage.fullscreen .mini-action.primary {
    background: transparent;
    border-color: transparent;
    color: #0071e3;
}

.mini-action:hover {
    transform: translateY(-1px);
}

.dictation-stage.fullscreen .mini-action:hover {
    color: #0071e3;
}

.dictation-stage.fullscreen .mini-action.active,
.dictation-stage.fullscreen .mini-action.is-pressed,
.dictation-stage.fullscreen .mini-action:focus-visible {
    color: #0071e3;
    background: rgba(0, 113, 227, 0.08);
    box-shadow: inset 0 0 0 1px rgba(0, 113, 227, 0.12);
}

.dictation-stage.fullscreen .mini-action.active .shortcut kbd,
.dictation-stage.fullscreen .mini-action.is-pressed .shortcut kbd,
.dictation-stage.fullscreen .mini-action:focus-visible .shortcut kbd {
    border-color: rgba(0, 113, 227, 0.2);
    background: rgba(255, 255, 255, 0.94);
}

.ai-feedback {
    margin-top: 18px;
}

.ai-feedback:empty {
    display: none;
}

.feedback-card {
    background: #f5f5f7;
    border-radius: 24px;
    padding: 24px 26px;
    color: #333;
    line-height: 1.8;
}

.feedback-card h3 {
    font-size: 22px;
    margin-bottom: 10px;
}

.feedback-card h4 {
    margin: 18px 0 8px;
}

.feedback-card ul {
    padding-left: 20px;
}

.feedback-score-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0 8px;
}

.feedback-score-item {
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
}

.feedback-score-item span,
.feedback-score-item small {
    display: block;
    color: #667085;
    font-size: 13px;
    line-height: 1.4;
}

.feedback-score-item strong {
    display: inline-block;
    margin-top: 4px;
    color: #1d1d1f;
    font-size: 24px;
    line-height: 1;
}

.feedback-score-item.is-missing strong,
.feedback-score-item.is-missing small {
    color: #98a2b3;
}

.feedback-mistakes {
    display: grid;
    gap: 10px;
}

.feedback-mistake {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
}

.feedback-mistake p {
    margin: 0;
}

.feedback-mistake p + p {
    margin-top: 6px;
}

.feedback-muted {
    margin: 0;
    color: #667085;
}

.feedback-error {
    padding: 18px 20px;
    border-radius: 20px;
    background: #fff2f2;
    color: #b42318;
    line-height: 1.7;
}

.btn-row {
    display: flex;
    gap: 12px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.btn {
    border: none;
    border-radius: 999px;
    padding: 13px 22px;
    cursor: pointer;
    font-size: 15px;
    transition: 0.25s;
}

.btn-primary {
    display: block;
    margin: 0 auto;
    background: #0071e3;
    color: white;
}

.translation-grade-quota {
    margin: 10px 0 0;
    text-align: center;
    color: #667085;
    font-size: 13px;
    line-height: 1.5;
}

.btn-secondary {
    background: #f5f5f7;
    color: #0071e3;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.68;
    filter: saturate(0.72);
}

.btn:disabled:hover {
    transform: none;
}

.btn-primary:disabled {
    background: #98a2b3;
    color: rgba(255, 255, 255, 0.92);
}

.btn-primary.is-loading:disabled {
    cursor: progress;
    background: #5b8fd6;
}

.btn-primary.is-quota-empty:disabled:hover {
    background: #8b95a1;
}

.access-denied-actions {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.access-denied-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin: 0;
    text-decoration: none;
}

.compare-student-card {
    position: sticky;
    top: 82px;
    z-index: 12;
    margin: 22px 0 26px;
    padding: 22px;
    border: 1px solid #dbe7f5;
    border-radius: 8px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
}

.compare-student-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.compare-label,
.compare-tag {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
}

.compare-label {
    color: #111827;
    font-size: 22px;
    line-height: 1.2;
}

.compare-toggle {
    min-width: 64px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #0071e3;
    cursor: pointer;
    padding: 9px 14px;
    font-weight: 800;
}

.compare-toggle:hover {
    border-color: #0071e3;
    background: #f0f7ff;
}

.compare-student-body {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e5edf7;
}

.compare-student-text,
.compare-student-empty {
    margin: 0;
    color: #374151;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.8;
    white-space: pre-wrap;
}

.compare-student-empty {
    color: #8a94a6;
}

.compare-list {
    display: grid;
    gap: 14px;
}

.sentence-pair {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 16px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}

.sentence-index {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #eef5ff;
    color: #0071e3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
}

.sentence-content {
    min-width: 0;
}

.compare-tag {
    margin-bottom: 7px;
}

.compare-tag.native {
    margin-top: 16px;
    color: #0071e3;
}

.zh {
    color: #6e6e73;
    line-height: 1.75;
}

.en {
    color: #111827;
    font-size: 19px;
    font-weight: 750;
    line-height: 1.65;
}

.compare-admin-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

.compare-admin-btn {
    min-height: 34px;
    border: 1px solid rgba(18, 67, 119, 0.16);
    border-radius: 999px;
    background: #f8fbff;
    color: #124377;
    cursor: pointer;
    padding: 0 14px;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
}

.compare-admin-btn:hover {
    border-color: #0071e3;
    color: #0071e3;
}

.compare-admin-actions-hints {
    margin-top: 12px;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
}

.compare-hint-editor {
    margin-top: 14px;
    border: 1px solid rgba(18, 67, 119, 0.12);
    border-radius: 20px;
    padding: 18px;
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.96), rgba(242, 248, 255, 0.92));
}

.compare-hint-editor-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.compare-hint-editor-head strong {
    display: block;
    color: #124377;
    font-size: 15px;
    font-weight: 800;
}

.compare-hint-editor-head span {
    display: block;
    margin-top: 4px;
    color: #51606f;
    font-size: 13px;
    line-height: 1.6;
}

.compare-hint-editor-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.compare-hint-editor-tip {
    margin: 12px 0 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.7;
}

.compare-hint-editor-tip kbd {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border: 1px solid rgba(18, 67, 119, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    color: #124377;
    font-size: 12px;
    font-weight: 800;
}

.compare-hint-word-grid {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.compare-hint-word {
    min-height: 42px;
    border: 1px solid rgba(18, 67, 119, 0.12);
    border-radius: 14px;
    padding: 0 14px;
    background: #fff;
    color: #124377;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.compare-hint-word:hover {
    border-color: rgba(0, 113, 227, 0.38);
    transform: translateY(-1px);
}

.compare-hint-word.is-grouped {
    background: rgba(232, 240, 255, 0.72);
}

.compare-hint-word.is-selected {
    border-color: #0071e3;
    background: #124377;
    color: #fff;
}

.compare-hint-word-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: rgba(18, 67, 119, 0.1);
    color: inherit;
    font-size: 11px;
    font-weight: 900;
}

.compare-hint-word.is-selected .compare-hint-word-index {
    background: rgba(255, 255, 255, 0.16);
}

.compare-hint-group-list {
    margin-top: 18px;
    display: grid;
    gap: 12px;
}

.compare-hint-group-card {
    border: 1px solid rgba(18, 67, 119, 0.1);
    border-radius: 18px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.96);
}

.compare-hint-group-card.is-selected {
    border-color: rgba(0, 113, 227, 0.32);
    box-shadow: 0 10px 28px rgba(0, 113, 227, 0.08);
}

.compare-hint-group-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.compare-hint-group-head strong {
    display: block;
    color: #111827;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.5;
}

.compare-hint-group-head span {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
}

.compare-hint-group-field + .compare-hint-group-field {
    margin-top: 10px;
}

.compare-hint-group-field {
    display: grid;
    gap: 6px;
}

.compare-hint-group-field span {
    color: #124377;
    font-size: 12px;
    font-weight: 800;
}

.compare-hint-group-field input {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(18, 67, 119, 0.14);
    border-radius: 14px;
    padding: 10px 12px;
    background: #fff;
    color: #111827;
    font: inherit;
    font-size: 14px;
    line-height: 1.6;
}

.compare-hint-group-field input:focus {
    outline: 2px solid rgba(0, 113, 227, 0.14);
    border-color: rgba(0, 113, 227, 0.28);
}

.expression-section {
    margin-top: 24px;
}

.expression-section + .expression-section {
    margin-top: 34px;
}

.expression-section-title {
    margin: 0 0 14px;
    color: #111827;
    font-size: 20px;
    line-height: 1.3;
}

.expression-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 24px;
}

.expression-section .expression-grid {
    margin-top: 0;
}

.expression-card {
    position: relative;
    display: grid;
    gap: 18px;
    padding: 22px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.05);
}

.expression-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.expression-card.has-admin-tools .expression-card-head {
    padding-right: 40px;
}

.expression-card-head h3 {
    flex: 1;
    min-width: 0;
}

.expression-admin-corner-btn {
    position: absolute;
    top: -1px;
    right: -1px;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(180, 35, 24, 0.16);
    border-radius: 0 8px 0 14px;
    background: rgba(180, 35, 24, 0.08);
    color: #b42318;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font: inherit;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.expression-admin-corner-btn:hover {
    background: rgba(180, 35, 24, 0.14);
    color: #942018;
}

.expression-card-actions {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}

.expression-index {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #eef5ff;
    color: #0071e3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 900;
}

.expression-card h3 {
    color: #111827;
    font-size: 24px;
    line-height: 1.2;
}

.vocab-save-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    background: #fff;
    color: #0071e3;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0;
    font: inherit;
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
}

.expression-admin-icon-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #c8d7ea;
    border-radius: 50%;
    background: #fff;
    color: #124377;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font: inherit;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}

.expression-admin-icon-btn:hover {
    border-color: #0071e3;
    color: #0071e3;
    background: #f8fbff;
}

.expression-admin-icon-btn:disabled {
    opacity: 0.58;
    cursor: wait;
}

.expression-admin-icon-btn.is-loading {
    animation: expression-admin-spin 1s linear infinite;
}

@keyframes expression-admin-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.vocab-save-btn:hover {
    border-color: #0071e3;
    background: #f0f7ff;
}

.vocab-save-btn:hover::after,
.vocab-save-btn:focus-visible::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 50%;
    bottom: calc(100% + 8px);
    z-index: 5;
    transform: translateX(50%);
    width: max-content;
    max-width: 160px;
    padding: 6px 9px;
    border-radius: 8px;
    background: rgba(17, 24, 39, 0.92);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
    pointer-events: none;
}

.vocab-save-btn.is-saved {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #15803d;
}

.vocab-save-btn.is-saved:hover {
    border-color: #86efac;
    background: #dcfce7;
}

.expression-details {
    display: grid;
    gap: 12px;
}

.expression-details div {
    padding: 12px 14px;
    border-radius: 8px;
    background: #f8fafc;
}

.expression-details dt {
    margin-bottom: 6px;
    color: #0071e3;
    font-size: 12px;
    font-weight: 900;
}

.expression-details dd {
    margin: 0;
    color: #6e6e73;
    line-height: 1.65;
    font-size: 15px;
}

.example {
    color: #111827 !important;
    font-weight: 600;
}

.expression-card.needs-generation {
    border-color: rgba(180, 83, 9, 0.35);
    background: #fffaf2;
}

.expression-admin-error {
    margin: -4px 0 0;
    color: #dc2626;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
}

.expression-add-card {
    min-height: 190px;
    display: grid;
    place-items: center;
    gap: 10px;
    border: 1px dashed #9db9d9;
    border-radius: 8px;
    background: #f8fbff;
    color: #124377;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.expression-add-card:hover {
    border-color: #0071e3;
    background: #eef5ff;
}

.expression-add-card span {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    color: #0071e3;
    font-size: 28px;
    line-height: 1;
}

.shadowing-list {
    display: grid;
    gap: 14px;
    margin-top: 24px;
}

.shadowing-admin-panel {
    margin-top: 18px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid rgba(18, 67, 119, 0.14);
    border-radius: 8px;
    background: rgba(242, 248, 255, 0.82);
}

.shadowing-admin-panel strong {
    display: block;
    color: #124377;
    font-size: 14px;
    font-weight: 800;
}

.shadowing-admin-panel span {
    color: #51606f;
    font-size: 13px;
    line-height: 1.6;
}

.shadowing-audio-debug {
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(18, 67, 119, 0.14);
    border-radius: 8px;
    background: #f8fbff;
}

.shadowing-audio-debug-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.shadowing-audio-debug-head strong {
    color: #124377;
    font-size: 14px;
    font-weight: 800;
}

.shadowing-audio-debug-clear {
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #35516e;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
}

.shadowing-audio-debug-status {
    margin-top: 10px;
    color: #35516e;
    font-size: 13px;
    line-height: 1.5;
}

.shadowing-audio-debug-log {
    margin: 10px 0 0;
    max-height: 240px;
    overflow: auto;
    padding: 12px;
    border-radius: 8px;
    background: #0f172a;
    color: #dbeafe;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.shadowing-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.05);
}

.shadowing-play-btn {
    width: 42px;
    height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    background: #f8fbff;
    color: #0071e3;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-left: 2px;
    font-weight: 900;
    line-height: 1;
}

.shadowing-play-btn:hover,
.shadowing-play-btn.is-playing {
    border-color: #0071e3;
    background: #eef5ff;
}

.shadowing-play-btn.is-playing {
    padding-left: 0;
}

.shadowing-sentence {
    color: #111827;
    font-size: 19px;
    font-weight: 750;
    line-height: 1.6;
}

.shadowing-phonetic {
    margin-top: 8px;
    color: #64748b;
    font-size: 18px;
    line-height: 1.7;
}

.shadowing-card.has-admin-tools {
    grid-template-columns: 48px minmax(0, 1fr) minmax(260px, 320px);
}

.shadowing-admin-tools {
    display: grid;
    gap: 10px;
    align-self: stretch;
    padding: 12px;
    border: 1px solid #dbe7f5;
    border-radius: 8px;
    background: #f8fbff;
}

.shadowing-admin-boundary {
    display: grid;
    grid-template-columns: minmax(90px, 1fr) 58px 58px;
    gap: 8px;
    align-items: center;
}

.shadowing-admin-boundary span {
    color: #425066;
    font-size: 13px;
    font-weight: 800;
}

.shadowing-admin-boundary strong {
    display: block;
    margin-top: 2px;
    color: #111827;
    font-size: 16px;
}

.shadowing-admin-tools button {
    min-height: 34px;
    border: 1px solid #c8d7ea;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
}

.shadowing-admin-tools button:hover {
    border-color: #0071e3;
    color: #0071e3;
}

.shadowing-admin-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.shadowing-admin-actions .shadowing-admin-save {
    border-color: #0071e3;
    background: #0071e3;
    color: #fff;
}

.shadowing-admin-actions .shadowing-admin-save:hover {
    color: #fff;
    box-shadow: 0 8px 18px rgba(0, 113, 227, 0.18);
}

.shadowing-admin-status {
    min-height: 18px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.5;
}

.shadowing-admin-status[data-tone="success"] {
    color: #15803d;
}

.shadowing-admin-status[data-tone="warning"] {
    color: #b45309;
}

.shadowing-admin-status[data-tone="error"] {
    color: #dc2626;
}

.checklist {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.review-audio-card {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1.15fr);
    gap: 24px;
    align-items: center;
    margin: 28px 0 30px;
    padding: 26px;
    border: 1px solid #dbe7f5;
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.07);
}

.review-audio-label {
    color: #0071e3;
    font-size: 12px;
    font-weight: 900;
}

.review-audio-card h3 {
    margin-top: 6px;
    color: #111827;
    font-size: 26px;
    line-height: 1.25;
}

.review-audio-copy p {
    max-width: 430px;
    margin-top: 10px;
    color: #64748b;
    font-size: 15px;
    line-height: 1.7;
}

.review-audio-player {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    width: 100%;
    padding: 18px;
    border-radius: 8px;
    background: #eef5ff;
}

.review-audio-play {
    width: 54px;
    height: 54px;
    border: none;
    border-radius: 50%;
    background: #0071e3;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-left: 3px;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 12px 26px rgba(0, 113, 227, 0.24);
}

.review-audio-play.is-playing {
    padding-left: 0;
}

.review-audio-track {
    min-width: 0;
}

.review-audio-time {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #425066;
    font-size: 14px;
    font-weight: 800;
}

.review-audio-track input[type="range"] {
    --progress: 0%;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    outline: none;
    appearance: none;
    background: linear-gradient(90deg, #0071e3 var(--progress), #d7e4f6 var(--progress));
    cursor: pointer;
}

.review-audio-track input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid #0071e3;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.review-audio-track input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid #0071e3;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.check-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
    border-radius: 20px;
    background: #f5f5f7;
    color: #333;
}

.bottom-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    gap: 16px;
}

.bottom-nav a,
.bottom-nav button {
    flex: 1;
    padding: 22px;
    border: none;
    border-radius: 24px;
    background: white;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.06);
    color: #0071e3;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    text-align: center;
}

@media (max-width: 900px) {
    body.dictation-open {
        --dictation-progress-top: 88px;
        --dictation-progress-height: 9px;
        --dictation-answer-gap-from-progress: 6px;
        --dictation-answer-top: calc(var(--dictation-progress-top) + var(--dictation-progress-height) + var(--dictation-answer-gap-from-progress));
        --dictation-answer-side-gap: 16px;
        --dictation-answer-safe-space: clamp(118px, 18vh, 190px);
        --dictation-burst-top: clamp(138px, 20vh, 210px);
    }

    .topbar {
        padding: 0 20px;
    }

    .layout {
        grid-template-columns: 1fr;
    }

    .resize-handle {
        display: none;
    }

    .sidebar {
        position: static;
        display: flex;
        overflow-x: auto;
        gap: 8px;
    }

    .side-title {
        display: none;
    }

    .side-nav-item {
        white-space: nowrap;
    }

    h1 {
        font-size: 40px;
    }

    .lesson-header,
    .panel {
        padding: 28px;
    }

    .feedback-score-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .expression-grid {
        grid-template-columns: 1fr;
    }

    .expression-card {
        padding: 18px;
    }

    .expression-card-head {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .expression-card-actions {
        width: auto;
        align-items: center;
        flex-direction: row;
        justify-content: flex-start;
    }

    .expression-card.has-admin-tools .expression-card-head {
        padding-right: 62px;
    }

    .expression-card h3 {
        font-size: 22px;
    }

    .shadowing-card {
        grid-template-columns: 1fr;
    }

    .shadowing-admin-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .shadowing-card.has-admin-tools {
        grid-template-columns: 1fr;
    }

    .shadowing-play-btn {
        width: 46px;
        height: 46px;
    }

    .shadowing-sentence {
        font-size: 17px;
    }

    .shadowing-phonetic {
        font-size: 14px;
    }

    .shadowing-admin-tools {
        width: 100%;
    }

    .lesson-admin-savebar,
    .lesson-admin-editor-head,
    .lesson-admin-expression-group-head,
    .lesson-admin-expression-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .lesson-admin-grid,
    .lesson-admin-sentence-card {
        grid-template-columns: 1fr;
    }

    .lesson-admin-savebar {
        top: 82px;
    }

    .review-audio-card {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .review-audio-player {
        grid-template-columns: 48px minmax(0, 1fr);
        gap: 12px;
        padding: 14px;
    }

    .review-audio-play {
        width: 46px;
        height: 46px;
    }

    .review-audio-card h3 {
        font-size: 22px;
    }

    .expression-details div {
        padding: 11px 12px;
    }

    .dictation-entry {
        padding: 30px 22px;
        min-height: 320px;
    }

    .dictation-entry h3 {
        font-size: 25px;
    }

    .dictation-stage {
        min-height: 520px;
        border-radius: 24px;
    }

    .dictation-stage.fullscreen {
        border-radius: 0;
        min-height: 100vh;
        min-height: 100dvh;
        grid-template-rows: 70px 112px minmax(0, 1fr) auto;
    }

    .dictation-stage.fullscreen .lesson-title {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 4px 10px;
        align-items: center;
        padding: 16px 70px 0 18px;
    }

    .dictation-stage.fullscreen .lesson-days {
        grid-row: span 2;
        padding: 7px 10px;
        font-size: 12px;
    }

    .dictation-stage.fullscreen .lesson-name {
        min-width: 0;
        font-size: 17px;
        line-height: 1.2;
    }

    .dictation-stage.fullscreen .lesson-title span:last-child {
        font-size: 12px;
        line-height: 1.2;
    }

    .dictation-stage.fullscreen .dictation-topbar {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        justify-items: stretch;
        align-items: center;
        padding: 42px 16px 12px;
    }

    .dictation-stage.fullscreen .dictation-stat {
        justify-self: start;
        font-size: 22px;
        gap: 6px;
    }

    .dictation-stage.fullscreen .stat-icon {
        font-size: 24px;
    }

    .dictation-tools {
        justify-self: center;
        flex-wrap: wrap;
        justify-content: center;
    }

    .dictation-stage.fullscreen .dictation-tools {
        position: static;
        justify-self: end;
        flex-wrap: nowrap;
        gap: 6px;
        padding: 6px;
        transform: none;
    }

    .dictation-stage.fullscreen .dictation-tools.is-floating {
        position: fixed;
        right: auto;
        z-index: 70;
    }

    .dictation-stage.fullscreen .icon-btn {
        width: 38px;
        height: 38px;
        border-radius: 14px;
    }

    .dictation-stage.fullscreen .speed-control {
        height: 38px;
        gap: 5px;
        padding: 0 8px;
        font-size: 12px;
    }

    .dictation-main {
        min-height: 300px;
        padding: 32px 16px;
    }

    .dictation-stage.fullscreen .dictation-main {
        padding: clamp(78px, 12vh, 132px) 18px 20px;
        justify-content: flex-start;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        gap: 0;
    }

    .dictation-stage.fullscreen {
        --dictation-progress-top: 88px;
        --dictation-progress-height: 9px;
        --dictation-answer-gap-from-progress: 6px;
        --dictation-answer-top: calc(var(--dictation-progress-top) + var(--dictation-progress-height) + var(--dictation-answer-gap-from-progress));
        --dictation-answer-side-gap: 16px;
        --dictation-answer-safe-space: clamp(118px, 18vh, 190px);
        --dictation-burst-top: clamp(138px, 20vh, 210px);
    }

    .dictation-stage.fullscreen.is-reviewing .dictation-main {
        padding: clamp(24px, 4vh, 40px) 16px 20px;
        justify-content: flex-start;
    }

    .dictation-stage.fullscreen .answer-card {
        top: var(--dictation-answer-top);
        max-width: calc(100vw - 32px);
        padding: 8px 10px;
        border-radius: 16px;
        z-index: 120;
        width: min(1120px, calc(100vw - (var(--dictation-answer-side-gap) * 2)));
        max-height: calc(100dvh - var(--dictation-answer-top) - 20px);
    }

    .answer-card.floating-answer-card {
        top: var(--dictation-answer-top);
        max-width: calc(100vw - 20px);
        padding: 8px 10px;
        border-radius: 16px;
        width: max-content;
        max-height: calc(100dvh - var(--dictation-answer-top) - 20px);
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .answer-card-words {
        gap: 4px;
    }

    .answer-phonetic-row {
        gap: 6px;
    }

    .answer-token-row {
        gap: 6px;
        padding: 3px 5px;
        border-radius: 7px;
    }

    .answer-token {
        font-size: 15px;
        font-weight: 700;
    }

    .answer-phonetic,
    .answer-meaning {
        font-size: 9px;
        font-weight: 600;
        padding: 1px 5px;
    }

    .dictation-review-card {
        width: min(100%, 520px);
        min-height: min(42vh, 280px);
        gap: 16px;
    }

    .review-card-words {
        gap: 10px 8px;
    }

    .review-word .answer-token {
        padding: 4px 4px;
        font-size: 23px;
    }

    .review-word .answer-phonetic,
    .review-word .answer-meaning {
        font-size: 12px;
    }

    .review-sentence-zh {
        max-width: calc(100vw - 36px);
        font-size: clamp(15px, 4vw, 18px);
    }

    .compare-student-card {
        top: 74px;
        padding: 18px;
    }

    .compare-student-head {
        align-items: flex-start;
    }

    .compare-label {
        font-size: 20px;
    }

    .sentence-pair {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 18px;
    }

    .sentence-index {
        width: 34px;
        height: 34px;
    }

    .compare-hint-editor-head,
    .compare-hint-editor-actions,
    .compare-hint-group-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .compare-hint-editor,
    .compare-hint-group-card {
        padding: 16px;
    }

    .compare-hint-word-grid {
        gap: 8px;
    }

    .compare-hint-word {
        min-height: 40px;
        padding: 0 12px;
        font-size: 13px;
    }

    .en {
        font-size: 17px;
    }

    .dictation-zh {
        font-size: 24px;
        margin-bottom: 30px;
    }

    .word-line {
        gap: 6px;
    }

    .word-slot {
        width: clamp(56px, calc(var(--letters) * 0.72em + 16px), 160px);
        min-height: 56px;
    }

    .dictation-stage.fullscreen .word-slot {
        --word-font-size: clamp(18px, 6.8vw, 28px);
        width: clamp(36px, calc(var(--letters) * 0.58em + 12px), 142px);
        min-height: 42px;
    }

    .dictation-stage.fullscreen .word-line {
        width: min(100%, 520px);
        margin-block: 0;
        align-content: flex-end;
    }

    .dictation-stage.fullscreen .word-line.is-reviewing {
        width: min(100%, 520px);
        margin-block: 0;
        flex: 0 0 auto;
    }

    .dictation-stage.fullscreen .word-input {
        padding-bottom: 6px;
        border-bottom-width: 2px;
        font-weight: 600;
    }

    .dictation-footer {
        grid-template-columns: 48px minmax(0, 1fr) 48px;
        gap: 10px;
        padding: 0 26px max(26px, env(safe-area-inset-bottom));
    }

    .dictation-stage.fullscreen .dictation-footer {
        grid-template-columns: 40px minmax(0, 1fr) 40px;
        gap: 12px;
        padding: 0 18px max(20px, env(safe-area-inset-bottom));
        align-items: end;
        z-index: 45;
    }

    .arrow-btn {
        width: 34px;
        height: 44px;
        border-radius: 0;
        background: transparent;
        color: #b6bdc8;
        font-size: 34px;
    }

    .dictation-actions {
        margin-top: 28px;
        gap: 8px;
    }

    .dictation-stage.fullscreen .dictation-actions {
        position: static;
        top: auto;
        left: auto;
        bottom: auto;
        transform: none;
        z-index: 35;
        display: grid;
        grid-template-columns: repeat(2, max-content);
        justify-content: center;
        justify-items: center;
        gap: 10px 12px;
        margin: 34px auto 0;
    }

    .mini-action {
        padding: 9px 12px;
        font-size: 14px;
    }

    .dictation-stage.fullscreen .mini-action {
        min-height: 30px;
        min-width: 76px;
        justify-content: center;
        gap: 0;
        padding: 0 12px;
        border: 1px solid #edf0f4;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.94);
        box-shadow: 0 4px 14px rgba(17, 24, 39, 0.06);
        color: #1d1d1f;
        font-size: 12px;
    }

    .dictation-stage.fullscreen .mini-action.primary {
        grid-column: 1 / -1;
        order: 1;
        background: rgba(255, 255, 255, 0.94);
        border-color: #edf0f4;
        color: #1d1d1f;
        margin-bottom: 2px;
    }

    .dictation-stage.fullscreen #revealSentenceBtn {
        order: 2;
    }

    .dictation-stage.fullscreen #speakShortcutBtn {
        order: 3;
    }

    .dictation-stage.fullscreen #masterSentenceBtn {
        grid-column: 1 / -1;
        order: 4;
        margin-top: 2px;
    }

    .dictation-stage.fullscreen .mini-action .shortcut {
        display: none;
    }

.shortcut kbd {
    min-width: 34px;
    height: 30px;
    padding: 0 8px;
    font-size: 12px;
}

@media (max-width: 700px) {
    .topbar {
        height: auto;
        padding: 14px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .brand {
        font-size: 16px;
        line-height: 1.25;
    }

    .brand-logo {
        width: 32px;
        height: 32px;
    }

    .brand .brand-wordmark {
        font-size: 20px;
    }

    .topbar .topbar-actions {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .topbar .topbar-links {
        flex-wrap: nowrap;
        gap: 8px;
        flex: 0 1 auto;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .topbar .topbar-links a,
    .topbar .topbar-links .topbar-profile-btn {
        min-height: 38px;
        padding: 0 14px;
        border-radius: 14px;
        display: inline-flex;
        align-items: center;
        background: rgba(255, 255, 255, 0.92);
        color: #1d1d1f;
        font-size: 13px;
        font-weight: 700;
        white-space: nowrap;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    }

    .topbar .topbar-actions .auth-status {
        width: auto;
        min-width: 0;
        justify-content: flex-end;
        flex: 0 0 auto;
    }

    .topbar .topbar-actions .auth-account {
        width: auto;
        gap: 8px;
        justify-content: flex-end;
        flex-wrap: nowrap;
    }

    .topbar .topbar-actions .auth-feedback-btn {
        min-height: 40px;
        padding: 0 12px;
        font-size: 13px;
        flex: 0 0 auto;
        width: fit-content;
    }
}

@media (max-width: 520px) {
    .feedback-score-grid {
        grid-template-columns: 1fr;
    }

    .topbar .topbar-actions .auth-status {
        width: auto;
    }

    .topbar .topbar-actions .auth-account {
        width: auto;
        justify-content: flex-end;
    }

    .topbar .topbar-actions .auth-feedback-btn {
        flex: 0 0 auto;
    }
}
