/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f8f9fa;
    font-size: 14px;
}

/* 顶部导航 */
.top-nav {
    background: linear-gradient(135deg, #00a2e8 0%, #0056b3 100%);
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.user-info a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 主要内容区 */
.container {
    display: flex;
    min-height: calc(100vh - 50px);
}

/* 左侧菜单 */
.sidebar {
    width: 200px;
    background-color: white;
    border-right: 1px solid #dee2e6;
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section h3 {
    padding: 10px 20px;
    color: #495057;
    font-size: 14px;
    font-weight: bold;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.nav-section ul {
    list-style: none;
}

.nav-section li a {
    display: block;
    padding: 8px 20px;
    color: #495057;
    text-decoration: none;
    transition: all 0.3s;
}

.nav-section li a:hover,
.nav-section li a.active {
    background-color: #e9ecef;
    color: #00a2e8;
}

/* 右侧内容区 */
.content {
    flex: 1;
    padding: 20px;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin: 20px;
    border-radius: 8px;
}

/* 批套历史表格样式 */
.history-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.history-table th,
.history-table td {
    padding: 8px;
    border: 1px solid #dee2e6;
    text-align: center;
    font-size: 12px;
}

.history-table th {
    background: #f8f9fa;
    font-weight: bold;
}

.history-table tr:hover {
    background-color: #f8f9fa;
}

/* 更新分页样式 */
.pagination {
    margin-top: 20px;
    text-align: center;
    user-select: none;
}

/* 分页信息样式 */
.pagination-info {
    margin-bottom: 10px;
    color: #666;
    font-size: 14px;
}

.pagination a {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 5px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #666;
    min-width: 32px;
    height: 32px;
    line-height: 20px;
    box-sizing: border-box;
    border-radius: 4px;
    transition: all 0.3s;
    cursor: pointer;
}

.pagination a:hover {
    background-color: #f8f9fa;
    color: #00a2e8;
    border-color: #00a2e8;
}

.pagination a.active {
    background-color: #00a2e8;
    color: white;
    border-color: #00a2e8;
}

/* 移除之前不需要的样式 */
.pagination-links,
.page-ellipsis,
.page-link.current,
.page-link.disabled {
    display: none;
}

/* 下载链接样式 */
.download-link {
    display: inline-block;
    padding: 2px 8px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    font-size: 12px;
}

.download-link:hover {
    background: #0056b3;
}

/* 错误消息样式 */
.error-message {
    text-align: center;
    padding: 20px;
    color: #dc3545;
}

.retry-btn {
    margin-left: 10px;
    padding: 5px 15px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.retry-btn:hover {
    background: #218838;
}

/* 过期和未命中文本样式 */
.expired-text {
    color: #dc3545;
    font-style: italic;
}

.no-hit-text {
    color: #6c757d;
    font-style: italic;
}

/* 命中率列的特殊样式 */
.history-table td:nth-child(5) {
    color: #28a745;
    font-weight: bold;
}

/* 下载链接的样式调整 */
.history-table .download-link {
    text-decoration: none;
    color: #007bff;
    background: none;
    padding: 0;
}

.history-table .download-link:hover {
    text-decoration: underline;
    background: none;
    color: #0056b3;
}

/* 登录状态样式 */
.success-text {
    color: #28a745;
    font-weight: bold;
}

.failed-text {
    color: #dc3545;
    font-weight: bold;
}

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

.marc-modal-content {
    position: relative;
    background: white;
    width: 80%;
    max-width: 900px;
    height: 70vh;
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.marc-modal-header {
    padding: 8px 10px;
    background: #0088cc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.marc-modal-header h3 {
    margin: 0;
    font-size: 14px;
    color: white;
    font-weight: normal;
}

.close-btn {
    font-size: 16px;
    color: white;
    cursor: pointer;
    padding: 2px 6px;
}

.marc-modal-body {
    flex: 1;
    overflow-y: auto;
    background: #fff;
}

/* MARC标签页样式 */
.marc-tabs {
    list-style: none;
    padding: 0;
    margin: 0;
    border-bottom: 1px solid #ddd;
    background: #f8f8f8;
    font-size: 13px;
}

.marc-tabs li {
    display: inline-block;
    margin: 0;
}

.marc-tabs li a {
    display: block;
    padding: 8px 20px;
    color: #333;
    text-decoration: none;
    border-right: 1px solid #ddd;
}

.marc-tabs li:first-child a {
    border-left: 1px solid #ddd;
}

.marc-tabs li a:hover {
    background: #f0f0f0;
}

.marc-tabs li.active a {
    background: white;
    margin-bottom: -1px;
    padding-bottom: 9px;
    border-top: 2px solid #0088cc;
}

.tab-content {
    padding: 15px;
    background: white;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* MARC信息表格样式 */
.marc-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.marc-info-table td {
    padding: 6px 8px;
    border: 1px solid #ddd;
}

.marc-info-table td:first-child {
    width: 80px;
    background: #f5f5f5;
    font-weight: normal;
}

/* MARC文本区域样式 */
.marc-textarea {
    width: 100%;
    height: calc(70vh - 150px);
    padding: 8px;
    border: 1px solid #ddd;
    font-family: Consolas, monospace;
    font-size: 13px;
    line-height: 1.4;
    resize: none;
    background: white;
    white-space: pre;
}

/* 加载状态样式 */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* 错误消息样式 */
.error-message {
    text-align: center;
    padding: 20px;
    color: #dc3545;
}

.retry-btn {
    margin-left: 10px;
    padding: 5px 15px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.retry-btn:hover {
    background: #218838;
}

/* 添加 MARC 检索界面的样式 */
.search-section {
    padding: 20px;
}

.search-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.search-select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 120px;
    background-color: white;
    color: #495057;
    font-size: 13px;
    height: 28px;
    box-sizing: border-box;
    vertical-align: middle;
}

.search-select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.search-input {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    color: #495057;
    background-color: white;
    height: 28px;
    box-sizing: border-box;
    vertical-align: middle;
    margin: 0;
    line-height: normal;
    min-height: 28px;
    max-height: 28px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    display: block;
}

.search-input:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.search-btn {
    padding: 4px 16px;
    background: #00a2e8;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s;
    height: 28px;
    line-height: 20px;
    box-sizing: border-box;
    vertical-align: middle;
}

.search-btn:hover {
    background: #0056b3;
}

.search-btn:active {
    background: #004085;
}

.search-info {
    margin: 15px 0;
    color: #666;
    font-size: 13px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

/* 搜索结果表格样式 */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.results-table th {
    background: #f8f9fa;
    padding: 12px 8px;
    border: 1px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    text-align: left;
}

.results-table td {
    padding: 12px 8px;
    border: 1px solid #dee2e6;
    color: #212529;
}

.results-table tr:hover {
    background-color: #f8f9fa;
}

.results-table .marc-link {
    color: #007bff;
    text-decoration: none;
    cursor: pointer;
}

.results-table .marc-link:hover {
    text-decoration: underline;
    color: #0056b3;
}

/* 添加一个通用的样式重置 */
input, select, button {
    box-sizing: border-box;
    height: 28px;
    line-height: normal;
    margin: 0;
    padding: 4px 8px;
    font-size: 13px;
    vertical-align: middle;
}

/* 数据表格样式 */
.table-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.data-table th {
    background-color: #f0f0f0;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border: 1px solid #ddd;
}

.data-table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

/* 状态标签样式 */
.status-tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.status-tag.success {
    background-color: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.status-tag.pending {
    background-color: #fff7e6;
    border: 1px solid #ffd591;
    color: #fa8c16;
}

/* 分页样式已存在，如果需要可以微调 */
.pagination-ellipsis {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 5px;
    color: #666;
}

/* 分页容器样式 */
.pagination-container {
    margin-top: 20px;
    text-align: center;
}

.pagination-info {
    margin-bottom: 10px;
    color: #666;
    font-size: 14px;
}

/* 进度对话框样式 */
.progress-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    width: 400px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.progress-content {
    text-align: center;
}

.progress-text {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
}

.progress-bar {
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: #00a2e8;
    width: 0;
    transition: width 0.3s ease;
}

.progress-percentage {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.cancel-button {
    padding: 8px 20px;
    background: #ff4d4f;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.cancel-button:hover {
    background: #ff7875;
}

/* 遮罩层样式 */
.download-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}
