/* 翻译预览组件样式 */
.translation-preview {
    background: #334155;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.preview-header {
    background: #475569;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.preview-title {
    font-size: 1rem;
    font-weight: 600;
    color: #f8fafc;
}

.preview-toggle {
    background: none;
    border: none;
    color: #cbd5e1;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.preview-toggle:hover {
    color: #ffffff;
    background: rgba(148, 163, 184, 0.1);
}

.preview-toggle.active {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.preview-content {
    display: flex;
    min-height: 400px;
}

.preview-panel {
    flex: 1;
    padding: 1.5rem;
    border-right: 1px solid rgba(148, 163, 184, 0.3);
    overflow-y: auto;
    max-height: 500px;
}

.preview-panel:last-child {
    border-right: none;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.panel-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.panel-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

.panel-info i {
    font-size: 0.875rem;
}

.panel-content {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #f1f5f9;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.panel-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
}

.panel-content table td,
.panel-content table th {
    border: 1px solid rgba(148, 163, 184, 0.3);
    padding: 0.5rem;
    text-align: left;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.panel-content table th {
    background: rgba(148, 163, 184, 0.1);
    font-weight: 600;
    color: #e2e8f0;
}

.panel-content table td {
    background: rgba(51, 65, 85, 0.5);
}

/* 翻译统计信息样式 */
.translation-stats {
    background: #475569;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* 文件类型图标样式 */
.file-type-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.file-type-icon.pdf {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.file-type-icon.word {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.file-type-icon.image {
    background: linear-gradient(135deg, #10b981, #059669);
}

.file-type-icon.unknown {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

/* 加载状态样式 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    z-index: 10;
}

.loading-content {
    text-align: center;
    color: #f8fafc;
}

.loading-spinner-large {
    width: 48px;
    height: 48px;
    border: 4px solid #3b82f6;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loading-text {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.loading-subtext {
    font-size: 0.875rem;
    color: #cbd5e1;
}

/* 错误状态样式 */
.error-state {
    text-align: center;
    padding: 2rem;
    color: #f8fafc;
}

.error-icon {
    font-size: 3rem;
    color: #ef4444;
    margin-bottom: 1rem;
}

.error-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.error-message {
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.error-retry {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.error-retry:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* 成功状态样式 */
.success-state {
    text-align: center;
    padding: 2rem;
    color: #f8fafc;
}

.success-icon {
    font-size: 3rem;
    color: #10b981;
    margin-bottom: 1rem;
}

.success-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.success-message {
    color: #cbd5e1;
    margin-bottom: 1rem;
}

/* 进度条样式 */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

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

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background: #1e293b;
    color: #f8fafc;
    text-align: center;
    border-radius: 8px;
    padding: 0.5rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    border: 1px solid rgba(148, 163, 184, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    font-size: 0.75rem;
    line-height: 1.4;
}

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
}

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

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #1e293b;
    border-radius: 16px;
    padding: 2rem;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(148, 163, 184, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f8fafc;
}

.modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.modal-body {
    color: #cbd5e1;
    line-height: 1.6;
}

/* 响应式组件样式 */
@media (max-width: 768px) {
    .preview-content {
        flex-direction: column;
        min-height: auto;
    }
    
    .preview-panel {
        border-right: none;
        border-bottom: 1px solid rgba(148, 163, 184, 0.3);
        max-height: none;
    }
    
    .preview-panel:last-child {
        border-bottom: none;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        margin: 1rem;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .preview-header {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .preview-panel {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        padding: 1rem;
    }
}
