#progress-container {
    width: 100%;
    position: relative;
}

.progress {
    width: 100%;
}

.progress:hover {
    cursor: pointer; /* 当鼠标悬浮在元素上时，显示手的样式 */
}

#mouse-over-show {
    display: none; /* 确保初始状态下隐藏 */
    position: absolute;
    bottom: 110%; /* 增加间距确保在进度条上方 */
    left: 50%;
    transform: translateX(-50%);
    background-color: gray;
    color: white;
    padding: 6px 10px; /* 增加内边距让文本更突出 */
    border-radius: 6px; /* 增加圆角 */
    font-size: 14px; /* 更大的字体 */
    text-align: center;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10; /* 确保显示在其他元素之上 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); /* 更明显的阴影 */
}

#toggle-captions-btn:focus {
    outline: none; /* 点击时不显示默认的边框 */
}
button:focus {
    outline: none !important;
    box-shadow: none !important;
}

input[type='checkbox'].my-custom-switch:checked + .custom-control-label::before {
    background-color: steelblue !important; /* 你想要的颜色 */
    border-color: white !important; /* 你想要的边框颜色，通常与背景颜色匹配一致 */
}

.custom-control-label {
    cursor: pointer; /* 鼠标悬浮时显示手的样式 */
}

#toggle-finish-btn:checked + .custom-control-label::before {
    background-color: mediumseagreen !important; /* 选中时背景颜色 */
    border-color: white !important; /* 边框颜色 */
}

/* 确保custom-control-input的checkbox被正确隐藏 */
.custom-control-input {
    opacity: 0 !important;
    z-index: -1 !important;
    position: absolute !important;
}

/* 其他checkbox保持指针样式 */
input[type='checkbox']:not(.custom-control-input) {
    cursor: pointer; /* 鼠标悬浮时显示手的样式 */
}

#progress-bar {
    width: 0;
}

#captionsTranslation {
    display: none;
}

#loading-message {
    display: none;
    font-size: 1.5rem;
    color: #007bff;
    margin: 20px 0;
    text-align: center;
    font-weight: 500;
}

/* 加载状态下的禁用样式 */
.loading .btn:disabled,
.loading .custom-control-input:disabled + .custom-control-label {
    opacity: 0.6;
    cursor: not-allowed;
}

.loading .progress {
    opacity: 0.6;
    cursor: not-allowed;
}

#favoriteListShow {
    display: none;
}

#needMoreSentence {
    width: 100%;
    max-height: 40vh;;
    overflow-y: auto;
}

#show-shortcut-list {
    text-decoration: none;
}

#reportError {
    top: 4px;
    right: 6px;
    padding: 0;
    font-size: 0.7rem;
}

/* 未兑换时锁定所有播放控件 */
body.purchase-required .player-control button,
body.purchase-required #progress-container,
body.purchase-required .custom-switch,
body.purchase-required #needMoreRepeat,
body.purchase-required #pronunciation-btn,
body.purchase-required .btn-group {
    pointer-events: none;
    opacity: 0.5;
}

/* 未兑换时隐藏字幕内容 */
body.purchase-required #captions,
body.purchase-required #captionsTranslation,
body.purchase-required #loading-message {
    display: none !important;
}

/* 字幕锁定提示样式 */
#subtitle-lock-hint {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

#subtitle-lock-hint p {
    font-size: 1.1rem;
    margin-bottom: 16px;
}

#subtitle-lock-hint .btn-unlock {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

#subtitle-lock-hint .btn-unlock:hover {
    opacity: 0.9;
}

#dictation-area{
    display: none;
}

/* ==================== 听写批改样式 ==================== */
.dictation-diff {
    font-size: 1.1rem;
    line-height: 1.8;
    word-wrap: break-word;
}

.diff-correct {
    color: #28a745;
    font-weight: 500;
}

.diff-wrong {
    color: #dc3545;
    text-decoration: line-through;
    cursor: help;
}

