/* 画笔工具栏统一参数 */
:root {
    --draw-btn-padding: 3px 8px;
    --draw-btn-font-size: 0.78rem;
    --draw-btn-gap: 2px;
    --draw-btn-radius: 5px;
    --draw-btn-height: 26px;
    --draw-toolbar-min-height: 35px;
}

/* 用户信息栏样式 */
.user-info-bar {
    display: flex; align-items: center; gap: 8px;
    margin-right: 12px; padding: 4px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
}
.user-info-bar .user-name {
    font-size: 0.85rem; color: #e2e8f0;
}
.user-info-bar .user-type-badge {
    font-size: 0.7rem; padding: 2px 6px;
    border-radius: 4px; font-weight: 600;
}
.user-type-badge.teacher {
    background: #fbbf24; color: #1e293b;
}
.user-type-badge.student {
    background: #34d399; color: #1e293b;
}
.user-info-bar .logout-btn {
    background: none; border: 1px solid rgba(255,255,255,0.3);
    color: #e2e8f0; font-size: 0.75rem;
    padding: 3px 8px; border-radius: 4px;
    cursor: pointer; transition: all 0.2s;
}
.user-info-bar .logout-btn:hover {
    background: rgba(255,255,255,0.15);
}

/* 学生模式：隐藏教师专属功能 */
body.student-mode .article-explain-entry,
body.student-mode #articleExplainBtn {
    display: none !important;
}
body.student-mode .tts-controls,
body.student-mode .text-display-controls {
    display: none !important;
}

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

#app {
    display: grid;
    grid-template-columns: 40px 1fr;
    grid-template-rows: 60px 1fr;
    grid-template-areas: 
        "header header"
        "sidebar main";
    height: 100vh;
    overflow: hidden;
    transition: grid-template-columns 0.3s ease;
}

/* 左侧侧边栏 - 可折叠，z-index确保在阅读区上层 */
.sidebar {
    grid-area: sidebar;
    background: white;
    border-right: 1px solid #e1e5eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 40px;
    transition: width 0.3s ease;
    position: relative;
    z-index: 100;
}

.sidebar.expanded, .sidebar.initial {
    width: 240px;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    min-height: 48px;
}

/* 展开状态下隐藏sidebar-header */
.sidebar.expanded .sidebar-header, .sidebar.initial .sidebar-header {
    display: none;
}

.sidebar-title {
    display: none;
}

.toggle-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    /* 方形按钮，四角略微圆润 */
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    /* 与右侧悬浮面板展开按钮统一：圆形 28x28，内容居中 */
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* 展开时的标题栏 - 与X按钮同高 */
.sidebar-expanded-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 12px 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    min-height: 48px;
}

.sidebar.expanded .sidebar-expanded-header, .sidebar.initial .sidebar-expanded-header {
    display: flex;
}

.sidebar-expanded-header h3 {
    font-size: 0.9rem;
    font-weight: bold;
    margin: 0;
}

.expand-toggle-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    /* 与左侧收起时的“重新弹出”按钮保持完全一致的容器尺寸与形状 */
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.expand-toggle-btn:hover {
    background: rgba(255,255,255,0.3);
}

.sidebar-content {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.sidebar.expanded .sidebar-content, .sidebar.initial .sidebar-content {
    display: flex;
}

.sidebar-content h3 {
    display: none;
}

.search-box {
    padding: 6px 12px;
    border-bottom: 1px solid #e1e5eb;
}

.search-box input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #e1e5eb;
    border-radius: 4px;
    font-size: 0.8rem;
    outline: none;
}

.search-box input:focus {
    border-color: #667eea;
}

.category-filter {
    padding: 6px 12px;
    border-bottom: 1px solid #e1e5eb;
}

.category-filter select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #e1e5eb;
    border-radius: 4px;
    font-size: 0.8rem;
    background: white;
    cursor: pointer;
    outline: none;
}

.article-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
    padding: 4px 0;
}

.article-list li {
    padding: 2px 16px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    font-size: 0.75rem;
    line-height: 1.4;
}

.article-list li:hover {
    background: #f0f4ff;
    border-left-color: #667eea;
}

.article-list li.active {
    background: #e8efff;
    border-left-color: #667eea;
    font-weight: 500;
}

/* 听力/阅读内容指示标签 */
.content-type-label {
    font-size: 0.7rem;
    color: #888;
    padding: 4px 12px;
    background: #f8fafc;
    border-bottom: 1px dashed #e1e5eb;
    display: flex;
    align-items: center;
    gap: 4px;
}

.content-type-label span {
    color: #667eea;
    font-weight: 500;
}

/* 一级分类标题 - 听力材料/阅读文章（单独一行） */
.article-list > .category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    font-weight: bold;
    font-size: 0.9rem;
    color: #333;
    background: #f0f4ff;
    border-left: 3px solid #667eea;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 4px 8px;
    border-radius: 6px;
}

.article-list > .category-header:hover {
    background: #e8efff;
    color: #667eea;
}

.category-header .category-toggle {
    font-size: 0.7rem;
    color: #667eea;
    transition: transform 0.2s ease;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-header .category-toggle.collapsed {
    transform: rotate(0deg);
}

.category-header .category-toggle:not(.collapsed) {
    transform: rotate(90deg);
}

.category-header .category-title {
    flex: 1;
}

/* 分类内容容器 - 放在 category-header 后面（平级） */
.article-list > .category-content {
    display: block;
    margin: 0 8px;
}

.article-list > .category-content.collapsed {
    display: none;
}

/* 筛选模式下的标题样式 */
.article-list .filter-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #667eea;
    background: #f0f4ff;
    border-left: 3px solid #667eea;
    margin: 8px 8px 4px 8px;
    border-radius: 6px;
}

/* 筛选模式下的内容样式 */
.article-list .filter-content {
    display: block;
    margin: 0 8px;
    padding-left: 12px;
}

.article-list .filter-content .teil-item {
    padding: 8px 12px 8px 24px;
    font-size: 0.85rem;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.article-list .filter-content .teil-item:hover {
    background: #f0f4ff;
    color: #667eea;
    border-left-color: #667eea;
}

/* 二级分组容器 - 标题和内容分行显示 */
.article-list .test-group-item {
    display: block;
    margin-bottom: 12px;
    padding: 0 12px;
}

/* 二级分组标题 - Test 01 Hören Teil: / Test 01 Lesen Teil: */
.article-list .test-sub-header {
    display: block;
    padding: 4px 0;
    font-weight: 600;
    font-size: 0.8rem;
    color: #667eea;
    background: transparent;
    border-bottom: none;
    white-space: nowrap;
}

/* 二级内容区域 - 1 | 2 | 3 | 4 */
.article-list .test-sub-content {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    padding: 6px 0;
    margin-left: 12px;
    white-space: nowrap;
}

/* B1 Teil2 两行布局专用：纵向排列，每行 4 个页码，避免水平滑动 */
.article-list .test-sub-content.has-two-rows {
    flex-direction: column;
    flex-wrap: wrap;
    white-space: normal;
    align-items: flex-start;
    gap: 4px;
}

.article-list .test-sub-content .teil-btn-row {
    display: flex;
    align-items: center;
    padding: 2px 0;
}

/* 平板窄屏下每行略收紧，保证一行 4 个不溢出 */
@media (min-width: 768px) and (max-width: 1100px) {
    .article-list .test-sub-content.has-two-rows .teil-btn {
        min-width: 28px;
        padding: 5px 8px;
    }
}

.article-list .test-sub-content .teil-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 6px 12px;
    font-size: 0.8rem;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    background: #f5f5f5;
}

.article-list .test-sub-content .teil-btn:hover {
    background: #667eea;
    color: #fff;
}

.article-list .test-sub-content .teil-btn.disabled {
    color: #ccc;
    cursor: not-allowed;
    background: #f9f9f9;
}

.article-list .test-sub-content .teil-btn.disabled:hover {
    background: #f9f9f9;
    color: #ccc;
}

.article-list .test-sub-content .teil-separator {
    padding: 0 2px;
    color: #999;
    font-size: 0.75rem;
    user-select: none;
}

.teil-icon {
    margin-right: 8px;
    font-size: 0.8rem;
}

/* 折叠时的工具栏 - 放在左侧 */
.collapsed-tools {
    display: none;
    flex-direction: column;
    /* 调整为等距布局：顶部内边距与元素间距一致，使 📝 与上下元素间距更均衡 */
    gap: 8px;
    padding: 8px 8px;
    align-items: center;
    margin-top: 8px;
}

/* 仅在折叠状态（非expanded非initial）下显示工具栏 */
.sidebar:not(.expanded):not(.initial) .collapsed-tools {
    display: flex;
}

.tools-label {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 4px;
    text-align: center;
}

/* 【新增】学习内容标题显示区 - 在笔记图标上方 */
/* 【说明】current-content-title 原用于折叠侧栏标题，V2.0 起改为仅保留占位高度，
   实际标题显示迁移到顶部 header 中央（header-current-title） */
.current-content-title {
    display: none;
}

/* 【新增】笔记工具图标样式 - 在标题下方 */
.note-icon {
    font-size: 1.2rem;
    display: block;
    text-align: center;
    margin-bottom: 8px;
}

/* 【V2.8新增】AI智能标注按钮样式 */
.ai-tool-btn {
    width: 100%;
    padding: 10px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-tool-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

.ai-tool-btn .btn-icon {
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    font-family: 'Consolas', 'Monaco', monospace;
    letter-spacing: 0.5px;
    text-align: center;
}

.ai-tool-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

.ai-tool-btn.loading .btn-icon::after {
    content: '...';
    animation: loading-dots 1s infinite;
}

.ai-tool-btn.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
}

.ai-tool-btn.active:hover {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.4);
}

@keyframes loading-dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* 【V2.8新增】AI标注结果样式 */
.ai-marked-sentence {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
    margin: 8px 0;
    font-size: 1rem;
    line-height: 1.8;
}

.ai-case-sup {
    color: #e74c3c;
    font-weight: 600;
    font-size: 0.75em;
    margin-left: 1px;
}

.v11-layer-view {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
    margin: 8px 0;
}

.v11-layer-header {
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #d1d5db;
}

.v11-layer-title {
    font-weight: bold;
    color: #4338ca;
    font-size: 0.9em;
    margin-right: 8px;
}

.v11-layer-sentence {
    color: #6b7280;
    font-size: 0.85em;
    font-style: italic;
}

.v11-layer-row {
    display: flex;
    align-items: flex-start;
    margin: 6px 0;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.v11-layer-label {
    min-width: 80px;
    font-size: 0.8em;
    font-weight: bold;
    padding: 2px 8px;
    margin-right: 12px;
    flex-shrink: 0;
}

.v11-layer-content {
    font-size: 1rem;
    line-height: 1.8;
    flex: 1;
}

.v11-ro-view {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    padding: 14px 16px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
    margin: 8px 0;
}

.v11-ro-header {
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #d1d5db;
}

.v11-ro-title {
    font-weight: bold;
    color: #4338ca;
    font-size: 0.95em;
    margin-right: 8px;
}

.v11-ro-sentence {
    color: #6b7280;
    font-size: 0.85em;
    font-style: italic;
}

.v11-ro-overview {
    font-size: 1rem;
    line-height: 1.8;
    padding: 8px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.v11-ro-sequence {
    margin-top: 8px;
}

.v11-ro-seq-title {
    font-weight: bold;
    color: #374151;
    font-size: 0.85em;
    margin-bottom: 8px;
}

.v11-ro-seq-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #d1d5db, transparent);
    margin: 6px 0;
}

.v11-ro-elem {
    display: flex;
    align-items: flex-start;
    padding: 6px 8px;
    margin: 3px 0;
    border-radius: 4px;
    transition: background 0.2s;
}

.v11-ro-elem:hover {
    background: rgba(0,0,0,0.03);
}

.v11-ro-elem-order {
    min-width: 24px;
    height: 24px;
    border-radius: 50%;
    color: white;
    font-size: 0.75em;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    flex-shrink: 0;
    margin-top: 2px;
}

.v11-ro-elem-body {
    flex: 1;
}

.v11-ro-elem-content {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95em;
}

.v11-ro-elem-meta {
    display: flex;
    gap: 4px;
    margin-top: 3px;
    flex-wrap: wrap;
}

.v11-ro-badge {
    font-size: 0.7em;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 600;
    white-space: nowrap;
}

.v11-ro-elem-instr {
    font-size: 0.75em;
    color: #6b7280;
    margin-top: 2px;
    font-style: italic;
}

.v11-ro-animation {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    padding: 16px;
    border-radius: 8px;
    border-left: 3px solid #8b5cf6;
    margin: 8px 0;
    color: #e0e7ff;
}

.v11-anim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.v11-anim-title {
    font-weight: bold;
    color: #c4b5fd;
    font-size: 0.9em;
}

.v11-anim-controls {
    display: flex;
    gap: 6px;
}

.v11-anim-btn {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 6px;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.2s;
}

.v11-anim-btn:hover {
    background: rgba(139, 92, 246, 0.4);
    color: #fff;
}

.v11-anim-progress {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px 0;
    flex-wrap: wrap;
}

.v11-anim-step {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7em;
    transition: color 0.3s;
}

.v11-step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    transition: background 0.3s;
    flex-shrink: 0;
}

.v11-step-text {
    font-weight: 600;
    white-space: nowrap;
}

.v11-anim-instruction {
    font-size: 0.85em;
    padding: 6px 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.08);
    min-height: 1.2em;
    transition: color 0.3s;
}

.v11-anim-sentence {
    font-size: 1.1rem;
    line-height: 2;
    padding: 8px 0;
}

.v11-anim-token {
    transition: all 0.4s ease;
    display: inline;
}

.v11-anim-unloaded {
    color: #4b5563 !important;
    opacity: 0.4;
}

.v11-anim-loaded {
    color: #e0e7ff;
}

.v11-anim-current {
    transition: all 0.3s ease;
}

/* 【V4.2新增】AI修正版本选择器样式 - 紧贴按钮弹出 */
.ai-version-selector {
    position: fixed;
    width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    z-index: 10000;
    overflow: hidden;
    animation: slideDown 0.2s ease;
    border: 1px solid #e2e8f0;
}

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

.ai-version-header {
    padding: 12px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-version-header .header-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.ai-version-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.ai-version-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.ai-version-group {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ai-version-group:last-of-type {
    border-bottom: none;
}

.ai-group-label {
    padding: 4px 14px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-version-options {
    padding: 4px 0;
}

.ai-version-option {
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.ai-version-option:last-child {
    border-bottom: none;
}

.ai-version-option:hover {
    background: #f5f7fa;
    border-left-color: #667eea;
}

.ai-version-option.selected {
    background: linear-gradient(135deg, #e0e7ff 0%, #f0e7ff 100%);
    border-left-color: #10b981;
}

.ai-version-option.pending {
    background: #fffbeb;
    border-left-color: #f59e0b;
}

.version-radio {
    width: 16px;
    height: 16px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
    position: relative;
    transition: all 0.15s ease;
}

.ai-version-option.selected .version-radio {
    border-color: #10b981;
    background: #10b981;
}

.ai-version-option.pending .version-radio {
    border-color: #f59e0b;
    background: #f59e0b;
}

.ai-version-option.pending .version-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

.ai-version-option.selected .version-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

.version-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ai-version-option .version-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #333;
}

.ai-version-option .version-desc {
    font-size: 0.7rem;
    color: #666;
}

.ai-version-actions {
    padding: 12px 14px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.ai-version-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.ai-version-btn-cancel {
    background: white;
    border-color: #d1d5db;
    color: #374151;
}

.ai-version-btn-cancel:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.ai-version-btn-confirm {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.ai-version-btn-confirm.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
}

.ai-version-btn-confirm.active:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* AI版本切换Toast提示 */
.ai-version-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(30, 41, 59, 0.95);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10000;
}

.ai-version-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ai-version-toast .toast-icon {
    font-size: 1rem;
}

/* AI自动关闭通知 */
.ai-auto-close-notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(245, 158, 11, 0.95);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10000;
}

.ai-auto-close-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ai-auto-close-notification::before {
    content: '⏱️';
    font-size: 1rem;
}

.ai-syntax-bold {
    color: #2c3e50;
    font-weight: 700;
}

.ai-unmarked {
    color: #95a5a6;
    text-decoration: line-through;
}

.ai-log-header {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 4px;
    padding-bottom: 2px;
    border-bottom: 1px dashed #ddd;
}

/* 【新增】预留未来工具位 */
.future-tools-slot {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e1e5eb;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 0.8rem;
    width: 100%;
}

.collapsed-tools .tool-btn {
    padding: 10px 12px;
    border: 1px solid #e1e5eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.collapsed-tools .tool-btn:hover {
    background: #f0f4ff;
    border-color: #667eea;
}

/* 选中状态使用蓝色边框指示器 */
.collapsed-tools .tool-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    border-radius: 4px;
}

.collapsed-tools .tool-btn:active {
    transform: scale(0.95);
}

/* 图标按钮样式 - MS-Office风格 */
.collapsed-tools .icon-btn {
    padding: 8px;
}

.collapsed-tools .icon-btn .btn-icon {
    font-size: 1rem;
}

/* 撤销图标 - 左转箭头 */
.undo-icon {
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 1.1rem;
}

/* 重做图标 - 右转箭头 */
.redo-icon {
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 1.1rem;
}

/* 清除图标 - 成品emoji */

.tool-divider {
    width: 80%;
    height: 1px;
    background: #e1e5eb;
    margin: 6px 0;
}

/* 品牌文字 - 顶部导航栏水平排列 */
.header-brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.header-brand .brand-name {
    font-size: 1rem;
    color: white;
    font-weight: 600;
    letter-spacing: 2px;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.3);
    padding-right: 12px;
    margin-right: 0;
}

.header-brand .logo {
    font-size: 1.1rem;
    font-weight: 600;
}

.logo-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0;
}

.logo-wrapper .brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    margin-right: 6px;
    letter-spacing: 1px;
    white-space: nowrap;
    user-select: none;
}

.logo-wrapper .logo {
    display: inline;
}

.logo-wrapper .version-badge {
    margin-left: 8px;
}

/* 顶部导航左侧区域：品牌 + 当前标题 作为一组固定在左边 */
.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0; /* 允许内部标题区域做省略号处理 */
}

