/* ==================== 自定义样式 ==================== */
/* 基础组件样式 */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s ease;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    transition: all 0.3s ease;
}
.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(240, 147, 251, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    transition: all 0.3s ease;
}
.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(74, 222, 128, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    transition: all 0.3s ease;
}
.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(251, 191, 36, 0.3);
}

.btn-traditional {
    background: linear-gradient(135deg, #f97316 0%, #dc2626 100%);
    transition: all 0.3s ease;
}
.btn-traditional:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(249, 115, 22, 0.3);
}

.btn-simplified {
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
    transition: all 0.3s ease;
}
.btn-simplified:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(14, 165, 233, 0.3);
}

.btn-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    transition: all 0.3s ease;
}
.btn-blue:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.btn-cyan {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    transition: all 0.3s ease;
}
.btn-cyan:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(6, 182, 212, 0.3);
}

.btn-pink {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    transition: all 0.3s ease;
}
.btn-pink:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(236, 72, 153, 0.3);
}

.btn-teal {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    transition: all 0.3s ease;
}
.btn-teal:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(20, 184, 166, 0.3);
}

.btn-orange {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    transition: all 0.3s ease;
}
.btn-orange:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(249, 115, 22, 0.3);
}

/* Word粘贴按钮样式 */
.btn-word {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    transition: all 0.3s ease;
}

.btn-word:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(33, 150, 243, 0.3);
}

/* 工具提示样式 */
.tooltip-container {
    position: relative;
    display: inline-block;
}

.tooltip-container .tooltip-text {
    visibility: hidden;
    background-color: #4a5568;
    color: white;
    text-align: center;
    border-radius: 4px;
    padding: 5px 10px;
    position: absolute;
    z-index: 100;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* 结果文本区域 */
.result-textarea {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    line-height: 1.6;
    font-size: 14px;
}

/* 预览区域 */
.preview-area {
    border: 1px dashed #cbd5e0;
    border-radius: 8px;
    min-height: 200px;
    padding: 1rem;
    background-color: #f8fafc;
}

/* 移动菜单 */
.mobile-menu {
    transition: all 0.3s ease;
}

.mobile-menu.hidden {
    transform: translateX(-100%);
}

/* 设置面板 */
.settings-panel {
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

.settings-panel.active {
    max-height: 500px;
}

/* 草稿管理面板 */
.draft-manager-panel {
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

.draft-manager-panel.active {
    max-height: 500px;
}

/* 草稿列表样式 */
.draft-list-container {
    max-height: 300px;
    overflow-y: auto;
    background-color: #f9fafb;
}

.draft-item {
    transition: all 0.2s ease;
    border-left: 4px solid #e5e7eb;
}

.draft-item:hover {
    background-color: #f3f4f6;
    border-left-color: #3b82f6;
}

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

/* 简繁体按钮激活状态 */
.btn-traditional.active, .btn-simplified.active {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5), 0 10px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

/* 卡片阴影效果 */
.card-shadow {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* 自定义滚动条 */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 编辑器容器样式 */
#editor-container.editor-wrapper {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background-color: white;
}

/* 标签样式 */
.status-tag {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    margin-right: 5px;
    margin-bottom: 5px;
}

/* 徽章样式 */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 5px;
}

.status-badge-success {
    background-color: #10b981;
    color: white;
}

.status-badge-warning {
    background-color: #f59e0b;
    color: white;
}

.status-badge-info {
    background-color: #3b82f6;
    color: white;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease-out;
}

/* 按钮组样式 */
.btn-group-container {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.btn-group-container button {
    flex: 1;
    border: none;
    border-right: 1px solid #e2e8f0;
    padding: 10px 15px;
    background: white;
    transition: all 0.3s ease;
}

.btn-group-container button:last-child {
    border-right: none;
}

.btn-group-container button:hover {
    background: #f7fafc;
}

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

/* 统计卡片样式 */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* 进度条样式 */
.progress-bar-container {
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* 编辑器状态指示器 */
.editor-status-bar {
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 16px;
    font-size: 12px;
    color: #64748b;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-status-indicator {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background-color: #10b981;
}

.status-dot.offline {
    background-color: #ef4444;
}

/* 编辑器选中文本样式优化 */
#editor-container.editor-wrapper .tox-tinymce .tox-edit-area__iframe {
    font-family: 'Microsoft YaHei', 'SimSun', sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

#editor-container.editor-wrapper .tox-tinymce .tox-edit-area__iframe ::selection {
    background-color: rgba(102, 126, 234, 0.3);
    color: inherit;
}

#editor-container.editor-wrapper .tox-tinymce .tox-edit-area__iframe ::-moz-selection {
    background-color: rgba(102, 126, 234, 0.3);
    color: inherit;
}

/* 编辑器表格样式优化 */
#editor-container.editor-wrapper .tox-tinymce .tox-edit-area__iframe table {
    border-collapse: collapse;
    width: 100%;
    margin: 16px 0;
}

#editor-container.editor-wrapper .tox-tinymce .tox-edit-area__iframe table td,
#editor-container.editor-wrapper .tox-tinymce .tox-edit-area__iframe table th {
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
}

