* {
    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 {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.auth-buttons button {
    margin-left: 10px;
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-login {
    background: transparent;
    color: white;
    border: 2px solid white !important;
}

.btn-logout {
    background: #ff4757;
    color: white;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-filter {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.search-filter input,
.search-filter select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.pdf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

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

.pdf-card:hover {
    transform: translateY(-5px);
}

.pdf-card-header {
    background: #667eea;
    color: white;
    padding: 15px;
}

.pdf-card-body {
    padding: 15px;
}

.pdf-tags {
    margin-top: 10px;
}

.tag {
    display: inline-block;
    background: #e0e7ff;
    color: #4f46e5;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 12px;
    margin-right: 5px;
    margin-bottom: 5px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 5px;
}

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

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-danger {
    background: #ff4757;
    color: white;
}

.btn-success {
    background: #2ed573;
    color: white;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    margin: 50px auto;
    border-radius: 10px;
    overflow: hidden;
}

.modal-header {
    background: #667eea;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.pdf-viewer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 1001;
}

.viewer-header {
    background: #667eea;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.viewer-body {
    height: calc(100% - 60px);
}

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

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    font-size: 18px;
    color: #667eea;
}

.error {
    color: #ff4757;
    padding: 10px;
    background: #ffeaea;
    border-radius: 5px;
    margin: 10px 0;
}

.success {
    color: #2ed573;
    padding: 10px;
    background: #e8fff3;
    border-radius: 5px;
    margin: 10px 0;
}

.status-active {
    color: #2ed573;
    font-weight: bold;
}

.status-inactive {
    color: #ff4757;
    font-weight: bold;
}

.admin-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background: #f8f9fa;
    font-weight: 600;
}

tr:hover {
    background: #f8f9fa;
}
/* 维护模式样式 */
.admin-panel {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 5px solid #667eea;
    margin-bottom: 20px;
}

.admin-badge {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 10px;
    vertical-align: middle;
}

.admin-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

/* PDF卡片中的管理员操作按钮 */
.pdf-card .admin-buttons {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #eee;
    display: flex;
    gap: 5px;
}

.pdf-card .admin-buttons button {
    flex: 1;
    padding: 6px 12px;
    font-size: 12px;
}

/* 状态指示器 */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-active {
    color: #2ed573;
}

.status-inactive {
    color: #ff4757;
}

/* 模态框样式优化 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

/* 空状态 */
.empty-state {
    grid-column: 1 / -1;
    padding: 40px 20px;
    text-align: center;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
}

/* 错误提示 */
.error {
    background: #ffeaea;
    color: #ff4757;
    padding: 10px 15px;
    border-radius: 5px;
    margin: 10px 0;
    border-left: 4px solid #ff4757;
}

/* 成功提示 */
.success {
    background: #e8fff3;
    color: #2ed573;
    padding: 10px 15px;
    border-radius: 5px;
    margin: 10px 0;
    border-left: 4px solid #2ed573;
}

/* 按钮组 */
.button-group {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .admin-actions {
        flex-direction: column;
    }
    
    .admin-actions button {
        width: 100%;
    }
    
    .pdf-grid {
        grid-template-columns: 1fr;
    }
    
    .search-filter {
        grid-template-columns: 1fr;
    }
}
/* 列表视图样式 */
.table-container {
    overflow-x: auto;
    margin-top: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#pdfTable {
    width: 100%;
    border-collapse: collapse;
}

#pdfTable th {
    background: #f8f9fa;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

#pdfTable td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

#pdfTable tr:hover {
    background: #f8f9fa;
}

#pdfTable tr:last-child td {
    border-bottom: none;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    min-height: auto;
}

/* 视图切换器 */
#viewMode {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    font-size: 14px;
}

/* 维护状态指示器 */
#adminStatus span {
    font-size: 12px;
    font-weight: bold;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .table-container {
        margin: 0 -15px;
        border-radius: 0;
    }
    
    #pdfTable {
        font-size: 14px;
    }
    
    #pdfTable th,
    #pdfTable td {
        padding: 8px 10px;
    }
    
    .btn-sm {
        padding: 3px 6px;
        font-size: 11px;
        margin: 2px;
    }
    
    #viewMode {
        width: 100%;
        margin-top: 10px;
    }
}

/* 标签样式优化 */
.tag {
    display: inline-block;
    background: #e0e7ff;
    color: #4f46e5;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 11px;
    margin-right: 4px;
    margin-bottom: 2px;
}
/* 文件信息区域样式 */
#fileInfoArea {
    border-left: 4px solid #667eea;
    margin: 15px 0;
}

#fileInfoArea p {
    margin: 5px 0;
    font-size: 14px;
}

/* 表单组样式优化 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* 必填字段标记 */
.form-group label[for*="uploadName"],
.form-group label[for*="uploadCode"],
.form-group label[for*="uploadPublishDate"],
.form-group label[for*="uploadPublisher"] {
    position: relative;
}

.form-group label[for*="uploadName"]::after,
.form-group label[for*="uploadCode"]::after,
.form-group label[for*="uploadPublishDate"]::after,
.form-group label[for*="uploadPublisher"]::after {
    content: " *";
    color: #ff4757;
}
/* 排序下拉框样式 */
#sortBy {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    font-size: 14px;
    min-width: 160px;
}

/* 排序选项的特殊样式 */
#sortBy option[value*="desc"] {
    font-weight: bold;
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .search-filter {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    #sortBy {
        min-width: 140px;
    }
}

@media (max-width: 768px) {
    .search-filter {
        grid-template-columns: 1fr;
    }
    
    #sortBy {
        width: 100%;
    }
}

/* 排序指示器 */
.sort-indicator {
    display: inline-block;
    margin-left: 5px;
    font-size: 12px;
}

.sort-indicator.desc::after {
    content: " ▼";
    color: #667eea;
}

.sort-indicator.asc::after {
    content: " ▲";
    color: #667eea;
}