/* 顶部当前学习内容标题（位于品牌与右侧操作区之间，居中对齐） */
.header-current-title {
    flex: 0 0 auto;
    text-align: left;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
    margin-left: 20px;
    padding-right: 16px;
    max-width: 520px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.header-current-title.hidden {
    visibility: hidden;
}

/* 新笔记工具图标样式 */
.collapsed-tools .tool-btn .btn-icon {
    font-family: 'Times New Roman', serif;
    font-weight: bold;
    font-size: 1rem;
}

/* 图标文字样式 */
.icon-underline {
    text-decoration: underline;
    font-family: Arial, sans-serif;
    font-weight: normal;
}

.icon-bold {
    font-weight: 900;
    font-family: Arial, sans-serif;
}

.icon-strike {
    text-decoration: line-through;
    font-size: 0.72rem; /* 缩小10%：从0.8rem */
    font-family: Arial, sans-serif;
}

.icon-superscript {
    font-size: 0.85rem;
    font-family: Arial, sans-serif;
}

.icon-superscript sup {
    font-size: 0.6em;
    position: relative;
    top: -2px;
    left: 1px;
}

/* 上标数字选择器 - 跟随选区定位 */
.superscript-selector {
    position: fixed;
    /* 默认隐藏，由 .show 类控制显示，位置由JS动态设置 */
    display: none;
    background: white;
    border: 1px solid #e1e5eb;
    border-radius: 8px;
    padding: 6px;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
}

.superscript-selector.show {
    display: flex;
}

.sup-btn {
    width: 32px;
    height: 32px;
    border: 2px solid #e1e5eb;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

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

.sup-btn.sup-1 {
    background: #fef08a;
    border-color: #facc15;
    color: #854d0e;
}

.sup-btn.sup-2 {
    background: #fbcfe8;
    border-color: #f472b6;
    color: #9d174d;
}

.sup-btn.sup-3 {
    background: #bfdbfe;
    border-color: #60a5fa;
    color: #1e40af;
}

.sup-btn.sup-4 {
    background: #bbf7d0;
    border-color: #4ade80;
    color: #166534;
}

/* 词性与数标记按钮样式：m / n / f / pl */
.sup-btn.sup-m {
    background: transparent;
    border-color: transparent;
    /* m. = 阳性 = 蓝色 */
    color: #2563eb;
}

.sup-btn.sup-n {
    background: transparent;
    border-color: transparent;
    /* n. = 中性 = 绿色 */
    color: #16a34a;
}

.sup-btn.sup-f {
    background: transparent;
    border-color: transparent;
    /* f. = 阴性 = 粉色 */
    color: #ec4899;
}

.sup-btn.sup-pl {
    background: transparent;
    border-color: transparent;
    /* pl. = 复数 = 紫色 */
    color: #8b5cf6;
}

/* 下划线颜色选择器 - 跟随选区定位 */
.underline-color-selector {
    position: fixed;
    /* 默认隐藏，由 .show 类控制显示，位置由JS动态设置 */
    display: none;
    background: white;
    border: 1px solid #e1e5eb;
    border-radius: 8px;
    padding: 6px;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
}

.underline-color-selector.show {
    display: flex;
}

.underline-color-btn {
    width: 30px; /* 从32px减小到30px */
    height: 30px; /* 从32px减小到30px */
    border: 2px solid #e1e5eb;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem; /* 从1.2rem减小到1.1rem */
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.underline-color-btn:hover {
    transform: scale(1.1);
    border-width: 3px;
}

/* 注释弹出框（无背景遮罩，贴近所选文字） */
.comment-popup {
    position: fixed;
    width: 280px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    z-index: 1200;
}

.comment-popup-header {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.comment-popup-text {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    font-size: 13px;
    line-height: 1.4;
    color: #0f172a;
    resize: vertical;
    outline: none;
    background: #ffffff;
}

.comment-popup-text:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.18);
}

.comment-popup-actions {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.comment-popup-actions-right {
    display: flex;
    gap: 8px;
}

.comment-popup-btn {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}

.comment-popup-btn:hover {
    filter: brightness(0.98);
}

.comment-popup-btn-save {
    background: #667eea;
    border-color: #667eea;
    color: #ffffff;
}

.comment-popup-btn-delete {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
}

/* 导出格式选择器 - 与导航栏下拉框样式统一 */
.export-format-selector {
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 120px;
    margin-top: 4px;
    display: none;
    padding: 0;
}

.export-format-selector.show {
    display: block;
}

.export-format-btn {
    padding: 10px 12px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.export-format-btn:not(:last-child) {
    border-bottom: 1px solid #eee;
}

.export-format-btn:hover {
    background: #f0f4ff;
}

.export-format-btn span {
    font-size: 1rem;
}

/* 下划线颜色按钮样式 - 5种颜色（采用格上标颜色：绿色、粉色、蓝色、黄色、紫色） */
/* 颜色1：绿色（来自格上标4） */
.underline-color-btn.underline-color-1 {
    border-color: #86efac; /* 稍微深一点的绿色 */
    color: #86efac;
}

.underline-color-btn.underline-color-1:hover {
    background: #dcfce7;
}

/* 颜色2：粉色（来自格上标2） */
.underline-color-btn.underline-color-2 {
    border-color: #f9a8d4; /* 稍微深一点的粉色 */
    color: #f9a8d4;
}

.underline-color-btn.underline-color-2:hover {
    background: #fce7f3;
}

/* 颜色3：蓝色（来自格上标3） */
.underline-color-btn.underline-color-3 {
    border-color: #93c5fd; /* 稍微深一点的蓝色 */
    color: #93c5fd;
}

.underline-color-btn.underline-color-3:hover {
    background: #dbeafe;
}

/* 颜色4：黄色（来自格上标1） */
.underline-color-btn.underline-color-4 {
    border-color: #fde047; /* 稍微深一点的黄色 */
    color: #fde047;
}

.underline-color-btn.underline-color-4:hover {
    background: #fef9c3;
}

/* 颜色5：紫色（来自pl标记） */
.underline-color-btn.underline-color-5 {
    border-color: #8b5cf6; /* pl标记的紫色 */
    color: #8b5cf6;
}

.underline-color-btn.underline-color-5:hover {
    background: #ede9fe;
}

/* 顶部导航栏 */
.header {
    grid-area: header;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

.logo {
    font-size: 1.3rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.version-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(102, 126, 234, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    letter-spacing: 0;
}

.editable-title {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.editable-title:hover {
    opacity: 0.8;
}

.editable-title:focus {
    outline: 2px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
    border-radius: 4px;
}

.title-edit-input {
    font-family: inherit;
}

.mode-switch {
    display: flex;
    gap: 8px;
}

.mode-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 16px;
    background: rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

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

.mode-btn.active {
    background: white;
    color: #667eea;
    font-weight: bold;
}

/* 右侧区域包含模式和提交按钮 */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.submit-header-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    /* 统一“开始测试”与“计时中 提交”等状态下的宽度，避免文字变化导致按钮跳动 */
    min-width: 140px;
    justify-content: center;
}

.submit-header-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* 【新增】计时中状态 */
.submit-header-btn.timing {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: timer-pulse 2s infinite;
}

/* 计时中状态 - 时钟图标固定显示 */
.submit-header-btn.timing .timing-icon {
    display: inline-block;
    /* 删除旋转动画，保持图标固定 */
}

/* 计时中状态 - 数字微动效果 */
.submit-header-btn.timing .timing-text {
    animation: timer-text-beat 1s ease-in-out infinite;
}

/* 移除伪元素时钟图标，避免与JavaScript添加的图标重复 */
/*.submit-header-btn.timing::before {
    content: "⏱️ ";
}*/

/* 【新增】已提交状态 */
.submit-header-btn.submitted {
    background: #10b981;
    cursor: default;
}
/* 注意：已提交状态的✅符号由JavaScript控制，不再使用::before伪元素 */

/* 【新增】脉冲动画 */
@keyframes timer-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(102, 126, 234, 0);
    }
}

/* 【新增】时钟图标旋转动画 */
@keyframes timer-icon-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 【新增】计时数字微动动画（模拟心跳） */
@keyframes timer-text-beat {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* 【临时禁用】计时中状态 - 边框渐变流动效果 */
/*.submit-header-btn.timing::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #667eea, #764ba2, #667eea);
    background-size: 400% 400%;
    border-radius: 10px;
    z-index: -1;
    animation: gradient-flow 3s ease infinite;
}*/

@keyframes gradient-flow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 顶部白板按钮 */
.whiteboard-header-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    display: none; /* 默认隐藏，精读模式显示 */
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    min-width: 100px; /* 统一按钮宽度 */
}

.whiteboard-header-btn:hover {
    background: rgba(255,255,255,0.3);
}

.whiteboard-header-btn.active {
    background: white;
    color: #667eea;
}

.whiteboard-header-btn.show {
    display: flex;
}

/* 顶部导出按钮：样式与白板按钮保持一致 */
.export-header-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    display: none; /* 默认隐藏，由模式控制显示 */
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    min-width: 100px; /* 统一按钮宽度 */
}

.export-header-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* 主内容区 */
.main-content {
    grid-area: main;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mode-panel {
    display: none;
    flex-direction: column;
    height: 100%;
    /* 【统一压缩】模块外层内边距：从 16px 24px 调整为 12px 16px，减少整体留白 */
    padding: 12px 16px;
    overflow: hidden;
    position: relative; /* 添加这行，让 .mode-init-hint 可以使用 absolute 定位 */
}

.mode-panel.active {
    display: flex;
}

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e1e5eb;
}

.article-header h2 {
    font-size: 1.15rem;
    color: #333;
}

/* 模式初始化提示 */
.mode-init-hint {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* height: 100%; 移除这行，使用 absolute 定位 */
    padding: 40px;
    text-align: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f5f7fa;
    z-index: 10;
}

.mode-init-hint.show {
    display: flex;
}

.mode-init-hint .hint-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.mode-init-hint .hint-text {
    font-size: 1.2rem;
    color: #667eea;
    font-weight: bold;
    margin-bottom: 8px;
}

.mode-init-hint .hint-subtext {
    font-size: 0.95rem;
    color: #888;
}

.mode-init-hint .welcome-logo {
    width: 120px;
    height: auto;
    margin-bottom: 24px;
    opacity: 0.9;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    /* 【统一压缩】阅读/听力/精练等双栏主内容间距：从 16px 调整为 12px */
    gap: 12px;
    flex: 1;
    overflow: hidden;
    position: relative; /* 用于模糊遮罩定位 */
}

/* 【新增】阅读2/4布局：调换左右顺序 - 左题目区，右文章区 */
.content-wrapper.reading-info-match,
.content-wrapper.reading-ad-match {
    grid-template-columns: 0.9fr 1.1fr;
}

/* 调换顺序时，确保文章内容在右侧 */
.content-wrapper.reading-info-match .article-content,
.content-wrapper.reading-ad-match .article-content {
    order: 2;
}

.content-wrapper.reading-info-match .questions-panel,
.content-wrapper.reading-ad-match .questions-panel {
    order: 1;
}

/* 【新增】测试模式内容遮罩 - 包含所有内容区域 */
/* 使用ID选择器提高优先级 */
#testContentWrapper.testing .article-content,
#testContentWrapper.testing .questions-panel,
#listeningTestContentWrapper.testing .listening-display-area,
#listeningTestContentWrapper.testing .listening-answer-area,
#listeningTestContentWrapper.testing .listening-text-area,
#listeningTestContentWrapper.testing .listening-study-questions-panel,
.content-wrapper.testing .article-content,
.content-wrapper.testing .questions-panel,
.content-wrapper.testing .listening-display-area,
.content-wrapper.testing .listening-answer-area,
.content-wrapper.testing .listening-text-area,
.content-wrapper.testing .listening-study-questions-panel {
    filter: blur(6px) !important;
    pointer-events: none !important;
    user-select: none !important;
    transition: all 0.3s ease;
}

/* 【新增】测试模式下允许 .markable 元素可点击、选择和标记（阅读模块） */
.content-wrapper.testing .question-header.markable,
.content-wrapper.testing .question-text.markable,
.content-wrapper.testing .option-text.markable,
.content-wrapper.testing .option-click-area,
.content-wrapper.testing .options-list li {
    pointer-events: auto;
    user-select: text !important;
    cursor: text;
}

/* 【新增】测试模式下允许听力模块的 .markable 元素可点击、选择和标记 */
.content-wrapper.testing .listening-answer-area .question-text.markable,
.content-wrapper.testing .listening-answer-area .option-text.markable,
.content-wrapper.testing .listening-study-questions-panel .question-text.markable,
.content-wrapper.testing .listening-study-questions-panel .option-text.markable,
.content-wrapper.testing .listening-study-questions-panel .study-option-item {
    pointer-events: auto;
    user-select: text !important;
    cursor: text;
}

/* 【新增】激活状态 - 清晰显示 */
/* 激活状态 - 清晰显示 - 使用ID选择器提高优先级 */
#testContentWrapper.testing.active .article-content,
#testContentWrapper.testing.active .questions-panel,
#listeningTestContentWrapper.testing.active .listening-display-area,
#listeningTestContentWrapper.testing.active .listening-answer-area,
#listeningTestContentWrapper.testing.active .listening-text-area,
#listeningTestContentWrapper.testing.active .listening-study-questions-panel,
.content-wrapper.testing.active .article-content,
.content-wrapper.testing.active .questions-panel,
.content-wrapper.testing.active .listening-display-area,
.content-wrapper.testing.active .listening-answer-area,
.content-wrapper.testing.active .listening-text-area,
.content-wrapper.testing.active .listening-study-questions-panel {
    filter: blur(0) !important;
    pointer-events: auto !important;
    user-select: auto !important;
}

/* 【新增】听力悬浮控制面板遮罩层 - 用于fixed定位的元素 */
.content-wrapper.testing ~ .study-mode-control-panel,
.content-wrapper.testing ~ .test-mode-status-panel,
.study-mode-control-panel.mask-blurred,
.test-mode-status-panel.mask-blurred {
    filter: blur(6px);
    pointer-events: none;
    user-select: none;
    transition: all 0.3s ease;
}

.content-wrapper.testing.active ~ .study-mode-control-panel,
.content-wrapper.testing.active ~ .test-mode-status-panel,
.study-mode-control-panel:not(.mask-blurred),
.test-mode-status-panel:not(.mask-blurred) {
    filter: blur(0) !important;
    pointer-events: auto !important;
    user-select: auto !important;
}

/* 测试模式提示遮罩层 - 可点击，模糊背景 */
.test-mode-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(102, 126, 234, 0.15);  /* 淡蓝紫色透明背景 */
    backdrop-filter: blur(3px);  /* 轻微模糊效果 */
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    cursor: pointer;
}

/* 指向按钮的箭头 */
.test-mode-arrow {
    position: absolute;
    top: -35px;
    right: 30px;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 15px solid rgba(102, 126, 234, 0.8);
    animation: arrowBounceUp 1.5s ease-in-out infinite;
}

@keyframes arrowBounceUp {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.test-mode-overlay-content {
    text-align: center;
    padding: 25px 40px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 12px;
    box-shadow: 0 4px 25px rgba(102, 126, 234, 0.25);
    border: 1px solid rgba(102, 126, 234, 0.2);
    position: relative;
}

.test-mode-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.test-mode-text {
    font-size: 1rem;
    color: #333;
    font-weight: 500;
}

/* 测试模式下显示遮罩 */
.content-wrapper.testing .test-mode-overlay {
    display: flex;
}

/* 激活后隐藏遮罩 */
.content-wrapper.testing.active .test-mode-overlay {
    display: none !important;
}

/* 隐藏旧的伪元素提示 */
.content-wrapper.testing::after {
    display: none !important;
}

/* ===== 修复：恢复遮罩显示规则 ===== */
.content-wrapper.testing:not(.active)::after {
    display: block;
}

/* 遮罩提示层悬停效果 - 已禁用 */
/*.content-wrapper.testing:not(.active)::after:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}*/

/* ===== 修复：当有 active 类时隐藏遮罩 ===== */
.content-wrapper.testing.active::after {
    display: none !important;
}

/* ===== 修复：强制移除 testing 相关的模糊效果 ===== */
html body .content-wrapper.testing .article-content,
html body .content-wrapper.testing .questions-panel,
html body .content-wrapper.testing .listening-display-area,
html body .content-wrapper.testing .listening-answer-area,
html body .content-wrapper.testing .listening-text-area,
html body .content-wrapper.testing .listening-study-questions-panel,
html body .content-wrapper.testing.active .article-content,
html body .content-wrapper.testing.active .questions-panel,
html body .content-wrapper.testing.active .listening-display-area,
html body .content-wrapper.testing.active .listening-answer-area,
html body .content-wrapper.testing.active .listening-text-area,
html body .content-wrapper.testing.active .listening-study-questions-panel {
    filter: blur(0) !important;
    -webkit-filter: blur(0) !important;
    pointer-events: auto !important;
    user-select: auto !important;
}

/* 遮罩提示层悬停效果 - 已禁用 */
/*.content-wrapper.testing:not(.active)::after:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    transform: scale(1.02);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.3);
}*/

/* 点击时的动画效果 */
.content-wrapper.testing:not(.active)::after:active {
    transform: scale(0.98);
}

/* 文章内容区 */
.article-content {
    background: white;
    border-radius: 10px;
    /* 【统一压缩】正文卡片内边距：右侧0让滚动条紧贴边缘，左侧6px保持内容间距 */
    padding: 12px 0 12px 6px;
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    line-height: 1.7;
}

.article-content h4 {
    color: #667eea;
    margin: 14px 0 8px;
    font-size: 1rem;
}

/* 文章标题样式 - 最高优先级 */
.article-content .article-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid #667eea;
    line-height: 1.4;
}

/* 文章副标题样式 - 次高优先级 */
.article-content .article-subtitle {
    font-size: 0.95rem;
    font-weight: 600;
    color: #64748b;
    margin: 0 0 12px 0;
    padding-left: 8px;
    border-left: 3px solid #94a3b8;
    line-height: 1.5;
}

.article-content p {
    margin-bottom: 10px;
    text-align: justify;
    /* 【V2.3修复】右侧边距6px，让文字与滚动条保持距离 */
    padding-right: 6px;
}

.article-content .email-header {
    background: #f8fafc;
    padding: 6px 14px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: #666;
    border-left: 3px solid #94a3b8;
}

.article-content .email-header p {
    margin: 2px 0;
    line-height: 1.3;
}

.article-content .email-header strong {
    color: #333;
    font-weight: 600;
}

.placeholder-text {
    text-align: center;
    color: #999;
    font-size: 1rem;
    padding: 30px;
}

/* 优化的高亮样式 - 使用下划线方式，不改变间距 */
.article-content .highlighted {
    background: transparent;
    border-bottom: 2px solid #fbbf24;
    cursor: pointer;
    padding: 0;
    display: inline;
    transition: border-color 0.2s ease;
}

.article-content .highlighted:hover {
    border-bottom-color: #f59e0b;
}

.article-content .highlighted.marked {
    border-bottom-color: #22c55e;
    background: linear-gradient(to bottom, transparent 60%, rgba(34, 197, 94, 0.3) 60%);
}

.article-content span.bold,
.questions-panel span.bold,
.listening-study-questions-panel span.bold,
.listening-answer-area span.bold,
.listening-text-content span.bold,
.whiteboard-content span.bold {
    font-weight: bold;
}

.article-content span.strike,
.questions-panel span.strike,
.listening-study-questions-panel span.strike,
.listening-answer-area span.strike,
.listening-text-content span.strike,
.whiteboard-content span.strike {
    text-decoration: line-through;
}

.article-content .highlighted.marked:hover {
    border-bottom-color: #16a34a;
}

/* 不同颜色的下划线样式 - 5种颜色（采用格上标颜色：绿色、粉色、蓝色、黄色、紫色） */
/* 颜色1：绿色（来自格上标4 #bbf7d0） */
.article-content .highlighted.marked.underline-color-1,
.questions-panel .highlighted.marked.underline-color-1,
.listening-study-questions-panel .highlighted.marked.underline-color-1,
.listening-study-questions .highlighted.marked.underline-color-1,
.listening-answer-area .highlighted.marked.underline-color-1,
.listening-text-content .highlighted.marked.underline-color-1,
.listening-questions .highlighted.marked.underline-color-1,
#testQuestionsContent .highlighted.marked.underline-color-1,
#studyQuestionsContent .highlighted.marked.underline-color-1,
#listeningQuestionsContent .highlighted.marked.underline-color-1,
#listeningStudyQuestionsContent .highlighted.marked.underline-color-1,
.whiteboard-content .highlighted.marked.underline-color-1 {
    border-bottom-color: #86efac;
    color: #22c55e;
}

.article-content .highlighted.marked.underline-color-1:hover,
.questions-panel .highlighted.marked.underline-color-1:hover,
.listening-study-questions-panel .highlighted.marked.underline-color-1:hover,
.listening-study-questions .highlighted.marked.underline-color-1:hover,
.listening-answer-area .highlighted.marked.underline-color-1:hover,
.listening-text-content .highlighted.marked.underline-color-1:hover,
.listening-questions .highlighted.marked.underline-color-1:hover,
#testQuestionsContent .highlighted.marked.underline-color-1:hover,
#studyQuestionsContent .highlighted.marked.underline-color-1:hover,
#listeningQuestionsContent .highlighted.marked.underline-color-1:hover,
#listeningStudyQuestionsContent .highlighted.marked.underline-color-1:hover,
.whiteboard-content .highlighted.marked.underline-color-1:hover {
    border-bottom-color: #4ade80;
}

/* 颜色2：粉色（来自格上标2 #fbcfe8） */
.article-content .highlighted.marked.underline-color-2,
.questions-panel .highlighted.marked.underline-color-2,
.listening-study-questions-panel .highlighted.marked.underline-color-2,
.listening-study-questions .highlighted.marked.underline-color-2,
.listening-answer-area .highlighted.marked.underline-color-2,
.listening-text-content .highlighted.marked.underline-color-2,
.listening-questions .highlighted.marked.underline-color-2,
#testQuestionsContent .highlighted.marked.underline-color-2,
#studyQuestionsContent .highlighted.marked.underline-color-2,
#listeningQuestionsContent .highlighted.marked.underline-color-2,
#listeningStudyQuestionsContent .highlighted.marked.underline-color-2,
.whiteboard-content .highlighted.marked.underline-color-2 {
    border-bottom-color: #f9a8d4;
    color: #f472b6;
}

.article-content .highlighted.marked.underline-color-2:hover,
.questions-panel .highlighted.marked.underline-color-2:hover,
.listening-study-questions-panel .highlighted.marked.underline-color-2:hover,
.listening-study-questions .highlighted.marked.underline-color-2:hover,
.listening-answer-area .highlighted.marked.underline-color-2:hover,
.listening-text-content .highlighted.marked.underline-color-2:hover,
.listening-questions .highlighted.marked.underline-color-2:hover,
#testQuestionsContent .highlighted.marked.underline-color-2:hover,
#studyQuestionsContent .highlighted.marked.underline-color-2:hover,
#listeningQuestionsContent .highlighted.marked.underline-color-2:hover,
#listeningStudyQuestionsContent .highlighted.marked.underline-color-2:hover,
.whiteboard-content .highlighted.marked.underline-color-2:hover {
    border-bottom-color: #f472b6;
}

/* 颜色3：蓝色（来自格上标3 #bfdbfe） */
.article-content .highlighted.marked.underline-color-3,
.questions-panel .highlighted.marked.underline-color-3,
.listening-study-questions-panel .highlighted.marked.underline-color-3,
.listening-study-questions .highlighted.marked.underline-color-3,
.listening-answer-area .highlighted.marked.underline-color-3,
.listening-text-content .highlighted.marked.underline-color-3,
.listening-questions .highlighted.marked.underline-color-3,
#testQuestionsContent .highlighted.marked.underline-color-3,
#studyQuestionsContent .highlighted.marked.underline-color-3,
#listeningQuestionsContent .highlighted.marked.underline-color-3,
#listeningStudyQuestionsContent .highlighted.marked.underline-color-3,
.whiteboard-content .highlighted.marked.underline-color-3 {
    border-bottom-color: #93c5fd;
    color: #60a5fa;
}

.article-content .highlighted.marked.underline-color-3:hover,
.questions-panel .highlighted.marked.underline-color-3:hover,
.listening-study-questions-panel .highlighted.marked.underline-color-3:hover,
.listening-study-questions .highlighted.marked.underline-color-3:hover,
.listening-answer-area .highlighted.marked.underline-color-3:hover,
.listening-text-content .highlighted.marked.underline-color-3:hover,
.listening-questions .highlighted.marked.underline-color-3:hover,
#testQuestionsContent .highlighted.marked.underline-color-3:hover,
#studyQuestionsContent .highlighted.marked.underline-color-3:hover,
#listeningQuestionsContent .highlighted.marked.underline-color-3:hover,
#listeningStudyQuestionsContent .highlighted.marked.underline-color-3:hover,
.whiteboard-content .highlighted.marked.underline-color-3:hover {
    border-bottom-color: #60a5fa;
}

/* 颜色4：黄色（来自格上标1 #fef08a） */
.article-content .highlighted.marked.underline-color-4,
.questions-panel .highlighted.marked.underline-color-4,
.listening-study-questions-panel .highlighted.marked.underline-color-4,
.listening-study-questions .highlighted.marked.underline-color-4,
.listening-answer-area .highlighted.marked.underline-color-4,
.listening-text-content .highlighted.marked.underline-color-4,
.listening-questions .highlighted.marked.underline-color-4,
#testQuestionsContent .highlighted.marked.underline-color-4,
#studyQuestionsContent .highlighted.marked.underline-color-4,
#listeningQuestionsContent .highlighted.marked.underline-color-4,
#listeningStudyQuestionsContent .highlighted.marked.underline-color-4,
.whiteboard-content .highlighted.marked.underline-color-4 {
    border-bottom-color: #fde047;
    color: #facc15;
}

.article-content .highlighted.marked.underline-color-4:hover,
.questions-panel .highlighted.marked.underline-color-4:hover,
.listening-study-questions-panel .highlighted.marked.underline-color-4:hover,
.listening-study-questions .highlighted.marked.underline-color-4:hover,
.listening-answer-area .highlighted.marked.underline-color-4:hover,
.listening-text-content .highlighted.marked.underline-color-4:hover,
.listening-questions .highlighted.marked.underline-color-4:hover,
#testQuestionsContent .highlighted.marked.underline-color-4:hover,
#studyQuestionsContent .highlighted.marked.underline-color-4:hover,
#listeningQuestionsContent .highlighted.marked.underline-color-4:hover,
#listeningStudyQuestionsContent .highlighted.marked.underline-color-4:hover,
.whiteboard-content .highlighted.marked.underline-color-4:hover {
    border-bottom-color: #facc15;
}

/* 颜色5：紫色（来自pl标记 #8b5cf6） */
.article-content .highlighted.marked.underline-color-5,
.questions-panel .highlighted.marked.underline-color-5,
.listening-study-questions-panel .highlighted.marked.underline-color-5,
.listening-study-questions .highlighted.marked.underline-color-5,
.listening-answer-area .highlighted.marked.underline-color-5,
.listening-text-content .highlighted.marked.underline-color-5,
.listening-questions .highlighted.marked.underline-color-5,
#testQuestionsContent .highlighted.marked.underline-color-5,
#studyQuestionsContent .highlighted.marked.underline-color-5,
#listeningQuestionsContent .highlighted.marked.underline-color-5,
#listeningStudyQuestionsContent .highlighted.marked.underline-color-5,
.whiteboard-content .highlighted.marked.underline-color-5 {
    border-bottom-color: #c4b5fd;
    color: #a78bfa;
}

.article-content .highlighted.marked.underline-color-5:hover,
.questions-panel .highlighted.marked.underline-color-5:hover,
.listening-study-questions-panel .highlighted.marked.underline-color-5:hover,
.listening-study-questions .highlighted.marked.underline-color-5:hover,
.listening-answer-area .highlighted.marked.underline-color-5:hover,
.listening-text-content .highlighted.marked.underline-color-5:hover,
.listening-questions .highlighted.marked.underline-color-5:hover,
#testQuestionsContent .highlighted.marked.underline-color-5:hover,
#studyQuestionsContent .highlighted.marked.underline-color-5:hover,
#listeningQuestionsContent .highlighted.marked.underline-color-5:hover,
#listeningStudyQuestionsContent .highlighted.marked.underline-color-5:hover,
.whiteboard-content .highlighted.marked.underline-color-5:hover {
    border-bottom-color: #7c3aed;
}

/* 加粗样式 */
.article-content .bold {
    font-weight: 700;
}

/* 删除线样式 */
.article-content .strike {
    text-decoration: line-through;
    text-decoration-color: #333; /* 与正文字体一致的黑色 */
    color: #333;
}

/* 上标样式 - 德语格标记
 * 应用于：
 * - 阅读文章区（.article-content）
 * - 阅读/听力题目区（.questions-panel, .listening-study-questions-panel, .listening-answer-area）
 * - 听力精听文本区（.listening-text-content）
 * - 白板区（.whiteboard-content）
 */
.article-content .superscript,
.questions-panel .superscript,
.listening-study-questions-panel .superscript,
.listening-answer-area .superscript,
.listening-text-content .superscript {
    position: relative;
    font-size: 0.75em;
    vertical-align: super;
    font-weight: bold;
    line-height: 1;
    padding: 0 2px;
}

.article-content .superscript.superscript-1,
.questions-panel .superscript.superscript-1,
.listening-study-questions-panel .superscript.superscript-1,
.listening-answer-area .superscript.superscript-1,
.listening-text-content .superscript.superscript-1 {
    color: #854d0e;
    background: #fef08a;
    border-radius: 3px;
}

.article-content .superscript.superscript-2,
.questions-panel .superscript.superscript-2,
.listening-study-questions-panel .superscript.superscript-2,
.listening-answer-area .superscript.superscript-2,
.listening-text-content .superscript.superscript-2 {
    color: #9d174d;
    background: #fbcfe8;
    border-radius: 3px;
}

.article-content .superscript.superscript-3,
.questions-panel .superscript.superscript-3,
.listening-study-questions-panel .superscript.superscript-3,
.listening-answer-area .superscript.superscript-3,
.listening-text-content .superscript.superscript-3 {
    color: #1e40af;
    background: #bfdbfe;
    border-radius: 3px;
}

.article-content .superscript.superscript-4,
.questions-panel .superscript.superscript-4,
.listening-study-questions-panel .superscript.superscript-4,
.listening-answer-area .superscript.superscript-4,
.listening-text-content .superscript.superscript-4 {
    color: #166534;
    background: #bbf7d0;
    border-radius: 3px;
}

/* 被标记短语本身的高亮背景：只作用于 superscript-text，
   这样 m/n/f/pl 不会“带上”格标记的绿色背景 */
.article-content .superscript-text.superscript-1,
.questions-panel .superscript-text.superscript-1,
.listening-study-questions-panel .superscript-text.superscript-1,
.listening-answer-area .superscript-text.superscript-1,
.listening-text-content .superscript-text.superscript-1 {
    background: #fef08a;
    padding: 1px 4px;
    border-radius: 3px;
}

.article-content .superscript-text.superscript-2,
.questions-panel .superscript-text.superscript-2,
.listening-study-questions-panel .superscript-text.superscript-2,
.listening-answer-area .superscript-text.superscript-2,
.listening-text-content .superscript-text.superscript-2 {
    background: #fbcfe8;
    padding: 1px 4px;
    border-radius: 3px;
}

.article-content .superscript-text.superscript-3,
.questions-panel .superscript-text.superscript-3,
.listening-study-questions-panel .superscript-text.superscript-3,
.listening-answer-area .superscript-text.superscript-3,
.listening-text-content .superscript-text.superscript-3 {
    background: #bfdbfe;
    padding: 1px 4px;
    border-radius: 3px;
}

.article-content .superscript-text.superscript-4,
.questions-panel .superscript-text.superscript-4,
.listening-study-questions-panel .superscript-text.superscript-4,
.listening-answer-area .superscript-text.superscript-4,
.listening-text-content .superscript-text.superscript-4 {
    background: #bbf7d0;
    padding: 1px 4px;
    border-radius: 3px;
}

/* 词性与数标记样式：m / n / f / pl */
.article-content .superscript-m,
.questions-panel .superscript-m,
.listening-study-questions-panel .superscript-m,
.listening-answer-area .superscript-m,
.listening-text-content .superscript-m {
    /* m. = 阳性 = 蓝色，仅彩色文字，不再有背景块 */
    color: #2563eb;
    background: transparent;
    border-radius: 0;
}

.article-content .superscript-n,
.questions-panel .superscript-n,
.listening-study-questions-panel .superscript-n,
.listening-answer-area .superscript-n,
.listening-text-content .superscript-n {
    /* n. = 中性 = 绿色，仅彩色文字 */
    color: #16a34a;
    background: transparent;
    border-radius: 0;
}

.article-content .superscript-f,
.questions-panel .superscript-f,
.listening-study-questions-panel .superscript-f,
.listening-answer-area .superscript-f,
.listening-text-content .superscript-f {
    /* f. = 阴性 = 粉色，仅彩色文字 */
    color: #ec4899;
    background: transparent;
    border-radius: 0;
}

.article-content .superscript-pl,
.questions-panel .superscript-pl,
.listening-study-questions-panel .superscript-pl,
.listening-answer-area .superscript-pl,
.listening-text-content .superscript-pl {
    /* pl. = 复数 = 紫色，仅彩色文字 */
    color: #8b5cf6;
    background: transparent;
    border-radius: 0;
}

/* 上标文本容器样式（被标记的短语，如“keinen Hund”） */
.superscript-text {
    position: relative;
    padding-right: 2px;
}

/* 白板中的格式化样式 */
.whiteboard-content .bold {
    font-weight: 700;
}

.whiteboard-content .strike {
    text-decoration: line-through;
    text-decoration-color: #333; /* 与正文字体一致的黑色 */
    color: #333;
}

.whiteboard-content .superscript {
    position: relative;
    font-size: 0.75em;
    vertical-align: super;
    font-weight: bold;
    line-height: 1;
    padding: 0 2px;
}

.whiteboard-content .superscript.superscript-1 {
    color: #854d0e;
    background: #fef08a;
    border-radius: 3px;
}

.whiteboard-content .superscript.superscript-2 {
    color: #9d174d;
    background: #fbcfe8;
    border-radius: 3px;
}

.whiteboard-content .superscript.superscript-3 {
    color: #1e40af;
    background: #bfdbfe;
    border-radius: 3px;
}

.whiteboard-content .superscript.superscript-4 {
    color: #166534;
    background: #bbf7d0;
    border-radius: 3px;
}

/* 白板短语本身的背景，仅作用于 superscript-text */
.whiteboard-content .superscript-text.superscript-1 {
    background: #fef08a;
    padding: 1px 4px;
    border-radius: 3px;
}

.whiteboard-content .superscript-text.superscript-2 {
    background: #fbcfe8;
    padding: 1px 4px;
    border-radius: 3px;
}

.whiteboard-content .superscript-text.superscript-3 {
    background: #bfdbfe;
    padding: 1px 4px;
    border-radius: 3px;
}

.whiteboard-content .superscript-text.superscript-4 {
    background: #bbf7d0;
    padding: 1px 4px;
    border-radius: 3px;
}

.whiteboard-content .superscript-text {
    position: relative;
    padding-right: 2px;
}

/* 白板中的词性与数标记样式：m / n / f / pl */
.whiteboard-content .superscript-m {
    color: #2563eb;
    background: transparent;
    border-radius: 0;
}

.whiteboard-content .superscript-n {
    color: #16a34a;
    background: transparent;
    border-radius: 0;
}

.whiteboard-content .superscript-f {
    color: #ec4899;
    background: transparent;
    border-radius: 0;
}

.whiteboard-content .superscript-pl {
    color: #8b5cf6;
    background: transparent;
    border-radius: 0;
}

/* 词族提示面板样式已移除 */

/* 题目面板 - 压缩垂直间距 */
.questions-panel, .vocab-panel {
    background: white;
    border-radius: 10px;
    /* 【统一压缩】题目/词汇面板内边距：与正文、听力卡片统一为 12px 14px */
    padding: 12px 14px;
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

/* 阅读精练模式题目面板 - 统一为听力精练模式格式 */
/* 使用更高优先级选择器，确保完全覆盖 .questions-panel 的样式 */
.questions-panel#studyQuestionsPanel,
#studyQuestionsPanel {
    background: transparent !important; /* 去除外层背景，避免双层框效果 */
    border-radius: 0 !important; /* 去除外层圆角 */
    padding: 0 !important; /* 去除外层内边距，避免双层框效果 */
    box-shadow: none !important; /* 去除外层阴影，避免双层框效果 */
    border: none !important; /* 明确去除边框 */
    overflow: hidden !important; /* 外层容器不滚动，由内层容器滚动 */
    overflow-y: hidden !important; /* 明确禁用垂直滚动，确保覆盖 .questions-panel 的 overflow-y: auto */
    display: flex !important; /* 明确设置，覆盖 .questions-panel 的样式 */
    flex-direction: column !important; /* 明确设置，覆盖 .questions-panel 的样式 */
}

/* 阅读精练模式题目面板标题样式 - 参考听力精练模式 */
/* 标题在内层滚动容器中，与内容一起滚动 */
#studyQuestionsPanel h3,
#studyQuestionsContent h3 {
    font-size: 0.9rem;
    color: #333;
    margin: 0 0 10px 0; /* 参考听力题目标题格式：margin: 0 0 10px 0 */
    padding-bottom: 8px; /* 参考听力题目标题格式：padding-bottom: 8px */
    border-bottom: 1px solid #e1e5eb;
    flex-shrink: 0; /* 标题不收缩 */
}

/* 阅读精练模式题目内容容器 - 参考听力精练模式结构 */
/* 内层容器包含标题和内容，统一滚动，统一显示框的视觉效果 */
#studyQuestionsContent {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0; /* 确保 flex 子元素可以正确收缩 */
    background: white !important; /* 内层容器有背景 */
    border-radius: 12px !important; /* 内层容器有完整圆角 */
    /* 【统一压缩】阅读精练内层容器内边距：与题目面板一致 */
    padding: 12px 14px !important; /* 内层容器有内边距，标题和内容都在其中 */
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important; /* 内层容器有阴影 */
    border: none !important; /* 确保没有边框 */
    margin: 0 !important; /* 确保没有外边距 */
    height: 100%; /* 【修复】确保容器有明确的高度 */
    max-height: 100%; /* 【修复】限制最大高度，确保滚动条正常工作 */
}

