/* 多邻国风格配色 */
:root {
    --duo-green: #58CC02;
    --duo-green-dark: #46a302;
    --duo-green-shadow: #3d8a02;
    --duo-blue: #1CB0F6;
    --duo-blue-dark: #1899d6;
    --duo-purple: #CE82FF;
    --duo-orange: #FF9600;
    --duo-red: #FF4B4B;
    --duo-red-dark: #ea2b2b;
    --duo-gray: #E5E5E5;
    --duo-gray-dark: #AFAFAF;
    --duo-bg: #235390;
    --duo-card-bg: #FFFFFF;
    --duo-text: #4B4B4B;
    --duo-text-light: #777777;
    --radius: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 隐藏滚动条但保留滚动功能 */
* {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}
*::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

/* 禁用按钮点击时的方形高亮 */
button, a, .btn, .import-btn, [role="button"] {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--duo-bg);
    color: var(--duo-text);
    padding: 12px;
    padding-bottom: 100px;
    min-height: 100vh;
}

h1 {
    text-align: center;
    margin-bottom: 12px;
    color: white;
    font-size: 1.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* SVG 图标 */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
}

.icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

h1 .icon {
    font-size: 2rem;
}

.container { max-width: 1120px; margin: 0 auto; }

/* 播放模式 - 移动端和桌面端通用 */
body.player-mode {
    padding: 0;
    overflow: hidden;
}

body.player-mode .container {
    max-width: 100%;
    padding: 0;
    margin: 0;
}

body.player-mode h1 {
    display: none;
}

body.player-mode .tips-card,
body.player-mode .settings-card {
    display: none !important;
}

body.player-mode #playerView {
    display: flex !important;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

/* 多邻国风格卡片 */
.card {
    background: var(--duo-card-bg);
    border-radius: var(--radius);
    border: 2px solid #E5E5E5;
    border-bottom-width: 4px;
    padding: 20px;
    margin-bottom: 16px;
    overflow: hidden;
}

.card-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--duo-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 多邻国风格按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.1s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary:disabled {
    background: #9E9E9E;
    border-bottom-color: #757575;
}

.btn-primary {
    background: var(--duo-green);
    color: white;
    border-bottom: 4px solid var(--duo-green-shadow);
}

.btn-primary:hover {
    background: var(--duo-green-dark);
}

.btn-primary:active {
    border-bottom-width: 2px;
}

.btn-secondary {
    background: white;
    color: var(--duo-blue);
    border: 2px solid #E5E5E5;
    border-bottom-width: 4px;
}

.btn-secondary:hover {
    background: #F7F7F7;
}

.btn-danger {
    background: var(--duo-red);
    color: white;
    border-bottom: 4px solid var(--duo-red-dark);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn-icon {
    padding: 10px;
    border-radius: 12px;
}

.btn-icon:active {
    transform: none;
}

/* 文件选择区域 - 多邻国风格 */
/* 导入按钮组 */
.import-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.import-btn {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    -webkit-tap-highlight-color: transparent;
}

.import-btn svg {
    width: 28px;
    height: 28px;
}

.import-btn span {
    font-size: 0.875rem;
    font-weight: 700;
}

.import-btn input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

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

.import-btn:active {
    transform: scale(0.98);
}

/* 音视频按钮 */
.import-btn-media {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    color: var(--duo-green);
}
.import-btn-media:hover {
    border-color: var(--duo-green);
}

/* 文件夹按钮 */
.import-btn-folder {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    color: #1899d6;
}
.import-btn-folder:hover {
    border-color: #1899d6;
}

/* 电子书按钮 */
.import-btn-ebook {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
    color: #ff9600;
}
.import-btn-ebook:hover {
    border-color: #ff9600;
}

/* 旧版样式保留兼容 */
.file-input-wrapper {
    position: relative;
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border: 3px dashed var(--duo-green);
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 16px;
}

.file-input-wrapper:hover {
    background: linear-gradient(135deg, #C8E6C9 0%, #A5D6A7 100%);
    transform: scale(1.02);
}

.file-input-wrapper input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.file-input-wrapper .file-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.file-input-wrapper .file-text {
    font-weight: 700;
    color: var(--duo-green-dark);
    font-size: 1.1rem;
}

/* 播放器布局 - 新版结构 */
.player-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* 顶部标题栏 */
.player-top-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #1a1a2e;
    flex-shrink: 0;
}

.player-top-header .back-btn {
    margin-bottom: 0;
    background: rgba(255,255,255,0.15);
}

.player-top-header .now-playing {
    flex: 1;
    color: white;
    font-size: 1.1rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.now-playing-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.share-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.share-btn:hover {
    background: rgba(255,255,255,0.25);
}

.share-btn svg {
    width: 18px;
    height: 18px;
    fill: white;
}

/* 播放区域（最大占屏幕一半） */
.player-media-section {
    flex-shrink: 0;
    max-height: 50vh;
    max-height: 50dvh;
    background: #1a1a2e;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.player-media-section #mediaContainer {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
}

.player-media-section #mediaContainer video,
.player-media-section #mediaContainer audio {
    width: 100%;
    max-height: calc(50vh - 120px);
    max-height: calc(50dvh - 120px);
    object-fit: contain;
    border-radius: 8px;
}

/* 内嵌播放控制条 - 默认隐藏，由 JS 控制显示 */
.inline-player-controls {
    display: none;
    padding: 10px 4px;
    background: #1a1a2e;
    flex-shrink: 0;
}

/* 当播放模式确定后显示（由 JS 添加 show-controls 类） */
.inline-player-controls.show-controls {
    display: block;
}

.inline-player-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.inline-time {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    font-family: ui-monospace, monospace;
    min-width: 36px;
}

.inline-time:first-child {
    text-align: left;
}

.inline-time:last-child {
    text-align: right;
}

.inline-progress-bar {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--duo-gray);
    border-radius: 2px;
    cursor: pointer;
    margin: 0;
}

.inline-progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--duo-green);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(88, 204, 2, 0.4);
    margin-top: -5px;
}

.inline-progress-bar::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--duo-green);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(88, 204, 2, 0.4);
}

.inline-progress-bar::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right, var(--duo-green) var(--progress, 0%), var(--duo-gray) var(--progress, 0%));
}

.inline-progress-bar::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background: var(--duo-gray);
}

.inline-progress-bar::-moz-range-progress {
    height: 4px;
    border-radius: 2px;
    background: var(--duo-green);
}

.inline-player-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.inline-control-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.15);
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.inline-control-btn:hover {
    background: rgba(255,255,255,0.25);
}

.inline-control-btn:active {
    transform: scale(0.95);
}

.inline-control-btn svg {
    width: 18px;
    height: 18px;
}

.inline-control-btn .skip-label {
    font-size: 0.55rem;
    font-weight: 800;
    margin-top: -3px;
}

.inline-play-btn {
    width: 48px;
    height: 48px;
    background: var(--duo-green);
    color: white;
}

.inline-play-btn:hover {
    background: var(--duo-green-dark);
}

.inline-play-btn svg {
    width: 24px;
    height: 24px;
}

.inline-playlist-btn {
    background: rgba(28, 176, 246, 0.3) !important;
}

.inline-bookmark-btn {
    background: rgba(255, 150, 0, 0.3) !important;
}

#inlineSpeedText {
    font-size: 0.8rem;
    font-weight: 800;
}

/* 标签栏 */
.player-tabs-section {
    flex-shrink: 0;
    padding: 8px 12px;
    background: var(--duo-bg);
}

.player-tabs-section .tabs {
    margin-bottom: 0;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 481px) {
    .player-tabs-section .tab-btn {
        flex: 1 1 0;
    }
}

/* 标签内容区域 */
.player-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px 4px 12px;
    background: var(--duo-bg);
    min-height: 0;
}

.player-tab-content .tab-content {
    height: 100%;
}

.player-tab-content .tab-content.active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.player-tab-content .tab-content .card {
    flex: 1;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding-top: 16px;
    padding-bottom: 8px;
}

.player-tab-content #transcriptList,
.player-tab-content #bookmarksList,
.player-tab-content #summaryContent {
    flex: 1;
    min-height: 0;
}

/* 桌面端样式 */
@media (min-width: 768px) {
    body.player-mode {
        overflow: hidden;
        padding: 0;
    }

    body.player-mode .container {
        max-width: 100%;
        height: 100vh;
        display: flex;
        flex-direction: column;
        padding: 0;
    }

    body.player-mode h1 {
        display: none;
    }

    body.player-mode .tips-card,
    body.player-mode .settings-card {
        display: none !important;
    }

    body.player-mode #playerView {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .player-top-header {
        padding: 12px 24px;
    }

    .player-media-section {
        padding: 0 24px;
    }

    .inline-player-controls {
        padding: 12px 24px;
        max-width: 800px;
        margin: 0 auto;
        width: 100%;
    }

    .player-tabs-section {
        padding: 8px 24px;
    }

    .player-tab-content {
        padding: 0 24px 24px 24px;
    }

    .player-tab-content .card {
        max-width: none;
    }
}

