/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

.upload-link {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.upload-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header h1 i {
    margin-right: 10px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 主要内容区域 */
main {
    padding: 2rem 0;
}

/* 上传区域 */
/* 上传页面特定样式 */
.upload-section {
    margin-bottom: 2rem;
}

.upload-box {
    background: white;
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.upload-box:hover {
    border-color: #667eea;
    background-color: #f8f9ff;
}

.upload-icon {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.upload-box p {
    margin-bottom: 1rem;
    color: #666;
}

#fileInput {
    display: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* 上传进度条 */
.upload-progress {
    width: 100%;
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.upload-progress p {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
}

/* 上传历史 */
.upload-history {
    margin-top: 3rem;
}

.upload-history h2 {
    margin-bottom: 1.5rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.back-to-home {
    text-align: center;
    margin-top: 2rem;
}

/* 文档卡片 */
.document-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 15px;
    gap: 15px;
}

.document-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.document-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.document-icon.ppt {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
}

.document-icon.word {
    background: linear-gradient(135deg, #4b6584, #386fa4);
    color: white;
}

.document-icon.excel {
    background: linear-gradient(135deg, #1dd1a1, #10ac84);
    color: white;
}

.document-info h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-info p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

/* 筛选按钮区域 */
.filter-section {
    margin-bottom: 2rem;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    background: white;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

/* 文档列表区域 */
.documents-section h2 {
    margin-bottom: 1.5rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.document-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.document-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.document-icon {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: white;
}

.document-icon.ppt {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
}

.document-icon.word {
    background: linear-gradient(135deg, #4b6584, #386fa4);
}

.document-icon.excel {
    background: linear-gradient(135deg, #1dd1a1, #10ac84);
}

.document-info {
    padding: 15px;
}

.document-info h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-info p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.document-actions {
    display: flex;
    justify-content: space-between;
}

.action-btn {
    padding: 5px 10px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.view-btn {
    background: #667eea;
    color: white;
}

.download-btn {
    background: #1dd1a1;
    color: white;
}

.action-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-size: 1.2rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ccc;
}

/* 模态框样式 */
/* 查看器模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 15px;
    z-index: 1001;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
}

.viewer-container {
    height: 600px;
    position: relative;
}

.viewer-container iframe {
    width: 100%;
    height: calc(100% - 50px);
    border: none;
}

.viewer-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background-color: #f5f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid #eee;
}

.download-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.download-link:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 2% auto;
    }
    
    .viewer-container {
        height: 400px;
    }
    
    .viewer-container iframe {
        height: calc(100% - 50px);
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98%;
        margin: 1% auto;
    }
    
    .viewer-container {
        height: 300px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .upload-box {
        padding: 1rem;
    }
}
#viewerContent {
    height: 80vh;
    overflow: auto;
}

.viewer-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 底部样式 */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        width: 95%;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .documents-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .filter-buttons {
        gap: 5px;
    }
    
    .filter-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .modal-content {
        width: 95%;
    }
}

@media (max-width: 480px) {
    .documents-grid {
        grid-template-columns: 1fr;
    }
    
    header {
        padding: 1.5rem 0;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .upload-box {
        padding: 1.5rem;
    }
}

/* 文档详情页面样式 */
.document-detail-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 30px;
}

.document-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.document-header .document-icon {
    font-size: 3rem;
    margin-right: 20px;
}

.document-header .document-info h2 {
    margin-top: 0;
    margin-bottom: 10px;
}

.document-header .document-info p {
    margin: 5px 0;
    color: #666;
}

.document-viewer {
    margin-bottom: 30px;
}

.document-actions {
    text-align: center;
}

.document-actions .btn-primary {
    padding: 12px 30px;
    font-size: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .document-detail-card {
        padding: 20px;
    }
    
    .document-header {
        flex-direction: column;
        text-align: center;
    }
    
    .document-header .document-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }
}