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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 顶部样式 */
header {
    background-color: #4a6fa5;
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 面包屑导航样式 */
.breadcrumb {
    background-color: white;
    padding: 10px 20px;
    margin: 0 auto;
    width: 90%;
    max-width: 1200px;
    font-size: 14px;
    color: #666;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.breadcrumb a {
    color: #4a6fa5;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.header-content {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
}

.logo a {
    color: white;
    text-decoration: none;
}

.search-box {
    display: flex;
    align-items: stretch;
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
}

#search-input {
    padding: 8px 12px;
    font-size: 16px;
    border: none;
    border-radius: 4px 0 0 4px;
    flex: 1;
    width: 300px;
}

#search-btn {
    padding: 8px 16px;
    font-size: 16px;
    border: none;
    border-radius: 0 4px 4px 0;
    background-color: #ff9f1c;
    color: white;
    cursor: pointer;
}

#search-btn:hover {
    background-color: #e68a00;
}

nav ul {
    display: flex;
    gap: 15px;
    list-style: none;
}

nav ul li a {
    color: white;
    text-decoration: none;
    position: relative;
    display: inline-block;
    overflow: hidden;
}

/* 鼠标悬停时文本变化效果 */
.hover-text {
    transition: all 0.3s ease;
}

.hover-text:hover {
    color: transparent;
}

.hover-text:hover::after {
    content: attr(data-hover-text);
    color: white;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 中部样式 */
main {
    padding: 20px 0;
}

.main-content {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.left-section {
    flex: 2;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.right-section {
    flex: 1;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.left-section h2,
.right-section h2 {
    margin-bottom: 15px;
    color: #4a6fa5;
    font-size: 18px;
}



/* 搜索结果页面标题样式 */
.search-content h1 {
    color: #4a6fa5;
    font-size: 20px;
    margin-bottom: 15px;
}

.search-content p {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

ul {
    list-style: none;
}

li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    width: 100%;
}

li:last-child {
    border-bottom: none;
}

li a {
    color: #333;
    text-decoration: none;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

li span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

li a:hover {
    color: #4a6fa5;
}

.btn-group {
    display: flex;
    gap: 10px;
    white-space: nowrap;
}

.preview-btn,
.download-btn {
    padding: 4px 8px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.preview-btn {
    background-color: #4a6fa5;
    color: white;
}

.preview-btn:hover {
    background-color: #3a5a85;
}

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

.download-btn:hover {
    background-color: #e68a00;
}

/* 搜索结果页面样式 */
.search-content {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* 关于我们页面样式 */
.about-content {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.about-content h1 {
    color: #4a6fa5;
    font-size: 20px;
    margin-bottom: 20px;
}

.about-text {
    line-height: 1.8;
    color: #333;
}

.about-text p {
    margin-bottom: 15px;
}

.search-content h2 {
    margin-bottom: 15px;
    color: #4a6fa5;
    font-size: 18px;
}

/* 分页样式 */
.pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.pagination button {
    padding: 6px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
}

.pagination button:hover {
    background-color: #f0f0f0;
}

.pagination button.active {
    background-color: #4a6fa5;
    color: white;
    border-color: #4a6fa5;
}

/* 分页省略号样式 */
.pagination .ellipsis {
    padding: 6px 12px;
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
}

/* 下部样式 */
footer {
    background-color: #333;
    color: white;
    padding: 20px 0;
    margin-top: 30px;
}

.footer-content {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    font-size: 14px;
}

.footer-content p {
    margin: 8px 0;
}

.footer-content a {
    color: white;
    text-decoration: none;
}

.footer-content a:hover {
    text-decoration: underline;
}

/* 浮窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    transition: opacity 0.3s ease;
}

.modal.show {
    display: block;
    opacity: 1;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    animation: modalSlideIn 0.3s ease-out;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 10;
    transition: color 0.2s ease;
}

.close-btn:hover,
.close-btn:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #4a6fa5;
    font-size: 18px;
    padding-right: 40px;
}

#preview-content {
    margin-top: 10px;
    flex: 1;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    background-color: #f9f9f9;
}

/* PDF预览控制栏 */
.pdf-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.page-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-btn {
    padding: 6px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-btn:hover {
    background-color: #f0f0f0;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 14px;
    color: #666;
    min-width: 100px;
    text-align: center;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.zoom-btn {
    padding: 6px 10px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.zoom-btn:hover {
    background-color: #f0f0f0;
}

.zoom-level {
    font-size: 14px;
    color: #666;
    min-width: 60px;
    text-align: center;
}

/* PDF页面容器 */
.pdf-pages {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pdf-page {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.pdf-page:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.pdf-page canvas {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

.page-label {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
    text-align: center;
}

/* 加载状态 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 15px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4a6fa5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    font-size: 14px;
    color: #666;
}

/* 错误状态 */
.error-message {
    padding: 20px;
    background-color: #fff3f3;
    border: 1px solid #ffcccc;
    border-radius: 4px;
    color: #d32f2f;
    margin: 10px 0;
}

/* 版权声明样式 */
.copyright-notice {
    color: red;
}

/* 模态窗口按钮 */
.modal-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

#cancel-download,
#confirm-download {
    padding: 8px 16px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#cancel-download {
    background-color: #ddd;
    color: #333;
}

#cancel-download:hover {
    background-color: #ccc;
}

#confirm-download {
    background-color: #4a6fa5;
    color: white;
}

#confirm-download:hover {
    background-color: #3a5a85;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 10px;
    }

    .main-content {
        flex-direction: column;
    }

    #search-input {
        width: 200px;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 85vh;
    }

    .pdf-controls {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .page-controls,
    .zoom-controls {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header-content {
        width: 95%;
    }

    .main-content,
    .search-content {
        width: 95%;
        padding: 15px;
    }

    #search-input {
        width: 150px;
    }

    .modal-content {
        width: 98%;
        margin: 15% auto;
        padding: 15px;
    }

    #preview-content {
        padding: 10px;
    }

    .pdf-controls {
        padding: 8px;
    }

    .page-btn,
    .zoom-btn {
        padding: 4px 8px;
        font-size: 12px;
    }
}

/* 滚动条样式 */
#preview-content::-webkit-scrollbar {
    width: 8px;
}

#preview-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#preview-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

#preview-content::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}