/* 播放器卡片 */
.player-card {
    background: white;
    border-radius: var(--radius);
    border: 2px solid #E5E5E5;
    border-bottom-width: 4px;
    padding: 16px;
    margin-bottom: 16px;
}

/* 媒体容器 */

#mediaContainer video, #mediaContainer audio {
    width: 100%;
    border-radius: 8px;
}
#mediaContainer video {
    object-fit: contain;
    background: #1a1a2e;
    /* 禁用长按默认行为 */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
video::cue {
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 4px 8px;
    font-family: 'Nunito', sans-serif;
}

.now-playing {
    flex: 1;
    text-align: left;
    word-break: break-all;
    font-weight: 800;
    color: var(--duo-text);
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 控制按钮组 */
.controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border: none;
    cursor: pointer;
    transition: all 0.1s;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn.skip {
    background: var(--duo-gray);
    color: var(--duo-text);
    border: 2px solid #d0d0d0;
    border-bottom-width: 4px;
}

.control-btn.play {
    width: 64px;
    height: 64px;
    background: var(--duo-green);
    color: white;
    border: 2px solid var(--duo-green-shadow);
    border-bottom-width: 5px;
    font-size: 1.5rem;
}

.control-btn.play:active {
    border-bottom-width: 2px;
}

/* 列表分组标题 */
.list-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--duo-text-light);
    margin: 16px 0 8px 0;
    padding: 0 4px;
}

.list-section-title:first-child {
    margin-top: 0;
}

/* 列表项 - 多邻国风格 */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px;
    margin-bottom: 10px;
    border-radius: 12px;
    background: #F7F7F7;
    border: 2px solid #E5E5E5;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.list-item:hover {
    background: #EFEFEF;
}

.list-item:last-child { margin-bottom: 0; }

.list-item-info { flex: 1; min-width: 0; }

.list-item-name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: var(--duo-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-item-meta {
    font-size: 0.8rem;
    color: var(--duo-text-light);
}

.list-item.has-file .list-item-name { color: var(--duo-green); }
.list-item.has-saved .list-item-name { color: var(--duo-blue); }

.list-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.bookmark-transcript {
    margin-top: 8px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--duo-text-light);
    border: 1px solid #E5E5E5;
}

/* 转录项 */
.transcript-item {
    padding: 14px;
    margin-bottom: 8px;
    background: #F7F7F7;
    border-radius: 12px;
    border-left: 4px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
}

.transcript-item:hover { background: #EFEFEF; }

.transcript-item.active {
    background: #E8F5E9;
    border-left-color: var(--duo-green);
}

.transcript-time {
    font-size: 0.75rem;
    color: var(--duo-text-light);
    font-family: ui-monospace, monospace;
    margin-bottom: 6px;
    font-weight: 600;
}

/* 进度条 - 多邻国风格 */
.progress-section { margin: 16px 0; }

.progress-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.progress-label {
    width: 70px;
    font-size: 0.75rem;
    color: var(--duo-text-light);
    font-weight: 700;
}

.progress-bar {
    flex: 1;
    height: 12px;
    background: var(--duo-gray);
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #d0d0d0;
}

.progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--duo-green), #7ED321);
    width: 0%;
    transition: width 0.3s;
    border-radius: 4px;
}

.progress-percent {
    width: 45px;
    font-size: 0.8rem;
    color: var(--duo-text);
    text-align: right;
    font-family: ui-monospace, monospace;
    font-weight: 700;
}

.process-notice {
    margin: 10px 0 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #FFF4D6;
    border: 1px solid #F2C96D;
    color: #8A5A00;
    font-size: 0.85rem;
    line-height: 1.5;
    font-weight: 700;
    text-align: center;
}

.process-notice-compact {
    margin-bottom: 12px;
}

.transcribe-status {
    text-align: center;
    font-size: 0.9rem;
    color: var(--duo-text-light);
    margin-top: 12px;
    margin-bottom: 12px;
    font-weight: 600;
}

/* 标签切换 - 多邻国风格 */
.tabs {
    display: flex;
    background: white;
    border-radius: 16px;
    padding: 6px;
    margin-bottom: 16px;
    border: 2px solid #E5E5E5;
    border-bottom-width: 4px;
    box-sizing: border-box;
}

.tab-btn {
    flex: 0 1 auto;
    min-width: 0;
    padding: 12px 16px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    border: none;
    background: transparent;
    color: var(--duo-text-light);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tab-btn:hover:not(.active) {
    background: #F0F0F0;
}

.tab-btn.active {
    background: var(--duo-green);
    color: white;
    box-shadow: 0 2px 4px rgba(88, 204, 2, 0.3);
}

/* Tips 折叠 */
.tips-card {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
    border: 2px solid #FFD54F;
    border-bottom-width: 4px;
}

.tips-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    color: #F57C00;
    -webkit-tap-highlight-color: transparent;
}

.tips-list {
    margin-top: 12px;
    padding-left: 20px;
    color: #E65100;
    font-size: 0.9rem;
    line-height: 1.8;
}

.tips-list li { margin-bottom: 4px; }

#tipsList.collapsed { display: none; }
#tipsToggle { transition: transform 0.15s; font-size: 0.9rem; }
#tipsToggle.collapsed { transform: rotate(180deg); }

/* 设置卡片 */
.settings-card {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border: 2px solid #81C784;
    border-bottom-width: 4px;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    color: #388E3C;
    -webkit-tap-highlight-color: transparent;
}

.settings-content {
    margin-top: 12px;
}

.settings-subsection {
    margin-bottom: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(56, 142, 60, 0.14);
}

.settings-subtitle {
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #2E7D32;
}

.settings-tips-list {
    margin: 0;
    padding-left: 18px;
    color: #2E7D32;
    font-size: 0.88rem;
    line-height: 1.7;
}

.settings-tips-list li + li {
    margin-top: 4px;
}

.settings-content.collapsed { display: none; }
#settingsToggle { transition: transform 0.15s; font-size: 0.9rem; }
#settingsToggle.collapsed { transform: rotate(180deg); }

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(56, 142, 60, 0.2);
}

.settings-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.settings-label {
    font-size: 0.9rem;
    color: #2E7D32;
    font-weight: 600;
}

.settings-update-version {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(129, 199, 132, 0.5);
    color: #2E7D32;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: right;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.settings-update-item {
    align-items: center;
}

.settings-update-item .settings-label {
    flex: 0 0 auto;
}

.settings-clear-cache-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.settings-clear-cache-item .settings-desc {
    font-size: 12px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

.btn-clear-cache {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    background: #ef4444;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-clear-cache:hover {
    background: #dc2626;
}

.btn-clear-cache:active {
    transform: scale(0.98);
}

@media (max-width: 640px) {
    .settings-update-item {
        align-items: flex-start;
        gap: 10px;
        flex-direction: column;
    }

    .settings-update-version {
        width: 100%;
        justify-content: flex-start;
        text-align: left;
    }
}

.settings-select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid #81C784;
    background: white;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2E7D32;
    cursor: pointer;
    min-width: 120px;
}

.settings-select:focus {
    outline: none;
    border-color: #4CAF50;
}

@media (min-width: 900px) {
    #projectList {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    #projectList .empty-message {
        grid-column: 1 / -1;
    }

    #projectList .list-item {
        height: 100%;
        margin-bottom: 0;
    }
}

@media (min-width: 1280px) {
    #projectList {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Select 下拉框 */
.select {
    padding: 12px 16px;
    border-radius: 12px;
    border: 2px solid #E5E5E5;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    background: white;
    color: var(--duo-text);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%234B4B4B' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.input {
    padding: 12px 16px;
    border-radius: 12px;
    border: 2px solid #E5E5E5;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    background: white;
    color: var(--duo-text);
}
.input:focus {
    outline: none;
    border-color: var(--duo-green);
}

/* Toast - 多邻国风格 */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--duo-text);
    color: white;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 700;
    z-index: 10010;
    opacity: 0;
    transition: all 0.2s;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-10px); }

/* Install Prompt - 多邻国风格 */
.install-prompt {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    padding: 16px 20px;
    border-radius: var(--radius);
    background: white;
    border: 2px solid var(--duo-green);
    border-bottom-width: 4px;
    display: none;
    justify-content: space-between;
    align-items: center;
    z-index: 10010;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.install-prompt span {
    font-weight: 700;
    color: var(--duo-text);
}
.install-prompt.show { display: flex; }
.install-actions { display: flex; gap: 8px; }

/* Tab 内容 */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* 空消息 */
.empty-message {
    text-align: center;
    padding: 32px 24px;
    color: var(--duo-text-light);
    font-weight: 600;
}

/* 返回按钮 */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 8px;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}
.back-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* 动画 */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.spin { animation: spin 1s linear infinite; }