/* 【修复】题目容器样式，确保内容可以正常滚动 */
#studyQuestionsContent .questions-container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    /* 【统一压缩】阅读精练题目之间间距：从 16px 调整为 12px */
    gap: 12px;
    padding-bottom: 8px; /* 【修复】确保最后一个卡片的下边缘不被截断 */
}

.questions-panel h3, .vocab-panel h3 {
    color: #667eea;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e1e5eb;
    font-size: 0.95rem;
}

.vocab-controls {
    margin-bottom: 10px;
}

.vocab-controls .tool-btn {
    padding: 6px 12px;
    background: #f0f4ff;
    border: 1px solid #667eea;
    border-radius: 6px;
    color: #667eea;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.vocab-controls .tool-btn:hover {
    background: #667eea;
    color: white;
}

.vocab-controls .tool-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    border-radius: 4px;
}

/* 白板样式 - 覆盖整个词汇区 */
.vocab-panel {
    position: relative;
    overflow: visible;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.vocab-panel h3 {
    color: #667eea;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e1e5eb;
    font-size: 0.95rem;
}

.whiteboard {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 253, 240, 0.98);
    z-index: 10;
    display: none;
    flex-direction: column;
}

.whiteboard.show {
    display: flex;
}

.whiteboard-content {
    flex: 1;
    padding: 14px;
    outline: none;
    line-height: 1.6;
    font-weight: normal;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.3);
    background-image: 
        linear-gradient(rgba(102, 126, 234, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(102, 126, 234, 0.08) 1px, transparent 1px);
    background-size: 20px 20px;
    cursor: text;
    white-space: pre-wrap;
    position: relative;
    z-index: 10;
    min-height: 0;
}

.whiteboard-content:empty:before {
    content: '选中左侧文章内容可拖动到这里...';
    color: #9ca3af;
    font-style: italic;
}

.whiteboard-tools {
    padding: 6px 14px;
    border-top: 1px solid rgba(102, 126, 234, 0.2);
    display: flex;
    justify-content: flex-end;
    background: rgba(248, 250, 252, 0.8);
    position: relative;
    z-index: 50;
    min-height: 35px;
}

.whiteboard-tools .tool-btn.small {
    padding: 4px 10px;
    font-size: 0.8rem;
    background: rgba(254, 226, 226, 0.8);
    border: 1px solid #ef4444;
    color: #ef4444;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.whiteboard-tools .tool-btn.small:hover {
    background: #ef4444;
    color: white;
}

/* 白板中的标记样式 */
.whiteboard-content .highlighted {
    background: transparent;
    border-bottom: 3px solid #22c55e;
    cursor: pointer;
    padding: 0;
    position: relative;
    display: inline;
    transition: border-color 0.2s ease;
}

.whiteboard-content .highlighted:hover {
    border-bottom-color: #16a34a;
}

/* 通用阅读题目块（测试模式） */
.question-item {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

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

/* 阅读精练模式：右侧"小题卡片"样式，参考听力精听 .listening-question-item */
#studyQuestionsPanel .questions-container {
    gap: 8px; /* 与 .listening-study-questions 中的 gap 保持一致 */
    padding-bottom: 8px; /* 【修复】确保最后一个卡片的下边缘不被截断 */
}

#studyQuestionsPanel .question-item {
    margin: 0;                       /* 去掉列表式的上下间距，由 gap 控制 */
    padding: 8px 14px;               /* 与听力小题卡片一致 */
    border-radius: 6px;
    border: 1px solid #e1e5eb;
    background: #f8fafc;
    box-shadow: none;
    padding-bottom: 8px;             /* 保持内部排版舒适 */
    border-bottom: none;             /* 覆盖通用列表下划线 */
    cursor: pointer;                 /* 与听力题卡片一致 */
    transition: all 0.2s ease;       /* 与听力题卡片一致 */
}

#studyQuestionsPanel .question-item:hover {
    border-color: #667eea;           /* 与听力题卡片悬停效果一致 */
    background: #f0f4ff;             /* 浅蓝色背景 */
}

#studyQuestionsPanel .question-item:last-child {
    margin-bottom: 0;
    padding-bottom: 8px;
    border-bottom: none;
}

/* 题目头部 - 一行显示题号和题目 */
.question-header {
    display: flex;
    align-items: baseline;
    gap: 18px; /* 约4个中文字符宽度 */
    margin-bottom: 6px;
    line-height: 1.4;
    padding-left: 0; /* 与选项外框左边界对齐 */
}

.question-num {
    font-weight: bold;
    color: #667eea;
    font-size: 0.85rem;
    flex-shrink: 0;
    width: 50px; /* 2位数字约22px，"Beispiel:"约45px */
    text-align: right;
}

/* 【修复】Beispiel卡片题号：统一字号 */
.question-num[data-is-beispiel="true"] {
    font-size: 0.85rem !important;
}

.question-text {
    font-size: 0.9rem;
    color: #333;
}

/* 阅读2和阅读4左侧题目区的题目文本样式 - 增大字号 */
.content-wrapper.reading-info-match .question-item .question-text,
.content-wrapper.reading-ad-match .question-item .question-text {
    font-size: 1rem;
    line-height: 1.4;
}

/* 阅读2和阅读4左侧题目区布局优化 - 减小间距 */
.content-wrapper.reading-info-match .question-header,
.content-wrapper.reading-ad-match .question-header {
    gap: 10px;
    margin-bottom: 4px;
}

.content-wrapper.reading-info-match .question-num,
.content-wrapper.reading-ad-match .question-num {
    width: 32px;
}

.content-wrapper.reading-info-match .options-list,
.content-wrapper.reading-ad-match .options-list {
    margin-top: 2px;
}

.content-wrapper.reading-info-match .options-list li,
.content-wrapper.reading-ad-match .options-list li {
    margin: 3px 0;
}

/* 题目可标记区域样式 */
.question-header.markable,
.question-text.markable,
.options-list li.markable {
    cursor: text;
    user-select: text;
}

.question-header.markable:hover,
.question-text.markable:hover,
.options-list li.markable:hover {
    background: transparent;
}

/* 标记文字样式 - 统一效果：上方半透明黄条 + 下方黄色线 */
.highlighted {
    background: linear-gradient(to bottom, transparent 60%, rgba(251, 191, 36, 0.4) 60%);
    border-bottom: 3px solid #fbbf24;
    cursor: pointer;
    padding: 0;
    display: inline;
    transition: border-color 0.2s ease;
}

.highlighted:hover {
    border-bottom-color: #f59e0b;
}

.highlighted.marked {
    border-bottom-color: #22c55e;
    background: linear-gradient(to bottom, transparent 60%, rgba(34, 197, 94, 0.3) 60%);
}

.highlighted.marked:hover {
    border-bottom-color: #16a34a;
}

.bold {
    font-weight: bold;
}

.strike {
    text-decoration: line-through;
    color: #333;
}

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

.options-list li {
    padding: 0;
    margin: 5px 0;
    border: 2px solid #e1e5eb;
    border-radius: 6px;
    cursor: default;
    transition: all 0.2s ease;
    display: flex;
    overflow: hidden;
    background: white;
}

.options-list li:hover {
    border-color: #667eea;
}

.options-list li.selected {
    border-color: #667eea;
    background: #e8efff;
}

.options-list li.correct {
    border-color: #22c55e;
    background: #dcfce7;
}

.options-list li.incorrect {
    border-color: #ef4444;
    background: #fee2e2;
}

/* 选项可点击区域（方块+字母） */
.option-click-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.03);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.options-list li.selected .option-click-area {
    background: rgba(102, 126, 234, 0.15);
}

.options-list li.correct .option-click-area {
    background: rgba(34, 197, 94, 0.15);
}

.options-list li.incorrect .option-click-area {
    background: rgba(239, 68, 68, 0.15);
}

/* 正方形复选框 */
.option-checkbox {
    width: 16px;
    height: 16px;
    border: 2px solid #c0c5ce;
    border-radius: 3px;
    flex-shrink: 0;
    transition: all 0.2s ease;
    position: relative;
}

/* 选中状态（优先级高于correct）- 蓝色背景+居中X标记 */
.options-list li.selected {
    position: relative;
}

.options-list li.selected::after {
    content: "✕";
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    z-index: 10;
    pointer-events: none;
}

#app.focus-mode .options-list li.selected::after {
    left: 15px;
    font-size: 11px;
    top: 50%;
    transform: translate(-50%, -50%);
}

.options-list li.selected .option-checkbox {
    border-color: #667eea !important;
    background: #667eea !important;
}

/* 已选中状态 - 仅显示颜色 */

.option-letter {
    font-weight: bold;
    font-size: 0.85rem;
    color: #667eea;
    min-width: 20px;
}

/* 选项文字区域 - 可标记 */
.option-text {
    padding: 8px 12px;
    font-size: 0.85rem;
    flex: 1;
    cursor: text;
    user-select: text;
}

/* 听力右侧题目选项：压缩行距/留白到接近最小（字号不变） */
.listening-answer-area .options-list li,
.listening-study-questions-panel .options-list li {
    margin: 2px 0;
}

.listening-answer-area .option-click-area,
.listening-study-questions-panel .option-click-area {
    padding: 4px 10px;
    gap: 6px;
}

/* 听力1专用：X标记位置调整 */
.listening-answer-area .options-list li.selected::after,
.listening-study-questions-panel .options-list li.selected::after {
    left: 18px;
}

.listening-answer-area .options-list li.correct::after,
.listening-study-questions-panel .options-list li.correct::after {
    left: 18px;
}

.listening-answer-area .options-list li.incorrect::after,
.listening-study-questions-panel .options-list li.incorrect::after {
    left: 18px;
}

.listening-answer-area .option-text,
.listening-study-questions-panel .option-text {
    padding: 4px 10px;
    line-height: 1.2;
}

.options-list li.correct {
    position: relative;
}

.options-list li.correct::after {
    content: "✕";
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    z-index: 10;
    pointer-events: none;
}

.options-list li.correct .option-checkbox {
    border-color: #22c55e;
    background: #22c55e;
}

.options-list li.incorrect {
    position: relative;
}

.options-list li.incorrect::after {
    content: "✕";
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    z-index: 10;
    pointer-events: none;
}

.options-list li.incorrect .option-checkbox {
    border-color: #ef4444;
    background: #ef4444;
}

/* 已提交状态 - 仅显示颜色 */

/* 提交按钮包装器 - 用于固定定位 */
.submit-btn-wrapper {
    flex-shrink: 0;
    padding-top: 12px;
    margin-top: auto;
    background: white;
    border-radius: 0 0 10px 10px;
}

