/* ========== 全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background-color: #F8F5DE;
    color: #0f47d7;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ========== 顶部工具栏 ========== */
#toolbar {
    font-size: xx-large;
    background-color: #588aff;
    color: #a3ff75;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid #97bafc;
    box-shadow: 0 2px 4px rgba(0,20,0,0.1);
}

#toolbar h1 {
    font-size: 20px;
    font-weight: 500;
    margin: 0;
}

/* OCR Progress Bar in PDF Controls */
/* OCR进度条 - 紧凑内联版本 */
.ocr-progress-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: rgb(177, 246, 92);
    border-radius: 4px;
    padding: 6px 10px;
    margin-left: 12px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.ocr-progress-text {
    font-size: 11px;
    color: #27590a;
    white-space: nowrap;
    min-width: 50px;
}

.ocr-progress-track {
    width: 120px;
    height: 7px;
    /* 进度条配色：背景轨道 */
    background-color: rgba(34, 109, 17, 0.896);
    border-radius: 3px;
    overflow: hidden;
}

.ocr-progress-fill {
    height: 100%;
    /* 进度条配色：填充条（渐变） */
    background: #acff68;
    border-radius: 3px;
    border-top: #1b5e20 solid 2px;
    border-bottom: #1b5e20 solid 2px;
    transition: width 0.3s ease;
    width: 0%;
}



#file-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

#currentFile {
    font-size: 14px;
    color: #a0ceff;
}

/* ========== 按钮样式 ========== */
button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

#uploadBtn {
    background-color: #bbff67;
    color: rgb(17, 128, 255);
    font-weight: bold;
}

#uploadBtn:hover {
    background-color: #5bc0ff;
    color: rgb(246, 255, 232);
}

.primary-btn {
    background-color: #8aff5f;
    color: #003366;
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
}

.primary-btn:hover {
    background-color: #c4ffa9;
}

/* ========== 主内容区 ========== */
#main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ========== PDF 阅读器面板 ========== */
#pdf-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: white;
    border-right: 5px solid rgb(214, 255, 125);
    min-height: 0;
    min-width: 0;  /* 关键：约束 panel 宽度，防止 canvas 撑大 */
}

#pdf-controls {
    padding: 10px;
    background-color: #def8f5;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    gap: 15px;
    flex-wrap: nowrap; /* Keep toolbar single-line */
    row-gap: 0; /* Remove row gap */
}

#pdf-controls button {
    background-color: #8de45b;
    color: #1e62ff;
    font-weight: bold;
    height: 31px;
    padding: 4px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#pdf-controls input[type="text"] {
    height: 31px;
    padding: 4px 8px;
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 4px;
    font-size: 12px;
    box-sizing: border-box;
}

#pdf-controls button:hover {
    background-color: #27dbee;
}

.toolbar-divider {
    width: 1px;
    height: 22px;
    background-color: rgba(7, 0, 197, 0.35);
    display: inline-block;
    margin: 0 6px;
}

#pageInfo {
    font-size: 14px;
    color: #0700c5;
}

#pdf-viewer {
    position: relative;
    flex: 1;
    overflow: auto;
    background-color: rgb(247, 255, 239);
    padding: 10px;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#pdf-pages {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.pdf-page {
    position: relative;
    width: 100%;
    display: block;
    margin: 0 auto;
}

.pdf-page.current {
    outline: 2px solid rgba(0, 132, 255, 0.35);
    outline-offset: 4px;
}

.pdf-canvas {
    display: block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    background-color: rgb(246, 255, 232);
    width: 100%;
    max-width: 100%;
    aspect-ratio: 595.2 / 841.92;  /* A4纸张比例 */
    pointer-events: none;  /* 让鼠标事件穿透到文本层 */
    position: relative;
    z-index: 1;
}

.text-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    user-select: text;
    -webkit-user-select: text;
    pointer-events: auto;
    z-index: 20;
}

/* DEBUG: 临时显示文本层范围 - 可通过JS添加debug类查看 */
.text-layer.debug {
    background-color: rgba(0, 100, 255, 0.1) !important;
    opacity: 1 !important;
}

.text-layer.debug .text-item {
    background-color: rgba(255, 200, 0, 0.2) !important;
    color: rgba(0, 0, 0, 0.5) !important;
    border: 1px solid rgba(255, 0, 0, 0.3);
}

/* 文本项默认透明，仅在选中时显示高亮 */
.text-item {
    background-color: transparent;
    color: transparent;
    min-height: 2px;
    min-width: 2px;
    user-select: text;
    -webkit-user-select: text;
    pointer-events: auto;
}

.text-item::selection {
    background-color: rgba(111, 255, 0, 0.3);  /* 选中时更深的蓝色半透明高亮 */
    color: transparent;  /* 文字仍然不显示 */
}

/* 导航回原文时的高亮标记 - 两层高亮 */
/* 第一层：context背景（浅黄） */
.text-item.jump-highlight-context {
    background-color: rgba(255, 255, 0, 0.3) !important;
    animation: highlight-context-fade 3s ease-out;
}

/* 第二层：主词高亮（深橙） */
.text-item.jump-highlight-word {
    background-color: rgba(255, 165, 0, 0.7) !important;
    animation: highlight-word-fade 3s ease-out;
}

/* 保留原有的单层高亮（向后兼容） */
.text-item.jump-highlight {
    background-color: rgba(255, 255, 0, 0.6) !important;
    animation: highlight-fade 3s ease-out;
}

@keyframes highlight-context-fade {
    0% { background-color: rgba(255, 255, 0, 0.4); }
    100% { background-color: transparent; }
}

@keyframes highlight-word-fade {
    0% { background-color: rgba(255, 165, 0, 0.8); }
    100% { background-color: transparent; }
}

@keyframes highlight-fade {
    0% { background-color: rgba(255, 255, 0, 0.8); }
    100% { background-color: transparent; }
}

