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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #34495e;
}

a {
    color: #2980b9;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #3498db;
}

ul {
    list-style: none;
}

/* 页面标题渐变背景 - 适用于所有页面 */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.page-header h1 {
    font-size: 2.8rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.page-header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* 头部样式 */
.site-header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo a {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    color: #3498db;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links a {
    color: #333;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-links a.active {
    color: #3498db;
}

.user-actions {
    display: flex;
    gap: 10px;
}

.login-btn {
    background-color: transparent;
    color: #3498db;
    border: 1px solid #3498db;
}

.login-btn:hover {
    background-color: #f0f7fc;
}

.register-btn {
    background-color: #3498db;
}

.register-btn:hover {
    background-color: #2980b9;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
}

/* 主内容区样式 */
.main-content {
    padding: 40px 0;
}

.page-title {
    margin-bottom: 30px;
    text-align: center;
}

.page-title h1 {
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.page-title p {
    color: #7f8c8d;
    font-size: 16px;
}

/* 搜索区域 */
.search-container {
    background-color: #f1f1f1;
    padding: 30px 0;
    margin-bottom: 40px;
    border-radius: 8px;
}

.search-box {
    display: flex;
    max-width: 800px;
    margin: 0 auto;
}

.search-box input {
    flex: 1;
    padding: 15px 20px;
    font-size: 16px;
    border: none;
    border-radius: 4px 0 0 4px;
    outline: none;
}

.search-btn {
    background-color: #3498db;
    padding: 0 30px;
    font-size: 16px;
    border-radius: 0 4px 4px 0;
}

/* 内容布局 */
.content-wrapper {
    display: flex;
    gap: 30px;
}

/* 左侧分类导航 */
.sidebar {
    width: 280px;
    flex-shrink: 0;
}

.category-nav, .filter-options {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.category-nav h3, .filter-options h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-nav ul li {
    margin-bottom: 5px;
}

.category-nav ul li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 4px;
    color: #333;
    transition: all 0.3s;
}

.category-nav ul li.active a, .category-nav ul li a:hover {
    background-color: #f0f7fc;
    color: #3498db;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group h4 {
    margin-bottom: 10px;
    color: #555;
    font-size: 15px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
    color: #666;
}

.filter-btn {
    width: 100%;
    background-color: #2c3e50;
}

/* 右侧期刊列表 */
.journal-list {
    flex: 1;
    padding: 20px;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.list-header p {
    color: #666;
}

.list-header p strong {
    color: #2c3e50;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

/* 期刊卡片容器 */
.journal-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* 期刊卡片 */
.journal-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 期刊封面 */
.journal-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* 期刊信息 */
.journal-info {
    padding: 15px;
}

.journal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.journal-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.journal-title a:hover {
    color: #667eea;
}

.journal-desc {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 12px;
    line-height: 1.5;
}

/* 期刊元信息 */
.journal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: #95a5a6;
}

.journal-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 期刊列表项布局 */
.journal-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

/* 期刊列表项样式 */
.journal-item {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.journal-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.journal-item .journal-cover {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}

.journal-item h4 {
    padding: 15px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.journal-item h4 a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.journal-item h4 a:hover {
    color: #667eea;
}

.journal-item p {
    padding: 0 15px 15px;
    margin: 0;
    font-size: 14px;
    color: #7f8c8d;
}

/* 分页导航 */
.pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.pagination ul {
    display: inline-flex;
    align-items: center;
    background: white;
    padding: 8px 12px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.pagination li {
    margin: 0 4px;
}

.pagination li a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    line-height: 45px;
    text-align: center;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: #666;
    font-weight: 500;
    border: 2px solid transparent;
    background: white;
}

.pagination li a:hover:not(.disabled-link) {
    background: #f8f9fa;
    border-color: #e0e0e0;
    color: #667eea;
    transform: translateY(-2px);
}

.pagination li.active a {
    background: #667eea;
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.pagination li.disabled a {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination li.disabled a:hover {
    background: white;
    border-color: transparent;
    transform: none;
}

/* 响应式设计 - 分页 */
@media (max-width: 768px) {
    .pagination {
        padding: 10px 0;
    }
    
    .pagination ul {
        flex-wrap: wrap;
        justify-content: center;
        padding: 8px 10px;
    }
    
    .pagination li {
        margin: 2px;
    }
    
    .pagination li a {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 0.9rem;
        border-radius: 6px;
    }
}

@media (max-width: 480px) {
    .pagination ul {
        padding: 6px 8px;
    }
    
    .pagination li a {
        width: 36px;
        height: 36px;
        line-height: 36px;
        font-size: 0.85rem;
    }
}

/* 页脚样式 */
.site-footer {
    background-color: #2c3e50;
    color: white;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.footer-section h3 {
    margin-bottom: 20px;
    font-size: 18px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background-color: #3498db;
}

.about p {
    color: #bdc3c7;
    margin-bottom: 20px;
}

.social-links {
    display: flex;
    gap: 10px;
}

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #34495e;
    color: white;
    text-align: center;
    line-height: 40px;
    transition: background-color 0.3s;
}

.social-links a:hover {
    background-color: #3498db;
}

.links ul li {
    margin-bottom: 10px;
}

.links ul li a {
    color: #bdc3c7;
    transition: color 0.3s;
}

.links ul li a:hover {
    color: #3498db;
    padding-left: 5px;
}

.contact ul li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #bdc3c7;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #34495e;
    color: #bdc3c7;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .content-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .category-nav ul {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
}

/* 响应式设计 - 导航自适应 */
/* 中等屏幕尺寸 - 当导航开始可能显示不完整时提前切换到更紧凑的布局 */
@media (max-width: 1024px) {
    .nav-links {
        gap: 20px;
    }
    
    .logo a {
        font-size: 20px;
    }
}

/* 平板和移动设备 - 完全切换到汉堡菜单 */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: white;
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        z-index: 99;
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .user-actions {
        display: none;
        position: absolute;
        top: calc(100% + 180px); /* 动态计算位置，确保在导航下方 */
        left: 0;
        width: 100%;
        background-color: white;
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        z-index: 98;
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-links.show {
        display: flex;
    }
    
    .user-actions.show {
        display: flex;
        top: calc(100% + 180px); /* 确保在导航下方显示 */
    }
    
    .site-header .container {
        height: auto;
        padding: 15px 0;
    }
    
    /* 确保导航项在移动菜单中完整显示 */
    .nav-links a {
        width: 100%;
        padding: 8px 0;
    }
    
    .journal-cards {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
    }
    
    .pagination ul {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .search-box {
        flex-direction: column;
    }
    
    .search-box input, .search-btn {
        width: 100%;
        border-radius: 4px;
    }
    
    .search-btn {
        margin-top: 10px;
    }
    
    .list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    /* 返回顶部按钮移动端样式 */
    .back-to-top {
        bottom: 20px !important;
        right: 20px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 16px !important;
    }
}