#editor-container.editor-wrapper .tox-tinymce .tox-edit-area__iframe table th {
    background-color: #f8fafc;
    font-weight: 600;
}

/* 编辑器焦点状态优化 */
#editor-container.editor-wrapper .tox-tinymce:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#editor-container.editor-wrapper .tox-tinymce .tox-edit-area__iframe:focus {
    outline: none;
}

/* 模态框动画效果 */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#word-count-modal:not(.hidden) > div {
    animation: modalFadeIn 0.3s ease-out;
}

/* 模态框内容响应式调整 */
@media (max-width: 640px) {
    #word-count-modal .grid.grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    #word-count-modal .text-2xl {
        font-size: 1.25rem;
    }
}

/* 新增样式：处理进度指示器 */
.processing-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.processing-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background-color: #f8fafc;
    border-radius: 6px;
    border-left: 4px solid #e2e8f0;
    transition: all 0.3s ease;
}

.processing-step.active {
    border-left-color: #667eea;
    background-color: #f0f4ff;
}

.processing-step.completed {
    border-left-color: #10b981;
    background-color: #f0fdf4;
}

.step-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #e2e8f0;
    color: #64748b;
    font-size: 12px;
}

.processing-step.active .step-icon {
    background-color: #667eea;
    color: white;
}

.processing-step.completed .step-icon {
    background-color: #10b981;
    color: white;
}

.step-text {
    font-size: 14px;
    color: #64748b;
}

.processing-step.active .step-text {
    color: #4f46e5;
    font-weight: 500;
}

.processing-step.completed .step-text {
    color: #059669;
}

/* 新增：错误提示样式 */
.error-message {
    background-color: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
    padding: 12px;
    border-radius: 6px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 新增：保存状态提示 */
.save-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.save-status.saving {
    display: block;
    background-color: #3b82f6;
    color: white;
    animation: pulse 1.5s infinite;
}

.save-status.saved {
    display: block;
    background-color: #10b981;
    color: white;
}

.save-status.error {
    display: block;
    background-color: #ef4444;
    color: white;
}

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

/* 新增：更多工具功能按钮 */
.more-tools-panel {
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

.more-tools-panel.active {
    max-height: 500px;
}

/* 新增：大型文档处理优化 */
.large-doc-warning {
    background-color: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
}

/* 新增：处理队列样式 */
.queue-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
}

/* 新增：性能监控样式 */
.performance-monitor {
    background-color: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px;
    font-size: 11px;
    color: #6b7280;
}

/* 编辑器字体和间距优化 */
#editor-container.editor-wrapper .tox-tinymce .tox-edit-area__iframe {
    font-size: 16px;
    line-height: 1.6;
}

