/* 基础样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

/* 导航栏样式 */
.nav-tabs {
    margin-bottom: 30px;
    border-bottom: 2px solid #dee2e6;
    background-color: white;
    padding: 0 15px;
    border-radius: 10px 10px 0 0;
}

.nav-tabs .nav-link {
    font-weight: 500;
    color: #495057;
    border: none;
    padding: 10px 20px;
    margin-right: 5px;
    transition: all 0.3s;
}

.nav-tabs .nav-link:hover {
    color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
    border-radius: 5px 5px 0 0;
}

.nav-tabs .nav-link.active {
    color: #0d6efd;
    background-color: #fff;
    border-bottom: 3px solid #0d6efd;
    font-weight: 600;
}

/* 搜索表单样式 */
.search-form, .analysis-form {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.form-control, .form-select {
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 14px;
}

.form-control:focus, .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.3rem rgba(13, 110, 253, 0.25);
    transform: translateY(-1px);
}

.form-label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
}

/* 表格样式 */
.paper-table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    border: none;
}

.table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    border: none;
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table tbody td {
    padding: 15px 20px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(102, 126, 234, 0.05);
}

.table-hover tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.1);
    transform: translateX(5px);
}

/* 树形视图样式 */
.tree-view {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.tree-year {
    border-left: 4px solid #667eea;
    padding-left: 15px;
    margin-bottom: 30px;
}

.tree-year h4 {
    color: #333;
    font-weight: 600;
    margin-bottom: 15px;
}

.tree-conference {
    border-left: 3px solid #4cd964;
    padding-left: 15px;
    margin-bottom: 20px;
}

.tree-conference h5 {
    color: #555;
    font-weight: 600;
    margin-bottom: 10px;
}

.paper-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s;
    margin-bottom: 15px;
}

.paper-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-outline-primary {
    color: #667eea;
    border: 1px solid #667eea;
    background: transparent;
}

.btn-outline-primary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-outline-danger {
    color: #ff6b6b;
    border: 1px solid #ff6b6b;
}

.btn-outline-danger:hover {
    background: #ff6b6b;
    color: white;
    transform: translateY(-2px);
}

.btn-outline-success {
    color: #4cd964;
    border: 1px solid #4cd964;
}