.diff-missing {
    color: #fd7e14;
    background-color: rgba(253, 126, 20, 0.1);
    padding: 0 2px;
    border-radius: 2px;
}

.diff-extra {
    color: #6c757d;
    text-decoration: line-through;
    opacity: 0.7;
}

/* ==================== 发音评测样式 ==================== */
/* 步骤指示器 */
.pronunciation-steps {
    display: flex;
    justify-content: center;
    align-items: center;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.3s;
}

.step-label {
    margin-top: 8px;
    font-size: 0.875rem;
    color: #6c757d;
}

.step-item.active .step-number {
    background-color: #007bff;
    color: white;
}

.step-item.active .step-label {
    color: #007bff;
    font-weight: 500;
}

.step-item.completed .step-number {
    background-color: #28a745;
    color: white;
}

.step-item.completed .step-label {
    color: #28a745;
}

.step-connector {
    width: 60px;
    height: 2px;
    background-color: #e9ecef;
    margin: 0 10px;
    margin-bottom: 24px;
}

/* 录音指示器 */
.recording-indicator {
    display: inline-flex;
    align-items: center;
}

.recording-dot {
    width: 12px;
    height: 12px;
    background-color: #dc3545;
    border-radius: 50%;
    animation: recording-pulse 1s infinite;
}

@keyframes recording-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* 发音分析加载动画 */
.analyzing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
}

.sound-wave {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 40px;
}

.sound-wave .bar {
    width: 6px;
    height: 100%;
    background: #4A90D9;
    border-radius: 3px;
    animation: sound-wave-bounce 1s ease-in-out infinite;
}

.sound-wave .bar:nth-child(1) { animation-delay: 0s; }
.sound-wave .bar:nth-child(2) { animation-delay: 0.15s; }
.sound-wave .bar:nth-child(3) { animation-delay: 0.3s; }
.sound-wave .bar:nth-child(4) { animation-delay: 0.45s; }
.sound-wave .bar:nth-child(5) { animation-delay: 0.6s; }

@keyframes sound-wave-bounce {
    0%, 100% { transform: scaleY(0.3); }
    50% { transform: scaleY(1); }
}

.analyzing-text {
    font-size: 1rem;
    color: #333;
}

.analyzing-dots span {
    opacity: 0;
    animation: dot-fade 1.4s infinite;
}

.analyzing-dots span:nth-child(1) { animation-delay: 0s; }
.analyzing-dots span:nth-child(2) { animation-delay: 0.3s; }
.analyzing-dots span:nth-child(3) { animation-delay: 0.6s; }

@keyframes dot-fade {
    0%, 60%, 100% { opacity: 0; }
    30% { opacity: 1; }
}

.analyzing-tip {
    font-size: 0.8rem;
    color: #999;
    transition: opacity 0.5s ease;
    min-height: 1.2em;
}

/* 发音评分展示 */
.pronunciation-score {
    display: inline-block;
    text-align: center;
}

.pronunciation-score .score-value {
    font-size: 4rem;
    font-weight: bold;
    line-height: 1;
}

.pronunciation-score .score-label {
    font-size: 1.25rem;
    margin-top: 8px;
}

.pronunciation-score .score-delta {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 4px;
}