/* Firefox 兼容性 */
.text-item::-moz-selection {
    background-color: rgba(0, 100, 255, 0.3);
    color: transparent;
}

/* ========== 侧边栏 ========== */
#sidebar {
    width: 400px;
    background-color: #ecffd2;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    position: relative;
}

#sidebar.collapsed {
    width: 50px;
    overflow: hidden;
}

/* 侧边栏收起时隐藏内部文字 */
#sidebar.collapsed #tabs,
#sidebar.collapsed .tab-content {
    display: none;
}

.collapse-btn {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    padding: 10px 4px;
    background-color: #a6ff57;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #43a705;
    border: #a6ff57 solid 2px;
    flex-shrink: 0;
    line-height: 1;
    min-width: 24px;
    border-radius: 4px 0 0 4px;
}

.collapse-btn:hover {
    background-color: #9cedff;
    color: #588aff;
    border: #0f47d7 solid 2px;
}

#sidebar.collapsed .collapse-btn {
    writing-mode: vertical-rl;
    transform: rotate(0deg);
    border-radius: 0 4px 4px 0;
}

#tabs {
    display: flex;
    border-bottom: 2px solid #ecf0f1;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background-color: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 16px;
    color: #43a705;
}

.tab-btn.active {
    color: #2c3e50;
    border-bottom-color: #6B9277;
    font-weight: 500;
}

.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

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

/* ========== Vocab 子标签样式 ========== */
.vocab-subtabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f9f9f9;
    margin-bottom: 0;
    gap: 0;
}

.vocab-subtab-btn {
    flex: 1;
    padding: 10px;
    background-color: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    color: #7f8c8d;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vocab-subtab-btn:hover {
    color: #2c3e50;
    background-color: #f0f0f0;
}

.vocab-subtab-btn.active {
    color: #2c3e50;
    border-bottom-color: #588aff;
    font-weight: 500;
}

.vocab-subtab-content {
    display: none;
    overflow-y: auto;
    padding: 15px 0;
}

.vocab-subtab-content.active {
    display: block;
}

/* ========== 搜索框样式 ========== */
.search-input {
    width: 100%;
    padding: 8px 32px 8px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: #0f47d7;
    box-shadow: 0 0 4px rgba(15, 71, 215, 0.3);
}

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

#vocab-search-bar,
#accum-search-bar {
    position: relative;
    margin-bottom: 12px;
}

.clear-search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: color 0.2s;
}

.clear-search-btn:hover {
    color: #333;
}

/* ========== 生词本样式 ========== */
#vocab-stats {
    padding: 10px;
    background-color: #bff38b;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
    border: 1px solid #83f43d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vocab-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.export-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.export-btn:hover {
    background-color: #218838;
}

.display-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.display-btn:hover {
    background-color: #5a6268;
}

.select-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.select-btn:hover {
    background-color: #0056b3;
}

.select-btn.active {
    background-color: #dc3545;
}

.select-btn.active:hover {
    background-color: #c82333;
}

.practice-btn {
    border: none;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    color: white;
    transition: background-color 0.2s;
}

.dictation-btn {
    background-color: #17a2b8;
}

.dictation-btn:hover {
    background-color: #138496;
}

.review-btn {
    background-color: #ffc107;
    color: #1f2d3d;
}

.review-btn:hover {
    background-color: #e0a800;
}

/* 批量操作栏 */
.bulk-actions {
    display: none;
    gap: 8px;
    padding: 10px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    margin-bottom: 10px;
    justify-content: center;
}

.bulk-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.bulk-btn:hover {
    background-color: #5a6268;
}

.delete-bulk-btn {
    background-color: #dc3545;
}

.delete-bulk-btn:hover {
    background-color: #c82333;
}

/* 删除确认框 */
.delete-confirmation {
    background: white;
    border: 2px solid #dc3545;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    animation: slideIn 0.2s ease-out;
}

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

.delete-confirmation p {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #212529;
    font-weight: 500;
}

.confirm-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.confirm-yes,
.confirm-no {
    padding: 6px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.confirm-yes {
    background-color: #dc3545;
    color: white;
}

.confirm-yes:hover {
    background-color: #c82333;
}

.confirm-no {
    background-color: #6c757d;
    color: white;
}

.confirm-no:hover {
    background-color: #5a6268;
}

#vocab-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vocab-item {
    padding: 12px;
    background-color: #f8f9fa;
    border-left: 4px solid #99CC81;
    border-radius: 4px;
    transition: background-color 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vocab-item:hover {
    background-color: #e9ecef;
}

/* 复选框样式 */
.item-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    z-index: 1;
    margin: 0;
    accent-color: #3498db;
}

/* Modern browsers: use :has() selector */
.vocab-item:has(.item-checkbox) {
    padding-left: 40px;
}

.accum-item:has(.item-checkbox) {
    padding-left: 40px;
}

/* Fallback for older browsers: explicit class */
.vocab-item.with-checkbox {
    padding-left: 40px;
}

.accum-item.with-checkbox {
    padding-left: 40px;
}

/* 精简模式样式 */
.vocab-item.compact,
.accum-item.compact {
    padding: 8px 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    justify-content: space-between;
    min-height: 60px;
    overflow: visible;
    flex-direction: row;
}

.vocab-item.compact .vocab-word {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: fit-content;
    line-height: 1;
}

.vocab-meaning-compact {
    font-size: 12px;
    color: #4867c6;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
    margin: 0 12px;
    line-height: 1;
}

.vocab-meaning-text {
    font-size: 12px;
    color: #555;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.vocab-item.compact .delete-btn {
    flex-shrink: 0;
    line-height: 1;
}

.vocab-item.compact .compact-jump {
    font-size: 14px;
    color: #007bff;
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
    transition: background-color 0.2s;
    line-height: 1;
}

