/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 5px;
    box-sizing: border-box;
    overflow: hidden;
}



/* 功能区域网格布局 */
.functions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 5px;
    height: calc(100vh - 10px);
    width: 100%;
}

/* 功能区域基础样式 */
.function-area {
    position: relative;
    cursor: move;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.function-area:hover {
    transform: scale(1.01);
    z-index: 10;
}

.function-area.dragging {
    z-index: 1000;
    transform: rotate(2deg) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    opacity: 0.5;
}

.function-area.drag-over {
    border: 3px solid #667eea;
    transform: scale(1.02);
    background: rgba(102, 126, 234, 0.1);
}

/* 不同功能区域的背景颜色 */
.translator-area .card {
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    border-left: 4px solid #2196f3;
}

.notepad-area .card {
    background: linear-gradient(135deg, #fff3e0, #fce4ec);
    border-left: 4px solid #ff9800;
}

.ocr-area .card {
    background: linear-gradient(135deg, #e8f5e8, #e0f2f1);
    border-left: 4px solid #4caf50;
}

.tasks-area .card {
    background: linear-gradient(135deg, #fff8e1, #f1f8e9);
    border-left: 4px solid #ff9800;
}

.bookmarks-area .card {
    background: linear-gradient(135deg, #f3e5f5, #e8eaf6);
    border-left: 4px solid #9c27b0;
}

.notebook-area .card {
    background: linear-gradient(135deg, #e1f5fe, #f0f8ff);
    border-left: 4px solid #03a9f4;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.6rem;
}

/* 翻译卡片特殊样式 */
.translator-card h2 {
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.card h2 i {
    margin-right: 10px;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn.secondary {
    background: #f8f9fa;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn.secondary:hover {
    background: #667eea;
    color: white;
}

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

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}



/* 任务表单按钮居中 */
.task-form-actions {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

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

input,
textarea,
select {
    width: 100%;
    padding: 8px;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
    background: #f8f9fa;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

textarea {
    min-height: 80px;
    resize: vertical;
    flex-grow: 1;
}

/* 翻译工具样式 */
/* 翻译工具容器包装 */
.translator-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: linear-gradient(135deg, #f5f7ff 0%, #e3eeff 100%);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
    max-height: calc(100vh - 100px);
    /* 确保在视口内有足够空间 */
}

/* 翻译工具主容器 */
.translator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    /* 减少间距以增加可用空间 */
    align-items: start;
    flex: 1;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    padding-bottom: 12px;
    /* 减少内边距 */
    margin-bottom: 12px;
    /* 减少外边距 */
    position: relative;
    min-height: 300px;
    /* 确保最小高度 */
}

/* 添加分隔线装饰 */
.translator-container:after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(to right,
            rgba(102, 126, 234, 0),
            rgba(102, 126, 234, 0.5),
            rgba(102, 126, 234, 0));
}

/* 按钮容器 */
.translate-btn-container {
    display: flex;
    flex-direction: row;
    gap: 15px;
    justify-content: center;
    align-items: center;
    padding: 8px 0;
    margin-top: -5px;
    /* 减少与上方内容的间距 */
}

/* 按钮样式优化 */
.translate-btn-container .btn {
    min-width: 110px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
}

.translate-btn-container .btn.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: white;
}

.translate-btn-container .btn.primary:hover {
    background: linear-gradient(135deg, #5a70d6, #6a43a0);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.translate-btn-container .btn.primary:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

.translate-btn-container .btn.secondary {
    border: 2px solid #667eea;
    background: rgba(255, 255, 255, 0.8);
    color: #667eea;
}

.translate-btn-container .btn.secondary:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

.translate-btn-container .btn.secondary:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.2);
}

.input-section,
.output-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
    /* 减少垂直间距 */
    height: 100%;
}

/* 优化语言选择器 */
.input-section label,
.output-section label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 2px;
}

.input-section select,
.output-section select {
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(102, 126, 234, 0.3);
    font-size: 0.85rem;
    color: #555;
    cursor: pointer;
    transition: all 0.3s ease;
    width: auto;
    max-width: 100%;
    margin-bottom: 5px;
}

/* 优化翻译区域的文本框 */
.input-section textarea,
.output-section textarea {
    flex: 1;
    min-height: 250px;
    /* 进一步增加高度 */
    padding: 12px;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05), 0 3px 10px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    resize: none;
    /* 防止用户调整大小 */
    height: 100%;
    /* 确保填满容器 */
}

.input-section textarea:focus,
.output-section textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2), inset 0 2px 5px rgba(0, 0, 0, 0.05), 0 5px 15px rgba(102, 126, 234, 0.1);
    background: #fff;
    transform: translateY(-2px);
}

.output-section textarea {
    background: rgba(248, 249, 250, 0.8);
    border-color: rgba(102, 126, 234, 0.2);
}

/* 添加占位符文本样式 */
.input-section textarea::placeholder,
.output-section textarea::placeholder {
    color: #aab7c4;
    opacity: 0.8;
    font-style: italic;
}

/* 添加滚动条样式 */
.input-section textarea::-webkit-scrollbar,
.output-section textarea::-webkit-scrollbar {
    width: 8px;
}

.input-section textarea::-webkit-scrollbar-track,
.output-section textarea::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 4px;
}