#editor-container.editor-wrapper .tox-tinymce .tox-edit-area__iframe p {
    margin-bottom: 1em;
}

#editor-container.editor-wrapper .tox-tinymce .tox-edit-area__iframe h1 {
    font-size: 2em;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
}

#editor-container.editor-wrapper .tox-tinymce .tox-edit-area__iframe h2 {
    font-size: 1.5em;
    margin-top: 1.25em;
    margin-bottom: 0.625em;
}

#editor-container.editor-wrapper .tox-tinymce .tox-edit-area__iframe h3 {
    font-size: 1.17em;
    margin-top: 1em;
    margin-bottom: 0.5em;
}

/* ==================== 响应式设计 ==================== */
/* 大屏设备 (≥1024px) */
@media (min-width: 1024px) {
    .lg\:toolbar-expanded .toolbar-buttons {
        display: flex !important;
    }
}

/* 平板设备 (768px - 1023px) */
@media (max-width: 1023px) and (min-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .toolbar-button {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    #editor-container.editor-wrapper {
        min-height: 400px;
    }
    
    .stat-card .flex.space-x-6 {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .stat-card .text-center {
        flex: 1 0 45%;
    }
    
    .draft-manager-panel .flex.space-x-2 {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* 移动设备 (≤767px) */
@media (max-width: 767px) {
    nav .flex.flex-col.md\:flex-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav .hidden.md\:block {
        display: none;
    }
    
    .toolbar-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    #editor-container.editor-wrapper {
        min-height: 350px;
    }
    
    .toolbar-button span {
        font-size: 12px;
    }
    
    .stat-card .flex.space-x-6 {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stat-card .text-center {
        flex: 1;
    }
    
    .preview-area {
        min-height: 150px;
        padding: 0.75rem;
    }
    
    .editor-status-bar {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .editor-status-indicator {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .settings-panel .grid.grid-cols-2.md\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .action-buttons button {
        width: 100%;
    }
    
    .draft-manager-panel .flex.justify-between {
        flex-direction: column;
        gap: 1rem;
    }
    
    .draft-manager-panel .flex.space-x-2 {
        justify-content: center;
    }
}

/* 小屏移动设备 (≤480px) */
@media (max-width: 480px) {
    .toolbar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #editor-container.editor-wrapper {
        min-height: 300px;
    }
    
    .toolbar-button .hidden-text {
        display: none;
    }
    
    .toolbar-button {
        padding: 6px 8px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .editor-status-bar {
        font-size: 11px;
        padding: 6px 12px;
    }
    
    .more-tools-panel .grid.grid-cols-2.md\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .save-status {
        bottom: 10px;
        right: 10px;
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* 移动端编辑器工具栏优化 */
@media (max-width: 767px) {
    #editor-container.editor-wrapper .tox-tinymce .tox-toolbar__primary {
        flex-wrap: wrap;
    }
    
    #editor-container.editor-wrapper .tox-tinymce .tox-tbtn {
        margin: 2px;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    .bg-gray-50 {
        background-color: #1f2937;
    }
    
    .text-gray-800 {
        color: #f9fafb;
    }
    
    .bg-white {
        background-color: #374151;
    }
    
    .card-shadow {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
    
    .border-gray-200 {
        border-color: #4b5563;
    }
    
    .text-gray-600 {
        color: #d1d5db;
    }
    
    .bg-gray-100 {
        background-color: #4b5563;
    }
    
    .text-gray-700 {
        color: #e5e7eb;
    }
    
    .draft-item:hover {
        background-color: #4b5563;
    }
    
    .draft-list-container {
        background-color: #374151;
    }
}

/* 打印优化 */
@media print {
    nav, footer, .settings-panel, .more-tools-panel, .draft-manager-panel, .toolbar-button, .action-buttons {
        display: none !important;
    }
    
    .editor-wrapper {
        border: none !important;
        box-shadow: none !important;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    body {
        background-color: white !important;
        color: black !important;
    }
}