.vocab-item.compact .compact-jump:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

/* Expanded detail state for single item in compact mode */
.vocab-item.expanded-detail {
    padding: 16px;
    background-color: #ffffff;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 生词本项目中的折叠按钮 */
.vocab-item .collapse-btn {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 3px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.vocab-item .collapse-btn:hover {
    background-color: rgba(52, 152, 219, 0.1);
    transform: scale(1.1);
}

.expand-details-btn {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 3px;
    transition: all 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
}

.expand-details-btn:hover {
    background-color: rgba(52, 152, 219, 0.1);
    transform: scale(1.1);
}

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

.vocab-compact-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.vocab-compact-container .vocab-word {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    white-space: nowrap;
    flex-shrink: 0;
}

.vocab-compact-container .vocab-meaning {
    font-size: 12px;
    color: #4867c6;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vocab-simple-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vocab-simple-word {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.vocab-simple-meaning {
    font-size: 12px;
    color: #4867c6;
}

.vocab-simple-source {
    font-size: 11px;
    color: #7f8c8d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vocab-detail-popup {
    position: fixed;
    width: 400px;
    max-height: 70vh;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    overflow-y: auto;
    z-index: 9999;
}

.vocab-source {
    font-size: 11px;
    color: #7f8c8d;
    margin-right: 8px;
}

.vocab-popup-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.vocab-popup-header h3 {
    margin: 0;
    font-size: 18px;
    color: #2c3e50;
}

.vocab-popup-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vocab-popup-close:hover {
    color: #333;
}

.vocab-popup-content {
    padding: 16px;
}

.accum-compact-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.accum-compact-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.accum-compact-sentence {
    font-size: 12px;
    color: #212529;
    line-height: 1.4;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.accum-compact-notes {
    font-size: 11px;
    color: #666;
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.accum-compact-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.accum-compact-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.accum-compact-buttons {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.accum-category-tag,
.accum-topic-tag {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.accum-item.compact .compact-edit-btn,
.accum-item.compact .compact-delete-btn {
    padding: 4px 6px;
    font-size: 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.6);
    color: #555;
    transition: background-color 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
}

.accum-item.compact .compact-edit-btn:hover,
.accum-item.compact .compact-delete-btn:hover {
    background-color: rgba(255, 255, 255, 0.9);
    color: #212529;
}

.accum-item.compact .accum-sentence {
    font-size: 13px;
    margin-bottom: 0;
    line-height: 1;
}

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

.vocab-word {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.vocab-meaning {
    font-size: 14px;
    color: #4867c6;
    margin-bottom: 8px;
}

.vocab-context-meaning {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 8px;
    font-style: italic;
}

.vocab-context {
    font-size: 12px;
    color: #8c95a1;
    font-style: italic;
    margin-bottom: 8px;
    padding: 6px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
}

.vocab-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #dee2e6;
}

.vocab-source {
    font-size: 11px;
    color: #6c757d;
}

.jump-link {
    font-size: 12px;
    color: #007bff;
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.jump-link:hover {
    background-color: rgba(0, 123, 255, 0.1);
    text-decoration: underline;
}

.delete-btn {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 20px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.delete-btn:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

.edit-btn {
    background: none;
    border: none;
    color: #1f7a4a;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 20px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.edit-btn:hover {
    background-color: rgba(31, 122, 74, 0.1);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
}

/* ========== 积累本样式 ========== */
#topic-selector {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: nowrap;
    align-items: center;
}

#topicSelect {
    flex: 1;
    padding: 6px;
    color: #0f47d7;
    border: 2px solid #93d5ff;
    border-radius: 3px;
    font-size: 13px;
    min-width: 0;
}

#addTopicBtn, #deleteTopicBtn, #toggleAccumDisplayBtn, #toggleAccumSelectBtn {
    padding: 6px 10px;
    font-size: 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

#addTopicBtn {
    background-color: #7bd546;
    color: white;
}

#deleteTopicBtn {
    background-color: #e67e22;
    color: white;
}

#accumulation-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.accum-item {
    padding: 12px;
    background-color: var(--topic-bg, #eee1ff);
    border-left: 4px solid #9572ff;
    border-radius: 4px;
    transition: background-color 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.accum-item:hover {
    background-color: var(--topic-bg-hover, #cde7ff);
}

/* Detailed 模式新布局 */
.accum-detailed-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.accum-top-left {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 4px;
    z-index: 10;
}

.accum-top-right {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
}

.accum-main {
    padding-top: 35px;
    flex: 1;
}

.accum-top-left .edit-btn,
.accum-top-left .delete-btn {
    padding: 5px 8px;
    font-size: 13px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.7);
    color: #555;
    transition: background-color 0.2s;
}

.accum-top-left .edit-btn:hover,
.accum-top-left .delete-btn:hover {
    background-color: rgba(255, 255, 255, 0.95);
    color: #212529;
}

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

.accum-category {
    display: inline-block;
    padding: 2px 8px;
    background-color: #2e89ff;
    color: rgb(220, 245, 254);
    font-size: 11px;
    border-radius: 10px;
    font-weight: 600;
}

.accum-sentence {
    font-size: 14px;
    color: #212529;
    margin-bottom: 8px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    word-spacing: 0.1em;
    overflow-wrap: break-word;
}

.accum-translation {
    font-size: 13px;
    color: #495057;
    margin-bottom: 8px;
    font-style: italic;
}

.accum-notes {
    font-size: 12px;
    color: #6c757d;
    padding: 6px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
    margin-bottom: 8px;
}

.accum-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #dee2e6;
}

.accum-topic {
    font-size: 11px;
    color: #6c757d;
    font-weight: 600;
}

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

.accumulation-item {
    padding: 12px;
    background-color: #f8f9fa;
    border-left: 4px solid #e74c3c;
    border-radius: 4px;
    cursor: pointer;
}

.accumulation-item.viewpoint {
    border-left-color: #27ae60;
}

.accumulation-sentence {
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 8px;
    line-height: 1.5;
}

.accumulation-meta {
    font-size: 12px;
    color: #7f8c8d;
    display: flex;
    gap: 10px;
}

/* ========== 弹窗样式 ========== */
.popup {
    position: fixed;
    z-index: 1000;
}

.popup[hidden] {
    display: none;
}

/* 模态对话框 */
.modal {
    position: fixed;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.modal[hidden] {
    display: none;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(46, 125, 50, 0.5);  /* 暗绿色带透明度 */
    z-index: 1999;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    position: relative;
    z-index: 2001;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.modal-content h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 20px;
}

.modal-content input[type="text"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.modal-content input[type="text"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

/* 删除确认对话框样式 */
.delete-confirm-content {
    text-align: center;
    max-width: 380px;
}

.delete-confirm-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.delete-confirm-content h3 {
    color: #e74c3c;
    margin-bottom: 12px;
    font-size: 18px;
}

.delete-confirm-content p {
    color: #555;
    margin: 8px 0;
    line-height: 1.5;
}

.delete-confirm-note {
    font-size: 13px;
    color: #7f8c8d;
    font-style: italic;
    margin-top: 12px !important;
}

.delete-confirm-content .modal-actions {
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.delete-confirm-content .modal-actions button {
    padding: 9px 24px;
    font-size: 13px;
}

.delete-confirm-content .modal-actions .delete-btn {
    background-color: #e74c3c;
    color: white;
}

.delete-confirm-content .modal-actions .delete-btn:hover {
    background-color: #c0392b;
}

/* 浮动编辑窗口样式 */
.float-editor {
    position: fixed;
    z-index: 2500;
    min-width: 380px;
    width: 380px;
    max-height: 85vh;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.float-editor[hidden] {
    display: none;
}

.float-editor-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
}

.float-editor-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.float-editor-body {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.float-editor-body .form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.float-editor-body label {
    font-size: 12px;
    font-weight: 500;
    color: #555;
}

.float-editor-body select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #bbb;
    border-radius: 4px;
    font-size: 13px;
    background-color: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px;
    box-sizing: border-box;
    max-height: 200px;
}

.float-editor-body select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.4);
}

.float-editor-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.float-editor-actions button {
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.float-editor-actions .secondary-btn {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.float-editor-actions .secondary-btn:hover {
    background-color: #efefef;
}

.float-editor-actions .primary-btn {
    background-color: #3498db;
    color: white;
}

.float-editor-actions .primary-btn:hover {
    background-color: #2980b9;
}

.float-editor-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    transition: color 0.2s;
}

.float-editor-close-btn:hover {
    color: #f44336;
}

.popup-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    max-width: 450px;
    width: auto;
    max-height: 60vh;
    position: relative;
    border: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.popup-tab-content,
.popup-scrollable-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    margin-bottom: 8px;
}

#saveVocabBtn,
#saveAccumulationBtn {
    margin-top: auto;
    flex-shrink: 0;
}

/* 加载指示器样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.loading-overlay.hidden {
    display: none;
    pointer-events: none;
}

.loading-container {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    margin-bottom: 24px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.loading-text h3 {
    margin: 0;
    font-size: 18px;
    color: #2c3e50;
    font-weight: 600;
}

.loading-text p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.loading-progress-bar {
    width: 300px;
    height: 6px;
    background-color: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin: 8px 0;
}

.loading-progress {
    height: 100%;
    background: #3498db;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #7f8c8d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
}

.popup .close-btn {
    position: sticky;
    top: 8px;
    align-self: flex-end;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    z-index: 2;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.modal .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
}

.close-btn:hover {
    color: #2c3e50;
}

.popup-content h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 24px;
}

.meaning-section {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.meaning-section h4 {
    color: #34495e;
    margin-bottom: 10px;
    font-size: 16px;
}

.meaning-section p {
    color: #555;
    line-height: 1.6;
}

    .sentence-original {
        line-height: 1.8;
        color: #2c3e50;
        font-size: 16px;
        white-space: pre-wrap;
        word-break: break-word;
    }

.ai-subsection {
    margin-top: 10px;
}

.ai-subtitle {
    font-size: 12px;
    color: #7f8c8d;
    letter-spacing: 0.5px;
    text-transform: uppercase;
        white-space: pre-wrap;
        word-break: break-word;
    margin-bottom: 6px;

    .accum-compact-sentence {
        white-space: pre-wrap;
        word-break: break-word;
    }
}

.ai-heading {
    color: #1e62ff;
}

.ai-collocation-list {
    margin: 6px 0 0 0;
    padding-left: 18px;
}

.ai-collocation-list li {
    margin: 4px 0;
    color: #555;
    line-height: 1.5;
}

.loading {
    color: #7f8c8d;
    font-style: italic;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #2c3e50;
    font-weight: 500;
}

.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

/* ========== 词典样式 ========== */
.dict-word {
    padding: 12px;
    background-color: #f9f7f4;
    border-left: 4px solid #8aff5f;
    border-radius: 4px;
}

.word-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.word-text {
    font-size: 18px;
    font-weight: 600;
    color: #0f47d7;
}

.phonetic {
    font-size: 12px;
    color: #7f8c8d;
    font-style: italic;
}

.audio-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
}

.audio-btn:hover:not(:disabled) {
    background-color: #e8f5e9;
    transform: scale(1.1);
}

.audio-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.audio-btn.audio-loading {
    animation: pulse 0.6s infinite;
}

.audio-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.dict-definition {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.dict-definition:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.dict-definition .pos {
    font-size: 12px;
    font-style: italic;
    color: #9e9e9e;
    margin-bottom: 4px;
}

.dict-definition .def {
    margin: 4px 0;
    line-height: 1.4;
    color: #2c3e50;
}

.dict-definition .example {
    margin: 6px 0;
    padding-left: 12px;
    color: #666;
    font-size: 13px;
    border-left: 2px solid #ddd;
}

.dict-definition .synonyms {
    margin-top: 6px;
    font-size: 13px;
    color: #555;
}

.dict-definition .chinese-def {
    margin: 6px 0;
    padding: 6px 8px;
    background-color: #f0f8ff;
    border-left: 3px solid #4a90e2;
    font-size: 13px;
    color: #2c3e50;
    line-height: 1.4;
}

.dict-origin {
    margin-top: 12px;
    padding: 8px;
    background-color: #fff9c4;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 中文译义样式（主要显示） */
.chinese-translation {
    margin-bottom: 16px;
    padding: 12px;
    background-color: #e8f5e9;
    border-left: 4px solid #4caf50;
    border-radius: 4px;
}

.translation-label {
    font-size: 12px;
    color: #2e7d32;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
}

.translation-text {
    font-size: 16px;
    color: #1b5e20;
    font-weight: 500;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 英文释义样式 */
.english-definitions {
    margin-bottom: 12px;
}

.english-label {
    font-size: 12px;
    color: #1976d2;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
}

/* 不完整单词警告样式 */
.incomplete-warning {
    margin: 12px 0;
    padding: 8px 12px;
    background-color: #fff3e0;
    border-left: 4px solid #ff9800;
    border-radius: 4px;
    color: #e65100;
    font-size: 13px;
}

/* 单词作用按钮样式 */
/* 错误信息样式 */
.dict-word .error {
    color: #d32f2f;
    font-style: italic;
}

/* ========== 响应式调整 ========== */
@media (max-width: 768px) {
    #main-container {
        flex-direction: column;
    }
    
    #sidebar {
        width: 100%;
        height: 40vh;
    }
}

/* ========== 新手教程样式 ========== */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.tutorial-overlay[hidden] {
    display: none;
}

.tutorial-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.tutorial-progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.tutorial-progress-fill {
    height: 100%;
    background: #3498db;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.tutorial-step-info {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

.tutorial-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    margin-left: 12px;
}

.tutorial-close:hover {
    background: #f5f5f5;
    color: #333;
}

.tutorial-body {
    padding: 32px 24px;
    overflow-y: auto;
    flex: 1;
}

.tutorial-body h2 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 26px;
    font-weight: 600;
}

.tutorial-body h3 {
    margin: 0 0 16px 0;
    color: #34495e;
    font-size: 18px;
    font-weight: 500;
}

.tutorial-body p {
    margin: 0 0 16px 0;
    color: #555;
    line-height: 1.7;
    font-size: 15px;
}

.tutorial-body ul {
    margin: 0 0 16px 0;
    padding-left: 24px;
}

.tutorial-body li {
    margin-bottom: 10px;
    color: #555;
    line-height: 1.6;
}

.tutorial-body strong {
    color: #2c3e50;
    font-weight: 600;
}

.tutorial-body em {
    color: #7f8c8d;
    font-style: italic;
}

.tutorial-body kbd {
    display: inline-block;
    padding: 3px 8px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #333;
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.tutorial-footer {
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: #f8f9fa;
}

.tutorial-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tutorial-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.tutorial-checkbox label {
    cursor: pointer;
    font-size: 13px;
    color: #666;
    user-select: none;
}

.tutorial-actions {
    display: flex;
    gap: 10px;
}

.tutorial-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tutorial-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tutorial-btn-skip {
    background: #ecf0f1;
    color: #7f8c8d;
}

.tutorial-btn-skip:hover:not(:disabled) {
    background: #dce1e3;
}

.tutorial-btn-prev {
    background: #ecf0f1;
    color: #2c3e50;
}

.tutorial-btn-prev:hover:not(:disabled) {
    background: #dce1e3;
}

.tutorial-btn-next {
    background: #3498db;
    color: white;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.tutorial-btn-next:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
    transform: translateY(-1px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tutorial-container {
        width: 95%;
        max-height: 90vh;
    }
    
    .tutorial-body {
        padding: 24px 20px;
    }
    
    .tutorial-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .tutorial-actions {
        width: 100%;
    }
    
    .tutorial-btn {
        flex: 1;
    }
}

/* ========== 交互式教程样式 ========== */
.interactive-tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9999;
    pointer-events: none;
}

.interactive-tutorial-overlay[hidden] {
    display: none;
}

.interactive-tutorial-highlight {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    pointer-events: none;
}

.interactive-tutorial-highlight[hidden] {
    display: none;
}

/* 高亮脉动效果 */
@keyframes tutorial-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(52, 152, 219, 0);
    }
}

.tutorial-highlight-pulse {
    animation: tutorial-pulse 2s infinite;
    position: relative;
    z-index: 10001 !important;
}

/* 教程面板 */
.interactive-tutorial-panel {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    z-index: 10002;
    display: flex;
    flex-direction: column;
    animation: slideInPanel 0.3s ease-out;
}

.interactive-tutorial-panel[hidden] {
    display: none;
}

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

/* 面板位置 */
.interactive-tutorial-panel.position-top {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.interactive-tutorial-panel.position-bottom {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.interactive-tutorial-panel.position-left {
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
}

.interactive-tutorial-panel.position-right {
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
}

.interactive-tutorial-panel.position-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.interactive-tutorial-panel.position-bottom-right {
    bottom: 20px;
    right: 20px;
}

/* 面板头部 */
.tutorial-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tutorial-progress-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
}

.tutorial-step-counter {
    font-size: 13px;
    color: #7f8c8d;
}

.tutorial-panel-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.tutorial-panel-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* 进度条 */
.tutorial-progress-bar {
    height: 4px;
    background: #e0e0e0;
}

.tutorial-progress-fill {
    height: 100%;
    background: #3498db;
    transition: width 0.4s ease;
}

/* 面板主体 */
.tutorial-panel-body {
    padding: 24px 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.tutorial-panel-body h2 {
    margin: 0 0 16px 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
}

.tutorial-panel-body p {
    margin: 0 0 12px 0;
    color: #555;
    line-height: 1.6;
    font-size: 14px;
}

.tutorial-panel-body ol,
.tutorial-panel-body ul {
    margin: 0 0 12px 0;
    padding-left: 24px;
}

.tutorial-panel-body li {
    margin-bottom: 8px;
    color: #555;
    line-height: 1.5;
    font-size: 14px;
}

.tutorial-panel-body strong {
    color: #2c3e50;
    font-weight: 600;
}

.tutorial-panel-body kbd {
    display: inline-block;
    padding: 2px 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #333;
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}

.tutorial-panel-body a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.tutorial-panel-body a:hover {
    text-decoration: underline;
}

/* 面板脚部 */
.tutorial-panel-footer {
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.tutorial-btn-skip {
    background: #ecf0f1;
    color: #7f8c8d;
}

.tutorial-btn-skip:hover {
    background: #dce1e3;
}

.tutorial-btn-next {
    background: #3498db;
    color: white;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.tutorial-btn-next:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
    transform: translateY(-1px);
}

.tutorial-btn-next:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 按钮脉动效果 */
@keyframes button-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.tutorial-btn-pulse {
    animation: button-pulse 1s ease-in-out 3;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .interactive-tutorial-panel {
        max-width: 95%;
        bottom: 10px !important;
        left: 50% !important;
        right: auto !important;
        top: auto !important;
        transform: translateX(-50%) !important;
    }
    
    .tutorial-panel-body {
        max-height: 50vh;
    }
    
    .tutorial-panel-footer {
        flex-direction: column;
    }
    
    .tutorial-btn {
        width: 100%;
    }
}

/* ==================== 弹窗标签页样式 ==================== */
.popup-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    margin: 16px 0 0 0;
}

.popup-tab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #7f8c8d;
    transition: all 0.2s ease;
    position: relative;
    top: 2px;
}

.popup-tab:hover {
    color: #2c3e50;
    background: #f8f9fa;
}

.popup-tab.active {
    color: #3498db;
    border-bottom-color: #3498db;
    background: transparent;
}

.popup-tab-content {
    position: relative;
    min-height: 200px;
    padding: 16px 0;
}

.hidden {
    display: none !important;
}

#practice-modal .popup-tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    align-items: stretch;
    padding: 8px 0 0;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.2s ease;
}

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

#practice-modal .tab-pane.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    min-width: 0;
    width: 100%;
    align-items: stretch;
    overflow: visible;
}

#practice-modal #practice-dictation-tab,
#practice-modal #practice-flashcard-tab {
    gap: 10px;
}

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

