/*
 Theme Name: GeneratePress Child
 Theme URI: https://generatepress.com
 Description: Child theme for GeneratePress
 Author: Your Name
 Author URI: https://yourwebsite.com
 Template: generatepress
 Version: 1.0
*/

/* 在这里添加你的自定义 CSS */

@import url("../[generatepress]/style.css");

/* 课程归档页网格布局 */
.courses-archive {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); /* 魔法在这里！自动创建响应式网格。最小宽度320px，最大1等分 */
    gap: 2rem; /* 卡片之间的间距 */
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto; /* 容器居中 */
}

/* 单个课程卡片样式 */
.course-card {
    background: #fff;
    border-radius: 12px; /* 圆角 */
    overflow: hidden; /* 防止图片溢出圆角 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* 淡淡的阴影 */
    transition: all 0.3s ease; /* 添加所有属性的过渡动画 */
}

/* 鼠标悬停效果：卡片微微上浮，阴影变深 */
.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

/* 卡片链接，设置为块级元素填满整个卡片 */
.course-card .card-link {
    display: block;
    text-decoration: none; /* 去掉下划线 */
    color: inherit; /* 继承文字颜色 */
    height: 100%; /* 让链接充满整个卡片高度 */
}

/* 课程图片样式 */
.course-card__image img {
    width: 100%; /* 图片宽度充满容器 */
    height: 180px; /* 固定一个高度 */
    object-fit: cover; /* 保持比例，裁剪覆盖整个区域 */
    display: block;
}

/* 课程内容区域样式 */
.course-card__content {
    padding: 1.5rem;
}

/* 课程标题样式 */
.course-card__title {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    color: #333; /* 深灰色标题 */
}

/* 课程摘要样式 */
.course-card__excerpt {
    margin-bottom: 1.5rem;
    color: #666; /* 浅灰色文字 */
    font-size: 0.9rem;
    line-height: 1.5;
}

/* “开始学习”按钮样式 */
.course-card__button {
    display: inline-block;
    background-color: #007cba; /* WordPress蓝色，可改为你喜欢的颜色 */
    color: white !important; /* 强制白色文字 */
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8rem;
    text-decoration: none;
}

/* 课程归档页网格布局 */
.courses-archive {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* 魔法在这里！自动创建响应式网格。最小宽度320px，最大1等分 */
    gap: 2rem; /* 卡片之间的间距 */
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto; /* 容器居中 */
}

/* 单个课程卡片样式 */
.course-card {
    background: #fff;
    border-radius: 12px; /* 圆角 */
    overflow: hidden; /* 防止图片溢出圆角 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* 淡淡的阴影 */
    transition: all 0.3s ease; /* 添加所有属性的过渡动画 */
}

/* 鼠标悬停效果：卡片微微上浮，阴影变深 */
.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

/* 卡片链接，设置为块级元素填满整个卡片 */
.course-card .card-link {
    display: block;
    text-decoration: none; /* 去掉下划线 */
    color: inherit; /* 继承文字颜色 */
    height: 100%; /* 让链接充满整个卡片高度 */
}

/* 课程图片样式 */
.course-card__image img {
    width: 100%; /* 图片宽度充满容器 */
    height: 180px; /* 固定一个高度 */
    object-fit: cover; /* 保持比例，裁剪覆盖整个区域 */
    display: block;
}

/* 课程内容区域样式 */
.course-card__content {
    padding: 1.5rem;
}

/* 课程标题样式 */
.course-card__title {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    color: #333; /* 深灰色标题 */
}

/* 课程摘要样式 */
.course-card__excerpt {
    margin-bottom: 1.5rem;
    color: #666; /* 浅灰色文字 */
    font-size: 0.9rem;
    line-height: 1.5;
}

/* “开始学习”按钮样式 */
.course-card__button {
    display: inline-block;
    background-color: #007cba; /* WordPress蓝色，可改为你喜欢的颜色 */
    color: white !important; /* 强制白色文字 */
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8rem;
    text-decoration: none;
}


.site-header {
    border-bottom: 1px solid #000;
	height: 80px ; 
}

/* 全局页面边距调整 - 与课程页面保持一致 */
.site-main, 
#primary, 
.content-area, 
.entry-content, 
.entry-header,
.container, 
.wrap, 
.site-content {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
}

