:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --background: #f8f9fa;
}

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

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    padding: 2rem;
    background-color: var(--background);
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
}

form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

input[type="text"] {
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1.1rem;
}

button {
    padding: 1rem 2rem;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    transition: transform 0.2s;
}

button:hover {
    transform: translateY(-2px);
}

.report-section {
    margin-top: 3rem;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.markdown-content {
    font-family: 'Inter', sans-serif;
    line-height: 1.8;
}

.markdown-content h2 {
    color: var(--primary);
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 0.5rem;
    margin: 2rem 0 1rem;
}

.evidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.article-card {
    display: block;
    padding: 1.5rem;
    border: 1px solid #eee;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9em;
}

.pmid {
    font-weight: 600;
    color: var(--secondary);
}

.evidence-strength {
    color: #27ae60;
    font-weight: 500;
}

.abstract {
    color: #666;
    margin-top: 1rem;
    font-size: 0.95em;
}

#loader {
    text-align: center;
    margin: 3rem 0;
}

.hidden {
    display: none;
}

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

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

.error-message {
    padding: 1.5rem;
    background: #ffe3e3;
    color: #c53030;
    border-radius: 8px;
    margin-top: 2rem;
    border: 2px solid #ffc9c9;
}

.error-message:before {
    content: "⚠️ ";
    margin-right: 0.5rem;
}

.pmid-group {
    font-family: monospace;
}

.pmid-link {
    color: #2c3e50;
    text-decoration: none;
    border-bottom: 1px dashed #3498db;
    transition: all 0.2s ease;
}

.pmid-link:hover {
    color: #3498db;
    border-bottom-style: solid;
    background-color: #f8f9fa;
}