/* ==================== End of 弹窗标签页样式 ==================== */

/* ==================== Dictation & Review 浮窗样式 ==================== */

.practice-buttons-area {
    display: flex;
    gap: 12px;
    padding: 20px 15px 15px;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
}

/* 模态框浮窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(88, 138, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal-overlay[hidden] {
    display: none;
}

.modal-window {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

#practice-modal .modal-window {
    width: 95%;
    max-width: 980px;
    height: 85vh;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
    background: #f5f7fa;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #2c3e50;
    font-weight: 600;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #7f8c8d;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #2c3e50;
}

.modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
}

#practice-modal .modal-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    width: 100%;
    max-width: none;
    padding: 20px 25px;
}

#practice-modal .popup-tabs {
    margin: 16px 0 0 0;
    padding: 0;
}

#practice-modal #dictation-card,
#practice-modal #spaced-repetition-card {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow: visible;
}

.dict-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 100%;
    width: 100%;
    min-width: 0;
}

.dict-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    flex: 1;
    min-height: 0;
    min-width: 0;
}

.dict-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.dict-panel-left {
    background: #f7fbf0;
    color: #214216;
}

.dict-panel-right {
    background: #f0f7ff;
    color: #1e3a5f;
}

.dict-header {
    background: #eef4ff;
    color: #1f2d3d;
    padding: 10px 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.dict-header-title {
    font-weight: 600;
}

.dict-progress {
    font-weight: 600;
    color: inherit;
}

.dict-question {
    background: #ffffff;
    color: inherit;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e6ecf7;
    width: 100%;
    box-sizing: border-box;
}

.dict-input-area {
    background: #ffffff;
    color: inherit;
    padding: 12px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

.dict-input {
    width: 100%;
    box-sizing: border-box;
}

.dict-actions {
    background: #f3f4f6;
    color: #1f2933;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

.dict-btn,
.sr-btn {
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.dict-btn:hover,
.sr-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.dict-btn:active,
.sr-btn:active {
    transform: translateY(0);
}

.dict-btn-hint {
    background: #dbeafe;
    color: #1e3a8a;
}

.dict-btn-hint:hover {
    background: #bfdbfe;
}

.dict-btn-submit {
    background: #dcfce7;
    color: #166534;
}

.dict-btn-submit:hover {
    background: #bbf7d0;
}

.dict-btn-skip {
    background: #fee2e2;
    color: #991b1b;
}

.dict-btn-skip:hover {
    background: #fecaca;
}

.dict-btn-translate {
    background: #fce7f3;
    color: #be185d;
}

.dict-btn-translate:hover {
    background: #fbcfe8;
}

.dict-btn-primary,
.sr-btn-primary {
    background: #2563eb;
    color: #ffffff;
}

.sr-btn-secondary {
    background: #6b7280;
    color: #ffffff;
}

.dict-btn-primary:hover,
.sr-btn-primary:hover {
    background: #1d4ed8;
}

.sr-btn-secondary:hover {
    background: #4b5563;
}

.dict-stats {
    background: #f0f7ff;
    color: #1e3a5f;
    padding: 10px 12px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

.dict-feedback {
    background: #ffffff;
    color: #3d2a1f;
    padding: 10px 12px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #f0e3c2;
}

.dict-feedback-hint .dict-hint {
    background: #eef6ff;
    color: #1e3a5f;
    padding: 8px 10px;
    border-radius: 6px;
}

.dict-feedback-correct .dict-correct p:first-child,
.dict-feedback-correct .dict-feedback-detail {
    text-align: center;
    font-weight: 700;
}

.dict-completion {
    background: #f0f8ff;
    color: #1e3a5f;
    padding: 18px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    min-height: 100%;
    width: 100%;
}

.dict-completion-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.dict-completion .stat-box {
    background: #ffffff;
    color: #1f2d3d;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    border: 1px solid #e6ecf7;
}

.dict-completion .stat-box:nth-child(2) .stat-number,
.dict-completion .stat-box:nth-child(2) .stat-label {
    display: block;
    text-align: center;
    font-weight: 700;
}

.dict-completion-message {
    background: #fff7f0;
    color: #3d2a1f;
    padding: 10px 12px;
    border-radius: 8px;
    max-width: 720px;
    text-align: center;
    font-weight: 700;
}

.dict-empty {
    background: #f7f7f7;
    color: #2c3e50;
    padding: 16px;
    border-radius: 10px;
    width: 100%;
}

.sr-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 100%;
    width: 100%;
    min-width: 0;
}

.sr-card-header {
    background: #f2f5ff;
    color: #1f2d3d;
    padding: 10px 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.sr-card-content {
    background: #f8fbff;
    color: #2c3e50;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

.sr-front {
    background: #ffffff;
    color: #1f2d3d;
    padding: 30px;
    border-radius: 6px;
    border: 1px solid #e6ecf7;
    flex: 1;
    min-height: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.sr-front .sr-label {
    font-size: 14px;
    color: #888;
    margin-bottom: 15px;
}

.sr-front .sr-chinese-label {
    font-size: 13px;
    color: #666;
    margin: 0 0 10px 0;
}

.sr-front .sr-question {
    font-size: 32px;
    font-weight: bold;
    line-height: 1.5;
    margin: 10px 0 0 0;
    color: #1f2d3d;
}

.sr-back {
    background: #fff8e6;
    color: #3d2a1f;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #f0e3c2;
    margin-top: 10px;
    flex: 1;
    min-height: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sr-back .sr-label {
    text-align: center;
}

.sr-back .sr-answer {
    text-align: center;
    font-size: 34px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;}

.sr-card-stats {
    background: #f6f3ff;
    color: #3b2f59;
    padding: 10px 12px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

.sr-card-actions {
    background: #f3f4f6;
    color: #1f2933;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

.sr-btn-forgot {
    background: #fee2e2;
    color: #991b1b;
}

.sr-btn-forgot:hover {
    background: #fecaca;
}

.sr-btn-flip {
    background: #e0e7ff;
    color: #3730a3;
}

.sr-btn-flip:hover {
    background: #c7d2fe;
}

.sr-btn-remembered {
    background: #dcfce7;
    color: #166534;
}

.sr-btn-remembered:hover {
    background: #bbf7d0;
}

.sr-btn-translate {
    background: #fce7f3;
    color: #be185d;
}

.sr-btn-translate:hover {
    background: #fbcfe8;
}

.sr-tips {
    background: #f0fff4;
    color: #1f3b2d;
    padding: 10px 12px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

.sr-completion {
    background: #f4f6ff;
    color: #1f2d3d;
    padding: 18px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    min-height: 100%;
    width: 100%;
}

.sr-empty {
    background: #f7f7ff;
    color: #1f2d3d;
    padding: 18px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    min-height: 100%;
    width: 100%;
}

.sr-completion-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.sr-completion .stat-item {
    background: #ffffff;
    color: #1f2d3d;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    border: 1px solid #e6ecf7;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #588aff;
    width: 100%;
    box-sizing: border-box;
}

.stats-header > span:first-child {
    font-weight: 600;
    color: #2c3e50;
}

.dict-stats-display,
.sr-stats-display {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 13px;
    color: #555;
    min-width: 0;
}

.dict-stats-display span,
.sr-stats-display span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dict-stats-display strong,
.sr-stats-display strong {
    color: #588aff;
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 900px) {
    #practice-modal .modal-window {
        width: 98%;
        height: 90vh;
    }

    #practice-modal .modal-content {
        width: 100%;
        max-width: none;
        padding: 14px 16px;
    }

    #practice-modal .popup-tabs {
        padding: 0;
    }

    #practice-modal #practice-dictation-tab,
    #practice-modal #practice-flashcard-tab {
        padding: 10px 0 0;
    }

    .dict-body {
        grid-template-columns: 1fr;
    }

    .dict-stats-display,
    .sr-stats-display {
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* ==================== End of 浮窗样式 ==================== */