/* 滑动动画 */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.card, .player-card, .file-input-wrapper {
    animation: slideUp 0.3s ease-out;
}

/* 横屏布局 */



/* 总结功能样式 */
.summarize-status {
    text-align: center;
    font-size: 0.9rem;
    color: var(--duo-text-light);
    margin-bottom: 12px;
    font-weight: 600;
}

.summary-content {
    line-height: 1.8;
}

.summary-chapter {
    padding: 16px;
    margin-bottom: 12px;
    background: #F7F7F7;
    border-radius: 12px;
    border-left: 4px solid var(--duo-purple);
    cursor: pointer;
    transition: all 0.15s;
}

.summary-chapter:hover {
    background: #EFEFEF;
    transform: translateX(4px);
}

.summary-chapter-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.summary-chapter-time {
    font-size: 0.75rem;
    color: white;
    background: var(--duo-purple);
    padding: 4px 8px;
    border-radius: 6px;
    font-family: ui-monospace, monospace;
    font-weight: 700;
}

.summary-chapter-title {
    font-weight: 700;
    color: var(--duo-text);
    font-size: 1rem;
}

.summary-chapter-content {
    font-size: 0.9rem;
    color: var(--duo-text-light);
    line-height: 1.6;
}

.summary-overview {
    padding: 16px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border-radius: 12px;
    border: 2px solid var(--duo-green);
}

.summary-overview-title {
    font-weight: 700;
    color: var(--duo-green-dark);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-overview-content {
    font-size: 0.95rem;
    color: var(--duo-text);
    line-height: 1.6;
}

/* 表单行布局 - 响应式 */
.form-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.form-row .select,
.form-row .btn {
    width: 100%;
}

.form-row .btn {
    flex-shrink: 0;
}

/* 桌面端横排 */
@media (min-width: 768px) {
    .form-row {
        flex-direction: row;
        align-items: center;
    }

    .form-row .select {
        flex: 1;
        min-width: 0;
        width: auto;
    }

    .form-row .btn {
        width: auto;
        white-space: nowrap;
    }
}

/* 自动跟随开关 */
/* 文稿标签需要相对定位 */
#transcriptTab {
    position: relative;
}

/* 滚动跟随按钮 - 固定在文稿标签左下角 */
.scroll-follow-btn {
    position: absolute;
    bottom: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #E5E5E5;
    color: #999;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.2s;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.scroll-follow-btn svg {
    width: 20px;
    height: 20px;
}

/* 激活状态：绿色（自动滚动开启） */
.scroll-follow-btn.active {
    background: var(--duo-green);
    color: white;
}

.scroll-follow-btn:hover {
    transform: scale(1.1);
}

.scroll-follow-btn.show {
    display: flex;
}

/* 旧的自动跟随开关样式，保留以兼容 */
.auto-follow-toggle {
    display: none;
}

.toggle-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--duo-text);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.2s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--duo-green);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* 当前播放的文稿高亮 */
.transcript-item.current {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%) !important;
    border-left: 4px solid var(--duo-green) !important;
}

/* 翻译功能样式 */
.translate-status {
    font-size: 0.85rem;
    color: var(--duo-green-dark);
    margin-bottom: 12px;
    font-weight: 600;
    text-align: center;
}

.transcript-translation {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #d0d0d0;
    font-size: 0.9rem;
    color: var(--duo-blue-dark);
    font-weight: 600;
}


/* 底部悬浮播放控制条 - 默认隐藏，已替换为内嵌控制条 */
.floating-player {
    position: fixed;
    bottom: 12px;
    left: 12px;
    right: 12px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
    padding: 14px 18px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
    z-index: 200;
    display: none !important; /* 总是隐藏，已用内嵌控制条替代 */
}

.floating-player.show {
    display: none !important;
}

/* 书签按钮样式 */
.floating-bookmark-btn {
    background: #FFF3E0 !important;
    color: var(--duo-orange) !important;
}

.floating-bookmark-btn:hover {
    background: #FFE0B2 !important;
}

.floating-player-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.floating-time {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--duo-text-light);
    font-family: ui-monospace, monospace;
    min-width: 40px;
}

.floating-time:first-child {
    text-align: left;
}

.floating-time:last-child {
    text-align: right;
}

.floating-progress-bar {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--duo-gray);
    border-radius: 3px;
    cursor: pointer;
    margin: 0;
}

.floating-progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--duo-green);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(88, 204, 2, 0.4);
    margin-top: -6px;
}

.floating-progress-bar::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--duo-green);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(88, 204, 2, 0.4);
}

.floating-progress-bar::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--duo-green) var(--progress, 0%), var(--duo-gray) var(--progress, 0%));
}

.floating-progress-bar::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: var(--duo-gray);
}

.floating-progress-bar::-moz-range-progress {
    height: 6px;
    border-radius: 3px;
    background: var(--duo-green);
}

.floating-player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.floating-control-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: #F0F0F0;
    color: var(--duo-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.floating-control-btn:hover {
    background: #E5E5E5;
}

.floating-control-btn:active {
    transform: scale(0.95);
}

.floating-control-btn svg {
    width: 20px;
    height: 20px;
}

.floating-control-btn {
    position: relative;
    flex-direction: column;
    gap: 0;
}

.floating-control-btn .skip-label {
    font-size: 0.6rem;
    font-weight: 800;
    margin-top: -4px;
}

.floating-play-btn {
    width: 56px;
    height: 56px;
    background: var(--duo-green);
    color: white;
    border: 3px solid var(--duo-green-shadow);
}

.floating-play-btn:hover {
    background: var(--duo-green-dark);
}

.floating-play-btn svg {
    width: 28px;
    height: 28px;
}

#floatingSpeedText {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--duo-text);
}

/* 当悬浮播放条显示时，给body增加底部padding - 已禁用，使用内嵌控制条 */
body.has-floating-player {
    padding-bottom: 0;
}

/* 视频模式：隐藏自定义进度条，使用原生控件 */
body.video-mode .inline-player-controls {
    display: none;
}

/* 音频模式：使用 ArtPlayer 统一界面，保持视频布局 */
body.audio-mode .player-media-section #mediaContainer {
    padding: 0;
}

body.audio-mode .player-media-section #mediaContainer audio {
    display: none;
}

/* 音频模式播放器：紧凑高度 */
body.audio-mode .player-media-section #mediaContainer .art-video-player {
    height: 120px !important;
    min-height: 120px !important;
    border-radius: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

/* 隐藏视频画面 */
body.audio-mode .art-video-player video {
    opacity: 0;
}

/* 波形可视化填充中间区域 */
.art-audio-visualizer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

body.audio-mode .inline-player-controls {
    display: none;
}

/* 播放列表按钮 */
.floating-playlist-btn {
    background: #E3F2FD !important;
    color: var(--duo-blue) !important;
}

.floating-playlist-btn:hover {
    background: #BBDEFB !important;
}

/* 播放列表面板 */
.playlist-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.playlist-overlay.show {
    opacity: 1;
    visibility: visible;
}

.playlist-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    background: white;
    z-index: 400;
    transform: translateX(-100%);
    transition: transform 0.3s ease-out;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0,0,0,0.2);
}

.playlist-panel.show {
    transform: translateX(0);
}

.playlist-header {
    background: var(--duo-blue);
    color: white;
    flex-shrink: 0;
}

.playlist-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
}

.playlist-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.1);
}

.playlist-search {
    flex: 1;
}

.playlist-search input {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    background: rgba(255,255,255,0.9);
}

.playlist-search input::placeholder {
    color: #999;
}

.playlist-controls .shuffle-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    color: white;
}

.playlist-controls .shuffle-switch span:first-child {
    font-weight: 600;
}

.playlist-controls .switch-slider {
    width: 40px;
    height: 22px;
}

.playlist-controls .switch-slider::after {
    width: 16px;
    height: 16px;
}

.playlist-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.playlist-close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.playlist-close-btn:hover {
    background: rgba(255,255,255,0.3);
}

.playlist-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

/* 播放列表文件树 */
.playlist-folder {
    margin-bottom: 8px;
}

.playlist-folder-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #F7F7F7;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--duo-text);
    transition: background 0.15s;
}

.playlist-folder-header:hover {
    background: #EFEFEF;
}

.playlist-folder-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.2s;
}

.playlist-folder.collapsed .playlist-folder-icon {
    transform: rotate(-90deg);
}

.playlist-folder-children {
    padding-left: 20px;
    margin-top: 4px;
}

.playlist-folder.collapsed .playlist-folder-children {
    display: none;
}

