/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
}

/* 应用容器 */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.app-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    text-align: center;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-content h1 {
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 8px;
    font-weight: 700;
}

.header-content p {
    color: #7f8c8d;
    font-size: 1.1em;
}

/* 主要内容区域 */
.main-content {
    flex: 1;
    padding: 30px 20px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* 上传区域 */
.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    background: rgba(255, 255, 255, 0.95);
    border: 3px dashed #bdc3c7;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.upload-area:hover {
    border-color: #3498db;
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.upload-area.dragover {
    border-color: #2ecc71;
    background: #f8fffe;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.7;
}

.upload-area h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.file-input {
    margin: 15px 0;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.supported-formats {
    margin: 20px 0 10px;
}

.format-badge {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 5px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
}

.format-badge.pdf {
    background: #e74c3c;
}

.format-badge.docx {
    background: #2980b9;
}

.format-badge.pptx {
    background: #d35400;
}

.upload-hint {
    color: #95a5a6;
    font-size: 0.9em;
    margin-top: 10px;
}

/* 文档信息栏 */
.document-info {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-label {
    font-weight: 600;
    color: #34495e;
}

.info-value {
    color: #2c3e50;
    background: #ecf0f1;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* 预览控制栏 */
.viewer-controls {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.pdf-controls, .docx-controls, .pptx-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

/* 按钮样式 */
.btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #95a5a6;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-primary {
    background: #e74c3c;
}

.btn-primary:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
}

/* 预览区域 */
.viewer-area {
    position: relative;
}

.viewer-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    min-height: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

/* 欢迎消息 */
.welcome-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 600px;
    text-align: center;
    padding: 40px;
}

.welcome-icon {
    font-size: 5em;
    margin-bottom: 20px;
    opacity: 0.7;
}

.welcome-message h2 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2em;
}

.welcome-message p {
    color: #7f8c8d;
    font-size: 1.1em;
    margin-bottom: 30px;
}

.features {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #34495e;
}

.feature-icon {
    font-size: 2em;
}

/* PDF预览样式 */
.pdf-container {
    padding: 20px;
    text-align: center;
}

.pdf-canvas {
    border: 1px solid #ddd;
    border-radius: 8px;
    margin: 20px auto;
    max-width: 100%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.page-info, .slide-info {
    background: #ecf0f1;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    color: #2c3e50;
}

/* DOCX预览样式 */
.docx-container {
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    line-height: 1.8;
    font-size: 16px;
    color: #2c3e50;
}

.docx-container h1, .docx-container h2, .docx-container h3 {
    color: #2c3e50;
    margin: 20px 0 15px;
    font-weight: 600;
}

.docx-container p {
    margin-bottom: 12px;
}

.docx-container table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.docx-container table td, .docx-container table th {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.docx-container table th {
    background: #f8f9fa;
    font-weight: 600;
}

/* PPTX预览样式 */
.pptx-container {
    padding: 20px;
}

.pptx-slide {
    background: white;
    margin: 20px auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 加载状态 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ecf0f1;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #7f8c8d;
    font-size: 1.1em;
}

/* 错误和成功状态 */
.error-message, .success-message {
    padding: 20px;
    margin: 20px;
    border-radius: 8px;
    text-align: center;
}

.error-message {
    background: #fdf2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.success-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

/* 底部 */
.app-footer {
    background: rgba(255, 255, 255, 0.9);
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
    font-size: 0.9em;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        padding: 20px 10px;
    }
    
    .header-content h1 {
        font-size: 2em;
    }
    
    .features {
        flex-direction: column;
        gap: 15px;
    }
    
    .pdf-controls, .docx-controls, .pptx-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .zoom-controls {
        margin-left: 0;
        justify-content: center;
    }
    
    .docx-container {
        padding: 20px;
        font-size: 14px;
    }
}

/* 打印样式 */
@media print {
    .app-header, .upload-section, .viewer-controls, .app-footer {
        display: none !important;
    }
    
    .main-content {
        padding: 0;
        max-width: none;
    }
    
    .viewer-container {
        box-shadow: none;
        border-radius: 0;
    }
}