/* 时钟图标 */
.clock-icon {
    display: inline-block;
}

/* 已提交图标 */
.submitted-icon {
    display: inline-block;
}

/* 全宽提交按钮 */
.submit-btn.full-width {
    width: 100%;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    margin: 0;
}

.submit-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

/* 激活状态下显示提交按钮 */
.content-wrapper.active .submit-btn,
.content-wrapper.active .submit-btn-wrapper {
    display: flex !important;
}

/* 听力答题区提交按钮样式优化 */
.listening-answer-area .submit-btn {
    position: relative;
    bottom: auto;
    flex-shrink: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    margin-top: auto;
    z-index: 10;
    border-radius: 8px;
}

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

/* 精读模式样式 - 移除下划线，用户点击单词时触发提示 */
.article-content.study-mode .clickable-word {
    cursor: pointer;
    border-bottom: none;
    padding: 0;
    transition: all 0.2s ease;
}

.article-content.study-mode .clickable-word:hover {
    color: #667eea;
}

.article-content.study-mode .clickable-word.selected {
    color: #667eea;
}

.vocab-item {
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
}

.vocab-word {
    font-weight: bold;
    font-size: 1rem;
    color: #667eea;
    margin-bottom: 6px;
}

.vocab-category {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 6px;
}

.vocab-expressions {
    font-size: 0.85rem;
    line-height: 1.5;
}

.vocab-expressions strong {
    color: #333;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalIn 0.3s ease;
}

.word-modal-content {
    max-width: 550px;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 1.3rem;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

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

.modal-content h2 {
    color: #667eea;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e1e5eb;
}

.result-score {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    margin: 12px 0;
}

/* 弹窗标题样式 */
.result-title {
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.result-subtitle {
    text-align: center;
    font-size: 1rem;
    color: #667eea;
    margin-bottom: 12px;
}

.result-item {
    display: flex;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.result-item .result-question {
    flex: 0 0 100px;
    font-weight: 500;
}

.result-item .result-user-answer {
    flex: 1;
    color: #555;
    font-size: 0.85rem;
}

.result-item .result-status {
    font-size: 1rem;
    margin-right: 8px;
}

.result-item .result-answer {
    color: #888;
    font-size: 0.85rem;
}

.result-item.correct {
    color: #22c55e;
}

.result-item.incorrect {
    color: #ef4444;
}

.result-details {
    margin-top: 16px;
    max-height: 300px;
    overflow-y: auto;
}

/* 精读模式词汇面板 */
.vocab-section {
    margin-bottom: 16px;
}

.vocab-section h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

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

.vocab-list li {
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.vocab-list li:hover {
    background: #e8efff;
    transform: translateX(4px);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    #app {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "header"
            "main";
    }

    .sidebar {
        display: none;
    }

    .content-wrapper {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
    }
}

/* 滚动条样式 - 全局默认 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 专注模式下优化滚动条宽度，减少占用空间 */
#app.focus-mode ::-webkit-scrollbar {
    width: 4px !important;
    height: 4px !important;
}

/* 【V2.3统一】阅读精练、听力精练、文章详解、文本朗读模式滚动条样式 */
/* 极窄宽度、透明轨道、紧贴边缘 */
#studyContentWrapper ::-webkit-scrollbar,
#listeningStudyContentWrapper ::-webkit-scrollbar,
#articleExplainContentWrapper ::-webkit-scrollbar,
#studyContentWrapper .scrollable::-webkit-scrollbar,
#listeningStudyContentWrapper .scrollable::-webkit-scrollbar,
#articleExplainContentWrapper .scrollable::-webkit-scrollbar,
#studyArticleContent::-webkit-scrollbar,
#listeningTextArea::-webkit-scrollbar,
#listeningStudyQuestionsContent::-webkit-scrollbar,
#articleExplainContentBody::-webkit-scrollbar,
#articleExplainWhiteboardContent::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

#studyContentWrapper ::-webkit-scrollbar-track,
#listeningStudyContentWrapper ::-webkit-scrollbar-track,
#articleExplainContentWrapper ::-webkit-scrollbar-track,
#studyContentWrapper .scrollable::-webkit-scrollbar-track,
#listeningStudyContentWrapper .scrollable::-webkit-scrollbar-track,
#articleExplainContentWrapper .scrollable::-webkit-scrollbar-track,
#studyArticleContent::-webkit-scrollbar-track,
#listeningTextArea::-webkit-scrollbar-track,
#listeningStudyQuestionsContent::-webkit-scrollbar-track,
#articleExplainContentBody::-webkit-scrollbar-track,
#articleExplainWhiteboardContent::-webkit-scrollbar-track {
    background: transparent;
    margin: 0;
}

#studyContentWrapper ::-webkit-scrollbar-thumb,
#listeningStudyContentWrapper ::-webkit-scrollbar-thumb,
#articleExplainContentWrapper ::-webkit-scrollbar-thumb,
#studyContentWrapper .scrollable::-webkit-scrollbar-thumb,
#listeningStudyContentWrapper .scrollable::-webkit-scrollbar-thumb,
#articleExplainContentWrapper .scrollable::-webkit-scrollbar-thumb,
#studyArticleContent::-webkit-scrollbar-thumb,
#listeningTextArea::-webkit-scrollbar-thumb,
#listeningStudyQuestionsContent::-webkit-scrollbar-thumb,
#articleExplainContentBody::-webkit-scrollbar-thumb,
#articleExplainWhiteboardContent::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
}

#studyContentWrapper ::-webkit-scrollbar-thumb:hover,
#listeningStudyContentWrapper ::-webkit-scrollbar-thumb:hover,
#articleExplainContentWrapper ::-webkit-scrollbar-thumb:hover,
#studyContentWrapper .scrollable::-webkit-scrollbar-thumb:hover,
#listeningStudyContentWrapper .scrollable::-webkit-scrollbar-thumb:hover,
#articleExplainContentWrapper .scrollable::-webkit-scrollbar-thumb:hover,
#studyArticleContent::-webkit-scrollbar-thumb:hover,
#listeningTextArea::-webkit-scrollbar-thumb:hover,
#listeningStudyQuestionsContent::-webkit-scrollbar-thumb:hover,
#articleExplainContentBody::-webkit-scrollbar-thumb:hover,
#articleExplainWhiteboardContent::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Firefox 滚动条样式 */
#studyContentWrapper,
#listeningStudyContentWrapper,
#articleExplainContentWrapper,
#studyContentWrapper .scrollable,
#listeningStudyContentWrapper .scrollable,
#articleExplainContentWrapper .scrollable,
#studyArticleContent,
#listeningTextArea,
#listeningStudyQuestionsContent,
#articleExplainContentBody,
#articleExplainWhiteboardContent {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

/* 确保滚动条紧贴边缘 - 移除右侧padding */
#studyContentWrapper .resizable-panel,
#listeningStudyContentWrapper .resizable-panel,
#articleExplainContentWrapper .resizable-panel {
    padding-right: 0 !important;
}

#studyArticleContent,
#studyContentWrapper .scrollable,
#listeningTextArea,
#listeningStudyQuestionsContent,
#articleExplainContentBody,
#articleExplainWhiteboardContent {
    padding-right: 0 !important;
}

/* 邮件格式 */
.email-from, .email-to, .email-subject, .email-time {
    color: #666;
}

.email-from strong, .email-to strong, .email-subject strong, .email-time strong {
    color: #333;
}

/* 例题样式 */
.example-section {
    background: #fef3c7;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    border-left: 4px solid #f59e0b;
}

.example-section h4 {
    color: #b45309;
    margin-bottom: 10px;
}

/* 答案示例 */
.example-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.example-option {
    padding: 4px 10px;
    background: white;
    border: 1px solid #e1e5eb;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* 例题禁用样式 - 非正确答案不可点击 */
.options-list li.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.options-list li.disabled .option-click-area {
    cursor: not-allowed;
}

.options-list li.disabled .option-text {
    cursor: not-allowed;
}

/* 例题禁用的事件列表不响应点击 */
.options-list.example-disabled {
    pointer-events: none;
}

/* 题目配对样式 */
.pair-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 8px;
}

.pair-number {
    font-weight: bold;
    color: #667eea;
    min-width: 26px;
}

.pair-content {
    flex: 1;
}

.pair-options {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pair-option {
    padding: 4px 10px;
    background: white;
    border: 1px solid #e1e5eb;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pair-option:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.pair-option.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ==================== 听力模式样式 ==================== */

/* 模式按钮 - 四种模式 */
.mode-switch {
    display: flex;
    gap: 4px;
    position: relative;
}

.mode-btn {
    padding: 6px 12px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(255,255,255,0.7);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.exercise-btn {
    padding: 6px 16px;
    background: rgba(255,255,255,0.15);
    color: white;
    font-weight: 600;
    min-width: 80px;
}

.exercise-btn.active {
    background: rgba(255,255,255,0.3);
    color: white;
    border-color: rgba(255,255,255,0.3);
}

.sub-modes {
    display: flex;
    gap: 4px;
    margin-left: 4px;
    opacity: 1;
    transition: all 0.3s ease;
}

.sub-modes.hidden {
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.sub-mode-btn {
    padding: 6px 12px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(255,255,255,0.7);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.sub-mode-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sub-mode-btn.active {
    background: rgba(255,255,255,0.2);
    color: white;
    border-color: rgba(255,255,255,0.3);
}

.sub-tool-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(255,255,255,0.7);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.sub-tool-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sub-tool-btn.show {
    display: flex;
}

.listening-modes {
    display: none;
}

.listening-modes.active {
    display: flex;
}

/* 下拉菜单样式 */
.dropdown {
    position: relative;
    display: inline-block;
}

.operations-area {
    display: flex;
    gap: 4px;
    margin-right: 16px;
}

.navigation-area {
    display: flex;
    gap: 8px;
}

.dropdown-btn {
    padding: 6px 12px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.7); /* 默认颜色稍浅，表示未选择状态 */
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    width: 100px; /* 固定宽度，确保选择前后一致 */
    justify-content: space-between; /* 让内容两端对齐，文本左对齐，箭头右对齐 */
}

/* 选中状态的下拉按钮 */
.dropdown-btn.selected {
    color: white; /* 选中后文字颜色更亮 */
    font-weight: 500; /* 选中后字体稍粗 */
    font-size: 0.9rem; /* 选中后稍微增大字号 */
    justify-content: center; /* 选中后文字居中显示 */
    background: rgba(255,255,255,0.25); /* 选中后更深的背景色 */
    border-color: rgba(255,255,255,0.4); /* 选中后更深的边框色 */
}

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

.focus-header-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(255,255,255,0.7);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.focus-header-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.dropdown-arrow {
    font-size: 0.7em;
    transition: transform 0.2s ease;
}

.dropdown-arrow.open {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 120px;
    margin-top: 4px;
}

/* 德语模块下拉菜单 - 向左扩展 */
#exerciseTypeMenu {
    position: absolute;
    top: 100%;
    right: 0; /* 从右边对齐，实现向左扩展 */
    left: auto; /* 取消左边对齐 */
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 120px;
    margin-top: 4px;
}

/* 学习方式下拉菜单 - 向右扩展 */
#modeTypeMenu {
    position: absolute;
    top: 100%;
    left: 0; /* 保持左边对齐，实现向右扩展 */
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 120px;
    margin-top: 4px;
}

.dropdown-item {
    padding: 10px 12px; /* 增加上下内边距，增加选项间区隔 */
    color: #333;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.95rem; /* 增大文字大小 */
    position: relative;
}

/* 选项之间的分割线 */
.dropdown-item:not(:last-child) {
    border-bottom: 1px solid #eee;
}

.dropdown-item:hover {
    background: #f0f4ff;
}

.mode-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.mode-btn.active {
    background: rgba(255,255,255,0.2);
    color: white;
    border-color: rgba(255,255,255,0.3);
}

/* 听力测试模式布局 - 新设计 */
.listening-test-wrapper {
    grid-template-columns: 280px 1fr !important;
    /* 【统一压缩】听力测试左右列主内容间距：从 16px 调整为 12px */
    gap: 12px !important;
}

/* 听力2特殊布局：收起右侧面板后，答题区自动填满 */
/* 详细规则已移至下方 4634-4700 行 */

/* 显示区（测试模式左侧） */
.listening-display-area {
    background: white;
    border-radius: 12px;
    /* 【统一压缩】听力显示区卡片内边距：与其他主内容卡片统一为 12px 14px */
    padding: 12px 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.listening-display-header {
    display: flex;
    align-items: center;
    gap: 10px;
    /* 【统一压缩】标题与内容间距：从 12px 调整为 8px */
    padding-bottom: 8px;
    border-bottom: 1px solid #e1e5eb;
    margin-bottom: 10px;
}

.listening-display-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    min-height: 200px;
}

.listening-display-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    /* 【统一压缩】控制区顶部间距：从 12px 调整为 8px */
    padding-top: 8px;
    border-top: 1px solid #e1e5eb;
    margin-top: auto;
}

.listening-display-controls .control-btn {
    width: 40px;
    height: 40px;
}

.listening-display-controls span {
    font-size: 0.85rem;
    color: #666;
}

/* 答题区（测试模式右侧） */
.listening-answer-area {
    background: white;
    border-radius: 12px;
    /* 【统一压缩】听力测试答题区卡片内边距 */
    padding: 12px 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    overflow: visible; /* 允许按钮溢出显示 */
    position: relative; /* 为提交按钮的绝对定位提供参照 */
}

.listening-type-header {
    display: flex;
    align-items: center;
    gap: 10px;
    /* 【统一压缩】标题与内容间距 */
    padding-bottom: 8px;
    border-bottom: 1px solid #e1e5eb;
    margin-bottom: 10px;
}

.listening-type-icon {
    font-size: 1.3rem;
}

.listening-type-text {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    flex: 1;
}

/* 发音状态图标 */
.audio-status-icon {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: #f0f4ff;
    border-radius: 20px;
}

.audio-wave {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 16px;
}

.wave-bar {
    width: 3px;
    background: #667eea;
    border-radius: 2px;
    animation: waveAnimation 0.5s ease-in-out infinite;
}

.wave-bar:nth-child(1) { height: 6px; animation-delay: 0s; }
.wave-bar:nth-child(2) { height: 10px; animation-delay: 0.1s; }
.wave-bar:nth-child(3) { height: 14px; animation-delay: 0.2s; }
.wave-bar:nth-child(4) { height: 10px; animation-delay: 0.3s; }
.wave-bar:nth-child(5) { height: 6px; animation-delay: 0.4s; }

@keyframes waveAnimation {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.5); }
}

.audio-muted, .audio-playing {
    font-size: 1rem;
}

.audio-playing {
    color: #667eea;
}

/* 听力测试模式 - 播放状态呼吸灯 */
.playback-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.breathing-indicator {
    width: 26px;
    height: 26px;
    border-radius: 9999px;
    background: radial-gradient(circle at 30% 30%, #e0e7ff, #4f46e5);
    box-shadow: 0 0 0 rgba(79, 70, 229, 0);
    display: flex;
    align-items: center;
    justify-content: center;
}

.breathing-dot {
    width: 12px;
    height: 12px;
    border-radius: 9999px;
    background: #4f46e5;
    opacity: 0.4;
    transform: scale(0.9);
    box-shadow: 0 0 4px rgba(79, 70, 229, 0.3);
    transition: opacity 0.2s ease-out;
}

.breathing-dot.playing {
    animation: breathingPulse 1.6s ease-in-out infinite;
}

@keyframes breathingPulse {
    0%, 100% {
        transform: scale(0.9);
        opacity: 0.4;
        box-shadow: 0 0 4px rgba(79, 70, 229, 0.35);
    }
    50% {
        transform: scale(1.35);
        opacity: 0.95;
        box-shadow: 0 0 18px rgba(79, 70, 229, 0.85);
    }
}

.playback-status-text {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    color: #4b5563;
}

.playback-status-text .status-line {
    font-weight: 600;
    color: #111827;
}

.playback-status-text .time-line {
    /* 听力测试模式要求：隐藏时间显示，仅保留播放状态文字 */
    display: none;
}

/* 听力播放控制面板 */
.listening-control-panel {
    background: white;
    border-radius: 12px;
    /* 【统一压缩】听力控制面板卡片内边距 */
    padding: 12px 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    /* 【统一压缩】控制面板内部纵向间距 */
    gap: 12px;
}

.listening-control-panel h3 {
    font-size: 0.95rem;
    color: #333;
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e1e5eb;
}

.audio-player {
    width: 100%;
}

.audio-player audio {
    width: 100%;
    height: 36px;
    border-radius: 6px;
}

.playback-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 8px 0;
}

/* 播放控制按钮 - 扁平化简洁风格 */
.control-btn {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: none;
    background: #f3f4f6;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: #4b5563;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.control-btn:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(15, 23, 42, 0.18);
}

.control-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.35);
}

.speed-options {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    background: #f8fafc;
    border-radius: 8px;
}

.speed-option {
    padding: 6px 12px;
    border: 1px solid #e1e5eb;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.speed-option:hover {
    border-color: #667eea;
}

.speed-option.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.listening-info {
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
}

.info-item {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
    text-align: center;
}

/* 听力精听模式布局 - 两列结构 + 右侧悬浮面板 */
.listening-study-wrapper {
    grid-template-columns: 7fr 3fr !important; /* 左侧:右侧 = 7:3 */
    grid-template-rows: 1fr !important;
    /* 【统一压缩】精听左右列主内容间距 */
    gap: 12px !important;
    overflow: hidden !important;
    padding-right: 0 !important; /* 为悬浮面板留出空间 */
}

.listening-text-area {
    background: white;
    border-radius: 12px;
    /* 【统一压缩】精听文本区卡片内边距：右侧0让滚动条紧贴边缘，左侧6px保持内容间距 */
    padding: 12px 0 12px 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.listening-text-header {
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.2;
    /* 按右侧“听力题目”标题标准，收窄上下留白，节约文本空间 */
    padding-bottom: 8px;
    border-bottom: 1px solid #e1e5eb;
    margin-bottom: 10px;
}

/* 左侧标题区：避免 📝 与 🙈 造成 header 过高，保证与右侧标题/分割线齐平 */
.listening-text-header .listening-type-icon {
    font-size: 1.1rem; /* 从默认 1.3rem 略微收窄 */
    line-height: 1;
}

.listening-text-header .display-toggle-btn {
    width: 26px;
    height: 26px;
    font-size: 0.95rem;
    line-height: 1;
    padding: 0;
}

/* 精听播放控制面板（新增中间列） */
.listening-study-control-panel {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.listening-study-control-panel h3 {
    font-size: 0.9rem;
    color: #333;
    margin: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e1e5eb;
}

.listening-study-control-panel .audio-player {
    display: none; /* 隐藏默认音频控件，使用自定义控制 */
}

.listening-study-control-panel .playback-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 8px 0;
}

.listening-study-control-panel .control-btn {
    width: 40px;
    height: 40px;
}

.listening-study-control-panel .speed-options {
    display: none; /* 速度选项通过点击速度按钮显示 */
}

.listening-study-control-panel .listening-info {
    padding: 8px;
    background: #f8fafc;
    border-radius: 6px;
}

.listening-study-control-panel .sentence-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid #e1e5eb;
}

.listening-study-control-panel .sentence-btn {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
}

.listening-text-content {
    flex: 1;
    overflow-y: auto;
    /* 【统一压缩】精听文本内容区内边距：右侧0让滚动条紧贴边缘，左侧6px保持内容间距 */
    padding: 8px 0 8px 6px;
    /* 适度减小行高以提高信息密度（约减少 20%） */
    line-height: 1.6;
    font-size: 1.1rem;
}

.listening-text-content .sentence {
    display: block;
    /* 适度压缩上下内边距和段间距，字体大小保持不变 */
    padding: 9px 16px;
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8fafc;
    border-left: 3px solid transparent;
}

.listening-text-content .sentence:hover {
    background: #e0e7ff;
    border-left-color: #667eea;
}

.listening-text-content .sentence.active {
    background: #e8efff;
    border-left-color: #22c55e;
}

.listening-text-content .sentence.current {
    background: #fef3c7;
    border-left-color: #f59e0b;
}

.listening-study-questions-panel h3 {
    font-size: 0.9rem;
    color: #333;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e1e5eb;
}

.listening-study-questions {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 底部精听控制条 - 已移除，改为在控制面板中显示 */
.listening-study-controls {
    display: none;
}

.listening-question-item {
    padding: 8px 14px;
    background: #f8fafc;
    border: 1px solid #e1e5eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.listening-question-item:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.listening-question-item.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 底部精听控制条 */
.listening-study-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: white;
    border-top: 1px solid #e1e5eb;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

.listening-study-control-left,
.listening-study-control-center,
.listening-study-control-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.listening-study-control-center {
    flex: 1;
    justify-content: center;
}

.sentence-controls {
    display: flex;
    gap: 6px;
}

.sentence-btn {
    width: 38px;
    height: 38px;
    font-size: 1rem;
}

.sentence-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.study-progress-info {
    font-size: 0.85rem;
    color: #666;
    min-width: 80px;
    text-align: right;
}

/* 听力题目样式 */
.listening-questions {
    padding: 4px;
}

.listening-question-item-full {
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 12px;
}

.listening-question-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 10px;
}

.listening-question-num {
    font-weight: bold;
    color: #667eea;
    font-size: 0.85rem;
    min-width: 28px;
}

.listening-question-text {
    font-size: 0.95rem;
    color: #333;
    line-height: 1.5;
}

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

.listening-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: white;
    border: 1px solid #e1e5eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.listening-option:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.listening-option.selected {
    background: #e8efff;
    border-color: #667eea;
}

.listening-option.correct {
    background: #dcfce7;
    border-color: #22c55e;
}

.listening-option.incorrect {
    background: #fee2e2;
    border-color: #ef4444;
}

.listening-option-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #e1e5eb;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.listening-option.selected .listening-option-checkbox {
    background: #667eea;
    border-color: #667eea;
}

.listening-option.selected .listening-option-checkbox::after {
    content: '';
    width: 10px;
    height: 10px;
    background: white;
    clip-path: polygon(20% 80%, 0% 100%, 100% 0%);
}

.listening-option-letter {
    font-weight: 500;
    color: #667eea;
    min-width: 20px;
}

.listening-option-text {
    font-size: 0.9rem;
    color: #333;
}