.score-item {
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.score-item .score-number {
    font-size: 2rem;
    font-weight: bold;
    color: #495057;
}

.score-item .score-name {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 4px;
}

/* 单词评分 */
.words-score-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.word-score {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.word-score:hover {
    transform: scale(1.08);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.word-score.word-speaking {
    animation: word-pulse 0.6s ease-in-out infinite alternate;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.5);
}

@keyframes word-pulse {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

.word-excellent {
    background-color: #c3e6cb;
    color: #155724;
}

.word-correct {
    background-color: #d4edda;
    color: #155724;
}

.word-fair {
    background-color: #ffeeba;
    color: #856404;
}

.word-poor {
    background-color: #f5c6cb;
    color: #721c24;
}

.word-wrong {
    background-color: #f8d7da;
    color: #721c24;
    font-weight: 600;
}

.word-missing {
    background-color: #fff3cd;
    color: #856404;
    text-decoration: line-through;
}

.word-unknown {
    background-color: #e2e3e5;
    color: #383d41;
}

.word-score-badge {
    font-size: 0.65rem;
    opacity: 0.7;
    margin-left: 2px;
    vertical-align: super;
}

/* 音量指示器 */
.volume-meter-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.volume-meter-label {
    font-size: 0.8rem;
    color: #6c757d;
    white-space: nowrap;
}

.volume-meter {
    flex: 1;
    height: 6px;
    background-color: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    max-width: 200px;
}

.volume-meter-bar {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #ffc107, #dc3545);
    border-radius: 3px;
    transition: width 0.05s linear;
    width: 0%;
}

/* 音素详情弹出 */
.word-score.has-phonemes {
    cursor: pointer;
    position: relative;
}

.phoneme-detail {
    display: none;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-top: 4px;
    font-size: 0.85rem;
}

.phoneme-detail.show {
    display: block;
}

.phoneme-item {
    display: inline-block;
    margin: 2px 4px;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}

.phoneme-good { background-color: #d4edda; color: #155724; }
.phoneme-fair { background-color: #ffeeba; color: #856404; }
.phoneme-weak { background-color: #f8d7da; color: #721c24; }


/* 当前句子显示 */
.pronunciation-sentence {
    padding: 15px;
    background-color: #e3f2fd;
    border-radius: 8px;
    border-left: 4px solid #2196f3;
}

/* ==================== 快捷键提示弹窗样式 ==================== */
.shortcut-hint-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.shortcut-hint-overlay.show {
    display: flex;
    opacity: 1;
}

.shortcut-hint-content {
    position: relative;
    max-width: 560px;
    width: 92%;
    padding: 32px 36px 24px;
    text-align: center;
    background: linear-gradient(135deg, #5a9fd4 0%, #4088c7 100%);
    border-radius: 18px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
    color: white;
}

.shortcut-hint-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    line-height: 1;
}

.shortcut-hint-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.shortcut-hint-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 24px;
    color: white;
}

/* 快捷键网格 */
.shortcut-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.shortcut-grid-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.13);
    border-radius: 10px;
    padding: 10px 14px;
}

.shortcut-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: white;
    color: #3a7fbf;
    font-weight: 700;
    font-size: 0.8rem;
    min-width: 36px;
    height: 32px;
    padding: 0 8px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.shortcut-key-group {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.shortcut-key-group .shortcut-key {
    min-width: 26px;
    height: 28px;
    padding: 0 5px;
    font-size: 0.75rem;
}

.shortcut-desc {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.95);
    text-align: left;
    white-space: nowrap;
}

/* 不再显示选项 */
.dont-show-again {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: 4px;
}

.dont-show-again input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

/* ==================== 桌面端下拉菜单方向 ==================== */
@media (min-width: 768px) {
    .audio-dropdown {
        position: relative;
    }

    .audio-dropdown .dropdown-menu {
        top: 0;
        left: 100%;
        margin-top: 0;
        margin-left: 0.125rem;
    }
}

/* ==================== 移动端响应式布局 ==================== */
@media (max-width: 767.98px) {
    /* 侧边栏改为紧凑水平布局 */
    .audio-settings {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .audio-settings .list-group-item {
        border: none;
        padding: 0.35rem 0.5rem;
        flex: 0 0 auto;
    }

    /* 更多设置展开区也用水平布局 */
    #audio-settings-extra .audio-settings {
        justify-content: center;
    }

    /* 下拉菜单移除 dropright，改为向下展开 */
    .audio-dropdown .dropdown-menu {
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
    }

    /* 减小 jumbotron 内间距 */
    .jumbotron {
        padding: 1rem !important;
        margin-bottom: 0.5rem;
    }

    /* 播放控制按钮增大触控区域 */
    .player-control .btn {
        min-width: 48px;
        min-height: 48px;
        font-size: 1.1rem;
    }

    /* 收藏按钮增大触控区域 */
    #needMoreRepeat {
        min-height: 48px;
    }

    /* 进度条区域减小上边距 */
    #progress-container {
        margin-top: 0.5rem;
    }

    /* 时间和句子信息换行显示 */
    .row.my-3 {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    /* 隐藏快捷键提示弹窗（手机无键盘） */
    .shortcut-hint-overlay {
        display: none !important;
    }

    /* 反馈字幕问题：移动端改为静态定位，不再遮挡字幕 */
    #reportError {
        position: static !important;
        display: block;
        text-align: right;
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
        padding: 0;
    }

    /* Play 按钮组居中占满宽 */
    .row > .col-xl-2.col-md-auto {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }
    .player-control {
        justify-content: center !important;
        width: 100%;
    }

    /* 时间/句序号行：隐藏竖线分隔符，元素自然排版 */
    .row.my-3 > span.text-secondary.mx-3 {
        display: none;
    }
    .row.my-3 {
        align-items: center;
        padding: 0 0.5rem;
    }

    /* 收藏按钮与时间行间距 */
    .row.my-3 > #needMoreRepeat {
        margin-top: 0.75rem;
    }

    /* 听写输入框、收藏列表手机端强制隐藏 */
    #dictation-area,
    #favoriteListShow {
        display: none !important;
    }
}