.playlist-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-size: 0.9rem;
    color: var(--duo-text);
    margin-bottom: 4px;
    -webkit-tap-highlight-color: transparent;
}

.playlist-file.playing {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    color: var(--duo-green-dark);
    font-weight: 700;
}

.playlist-file-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--duo-text-light);
}

.playlist-file.playing .playlist-file-icon {
    color: var(--duo-green);
}

.playlist-file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-file-size {
    font-size: 0.75rem;
    color: var(--duo-text-light);
    white-space: nowrap;
    flex-shrink: 0;
}

.playlist-file.playing .playlist-file-size {
    color: white;
}

/* 文件删除按钮 */
.playlist-file-delete {
    width: 28px;
    height: 28px;
    padding: 4px;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    color: var(--duo-text-light);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s, background 0.15s, color 0.15s, transform 0.15s;
}

.playlist-file-delete svg {
    width: 100%;
    height: 100%;
}

.playlist-file-delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

.playlist-file-delete:active {
    transform: scale(0.95);
}

/* 随机播放开关 */
.shuffle-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--duo-text);
}

.shuffle-switch input {
    display: none;
}

.switch-slider {
    position: relative;
    width: 48px;
    height: 26px;
    background: #E0E0E0;
    border-radius: 13px;
    transition: background 0.2s;
}

.switch-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.shuffle-switch input:checked + .switch-slider {
    background: var(--duo-green);
}

.shuffle-switch input:checked + .switch-slider::after {
    transform: translateX(22px);
}

/* 文件夹选择区域 */
.folder-input-wrapper {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    border-color: var(--duo-blue);
}

.folder-input-wrapper:hover {
    background: linear-gradient(135deg, #BBDEFB 0%, #90CAF9 100%);
}

.folder-input-wrapper .file-text {
    color: var(--duo-blue-dark);
}

/* 定时关闭功能 */
.inline-sleep-btn,
.floating-sleep-btn {
    position: relative;
    background: rgba(156, 39, 176, 0.3) !important;
}

.inline-sleep-btn.active,
.floating-sleep-btn.active,
.art-top-btn[data-action="sleepTimer"].active {
    background: rgba(156, 39, 176, 0.6) !important;
}

.sleep-timer-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #9C27B0;
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
}

.sleep-timer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10010;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.sleep-timer-overlay.show {
    opacity: 1;
    visibility: visible;
}

.sleep-timer-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    z-index: 10020;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    max-height: 80vh;
    overflow-y: auto;
}

.sleep-timer-menu.show {
    transform: translateY(0);
}

.sleep-timer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #E8E8E8;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--duo-text);
}

.sleep-timer-close {
    background: #F0F0F0;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--duo-text-light);
}

.sleep-timer-close:hover {
    background: #E0E0E0;
}

.sleep-timer-options {
    padding: 12px;
}

.sleep-timer-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    background: #F7F7F7;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 8px;
    text-align: left;
}

.sleep-timer-option:hover {
    background: #EFEFEF;
}

.sleep-timer-option:active {
    transform: scale(0.98);
}

.sleep-timer-option svg {
    width: 24px;
    height: 24px;
    color: #9C27B0;
    flex-shrink: 0;
}

.sleep-timer-option-text {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    color: var(--duo-text);
}

.sleep-timer-option-time {
    font-size: 0.85rem;
    color: var(--duo-text-light);
    font-weight: 500;
    margin-left: 0.5rem;
}

.sleep-timer-option.sleep-timer-cancel {
    background: #FFEBEE;
}

.sleep-timer-option.sleep-timer-cancel:hover {
    background: #FFCDD2;
}

.sleep-timer-option.sleep-timer-cancel svg {
    color: #E53935;
}

.sleep-timer-option.sleep-timer-cancel .sleep-timer-option-text {
    color: #E53935;
}

.sleep-timer-option.sleep-timer-cancel .sleep-timer-option-time {
    color: #E53935;
    font-weight: 700;
}

/* 复习卡样式 */
.flashcard-status {
    font-size: 0.9rem;
    color: var(--duo-text-light);
    margin-bottom: 12px;
    min-height: 20px;
}

.flashcards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.flashcard-item {
    background: #F7F7F7;
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.flashcard-item:hover {
    background: #EFEFEF;
}

.flashcard-item-front {
    font-weight: 600;
    color: var(--duo-text);
    margin-bottom: 4px;
}

.flashcard-item-meta {
    font-size: 0.8rem;
    color: var(--duo-text-light);
    display: flex;
    gap: 12px;
    align-items: center;
}

.flashcard-due {
    color: #E53935;
    font-weight: 600;
}

.flashcard-due.later {
    color: var(--duo-text-light);
}

/* 复习模式 */
.review-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.review-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-bottom: 20px;
}

.review-progress-bar {
    flex: 1;
    height: 8px;
    background: #E8E8E8;
    border-radius: 4px;
    overflow: hidden;
}

.review-progress-inner {
    height: 100%;
    background: var(--duo-green);
    border-radius: 4px;
    transition: width 0.3s;
}

.review-progress-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--duo-text-light);
    white-space: nowrap;
}

/* 翻转卡片 */
.flashcard {
    perspective: 1000px;
    width: 100%;
    max-width: 400px;
    height: 280px;
    margin: 0 auto 20px;
    cursor: pointer;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    box-sizing: border-box;
}

.flashcard-front {
    background: linear-gradient(135deg, #58CC02 0%, #46A302 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(88, 204, 2, 0.3);
}

.flashcard-back {
    background: linear-gradient(135deg, #1899D6 0%, #1471A9 100%);
    color: white;
    transform: rotateY(180deg);
    box-shadow: 0 4px 12px rgba(24, 153, 214, 0.3);
}

.flashcard-question,
.flashcard-answer {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.5;
    overflow: auto;
    max-height: 100%;
}

.flashcard-hint {
    position: absolute;
    bottom: 16px;
    font-size: 0.8rem;
    opacity: 0.8;
}

.flashcard-time {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 0.75rem;
    opacity: 0.8;
    background: rgba(255,255,255,0.2);
    padding: 4px 8px;
    border-radius: 12px;
    cursor: pointer;
}

.flashcard-time:hover {
    background: rgba(255,255,255,0.3);
}

/* 评分按钮 */
.review-buttons {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 400px;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.review-buttons.visible {
    opacity: 1;
    pointer-events: auto;
}

.review-btn {
    flex: 1;
    padding: 14px 8px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.review-btn:active {
    transform: scale(0.95);
}

.review-btn-again {
    background: #FFEBEE;
    color: #E53935;
}

.review-btn-again:hover {
    background: #FFCDD2;
}

.review-btn-hard {
    background: #FFF3E0;
    color: #F57C00;
}

.review-btn-hard:hover {
    background: #FFE0B2;
}

.review-btn-good {
    background: #E8F5E9;
    color: #43A047;
}

.review-btn-good:hover {
    background: #C8E6C9;
}

.review-btn-easy {
    background: #E3F2FD;
    color: #1E88E5;
}

.review-btn-easy:hover {
    background: #BBDEFB;
}

.review-btn-interval {
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0.8;
}

/* 复习完成 */
.review-complete {
    text-align: center;
    padding: 40px 20px;
}

.review-complete-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.review-complete-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--duo-text);
    margin-bottom: 8px;
}

.review-complete-subtitle {
    font-size: 1rem;
    color: var(--duo-text-light);
    margin-bottom: 24px;
}

.review-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
}

.review-stat {
    text-align: center;
}

.review-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--duo-green);
}

.review-stat-label {
    font-size: 0.85rem;
    color: var(--duo-text-light);
}

/* 空状态 */
.flashcard-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--duo-text-light);
}

.flashcard-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* 字幕编辑模态框 */
.subtitle-edit-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10010;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.subtitle-edit-overlay.show {
    opacity: 1;
    visibility: visible;
}

.subtitle-edit-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    z-index: 10020;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.subtitle-edit-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.subtitle-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.subtitle-edit-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--duo-text);
}

.subtitle-edit-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--duo-text-light);
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.subtitle-edit-close:hover {
    background: #f0f0f0;
}

.subtitle-edit-body {
    padding: 20px;
}

.subtitle-edit-row {
    margin-bottom: 16px;
}

.subtitle-edit-row label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--duo-text-light);
    margin-bottom: 8px;
}

.subtitle-edit-row input,
.subtitle-edit-row textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.subtitle-edit-row input:focus,
.subtitle-edit-row textarea:focus {
    outline: none;
    border-color: var(--duo-green);
}

.subtitle-edit-row textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.time-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-input-group input {
    flex: 1;
    width: auto;
}

.time-unit {
    font-size: 0.85rem;
    color: var(--duo-text-light);
}

.subtitle-edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.subtitle-edit-actions .btn {
    flex: 1;
}