/* 听力精听模式题目卡片 */
.listening-study-question-card {
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.listening-study-question-card.active {
    background: #e8efff;
    border-left-color: #22c55e;
}

/* ==================== 精听模式右侧悬浮控制面板 ==================== */

.study-mode-control-panel {
    position: fixed;
    right: 0;
    top: 60px;
    bottom: 0;
    width: 200px;
    background: white;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    z-index: 50;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    border-left: 1px solid #e1e5eb;
}

/* 收起状态 */
.study-mode-control-panel.collapsed {
    width: 40px;
}

.study-mode-control-panel.collapsed .floating-panel-content {
    display: none;
}

.study-mode-control-panel.collapsed .floating-panel-title {
    display: none;
}

/* 收起状态下的迷你控制区（精简垂直按钮） */
.floating-mini-controls {
    display: none;
}

.study-mode-control-panel.collapsed .floating-mini-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 8px 6px 12px 6px;
}

/* 精听模式收起状态顶部图标：与左侧收起栏的 📝 统一大小与下边距 */
.mini-panel-icon {
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 4px;
}

/* 精听模式收起区分割线：与左侧栏 tool-divider 统一 */
.mini-tool-divider {
    width: 80%;
    height: 1px;
    background: #e1e5eb;
    margin: 4px 0;
}

.mini-control-btn {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #f3f4f6;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 图标颜色（svg 使用 currentColor 作为 stroke） */
    color: #111827;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.mini-control-btn:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(15, 23, 42, 0.18);
}

.mini-control-btn.active {
    /* 与控制面板按钮统一的选中效果 */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.35);
}

/* 面板头部 */
.floating-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    min-height: 48px;
}

/* 收起状态：仅保留顶部条，居中显示箭头按钮，并明显留出左右边距 */
.study-mode-control-panel.collapsed .floating-panel-header {
    justify-content: center;
    padding: 10px 0;
}

/* 收起状态下缩小箭头按钮宽度，让左右空隙更明显 */
.study-mode-control-panel.collapsed .floating-panel-toggle {
    padding: 4px;
}

.floating-panel-title {
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.floating-panel-toggle {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    /* 与左侧收起按钮统一：圆形 28x28，内容居中 */
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-panel-toggle:hover {
    background: rgba(255,255,255,0.3);
}

/* 面板内容区 */
.floating-panel-content {
    flex: 1;
    overflow-y: auto;
    /* 适度压缩内边距与分区间距，让控制面板内容尽量一屏显示 */
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 分区样式 */
.floating-section {
    display: flex;
    flex-direction: column;
    /* 统一收紧分区内部的垂直间距 */
    gap: 6px;
}

.floating-section-title {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* 播放模式选择 */
.play-mode-options {
    display: flex;
    gap: 6px;
}

.play-mode-btn {
    flex: 1;
    padding: 8px 4px;
    border: 1px solid #e1e5eb;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.7rem;
    color: #666;
    transition: all 0.2s ease;
    text-align: center;
    line-height: 1.1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.play-mode-btn .pm-label {
    line-height: 1.1;
}

/* Unified SVG icons (line style, consistent across playback controls) */
.ui-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.ui-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ui-icon svg.ui-fill {
    fill: currentColor;
    stroke: none;
}

.playback-controls-section .play-btn .ui-icon svg {
    width: 20px;
    height: 20px;
}

.floating-panel-toggle.ui-icon svg {
    width: 16px;
    height: 16px;
}

.play-mode-btn:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.play-mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

/* 单句循环次数选择弹框（点击“单句”弹出，限时消失） */
.sentence-loop-count-popover {
    position: fixed;
    z-index: 10000;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 10px 8px;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.14);
    min-width: 160px;
}

.sentence-loop-count-popover .slcp-title {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.2px;
}

.sentence-loop-count-popover .slcp-options {
    display: flex;
    gap: 8px;
}

.sentence-loop-count-popover .slcp-option {
    flex: 1;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 8px;
    padding: 8px 6px;
    cursor: pointer;
    font-size: 0.78rem;
    color: #334155;
    transition: all 0.15s ease;
}

.sentence-loop-count-popover .slcp-option:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.sentence-loop-count-popover .slcp-hint {
    margin-top: 8px;
    font-size: 0.72rem;
    color: #94a3b8;
    line-height: 1.25;
}

/* 播放进度 */
.progress-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #666;
}

.progress-bar-container {
    flex: 1;
    height: 6px;
    background: #e1e5eb;
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    transition: width 0.1s linear;
}

/* 播放控制区 */
/* 播放控制区域（两行布局：上一句-播放-下一句 / 自动跟随-重新播放） */
.playback-controls-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* 统一压缩这一块的垂直高度，并取消与进度条之间的分割线 */
    gap: 2px;
    padding: 4px 0 2px 0;
}

.playback-row {
    display: flex;
    justify-content: center;
    /* 稍微缩小按钮之间的水平间距 */
    gap: 6px;
}

.playback-row.primary-row .control-btn {
    width: 36px;
    height: 36px;
}

.playback-row.secondary-row .control-btn {
    width: 28px;
    height: 28px;
    font-size: 0.78rem;
}

.playback-controls-section .play-btn {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    box-shadow: 0 6px 14px rgba(99, 102, 241, 0.45);
}

.playback-controls-section .play-btn:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 8px 18px rgba(99, 102, 241, 0.55);
}

/* 速度选项 - 默认按钮样式（测试模式等仍使用） */
.speed-options {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.speed-option {
    padding: 6px 10px;
    border: 1px solid #e1e5eb;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.speed-option:hover {
    border-color: #667eea;
}

.speed-option.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 听力精听模式 - 连续速度轴样式（0.5 - 1.5） */
#studyModeControlPanel .speed-options {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 4px 4px;
    margin-top: 2px;
    height: 52px; /* 轴线 + 标记 + 文本 */
}

#studyModeControlPanel .speed-options::before {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    top: 20px;
    height: 3px;
    background: linear-gradient(90deg, #e5e7eb 0%, #cbd5e1 100%);
    border-radius: 999px;
}

#studyModeControlPanel .speed-option {
    position: relative;
    padding: 0;
    border: none;
    background: none;
    border-radius: 0;
    font-size: 0.75rem;
    color: #6b7280;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

#studyModeControlPanel .speed-option::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 999px;
    border: 2px solid #cbd5e1;
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.3);
    transition: all 0.2s ease;
}

#studyModeControlPanel .speed-option.active {
    color: #111827;
    font-weight: 600;
}

#studyModeControlPanel .speed-option.active::before {
    background: #6366f1;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.25);
}

/* 句子导航显示 */
.sentence-nav-display {
    text-align: center;
    font-size: 0.9rem;
    color: #667eea;
    font-weight: 600;
    padding: 8px;
    background: #f0f4ff;
    border-radius: 6px;
}

/* 精听文字区样式 */
.listening-text-area {
    flex: 1;
    background: white;
    border-radius: 12px;
    /* 【统一压缩】精听文本区卡片内边距：右侧0让滚动条紧贴边缘，左侧6px保持内容间距 */
    padding: 16px 0 16px 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.listening-text-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e1e5eb;
    margin-bottom: 12px;
}

/* 文本显示切换按钮 */
.text-display-controls {
    margin-left: auto;
    display: flex;
    gap: 6px;
    /* 【统一压缩】右对齐元素右侧边距：保持6px与版面边缘的距离 */
    padding-right: 6px;
}

.display-toggle-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e1e5eb;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.display-toggle-btn:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.display-toggle-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 文本模式按钮组（浮动控制面板） */
.text-mode-options {
    display: flex;
    gap: 6px;
}

.text-mode-btn {
    flex: 1;
    padding: 8px 4px;
    border: 1px solid #e1e5eb;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.7rem;
    color: #666;
    transition: all 0.2s ease;
    text-align: center;
    line-height: 1.1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.text-mode-btn:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.text-mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

/* 文本显示模式 - 隐藏 */
.listening-text-area.hidden-mode .listening-text-content {
    opacity: 0;
    pointer-events: none;
}

.listening-text-area.hidden-mode::after {
    /* 盲听模式提示：点击眼睛图标恢复文本 */
    content: "盲听模式：点击眼睛图标显示文本";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(102,126,234,0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* ===== 听力精练：模糊遮罩（精听）
 * 仅改变文字呈现，不改变原有行距和容器尺寸
 * ===== */
.timeline-sentence.blurred {
    color: transparent !important;
    text-shadow: 0 0 8px rgba(148, 163, 184, 0.4) !important;
    user-select: none;
    cursor: default;
    position: relative;
}

.timeline-sentence.blurred.temp-visible {
    color: #64748b !important;
    text-shadow: none !important;
    background: rgba(241, 245, 249, 0.8) !important;
    border-radius: 4px;
}

/* 精听主内容区 */
.listening-study-main-area {
    display: flex;
    flex-direction: column;
    /* 【统一压缩】精听左侧各卡片之间的间距：从 16px 调整为 12px */
    gap: 12px;
    height: 100%;
    overflow: hidden;
}

.listening-study-main-area .listening-text-area {
    flex: 1;
    overflow: hidden;
}

.listening-study-questions-panel h3 {
    font-size: 0.9rem;
    color: #333;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e1e5eb;
    flex-shrink: 0;
}

.listening-study-questions {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 精听模式题目卡片样式 */
.study-question-item {
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e1e5eb;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.study-question-item:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.study-question-item .question-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    /* 保证 Aufgab​e + 题号在一行显示，避免换行 */
    white-space: nowrap;
}

.study-question-item .question-num {
    font-weight: bold;
    color: #667eea;
    font-size: 0.85rem;
}

/* 例题题号：统一蓝色 */
.question-num.beispiel-num {
    color: #667eea !important;
}

.study-question-item .question-text {
    font-size: 0.85rem;
    color: #333;
    line-height: 1.4;
}

.study-options-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.study-option-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e1e5eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.study-option-item:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.study-option-item.selected {
    background: #e8efff;
    border-color: #667eea;
}

.study-option-item .option-marker {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f4ff;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8rem;
    color: #667eea;
}

.study-option-item.selected .option-marker {
    background: #667eea;
    color: white;
}

.study-option-item .option-text {
    flex: 1;
    font-size: 0.85rem;
    color: #333;
}

/* ==================== 测试模式右侧悬浮控制面板 ==================== */

.test-mode-status-panel {
    position: fixed;
    right: 0;
    top: 60px;
    bottom: 0;
    width: 200px;
    background: white;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    z-index: 50;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    border-left: 1px solid #e1e5eb;
}

/* 收起状态 */
.test-mode-status-panel.collapsed {
    width: 40px;
}

.test-mode-status-panel.collapsed .floating-panel-content {
    display: none;
}

.test-mode-status-panel.collapsed .floating-panel-title {
    display: none;
}

/* 测试模式布局调整 - 听力测试新布局 */
.listening-test-wrapper {
    grid-template-columns: 1fr 200px !important;
    gap: 0 !important;
    padding-right: 0 !important;
    height: 100%;
    overflow: hidden !important;
}

/* 听力2模式：覆盖全局grid布局，使用独立容器 */
body.teil2-expanded .listening-test-wrapper {
    grid-template-columns: 1fr 0 !important;
    overflow: visible !important;
}

body.teil2-expanded .listening-test-wrapper .listening-display-area {
    display: none !important;
}

body.teil2-expanded .listening-test-wrapper .listening-answer-area {
    display: none !important;
}

/* 听力2模式：答题区填满整个内容区域 */
/* 规则已移至上方 3017 行 */

/* 听力测试时，显示区隐藏，答题区占据左侧全部空间 */
.listening-test-wrapper .listening-display-area {
    display: none !important;
}

/* 答题区 - 参考阅读测试的 questions-panel 设置 */
.listening-test-wrapper .listening-answer-area {
    grid-column: 1;
    grid-row: 1;
    height: 100%;
    border-radius: 0;
    background: white;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow-y: auto; /* 允许滚动 */
    -webkit-overflow-scrolling: touch;
}

/* 答题区题目内容 */
.listening-test-wrapper .listening-questions {
    padding: 0;
    flex: none; /* 取消 flex: 1，不独立滚动 */
    overflow: visible; /* 不独立滚动 */
}

/* 提交按钮作为内容的最后部分 */
.listening-test-wrapper .submit-btn-wrapper {
    padding: 12px 0;
    background: white;
}

/* 听力3测试模式：隐藏全局提交按钮包装器 */
.submit-btn-wrapper.teil3-active {
    display: none !important;
}

/* 确保在听力3时全局按钮不显示 */
body.teil3-active .submit-btn-wrapper,
.listening-test-wrapper.teil3-active .submit-btn-wrapper,
#listeningAnswerArea .submit-btn-wrapper.teil3-active {
    display: none !important;
}

/* 全宽提交按钮 */
.listening-test-wrapper .submit-btn {
    width: 100%;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ========== 判断题样式（Teil 4 Ja/Nein） ========== */
.question-item-judgment {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.question-item-judgment:last-child {
    border-bottom: none;
}

.question-item-judgment .question-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.question-item-judgment .question-num {
    font-weight: 600;
    color: #667eea;
    min-width: 24px;
}

.question-item-judgment .question-text {
    flex: 1;
    line-height: 1.4;
    font-size: 0.9rem; 
}

.options-list-judgment {
    display: flex;
    gap: 10px !important;
    padding: 0 !important;
    margin-left: 42px !important; /* 选项位置向右移动，与题目文本对齐 */
    background: transparent !important;
    box-shadow: none !important;
}

.judgment-option {
    flex: none !important;
    display: inline-flex;
    align-items: center;
    padding: 4px 20px !important;
    background: #f5f5f5;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    min-width: 60px; /* 缩小宽度 */
    justify-content: center; /* 文字居中 */
}

.judgment-option:hover {
    background: #e8e8e8;
}

/* 判断题选项选中效果 - 与普通选项视觉效果统一 */
.judgment-option.selected {
    background: #e8efff !important;
    color: #333 !important;
    border-color: #667eea !important;
    position: relative;
}

.judgment-option.selected::after {
    content: "✕";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #667eea !important;
    font-weight: bold;
    font-size: 35px !important;
    z-index: 10;
    pointer-events: none;
}

/* 判断题选项正确/错误状态 - 与普通选项统一颜色 */
.judgment-option.correct {
    background: #dcfce7 !important;
    color: #333 !important;
    border-color: #22c55e !important;
    position: relative;
}

.judgment-option.correct::after {
    content: "✕";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #22c55e;
    font-weight: bold;
    font-size: 35px !important;
    z-index: 10;
    pointer-events: none;
}

.judgment-option.incorrect {
    background: #fee2e2 !important;
    color: #333 !important;
    border-color: #ef4444 !important;
    position: relative;
}

.judgment-option.incorrect::after {
    content: "✕";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ef4444;
    font-weight: bold;
    font-size: 35px !important;
    z-index: 10;
    pointer-events: none;
}

.judgment-text {
    font-size: 0.85rem !important; /* 适配字号缩小 */
    font-weight: 500;
    text-transform: capitalize; /* 首字母大写：Ja Nein */
}

/* 题目导航显示 */
.question-nav-display {
    /* 题目导航改为上下纵向排列（从上到下） */
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 6px 4px;
    background: #f0f4ff;
    border-radius: 6px;
    max-height: 220px;
    overflow-y: auto;
}

.question-nav-item {
    /* 占满一行，数字居中，支持两位及以上题号 */
    width: 100%;
    min-height: 26px;
    padding: 4px 6px;
    border-radius: 9999px;
    border: none;
    background: #e5e7eb;
    color: #374151;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s ease;
}

.question-nav-label {
    flex: 1;
    text-align: left;
}

.question-nav-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    margin-left: 6px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.question-nav-status-dot.answered {
    background-color: #22c55e;
}

.question-nav-status-dot.unanswered {
    background-color: #facc15;
}

.question-nav-status-dot.correct {
    background-color: #22c55e;
}

.question-nav-status-dot.incorrect {
    background-color: #ef4444;
}

/* ========================================
   听力 Teil 2：独立布局（利用更宽的右侧版面）
   ======================================== */

/* 独立包装器：覆盖全局容器，脱离grid布局 */
.teil2-standalone-wrapper {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 20px;
    z-index: 50;
    background: transparent;
    overflow: visible;
}

/* 隐藏全局容器中可能被干扰的元素 */
.teil2-standalone-wrapper ~ .listening-answer-area,
.teil2-standalone-wrapper ~ .listening-display-area {
    display: none !important;
}

/* 主布局：左40%，右60%（利用更宽的右侧） */
.teil2-main-layout {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    gap: 10px;
}

/* 左栏40%：上表格、中空白、下提交按钮 */
.teil2-left-panel {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    padding: 10px 20px;
    box-sizing: border-box;
    overflow: visible;
    align-items: center; /* 内容居中 */
}

/* 题目表格 */
.teil2-left-panel .teil2-table-section {
    flex: 0 0 auto;
    width: 100%;
    display: flex;
    justify-content: flex-end; /* 表格靠右 */
    box-sizing: border-box;
}

.teil2-left-panel .teil2-table {
    width: 100%;
    min-width: 300px;
    border-collapse: collapse;
    font-size: 0.95rem;
    margin-left: 40px; /* 表格左侧与版面左侧的间距 */
}

/* 表格右侧与图片左侧的间距 - 已取消参考关系 */
.teil2-left-panel .teil2-table-section {
    flex: 0 0 auto;
    width: 100%;
    display: flex;
    justify-content: flex-end;
    box-sizing: border-box;
}

/* 题号6-10列（第3-7列）固定宽度75px */
.teil2-left-panel .teil2-table th:nth-child(n+3):nth-child(-n+7),
.teil2-left-panel .teil2-table td:nth-child(n+3):nth-child(-n+7) {
    width: 75px;
    min-width: 75px;
    max-width: 75px;
    box-sizing: border-box;
}

.teil2-left-panel .teil2-table th,
.teil2-left-panel .teil2-table td {
    border: 1px solid #e0e0e0;
    padding: 8px 10px;
    text-align: center;
}

.teil2-left-panel .teil2-table .label-col {
    width: 50px;
    background: #f5f5f5;
    font-weight: 600;
}

.teil2-left-panel .teil2-table .label-cell {
    width: 50px;
    background: #f5f5f5;
    font-weight: 600;
}

.teil2-left-panel .teil2-table .answer-cell {
    min-width: 35px;
    cursor: pointer;
}

.teil2-left-panel .teil2-table .answer-cell:hover {
    background: #f0f7ff;
}

.teil2-left-panel .teil2-table .answer-letter {
    font-weight: 700;
    font-size: 1.1em;
    color: #2563eb;
}

/* 中间空白区域（用于弹出选项框） */
.teil2-left-panel .teil2-popup-area {
    flex: 1 1 auto;
    min-height: 20px;
}

/* 提交按钮 */
.teil2-left-panel .teil2-submit-section {
    flex: 0 0 auto;
    padding: 10px 0;
    width: 100%;
    display: flex;
    justify-content: center; /* 按钮居中 */
}

.teil2-left-panel .teil2-submit-btn {
    padding: 10px 30px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
}

.teil2-left-panel .teil2-submit-btn:hover {
    background: #1d4ed8;
}

/* 右栏60%：图片居中 */
.teil2-image-panel {
    flex: 1 1 60%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 10px 10px 0; /* 右侧10px间距，左侧为0取消与表格的参考关系 */
    box-sizing: border-box;
}

.teil2-image-panel .teil2-grid-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.teil2-content {
    display: flex;
    flex-direction: row;
    gap: 0;
    width: 100%;
    height: calc(100vh - 120px);
    min-height: 400px;
}

/* 左栏 */
.teil2-left-column {
    flex: 0 0 45%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 350px;
}

.teil2-table-section {
    flex: 0 0 auto;
}

.teil2-spacer {
    flex: 1 1 30%;
    min-height: 20px;
}

.teil2-submit-section {
    flex: 0 0 auto;
    padding: 10px 0;
}

.teil2-submit-btn {
    padding: 12px 40px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: #667eea;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.teil2-submit-btn:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* ============ 听力3样式（图片选择题） ============ */
.teil3-questions-wrapper {
    padding: 8px 10px;
}

.teil3-question-item {
    margin-bottom: 6px;
    padding: 8px 10px;
    background: #f9f9f9;
    border-radius: 8px;
    border-bottom: 1px solid #eee;
}

.teil3-question-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.teil3-question-header {
    margin-bottom: 5px;
}

.teil3-question-num {
    font-size: 0.85rem;
    font-weight: 600;
    color: #667eea;
}

.teil3-question-text {
    font-size: 0.95rem;
    color: #333;
    margin-left: 10px;
    font-weight: 500;
}

.teil3-options-container {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.teil3-image-option {
    flex: 0 0 30%;
    max-width: 180px;
    cursor: pointer;
    border: 3px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
    padding: 2px;
}

.teil3-image-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.teil3-image-option.selected {
    border-color: #667eea;
    background: transparent;
    position: relative;
}

.teil3-image-option.selected::after {
    content: "✕";
    position: absolute;
    top: 3px;
    left: 3px;
    color: #2196f3;
    font-weight: bold;
    font-size: 18px;
    z-index: 10;
    pointer-events: none;
}

.teil3-image-option.correct {
    border-color: #22c55e !important;
    background: transparent;
    position: relative;
}

.teil3-image-option.correct::after {
    content: "✕";
    position: absolute;
    top: 3px;
    left: 3px;
    color: #22c55e;
    font-weight: bold;
    font-size: 18px;
    z-index: 10;
    pointer-events: none;
}

.teil3-image-option.incorrect {
    border-color: #ef4444 !important;
    background: transparent;
    position: relative;
}

.teil3-image-option.incorrect::after {
    content: "✕";
    position: absolute;
    top: 3px;
    left: 3px;
    color: #ef4444;
    font-weight: bold;
    font-size: 18px;
    z-index: 10;
    pointer-events: none;
}

.teil3-image-option.correct-answer {
    border-color: #22c55e;
}

.teil3-option-image-wrapper {
    width: 100%;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.teil3-option-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.teil3-option-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.9rem;
    background: #f5f5f5;
}

.teil3-option-letter {
    padding: 8px;
    text-align: center;
    font-weight: 600;
    color: #333;
    background: #fff;
    border-top: 1px solid #e0e0e0;
}

.teil3-submit-section {
    margin-top: 20px;
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.teil3-submit-btn {
    width: 100%;
    max-width: 300px;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.teil3-result-stats {
    margin-top: 30px;
    padding: 20px;
    background: #f0f4ff;
    border-radius: 8px;
    text-align: center;
}

.teil3-score {
    font-size: 1.2rem;
}

.teil3-score-label {
    font-weight: 600;
    color: #333;
}

.teil3-score-value {
    font-weight: 700;
    color: #667eea;
    font-size: 1.5rem;
}

.teil3-percentage {
    color: #666;
    margin-left: 10px;
}

/* 听力3精练/专注模式样式 */
.teil3-study-wrapper {
    padding: 15px;
}

.teil3-study-question-item {
    margin-bottom: 15px;
    padding: 10px 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border-bottom: 1px solid #eee;
}

.teil3-study-question-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* 精听模式：选项图片一行显示，自动缩放 */
.teil3-options-container {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 10px;
}
    width: 100%;
}

.teil3-study-option {
    flex: 1 1 0;
    min-width: 0;
    border: 3px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.teil3-study-option .teil3-option-image-wrapper {
    width: 100%;
    height: auto;
}

.teil3-study-option .teil3-option-image {
    width: 100%;
    height: auto;
    display: block;
}

.teil3-study-option.correct {
    border-color: #4caf50;
    background: #e8f5e9;
}

/* 右栏：上层图片 */
.teil2-right-column {
    flex: 1 1 55%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 300px;
    padding-right: 0;
}

/* 图片独立容器 */
.teil2-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 300px;
}

.teil2-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.teil2-table th,
.teil2-table td {
    border: 1px solid #ddd;
    padding: 10px 12px;
    text-align: center;
}

.teil2-table th {
    background: #667eea;
    color: white;
    font-weight: 600;
}

.teil2-table .person-name {
    text-align: left;
    font-weight: 500;
    font-size: 12px;
    background: #f5f5f5;
}

.teil2-table .answer-cell {
    width: 60px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.teil2-table .answer-cell:hover:not(.beispiel-cell) {
    background-color: #e8f0fe;
}

.teil2-table .answer-cell .answer-cell-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    position: relative;
}

.teil2-table .answer-cell .answer-letter {
    font-weight: 600;
    font-size: 1.1rem;
    color: #667eea;
}

.teil2-table .answer-cell .answer-placeholder {
    color: #ccc;
    font-size: 1.2rem;
}

/* 正确答案单元格样式 */
.teil2-table .answer-cell.correct {
    background-color: #d4edda !important;
    border-color: #28a745 !important;
}

.teil2-table .answer-cell.correct .answer-letter {
    color: #155724;
}

.teil2-table .answer-cell.correct .answer-placeholder {
    color: #155724;
}

/* 错误答案单元格样式 */
.teil2-table .answer-cell.incorrect {
    background-color: #f8d7da !important;
    border-color: #dc3545 !important;
}

.teil2-table .answer-cell.incorrect .answer-letter {
    color: #721c24;
}

/* 错误答案单元格显示正确答案提示 */
.teil2-table .answer-cell.incorrect .answer-cell-content::after {
    content: '(' attr(data-correct-answer) ')';
    position: absolute;
    bottom: -2px;
    right: 2px;
    font-size: 0.65rem;
    color: #155724;
    font-weight: bold;
    background: rgba(212, 237, 218, 0.9);
    padding: 1px 3px;
    border-radius: 2px;
}

.teil2-table .answer-input {
    width: 36px;
    height: 32px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    text-transform: lowercase;
    border: 2px solid #ccc;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.teil2-table .answer-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.teil2-table .beispiel-answer {
    display: inline-block;
    padding: 4px 12px;
    background: #e8e8e8;
    border-radius: 4px;
    font-weight: 600;
    color: #333;
}

/* 9宫格选择器样式 - 改为相对于左栏定位 */
.teil2-left-column {
    position: relative;
}

.grid-selector-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: transparent;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.grid-selector-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    min-width: 200px;
}

.grid-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #667eea;
    color: white;
    font-weight: 600;
}

.grid-selector-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.grid-selector-close:hover {
    opacity: 0.8;
}

.grid-selector-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 15px;
}

.grid-option {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    background: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.grid-option:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: scale(1.05);
}

/* 表格新结构样式 */
.teil2-table .label-col {
    width: 80px;
    background: #f5f5f5;
}

.teil2-table .label-cell {
    text-align: left;
    font-weight: 500;
    font-size: 12px;
    background: #f5f5f5;
    padding-left: 12px;
}

.teil2-table .header-row th:not(:first-child) {
    min-width: 50px;
    font-size: 12px;
}

.teil2-table .person-row td {
    font-weight: 500;
    font-size: 12px;
}

.teil2-grid-image {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 响应式：小屏幕上下布局 */
@media (max-width: 1100px) {
    .teil2-content {
        flex-direction: column;
        height: auto;
        min-height: auto;
    }

    .teil2-left-column {
        flex: 0 0 auto;
        width: 100%;
        min-width: auto;
    }

    .teil2-right-column {
        flex: 0 0 auto;
        width: 100%;
    }

    .teil2-grid-image {
        max-height: calc(100vh - 300px);
    }

    .teil2-spacer {
        display: none;
    }
}

.question-nav-item:hover {
    background: #6366f1;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.35);
}

.question-nav-item.active {
    background: #4f46e5;
    color: #ffffff;
    box-shadow:
        0 0 0 1px rgba(79, 70, 229, 0.3),
        0 4px 10px rgba(79, 70, 229, 0.55);
}

.question-item.nav-focused {
    background: #eef2ff;
    box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.25);
}


/* Focus Mode - 增大显示空间 */
#app.focus-mode {
    /* 保留一个窄列用于左侧竖向标记工具栏（约等于折叠状态的 40px），其余全部给主内容 */
    grid-template-columns: 40px 1fr;
    grid-template-rows: 0 1fr; /* 隐藏顶部导航栏 */
}

/* 【专注模式优化】阅读模式：左侧栏收起，隐藏展开按钮，但保留标记工具 */
#app.focus-mode .sidebar {
    /* 保持与普通折叠状态相近的宽度，仅作为工具栏容器 */
    width: 40px !important;
    min-width: 40px !important;
}
/* 隐藏侧边栏的展开按钮（不可点开） */
#app.focus-mode .sidebar #sidebarToggle,
#app.focus-mode .sidebar #expandToggleBtn {
    display: none !important;
}
/* 隐藏侧边栏展开时的内容（文章列表等） */
#app.focus-mode .sidebar .sidebar-expanded-header,
#app.focus-mode .sidebar .sidebar-content {
    display: none !important;
}
/* 确保标记工具（collapsed-tools）在专注模式下可见且可用 */
#app.focus-mode .sidebar .collapsed-tools {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* 椤堕儴瀵艰埅锛氫繚鐣欎笓娉ㄦ寜閽紝寮卞寲鍏跺畠瀵艰埅 */
#app.focus-mode .navigation-area {
    display: none !important;
}
#app.focus-mode #submitHeaderBtn,
#app.focus-mode #whiteboardHeaderBtn,
#app.focus-mode #exportHeaderBtn {
    display: none !important;
}