.input-section textarea::-webkit-scrollbar-thumb,
.output-section textarea::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 4px;
}

.input-section textarea::-webkit-scrollbar-thumb:hover,
.output-section textarea::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* OCR头部样式 */
.ocr-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ocr-header h2 {
    margin: 0;
    flex: 1;
}

.ocr-settings {
    display: flex;
    align-items: center;
}

.auto-extract-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #555;
    cursor: pointer;
    user-select: none;
}

.auto-extract-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
}

.toggle-text {
    font-weight: 500;
}

/* OCR样式 */
.ocr-container {
    display: flex;
    gap: 12px;
    height: calc(100% - 45px);
}

/* 左侧输入区域 */
.ocr-input-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.upload-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

/* 右侧结果区域 */
.ocr-result-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

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

.result-header label {
    margin: 0;
    font-size: 0.9rem;
    font-weight: bold;
    color: #555;
}

.ocr-result-section textarea {
    flex: 1;
    min-height: 150px;
    resize: none;
}

.drop-zone {
    border: 2px dashed #667eea;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: #764ba2;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
    transform: scale(1.01);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.drop-zone-icon {
    font-size: 2rem;
    color: #667eea;
}

.drop-zone p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.compact-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
}

.paste-section {
    text-align: center;
}

.preview-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

.image-preview-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f8f9fa;
    min-height: 150px;
    overflow: hidden;
}

.image-preview-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.preview-section .btn.primary {
    align-self: center;
    padding: 8px 16px;
    font-weight: 500;
    flex-shrink: 0;
}

/* 任务标题区域样式 */
.tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline; /* 改为基线对齐 */
    margin-bottom: 15px;
    flex-wrap: nowrap;
    gap: 15px;
}

.tasks-header h2 {
    margin: 0;
    flex-shrink: 0;
}

.tasks-header-controls {
    display: flex;
    align-items: baseline; /* 改为基线对齐 */
    gap: 15px;
    flex-wrap: nowrap;
    flex-shrink: 0; /* 防止压缩 */
}

/* 任务按钮容器 */
.task-buttons {
    display: flex;
    align-items: baseline; /* 改为基线对齐 */
    gap: 8px;
}

/* 生成周报按钮样式 */
.generate-report-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: 1px solid transparent; /* 统一边框处理 */
    border-radius: 16px;
    padding: 0 14px;
    height: 32px; /* 固定高度与排序按钮一致 */
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    display: inline-flex; /* 改为inline-flex */
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    box-sizing: border-box;
    vertical-align: baseline; /* 明确基线对齐 */
}

.generate-report-btn:hover {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2, #667eea);
}

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



/* 字段提示文本 */
.field-hint {
    color: #666;
    font-style: italic;
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
}

/* 添加任务按钮容器 */
.tasks-container {
    position: relative;
}

.tasks-container > .btn {
    margin: 15px auto;
    display: block;
}



/* 快速添加按钮样式 */
.quick-add-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: 1px solid transparent; /* 统一边框处理 */
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex; /* 改为inline-flex */
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    flex-shrink: 0;
    box-sizing: border-box;
    vertical-align: baseline; /* 明确基线对齐 */
}

.quick-add-btn:hover {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2, #667eea);
}

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

/* 任务列表样式 */
.tasks-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.add-task-section {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    flex-shrink: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.3s ease;
    will-change: opacity, transform;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.2);
    max-height: 200px; /* 设置添加任务区域的最大高度 */
}

