/* 
 * 🏥 Style: Medical Scientific American (Elite Flagship Edition)
 * Version: 5.2.0 (The Aesthetic Journal - Mesh Gradient Edition)
 * Author: GemOS SOTA Agent
 */

@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400;0,700;1,400&family=Inter:wght@300;400;500;600;700;800&family=Noto+Serif+TC:wght@600;900&display=swap');

:root {
    --msa-primary: #020617;
    --msa-text-body: #1e293b;
    --msa-text-muted: #64748b;
    --msa-border-light: rgba(226, 232, 240, 0.8);
    --msa-card-bg: #ffffff;
    
    /* Dynamic Theme Defaults */
    --msa-theme-core: #2563eb;
    --msa-theme-soft: #eff6ff;
    --msa-bg-mesh: radial-gradient(at 0% 0%, #f1f5f9 0, transparent 50%), 
                  radial-gradient(at 50% 0%, #f8fafc 0, transparent 50%), 
                  radial-gradient(at 100% 0%, #e2e8f0 0, transparent 50%);
}

/* 🎨 Beautiful Theme Variations */
.theme-diagnosis { 
    --msa-theme-core: #1e40af; /* Deep Blue */
    --msa-theme-soft: #dbeafe;
    --msa-bg-mesh: radial-gradient(at 0% 0%, #eff6ff 0, transparent 50%), 
                  radial-gradient(at 100% 100%, #dbeafe 0, transparent 50%);
}
.theme-recovery { 
    --msa-theme-core: #047857; /* Emerald */
    --msa-theme-soft: #ecfdf5;
    --msa-bg-mesh: radial-gradient(at 0% 0%, #f0fdf4 0, transparent 50%), 
                  radial-gradient(at 100% 100%, #dcfce7 0, transparent 50%);
}
.theme-pathology { 
    --msa-theme-core: #be123c; /* Rose/Red */
    --msa-theme-soft: #fff1f2;
    --msa-bg-mesh: radial-gradient(at 0% 0%, #fff1f2 0, transparent 50%), 
                  radial-gradient(at 100% 100%, #ffe4e6 0, transparent 50%);
}
.theme-special { 
    --msa-theme-core: #6d28d9; /* Violet */
    --msa-theme-soft: #f5f3ff;
    --msa-bg-mesh: radial-gradient(at 0% 0%, #f5f3ff 0, transparent 50%), 
                  radial-gradient(at 100% 100%, #ede9fe 0, transparent 50%);
}
.theme-closing { 
    --msa-theme-core: #0f766e; /* Teal */
    --msa-theme-soft: #f0fdfa;
    --msa-bg-mesh: radial-gradient(at 0% 0%, #f0fdfa 0, transparent 50%), 
                  radial-gradient(at 100% 100%, #ccfbf1 0, transparent 50%);
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--msa-text-body);
    background: #f1f5f9;
    background-image: var(--msa-bg-mesh);
    background-attachment: fixed;
    line-height: 1.625;
    margin: 0;
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-family: 'Noto Serif TC', serif;
    color: var(--msa-primary);
}

/* 📦 The Container */
.msa-container {
    max-width: 820px;
    margin: 4rem auto;
    background: var(--msa-card-bg);
    border-radius: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 20px 50px -12px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid var(--msa-border-light);
}

/* 🚀 Header Upgrade */
header {
    background: #ffffff;
    padding: 4rem 4rem 2.5rem 4rem;
    border-bottom: 3px solid var(--msa-theme-core);
    position: relative;
}

header h1 {
    font-size: 2.85rem;
    line-height: 1.2;
    margin: 0;
    letter-spacing: -0.02em;
}

/* 👨‍⚕️ Author Block */
.msa-author {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
}

.msa-author .avatar {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    background: var(--msa-theme-core);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    box-shadow: 0 4px 12px -2px rgba(0,0,0,0.1);
}

.info .author-meta { font-size: 0.95rem; font-weight: 800; color: var(--msa-primary); }
.info .contributor-meta { font-size: 0.85rem; color: var(--msa-text-muted); font-weight: 500; }
.msa-meta-stats { display: flex; gap: 1rem; font-size: 0.75rem; color: #94a3b8; margin-top: 0.25rem; }

/* 📝 Content */
.prose-content { padding: 3rem 4rem; }
.prose-content p { font-size: 1.0625rem; margin-bottom: 2rem; color: #334155; }
.prose-content h2 { 
    font-size: 1.75rem; 
    margin: 4.5rem 0 1.5rem 0; 
    color: var(--msa-theme-core);
    border-bottom: 1px solid var(--msa-theme-soft);
    padding-bottom: 0.5rem;
    font-weight: 900;
}

/* 🏆 Elite Visual Components */

/* 1. Infographic Grid */
.msa-visual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.msa-info-box {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    padding: 1.5rem;
    border-radius: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
    transition: transform 0.3s ease;
}
.msa-info-box:hover { transform: translateY(-5px); border-color: var(--msa-theme-core); }
.msa-info-box i { 
    font-size: 1.5rem; 
    color: var(--msa-theme-core); 
    margin-bottom: 1rem; 
    display: block; 
}
.msa-info-box .title { font-weight: 800; display: block; margin-bottom: 0.5rem; color: var(--msa-primary); font-size: 0.95rem; }
.msa-info-box .desc { font-size: 0.85rem; color: var(--msa-text-muted); line-height: 1.5; }

/* 2. Mechanism Step Flow */
.msa-step-flow {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin: 2.5rem 0;
    padding-left: 1rem;
    border-left: 2px dashed #e2e8f0;
}
.msa-step-item {
    position: relative;
    padding-bottom: 1.5rem;
}
.msa-step-dot {
    position: absolute;
    left: -1.45rem;
    top: 0.25rem;
    width: 0.75rem;
    height: 0.75rem;
    background: var(--msa-theme-core);
    border-radius: 50%;
    border: 2px solid #fff;
}

/* 3. Comparison Table (Elite Style) */
.msa-comparison {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 3rem 0;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid #f1f5f9;
}
.msa-comparison th { background: #f8fafc; padding: 1rem; font-size: 0.8rem; text-transform: uppercase; color: var(--msa-text-muted); text-align: left; }
.msa-comparison td { padding: 1.25rem 1rem; border-top: 1px solid #f1f5f9; font-size: 0.9rem; }
.msa-comparison .highlight { font-weight: 700; color: var(--msa-theme-core); }

/* 🃏 Hybrid Cards */
.msa-takeaway {
    background: var(--msa-theme-soft);
    border-radius: 1.5rem;
    padding: 2.5rem;
    margin: 4rem 0;
    border: 1px solid rgba(0,0,0,0.03);
    position: relative;
}
.msa-takeaway::before {
    content: '\f249';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: -1.25rem;
    left: 2rem;
    background: var(--msa-theme-core);
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* 🚨 Footer Warning */
.msa-medical-warning {
    background: #fffbeb;
    padding: 2.5rem 4rem;
    border-top: 1px solid #fef3c7;
    color: #92400e;
    font-size: 0.875rem;
    line-height: 1.6;
}
.msa-medical-warning .title { font-weight: 900; display: block; margin-bottom: 0.5rem; font-size: 1rem; }

/* 🔘 Footer Nav */
.msa-footer-nav { display: flex; gap: 1px; background: #f1f5f9; border-top: 1px solid #f1f5f9; }
.msa-nav-btn { flex: 1; padding: 2rem; background: white; text-decoration: none; transition: all 0.2s; }
.msa-nav-btn:hover { background: #f8fafc; }
.msa-nav-btn.next { text-align: right; border-left: 1px solid #f1f5f9; }
.msa-nav-btn .label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; }
.msa-nav-btn .title { font-weight: 700; color: var(--msa-primary); }

.msa-references { background: #fafafa; padding: 3rem 4rem; border-top: 1px solid #f1f5f9; font-size: 0.8rem; color: #64748b; }

@media (max-width: 640px) {
    .msa-container { margin: 0; border-radius: 0; }
    .prose-content, header, .msa-medical-warning { padding: 2rem; }
}


