* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.language-toggle {
    display: flex;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 4px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
}

.lang-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    min-width: 60px;
}

.lang-btn:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.lang-btn.active {
    background: rgba(255,255,255,0.2);
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.search-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

#queryInput {
    flex: 1;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

#queryInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#searchBtn {
    padding: 15px 25px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

#searchBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

#searchBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.database-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.database-group {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.database-group h4 {
    color: #495057;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 5px;
}

.database-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 8px;
    padding: 5px;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.database-group label:hover {
    background: #e9ecef;
}

.database-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.loading {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.results-container {
    display: grid;
    gap: 20px;
}

.result-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.result-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.4;
    margin-bottom: 8px;
}

.result-title a {
    color: inherit;
    text-decoration: none;
}

.result-title a:hover {
    color: #667eea;
}

.database-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 国际权威医学数据库 */
.badge-pubmed {
    background: #e8f5e8;
    color: #2e7d32;
}

.badge-pmc {
    background: #e8f5e8;
    color: #388e3c;
}

.badge-biorxiv {
    background: #f3e5f5;
    color: #7b1fa2;
}

.badge-medrxiv {
    background: #ffebee;
    color: #d32f2f;
}

/* 中文医学数据库 */
.badge-sinomed {
    background: #fff3e0;
    color: #e65100;
}

.badge-cma {
    background: #fce4ec;
    color: #ad1457;
}

/* 开放获取医学 */
.badge-doaj {
    background: #fff8e1;
    color: #f9a825;
}

.badge-springeropen {
    background: #e0f2f1;
    color: #00695c;
}

.badge-plos {
    background: #e8eaf6;
    color: #3f51b5;
}

.badge-mdpi {
    background: #f1f8e9;
    color: #558b2f;
}

/* 专业医学期刊 */
.badge-frontiers {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-sage {
    background: #fce4ec;
    color: #c2185b;
}

/* 理工综合 */
.badge-arxiv {
    background: #fff3e0;
    color: #f57c00;
}

.badge-ieee {
    background: #e1f5fe;
    color: #0277bd;
}

.badge-crossref {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-semantic {
    background: #f1f8e9;
    color: #689f38;
}

.result-authors {
    color: #666;
    margin-bottom: 10px;
    font-style: italic;
}

.result-abstract {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.result-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #888;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.result-date {
    font-weight: 500;
}

.result-doi {
    font-family: monospace;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
}

.error-message {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.no-results {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 15px;
    color: #666;
}



/* 面板样式 */
.panel {
    display: none;
}

.panel.active {
    display: block;
}





.references-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reference-item {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 15px;
    margin-bottom: 12px;
    border-radius: 0 8px 8px 0;
    transition: background-color 0.2s;
}

.reference-item:hover {
    background: #e9ecef;
}

.reference-citation {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin-bottom: 8px;
}

.reference-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
}

.reference-link:hover {
    text-decoration: underline;
}

.reference-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 12px;
    color: #888;
}

.copy-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.copy-btn:hover {
    background: #5a6268;
}

/* 综述写作功能样式 */
.review-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

.review-input-group {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.review-title-input {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#reviewTitle {
    width: 100%;
    padding: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.4;
}

#reviewTitle:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.review-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-group label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.option-group select {
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    font-family: inherit;
}

.option-group select:focus {
    outline: none;
    border-color: #667eea;
}

.review-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

#generateReviewBtn {
    padding: 18px 35px;
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

#generateReviewBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

#generateReviewBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.export-btn {
    padding: 18px 35px;
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.export-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(23, 162, 184, 0.4);
}