/* 当添加任务区域隐藏时 */
.add-task-section.hidden {
    max-height: 0;
    padding: 0 15px;
    margin-bottom: 0;
    opacity: 0;
    transform: translateY(-10px);
}

/* 模式切换动画 */
.mode-transition {
    opacity: 0.6;
    transform: scale(0.98);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mode-transition .form-group {
    transition: all 0.3s ease;
}

.add-task-section h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1rem;
}

.tasks-list {
    flex-grow: 1;
    overflow-y: auto;
    width: 100%;
    padding-right: 5px; /* 为滚动条留出空间 */
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: max-height 0.3s ease; /* 添加高度变化的过渡动画 */
    /* 默认高度：当添加任务区域显示时的高度 */
    max-height: 300px; /* 基础高度 */
}

/* 当添加任务区域隐藏时 */
.tasks-container.add-section-hidden .tasks-list {
    max-height: 500px; /* 利用添加任务区域腾出的空间 */
}

/* 自定义滚动条样式 */
.tasks-list::-webkit-scrollbar {
    width: 6px;
}

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

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

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

.sorting-options {
    display: flex;
    align-items: baseline; /* 改为基线对齐 */
    gap: 8px;
    flex-wrap: wrap;
}

.sorting-options label {
    color: #333;
    font-weight: 500;
    font-size: 14px;
    margin: 0 3px 0 0;
    white-space: nowrap;
    line-height: 32px; /* 与按钮高度一致 */
    display: inline-block; /* 改为inline-block */
    vertical-align: baseline; /* 明确基线对齐 */
}

.sort-btn {
    height: 32px; /* 固定高度与生成周报按钮一致 */
    display: inline-flex; /* 改为inline-flex */
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1;
    box-sizing: border-box;
    border: 1px solid #e9ecef; /* 统一边框 */
    background: #f8f9fa;
    color: #667eea;
    transition: all 0.3s ease;
    cursor: pointer;
    vertical-align: baseline; /* 明确基线对齐 */
}

.sort-btn:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

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

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
}

.task-item {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.task-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.task-item.completed {
    opacity: 0.7;
    text-decoration: line-through;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.task-title {
    font-weight: bold;
    font-size: 1.1rem;
    color: #333;
}

.task-badges {
    display: flex;
    gap: 8px;
}

.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
}

.badge.difficulty-1 {
    background: #28a745;
}

.badge.difficulty-2 {
    background: #ffc107;
    color: #333;
}

.badge.difficulty-3 {
    background: #fd7e14;
}

.badge.difficulty-4 {
    background: #dc3545;
}

.badge.implementation-1 {
    background: #17a2b8;
}

.badge.implementation-2 {
    background: #6f42c1;
}

.badge.implementation-3 {
    background: #e83e8c;
}

.badge.implementation-4 {
    background: #6c757d;
}

.task-deadline {
    color: #666;
    font-size: 0.9rem;
}

.task-deadline.urgent {
    color: #dc3545;
    font-weight: bold;
}

.task-actions {
    margin-top: 10px;
    display: flex;
    justify-content: center;
}

.task-actions .btn {
    padding: 5px 10px;
    font-size: 0.9rem;
    margin-right: 10px;
}

/* 书签头部样式 */
.bookmarks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.bookmarks-header h2 {
    margin: 0;
    flex: 1;
}

.bookmark-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 书签样式 */
.add-bookmark-section {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    flex-shrink: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.3s ease;
    will-change: opacity, transform;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.add-bookmark-section h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1rem;
}

/* 颜色选择样式 */
.color-selection-group {
    margin-bottom: 12px;
}

.color-selection-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    color: #555;
    font-size: 0.85rem;
}

.color-options {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.color-preset {
    width: 28px;
    height: 28px;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
}

.color-preset:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.color-preset.active {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
    transform: scale(1.1);
}

.color-preset.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 12px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.custom-color {
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.custom-color input[type="color"] {
    position: absolute;
    top: -2px;
    left: -2px;
    width: 32px;
    height: 32px;
    border: none;
    opacity: 0;
    cursor: pointer;
}

.custom-color::before {
    content: '🎨';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    color: #555;
}

/* 添加网站按钮样式 */
.bookmark-form-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 10px;
}

.add-bookmark-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
}

