/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS 变量 */
:root {
    --primary-color: #4CAF50;
    --secondary-color: #333;
    --background-color: #f4f4f4;
    --text-color: #333;
    --white: #fff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部 */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: var(--secondary-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo img {
    border-radius: 50%;
    transition: var(--transition);
}

.logo img:hover {
    transform: scale(1.1);
}

nav {
    display: flex;
}

nav a {
    color: var(--secondary-color);
    text-decoration: none;
    margin: 0 20px;
    font-weight: 600;
    position: relative;
    transition: var(--transition);
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background-color: var(--primary-color);
    transition: var(--transition);
    transform: translateX(-50%);
}

nav a:hover::after,
nav a.active::after {
    width: 100%;
}

nav a:hover,
nav a.active {
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* 主内容 */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--white);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    flex: 1;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main h1 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 2.5rem;
    text-align: center;
    background: linear-gradient(45deg, var(--primary-color), #2196F3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

main p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: center;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 1.5rem;
    background: rgba(51, 51, 51, 0.9);
    color: var(--white);
    backdrop-filter: blur(10px);
    margin-top: auto;
}

footer p {
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 1rem;
    }

    nav {
        margin-top: 1rem;
    }

    nav a {
        margin: 0 10px;
    }

    main {
        margin: 1rem;
        padding: 1.5rem;
    }

    main h1 {
        font-size: 2rem;
    }
}

/* 文档页面样式 */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.document-card {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    border: 2px solid transparent;
}

.document-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.document-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.document-card h3 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.document-card p {
    color: #666;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.file-size {
    font-size: 0.9rem;
    color: #888;
    font-weight: bold;
}

.download-btn {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: var(--transition);
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.download-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.upload-section {
    margin-top: 3rem;
    padding: 2rem;
    background: rgba(76, 175, 80, 0.05);
    border-radius: 15px;
    border-left: 4px solid var(--primary-color);
}

.upload-section h2 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.upload-note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    color: #856404;
}

.upload-note strong {
    color: #533f00;
}

/* 按钮组样式 */
.button-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.preview-btn {
    background: #2196F3;
    color: var(--white);
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
    flex: 1;
    min-width: 80px;
}

.preview-btn:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 1000px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, var(--primary-color), #2196F3);
    color: var(--white);
    border-radius: 15px 15px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-btn {
    font-size: 2rem;
    cursor: pointer;
    transition: var(--transition);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 0;
    max-height: 70vh;
    overflow: hidden;
}

#documentViewer {
    border: none;
    border-radius: 0 0 15px 15px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
    }

    .preview-btn,
    .download-btn {
        flex: none;
        width: 100%;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .modal-body {
        max-height: 60vh;
    }

    #documentViewer,
    #pdfEmbed {
        height: 400px;
    }
}

/* 加载指示器样式 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#loadingIndicator p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

/* 图片展示区域样式 */
.images-section {
    margin: 3rem 0;
}

.images-section h2 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    text-align: center;
    font-size: 2rem;
}

.images-section>p {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.image-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    border: 2px solid transparent;
}

.image-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.image-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

.image-card:hover img {
    transform: scale(1.05);
}

.image-info {
    padding: 1.5rem;
}

.image-info h3 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.image-info p {
    color: #666;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.image-info .file-size {
    font-size: 0.9rem;
    color: #888;
    font-weight: bold;
    margin-bottom: 0;
}

/* 图片模态框预览 */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.image-modal-content {
    position: relative;
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    animation: modalFadeIn 0.3s ease-out;
}

.image-modal-content img {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.image-modal .close-btn {
    position: absolute;
    top: -50px;
    right: 0;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.image-modal .close-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .images-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .image-card img {
        height: 150px;
    }

    .image-modal-content {
        max-width: 95%;
        max-height: 80%;
    }

    .image-modal .close-btn {
        top: -40px;
        font-size: 30px;
    }
}