.export-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 综述结果样式 */
.review-result {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

.review-result-header {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.review-title-display {
    font-size: 1.3rem;
    font-weight: 600;
}

.review-meta {
    font-size: 0.9rem;
    opacity: 0.9;
}

.review-result-content {
    padding: 30px;
    max-height: 80vh;
    overflow-y: auto;
}

.review-text {
    line-height: 1.8;
    font-size: 16px;
    color: #333;
    margin-bottom: 30px;
    text-align: justify;
}

.review-text h2 {
    color: #2c3e50;
    font-size: 1.4rem;
    margin: 30px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

.review-text h3 {
    color: #495057;
    font-size: 1.2rem;
    margin: 25px 0 12px 0;
}

.review-text p {
    margin-bottom: 15px;
    text-indent: 2em;
}

.review-references {
    border-top: 3px solid #f0f0f0;
    padding-top: 25px;
}

.review-references-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.reference-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #e1e5e9;
    background: white;
    color: #495057;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.filter-btn:hover:not(.active) {
    border-color: #667eea;
    color: #667eea;
}

.review-reference-item {
    background: #f8f9fa;
    border-left: 4px solid #dc3545;
    padding: 15px;
    margin-bottom: 12px;
    border-radius: 0 8px 8px 0;
    transition: background-color 0.2s;
}

.review-reference-item:hover {
    background: #e9ecef;
}

.progress-indicator {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #dc3545, #c82333);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: #495057;
    font-weight: 500;
}

.progress-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.progress-step {
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
}

.progress-step.completed {
    background: #d4edda;
    color: #155724;
}

.progress-step.active {
    background: #fff3cd;
    color: #856404;
}

.progress-step.pending {
    background: #f8f9fa;
    color: #6c757d;
}

@media (max-width: 768px) {
    .input-group {
        flex-direction: column;
    }
    
    .database-selector {
        flex-direction: column;
        gap: 10px;
    }
    

    
    header h1 {
        font-size: 2rem;
    }
    

    
    .header-top {
        justify-content: center;
        margin-bottom: 15px;
    }
    
    .lang-btn {
        font-size: 12px;
        padding: 5px 10px;
        min-width: 50px;
    }
}/* 语言切换提示样
式 */
.language-change-notice {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}/* 搜索控制
按钮样式 */
.search-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.advanced-toggle {
    padding: 15px 20px;
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.advanced-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4);
}

.advanced-toggle.active {
    background: linear-gradient(135deg, #28a745, #20c997);
}

/* 高级过滤器样式 */
.advanced-filters {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.advanced-filters.hidden {
    display: none;
}

.filter-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 150px;
    flex: 1;
}

.filter-group label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.date-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-inputs input {
    flex: 1;
    min-width: 80px;
}

.date-inputs span {
    color: #6c757d;
    font-weight: 500;
}

.reset-btn {
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    align-self: flex-end;
}

.reset-btn:hover {
    background: #c82333;
}

/* 结果头部样式 */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-header.hidden {
    display: none;
}

.results-stats {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.results-stats span:first-child {
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
}

.results-stats span:last-child {
    color: #6c757d;
    font-size: 14px;
}

.export-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.export-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.export-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(23, 162, 184, 0.3);
}

.export-btn:active {
    transform: translateY(0);
}

/* 导出下拉菜单样式 */
.export-dropdown {
    position: relative;
    display: inline-block;
}

.export-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 8px 0;
    min-width: 140px;
    z-index: 1000;
    display: none;
    margin-top: 5px;
}

.export-dropdown .dropdown-menu.show {
    display: block;
}

.export-dropdown .dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: #495057;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.export-dropdown .dropdown-item:hover {
    background: #f8f9fa;
    color: #17a2b8;
}

/* 移动端下拉菜单适配 */
@media (max-width: 768px) {
    .export-dropdown .dropdown-menu {
        right: auto;
        left: 0;
        min-width: 120px;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .search-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-controls button {
        width: 100%;
    }
    
    .filter-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .date-inputs {
        flex-direction: column;
        gap: 10px;
    }
    
    .date-inputs span {
        display: none;
    }
    
    .results-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .export-controls {
        justify-content: center;
    }
    
    .export-btn {
        flex: 1;
        min-width: 80px;
    }
}