.bookmarks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.bookmark-item {
    position: relative;
    border-radius: 10px;
    padding: 20px;
    color: white;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.bookmark-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    color: white;
}

.bookmark-delete {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    color: white;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bookmark-item:hover .bookmark-delete {
    opacity: 1;
}

.bookmark-delete:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 记事本样式 */
.notepad-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.notepad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-shrink: 0;
}

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

.notepad-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
    height: 100%;
}

.note-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-grow: 1;
}

#notepad1,
#notepad2 {
    min-height: 200px;
    resize: vertical;
    flex-grow: 1;
}

.compare-mode .notepad-container {
    flex-direction: row;
    gap: 10px;
}

.compare-mode .note-section {
    flex: 1;
}

.compare-mode #notepad1,
.compare-mode #notepad2 {
    min-height: 150px;
}

.notepad-controls .btn {
    padding: 5px 8px;
    font-size: 0.8rem;
}

/* 紧凑布局优化 - 已移至卡片样式部分 */

.card h2 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.card h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    flex-shrink: 0;
}

/* 翻译工具紧凑布局 */
.translator-container {
    display: grid;
    grid-template-areas:
        "input output"
        "buttons buttons";
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto;
    gap: 10px;
    height: 100%;
}

.input-section {
    grid-area: input;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.output-section {
    grid-area: output;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.translate-btn-container {
    grid-area: buttons;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.input-section textarea,
.output-section textarea {
    flex-grow: 1;
    min-height: 120px;
}

/* OCR区域优化 */
.ocr-container {
    flex-direction: column;
    gap: 10px;
}

.ocr-input-section {
    flex: none;
}

.ocr-result-section {
    flex: 1;
}

.drop-zone {
    padding: 15px;
    min-height: 100px;
}

.drop-zone-icon {
    font-size: 1.5rem;
}

.drop-zone p {
    font-size: 0.8rem;
}

.compact-btn {
    padding: 5px 10px;
    font-size: 0.8rem;
}

    .image-preview-container {
        min-height: 120px;
    }

    .ocr-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .auto-extract-toggle {
        font-size: 0.8rem;
}

/* 表单优化 */
.form-row {
    display: flex;
    gap: 5px;
}

.form-row .form-group {
    flex: 1;
}

.sorting-options {
    margin-bottom: 10px;
    gap: 3px;
    flex-wrap: wrap;
}

.sort-btn {
    padding: 3px 6px;
    font-size: 0.8rem;
}

/* 任务项优化 */
.task-item {
    padding: 10px;
    margin-bottom: 8px;
}

.task-title {
    font-size: 0.9rem;
}

.task-actions .btn {
    padding: 3px 6px;
    font-size: 0.8rem;
}

/* 书签网格优化 */
    .bookmarks-header {
        flex-direction: row;
        align-items: center;
    }

.bookmarks-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    flex-grow: 1;
}

    .color-options {
        gap: 6px;
    }

    .color-preset {
        width: 26px;
        height: 26px;
    }
    
    .custom-color {
        width: 26px;
        height: 26px;
    }

.bookmark-item {
    padding: 10px;
    font-size: 0.9rem;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bookmarks-container {
    height: calc(100% - 45px);
    display: flex;
    flex-direction: column;
}

/* 拖拽占位符 */
.drag-placeholder {
    opacity: 0.8;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.8;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        opacity: 0.8;
    }
}

/* 响应式设计 - 优化布局确保一屏显示完所有功能 */
@media (max-width: 1024px) {
    .functions-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr 1fr;
        gap: 4px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 3px;
    }

    .functions-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr 1fr;
        gap: 3px;
        height: calc(100vh - 6px);
    }

    .function-area {
        min-height: auto;
    }

    /* 为小屏幕优化卡片内容 */
    .card {
        padding: 8px;
    }

    .card h2 {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .translator-container {
        grid-template-areas:
            "input"
            "output"
            "buttons";
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr auto;
    }

    .form-row {
        flex-direction: column;
        gap: 8px;
    }

    .sorting-options {
        justify-content: center;
    }

    .bookmarks-grid {
        grid-template-columns: 1fr;
    }

    .notepad-controls {
        flex-direction: column;
        gap: 5px;
    }

    .compare-mode .notepad-container {
        flex-direction: column;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.notification.success {
    background: #28a745;
}

.notification.error {
    background: #dc3545;
}

.notification.info {
    background: #17a2b8;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== 笔记本功能样式 ===== */

/* 笔记本头部布局 */
.notebook-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.notebook-header h2 {
    margin: 0;
    font-size: 1.4rem;
    flex-shrink: 0;
}

/* 头部控制区 */
.notebook-header-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

/* 紧凑搜索框 */
.note-search-compact {
    width: 140px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.note-search-compact:focus {
    width: 180px;
    border-color: #03a9f4;
    box-shadow: 0 0 0 2px rgba(3, 169, 244, 0.2);
}

/* 紧凑按钮样式 */
.btn.compact {
    padding: 6px 10px;
    font-size: 0.85rem;
    min-width: 60px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    font-weight: 500;
}

/* 笔记本容器布局 */
.notebook-container {
    display: flex;
    height: calc(100% - 55px);
    gap: 8px;
    position: relative;
}

/* 左侧侧边栏 */
.notebook-sidebar {
    width: 220px;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    padding: 8px;
    border: 1px solid rgba(3, 169, 244, 0.2);
    transition: all 0.3s ease;
    overflow: hidden;
}

/* 折叠状态的侧边栏 */
.notebook-sidebar.collapsed {
    width: 0;
    min-width: 0;
    padding: 0;
    border: none;
    opacity: 0;
}

.btn.small {
    padding: 4px 8px;
    font-size: 0.75rem;
    min-width: auto;
    border-radius: 4px;
}

.btn.danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.btn.danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

/* 笔记列表 */
.notes-list {
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 180px);
}

.empty-notes {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.9rem;
}

.empty-notes i {
    font-size: 2rem;
    color: #03a9f4;
    margin-bottom: 10px;
    display: block;
}

/* 笔记项 */
.note-item {
    padding: 10px;
    margin-bottom: 8px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid #03a9f4;
}

.note-item:hover {
    background: #f8f9fa;
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(3, 169, 244, 0.15);
}

.note-item.active {
    background: linear-gradient(135deg, #e1f5fe, #f0f8ff);
    border-color: #03a9f4;
    box-shadow: 0 3px 12px rgba(3, 169, 244, 0.25);
}

.note-item-title {
    font-weight: bold;
    color: #333;
    font-size: 0.9rem;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-item-preview {
    color: #666;
    font-size: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 5px;
}

.note-item-date {
    color: #999;
    font-size: 0.7rem;
}

/* 右侧内容区域 */
.notebook-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 欢迎页面 */
.note-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #666;
}

.note-welcome i {
    font-size: 3rem;
    color: #03a9f4;
    margin-bottom: 20px;
}

.note-welcome h3 {
    color: #333;
    margin-bottom: 15px;
}

.note-welcome ul {
    text-align: left;
    margin-top: 20px;
}

.note-welcome li {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

/* 笔记编辑器 */
.note-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    padding: 12px;
    border: 1px solid rgba(3, 169, 244, 0.2);
}

/* 笔记头部 */
.note-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.note-title-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    background: white;
}

.note-actions {
    display: flex;
    gap: 8px;
}

/* 笔记内容区域 */
.note-content-area {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: none;
    background: white;
    min-height: 150px;
}

.note-content-area:focus {
    outline: none;
    border-color: #03a9f4;
    box-shadow: 0 0 0 2px rgba(3, 169, 244, 0.2);
}

/* 笔记信息栏 */
.note-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #e9ecef;
    font-size: 0.75rem;
    color: #666;
    flex-shrink: 0;
}

/* 搜索高亮 */
.highlight {
    background-color: yellow;
    font-weight: bold;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .notebook-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .notebook-header-controls {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 6px;
    }

    .note-search-compact {
        width: 100%;
        min-width: 120px;
        order: -1;
        margin-bottom: 4px;
    }

    .note-search-compact:focus {
        width: 100%;
    }

    .notebook-container {
        flex-direction: column;
        height: calc(100% - 75px);
    }

    .notebook-sidebar {
        width: 100%;
        min-width: auto;
        max-height: 150px;
        order: 2;
    }

    .notebook-sidebar.collapsed {
        max-height: 0;
        padding: 0;
    }

    .notebook-content {
        order: 1;
        flex: 1;
    }

    .btn.compact {
        padding: 8px 12px;
        font-size: 0.8rem;
        flex: 1;
        min-width: 80px;
    }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
    .notebook-header h2 {
        font-size: 1.2rem;
    }
    
    .btn.compact {
        padding: 6px 8px;
        font-size: 0.75rem;
        min-width: 70px;
    }
    
    .note-search-compact {
        font-size: 0.75rem;
        padding: 6px 8px;
    }
    
    .color-preset, .custom-color {
        width: 24px;
        height: 24px;
    }
    
    .color-options {
        gap: 5px;
    }
    
    .add-bookmark-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .drop-zone {
        padding: 12px;
        min-height: 80px;
    }
    
    .drop-zone-icon {
        font-size: 1.2rem;
    }
    
    .compact-btn {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    .image-preview-container {
        min-height: 100px;
    }
}

/* 极小屏幕适配（手机竖屏等） - 确保一屏显示所有功能 */
@media (max-width: 480px) {
    .container {
        padding: 2px;
    }

    .functions-grid {
        gap: 2px;
        height: calc(100vh - 4px);
    }

    .card {
        padding: 6px;
    }

    .card h2 {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }

    /* 进一步压缩表单元素间距 */
    .form-group {
        margin-bottom: 4px;
    }

    /* 优化按钮大小 */
    .btn {
        padding: 4px 8px;
        font-size: 0.8rem;
    }

    /* 优化输入框 */
    input,
    textarea,
    select {
        font-size: 0.85rem;
        padding: 4px;
    }
}

/* 设置按钮样式 */
.settings-panel {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 9999;
}

.settings-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 18px;
    color: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-btn:hover {
    background: #667eea;
    color: white;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
}

.settings-section {
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.settings-section h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-section p {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.danger-zone {
    border: 2px solid #ff4757;
    background: #fff5f5;
}

.danger-zone h3 {
    color: #ff4757;
}

/* 系统信息样式 */
.system-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 5px;
}

.info-item .label {
    font-weight: 600;
    color: #555;
}

.info-item .value {
    color: #333;
    font-family: monospace;
}

/* 按钮样式扩展 */
.btn.danger {
    background: linear-gradient(135deg, #ff4757, #ff3742);
    color: white;
}

.btn.danger:hover {
    background: linear-gradient(135deg, #ff3742, #ff2837);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .settings-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .modal-content {
        margin: 10% auto;
        width: 95%;
    }

    .modal-header {
        padding: 15px;
    }

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

    .modal-body {
        padding: 15px;
    }

    .system-info {
        grid-template-columns: 1fr;
    }
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

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

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

.report-step h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1rem;
    font-weight: 600;
}

.task-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.task-selection-header h4 {
    margin: 0;
    flex: 1;
}

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

.task-selection-controls .btn.small {
    padding: 4px 12px;
    font-size: 0.85rem;
    border-radius: 4px;
}

.task-selection-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
}

.task-selection-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.2s;
}

.task-selection-item:hover {
    background: #f8f9fa;
}

.task-selection-item:last-child {
    border-bottom: none;
}

.task-selection-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
}

.task-selection-info {
    flex: 1;
}

.task-selection-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.task-selection-meta {
    font-size: 0.85rem;
    color: #666;
    display: flex;
    gap: 10px;
}

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

.generation-status {
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

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

.generation-status p {
    color: #666;
    font-size: 1rem;
    margin: 0;
}

.report-preview {
    margin-bottom: 20px;
}

.report-preview textarea {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.9rem;
    line-height: 1.6;
    resize: vertical;
    background: #f8f9fa;
}

/* 周报弹窗响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
        margin: 5px 0;
    }
    
    .task-buttons {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .generate-report-btn {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    
    .tasks-header {
        flex-wrap: wrap;
        align-items: flex-start;
    }
    
    .tasks-header-controls {
        flex-wrap: wrap;
        width: 100%;
        justify-content: flex-end;
    }
    
    .sorting-options {
        order: 1;
    }
    
    .task-buttons {
        order: 2;
    }
    
    .task-selection-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .task-selection-controls {
        width: 100%;
        justify-content: flex-end;
    }
    
    .task-selection-controls .btn.small {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
    .tasks-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .tasks-header h2 {
        text-align: center;
        margin-bottom: 5px;
    }
    
    .tasks-header-controls {
        justify-content: center;
        flex-direction: column;
        gap: 10px;
    }
    
    .sorting-options {
        justify-content: center;
    }
    
    .task-buttons {
        justify-content: center;
    }
}

/* 排序选项容器样式 */
.sort-options-container {
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-radius: 10px;
    margin-top: 8px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12);
    padding: 0;
    width: max-content;
    min-width: 140px;
    position: absolute;
    z-index: 100;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transform: translateY(-10px) translateX(-50%);
}

/* 展开状态的排序选项 */
.sort-options-container.expanded {
    max-height: 220px; /* 增加高度以适应垂直排列 */
    padding: 10px;
    opacity: 1;
    border: 1px solid rgba(102, 126, 234, 0.3);
    transform: translateY(0) translateX(-50%);
}

/* 排序选项垂直排列 */
.sort-options-container label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    color: #555;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    text-align: center;
}

/* 排序按钮垂直排列 */
.sort-options-container .sort-btn {
    display: block;
    width: 100%;
    text-align: left;
    margin: 6px 0;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid transparent;
    font-size: 0.95rem;
}

.sort-options-container .sort-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateX(3px);
    border-color: rgba(102, 126, 234, 0.2);
}

.sort-options-container .sort-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(102, 126, 234, 0.3);
}