.btn-danger {
    background: #ff4b4b;
    color: white;
}

.btn-danger:hover {
    background: #e53e3e;
}

/* 配音风格编辑 */
.dubbing-style-row label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dubbing-help-link {
    color: var(--duo-green);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.dubbing-help-link:hover {
    opacity: 0.8;
}

.dubbing-style-tips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.tip-tag {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: var(--duo-bg);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--duo-border);
}

.tip-tag:hover {
    background: var(--duo-green);
    color: white;
    border-color: var(--duo-green);
}

/* 字幕编辑时间范围 */
.time-edit-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.time-separator {
    color: var(--duo-text-light);
    font-size: 1.1rem;
}

/* 循环播放控制 */
.loop-control {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}

.loop-hint {
    font-size: 0.8rem;
    color: var(--duo-text-light);
}

/* 编辑提示 */
.edit-hint {
    font-weight: normal;
    font-size: 0.75rem;
    color: var(--duo-text-lighter);
}

/* 行数警告 */
.line-count-warning {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    color: #856404;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

/* 字幕项编辑按钮 */
.transcript-item {
    position: relative;
}

.transcript-edit-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 4px 8px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    font-size: 0.8rem;
    color: var(--duo-text-light);
}

.transcript-item:hover .transcript-edit-btn {
    opacity: 1;
}

.transcript-edit-btn:hover {
    background: var(--duo-green);
    color: white;
    border-color: var(--duo-green);
}

/* ============ 系列模态框样式 ============ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10010;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--duo-text);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--duo-text-light);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #f5f5f5;
}

.modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #eee;
}

.modal-footer .btn {
    flex: 1;
}

/* 确认弹窗 */
.confirm-modal {
    max-width: 360px;
    text-align: center;
}

.confirm-modal .modal-header {
    justify-content: center;
    border-bottom: none;
    padding-bottom: 8px;
}

.confirm-modal .modal-header h3 {
    font-size: 1.3rem;
}

.confirm-modal .modal-body {
    padding: 8px 24px 16px;
}

.confirm-message {
    margin: 0;
    font-size: 1rem;
    color: var(--duo-text-light);
    line-height: 1.5;
}

.confirm-modal .modal-footer {
    border-top: none;
    padding-top: 8px;
}

/* 清除缓存弹窗 */
.clear-cache-modal {
    max-width: 400px;
}

.clear-cache-modal .modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.clear-cache-modal .modal-body {
    padding: 16px 20px;
}

.clear-cache-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 12px;
    background: #f8f9fa;
    cursor: pointer;
    transition: background 0.2s;
}

.clear-cache-item:hover {
    background: #f0f0f0;
}

.clear-cache-item:last-child {
    margin-bottom: 0;
}

.clear-cache-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--duo-green);
    cursor: pointer;
}

.clear-cache-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.clear-cache-label {
    font-weight: 600;
    color: #333;
}

.clear-cache-desc {
    font-size: 0.85rem;
    color: #666;
}

.clear-cache-modal .modal-footer {
    border-top: none;
    padding-top: 8px;
}

/* 资源搜索框 */
.source-search-bar {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
}

.source-search-bar input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.source-search-bar input:focus {
    border-color: var(--duo-green);
}

.source-search-bar input::placeholder {
    color: #999;
}

/* 系列文件列表 */
.series-file-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.series-file-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
    gap: 12px;
}

.series-file-item:hover {
    background: #f5f5f5;
}

.series-file-item.last-played {
    background: #e8f5e9;
}

.series-file-item.last-played:hover {
    background: #c8e6c9;
}

.series-file-index {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--duo-green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.series-file-info {
    flex: 1;
    min-width: 0;
}

.series-file-name {
    font-weight: 600;
    color: var(--duo-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95rem;
}

.series-file-position {
    font-size: 0.8rem;
    color: var(--duo-text-light);
    margin-top: 2px;
}

.last-played-badge {
    background: var(--duo-green);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* 列表项动作按钮 */
.list-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* 宽屏下复习卡网格布局 */
@media (min-width: 768px) {
    .flashcards-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 12px;
    }
}

/* 复习卡编辑模态框 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--duo-text);
}

.form-group textarea,
.form-group input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--duo-border);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--duo-card-bg);
    color: var(--duo-text);
    resize: vertical;
    box-sizing: border-box;
}

.form-group textarea:focus,
.form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--duo-green);
}

/* 复习卡列表项操作按钮 */
.flashcard-item {
    position: relative;
}

.flashcard-item-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.flashcard-item:hover .flashcard-item-actions {
    opacity: 1;
}

.flashcard-action-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: var(--duo-card-bg);
    color: var(--duo-text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.flashcard-action-btn:hover {
    background: var(--duo-green);
    color: white;
}

.flashcard-action-btn.delete:hover {
    background: #e53935;
}

/* 移动端触摸支持 */
@media (hover: hover) and (pointer: fine) {
    .playlist-file:hover {
        background: #F7F7F7;
    }

    .playlist-file:hover .playlist-file-delete,
    .playlist-file:focus-within .playlist-file-delete {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

@media (hover: none) {
    .playlist-file-delete {
        opacity: 0.72;
        visibility: visible;
        pointer-events: auto;
    }

    .flashcard-item-actions {
        opacity: 1;
    }
}

/* ============ 导出模态框样式 ============ */
.export-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10010;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.export-overlay.show {
    opacity: 1;
    visibility: visible;
}

.export-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 10020;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.export-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.export-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.export-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--duo-text);
}

.export-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--duo-text-light);
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.export-close:hover {
    background: #f0f0f0;
}

.export-body {
    padding: 16px;
}

.export-section {
    margin-bottom: 20px;
}

.export-section:last-child {
    margin-bottom: 0;
}

.export-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--duo-text-light);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.export-option {
    display: flex;
    flex-direction: column;
    background: #f8f8f8;
    border: 2px solid transparent;
    -webkit-tap-highlight-color: transparent;
    border-radius: 12px;
    transition: all 0.2s;
    width: 100%;
}

.export-option:hover:not(.is-active):not(.is-disabled) {
    background: #f0f0f0;
    border-color: var(--duo-green);
}

.export-option.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.export-option.is-active {
    border-color: var(--duo-green);
    background: #f0f8ff;
}

.export-option-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    width: 100%;
    font: inherit;
    -webkit-tap-highlight-color: transparent;
}

.export-option.is-active .export-option-trigger,
.export-option.is-disabled .export-option-trigger {
    pointer-events: none;
}

/* 卡片内进度显示 */
.export-option-progress {
    padding: 10px 14px 14px;
}

.export-option-progress-text {
    font-size: 0.85rem;
    color: var(--duo-text);
    margin-bottom: 8px;
    text-align: center;
}

.export-option-progress-inner {
    height: 100%;
    background: var(--duo-green);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s;
}

/* 字幕类型选择器 */
.export-subtitle-select {
    padding: 6px 14px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.export-subtitle-select-title {
    width: 100%;
    font-size: 0.8rem;
    color: var(--duo-text-light);
    margin-bottom: 2px;
}

.export-subtitle-option {
    padding: 5px 12px;
    border-radius: 8px;
    border: 1.5px solid #ddd;
    background: white;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--duo-text);
}

.export-subtitle-option:hover {
    border-color: var(--duo-green);
    background: #f0fff0;
}

.export-option-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 10px;
    flex-shrink: 0;
}

.export-option-text {
    flex: 1;
    min-width: 0;
}

.export-option-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--duo-text);
}

.export-option-desc {
    font-size: 0.8rem;
    color: var(--duo-text-light);
    margin-top: 2px;
}

.export-progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

/* 导出按钮样式 */
.btn-outline {
    background: transparent;
    border: 2px solid var(--duo-green);
    color: var(--duo-green);
}

.btn-outline:hover {
    background: var(--duo-green);
    color: white;
}

/* 小型按钮 */
.btn-xs {
    padding: 2px 8px;
    font-size: 0.75rem;
    border-radius: 6px;
    border-width: 1px;
}

/* 翻译单句按钮 */
.translate-single-btn {
    margin-left: 8px;
    vertical-align: middle;
}

.translate-single-btn .spin {
    display: inline-block;
    animation: spin 1s linear infinite;
}

.export-row {
    justify-content: flex-start;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--duo-green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    margin-top: 16px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
}