/* ==================== 导出弹窗样式 ==================== */
.export-modal-content {
    max-width: 500px;
    width: 90%;
}

.export-options {
    margin: 20px 0;
}

.export-options .form-group {
    margin-bottom: 16px;
}

.export-options label {
    display: block;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 8px;
}

.topics-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    background: #f8f9fa;
}

.topics-list label {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 6px;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: normal;
}

.topics-list label:hover {
    background: #f0f7ff;
}

.topics-list input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.export-format-options {
    display: flex;
    gap: 20px;
}

.export-format-options label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.export-format-options input[type="radio"] {
    margin-right: 6px;
    cursor: pointer;
}

/* ==================== End of 导出弹窗样式 ==================== */
/* ==================== 默写选择界面样式 ==================== */

.dict-select-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #F8F5DE 0%, #FFFBF0 100%);
    border-radius: 8px;
    overflow-y: auto;
}

.dict-select-panel h3 {
    font-size: 20px;
    color: #0f47d7;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.select-options {
    padding: 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #588aff;
}

.option-group {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    color: #0f47d7;
}

.option-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #588aff;
}

.option-group span {
    font-size: 14px;
}

.date-groups {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 8px;
}

.date-group {
    margin-bottom: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.date-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background-color: #f5f7ff;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 600;
    color: #0f47d7;
}