.sort-options-container .sort-btn.active::before {
    content: "✓ ";
    font-weight: bold;
}

/* 排序按钮容器定位 */
.sorting-options {
    position: relative;
}

/* 排序切换按钮 */
#toggle-sort-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #555;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 20px;
}

#toggle-sort-btn:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.2);
}

#toggle-sort-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
}

/* 添加排序按钮图标旋转动画 */
@keyframes rotateIcon {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

#toggle-sort-btn.active::before {
    content: "🔄";
    display: inline-block;
    margin-right: 5px;
    animation: rotateIcon 1s linear;
}

/* 文本对比相关样式 */
.comparison-result {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 10px;
}

.comparison-header h3 {
    margin: 0;
    color: #667eea;
    font-size: 1.1rem;
}

.cer-result {
    font-weight: bold;
}

.cer-result span {
    color: #667eea;
    font-size: 1.2rem;
}

.comparison-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #eaeaea;
}

.comparison-stats .stat-item {
    font-size: 0.9rem;
    color: #555;
}

.comparison-stats .stat-item span {
    font-weight: bold;
    color: #333;
    margin-left: 5px;
}

.text-comparison {
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #eaeaea;
    border-radius: 6px;
    background: #fff;
    max-height: 300px;
    overflow-y: auto;
}