/* 专注模式：与普通模式保持同样的浅色背景，减少强对比边缘感 */
#app.focus-mode .main-content {
    background: #f5f7fa;
}

#app.focus-mode .mode-panel.active {
    padding: 12px 16px !important; /* 统一版容器内边距：与测试/精练模式完全一致的 12px 16px */
}

#app.focus-mode .content-wrapper {
    gap: 12px !important; /* 统一左右版面间距：与测试/精练模式一致的 12px */
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* 专注模式下阅读2/4：左题目区，右文章区 */
#app.focus-mode .content-wrapper.reading-info-match,
#app.focus-mode .content-wrapper.reading-ad-match {
    grid-template-columns: 0.9fr 1.1fr;
}

#app.focus-mode .content-wrapper.reading-info-match .article-content,
#app.focus-mode .content-wrapper.reading-ad-match .article-content {
    order: 2;
}

#app.focus-mode .content-wrapper.reading-info-match .questions-panel,
#app.focus-mode .content-wrapper.reading-ad-match .questions-panel {
    order: 1;
}

/* 【专注模式优化】阅读精练：隐藏白板和词族提示，但保留阅读题目面板 */
#app.focus-mode #studyModePanel .vocab-panel {
    display: flex !important;        /* 【修复】使用 flex 布局，确保子元素正确显示 */
    flex-direction: column !important;
    height: 100% !important;         /* 【修复】确保有明确的高度 */
    /* 【阅读精练-专注】去掉右侧整块外框，只保留内部“小题卡片” */
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
}
#app.focus-mode #studyModePanel .vocab-panel .whiteboard {
    display: none !important; /* 隐藏白板 */
}
#app.focus-mode #studyModePanel .vocab-panel .questions-panel {
    display: flex !important; /* 【修复】使用 flex 以匹配 CSS 样式，确保滚动条正常工作 */
    flex-direction: column !important;
    height: 100% !important; /* 【修复】确保有明确的高度 */
}
#app.focus-mode #studyModePanel .vocab-panel #studyQuestionsContent {
    overflow-y: auto !important; /* 【修复】确保专注模式下滚动条可见 */
    height: 100% !important;
    max-height: 100% !important;
}
#app.focus-mode #studyModePanel .content-wrapper {
    grid-template-columns: 1.1fr 0.9fr !important; /* 保持左右版面布局 */
}

/* 专注模式下阅读2/4：使用测试模式的比例 - 题目区窄(0.9fr)，文章区宽(1.1fr) */
#app.focus-mode #studyModePanel .content-wrapper.reading-info-match,
#app.focus-mode #studyModePanel .content-wrapper.reading-ad-match {
    grid-template-columns: 0.9fr 1.1fr !important;
}

/* 专注模式下阅读2/4：题目区在左，文章区在右 */
#app.focus-mode #studyModePanel .content-wrapper.reading-info-match .article-content,
#app.focus-mode #studyModePanel .content-wrapper.reading-ad-match .article-content {
    order: 2;
}

#app.focus-mode #studyModePanel .content-wrapper.reading-info-match .questions-panel,
#app.focus-mode #studyModePanel .content-wrapper.reading-ad-match .questions-panel {
    order: 1;
}

/* 专注模式下阅读2/4题目排版：与测试模式一致 */
#app.focus-mode .info-match-question {
    display: grid !important;
    grid-template-columns: 35px 1fr 180px !important;
    grid-template-rows: auto !important;
    grid-column: 1 / -1 !important;
    gap: 4px 3px !important;
    padding: 4px 6px !important;
    margin-bottom: 2px !important;
    background: #fff !important;
    border-radius: 4px !important;
    border: 1px solid #e0e0e0 !important;
    align-items: start !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

#app.focus-mode .info-match-question .question-num {
    grid-area: auto !important;
    grid-row: 1 !important;
    grid-column: 1 !important;
    font-weight: bold !important;
    color: #333 !important;
    font-size: 13px !important;
    padding-top: 3px !important;
    padding-left: 4px !important;
    padding-right: 2px !important;
    text-align: left !important;
    align-self: start !important;
    min-width: 35px !important;
    width: 35px !important;
    flex-shrink: 0 !important;
}

#app.focus-mode .info-match-question .question-text {
    grid-area: auto !important;
    grid-row: 1 !important;
    grid-column: 2 !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    color: #333 !important;
    white-space: pre-line !important;
    flex: 1 !important;
}

#app.focus-mode .info-match-question .options-list {
    grid-area: auto !important;
    grid-row: 1 !important;
    grid-column: 3 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    width: 180px !important;
}

/* 确保专注模式下info-match-question内部的question-header不影响grid布局 */
#app.focus-mode .info-match-question .question-header {
    display: contents !important;
}

/* 精练模式下阅读2/4题目排版：与测试模式一致（非专注模式） */
#studyModePanel .info-match-question{
    display: grid !important;
    grid-template-columns: 32px 1fr 180px !important;
    grid-template-rows: auto !important;
    grid-column: 1 / -1 !important;
    gap: 4px 6px !important;
    padding: 4px 6px !important;
    margin-bottom: 2px !important;
    background: #fff !important;
    border-radius: 4px !important;
    border: 1px solid #e0e0e0 !important;
    align-items: start !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

#studyModePanel .info-match-question .question-num {
    grid-area: auto !important;
    grid-row: 1 !important;
    grid-column: 1 !important;
    font-weight: bold !important;
    color: #333 !important;
    font-size: 13px !important;
    padding-top: 3px !important;
    padding-left: 4px !important;
    padding-right: 2px !important;
    text-align: left !important;
    align-self: start !important;
    min-width: 32px !important;
    width: 32px !important;
    flex-shrink: 0 !important;
}

#studyModePanel .info-match-question .question-text {
    grid-area: auto !important;
    grid-row: 1 !important;
    grid-column: 2 !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    color: #333 !important;
    white-space: pre-line !important;
    flex: 1 !important;
}

#studyModePanel .info-match-question .options-list {
    grid-area: auto !important;
    grid-row: 1 !important;
    grid-column: 3 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    width: 200px !important;
}

/* 确保info-match-question内部的question-header不影响grid布局 */
#studyModePanel .info-match-question .question-header {
    display: contents !important;
}

/* 精练模式下广告匹配题目排版 */
#studyModePanel .ad-match-question {
    display: grid !important;
    grid-template-columns: 45px 1fr 60px !important;
    grid-template-rows: auto !important;
    grid-column: 1 / -1 !important;
    gap: 6px 10px !important;
    padding: 8px 10px !important;
    margin-bottom: 8px !important;
    background: #fff !important;
    border-radius: 6px !important;
    border: 1px solid #e0e0e0 !important;
    align-items: start !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

#studyModePanel .ad-match-question .question-num {
    grid-area: auto !important;
    grid-row: 1 !important;
    grid-column: 1 !important;
    font-weight: bold !important;
    color: #333 !important;
    font-size: 15px !important;
    padding-top: 2px !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
    text-align: left !important;
    align-self: start !important;
    min-width: 45px !important;
    width: 45px !important;
    flex-shrink: 0 !important;
}

#studyModePanel .ad-match-question .question-text {
    grid-area: auto !important;
    grid-row: 1 !important;
    grid-column: 2 !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    color: #333 !important;
    white-space: pre-line !important;
    flex: 1 !important;
}

#studyModePanel .ad-match-question .answer-selector-wrapper {
    grid-area: auto !important;
    grid-row: 1 !important;
    grid-column: 3 !important;
    display: flex !important;
    flex-direction: column;
    align-items: center !important;
    justify-content: flex-start;
    gap: 4px !important;
    flex-shrink: 0 !important;
    min-width: 50px !important;
}

#studyModePanel .ad-match-question .answer-display {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 40px !important;
    height: 28px !important;
    padding: 0 8px !important;
    font-size: 15px !important;
    font-weight: bold !important;
    color: #333 !important;
    background: #f5f5f5 !important;
    border: 2px solid #4caf50 !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 1 !important;
}

#studyModePanel .ad-match-question .answer-display:hover {
    background: #e8f5e9 !important;
    border-color: #2e7d32 !important;
    z-index: 2 !important;
}

#studyModePanel .ad-match-question .answer-display.has-value {
    background: #4caf50 !important;
    color: white !important;
    border-color: #2e7d32 !important;
}

/* 确保精练模式下ad-match-question内部的question-header不影响grid布局 */
#studyModePanel .ad-match-question .question-header {
    display: contents !important;
}

#app.focus-mode .info-match-question .question-num {
    grid-row: 1 !important;
    font-weight: bold !important;
    color: #333 !important;
    font-size: 13px !important;
    padding-top: 3px !important;
    padding-left: 0 !important;
}

#app.focus-mode .info-match-question .question-text {
    font-size: 12px !important;
    line-height: 1.3 !important;
    color: #333 !important;
    white-space: pre-line !important;
    grid-column: 2 !important;
}

#app.focus-mode .info-match-question .options-list {
    grid-column: 3 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

#app.focus-mode .ad-match-question {
    display: grid !important;
    grid-template-columns: 45px 1fr 60px !important;
    grid-template-rows: auto !important;
    grid-column: 1 / -1 !important;
    gap: 6px 5px !important;
    padding: 8px 10px !important;
    margin-bottom: 8px !important;
    background: #fff !important;
    border-radius: 6px !important;
    border: 1px solid #e0e0e0 !important;
    align-items: start !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

#app.focus-mode .ad-match-question .question-num {
    grid-area: auto !important;
    grid-row: 1 !important;
    grid-column: 1 !important;
    font-weight: bold !important;
    color: #333 !important;
    font-size: 15px !important;
    padding-top: 2px !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
    text-align: left !important;
    align-self: start !important;
    min-width: 45px !important;
    width: 45px !important;
    flex-shrink: 0 !important;
}

#app.focus-mode .ad-match-question .question-text {
    grid-area: auto !important;
    grid-row: 1 !important;
    grid-column: 2 !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    color: #333 !important;
    white-space: pre-line !important;
    flex: 1 !important;
}

#app.focus-mode .ad-match-question .answer-selector-wrapper {
    grid-column: 3 !important;
    display: flex !important;
    flex-direction: column;
    align-items: center !important;
    justify-content: flex-start;
    gap: 4px !important;
    flex-shrink: 0 !important;
    min-width: 50px !important;
}

#app.focus-mode .ad-match-question .answer-display {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 40px !important;
    height: 28px !important;
    padding: 0 8px !important;
    font-size: 15px !important;
    font-weight: bold !important;
    color: #333 !important;
    background: #f5f5f5 !important;
    border: 2px solid #4caf50 !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 1 !important;
}

#app.focus-mode .ad-match-question .answer-display:hover {
    background: #e8f5e9 !important;
    border-color: #2e7d32 !important;
    z-index: 2 !important;
}

#app.focus-mode .ad-match-question .answer-display.has-value {
    background: #4caf50 !important;
    color: white !important;
    border-color: #2e7d32 !important;
}

/* 确保专注模式下ad-match-question内部的question-header不影响grid布局 */
#app.focus-mode .ad-match-question .question-header {
    display: contents !important;
}
/* （说明）
 * 这里不再依赖兄弟选择器（#studyModePanel ~ .sidebar），
 * 而是通过上面的 #app.focus-mode .sidebar .collapsed-tools 规则统一控制，
 * 以避免 DOM 结构变动时导致专注模式下工具栏丢失。
 */

/* 鍚姏绮剧粌锛氶殣钘忓彸渚ф偓娴帶鍒堕潰鏉匡紝浠呬繚鐣欎富鍐呭鍖?*/
/* 【专注模式优化】听力模式：右侧栏收起，隐藏展开按钮，但保留简洁播放控制按钮 */
#app.focus-mode #studyModeControlPanel {
    /* 保持收起状态，不隐藏整个面板 */
    display: block !important;
    /* 顶部紧贴视口（专注模式已隐藏 header） */
    top: 0 !important;
}
/* 隐藏右侧栏的展开按钮和标题栏（不可点开） */
#app.focus-mode #studyModeControlPanel .floating-panel-header {
    display: none !important;
}
/* 隐藏展开状态下的完整控制面板内容 */
#app.focus-mode #studyModeControlPanel .floating-panel-content {
    display: none !important;
}
/* 确保收起状态下的迷你控制按钮在专注模式下可见且可用 */
#app.focus-mode #studyModeControlPanel .floating-mini-controls {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    /* 与常规收起状态一致的紧凑内边距，让内容整体上移，与顶部退出 X 形成连续竖条 */
    padding: 8px 6px 12px 6px !important;
}
/* 确保听力面板处于收起状态，宽度与非专注模式一致 */
#app.focus-mode #studyModeControlPanel.collapsed {
    width: 40px !important; /* 修复：与非专注模式保持一致，避免重叠 */
}
/* 【专注模式优化】听力精练布局：为右侧迷你控制条预留空间，避免与答题区内容重叠 */
#app.focus-mode .listening-study-wrapper {
    /* 预留与迷你控制条等宽的右内边距，使主内容与迷你条“紧挨但不被覆盖” */
    padding-right: 40px !important;
}

/* 听力测试模式的悬浮面板仍然隐藏 */
#app.focus-mode #testModeStatusPanel {
    display: none !important;
}

/* 閫傚害鍑忓皯闈炴牳蹇冩寜閽?*/
#app.focus-mode .text-display-controls {
    opacity: 0.25;
    pointer-events: none;
}

/* 璁╀笓娉ㄦ寜閽洿鏄剧溂 */
#app.focus-mode .focus-header-btn {
    color: white;
    border-color: rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.14);
}
#app.focus-mode .focus-header-btn.active {
    background: white;
    color: #667eea;
}

/* ========== 专注模式优化：增大显示空间 ========== */
/* 隐藏整个顶部导航栏 */
#app.focus-mode .header {
    display: none !important;
}

/* 专注模式退出按钮：与右侧精听迷你控制条融合为一体 */
#focusModeExitBtn {
    position: fixed;
    top: 0;              /* 紧贴视口右上角 */
    right: 0;
    width: 40px;         /* 与收起状态下的控制条同宽 */
    height: 40px;
    background: #ffffff;
    border: none;
    border-left: 1px solid #e1e5eb;   /* 与控制条左侧边框对齐 */
    border-bottom: 1px solid #e1e5eb; /* 与下方控制按钮之间形成分割线 */
    border-radius: 0;                 /* 直角，作为整个纵向条的顶部单元 */
    color: #333;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    z-index: 1001;       /* 略高于控制条，确保清晰可点 */
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: none;    /* 不额外增加阴影，保持极简 */
    transition: background 0.15s ease, color 0.15s ease;
}

#focusModeExitBtn:hover {
    background: #f3f4f6;
    color: #111827;
}

#focusModeExitBtn:active {
    background: #e5e7eb;
}

/* 专注模式下显示退出按钮 */
#app.focus-mode #focusModeExitBtn {
    display: flex !important;
}

/* 隐藏阅读文章/听力文本区的标题栏 */
#app.focus-mode .listening-text-header,
#app.focus-mode .listening-display-header {
    display: none !important;
}

/* 隐藏题目区的标题栏 - 只在专注模式下隐藏所有标题 */
#app.focus-mode .questions-panel > h3,
#app.focus-mode .listening-study-questions-panel > h3,
#app.focus-mode #studyQuestionsContent h3 {
    display: none !important;
}

/* 阅读2/4：隐藏测试模式和精练模式的标题 */
.reading-info-match .questions-panel > h3,
.reading-ad-match .questions-panel > h3,
.reading-info-match #testQuestionsContent > h3,
.reading-ad-match #testQuestionsContent > h3,
.reading-info-match #studyQuestionsContent > h3,
.reading-ad-match #studyQuestionsContent > h3 {
    display: none !important;
}