.btn-outline-success:hover {
    background: #4cd964;
    color: white;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* 折叠内容样式 */
.abstract-content {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #667eea;
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 0 8px 8px 0;
    animation: fadeIn 0.3s ease-out;
}

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

/* 图表容器样式 */
.chart-container {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    transition: all 0.3s;
    position: relative;
}

.chart-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.chart-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

/* 图表控制按钮样式 */
.chart-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-controls .btn {
    padding: 4px 12px;
    font-size: 12px;
}

.top-selector {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.top-selector select {
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid #ced4da;
    font-size: 12px;
    background: white;
}

/* 统计卡片样式 */
.stats-card {
    background: white;
    padding: 25px 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    transition: all 0.3s;
    border-top: 4px solid #667eea;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
}

.stats-number {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.stats-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* 文件链接样式 */
.file-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #667eea;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.3s;
    font-weight: 500;
}

.file-link:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
    text-decoration: none;
}

.file-link i {
    font-size: 14px;
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 50px;
    min-height: 300px;
}

.spinner {
    width: 40px; height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* 徽章样式 */
.badge {
    padding: 6px 12px;
    font-weight: 600;
    border-radius: 20px;
}

.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* 警告框样式 */
.alert {
    border: none;
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.alert-info {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
    border-left: 4px solid #667eea;
}

/* 页脚样式 */
footer {
    margin-top: 50px;
    padding: 20px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px 10px 0 0;
}

/* 分页样式 */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.pagination {
    margin: 0;
}

.page-item.active .page-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.page-link {
    color: #667eea;
    border: 1px solid #dee2e6;
    margin: 0 3px;
    border-radius: 6px;
    min-width: 40px;
    text-align: center;
    transition: all 0.3s;
}

.page-link:hover {
    background-color: rgba(102, 126, 234, 0.1);
    color: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.page-info {
    margin: 0 15px;
    color: #666;
    font-size: 0.9rem;
}

.page-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 20px;
}

.page-selector select {
    width: 80px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    padding: 6px 12px;
    background-color: white;
}

/* 顶部操作栏样式 */
.actions-bar {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* 横向复选框容器样式 - 优化版 */
.checkbox-horizontal-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px; /* 增加间距 */
    padding: 15px;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    max-height: 150px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.checkbox-item-horizontal {
    display: flex;
    align-items: center;
    margin: 0;
    margin-right: 10px; /* 额外增加右边距 */
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.2s;
    cursor: pointer;
}

.checkbox-item-horizontal:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.checkbox-item-horizontal .form-check-input {
    margin-right: 8px;
    margin-top: 0;
    cursor: pointer;
}

.checkbox-item-horizontal .form-check-label {
    font-size: 13px;
    white-space: nowrap;
    color: #495057;
    cursor: pointer;
}

/* 全选按钮容器 */
.checkbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .search-form, .analysis-form {
        padding: 15px;
    }

    .table {
        font-size: 13px;
    }

    .table td, .table th {
        padding: 10px;
    }

    .chart-container {
        padding: 15px;
    }

    .stats-card {
        margin-bottom: 15px;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .actions-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .checkbox-horizontal-container {
        max-height: 150px;
    }
    
    .chart-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .chart-controls {
        align-self: flex-end;
    }
}

/* 错误页面样式 */
.error-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.error-page h1 {
    font-size: 6rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
}

.error-page h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #333;
}

/* 摘要内容区域 */
.abstract-content {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #0d6efd;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* 统一摘要按钮样式 */
.abstract-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    transition: all 0.2s;
    text-decoration: none;
}

.abstract-toggle-btn:hover {
    background: #f8f9fa;
    color: #0d6efd;
    border-color: #0d6efd;
    text-decoration: none;
}

.abstract-toggle-btn.active {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

/* 登录页面 */
.login-page {
    background:
        linear-gradient(135deg, rgba(102, 126, 234, 0.14), rgba(25, 135, 84, 0.08)),
        #f7f9fc;
}

.login-shell {
    width: min(1040px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, 420px);
    align-items: center;
    gap: 48px;
    padding: 48px 0;
}

.login-brand {
    color: #27364a;
}

.login-mark {
    width: 72px;
    height: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    border-radius: 18px;
    background: linear-gradient(135deg, #667eea 0%, #198754 100%);
    color: white;
    font-size: 32px;
    box-shadow: 0 18px 40px rgba(102, 126, 234, 0.25);
}

.login-brand h1 {
    max-width: 620px;
    margin-bottom: 18px;
    font-size: clamp(2.1rem, 5vw, 4rem);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: 0;
}

.login-brand p {
    max-width: 520px;
    margin: 0;
    color: #5b6878;
    font-size: 1.08rem;
    line-height: 1.8;
}

.login-panel {
    background: white;
    border: 1px solid rgba(102, 126, 234, 0.12);
    border-radius: 8px;
    padding: 34px;
    box-shadow: 0 18px 55px rgba(39, 54, 74, 0.14);
}

.login-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 28px;
}

.login-panel-header h2 {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 700;
    color: #27364a;
}

.login-panel-header span {
    color: #8a96a8;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.login-form .input-group-text {
    min-width: 46px;
    justify-content: center;
    color: #667eea;
    background: #f4f6ff;
    border-radius: 8px 0 0 8px;
}

.login-submit {
    min-height: 46px;
}

.logout-link {
    white-space: nowrap;
}

@media (max-width: 992px) {
    header .container {
        flex-direction: column;
        align-items: stretch !important;
        gap: 14px;
    }

    header nav .d-flex {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    #mainTab {
        flex-wrap: wrap;
        gap: 6px;
    }

    .login-shell {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 576px) {
    .login-shell {
        width: min(100% - 24px, 420px);
        padding: 28px 0;
    }

    .login-panel {
        padding: 24px;
    }

    .login-panel-header {
        display: block;
    }

    .login-panel-header span {
        display: block;
        margin-top: 6px;
    }
}