.date-header input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #588aff;
}

.date-header span {
    font-size: 14px;
}

.word-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    padding: 12px 15px;
    background: white;
}

.word-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
}

.word-item:hover {
    background: #e8f0ff;
    border-color: #588aff;
}

.word-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    cursor: pointer;
    accent-color: #588aff;
}

.word-item span {
    font-size: 13px;
    color: #0f47d7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.select-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    border-top: 2px solid #588aff;
    gap: 15px;
}

.shuffle-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    color: #0f47d7;
}

.shuffle-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: #588aff;
}

.shuffle-option span {
    font-size: 14px;
}

.start-btn {
    padding: 10px 25px;
    background: linear-gradient(135deg, #588aff 0%, #4a7ae8 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(88, 138, 255, 0.3);
}

.start-btn:hover {
    background: linear-gradient(135deg, #4a7ae8 0%, #3968d6 100%);
    box-shadow: 0 4px 12px rgba(88, 138, 255, 0.4);
    transform: translateY(-2px);
}

.start-btn:active {
    transform: translateY(0);
}

/* ==================== End of 默写选择界面样式 ==================== */

/* ==================== 翻译模态框样式 ==================== */
.translation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 4000;
    padding: 20px;
}

.translation-modal.visible {
    display: flex;
}

.translation-modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-height: 80vh;
    overflow-y: auto;
}

