body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f7f6;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.container {
    width: 100%;
    max-width: 1200px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 25px;
    box-sizing: border-box;
}
h1 {
    width: 100%;
    color: #0056b3;
    margin-bottom: 25px;
    font-size: 2.2em;
    text-align: center;
}
h2 {
    color: #0056b3;
    margin-bottom: 20px;
    font-size: 1.8em;
    text-align: center;
}

/* 文件列表样式 */
.file-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.file-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}
.file-list li:last-child {
    border-bottom: none;
}
.file-list .file-name {
    flex-grow: 1;
    font-weight: bold;
    color: #333;
    margin-right: 10px;
}
.file-list .file-actions button,
.file-list .file-actions a {
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-left: 8px;
    display: inline-block;
    border: 1px solid transparent; /* 统一边框 */
}
.file-list .file-actions button.preview-btn {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}
.file-list .file-actions button.preview-btn:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}
.file-list .file-actions a.download-btn {
    background-color: #28a745;
    color: white;
    border-color: #28a745;
}
.file-list .file-actions a.download-btn:hover {
    background-color: #218838;
    border-color: #218838;
}

/* 预览页面的通用样式 */
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.preview-header h2 {
    margin: 0;
    text-align: left;
}
.back-button {
    background-color: #6c757d;
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
}
.back-button:hover {
    background-color: #5a6268;
}

/* PDF 预览器样式 */
.pdf-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.pdf-controls button, .pdf-controls select {
    padding: 8px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    font-size: 1em;
}
.pdf-controls button:hover {
    background-color: #e2e6ea;
    border-color: #a3aab1;
}
.pdf-viewer-wrapper {
    width: 100%;
    height: 600px;
    border: 1px solid #ddd;
    background-color: #e0e0e0;
    overflow: auto;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}
canvas {
    display: block;
    margin: 0 auto;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 表格预览器样式 */
.csv-viewer-wrapper {
    width: 100%;
    height: 600px;
    border: 1px solid #ddd;
    overflow: auto;
    background-color: white;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    padding: 10px;
    box-sizing: border-box;
}
.csv-viewer-wrapper table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}
.csv-viewer-wrapper th, .csv-viewer-wrapper td {
    border: 1px solid #eee;
    padding: 8px;
    text-align: left;
}
.csv-viewer-wrapper th {
    background-color: #f0f0f0;
    font-weight: bold;
}
.no-preview-message, .error-message {
    text-align: center;
    margin-top: 50px;
    font-size: 1.1em;
}
.no-preview-message {
    color: #666;
}
.error-message {
    color: red;
}

/* 手机端适配 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .container {
        padding: 15px;
        box-shadow: none;
    }
    h1 {
        font-size: 1.8em;
        margin-bottom: 20px;
    }
    h2 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }
    .file-list li {
        flex-direction: column;
        align-items: flex-start;
    }
    .file-list .file-name {
        margin-bottom: 8px;
        margin-right: 0;
    }
    .file-list .file-actions {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }
    .file-list .file-actions button,
    .file-list .file-actions a {
        margin-left: 5px;
        margin-right: 0;
        padding: 8px 10px;
    }
    .pdf-controls {
        flex-direction: column;
        gap: 10px;
    }
    .pdf-controls button, .pdf-controls select {
        width: 100%;
        box-sizing: border-box;
    }
    .pdf-viewer-wrapper, .csv-viewer-wrapper {
        height: 400px;
    }
    .preview-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .preview-header h2 {
        margin-bottom: 10px;
    }
    .back-button {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}
