* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    color: #fff;
    min-height: 100vh;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* 标题和副标题显示在渐变背景上，不在黑框内 */
header {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
    max-width: 800px;
    background: transparent;
    padding: 0;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    background: linear-gradient(to right, #ff7e5f, #feb47b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: #ddd;
    font-size: 1rem;
}

.container {
    max-width: 800px;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Anki部分样式 */
.anki-section {
    margin-bottom: 20px;
}

.anki-container {
    background: rgba(30, 30, 40, 0.9);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* 移动端Anki状态和按钮在同一行 */
.anki-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.anki-status {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 200px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
}

.status-connected {
    background-color: #2ecc71;
}

.status-disconnected {
    background-color: #e74c3c;
}

.anki-controls {
    display: flex;
    gap: 8px;
}

.anki-btn {
    background: rgba(155, 89, 182, 0.7);
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.anki-btn:hover, .anki-btn:active {
    background: rgba(155, 89, 182, 1);
}

/* 顶部按钮布局 - 移动端优化 */
.top-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    align-items: center;
    justify-content: center;
}

.media-mode-btn {
    background: rgba(52, 152, 219, 0.7);
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    flex: 1;
    max-width: 120px;
}

.media-mode-btn:hover, .media-mode-btn:active {
    background: rgba(52, 152, 219, 1);
}

.language-mode-btn {
    background: rgba(155, 89, 182, 0.7);
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    flex: 1;
    max-width: 120px;
}

.language-mode-btn:hover, .language-mode-btn:active {
    background: rgba(155, 89, 182, 1);
}

.import-controls {
    display: flex;
    gap: 8px;
    flex: 2;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.import-btn {
    background: rgba(52, 152, 219, 0.7);
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    flex: 1;
}

.import-btn:hover, .import-btn:active {
    background: rgba(52, 152, 219, 1);
}

/* 自动配置区域 */
.auto-config-section {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
}

.auto-config-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.auto-config-label {
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #ddd;
}

.auto-config-select {
    padding: 8px 10px;
    border: none;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 0.9rem;
}

/* 播放器区域 */
.player-section {
    margin-bottom: 25px;
}

.player-container {
    background: rgba(30, 30, 40, 0.9);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

.video-player {
    width: 100%;
    height: 400px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    display: none;
}

.video-player.active {
    display: block;
}

.video-player video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.audio-player {
    width: 100%;
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    padding: 15px;
    display: none;
}

.audio-player.active {
    display: block;
}

.audio-player-container {
    width: 100%;
}

.audio-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.audio-progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    position: relative;
}

.audio-time {
    font-size: 0.8rem;
    color: #ddd;
    min-width: 40px;
}

.audio-progress {
    flex: 1;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.audio-progress-filled {
    height: 100%;
    background: #3498db;
    width: 0%;
    transition: width 0.1s;
}

.progress-thumb {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.audio-volume-container {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.audio-volume {
    flex: 1;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.audio-volume-filled {
    height: 100%;
    background: #2ecc71;
    width: 50%;
}

.volume-thumb {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.audio-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.audio-btn {
    background: transparent;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.audio-btn.active {
    color: #3498db;
    transform: scale(1.1);
}

/* 音频信息 */
.audio-info {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.album-art {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    background: linear-gradient(45deg, #3498db, #8e44ad);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.album-art i {
    font-size: 30px;
    color: rgba(255, 255, 255, 0.8);
}

.track-info h2 {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.track-info p {
    color: #bbb;
    font-size: 0.9rem;
}

/* 字幕区域 */
.subtitle-section {
    margin-bottom: 25px;
}

.subtitle-display {
    background: rgba(30, 30, 40, 0.9);
    border-radius: 10px;
    padding: 15px;
    min-height: 100px;
    margin-bottom: 15px;
    line-height: 1.6;
    font-size: 1.1rem;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    user-select: text;
}

.subtitle-text {
    transition: all 0.3s;
}

.subtitle-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.subtitle-btn {
    background: rgba(52, 152, 219, 0.7);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.subtitle-btn:hover, .subtitle-btn:active {
    background: rgba(52, 152, 219, 1);
}

.hint {
    text-align: center;
    color: #bbb;
    font-size: 0.9rem;
    margin-top: 10px;
    line-height: 1.4;
}

/* 视频控制按钮 */
.video-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.control-btn {
    background: rgba(52, 152, 219, 0.7);
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    min-width: 36px;
    min-height: 36px;
}

.control-btn:hover, .control-btn:active {
    background: rgba(52, 152, 219, 1);
}

/* 剪贴板按钮激活状态 */
.control-btn.active {
    background: rgba(46, 204, 113, 0.8);
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.5);
}

.control-btn.active:hover {
    background: rgba(46, 204, 113, 1);
}

/* 时间跳转栏 */
.time-input-container {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.time-input {
    flex: 1;
    padding: 8px 10px;
    border: none;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9rem;
    max-width: 120px;
    min-width: 80px;
}

.time-jump-btn {
    background: rgba(52, 152, 219, 0.7);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 视频字幕 - 彻底修复单词黑框问题 */
.video-subtitles {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-size: 1rem;
    text-shadow: 
        1px 1px 3px rgba(0, 0, 0, 0.8),
        -1px -1px 3px rgba(0, 0, 0, 0.8),
        1px -1px 3px rgba(0, 0, 0, 0.8),
        -1px 1px 3px rgba(0, 0, 0, 0.8);
    padding: 0 15px;
    z-index: 10;
    cursor: text;
    user-select: text;
    pointer-events: none;
}

.video-subtitles span {
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
    max-width: 90%;
    cursor: text;
    user-select: text;
    pointer-events: auto;
}

/* 彻底移除视频字幕中的单词单独背景 */
.video-subtitles .word-span,
.video-subtitles .word,
.video-subtitles .selectable-word {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: inline !important;
    box-shadow: none !important;
    border: none !important;
    text-shadow: inherit !important;
}

.video-subtitles .word-span:hover,
.video-subtitles .word:hover,
.video-subtitles .selectable-word:hover {
    background: rgba(52, 152, 219, 0.3) !important;
}

/* 音频字幕 */
.audio-subtitles {
    margin-top: 15px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    display: none;
}

.audio-subtitles.active {
    display: block;
}

.audio-subtitle-item {
    padding: 8px 10px;
    margin-bottom: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
    cursor: pointer;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    line-height: 1.4;
    word-spacing: normal;
    letter-spacing: normal;
    white-space: normal;
    text-align: left;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    width: 100%;
    box-sizing: border-box;
}

.audio-subtitle-item:hover, .audio-subtitle-item:active {
    background: rgba(52, 152, 219, 0.2);
}

.audio-subtitle-item.active {
    background: rgba(52, 152, 219, 0.4);
}

/* 底部面板样式 */
.dictionary-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 30, 40, 0.98);
    border-radius: 15px 15px 0 0;
    padding: 15px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
}

.dictionary-panel.active {
    transform: translateY(0);
}

/* 词典标题栏固定在顶部 - 缩小高度并消除缝隙 */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: -15px;
    background: rgba(30, 30, 40, 0.98);
    z-index: 10;
    margin-top: -15px;
    padding-top: 15px;
    min-height: auto;
}

.panel-title {
    font-size: 1.1rem;
    font-weight: bold;
}

.close-panel {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 5px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 搜索和Anki按钮 - 修复按钮超出范围 */
.panel-search-anki-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.panel-search-container {
    display: flex;
    gap: 6px;
    width: 100%;
    align-items: center;
    flex-wrap: nowrap;
    overflow: hidden;
}

.panel-search-input {
    flex: 1;
    padding: 10px 12px;
    border: none;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    min-height: 40px;
    min-width: 0;
}

/* 统一按钮大小并确保不超出范围 */
.panel-search-btn,
.append-word-btn,
.panel-anki-btn {
    background: rgba(46, 204, 113, 0.7);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    min-width: 40px;
    width: 40px;
    flex-shrink: 0;
}

.panel-search-btn:hover, .panel-search-btn:active {
    background: rgba(46, 204, 113, 1);
}

.append-word-btn {
    background: rgba(241, 196, 15, 0.7);
}

.append-word-btn:hover, .append-word-btn:active {
    background: rgba(241, 196, 15, 1);
}

.panel-anki-btn {
    background: rgba(231, 76, 60, 0.7);
}

.panel-anki-btn:hover, .panel-anki-btn:active {
    background: rgba(231, 76, 60, 1);
}

/* 原句显示 - 修复换行问题 */
.original-sentence {
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    line-height: 1.5;
    font-size: 1rem;
    word-spacing: normal;
    letter-spacing: normal;
    white-space: normal;
    text-align: left;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.sentence-word {
    cursor: pointer;                 /* 鼠标悬停变手型 */
    display: inline;                 /* 紧密排列 */
    padding: 0;                      /* 内边距去掉 */
    margin: 0;                       /* 外间距去掉 */
    word-break: keep-all;            /* 不换行 */
    transition: background-color 0.2s; /* 高亮过渡效果 */
}

.sentence-word:hover, .sentence-word:active {
    background-color: rgba(52, 152, 219, 0.2);
}

.sentence-word.highlight {
    background-color: rgba(255, 215, 0, 0.3);
}

/* 标签页样式 */
.dictionary-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
    overflow-x: auto;
}

.tab-button {
    background: transparent;
    color: #bbb;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
    font-size: 0.9rem;
    white-space: nowrap;
    min-height: 40px;
}

.tab-button.active {
    color: #3498db;
    border-bottom: 2px solid #3498db;
}

.tab-button:hover {
    color: #3498db;
}

.tab-content {
    position: relative;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* 词典结果样式 */
.dictionary-result {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    min-height: 100px;
    line-height: 1.6;
    max-height: 300px;
    overflow-y: auto;
    font-size: 0.95rem;
}

.word-header {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.word-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-right: 15px;
}

.phonetic {
    color: #3498db;
    font-style: italic;
}

.meaning-section {
    margin-bottom: 15px;
}

.part-of-speech {
    font-weight: bold;
    color: #2ecc71;
    margin-bottom: 5px;
}

.definition {
    margin-left: 15px;
    margin-bottom: 5px;
}

.example {
    margin-left: 15px;
    font-style: italic;
    color: #ddd;
    margin-bottom: 8px;
}

/* 油猴结果样式 */
.tampermonkey-result {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    min-height: 100px;
    line-height: 1.6;
    max-height: 300px;
    overflow-y: auto;
    font-size: 0.95rem;
}

.tampermonkey-content {
    color: #fff;
    word-break: break-word;
    overflow-wrap: break-word;
}

.tampermonkey-content h3 {
    color: #3498db;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.tampermonkey-content p {
    margin-bottom: 8px;
}

.tampermonkey-content ul {
    margin-left: 20px;
    margin-bottom: 10px;
}

.tampermonkey-content li {
    margin-bottom: 5px;
}

/* 自定义释义 */
.custom-definition {
    margin-top: 15px;
}

.custom-definition textarea {
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
}

/* 字幕列表样式 */
.subtitle-list-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 30, 40, 0.95);
    border-radius: 15px 15px 0 0;
    padding: 20px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
}

.subtitle-list-panel.active {
    transform: translateY(0);
}

.subtitle-list {
    list-style: none;
}

.subtitle-item {
    padding: 8px 10px;
    margin-bottom: 5px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.subtitle-item:hover, .subtitle-item:active {
    background: rgba(52, 152, 219, 0.2);
}

.subtitle-item.active {
    background: rgba(52, 152, 219, 0.4);
}

/* ==================== 全屏相关样式 ==================== */

/* 全屏模式 */
.fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    background: #000;
    padding: 0;
    overflow: hidden;
}

.fullscreen-mode .container,
.fullscreen-mode header,
.fullscreen-mode .anki-section,
.fullscreen-mode .subtitle-section,
.fullscreen-mode .player-controls {
    display: none;
}

.fullscreen-video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #000;
    cursor: pointer;
    display: none;
}

.fullscreen-mode .fullscreen-video-container {
    display: flex;
}

.fullscreen-video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 全屏字幕样式 */
.fullscreen-subtitle {
    position: fixed;
    bottom: 60px;
    left: 0;
    width: 100%;
    background: transparent;
    color: white;
    padding: 15px 20px;
    text-align: center;
    font-size: 1.5rem;
    z-index: 100;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    text-shadow: 
        1px 1px 3px rgba(0, 0, 0, 0.8),
        -1px -1px 3px rgba(0, 0, 0, 0.8),
        1px -1px 3px rgba(0, 0, 0, 0.8),
        -1px 1px 3px rgba(0, 0, 0, 0.8);
    transition: bottom 0.3s ease;
    display: none;
}

.fullscreen-mode .fullscreen-subtitle {
    display: flex;
}

/* 全屏字幕单词样式 */
.fullscreen-subtitle .word-span {
    cursor: pointer;
    transition: all 0.2s;
    padding: 2px 6px;
    border-radius: 4px;
    margin: 0 2px;
    background: rgba(67, 97, 238, 0.2);
    display: inline;
    word-break: keep-all;
    vertical-align: bottom;
    line-height: 1.4;
}

.fullscreen-subtitle .word-span:hover {
    background: rgba(67, 97, 238, 0.5);
}

/* 全屏退出按钮 */
.exit-fullscreen-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 101;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.fullscreen-mode .exit-fullscreen-btn {
    display: flex;
}

.exit-fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* 全屏控制条 */
.fullscreen-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    display: none;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.fullscreen-mode .fullscreen-controls {
    display: flex;
}

.fullscreen-progress {
    flex: 1;
    margin: 0 15px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.fullscreen-progress-bar {
    position: absolute;
    height: 100%;
    background: #4361ee;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s;
}

.fullscreen-progress-thumb {
    position: absolute;
    top: 50%;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    z-index: 102;
    transition: all 0.2s;
    left: 0%;
}

.fullscreen-time {
    color: white;
    font-size: 14px;
    min-width: 100px;
    text-align: center;
}

.fullscreen-control-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background 0.3s;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 全屏字幕面板 */
.fullscreen-subtitles-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 800px;
    height: 70%;
    background: rgba(22, 33, 62, 0.95);
    border-radius: 12px;
    z-index: 1001;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.fullscreen-subtitles-panel.active {
    display: flex;
}

.fullscreen-subtitles-header {
    padding: 20px;
    background: #0f3460;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fullscreen-subtitles-title {
    font-size: 1.5rem;
    color: #4cc9f0;
}

.fullscreen-subtitles-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.fullscreen-subtitle-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.fullscreen-subtitle-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.fullscreen-subtitle-item.current {
    background: rgba(67, 97, 238, 0.3);
    border-left: 3px solid #4361ee;
}

.fullscreen-subtitles-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: none;
}

.fullscreen-subtitles-overlay.active {
    display: block;
}

/* 词典面板样式 */
.dictionary-panel-fullscreen {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: #16213e;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    transition: right 0.4s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dictionary-panel-fullscreen.active {
    right: 0;
}

.dictionary-header {
    padding: 20px;
    background: #0f3460;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dictionary-title {
    font-size: 1.5rem;
    color: #4cc9f0;
}

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dictionary-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.search-box {
    display: flex;
    margin-bottom: 20px;
}

#wordInput {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 6px 0 0 6px;
    background: #1a1a2e;
    color: white;
    font-size: 16px;
    min-height: 44px;
}

#searchBtn {
    background: #4361ee;
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
    min-height: 44px;
    min-width: 80px;
}

/* 词典面板遮罩 */
.dictionary-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.dictionary-overlay.active {
    display: block;
}

/* 通知 */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1002;
    display: none;
}

/* 通用样式 */
.hidden {
    display: none;
}

.word {
    cursor: pointer;
    transition: background-color 0.2s;
    padding: 2px 4px;
    border-radius: 3px;
    margin: 0 1px;
    display: inline;
    word-break: keep-all;
}

.word:hover, .word:active {
    background-color: rgba(52, 152, 219, 0.2);
}

.word.highlight {
    background-color: rgba(255, 215, 0, 0.3);
}

.loading {
    text-align: center;
    color: #3498db;
    font-style: italic;
    padding: 20px;
}

.error {
    color: #e74c3c;
    text-align: center;
    padding: 20px;
}

.status-message {
    text-align: center;
    padding: 15px;
    color: #a5b1c2;
    font-style: italic;
}

/* GitHub链接样式 - 移动到黑框外 */
.github-link {
    margin-top: 15px;
    text-align: center;
}

.github-link a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: color 0.3s, transform 0.3s;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.github-link a:hover {
    color: #3498db;
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

footer {
    margin-top: 25px;
    text-align: center;
    color: #ddd;
    font-size: 0.8rem;
    padding: 0 10px;
    width: 100%;
}

/* ==================== 响应式设计修复 ==================== */

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    .video-player {
        height: 250px;
    }
    
    /* 移动端Anki状态和按钮在同一行 */
    .anki-status-row {
        flex-wrap: nowrap;
    }
    
    .anki-status {
        min-width: auto;
    }
    
    /* 移动端顶部按钮布局 */
    .top-controls {
        flex-direction: column;
        gap: 8px;
    }
    
    .media-mode-btn,
    .language-mode-btn {
        max-width: 100%;
        width: 100%;
    }
    
    .import-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .import-btn {
        flex: 1;
        max-width: calc(50% - 4px);
    }
    
    /* 移动端视频字幕调整 */
    .video-subtitles {
        font-size: 0.9rem;
    }
    
    /* 移动端音频字幕强制换行 */
    .audio-subtitle-item {
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
    }
    
    /* 移动端词典按钮统一大小并确保不超出范围 */
    .panel-search-container {
        gap: 4px;
    }
    
    .panel-search-btn,
    .append-word-btn,
    .panel-anki-btn {
        min-width: 38px !important;
        width: 38px !important;
        padding: 8px !important;
        font-size: 0.8rem !important;
        min-height: 38px !important;
    }
    
    .panel-search-input {
        min-height: 38px;
        padding: 8px 10px;
    }
    
    /* 移动端全屏字幕调整 */
    .fullscreen-subtitle {
        font-size: 1.3rem;
    }
    
    /* 移动端词典标题栏进一步缩小 */
    .panel-header {
        padding: 6px 0;
        margin-top: -15px;
        padding-top: 15px;
        top: -15px;
    }
    
    .panel-title {
        font-size: 1rem;
    }
    
    .close-panel {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .video-player {
        height: 200px;
    }
    
    .video-subtitles {
        font-size: 0.85rem;
    }
    
    .audio-subtitle-item {
        font-size: 0.9rem;
    }
    
    .fullscreen-subtitle {
        font-size: 1.1rem;
    }
    
    /* 小屏幕词典按钮进一步调整 */
    .panel-search-btn,
    .append-word-btn,
    .panel-anki-btn {
        min-width: 36px !important;
        width: 36px !important;
        padding: 7px !important;
        min-height: 36px !important;
    }
}

@media (max-width: 360px) {
    .video-player {
        height: 180px;
    }
    
    .video-subtitles {
        font-size: 0.8rem;
    }
    
    /* 超小屏幕词典按钮进一步调整 */
    .panel-search-btn,
    .append-word-btn,
    .panel-anki-btn {
        min-width: 34px !important;
        width: 34px !important;
        padding: 6px !important;
        min-height: 34px !important;
    }
    
    .panel-search-input {
        min-height: 34px;
        padding: 6px 8px;
        font-size: 0.9rem;
    }
}

/* 横屏模式优化 - 修复Anki按钮高度问题 */
@media (max-height: 500px) and (orientation: landscape) {
    .audio-subtitles {
        max-height: 120px;
    }
    
    .fullscreen-subtitle {
        font-size: 1.2rem;
    }
    
    /* 横屏时统一按钮高度 */
    .panel-search-btn,
    .append-word-btn,
    .panel-anki-btn {
        min-height: 36px !important;
        height: 36px !important;
    }
    
    .panel-search-input {
        min-height: 36px;
    }
}

/* 确保所有文本正确换行 */
.subtitle-text,
.video-subtitles,
.audio-subtitles,
.fullscreen-subtitle {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}