.comparison-line {
    display: flex;
    margin-bottom: 10px;
    font-family: monospace;
    line-height: 1.8;
}

.comparison-label {
    flex: 0 0 80px;
    font-weight: bold;
    color: #666;
}

.comparison-text {
    flex: 1;
    white-space: pre-wrap;
    word-break: break-all;
}

/* 字符颜色标记 */
.char-equal {
    color: #333;
}

.char-substitution {
    color: #f57c00;
    background-color: rgba(245, 124, 0, 0.1);
    text-decoration: line-through;
    padding: 0 2px;
}

.char-insertion {
    color: #d32f2f;
    background-color: rgba(211, 47, 47, 0.1);
    text-decoration: underline;
    padding: 0 2px;
}

.char-deletion {
    color: #388e3c;
    background-color: rgba(56, 142, 60, 0.1);
    padding: 0 2px;
}

/* 图例 */
.legend {
    font-size: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.legend div {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.sample {
    display: inline-block;
    margin-right: 5px;
    padding: 2px 5px;
}

/* 比较按钮样式 */
#compare-texts-btn {
    display: block;
    margin: 15px auto;
    padding: 8px 20px;
}

/* 对比模式下的布局调整 */
.compare-mode .notepad-container {
    flex-direction: column;
}

.compare-mode .note-section {
    margin-bottom: 15px;
}

/* 比较容器 */
.compare-container {
    margin-top: 20px;
    width: 100%;
}

#compare-texts-btn {
    display: block;
    margin: 0 auto 15px;
    padding: 10px 25px;
    font-size: 1rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
}

#compare-texts-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

#compare-texts-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.4);
}

/* 改进对比模式下的布局 */
.compare-mode .notepad-container {
    flex-direction: column;
}

.compare-mode .note-section {
    flex: none;
    margin-bottom: 15px;
}

.compare-mode #notepad1,
.compare-mode #notepad2 {
    height: 200px;
    min-height: 150px;
}