.translation-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    border: none;
    background: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

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

.translation-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 16px;
    word-break: break-word;
}

.translation-modal-body {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.translation-loading {
    text-align: center;
    color: #999;
    font-style: italic;
}

.translation-error {
    color: #d32f2f;
    padding: 12px;
    background-color: #ffebee;
    border-radius: 4px;
    border-left: 4px solid #d32f2f;
}

/* ==================== End of 翻译模态框样式 ==================== */

/* ==================== 错词/forgotten卡片展示样式 ==================== */
.dict-error-summary,
.sr-forgotten-summary {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.dict-error-summary h3,
.sr-forgotten-summary h3 {
    margin: 0 0 12px 0;
    color: #856404;
    font-size: 16px;
    font-weight: 600;
}

.dict-error-words-list,
.sr-forgotten-words-list {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dict-error-word-tag,
.sr-forgotten-word-tag {
    display: inline-block;
    background: #fff8e1;
    border: 1px solid #ffe082;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    color: #856404;
    font-weight: 500;
}

.dict-error-word-tag:hover,
.sr-forgotten-word-tag:hover {
    background: #ffd54f;
    cursor: default;
}

/* ==================== End of 错词/forgotten卡片展示样式 ==================== */

/* ==================== 音标和发音按钮样式 ==================== */
.dict-hint-phonetic,
.sr-phonetic-section {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.phonetic {
    font-size: 14px;
    font-style: italic;
    color: #666;
    font-weight: 500;
}

.audio-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
}

.audio-btn:hover:not(:disabled) {
    background-color: rgba(0, 0, 0, 0.1);
    transform: scale(1.15);
}

.audio-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== End of 音标和发音按钮样式 ==================== */

/* ==================== Collocations样式（闪卡反面） ==================== */
.sr-collocations {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.collocation-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.collocation-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.collocation-tag {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
    transition: all 0.2s ease;
}

.collocation-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* ==================== End of Collocations样式 ==================== */

.audio-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.audio-btn.audio-loading {
    animation: pulse 0.6s infinite;
}

.audio-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==================== End of 音标和发音按钮样式 ==================== */

/* ==================== 闪卡选择界面样式 ==================== */

.sr-select-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #F8F5DE 0%, #FFFBF0 100%);
    border-radius: 8px;
    overflow-y: auto;
}

.sr-select-panel h3 {
    font-size: 20px;
    color: #0f47d7;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.sr-select-mode {
    padding: 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #588aff;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mode-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    color: #0f47d7;
}

.mode-option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #588aff;
}

.mode-option span {
    font-size: 14px;
}

.sr-select-options {
    padding: 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #588aff;
}

.sr-option-group {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    color: #0f47d7;
}

.sr-option-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #588aff;
}

.sr-option-group span {
    font-size: 14px;
}

.sr-date-groups {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 8px;
}

.sr-date-group {
    margin-bottom: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sr-date-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background-color: #f5f7ff;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 600;
    color: #0f47d7;
}

.sr-date-header input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #588aff;
}

.sr-date-header span {
    font-size: 14px;
}

.sr-word-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    padding: 12px 15px;
    background: white;
}

.sr-word-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
}

.sr-word-item:hover {
    background: #e8f0ff;
    border-color: #588aff;
}

.sr-word-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    cursor: pointer;
    accent-color: #588aff;
}

.sr-word-item span {
    font-size: 13px;
    color: #0f47d7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sr-select-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    border-top: 2px solid #588aff;
    gap: 15px;
}

.sr-start-btn {
    padding: 10px 25px;
    background: linear-gradient(135deg, #588aff 0%, #4a7ae8 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(88, 138, 255, 0.3);
}

.sr-start-btn:hover {
    background: linear-gradient(135deg, #4a7ae8 0%, #3968d6 100%);
    box-shadow: 0 4px 12px rgba(88, 138, 255, 0.4);
    transform: translateY(-2px);
}

.sr-start-btn:active {
    transform: translateY(0);
}

/* ==================== End of 闪卡选择界面样式 ==================== */