/* 统一文章内容区内边距：与测试/精练模式一致的 12px 14px */
#app.focus-mode .article-content {
    padding: 12px 14px !important;
}

/* 统一题目面板内边距：与测试/精练模式一致的 12px 14px */
#app.focus-mode .questions-panel,
#app.focus-mode .listening-study-questions-panel {
    padding: 12px 14px !important;
}

/* 【修复双层容器问题】专注模式下，确保阅读精练模式的题目面板外层完全透明，无内边距 */
#app.focus-mode #studyQuestionsPanel {
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important; /* 去除外层内边距，避免双层框效果 */
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
}

/* 【阅读精练-专注】题目容器内容紧贴边缘：去内边距与圆角、阴影 */
#app.focus-mode #studyQuestionsContent {
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
}

/* 缩小听力显示区域的内边距到最小值 */
#app.focus-mode .listening-display-area,
#app.focus-mode .listening-text-area {
    padding: 8px !important; /* 进一步缩小内边距 */
}

/* 缩小听力答题区的内边距到最小值 */
#app.focus-mode .listening-answer-area {
    padding: 8px !important; /* 进一步缩小内边距 */
}

/* 移除标题栏的底部边距，进一步节省空间 */
#app.focus-mode .listening-text-content,
#app.focus-mode .listening-display-content {
    margin-top: 0 !important;
    padding: 8px !important; /* 进一步缩小精听文本内容的内边距，减少与滚动条的间距 */
}

/* 【大幅优化】缩小题目列表的间距和内边距 */
#app.focus-mode .question-item {
    margin-bottom: 4px !important; /* 从 8px 减少到 4px */
    padding: 4px 0 !important; /* 从 10px 减少到 4px，左右为 0 */
    border-bottom-width: 1px !important; /* 保持细边框 */
}

/* 【大幅优化】缩小题目头部的间距和元素间距 */
#app.focus-mode .question-header {
    margin-bottom: 3px !important; /* 从 6px 减少到 3px */
    gap: 10px !important; /* 从 18px 减少到 10px */
    line-height: 1.3 !important; /* 从 1.4 减少到 1.3 */
}

/* 【大幅优化】缩小选项列表的间距和内边距 */
#app.focus-mode .options-list li {
    margin-bottom: 3px !important; /* 从 6px 减少到 3px */
    padding: 0 !important; /* 从 6px 减少到 0，内边距由子元素控制 */
    border-width: 1px !important; /* 从 2px 减少到 1px */
    border-radius: 4px !important; /* 从 6px 减少到 4px */
}

/* 【大幅优化】缩小选项点击区域的内边距 */
#app.focus-mode .option-click-area {
    padding: 4px 8px !important; /* 从 8px 12px 减少到 4px 8px */
    gap: 6px !important; /* 从 8px 减少到 6px */
}

/* 【大幅优化】缩小选项文字区域的内边距 */
#app.focus-mode .option-text {
    padding: 4px 8px !important; /* 从 8px 12px 减少到 4px 8px */
    line-height: 1.3 !important; /* 优化行高 */
}

/* 【大幅优化】缩小复选框尺寸 */
#app.focus-mode .option-checkbox {
    width: 14px !important; /* 从 16px 减少到 14px */
    height: 14px !important; /* 从 16px 减少到 14px */
    border-width: 1.5px !important; /* 从 2px 减少到 1.5px */
}

/* 【大幅优化】缩小题号宽度，节省空间 */
#app.focus-mode .question-num {
    width: 40px !important; /* 从 50px 减少到 40px */
    font-size: 0.8rem !important; /* 从 0.85rem 减少到 0.8rem */
}

/* 专注模式下例题题号：灰黑色 */
#app.focus-mode .question-num.beispiel-num {
    color: #555 !important;
}

/* 【修复】专注模式下Beispiel卡片题号 */
#app.focus-mode .question-num[data-is-beispiel="true"] {
    font-size: 0.7rem !important;
}

/* 【大幅优化】缩小选项字母区域宽度 */
#app.focus-mode .option-letter {
    min-width: 16px !important; /* 从 20px 减少到 16px */
    font-size: 0.8rem !important; /* 从 0.85rem 减少到 0.8rem */
}

/* ===== 专注模式下：简化主版面容器外观（直角、去重阴影） ===== */

/* 阅读 / 听力 / 白板等主内容容器：去圆角和重阴影，突出内容本身 */
#app.focus-mode .article-content,
#app.focus-mode .questions-panel,
#app.focus-mode .listening-text-area,
#app.focus-mode .listening-display-area,
#app.focus-mode .listening-answer-area,
#app.focus-mode .listening-study-questions-panel,
#app.focus-mode .whiteboard-content {
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* 内层滚动内容区：轻微圆角和弱阴影，避免“黑色框线”感（阅读精练题目容器单独在下方处理） */
#app.focus-mode .listening-text-content,
#app.focus-mode .listening-study-questions,
#app.focus-mode .listening-display-content,
#app.focus-mode .listening-questions {
    border-radius: 4px !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
}

/* 【听力精练-专注】两侧主版面容器：直角 + 内容紧贴边缘，去掉多余层次感 */
#app.focus-mode #listeningStudyModePanel .listening-text-area,
#app.focus-mode #listeningStudyModePanel .listening-study-questions-panel {
    padding: 0 !important;          /* 容器与内部内容之间不再留白 */
    margin: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
}

/* 精听文本内容与题目内容：去内边距 / 圆角 / 阴影，形成“单层版面感” */
#app.focus-mode #listeningStudyModePanel .listening-text-content,
#app.focus-mode #listeningStudyModePanel .listening-study-questions {
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
}

/* 【阅读精练-专注】文章与题目采用与听力精练一致的"单层画布"风格 */
/* 精读文章区：容器直角、透明，无额外阴影和边框，正文直接铺在背景上 */
#app.focus-mode #studyModePanel #studyArticleContent {
    padding: 16px !important;        /* 增大内容和边的间距 */
    margin: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
}

/* 阅读精练题目容器内容：紧贴边缘，无圆角、无阴影 */
#app.focus-mode #studyModePanel #studyQuestionsPanel {
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
}

#app.focus-mode #studyModePanel #studyQuestionsContent {
    padding: 16px !important;        /* 增大内容和边的间距 */
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important; /* 去除容器底色，只保留内部小题卡片 */
}

/* ========================================
   阅读2：信息匹配配对布局样式
   ======================================== */

/* 信息匹配文章区（右侧信息公告板） */
.info-match-article,
#testArticleContent .info-board,
#studyArticleContent .info-board {
    padding: 14px;
    background: #fffbf0;
    border: 3px solid #8b7355;
    border-radius: 8px;
    height: 100%;
    overflow-y: auto;
    box-shadow: 4px 4px 12px rgba(0,0,0,0.15);
}

.info-match-article .template-instruction {
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.6;
    padding: 10px;
    background: #fff;
    border-left: 4px solid #8b7355;
}

.info-match-article .template-question {
    font-size: 16px;
    font-weight: bold;
    color: #222;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #f5f0e6;
    border-radius: 4px;
}

.info-match-article .template-hint {
    font-size: 12px;
    color: #666;
    margin-bottom: 20px;
    font-style: italic;
    padding: 8px;
    background: #fff;
    border-radius: 4px;
}

/* 信息公告板样式 - 模拟公告板 */
.info-board {
    background: #fffbf0;
    border: 2px solid #8b7355;
    height: 100%;
    padding: 12px;
}

.info-board h3 {
    display: none;
}

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

.location-item {
    background: #fff;
    border: 2px solid #d4c4a8;
    border-radius: 6px;
    padding: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.location-item:hover {
    transform: translateX(5px);
    box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
}

.location-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0e6d2;
}

.location-id {
    font-weight: bold;
    color: white;
    font-size: 14px;
    background: #8b7355;
    padding: 4px 10px;
    border-radius: 4px;
    min-width: 24px;
    text-align: center;
}

.location-name {
    font-weight: bold;
    color: #5d4a35;
    font-size: 15px;
    flex: 1;
}

.location-time {
    font-size: 12px;
    color: #666;
    background: #f5f0e6;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #d4c4a8;
}

.location-activities {
    list-style: none;
    padding: 0;
    margin: 0;
}

.location-activities li {
    padding: 6px 0;
    font-size: 13px;
    color: #444;
    position: relative;
    padding-left: 20px;
    line-height: 1.4;
}

.location-activities li::before {
    content: "▶";
    position: absolute;
    left: 0;
    color: #8b7355;
    font-size: 10px;
}

/* 信息匹配布局 - 左右分栏 */
/* 默认：左题目区，右文章区（调换顺序） */
.info-match-layout {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 20px;
    height: 100%;
}

.info-match-layout .questions-section {
    overflow-y: auto;
    padding-right: 10px;
}

.info-match-layout .info-board-section {
    overflow-y: auto;
}

/* 广告匹配布局 - 左右分栏 */
/* 默认：左题目区，右文章区（调换顺序） */
.ad-match-layout {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 20px;
    height: 100%;
}

.ad-match-layout .questions-section {
    overflow-y: auto;
    padding-right: 10px;
}

.ad-match-layout .ads-section {
    overflow-y: auto;
}

/* 信息匹配题目样式 - 题号+题目内容+选项紧凑布局 */
.info-match-question {
    display: grid !important;
    grid-template-columns: 32px 1fr 180px !important;
    grid-template-rows: auto !important;
    grid-column: 1 / -1 !important;
    gap: 4px 3px !important;
    padding: 4px 6px !important;
    margin-bottom: 2px !important;
    background: #fff !important;
    border-radius: 4px !important;
    border: 1px solid #e0e0e0 !important;
    align-items: start !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

.info-match-question .question-num {
    grid-area: auto;
    grid-row: 1 !important;
    grid-column: 1 !important;
    font-weight: bold !important;
    color: #667eea !important;
    font-size: 0.85rem !important;
    padding-top: 3px !important;
    padding-left: 4px !important;
    padding-right: 1px !important;
    text-align: left !important;
    align-self: start !important;
    min-width: 32px !important;
    width: 32px !important;
    flex-shrink: 0 !important;
}

.info-match-question .question-text {
    grid-area: auto;
    grid-row: 1 !important;
    grid-column: 2 !important;
    font-size: 12px;
    line-height: 1.3;
    color: #333;
    white-space: pre-line;
}

.info-match-question .options-list {
    grid-area: auto;
    grid-row: 1 !important;
    grid-column: 3 !important;
    display: flex;
    flex-direction: column;
    gap: 2px;
    list-style: none;
    padding: 0;
    margin: 0;
    width: 180px;
}

.info-match-question .options-list li {
    display: block;
    padding: 3px 6px;
    background: #f5f5f5;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    border: 1px solid #ccc;
    transition: all 0.2s;
    height: 22px;
    width: 180px;
    overflow: visible;
    position: relative;
}

.info-match-question .options-list li .option-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.info-match-question .options-list li:hover {
    background: #e0e0e0;
    border-color: #999;
}

.info-match-question .options-list li.selected {
    background: #e3f2fd;
    border-color: #2196f3;
}

.info-match-question .options-list li.selected::after {
    content: "✕";
    position: absolute;
    top: 50%;
    left: 3px;
    transform: translateY(-50%);
    color: #2196f3;
    font-weight: bold;
    font-size: 18px;
    width: 24px;
    height: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

.info-match-question .options-list li.correct {
    background: #e8f5e9;
    border-color: #4caf50;
}

.info-match-question .options-list li.correct::after {
    content: "✕";
    position: absolute;
    top: 50%;
    left: 3px;
    transform: translateY(-50%);
    color: #22c55e;
    font-weight: bold;
    font-size: 18px;
    width: 24px;
    height: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

.info-match-question .options-list li.incorrect {
    background: #ffebee;
    border-color: #f44336;
}

.info-match-question .options-list li.incorrect::after {
    content: "✕";
    position: absolute;
    top: 50%;
    left: 3px;
    transform: translateY(-50%);
    color: #ef4444;
    font-weight: bold;
    font-size: 18px;
    width: 24px;
    height: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

.info-match-question .option-letter {
    font-weight: bold;
    color: #333;
    margin-right: 0;
}

.info-match-question .option-text {
    color: #555;
    padding: 0;
    margin: 0;
}

/* 隐藏option-click-area和option-checkbox */
.info-match-question .option-click-area {
    display: none;
}

.info-match-question .option-checkbox {
    display: none;
}

/* ========================================
   阅读4：广告匹配配对布局样式
   ======================================== */

/* 广告匹配文章区（右侧广告栏） */
.ad-match-article,
#testArticleContent .ads-board,
#studyArticleContent .ads-board {
    padding: 20px;
    background: #f0f7f0;
    border: 3px solid #2e7d32;
    border-radius: 8px;
    height: 100%;
    overflow-y: auto;
    box-shadow: 4px 4px 12px rgba(0,0,0,0.15);
}

.ad-match-article .template-instruction {
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.6;
    padding: 10px;
    background: #fff;
    border-left: 4px solid #2e7d32;
}

.ad-match-article .template-question {
    font-size: 16px;
    font-weight: bold;
    color: #222;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #e8f5e9;
    border-radius: 4px;
}

.ad-match-article .template-hint {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    font-style: italic;
    padding: 8px;
    background: #fff;
    border-radius: 4px;
}

.ad-match-article .template-example-note {
    font-size: 12px;
    color: #e65100;
    background: #fff3e0;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 3px solid #e65100;
    font-weight: 500;
}

/* 广告栏样式 - 模拟小广告 */
.ads-board {
    background: #f0f7f0;
    border: 2px solid #2e7d32;
    height: 100%;
    padding: 15px;
}

.ads-board h3 {
    display: none;
}

.ads-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ad-item {
    background: #fff;
    border: 2px solid #a5d6a7;
    border-left: 5px solid #4caf50;
    border-radius: 6px;
    padding: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ad-item:hover {
    transform: translateX(5px);
    box-shadow: 2px 2px 10px rgba(0,0,0,0.15);
}

/* 已标记的广告（例题答案） */
.ad-item.marked {
    background: #e8f5e9;
    border-color: #2e7d32;
    border-left-color: #1b5e20;
}

.ad-item .ad-mark {
    margin-left: auto;
    font-size: 14px;
    font-weight: bold;
    color: #1b5e20;
    background: #a5d6a7;
    padding: 2px 6px;
    border-radius: 4px;
}

.ad-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 2px dashed #c8e6c9;
}

.ad-id {
    font-weight: bold;
    color: white;
    font-size: 12px;
    background: #4caf50;
    padding: 3px 8px;
    border-radius: 4px;
    min-width: 18px;
    text-align: center;
}

.ad-title {
    font-weight: bold;
    color: #1b5e20;
    font-size: 12px;
    flex: 1;
}

.ad-content {
    font-size: 11px;
    color: #424242;
    line-height: 1.4;
    margin-bottom: 5px;
    padding: 5px;
    background: #f5f5f5;
    border-radius: 4px;
}

.ad-contact {
    font-size: 10px;
    color: #666;
    background: #e8f5e9;
    padding: 4px 8px;
    border-radius: 4px;
    word-break: break-all;
    border: 1px dashed #a5d6a7;
}

/* 广告匹配布局 - 左右分栏 */
.ad-match-layout {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 20px;
    height: 100%;
}

.ad-match-layout .questions-section {
    overflow-y: auto;
    padding-right: 10px;
}

.ad-match-layout .ads-section {
    overflow-y: auto;
}

/* 广告匹配题目样式 - 题号+题目内容+选项紧凑布局 */
.ad-match-question {
    display: grid !important;
    grid-template-columns: 45px 1fr 60px !important;
    grid-template-rows: auto !important;
    grid-column: 1 / -1 !important;
    gap: 6px 5px !important;
    padding: 8px 10px !important;
    margin-bottom: 8px !important;
    background: #fff !important;
    border-radius: 6px !important;
    border: 1px solid #e0e0e0 !important;
    align-items: start !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

.ad-match-question .question-num {
    grid-area: auto;
    grid-row: 1 !important;
    grid-column: 1 !important;
    font-weight: bold !important;
    color: #667eea !important;
    font-size: 0.85rem !important;
    padding-top: 2px !important;
    padding-left: 4px !important;
    padding-right: 2px !important;
    text-align: left !important;
    align-self: start !important;
    min-width: 45px !important;
    width: 45px !important;
    flex-shrink: 0 !important;
}

.ad-match-question .question-text {
    grid-area: auto;
    grid-row: 1 !important;
    grid-column: 2 !important;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    white-space: pre-line;
}

.ad-match-question .question-person {
    display: none;
}

.ad-match-question .answer-selector-wrapper {
    grid-column: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-width: 50px;
}

.ad-match-question .answer-display {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 28px;
    padding: 0 8px;
    font-size: 15px;
    font-weight: bold;
    color: #333;
    background: #f5f5f5;
    border: 2px solid #4caf50;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.ad-match-question .answer-display:hover {
    background: #e8f5e9;
    border-color: #2e7d32;
    z-index: 2;
}

.ad-match-question .answer-display.has-value {
    background: #4caf50;
    color: white;
    border-color: #2e7d32;
}

.ad-match-question .answer-input {
    width: 36px;
    height: 24px;
    text-align: center;
    font-size: 13px;
    font-weight: bold;
    border: 2px solid #4caf50;
    border-radius: 4px;
    text-transform: lowercase;
}

.ad-match-question .answer-input:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.ad-match-question .example-answer-label {
    font-size: 10px;
    color: #666;
}


/* ========================================
   听力2精练模式样式（Teil2 Study Mode）
   ======================================== */

/* 精练模式外层容器 - 上下布局 */
.teil2-study-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* 表格区域 */
.teil2-study-table-section {
    width: 100%;
    overflow-x: auto;
}

/* 精练模式表格 */
.teil2-study-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    table-layout: fixed;
}

.teil2-study-table th,
.teil2-study-table td {
    padding: 10px 8px;
    text-align: center;
    border: 1px solid #e0e0e0;
    font-size: 14px;
}

.teil2-study-table th {
    background: #f5f7fa;
    font-weight: 600;
    color: #333;
}

.teil2-study-table .label-col {
    width: 60px;
    background: #f0f4f8;
}

.teil2-study-table .label-cell {
    background: #f0f4f8;
    font-weight: 500;
    color: #666;
    text-align: left;
    padding-left: 10px;
}

.teil2-study-table .person-name {
    font-size: 13px;
    color: #333;
}

/* 答案单元格 */
.teil2-study-table .answer-cell {
    background: #fafafa;
    min-width: 40px;
}

.teil2-study-table .beispiel-cell {
    background: #e8f5e9;
}

.teil2-study-table .beispiel-answer {
    font-weight: bold;
    color: #2e7d32;
    font-size: 15px;
}

.teil2-study-table .study-answer {
    background: #e3f2fd;
}

.teil2-study-table .answer-letter {
    font-weight: bold;
    font-size: 15px;
}

.teil2-study-table .answer-letter.correct {
    color: #1565c0;
}

/* 图片区域 */
.teil2-study-image-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    min-height: 200px;
}

.teil2-study-grid-image {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 图片占位符 */
.image-placeholder {
    color: #999;
    font-size: 14px;
    padding: 40px;
    text-align: center;
    background: #f5f5f5;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .teil2-study-wrapper {
        padding: 8px;
        gap: 12px;
    }
    
    .teil2-study-table th,
    .teil2-study-table td {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    .teil2-study-table .label-col {
        width: 50px;
    }
    
    .teil2-study-grid-image {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .teil2-study-table th,
    .teil2-study-table td {
        padding: 6px 3px;
        font-size: 11px;
    }
    
    .teil2-study-table .label-col {
        width: 40px;
    }
    
    .teil2-study-grid-image {
        max-height: 250px;
    }
}


/* ========================================
   文章讲解模块样式 - 垂直流式布局
   ======================================== */

/* 可拖动分割条样式 */
.resizable-wrapper {
    display: flex !important;
    gap: 0 !important;
}

.resizable-panel {
    min-width: 20%;
    max-width: 80%;
    display: flex;
    flex-direction: column;
}

.resizable-panel[data-panel="left"] {
    flex: 1 1 55%;
}

.resizable-panel[data-panel="right"] {
    flex: 1 1 45%;
}

/* 确保面板本身可以滚动 */
.resizable-panel.scrollable {
    overflow-y: auto !important;
    overflow-x: hidden;
}

/* 确保内部滚动区域可以正常滚动 */
.resizable-panel .scrollable,
.resizable-panel .article-content-body,
.resizable-panel .whiteboard-content,
.resizable-panel .listening-text-content,
.resizable-panel .listening-study-questions,
.resizable-panel .listening-text-area {
    overflow-y: auto !important;
    flex: 1;
}

/* 听力精练左侧面板特殊处理 */
#listeningStudyMainArea {
    overflow: hidden;
}

#listeningStudyMainArea .listening-text-area {
    overflow-y: auto;
}

.resize-handle {
    width: 8px;
    background: transparent;
    cursor: col-resize;
    position: relative;
    flex-shrink: 0;
    z-index: 10;
    transition: background-color 0.2s;
}

.resize-handle:hover,
.resize-handle.dragging {
    background: linear-gradient(180deg, transparent 0%, #667eea 50%, transparent 100%);
}

.resize-handle-line {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 40px;
    background: #ccc;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s;
}

.resize-handle:hover .resize-handle-line,
.resize-handle.dragging .resize-handle-line {
    opacity: 1;
    background: #667eea;
}

/* ==================== 拖放功能样式 ==================== */
.whiteboard-content.drag-over {
    background-color: rgba(102, 126, 234, 0.1) !important;
    border: 2px dashed #667eea !important;
    border-radius: 8px;
}

#whiteboardContent.drag-over,
#listeningStudyWhiteboardContent.drag-over,
#articleExplainWhiteboardContent.drag-over {
    background-color: rgba(102, 126, 234, 0.1) !important;
}

/* ==================== 视频录制模块样式 ==================== */
.record-header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.record-header-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.record-header-btn.recording {
    background: #fff5f5;
    border-color: #e74c3c;
    color: #e74c3c;
}

.record-type-selector {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 160px;
    padding: 6px 0;
    display: none;
}

.record-type-selector.show {
    display: block;
}

.record-type-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
}

.record-type-btn:hover {
    background: #f5f5f5;
}

.record-settings-content {
    width: 500px;
    max-width: 90vw;
}

.record-settings-body {
    max-height: 70vh;
    overflow-y: auto;
}

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

.setting-section h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}

.device-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.record-type-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f5f5f5;
    border-radius: 8px;
}

.record-type-display .type-icon {
    font-size: 24px;
}