.loading-progress {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============ 电子书朗读样式 ============ */

.ebook-input-wrapper {
    border-color: #ff9600;
    background: linear-gradient(135deg, #fff8ed 0%, #fff4e0 100%);
}

.ebook-input-wrapper:hover {
    border-color: #ff9600;
    background: linear-gradient(135deg, #fff4e0 0%, #ffeed0 100%);
}

/* TTS 控制区 */
.tts-control-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px;
    background: var(--bg-elevated);
    border-radius: 12px;
    margin-bottom: 16px;
    align-items: center;
}

.tts-voice-select-wrapper,
.tts-rate-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tts-voice-select-wrapper label,
.tts-rate-wrapper label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.tts-voice-select-wrapper .select {
    min-width: 150px;
    max-width: 250px;
}

.tts-rate-wrapper .select {
    width: 80px;
}

/* 电子书段落列表 */
.ebook-paragraphs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ebook-paragraph {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-elevated);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    -webkit-tap-highlight-color: transparent;
}

.ebook-paragraph:hover {
    background: var(--bg-hover);
}

.ebook-paragraph.active {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-color: var(--duo-green);
}

.ebook-paragraph-index {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--duo-green-light);
    color: var(--duo-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
}

.ebook-paragraph.active .ebook-paragraph-index {
    background: var(--duo-green);
    color: white;
}

.ebook-paragraph-text {
    flex: 1;
    line-height: 1.6;
    color: var(--text-primary);
    font-size: 1rem;
}

/* 响应式调整 */
@media (max-width: 480px) {
    .tts-control-row {
        flex-direction: column;
        align-items: stretch;
    }

    .tts-voice-select-wrapper,
    .tts-rate-wrapper {
        width: 100%;
    }

    .tts-voice-select-wrapper .select,
    .tts-rate-wrapper .select {
        flex: 1;
        max-width: none;
    }

    .ebook-paragraph {
        padding: 10px;
    }

    .ebook-paragraph-text {
        font-size: 0.9375rem;
    }
}

/* 列表项菜单 */
.item-menu {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 10010;
    min-width: 160px;
    padding: 8px 0;
    animation: menuFadeIn 0.15s ease;
}

@keyframes menuFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.item-menu-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--duo-text);
    transition: background 0.15s;
}

.item-menu-option:hover {
    background: #f5f5f5;
}

.item-menu-option svg {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

.item-menu-option.danger {
    color: var(--duo-red);
}

.item-menu-option.danger svg {
    opacity: 1;
}

.item-menu-divider {
    height: 1px;
    background: #eee;
    margin: 8px 0;
}

/* URL 导入按钮 */
.import-btn-url {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
}

.import-btn-url:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 模态框通用样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10010;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal > .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    z-index: 10020;
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.25s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--duo-text);
}

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

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

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid #eee;
}

/* URL 输入框 */
.url-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.url-input:focus {
    border-color: var(--duo-green);
    box-shadow: 0 0 0 4px rgba(88, 204, 2, 0.15);
}

.url-hint {
    margin: 12px 0 0;
    font-size: 0.85rem;
    color: #888;
}

.url-error {
    margin: 12px 0 0;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: #d32f2f;
    background: #ffebee;
    border-radius: 8px;
    border-left: 3px solid #d32f2f;
}

/* 按钮样式 */
.btn-secondary {
    background: #f0f0f0;
    color: var(--duo-text);
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-loading::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    -webkit-tap-highlight-color: transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 生成复习卡弹窗滑块样式 */
.slider-container {
    padding: 8px 0;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 500;
}

.slider-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--duo-green);
}

.card-count-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e0e0e0;
    outline: none;
    cursor: pointer;
}

.card-count-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--duo-green);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(88, 204, 2, 0.4);
    transition: transform 0.15s, box-shadow 0.15s;
}

.card-count-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 12px rgba(88, 204, 2, 0.5);
}

.card-count-slider::-webkit-slider-thumb:active {
    transform: scale(1.05);
}

.card-count-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: var(--duo-green);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(88, 204, 2, 0.4);
}

.slider-range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: #888;
}

/* ==================== 用户模块样式 ==================== */

/* 用户按钮 - 在标题栏右上角 */
.user-btn {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 8px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.user-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.user-btn.anonymous {
    background: rgba(255, 255, 255, 0.1);
    gap: 0;
    padding: 6px;
}

.user-btn.anonymous:hover {
    background: rgba(255, 255, 255, 0.2);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--duo-green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.user-btn.anonymous .user-avatar {
    background: var(--duo-gray-dark);
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    color: white;
    font-size: 13px;
    font-weight: 600;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 用户弹窗 */
.user-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10010;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.user-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.user-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: calc(100% - 32px);
    max-width: 360px;
    max-height: calc(100vh - 40px);
    background: white;
    border-radius: var(--radius);
    z-index: 10020;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    overflow: hidden;
}

.user-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.user-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.user-modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--duo-text);
}

.user-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.user-modal-close:hover {
    background: #eee;
    color: #333;
}

.user-modal-body {
    padding: 24px 20px;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

/* 用户弹窗内部组件 */
.user-modal-section {
    text-align: center;
    margin-bottom: 20px;
}

.user-modal-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--duo-green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    margin: 0 auto 16px;
}

.user-modal-avatar.anonymous {
    background: #e0e0e0;
    color: #999;
}

.user-modal-avatar svg {
    width: 40px;
    height: 40px;
}

.user-modal-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-modal-status {
    font-size: 16px;
    font-weight: 700;
    color: var(--duo-text);
    margin-bottom: 4px;
}

.user-modal-hint {
    font-size: 13px;
    color: var(--duo-text-light);
}

.user-modal-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--duo-text);
    margin-bottom: 4px;
}

.user-modal-email {
    font-size: 14px;
    color: var(--duo-text-light);
}

.user-detail-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 20px;
    padding: 12px;
    border: 1px solid var(--duo-border);
    border-radius: 8px;
    background: #fafafa;
}

.user-detail-row {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    font-size: 13px;
    line-height: 1.45;
}

.user-detail-row span {
    color: var(--duo-text-light);
}

.user-detail-row strong {
    color: var(--duo-text);
    font-weight: 600;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.user-detail-copy {
    margin-top: 4px;
    padding: 10px 12px;
    font-size: 13px;
}

.user-action-spaced {
    margin-top: 8px;
}

.user-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--duo-text);
}

.user-modal-message {
    text-align: center;
    color: var(--duo-text-light);
    padding: 40px 0;
}

/* 表单样式 */
.user-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fafafa;
    color: var(--duo-text);
    transition: all 0.2s;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--duo-green);
    background: white;
}

.form-input::placeholder {
    color: #aaa;
}

/* 分隔线 */
.user-modal-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #ccc;
    font-size: 13px;
}

.user-modal-divider::before,
.user-modal-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.user-modal-divider span {
    padding: 0 12px;
}

/* 按钮增强 */
.btn-block {
    width: 100%;
}

.btn-outline {
    background: white;
    border: 2px solid #e0e0e0;
    color: var(--duo-text);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-text {
    background: none;
    border: none;
    color: var(--duo-text-light);
    padding: 12px;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-text:hover {
    color: var(--duo-text);
}

/* 播放模式下隐藏用户按钮 */
body.player-mode .user-btn {
    display: none !important;
}

/* ArtPlayer 视频播放器样式 */
body.video-mode .player-media-section {
    padding: 0;
}

body.video-mode .player-media-section #mediaContainer {
    padding: 0;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    height: calc(50vh - 80px);
    height: calc(50dvh - 80px);
    min-height: 200px;
}

body.video-mode .player-media-section #mediaContainer .art-video-player {
    width: 100%;
    height: 100%;
}

/* ArtPlayer 主题覆盖 */
.art-video-player .art-bottom {
    background: linear-gradient(transparent, rgba(0,0,0,0.7)) !important;
}

.art-video-player .art-progress-hover {
    background: #58CC02 !important;
}

.art-video-player .art-control-progress .art-control-progress-inner {
    background: rgba(255,255,255,0.24) !important;
}

.art-video-player .art-control-progress .art-control-progress-inner .art-progress-loaded {
    background: rgba(255,255,255,0.38) !important;
}

.art-video-player .art-control-progress .art-control-progress-inner .art-progress-played {
    background: #58CC02 !important;
}

.art-video-player .art-control-progress .art-control-progress-inner .art-progress-indicator {
    background: #58CC02 !important;
    border-color: #58CC02 !important;
}

/* 控制栏按钮颜色 */
.art-video-player .art-controls .art-control {
    color: white;
}

.art-video-player .art-controls .art-control:hover {
    color: #58CC02;
}

/* 设置面板 */
.art-video-player .art-settings {
    background: rgba(0, 0, 0, 0.9) !important;
    border-radius: 8px !important;
}

.art-video-player .art-setting-item:hover {
    background: rgba(88, 204, 2, 0.2) !important;
}

.art-video-player .art-setting-item-right-icon {
    color: #58CC02 !important;
}

/* 移动端优化 */
@media (max-width: 600px) {
    body.video-mode .player-media-section #mediaContainer .art-video-player {
        max-height: calc(40vh - 60px);
        max-height: calc(40dvh - 60px);
    }

    .art-video-player .art-bottom {
        padding: 0 8px !important;
    }

    .art-video-player .art-controls .art-control {
        padding: 0 6px !important;
    }
}

