:root {
    --primary: #1E3A8A;
    --primary-dark: #172554;
    --secondary: #3B82F6;
    --text: #000000;
    --subtext: #4B5563;
    --background: #FFFFFF;
    --background-light: #F3F4F6;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --border: #E5E7EB;
    --nature: #008a00;
    --nature-light: #e8f5e9;
    --highlight: #FFD700;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', 'Inter', sans-serif;
    color: var(--text);
    line-height: 1.6;
    background-color: var(--background);
}

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

/* 页面标题栏 */
.page-header {
    background-color: #f8f9fa;
    padding: 3rem 0 2rem;
    text-align: center;
}

/* 搜索框样式 */
.search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    width: 100%;
}

.search-box {
    display: flex;
    width: 100%;
    max-width: 600px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: 30px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
    font-family: 'Noto Sans SC', sans-serif;
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.2);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s;
}

.search-btn:hover {
    background: var(--primary-dark);
}

.search-icon {
    font-style: normal;
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .search-box {
        max-width: 100%;
    }
    
    .search-box input {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .search-btn {
        width: 36px;
        height: 36px;
    }
}

.page-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-title span {
    color: var(--highlight);
}

.page-description {
    max-width: 800px;
    margin: 0 auto;
    color: var(--subtext);
}

/* 标签筛选 */
.filter-bar {
    background-color: white;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--background-light);
    margin-bottom: 1rem;
}

/* 为 Subject Filter 调整样式 */
#subjectFilter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    justify-content: center;
    padding: 0.5rem 0;
}

.tags-filter {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0 auto;
    justify-content: center;
}

.tag-pill {
    background-color: var(--background-light);
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text);
    white-space: nowrap;
}

.tag-pill:hover {
    background-color: #e8f0fe;
    border-color: #c6d8f9;
}

.tag-pill.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Nature数据期刊样式 */
.nature-section {
    padding: 1rem 0 3rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--primary);
    position: relative;
    padding-left: 1rem;
    border-left: 5px solid var(--primary);
}

.paper-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.paper-card {
    border-bottom: 1px solid #eee;
    padding: 1rem;
    background-color: white;
    transition: background-color 0.2s;
}

.paper-card:hover {
    background-color: #f9f9f9;
}

.paper-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.voting {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 1rem;
    min-width: 40px;
}

.vote-count {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--subtext);
}

.vote-icon {
    color: #FF6600;
    font-size: 1.2rem;
}

.paper-content {
    flex: 1;
}

.paper-title {
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.paper-cn-title {
    color: var(--text);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.paper-abstract {
    color: var(--subtext);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.paper-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.8rem;
    color: var(--subtext);
    margin: 0.5rem 0;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.paper-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.paper-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.paper-tag {
    background-color: var(--background-light);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--subtext);
}

.paper-link {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    transition: color 0.3s;
}

.paper-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* 刷新按钮区域 */
.refresh-section {
    text-align: center;
    padding: 1rem 0 2rem;
}

.refresh-btn {
    background-color: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.refresh-btn:hover {
    background-color: var(--primary-dark);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.page-item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: background-color 0.3s;
}

.page-item:hover {
    background-color: var(--background-light);
}

.page-item.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    width: 80%;
    max-width: 800px;
}

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

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.close-btn {
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--subtext);
}

.close-btn:hover {
    color: var(--danger);
}

.modal-body {
    max-height: 60vh;
    overflow-y: auto;
    padding: 1rem 0;
}

.text-muted {
    color: var(--subtext);
}

.mb-3 {
    margin-bottom: 1rem;
}

.modal-footer {
    border-top: 1px solid #eee;
    padding-top: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.close-btn-secondary {
    background-color: #eee;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.close-btn-secondary:hover {
    background-color: #ddd;
}

.list-group {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-group-item {
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
}

/* 加载指示器 */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    color: white;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* 状态消息 */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

.alert-info {
    background-color: #e6f7ff;
    border: 1px solid #91d5ff;
    color: #1890ff;
}

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

.alert-danger {
    background-color: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
}

/* 页脚样式 */
.footer {
    background-color: #f5f5f5;
    margin-top: 3rem;
    color: #555;
    font-size: 14px;
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 2rem 0;
}

.footer-section {
    margin-bottom: 1.5rem;
    min-width: 200px;
    flex: 1;
}

.footer-info {
    flex: 2;
}

.footer-logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

.footer-description {
    color: #666;
    line-height: 1.5;
}

.footer-links h4, .footer-contact h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #444;
    font-weight: 600;
}

.footer-links ul {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a, .footer-contact a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover, .footer-contact a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.footer-bottom {
    background-color: #eaeaea;
    padding: 1rem 0;
    text-align: center;
    border-top: 1px solid #ddd;
}

.copyright {
    color: #777;
    font-size: 0.9rem;
}

/* 响应式页脚设计 */
@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-section {
        margin-bottom: 2rem;
    }
    
    .footer-links ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .footer-links li {
        margin-bottom: 0;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .paper-header {
        flex-direction: column;
    }
    
    .voting {
        flex-direction: row;
        margin-bottom: 1rem;
        margin-right: 0;
    }
    
    .vote-icon {
        margin-right: 0.5rem;
    }
    
    .paper-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
}

/* 日期分隔器样式 */
.date-separator {
    position: relative;
    margin: 1.5rem 0 1rem;
    text-align: left;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--background-light);
}

.date-separator h3 {
    display: inline-block;
    background-color: transparent;
    color: var(--text);
    padding: 0.4rem 0;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

/* 同一日期下的文章组 */
.date-articles-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* 期刊标识 */
.journal-badge {
    background-color: var(--nature-light);
    color: var(--nature);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* DOI标识 */
.doi-badge {
    font-size: 0.75rem;
    color: var(--subtext);
}

/* 响应式设计补充 */
@media (max-width: 768px) {
    .date-separator {
        margin: 1.2rem 0 0.8rem;
    }
    
    .date-separator h3 {
        font-size: 1rem;
        padding: 0.3rem 0;
    }
}