/* 确保文章内容区域也是全宽 */
article {
    max-width: 100% !important;
}

/* 添加到你的额外CSS中 */
@media only screen and (max-width: 768px) {
    /* 基础容器边距 */
    .container, .wrap, .grid-container {
        padding-left: 2px !important;
        padding-right: 2px !important;
        max-width: 100% !important;
    }
    
    /* 主要内容区域 */
    .site-main, #primary, .content-area {
        padding-left: 2px !important;
        padding-right: 2px !important;
    }
    
    /* 文章内容最小边距 */
    .entry-content, .inside-article {
        padding-left: 2px !important;
        padding-right: 2px !important;
    }
}

/* 针对GeneratePress主题的特殊处理 */
@media (min-width: 768px) {
    .grid-container {
        max-width: 100% !important;
    }
    
    .inside-article {
        max-width: 100% !important;
    }
}

/* 隐藏侧边栏（如果不需要） */
#secondary, .sidebar, .widget-area {
    display: none !important;
}


/* 针对单个课程页面的移动端边距优化 */
@media only screen and (max-width: 768px) {
    /* 基础容器边距 - 覆盖所有页面 */
    .container, .wrap, .grid-container {
        padding-left: 5px !important;
        padding-right: 5px !important;
        max-width: 100% !important;
    }
    
    /* 主要内容区域 */
    .site-main, #primary, .content-area {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
    
    /* 文章内容最小边距 */
    .entry-content, .inside-article {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
    
    /* 专门针对单个课程页面的额外调整 */
    body.single-episode .site.grid-container.container.hfeed,
    body.single-episode .site-content {
        padding-left: 5px !important;
        padding-right: 5px !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* 针对你的模板中的特定容器 */
    body.single-episode .video-subtitle-container,
    body.single-episode .self-test-section,
    body.single-episode .vocabulary-section,
    body.single-episode .sentence-patterns-section,
    body.single-episode .full-transcript-section,
    body.single-episode .youtube-video-section {
        padding-left: 5px !important;
        padding-right: 5px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    
    /* 确保视频播放器适应小屏幕 */
    body.single-episode .video-container {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    body.single-episode #english-learning-video {
        width: 100% !important;
        height: auto !important;
    }
    
    /* 调整动态字幕和原文容器的边距 */
    body.single-episode #interactive-subtitles-container,
    body.single-episode #full-transcript {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
    
     /* 确保网格布局在手机上变为单列 */
    body.single-episode .video-subtitle-container {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}
    


/* 修复视频播放器消失问题 */
.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 比例 */
    background-color: #000; /* 添加黑色背景 */
    border-radius: 8px;
    overflow: hidden;
}

.video-container .video-js {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 确保Video.js播放器正确初始化 */
#english-learning-video {
    width: 100% !important;
    height: 100% !important;
}

/* 移除可能冲突的样式 */
.video-container video {
    width: 100% !important;
    height: 100% !important;
}

/* 修复移动端视频显示 */
@media (max-width: 768px) {
    .video-container {
        padding-bottom: 56.25%; /* 保持16:9比例 */
    }
    
    body.single-episode #english-learning-video {
        width: 100% !important;
        height: 100% !important; /* 改为100%而不是auto */
    }
}

/* 简化版粘性视频效果 */
@media (max-width: 768px) {
    body.single-episode .video-subtitle-container {
        position: relative;
    }
    
    body.single-episode .video-player-section {
        position: -webkit-sticky;
        position: sticky;
        top: 0;
        z-index: 1000;
        background: white;
        padding: 10px 0;
        transition: all 0.3s ease;
    }
    
    /* 当滚动到重点词汇时，通过相邻选择器取消粘性 */
    body.single-episode .vocabulary-section:target ~ .video-subtitle-container .video-player-section,
    body.single-episode .vocabulary-section:target ~ .video-player-section {
        position: relative;
        top: auto;
    }
    
    /* 为重点词汇添加滚动边距 */
    body.single-episode .vocabulary-section {
        scroll-margin-top: 80px;
    }
}

/* ===== 手机端单个课程页面优化 ===== */
/* ===== 手机端单个课程页面优化 ===== */
@media only screen and (max-width: 768px) {
    /* 1. 将自定义控制按钮改为固定在底部的悬浮按钮 */
    body.single-episode .custom-controls {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        padding: 8px 10px;
        justify-content: space-around;
        align-items: center;
        z-index: 10000;
        border-top: 1px solid #ddd;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        backdrop-filter: blur(10px);
    }
    
    /* 隐藏字幕按钮和倍速按钮 */
    body.single-episode .custom-controls #toggle-subtitles,
    body.single-episode .custom-controls .playback-rate-container {
        display: none !important;
    }

    /* 调整控制按钮在移动端的样式 */
        /* 调整控制按钮在移动端的样式 - 与电脑端保持一致 */
    body.single-episode .custom-controls .control-btn {
        padding: 8px 0;
        font-size: 12px;
        flex: 1;
        margin: 0 2px;
        text-align: center;
        background: #fff;
        border: 1px solid #ddd;
        border-radius: 6px;
        min-height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #333; /* 确保文字颜色为深色 */
        transition: all 0.2s ease; /* 添加过渡效果 */
    }

    /* 移动端按钮悬停和激活状态 - 与电脑端保持一致 */
    body.single-episode .custom-controls .control-btn:hover,
    body.single-episode .custom-controls .control-btn.active {
        background: #3498db;
        color: white;
        border-color: #3498db;
    }

    /* 确保按钮文字在激活状态下也保持可见 */
    body.single-episode .custom-controls .control-btn.active {
        color: white !important;
    }

    /* 确保页面内容不会被底部悬浮按钮遮挡 */
    body.single-episode {
        padding-bottom: 60px;
    }

    /* 调整倍速下拉菜单在移动端的位置 */
    body.single-episode .playback-rate-container {
        position: relative;
    }

    body.single-episode .playback-rate-menu {
        position: fixed;
        bottom: 50px;
        left: 50%;
        transform: translateX(-50%);
        background: white;
        border: 1px solid #ddd;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        z-index: 10001;
        min-width: 120px;
    }

    body.single-episode .playback-rate-menu button {
        padding: 10px 15px;
        font-size: 14px;
    }
    
/* ===== 更直接的推拉式导航解决方案 ===== */
@media only screen and (max-width: 768px) {
    /* 强制导航菜单占据空间 */
    .main-navigation ul {
        position: relative !important;
        display: none;
        width: 100%;
        background: white;
        margin: 0;
        padding: 0;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .main-navigation.toggled ul {
        display: block;
        animation: slideDown 0.3s ease;
    }
    
    /* 确保菜单项正常排列 */
    .main-navigation ul li {
        display: block;
        width: 100%;
        margin: 0;
    }
    
    .main-navigation ul li a {
        display: block;
        padding: 15px 20px;
        border-bottom: 1px solid #f0f0f0;
    }
}

/* 修复导航栏显示问题 */
@media (max-width: 768px) {
    /* 确保导航栏在最上层 */
    .site-header,
    .main-navigation,
    .menu-toggle,
    .main-nav {
        z-index: 9999 !important; /* 高于视频播放器 */
        position: relative;
    }
    
    /* 调整视频播放器的z-index */
    body.single-episode .video-player-section {
        z-index: 100; /* 降低视频的z-index */
    }
    
    /* 确保导航栏下拉菜单可见 */
    .main-nav ul ul {
        z-index: 10000 !important;
    }
}

/* 自定义登录页面样式 */
.custom-login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.custom-login-container h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.login-error {
    color: #d63638;
    background: #ffeaea;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
}

/* 账号管理页面样式 */
.account-management {
    max-width: 800px;
    margin: 30px auto;
    padding: 20px;
}

.session-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.session-table th,
.session-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.session-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.session-controls {
    margin-top: 30px;
    text-align: center;
}

.session-controls .button,
.session-controls button {
    background: #2271b1;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin: 0 10px;
}

.session-controls .button:hover,
.session-controls button:hover {
    background: #135e96;
}

/* 登录表单样式优化 */
.login-form {
    max-width: 400px;
    margin: 0 auto;
}

.login-button {
    width: 100%;
    padding: 12px;
    background: #2271b1;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

.login-button:hover {
    background: #135e96;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

/* 当前播放句子显示样式 */
.current-sentence-display {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
}

.current-sentence-display h3 {
    margin-top: 0;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    font-size: 1.2rem;
}

#current-sentence-container {
    min-height: 60px;
    padding: 0.5rem;
}

#current-sentence-container .en-text {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 0.25rem;
    line-height: 1.7;
}

#current-sentence-container .cn-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* 在手机屏幕上隐藏当前字幕显示 */
@media only screen and (max-width: 768px) {
    .current-sentence-display {
        display: none !important;
    }
}

/* ===== 移动端浏览器兼容性优化 ===== */
@media only screen and (max-width: 768px) {
    /* 基础字体大小调整 */
    body {
        font-size: 14px !important;
        -webkit-text-size-adjust: 100%; /* 防止Safari自动调整 */
        text-size-adjust: 100%; /* 标准属性 */
    }
    
    /* 标题字体大小调整 */
    h1 {
        font-size: 1.4rem !important;
    }
    
    h2 {
        font-size: 1.3rem !important;
    }
    
    h3 {
        font-size: 1.2rem !important;
    }
    
    /* 学习自测板块优化 */
    .self-test-section .subtitle-line {
        padding: 0.6rem !important;
        margin-bottom: 0.4rem !important;
    }
    
    /* 输入框宽度修复 */
    .self-test-input-container,
    .dictation-input-container {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .self-test-input,
    .dictation-input {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        font-size: 14px !important;
        padding: 8px !important;
    }
    
    /* 确保输入框不会溢出 */
    #self-test-subtitles-container,
    #interactive-subtitles-container {
        overflow-x: hidden !important;
        padding: 8px !important;
    }
    
    /* 按钮字体调整 */
    .control-btn,
    .mode-btn,
    .vocab-tab-btn,
    .sentence-tab-btn,
    .self-test-mode-btn {
        font-size: 12px !important;
        padding: 8px 12px !important;
    }
    
    /* 字幕文本字体调整 */
    .en-text {
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
    }
    
    .cn-text {
        font-size: 0.85rem !important;
    }
    
    /* 词汇卡片字体调整 */
    .vocab-card,
    .sentence-card {
        padding: 12px !important;
    }
    
    .vocab-title,
    .sentence-title {
        font-size: 1.1rem !important;
    }
    
    .vocab-definition,
    .vocab-example,
    .sentence-cn-definition,
    .sentence-example {
        font-size: 0.85rem !important;
    }
    
    /* 分类标签按钮换行优化 */
    .vocab-tab-headers,
    .sentence-tab-headers {
        gap: 4px !important;
    }
    
    .vocab-tab-btn,
    .sentence-tab-btn {
        font-size: 10px !important;
        padding: 6px 10px !important;
        margin-bottom: 4px !important;
    }
    
    /* 确保所有容器宽度正确 */
    .container, .wrap, .site-content,
    .site-main, #primary, .content-area,
    .entry-content, .inside-article {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
    
    /* 防止横向滚动 */
    body {
        overflow-x: hidden !important;
        width: 100% !important;
    }
    
    /* 视频字幕容器布局调整 */
    .video-subtitle-container {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* 自定义控制按钮换行 */
    .custom-controls {
        gap: 4px !important;
        justify-content: space-between !important;
    }
    
    .control-btn {
        flex: 1 !important;
        min-width: 60px !important;
        font-size: 11px !important;
        padding: 6px 8px !important;
    }
}

/* ===== 针对夸克和QQ浏览器的特殊优化 ===== */
@supports not (-webkit-overflow-scrolling: touch) {
    @media only screen and (max-width: 768px) {
        /* 非Safari浏览器的额外优化 */
        body {
            font-size: 13px !important;
        }
        
        /* 输入框在非Safari浏览器中进一步优化 */
        input[type="text"],
        input[type="password"],
        .self-test-input,
        .dictation-input {
            font-size: 13px !important;
            height: 36px !important;
            min-height: 36px !important;
        }
        
        /* 确保按钮在非Safari浏览器中显示正常 */
        button, .control-btn, .mode-btn {
            -webkit-appearance: none !important;
            appearance: none !important;
            border-radius: 6px !important;
        }
    }
}

/* ===== 针对 page-all-vocabulary 和 page-sentence-patterns 页面的移动端优化 ===== */
@media only screen and (max-width: 768px) {
    /* 词汇页面卡片布局 */
    .vocabulary-grid,
    .sentence-patterns-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* 词汇卡片字体调整 */
    .vocab-item,
    .sentence-item {
        padding: 12px !important;
        font-size: 0.9rem !important;
    }
    
    .vocab-item h3,
    .sentence-item h3 {
        font-size: 1.1rem !important;
    }
    
    /* 搜索框和筛选器优化 */
    .vocabulary-search,
    .sentence-search {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    input[type="search"],
    .search-input {
        width: 100% !important;
        font-size: 14px !important;
    }
    
    /* 分页按钮优化 */
    .pagination .page-numbers {
        padding: 8px 12px !important;
        font-size: 0.9rem !important;
        margin: 2px !important;
    }
}

/* ===== 强制移动端视口设置 ===== */
@media only screen and (max-width: 768px) {
    html {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    /* 确保所有盒模型正确 */
    * {
        box-sizing: border-box !important;
    }
    
    /* 防止输入框缩放 */
    input, textarea, select {
        font-size: 16px !important; /* 防止iOS缩放 */
        max-width: 100% !important;
    }
    
    /* 学习自测输入框特别优化 */
    .self-test-input-container,
    .dictation-input-container {
        position: relative !important;
        width: 100% !important;
    }
    
    .self-test-input,
    .dictation-input {
        width: calc(100% - 50px) !important; /* 为按钮留出空间 */
        min-width: 0 !important;
        flex: 1 !important;
    }
    
    .self-test-check-btn,
    .dictation-check-btn {
        width: 50px !important;
        flex: none !important;
    }
}

/* ===== 移动端单词悬浮框优化 ===== */
@media only screen and (max-width: 768px) {
    .word-tooltip {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 70% !important;
        max-width: 280px !important;
        max-height: 80vh !important;
        overflow-y: auto !important;
        z-index: 10000 !important;
        margin: 0 !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
        border: 2px solid #3498db !important;
    }
    
    /* 悬浮框内容区域优化 */
    .word-tooltip-header {
        padding-bottom: 10px !important;
        margin-bottom: 10px !important;
    }
    
    .word-title {
        font-size: 1.2rem !important;
        text-align: center !important;
    }
    
    .phonetics {
        margin-bottom: 10px !important;
    }
    
    .phonetic-item {
        font-size: 0.85rem !important;
        margin-bottom: 5px !important;
    }
    
    .definitions, .examples {
        margin-bottom: 10px !important;
    }
    
    .definition-item, .example-item {
        margin-bottom: 8px !important;
    }
    
    .definition-label {
        font-size: 0.8rem !important;
    }
    
    .definition-content, .example-en, .example-cn {
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
    }
    
    /* 添加关闭按钮 */
    .word-tooltip::after {
        content: "×";
        position: absolute;
        top: 10px;
        right: 15px;
        font-size: 1.5rem;
        color: #666;
        cursor: pointer;
        z-index: 10001;
        background: white;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }
    
    /* 点击背景关闭悬浮框 */
    .word-tooltip-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9999;
        display: none;
    }
    
    /* 确保悬浮框在视频上方 */
    .video-player-section {
        z-index: 100 !important;
    }
    
    .word-tooltip {
        z-index: 10001 !important;
    }
}

/* ===== 增强移动端悬浮框交互 ===== */
@media only screen and (max-width: 768px) {
    /* 防止背景滚动当悬浮框显示时 */
    body.word-tooltip-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
    }
    
    /* 悬浮框内部滚动优化 */
    .word-tooltip {
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* 确保长内容可以滚动 */
    .word-tooltip .definitions,
    .word-tooltip .examples {
        max-height: none !important;
    }
}

/* ===== 针对小屏幕手机的额外优化 ===== */
@media only screen and (max-width: 480px) {
    .word-tooltip {
        width: 75% !important;
        max-width: 260px !important;
        padding: 15px !important;
    }
    
    .word-title {
        font-size: 1.1rem !important;
    }
    
    .phonetic-item {
        font-size: 0.8rem !important;
    }
    
    .definition-content, .example-en, .example-cn {
        font-size: 0.8rem !important;
    }
}