/* 确保桌面端 #audio-settings-extra 始终可见 */
@media (min-width: 768px) {
    #audio-settings-extra {
        display: block !important;
    }
}

/* 响应式设计 - 快捷键提示弹窗 */
@media (max-width: 576px) {
    .shortcut-hint-content {
        padding: 24px 18px 18px;
        max-width: 320px;
    }

    .shortcut-hint-title {
        font-size: 1rem;
    }

    .arrow-key {
        width: 30px;
        height: 30px;
        font-size: 11px;
    }

    .arrow-label {
        font-size: 0.65rem;
    }

    .shortcut-cards-row {
        gap: 8px;
    }

    .shortcut-card {
        padding: 8px 10px;
        min-width: 70px;
    }

    .shortcut-card .key {
        font-size: 0.7rem;
    }

    .shortcut-card .desc {
        font-size: 0.65rem;
    }

    .more-shortcuts {
        padding: 10px 12px;
        gap: 6px 12px;
    }

    .shortcut-item {
        font-size: 0.7rem;
    }
}

/* ========== 生词本：可点击单词 ========== */
.clickable-word {
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.15s;
}

.clickable-word:hover {
    background-color: rgba(70, 130, 180, 0.15);
}

/* ========== 生词本：释义弹窗 ========== */
.word-popover {
    position: fixed;
    z-index: 1050;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 12px 16px;
    min-width: 240px;
    max-width: 360px;
    font-size: 14px;
    color: #333;
}

.word-popover-loading {
    color: #999;
    text-align: center;
    padding: 8px 0;
}

.word-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.popover-word {
    font-size: 18px;
    font-weight: 600;
    color: #222;
}

.popover-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    padding: 0 4px;
    line-height: 1;
}

.popover-close:hover {
    color: #333;
}

.word-popover-phonetic {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #666;
}

.phonetic-text {
    font-size: 14px;
    font-style: italic;
}

.popover-play-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    color: #999;
    transition: color 0.15s;
}

.popover-play-btn:hover {
    color: #6c8eef;
}

.word-popover-definition {
    margin-bottom: 10px;
    line-height: 1.6;
}

.word-popover-definition p {
    margin: 0;
    padding: 1px 0;
}

.word-popover-action {
    border-top: 1px solid #eee;
    padding-top: 8px;
    text-align: center;
}

.popover-add-btn {
    background: #4682b4;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 5px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.popover-add-btn:hover {
    background: #3a6d96;
}

.popover-add-btn:disabled {
    background: #aaa;
    cursor: not-allowed;
}

.popover-collected-badge {
    color: #4682b4;
    font-size: 13px;
    font-weight: 500;
}