/* 音频模式 ArtPlayer 样式 */
body.audio-mode .art-video-player .art-bottom {
    background: rgba(0, 0, 0, 0.6) !important;
    height: 56px !important;
    /* 始终显示，不依赖 hover */
    opacity: 1 !important;
    pointer-events: auto !important;
    /* 覆盖 inset:0，将控制栏固定在底部 */
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
}

/* 重置控制栏 translate 偏移，始终展开 */
body.audio-mode .art-video-player .art-bottom .art-controls,
body.audio-mode .art-video-player .art-bottom .art-progress {
    transform: translateY(0) !important;
    transition: none !important;
}

body.audio-mode .art-video-player .art-controls {
    height: 40px !important;
    padding: 0 8px !important;
}

body.audio-mode .art-video-player .art-controls .art-control {
    padding: 0 10px !important;
}

body.audio-mode .art-video-player .art-controls .art-icon {
    width: 20px !important;
    height: 20px !important;
}

body.audio-mode .art-video-player .art-progress {
    height: 4px !important;
    margin: 0 8px !important;
}

/* 音频模式下顶部工具栏始终显示 */
body.audio-mode .art-video-player .art-top-toolbar {
    opacity: 1 !important;
    visibility: visible !important;
}

/* 隐藏音频模式下的全屏和网页全屏按钮 */
body.audio-mode .art-video-player .art-controls .art-control-fullscreen,
body.audio-mode .art-video-player .art-controls .art-control-fullscreenWeb {
    display: none !important;
}

/* 音频模式下隐藏中间播放按钮和遮罩层 */
body.audio-mode .art-video-player .art-mask {
    pointer-events: none !important;
}

body.audio-mode .art-video-player .art-state {
    display: none !important;
}

/* ArtPlayer 全屏修复 - class 在 .art-video-player 上 */
.art-video-player.art-fullscreen,
.art-video-player.art-fullscreen-web {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: none !important;
    z-index: 9999 !important;
    background: #000 !important;
}

.art-video-player.art-fullscreen video,
.art-video-player.art-fullscreen-web video {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
}

/* 控制栏按钮样式 */
.art-video-player .art-control .art-playback-rate {
    color: #58CC02;
}

/* ArtPlayer 顶部工具栏 */
.art-top-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px;
    opacity: 0;
    transition: opacity 0.3s;
}

.art-video-player.art-hover .art-top-toolbar,
.art-video-player.art-control-show .art-top-toolbar {
    opacity: 1;
}

.art-top-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.art-top-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.art-top-btn:active {
    background: rgba(88, 204, 2, 0.5);
}

.art-top-btn.active {
    background: rgba(0, 0, 0, 0.5);
}

.art-top-btn.active svg {
    color: #58CC02;
    fill: #58CC02;
}

.art-top-btn .speed-text {
    font-size: 13px;
    font-weight: bold;
    color: #58CC02;
}

.art-top-btn svg {
    width: 20px;
    height: 20px;
}

.art-top-btn .sleep-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #9C27B0;
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
}

/* 倍速选择菜单 */
.speed-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 10010;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.speed-menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

.speed-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    z-index: 10020;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    max-height: 80vh;
    overflow-y: auto;
}

.speed-menu.show {
    transform: translateY(0);
}

.speed-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #E8E8E8;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--duo-text);
}

.speed-menu-close {
    background: #F0F0F0;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--duo-text-light);
}

.speed-menu-close:hover {
    background: #E0E0E0;
}

.speed-menu-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 16px;
}

.audio-tracks-content {
    padding: 8px 0;
}

.audio-track-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
}

.audio-track-option:hover {
    background: #F5F5F5;
}

.audio-track-option.active {
    background: #E8F5E9;
}

.audio-track-option .track-icon {
    font-size: 1.2rem;
}

.audio-track-option .track-name {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--duo-text);
}

.audio-track-option .track-check {
    color: var(--duo-green);
    font-weight: bold;
    opacity: 0;
}

.audio-track-option.active .track-check {
    opacity: 1;
}

/* 旧的音轨样式 - 保留兼容 */
.audio-track-item {
    padding: 12px 16px;
    border-bottom: 1px solid #E8E8E8;
}

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

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

.audio-track-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--duo-text);
}

.audio-track-name span {
    font-weight: 400;
    color: var(--duo-text-light);
    margin-left: 4px;
}

.audio-track-mute {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--duo-text-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.audio-track-mute:hover {
    background: #F0F0F0;
}

.audio-track-mute.muted {
    color: #FF4B4B;
}

.audio-track-volume {
    display: flex;
    align-items: center;
    gap: 12px;
}

.audio-track-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #E0E0E0;
    outline: none;
    cursor: pointer;
}

.audio-track-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--duo-green);
    cursor: pointer;
}

.audio-track-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--duo-green);
    cursor: pointer;
    border: none;
}

.audio-track-volume span {
    min-width: 40px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--duo-green);
    text-align: right;
}

.speed-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 8px;
    background: #F7F7F7;
    border: 2px solid transparent;
    -webkit-tap-highlight-color: transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 1rem;
    font-weight: 600;
    color: var(--duo-text);
}

.speed-option:hover {
    background: #EFEFEF;
}

.speed-option:active {
    transform: scale(0.95);
}

.speed-option.active {
    background: #E8F5E9;
    border-color: #58CC02;
    color: #58CC02;
}

/* 转录/翻译弹窗样式 */
.modal-form-item {
    margin-bottom: 16px;
}

.modal-form-item:last-child {
    margin-bottom: 0;
}

#autoTranslateOptionsWrapper {
    margin-bottom: 16px;
}

.modal-form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--duo-text);
}

.modal-form-item .select {
    width: 100%;
}

.modal-form-item .input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E5E5E5;
    border-radius: 12px;
    font-size: 1rem;
}

.modal-form-item .input:focus {
    border-color: var(--duo-blue);
    outline: none;
}

/* Switch 样式 */
.switch-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.switch-label span:first-child {
    font-size: 0.95rem;
    color: var(--duo-text);
}

.switch-label input {
    display: none;
}

.switch-label .switch-slider {
    position: relative;
    width: 48px;
    height: 26px;
    background: #E0E0E0;
    border-radius: 13px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.switch-label .switch-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.switch-label input:checked + .switch-slider {
    background: var(--duo-green);
}

.switch-label input:checked + .switch-slider::after {
    transform: translateX(22px);
}

/* Modal 内的 Switch */
.modal-switch {
    padding: 12px 0;
    border-top: 1px solid #f0f0f0;
}

.modal-switch:first-of-type {
    border-top: none;
    padding-top: 0;
}

/* 文稿界面选项行 */
.transcript-actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.transcript-actions-row .btn {
    flex: 1;
    min-width: 80px;
}

.transcript-options-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 12px;
}

.transcript-options-row .switch-label {
    flex: 1;
    min-width: 140px;
}

.transcript-options-row .switch-label span:first-child {
    font-size: 0.85rem;
    color: var(--duo-text-light);
}

/* =========================
   价格页面样式
========================= */
.pricing-modal-content {
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
}

.pricing-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-weight: 600;
}

.pricing-status-free {
    background: #f0f0f0;
    color: var(--duo-text);
}

.pricing-status-premium {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #333;
}

.status-icon {
    font-size: 1.2rem;
}

.status-trial {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--duo-text-light);
}

.pricing-credits-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-radius: 12px;
    margin-bottom: 20px;
}

.credits-icon {
    font-size: 1.5rem;
}

.credits-amount {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--duo-green-dark);
}

.credits-label {
    color: var(--duo-text-light);
}

.pricing-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.pricing-card-lifetime {
    border: 3px solid var(--duo-green);
}

.pricing-card-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--duo-orange);
    color: white;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    border-bottom-left-radius: 12px;
}

.pricing-card-header {
    text-align: center;
    margin-bottom: 16px;
}

.pricing-card-header h4 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.pricing-card-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.price-original {
    font-size: 1.2rem;
    color: var(--duo-text-light);
    text-decoration: line-through;
}

.price-sale {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--duo-green);
}