.record-type-display .type-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.preview-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

#recordPreviewVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.watermark-overlay {
    position: absolute;
    padding: 8px 12px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 12px;
    border-radius: 4px;
    bottom: 10px;
    right: 10px;
}

.watermark-settings {
    background: #f9f9f9;
    padding: 16px;
    border-radius: 8px;
}

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

.watermark-row:last-child {
    margin-bottom: 0;
}

.watermark-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.watermark-row input[type="range"] {
    flex: 1;
}

.asr-settings {
    background: #f0f7ff;
    padding: 16px;
    border-radius: 8px;
}

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

.asr-row:last-child {
    margin-bottom: 0;
}

.record-settings-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    margin-top: 20px;
}

.btn-start-record {
    padding: 10px 24px;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-start-record:hover {
    background: #c0392b;
}

.recording-floating-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 300px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    z-index: 9999;
    overflow: hidden;
}

.recording-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #e74c3c;
    color: #fff;
}

.recording-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.recording-dot {
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
}

.recording-dot.pulse {
    animation: recordPulse 1s infinite;
}

@keyframes recordPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

.recording-time {
    font-size: 18px;
    font-weight: 600;
    font-family: monospace;
}

.recording-subtitle-preview {
    padding: 12px 16px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
    max-height: 80px;
    overflow-y: auto;
}

.subtitle-content {
    font-size: 13px;
    line-height: 1.5;
    color: #333;
}

.recording-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 16px;
}

.rec-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s;
}

.rec-btn.pause {
    background: #f39c12;
    color: #fff;
}

.rec-btn.pause:hover {
    background: #e67e22;
}

.rec-btn.stop {
    background: #e74c3c;
    color: #fff;
}

.rec-btn.stop:hover {
    background: #c0392b;
}

.rec-btn.cancel {
    background: #95a5a6;
    color: #fff;
}

.rec-btn.cancel:hover {
    background: #7f8c8d;
}

.recording-tips {
    text-align: center;
    padding: 8px;
    font-size: 12px;
    color: #999;
    background: #f5f5f5;
}

.recording-tips kbd {
    background: #eee;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}

.recording-floating-panel.paused .recording-dot {
    background: #f39c12;
    animation: none;
}

.recording-floating-panel.paused .recording-label {
    color: #f39c12;
}

.record-complete-content {
    width: 450px;
}

.record-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 20px;
}

.summary-item {
    text-align: center;
}

.summary-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.summary-value {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.subtitle-info {
    padding: 16px;
    background: #f0fff4;
    border-radius: 8px;
    margin-bottom: 20px;
}

.subtitle-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #27ae60;
}

.subtitle-stats {
    font-size: 13px;
    color: #666;
}

.download-options {
    margin-bottom: 20px;
}

.download-options h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.download-item {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 8px;
}

.download-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.download-checkbox input {
    width: 18px;
    height: 18px;
}

.download-checkbox .icon {
    font-size: 18px;
}

.download-checkbox .filename {
    font-size: 13px;
    color: #666;
}

.record-complete-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-download-all {
    padding: 10px 24px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-download-all:hover {
    background: #2980b9;
}

.btn-cancel {
    padding: 10px 24px;
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.btn-cancel:hover {
    background: #f5f5f5;
}

/* 文章讲解模式 - 左侧文章区 */
#articleExplainArticleContent {
    padding: 16px 0 16px 6px;
}

#articleExplainContentBody {
    min-height: 200px;
    outline: none;
    line-height: 1.8;
}

#articleExplainContentBody:focus {
    outline: none;
}

#articleExplainContentBody .article-paragraph {
    margin-bottom: 16px;
    line-height: 1.8;
    /* 【V2.3修复】右侧边距6px，让文字与滚动条保持距离 */
    padding-right: 6px;
}

#articleExplainArticleContent .article-paragraph {
    margin-bottom: 16px;
    line-height: 1.8;
    /* 【V2.3修复】右侧边距6px，让文字与滚动条保持距离 */
    padding-right: 6px;
}

#articleExplainArticleContent .markable-word {
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 2px;
    padding: 0 1px;
}

#articleExplainArticleContent .markable-word:hover {
    background-color: #e3f2fd;
}

/* 文章讲解模式 - 右侧上传面板 */
/* 【V2.3修复】去掉外层vocab-panel的容器效果，避免双层容器 */
#articleExplainVocabPanel {
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
}

#articleExplainUploadPanel {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px;
    padding-right: 0;
    box-sizing: border-box;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 标题控制行 */
.upload-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e1e5eb;
}

.upload-main-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.upload-main-title .section-icon {
    font-size: 1.1rem;
}

.upload-main-title .section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
}

/* 模式切换标签 */
.upload-mode-tabs {
    display: flex;
    gap: 6px;
}

.upload-mode-tabs .mode-tab {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    white-space: nowrap;
}

.upload-mode-tabs .mode-tab.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.upload-mode-tabs .mode-tab:hover:not(.active) {
    background: #e8efff;
    border-color: #667eea;
}

/* 输入区域 - 同尺寸同位置 */
.upload-input-area {
    flex: 1;
    position: relative;
    min-height: 200px;
    margin-bottom: 12px;
}

.text-input-box,
.file-upload-box {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
}

.text-input-box textarea {
    flex: 1;
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    resize: none;
    box-sizing: border-box;
}

.text-input-box textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.file-upload-box {
    flex-direction: column;
    gap: 8px;
}

.file-drop-zone {
    flex: 1;
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

.file-drop-zone:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.file-drop-zone.dragover {
    border-color: #667eea;
    background: #e8efff;
}

.drop-zone-icon {
    font-size: 2.5rem;
}

.drop-zone-text {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

.drop-zone-hint {
    font-size: 11px;
    color: #666;
}

.supported-formats {
    font-size: 11px;
    color: #999;
    text-align: center;
}

/* 提交按钮行 */
.upload-submit-row {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.upload-submit-row .article-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-submit-row .article-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 状态显示 */
.article-upload-status {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    text-align: center;
    display: none;
}

.article-upload-status.loading {
    display: block;
    background: #fff3e0;
    color: #e65100;
}

.article-upload-status.success {
    display: block;
    background: #e8f5e9;
    color: #2e7d32;
}

.article-upload-status.error {
    display: block;
    background: #ffebee;
    color: #c62828;
}

/* 文章讲解入口样式 */
.category-header.article-explain-entry {
    background: #f0f4ff;
    color: #333;
}

.category-header.article-explain-entry:hover {
    background: #e8efff;
    color: #667eea;
}

.category-header.article-explain-entry .category-title {
    color: #333;
}

.category-header.article-explain-entry:hover .category-title {
    color: #667eea;
}

.category-header.article-explain-entry.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.category-header.article-explain-entry.selected .category-title {
    color: white;
}

/* ========================================
   【V2.3新增】字号调整功能
   ======================================== */

.article-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e1e5eb;
}

.article-section-header .header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-section-header .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    /* 【统一压缩】右对齐元素右侧边距：保持6px与版面边缘的距离 */
    padding-right: 6px;
}

.font-size-btn {
    padding: 6px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: all 0.2s;
}

.font-size-btn:hover {
    background: #e8efff;
    border-color: #667eea;
    color: #667eea;
}

.font-size-icon {
    display: inline-flex;
    align-items: baseline;
    font-family: 'Times New Roman', serif;
}

.font-size-icon .font-large {
    font-size: 16px;
    font-weight: bold;
}

.font-size-icon .font-small {
    font-size: 10px;
    margin-left: 1px;
}

.font-size-modal {
    z-index: 10000;
}

.font-size-modal-content {
    width: 320px;
    max-width: 90vw;
    padding: 20px;
}

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

.font-size-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.font-size-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.font-size-slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
}

.font-size-label {
    font-size: 13px;
    color: #666;
    min-width: 30px;
}

.font-size-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #ccc 0%, #667eea 100%);
    border-radius: 3px;
    cursor: pointer;
}

.font-size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
    transition: transform 0.2s;
}

.font-size-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.font-size-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.font-size-preview {
    padding: 16px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: font-size 0.3s;
}

.font-size-preview-text {
    line-height: 1.6;
}

/* 字号变化类 - 【V2.3修复】使用更高优先级的选择器 */
#articleExplainContentBody.font-size-small,
#articleExplainContentBody.font-size-small *,
#articleExplainContentBody.font-size-small .article-paragraph,
#articleExplainWhiteboardContent.font-size-small,
#articleExplainWhiteboardContent.font-size-small *,
#articleExplainWhiteboardContent.font-size-small p {
    font-size: 11px !important;
}

#articleExplainContentBody.font-size-medium,
#articleExplainContentBody.font-size-medium *,
#articleExplainContentBody.font-size-medium .article-paragraph,
#articleExplainWhiteboardContent.font-size-medium,
#articleExplainWhiteboardContent.font-size-medium *,
#articleExplainWhiteboardContent.font-size-medium p {
    font-size: 15px !important;
}

#articleExplainContentBody.font-size-large,
#articleExplainContentBody.font-size-large *,
#articleExplainContentBody.font-size-large .article-paragraph,
#articleExplainWhiteboardContent.font-size-large,
#articleExplainWhiteboardContent.font-size-large *,
#articleExplainWhiteboardContent.font-size-large p {
    font-size: 20px !important;
}

#articleExplainContentBody.font-size-xlarge,
#articleExplainContentBody.font-size-xlarge *,
#articleExplainContentBody.font-size-xlarge .article-paragraph,
#articleExplainWhiteboardContent.font-size-xlarge,
#articleExplainWhiteboardContent.font-size-xlarge *,
#articleExplainWhiteboardContent.font-size-xlarge p {
    font-size: 30px !important;
}

/* ========================================
   【V2.3新增】上传管理功能
   ======================================== */

.manage-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
}

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

.manage-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.manage-close-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.manage-close-btn:hover {
    background: #eee;
    color: #333;
}

.saved-articles-list {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}

.saved-article-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #eee;
    cursor: pointer;
    transition: all 0.2s;
}

.saved-article-item:hover {
    background: #f0f4ff;
    border-color: #667eea;
}

.saved-article-item.active-article {
    border-color: #667eea;
    background: #f0f4ff;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.25);
}

.saved-article-info {
    flex: 1;
    overflow: hidden;
}

.saved-article-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-article-date {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.saved-article-actions {
    display: flex;
    gap: 8px;
    margin-left: 12px;
}

.saved-article-btn {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.saved-article-btn.load-btn {
    background: #667eea;
    color: white;
}

.saved-article-btn.load-btn:hover {
    background: #5a6fd6;
}

.saved-article-btn.delete-btn {
    background: #fff;
    color: #e53935;
    border: 1px solid #e53935;
}

.saved-article-btn.delete-btn:hover {
    background: #ffebee;
}

/* 左侧目录 - 已保存文章列表 */
.saved-articles-category {
    margin-top: 4px;
}

.saved-article-entry {
    display: flex;
    align-items: center;
    padding: 10px 16px 10px 36px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.saved-article-entry:hover {
    background: #f5f5f5;
    border-left-color: #667eea;
}

.saved-article-entry.selected {
    background: #e8efff;
    border-left-color: #667eea;
}

.saved-article-entry .article-icon {
    margin-right: 8px;
    font-size: 14px;
}

.saved-article-entry .article-name {
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 保存按钮行 */
.save-actions-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
}

.save-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.save-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.save-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.save-btn.secondary {
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
}

.save-btn.secondary:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

/* 保存按钮样式 */
.article-submit-btn.save-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    margin-left: 10px;
}

.article-submit-btn.save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* ==================== 文本朗读模式（TTS）样式 ==================== */

/* 文本朗读模式容器 - 右侧边距让开收起状态的播放控制面板 */
.tts-upload-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    /* 【V2.3修复】右侧边距让开收起状态的播放控制面板（40px）+ 10px */
    padding-right: 50px;
    box-sizing: border-box;
}

.tts-upload-container.compact {
    padding: 16px;
    padding-right: 50px;
}

.tts-upload-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tts-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tts-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.tts-title.editable-title {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s;
}

.tts-title.editable-title:hover {
    background: #f0f4ff;
}

.tts-word-count {
    font-size: 0.8rem;
    color: #999;
}

.tts-text-input {
    flex: 1;
    width: 100%;
    padding: 12px;
    border: 1px solid #e1e5eb;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.tts-text-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.tts-action-row {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.tts-upload-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tts-upload-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.tts-upload-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.tts-config-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.tts-config-btn:hover {
    background: #e8efff;
    border-color: #667eea;
}

.tts-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #64748b;
}

.tts-speaker-icon {
    font-size: 1.2rem;
}

/* 【V2.3统一】文本朗读模式 - 去掉外层容器效果，避免双层容器 */
#listeningStudyQuestionsPanel {
    position: relative;
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
}

/* 【V2.3统一】文本朗读模式上传面板样式 - 与文章详解模式一致 */
#listeningStudyUploadPanel {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px;
    padding-right: 50px;
    box-sizing: border-box;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 文本朗读模式特有：TTS设置按钮 */
.tts-config-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
    margin-left: 8px;
}

.tts-config-btn:hover {
    background: #e0e7ff;
    border-color: #667eea;
}

/* 文本朗读模式特有：状态显示 */
#ttsStatus {
    display: flex;
    align-items: center;
    gap: 8px;
}

#ttsStatus .tts-status-text {
    flex: 1;
}

#ttsStatus.status-info { background: #f1f5f9; color: #475569; }
#ttsStatus.status-success { background: #dcfce7; color: #166534; }
#ttsStatus.status-error { background: #fee2e2; color: #dc2626; }
#ttsStatus.status-speaking { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); color: #92400e; }
#ttsStatus.status-loading { background: #e0e7ff; color: #3730a3; }

/* 【V2.3修复】文本朗读模式白板工具栏避免被右侧边栏遮挡 */
#listeningStudyWhiteboard .whiteboard-tools {
    padding-right: 50px;
}

/* ===== V2.5 涂鸦画笔模块样式 ===== */
.whiteboard-title-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    pointer-events: none;
    opacity: 0;
    animation: whiteboardTitleFade 2s ease-out forwards;
}

.whiteboard-title-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: #667eea;
    text-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

@keyframes whiteboardTitleFade {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    20% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.05);
    }
}

.drawing-canvas {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 40px;
    width: auto;
    height: auto;
    z-index: 1;
    pointer-events: none;
}

.drawing-canvas.active {
    pointer-events: auto;
    z-index: 100;
}

.drawing-tool-group {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    position: relative;
    z-index: 100;
}

.draw-expand-panel {
    display: none;
    flex-direction: row-reverse;
    gap: var(--draw-btn-gap);
    align-items: center;
    min-height: var(--draw-toolbar-min-height);
}

.draw-pen-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--draw-btn-gap);
    padding: var(--draw-btn-padding);
    font-size: var(--draw-btn-font-size);
    height: var(--draw-btn-height);
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #667eea;
    border-radius: var(--draw-btn-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.draw-pen-toggle:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.draw-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--draw-btn-gap);
    padding: var(--draw-btn-padding);
    font-size: var(--draw-btn-font-size);
    height: var(--draw-btn-height);
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #667eea;
    border-radius: var(--draw-btn-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.draw-tool-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.draw-tool-btn[data-active="true"] {
    background: #667eea;
    color: white;
    border-color: #667eea;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.35);
}

.draw-color-panel {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 6px;
}

.draw-color-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.draw-color-btn:hover {
    transform: scale(1.2);
}

.draw-color-btn.active {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
    transform: scale(1.15);
}

.draw-size-panel {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 6px;
}

.draw-size-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 2px solid transparent;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.draw-size-btn:hover {
    background: #f0f4f8;
}

.draw-size-btn.active {
    border-color: #667eea;
    background: #eef2ff;
}

.size-dot {
    display: block;
    border-radius: 50%;
    background: #333;
}

/* ========================================
   欢迎动画样式 - Logo与欢迎语合一
   ======================================== */

.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.welcome-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.welcome-overlay.hidden {
    display: none;
}

.welcome-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    animation: contentAppear 0.5s ease-out forwards;
}

@keyframes contentAppear {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-logo {
    width: 180px;
    height: auto;
    max-width: 80vw;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.25));
    margin-bottom: 32px;
    animation: logoShine 2s ease-in-out infinite;
}

@keyframes logoShine {
    0%, 100% {
        filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.25));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 8px 32px rgba(255, 255, 255, 0.5)) drop-shadow(0 0 20px rgba(102, 126, 234, 0.6));
        transform: scale(1.02);
    }
}

.welcome-text {
    opacity: 0;
    animation: textFadeIn 0.4s ease-out forwards;
    animation-delay: 0.1s;
}

@keyframes textFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.welcome-title {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    font-size: 2.2rem;
    font-weight: 300;
    color: #fff;
    letter-spacing: 0.12em;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.welcome-subtitle {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 1rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.15em;
    margin-top: 12px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .welcome-logo {
        width: 140px;
        margin-bottom: 24px;
    }
    
    .welcome-title {
        font-size: 1.6rem;
    }
    
    .welcome-subtitle {
        font-size: 0.85rem;
    }
}

/* =====================================================
   平板横屏适配（≥1024px 桌面平板，如 iPad 横屏）
   修复：max-width:1024px 断点会隐藏 sidebar，导致
   平板横屏 (宽=1024px) 时左侧目录栏无法弹出。
   此适配层让侧边栏在平板横屏下以浮层抽屉形式工作，
   默认折叠保留 40px 工具栏，点击 ☰ 展开为 240px 覆盖层。
   ===================================================== */
@media (min-width: 768px) and (max-width: 1100px) {
    /* 主区域改为单列全宽，侧边栏脱离网格流、作为浮层 */
    #app {
        grid-template-columns: 1fr;
        grid-template-rows: 60px 1fr;
        grid-template-areas:
            "header"
            "main";
    }

    .sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        bottom: 0;
        height: auto;
        width: 40px;
        min-width: 0;
        z-index: 1000;
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.15);
        display: flex;
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* 折叠态仍显示 40px 工具栏（☰ 可点），默认收起 */
    .sidebar .sidebar-header {
        display: flex;
    }
    .sidebar .collapsed-tools {
        display: flex;
    }
    .sidebar .sidebar-content {
        display: none;
    }

    /* 展开时覆盖为 240px 抽屉 */
    .sidebar.initial,
    .sidebar.expanded {
        width: 240px;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
    }
    .sidebar.initial .sidebar-content,
    .sidebar.expanded .sidebar-content {
        display: flex;
    }
    .sidebar.initial .sidebar-header,
    .sidebar.expanded .sidebar-header {
        display: none;
    }

    /* 内容容器在窄板下纵向堆叠，保证阅读区与答题区都可滚 */
    .content-wrapper,
    .listening-test-wrapper,
    .listening-study-wrapper {
        grid-template-columns: 1fr !important;
        grid-template-rows: 1fr 1fr !important;
        min-height: 0;
    }

    /* 顶栏工具按钮图标适度缩小，避免拥挤 */
    .header .tool-btn,
    .header .mode-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    .header-current-title {
        max-width: 40vw;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* =====================================================
   平板竖屏适配：侧边栏折叠工具栏不再遮挡主内容，
   主内容区预留 40px 避让；展开抽屉时仍然悬浮覆盖。
   ===================================================== */
@media (min-width: 600px) and (max-width: 1100px) and (orientation: portrait) {
    #app {
        grid-template-columns: 1fr;
        grid-template-rows: 60px 1fr;
        grid-template-areas:
            "header"
            "main";
    }

    /* 侧边栏：折叠为 40px 悬浮工具栏，杜绝与内容重叠 */
    .sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        bottom: 0;
        width: 40px;
        z-index: 1000;
        display: flex;
    }
    .sidebar .sidebar-header {
        display: flex;
    }
    .sidebar .collapsed-tools {
        display: flex;
    }
    .sidebar .sidebar-content {
        display: none;
    }

    /* 竖屏初始态：即使带 initial 类也按折叠 40px 显示（避免启动时覆盖内容） */
    .sidebar.initial {
        width: 40px;
    }
    .sidebar.initial .sidebar-content {
        display: none;
    }
    .sidebar.initial .sidebar-header {
        display: flex;
    }

    /* 展开抽屉：仅 expanded 完全覆盖，不压缩主内容 */
    .sidebar.expanded {
        width: 260px;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.25);
    }
    .sidebar.expanded .sidebar-content {
        display: flex;
    }
    .sidebar.expanded .sidebar-header {
        display: none;
    }

    /* 主内容区避让折叠工具栏，避免重叠 */
    .main-content {
        padding-left: 40px;
        box-sizing: border-box;
    }
    /* 展开抽屉时无需避让（抽屉覆盖在上层） */
    body:has(.sidebar.expanded) .main-content {
        padding-left: 0;
    }
}

/* =====================================================
   设备使用指引提示条
   根据屏幕尺寸显示不同提示，2 秒后自动淡出消失
   ===================================================== */
.device-hint {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    max-width: 88vw;
    background: rgba(30, 41, 59, 0.92);
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    white-space: normal;
    font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
}
.device-hint.show {
    opacity: 1;
}
.device-hint .hint-icon {
    margin-right: 6px;
}
@media (max-width: 480px) {
    .device-hint {
        font-size: 0.82rem;
        padding: 10px 14px;
        width: 88vw;
    }
}

/* =====================================================
   触屏设备：抑制系统原生"选中后弹出菜单"
   仅对触摸设备生效，不影响桌面鼠标右键。
   - -webkit-touch-callout:none：阻止 iOS 长按弹出气泡
     （复制/粘贴/翻译等）
   - user-select:text 保留，使自定义笔记工具仍能通过
     selectionchange 捕获选区做下划线/加粗等操作
   ===================================================== */
@media (pointer: coarse) {
    /* 笔记目标区：抑制长按系统菜单，但保留可选文本 */
    .article-content,
    .listening-text-content,
    .listening-display-content,
    .whiteboard-content,
    .article-explain-content-body,
    #studyArticleContent,
    #listeningTextContent,
    #articleExplainContentBody {
        -webkit-touch-callout: none !important;
        -webkit-user-select: text !important;
        user-select: text !important;
        touch-action: auto;
    }
    /* 纯交互按钮/选项：完全禁选，避免误触选中弹菜单 */
    .option-click-area,
    .option-text,
    .question-nav-item,
    .teil-btn,
    .category-header,
    .category-title,
    .dropdown-item,
    .play-mode-btn,
    .text-mode-btn,
    .speed-option,
    .control-btn,
    .tool-btn {
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        user-select: none !important;
    }
}

