#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; /* 鼠标悬浮时显示手的样式 */
}

#shortcut-display p {
    font-size: smaller;
}

#shortcut-display kbd {
    font-size: smaller;
}

#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: underline;
}

#reportError {
    top: 0;
    right: 0;
    padding: 10px;
}

/* 未兑换时锁定所有播放控件 */
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: help;
}

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

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

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

/* 当前句子显示 */
.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.5);
    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: 380px;
    width: 90%;
    padding: 28px 24px 20px;
    text-align: center;
    background: linear-gradient(135deg, #5a9fd4 0%, #4088c7 100%);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    color: white;
}

.shortcut-hint-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 18px;
    width: 28px;
    height: 28px;
    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.3);
}

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

/* 方向键区域 */
.arrow-keys-section {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.arrow-key-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.arrow-key-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.arrow-key-middle {
    display: flex;
    align-items: center;
    gap: 4px;
}

.arrow-key-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.arrow-key-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.arrow-key {
    width: 34px;
    height: 34px;
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #4088c7;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    font-weight: bold;
}

.arrow-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
}

.arrow-label-bottom {
    margin-top: 4px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.9);
}

/* 主要快捷键卡片 */
.shortcut-cards-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 14px;
}

.shortcut-card {
    background: white;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    min-width: 80px;
}

.shortcut-card .key {
    background: #e8f0f7;
    color: #4088c7;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.shortcut-card .desc {
    color: #666;
    font-size: 0.7rem;
}

/* 更多快捷键 */
.more-shortcuts {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 14px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 16px;
}

.shortcut-item {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    gap: 4px;
}

.shortcut-item .key {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.7rem;
    min-width: 18px;
    text-align: center;
}

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

.dont-show-again input[type="checkbox"] {
    width: 13px;
    height: 13px;
    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;
    }
}

/* 确保桌面端 #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;
    }
}