.pricing-card-desc {
    color: var(--duo-text-light);
    font-size: 0.9rem;
    margin-top: 4px;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.pricing-features li {
    padding: 8px 0;
    color: var(--duo-text);
    border-bottom: 1px solid #f0f0f0;
}

.pricing-features li:last-child {
    border-bottom: none;
}

.pricing-buy-btn {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
}

.pricing-buy-btn .btn-loading-label {
    display: none;
}

.pricing-buy-btn.btn-loading .btn-loading-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.pricing-section-title {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.pricing-section-desc {
    color: var(--duo-text-light);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.pricing-packages {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.pricing-package {
    background: #f8f8f8;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.pricing-package-disabled {
    opacity: 0.65;
}

.pricing-package:hover {
    border-color: var(--duo-green);
    background: #f0fff0;
}

.pricing-package:active {
    transform: scale(0.98);
}

.pricing-package-loading {
    border-color: var(--duo-green);
    background: #f0fff0;
}

.pricing-package-loading::after {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(88, 204, 2, 0.25);
    border-top-color: var(--duo-green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.package-credits {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--duo-text);
}

.package-price {
    font-size: 1rem;
    color: var(--duo-green-dark);
    font-weight: 600;
    margin-top: 4px;
}

.package-bonus {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--duo-red);
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 700;
}

.package-loading-label {
    display: none;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--duo-green-dark);
    font-weight: 700;
}

.pricing-package-loading .package-loading-label {
    display: block;
}

.pricing-consumption-info {
    margin-top: 16px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--duo-text-light);
}

.pricing-consumption-info p {
    margin: 4px 0;
}

/* 用户会员状态徽章 */
.user-plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 8px;
}

.user-plan-free {
    background: #f0f0f0;
    color: var(--duo-text);
}

.user-plan-premium {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #333;
}

/* 开关按钮样式 */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--duo-green);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* 缓存条件样式 */
.cache-condition {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 0;
}

.cache-condition-label {
  flex: 1;
  font-size: 0.9rem;
  color: var(--duo-text);
}

.cache-size-input {
  width: 60px;
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  text-align: center;
}

.cache-size-input:focus {
  outline: none;
  border-color: var(--duo-green);
}

.cache-size-unit {
  font-size: 0.85rem;
  color: var(--duo-text-light);
}

/* 窄屏仅显示图标，避免溢出 */
@media (max-width: 480px) {
    .tabs {
        padding: 6px;
        gap: 6px;
        flex-wrap: nowrap;
        justify-content: center;
    }

    .tab-btn {
        padding: 12px 10px;
        font-size: 0.9rem;
        gap: 6px;
    }

    .tab-btn span {
        display: inline;
        white-space: nowrap;
    }

    .tab-btn svg {
        display: none;
    }
}

/* 模型下载文件列表 */
.progress-item-files {
    align-items: flex-start;
}

.file-progress-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 2px;
}

.file-progress-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px 48px;
    gap: 10px;
    align-items: center;
}

.file-progress-name {
    font-size: 0.78rem;
    color: var(--duo-text);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-progress-bar {
    height: 8px;
    background: var(--duo-gray);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #d0d0d0;
}

.file-progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    width: 0%;
    transition: width 0.2s;
}

.file-progress-percent {
    font-size: 0.75rem;
    color: var(--duo-text-light);
    text-align: right;
    font-family: ui-monospace, monospace;
    font-weight: 700;
}

.progress-bar-inner-instant {
    transition: none;
}

/* ============ 播放页配音样式 ============ */
.dubbing-control-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    background: var(--bg-elevated);
    border-radius: 12px;
    margin-bottom: 6px;
    align-items: center;
}

.dubbing-field {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dubbing-field label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.dubbing-status {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

#dubbingQueue {
    display: none;
}

.dubbing-queue-item {
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.dubbing-queue-item.active {
    border-color: #58CC02;
    box-shadow: 0 0 0 1px rgba(88, 204, 2, 0.25);
}

.dubbing-queue-item .dubbing-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

#mimoApiKey {
    min-width: 220px;
}

.dubbing-switch {
    gap: 12px;
}

#dubbingDetails {
    margin-top: 8px;
}

.dubbing-speed {
    margin-top: 8px;
    padding: 8px;
    border-radius: 12px;
    background: var(--bg-elevated);
}

.dubbing-speed-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dubbing-speed-control .dubbing-rate-slider {
    flex: 1;
}

.dubbing-speed-control span {
    min-width: 40px;
    text-align: right;
    font-weight: 600;
    color: var(--duo-green);
}

.dubbing-speed-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.dubbing-speed-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--duo-green);
    margin-bottom: 6px;
}

.dubbing-rate-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e0e0e0;
    outline: none;
    cursor: pointer;
}

.dubbing-rate-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--duo-green);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(88, 204, 2, 0.4);
    transition: transform 0.15s, box-shadow 0.15s;
}

.dubbing-rate-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 12px rgba(88, 204, 2, 0.5);
}

.dubbing-rate-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: var(--duo-green);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(88, 204, 2, 0.4);
}

.dubbing-control-row {
    justify-content: space-between;
    width: 100%;
    flex-wrap: wrap;
}

.dubbing-field {
    min-width: 0;
    flex: 1 1 auto;
}

.dubbing-switch {
    margin-left: auto;
}

@media (max-width: 640px) {
    .dubbing-control-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .dubbing-field {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .dubbing-field label {
        margin-bottom: 4px;
    }

    .dubbing-field .select,
    .dubbing-field .input {
        width: 100%;
    }

    .dubbing-switch {
        width: 100%;
        justify-content: space-between;
    }
}

.dubbing-compact-row {
    margin-bottom: 2px;
}

#dubbingDetails {
    margin-top: 4px;
}

.dubbing-field .input,
.dubbing-field .select {
    width: 100%;
    min-width: 0;
}

.dubbing-field {
    flex: 1 1 auto;
}
.dubbing-progress-status {
    padding: 12px 16px;
    margin: 8px 0;
    background: linear-gradient(135deg, #E8F5E9 0%, #F1F8E9 100%);
    border-radius: 12px;
    font-size: 0.9rem;
    color: #2E7D32;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dubbing-progress-status::before {
    content: "🎙️";
}
.dubbing-status-badge {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.dubbing-status-badge.status-ready {
    background: #E8F5E9;
    color: #2E7D32;
}

.dubbing-status-badge.status-queued {
    background: #FFF3E0;
    color: #E65100;
}

.dubbing-status-badge.status-error {
    background: #FFEBEE;
    color: #C62828;
}

/* 音量控制样式 */
.audio-volume-control {
    padding: 12px 16px;
    border-bottom: 1px solid #E8E8E8;
}

.audio-volume-control:last-child {
    border-bottom: none;
}

.audio-volume-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.audio-volume-header .track-icon {
    font-size: 1.1rem;
}

.audio-volume-header .track-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--duo-text);
}

.audio-volume-value {
    min-width: 40px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--duo-green);
    text-align: right;
}

.audio-volume-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #E0E0E0;
    outline: none;
    cursor: pointer;
}

.audio-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--duo-green);
    cursor: pointer;
    transition: transform 0.1s;
}

.audio-volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.audio-volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--duo-green);
    cursor: pointer;
    border: none;
}

/* 配音开关样式 */
.dubbing-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #F5F5F5;
    border-radius: 12px;
    margin-bottom: 16px;
}

.dubbing-toggle-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--duo-text);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--duo-green);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.dubbing-settings-section {
    transition: opacity 0.2s;
}

/* 配音按钮激活状态 */
#dubbingBtn.active {
    background: var(--duo-green);
    color: white;
    border-color: var(--duo-green);
}

#dubbingBtn.active .dubbing-icon {
    filter: drop-shadow(0 0 2px rgba(255,255,255,0.5));
}
/* 配音开关行 */
.audio-toggle-control {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #E8E8E8;
}

.audio-toggle-control .track-icon {
    font-size: 1.2rem;
}

.audio-toggle-control .track-name {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--duo-text);
}

.audio-toggle-control .toggle-switch {
    width: 48px;
    height: 26px;
}

.audio-toggle-control .toggle-slider:before {
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
}

.audio-toggle-control .toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}
/* 全屏模式下弹窗样式修复 - 仅修改定位 */
.art-video-player.art-fullscreen .speed-menu-overlay,
.art-video-player.art-fullscreen-web .speed-menu-overlay,
.art-video-player.art-fullscreen #audioTracksMenuOverlay,
.art-video-player.art-fullscreen-web #audioTracksMenuOverlay {
    position: absolute !important;
}

.art-video-player.art-fullscreen .speed-menu,
.art-video-player.art-fullscreen-web .speed-menu,
.art-video-player.art-fullscreen #audioTracksMenu,
.art-video-player.art-fullscreen-web #audioTracksMenu {
    position: absolute !important;
}

.art-video-player.art-fullscreen .user-modal-overlay,
.art-video-player.art-fullscreen-web .user-modal-overlay {
    position: absolute !important;
}

.art-video-player.art-fullscreen .user-modal,
.art-video-player.art-fullscreen-web .user-modal {
    position: absolute !important;
}

.art-video-player.art-fullscreen .modal-overlay,
.art-video-player.art-fullscreen-web .modal-overlay,
.art-video-player.art-fullscreen #dubbingModal,
.art-video-player.art-fullscreen-web #dubbingModal {
    position: absolute !important;
}
