/* 
 * 🏥 Style: GemOS Elite Medical-Journal
 * Version: 5.3.0 (The Aesthetic Journal - 2026 Edition)
 * Standard: GemOS Style Protocol v1.0
 * Author: GemOS SOTA Agent
 */

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

:root {
    --msa-primary: #020617;
    --msa-text-body: #1e293b; /* High-contrast Slate 800 for maximum readability */
    --msa-text-muted: #64748b;
    --msa-border-main: rgba(0,0,0,0.06); /* Lighter border */
    --msa-border-bold: #cbd5e1;
    --msa-card-bg: #ffffff;

    /* Dynamic Theme Defaults */
    --msa-theme-core: #2563eb;
    --msa-theme-soft: #eff6ff;
    --msa-bg-mesh: radial-gradient(at 0% 0%, #f8fafc 0, transparent 50%),
        radial-gradient(at 100% 0%, #f1f5f9 0, transparent 50%);
    --msa-theme-core-rgb: 225, 29, 72;
    /* Default for pathology (rose) */
}

/* Theme RGB Overrides (Used for glows and transparency) */
body.theme-pathology {
    --msa-theme-core-rgb: 225, 29, 72;
}

body.theme-acute {
    --msa-theme-core-rgb: 37, 99, 235;
}

body.theme-recovery {
    --msa-theme-core-rgb: 5, 150, 105;
}

body.theme-myths {
    --msa-theme-core-rgb: 124, 58, 237;
}

body.theme-neural {
    --msa-theme-core-rgb: 79, 70, 229;
}

body.theme-training {
    --msa-theme-core-rgb: 245, 158, 11;
}

/* 🎨 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: 'Noto Sans TC', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--msa-text-body);
    background: #f1f5f9;
    background-image: var(--msa-bg-mesh);
    background-attachment: fixed;
    line-height: 1.85; /* SOTA High Readability line height */
    letter-spacing: 0.01em;
    margin: 0;
    min-height: 100vh;
}

h1,
h2,
h3,
h4 {
    font-family: 'Noto Sans TC', 'Inter', sans-serif;
    font-weight: 800;
    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.02), 0 20px 50px -12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid var(--msa-border-main);
}

/* 🚀 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: 2.5rem; /* Increased vertical space */
    color: var(--msa-text-body);
}

.prose-content h2 {
    font-size: 1.85rem;
    margin: 5rem 0 2rem 0;
    color: var(--msa-theme-core);
    border-bottom: 2px solid var(--msa-theme-soft);
    padding-bottom: 1rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    text-shadow: 0 0 30px rgba(var(--msa-theme-core-rgb), 0.1);
}

/* 🍎 Apple-esque Icon Spacing */
.prose-content h4 i,
.msa-info-box i,
.msa-takeaway h3 i,
.msa-nav-btn i {
    margin-right: 0.75rem;
}

/* 🏆 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: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.5);
    padding: 2rem;
    border-radius: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), inset 0 0 20px rgba(255, 255, 255, 0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
    display: flex;
    flex-direction: column;
}

.msa-info-box:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--msa-theme-core);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
}

.msa-info-box i {
    width: 3.5rem;
    height: 3.5rem;
    background: var(--msa-theme-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    font-size: 1.5rem;
    color: var(--msa-theme-core);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.msa-info-box:hover i {
    background: var(--msa-theme-core);
    color: white;
    transform: rotate(-5deg);
}

.msa-info-box .title {
    font-weight: 900;
    display: block;
    margin-bottom: 0.75rem;
    color: var(--msa-primary);
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

.msa-info-box .desc {
    font-size: 0.9rem;
    color: var(--msa-text-muted);
    line-height: 1.625;
}

/* 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 (SOTA v18.5 Mobile-Responsive Architecture) */
/* Table styling is consolidated under section XI in this file */

/* 🃏 Hybrid Cards */
.msa-takeaway {
    background: var(--msa-theme-soft);
    border-radius: 1.5rem;
    padding: 2.5rem;
    margin: 4rem 0;
    border: 1.5px solid var(--msa-theme-core);
    position: relative;
    box-shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.05);
}

.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 & Series Nav (SOTA v39.2 3-Button Standard) */
.msa-footer-nav,
.msa-series-nav {
    display: flex;
    gap: 1.25rem;
    padding: 2.5rem 3rem;
    background: #f8fafc;
    border-top: 1.5px solid var(--msa-border-main);
    align-items: stretch;
}

.msa-nav-btn {
    flex: 1;
    padding: 1.5rem;
    background: #ffffff;
    text-decoration: none;
    border-radius: 1.25rem;
    border: 1px solid var(--msa-border-main);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.msa-nav-btn.catalog {
    flex: 0 0 180px;
    text-align: center;
    align-items: center;
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.msa-nav-btn.catalog:hover {
    background: var(--msa-theme-core);
    border-color: var(--msa-theme-core);
}

.msa-nav-btn.catalog:hover .label,
.msa-nav-btn.catalog:hover .title {
    color: #ffffff !important;
}

.msa-nav-btn .label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--msa-theme-core);
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.msa-nav-btn.next .label {
    justify-content: flex-end;
}

.msa-nav-btn.catalog .label {
    justify-content: center;
    color: #475569;
}

.msa-nav-btn .title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--msa-text-heading);
    line-height: 1.4;
}

.msa-nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.15);
    border-color: var(--msa-theme-core);
}
}

.msa-nav-btn:hover {
    transform: translateY(-5px);
    border-color: var(--msa-theme-core);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08);
}

.msa-nav-btn .label,
.msa-nav-btn .title {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.msa-nav-btn:hover .label,
.msa-nav-btn:hover .title {
    transform: translateX(5px);
}

.msa-nav-btn.next:hover .label,
.msa-nav-btn.next:hover .title {
    transform: translateX(-5px);
}

.msa-nav-btn .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--msa-text-muted);
    margin-bottom: 0.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.msa-nav-btn .label i {
    font-size: 1rem;
    color: var(--msa-theme-core);
    opacity: 0.6;
    transition: transform 0.3s ease;
}

.msa-nav-btn:hover .label i {
    transform: scale(1.2);
    opacity: 1;
}

.msa-nav-btn .title {
    font-weight: 900;
    color: var(--msa-primary);
    font-size: 1.15rem;
    line-height: 1.3;
    position: relative;
    z-index: 10;
}

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

/* 📊 Data Plate (Journal Style Figure) */
.msa-data-plate {
    background: #f8fafc;
    border-top: 4px solid var(--msa-theme-core);
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 2.5rem;
    border-radius: 0.5rem 1.5rem 1.5rem 0.5rem;
    margin: 4rem 0;
    position: relative;
    box-shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.05);
}

.msa-data-plate .figure-label {
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--msa-theme-core);
    display: block;
    margin-bottom: 1.25rem;
}

.msa-data-plate h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

/* 🌈 Premium Box Variants (Apple Refined - Partial Borders) */
.msa-visual-container {
    border: 1px solid rgba(0,0,0,0.05) !important;
    border-top: 3px solid var(--msa-theme-core) !important;
    padding: 3rem !important; /* Massive padding */
    border-radius: 1.5rem !important; /* Apple curve */
    background: #fff;
    box-shadow: 0 15px 50px -15px rgba(0, 0, 0, 0.05); /* Apple soft drop shadow */
}

.msa-soft-box {
    border: 1px solid rgba(0,0,0,0.05) !important;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255,255,255,0.6) 100%) !important;
    backdrop-filter: blur(8px);
    box-shadow: 0 15px 50px -15px rgba(0, 0, 0, 0.05); /* Soft premium shadow */
    border-radius: 1.5rem;
    padding: 3rem 3.5rem; /* Expansive whitespace */
    margin: 4rem 0;
    position: relative;
    transition: all 0.4s ease;
}

.msa-border-left {
    border-left: 3px solid var(--msa-theme-core) !important; /* Elegant thin line */
    padding-left: 3rem;
    border-radius: 0.5rem 1.5rem 1.5rem 0.5rem;
}

.msa-border-right {
    border-right: 3px solid var(--msa-theme-core) !important;
    border-radius: 1.5rem 0.5rem 0.5rem 1.5rem;
}

/* Callout Box Uniform Pattern (Apple Style) */
.bg-blue-50, .bg-amber-50, .bg-emerald-50, .bg-violet-50, .bg-red-50, .bg-teal-50, .bg-indigo-50 {
    border: 1px solid rgba(0,0,0,0.04) !important;
    border-radius: 1.5rem !important;
    padding: 3rem 3.5rem !important; /* Huge white space */
}

.bg-blue-50 {
    border-left: 3px solid #3b82f6 !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%) !important;
    box-shadow: 0 15px 45px -10px rgba(59, 130, 246, 0.05);
}

.bg-amber-50 {
    border-left: 3px solid #f59e0b !important;
    background: linear-gradient(135deg, #ffffff 0%, #fffdf5 100%) !important;
    box-shadow: 0 15px 45px -10px rgba(245, 158, 11, 0.05);
}

.bg-emerald-50 {
    border-left: 3px solid #10b981 !important;
    background: linear-gradient(135deg, #ffffff 0%, #f7fdfa 100%) !important;
    box-shadow: 0 15px 45px -10px rgba(16, 185, 129, 0.05);
}

.bg-violet-50 {
    border-left: 3px solid #8b5cf6 !important;
    background: linear-gradient(135deg, #ffffff 0%, #faf8ff 100%) !important;
    box-shadow: 0 15px 45px -10px rgba(139, 92, 246, 0.05);
}

.bg-red-50 {
    border-left: 3px solid #ef4444 !important;
    background: linear-gradient(135deg, #ffffff 0%, #fffafa 100%) !important;
    box-shadow: 0 15px 45px -10px rgba(239, 68, 68, 0.05);
}

.bg-teal-50 {
    border-left: 3px solid #14b8a6 !important;
    background: linear-gradient(135deg, #ffffff 0%, #f5fcfc 100%) !important;
    box-shadow: 0 15px 45px -10px rgba(20, 184, 166, 0.05);
}

.bg-indigo-50 {
    border-left: 3px solid #6366f1 !important;
    background: linear-gradient(135deg, #ffffff 0%, #f7f7ff 100%) !important;
    box-shadow: 0 15px 45px -10px rgba(99, 102, 241, 0.05);
}

/* 🖼️ Image Placeholder & Figure Standards (IMAGE_ASSET_PROTOCOL v1.0) */
.img-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #f1f5f9;
    border: 2px dashed #cbd5e1;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #94a3b8;
    font-size: 0.85rem;
    margin-top: 1rem;
}

.img-placeholder i {
    font-size: 2rem;
    color: #cbd5e1;
    margin-bottom: 0;
    background: transparent;
}

figure {
    margin: 1.5rem 0 0 0;
}

figure img {
    width: 100%;
    height: auto;
    border-radius: 0.75rem;
    display: block;
}

figcaption {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 0.5rem;
    line-height: 1.5;
}

.img-credit {
    display: inline-block;
    margin-top: 0.2rem;
    opacity: 0.75;
}

.img-credit a {
    color: #94a3b8;
    text-decoration: underline;
}

/* ======================================================================
   X. Series Navigation & Portal Architecture (SOTA Pagination)
   ====================================================================== */
.msa-series-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5rem;
    padding-top: 3rem;
    border-top: 1px solid rgba(0,0,0,0.06);
    flex-wrap: wrap;
    gap: 1rem;
}

.msa-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.85rem 1.75rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.08);
    color: var(--msa-text-body);
    box-shadow: 0 4px 15px -5px rgba(0,0,0,0.04);
}

.msa-nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -8px rgba(0,0,0,0.1);
    border-color: rgba(0,0,0,0.15);
    color: var(--msa-primary);
}

.msa-nav-portal {
    background: var(--msa-theme-core);
    color: #ffffff;
    border: none;
    box-shadow: 0 8px 25px -8px var(--msa-theme-core);
}

.msa-nav-portal:hover {
    background: var(--msa-primary);
    color: #ffffff;
}

@media (max-width: 640px) {
    .msa-container {
        margin: 0;
        border-radius: 0;
    }

    .prose-content,
    header,
    .msa-medical-warning,
    .msa-footer-nav {
        padding: 1.5rem;
    }

    .msa-footer-nav {
        flex-direction: column;
        gap: 0.75rem;
    }

    header h1 {
        font-size: 2rem;
    }
} /* --- Image Zoom on Hover --- */ figure img, .msa-visual-grid img { transition: transform 0.3s ease; transform-origin: center; } figure img:hover, .msa-visual-grid img:hover { transform: scale(1.8); position: relative; z-index: 999; cursor: zoom-in; box-shadow: 0 10px 30px rgba(0,0,0,0.3); border-radius: 4px; } figure, .msa-visual-grid { overflow: visible !important; }  /* --- Full width vertical images --- */ .msa-visual-grid figure { grid-column: 1 / -1; margin-bottom: 2rem; } .msa-visual-grid figure img { width: 100%; height: auto; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); } 

/* ======================================================================
   XI. Requires Illustration Layout (Dynamic Image-Text Integration)
   ====================================================================== */
requires-illustration {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 3rem 0;
    width: 100%;
}

.left-illustration,
.right-illustration {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 1.25rem;
    padding: 2rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.02), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.left-illustration:hover,
.right-illustration:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
}

.left-illustration {
    border-top: 4px solid #94a3b8; /* Neutral border-top */
}

.right-illustration {
    border-top: 4px solid var(--msa-theme-core); /* Theme core color border-top */
}

.left-illustration h4,
.right-illustration h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.left-illustration p,
.right-illustration p {
    margin-bottom: 0;
    font-size: 0.975rem;
    line-height: 1.6;
}

/* Premium img-placeholder styles inside requires-illustration */
requires-illustration .img-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1.5px dashed #cbd5e1;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.85rem;
    margin: 1.25rem 0;
    transition: all 0.3s ease;
}

requires-illustration .img-placeholder:hover {
    background: linear-gradient(135deg, #eff6ff 0%, #eff6ff 100%);
    border-color: var(--msa-theme-core);
    color: var(--msa-theme-core);
}

requires-illustration .img-placeholder i {
    font-size: 1.75rem;
    color: #94a3b8;
    transition: color 0.3s ease;
}

requires-illustration .img-placeholder:hover i {
    color: var(--msa-theme-core);
}

@media (max-width: 768px) {
    requires-illustration {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Standardized Dual-Author Card Classes (SOTA v14.0 Zero-Inline-Styles Compliance) */
.msa-dual-author-card {
    background: #f8fafc;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin: 25px 0;
    font-family: sans-serif;
    line-height: 1.6;
}
.msa-author-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.msa-author-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.msa-author-badge {
    background: #3b82f6;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
}
.msa-author-name {
    font-weight: 700;
    color: #1e293b;
    font-size: 1.1rem;
}
.msa-author-link {
    position: relative;
    z-index: 50;
    pointer-events: auto;
    color: inherit;
    text-decoration: underline;
    text-decoration-color: #3b82f6;
    text-underline-offset: 4px;
    transition: color 0.2s;
}
.msa-author-link:hover {
    color: #2563eb;
}
.msa-author-institution {
    color: #64748b;
    font-size: 0.9rem;
}
.msa-sponsor-row {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px dashed #cbd5e1;
    font-size: 0.85rem;
    color: #475569;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.msa-sponsor-title {
    font-weight: bold;
    color: #0f172a;
}

.msa-formula {
    background: #f1f5f9;
    padding: 15px;
    border-radius: 8px;
    font-family: monospace;
    text-align: center;
    margin: 15px 0;
}

 
/* --- PT-MT Knee Series Remastering Overrides (SOTA v16.0 Zero-Inline-Styles Compliance) --- */
.msa-preface {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--msa-text-body);
    margin-bottom: 2rem;
}
.msa-tldr {
    border-left: 4px solid var(--msa-theme-core);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background: #f8fafc;
    border-radius: 0 8px 8px 0;
    font-size: 1rem;
    line-height: 1.6;
}
.msa-sponsor-left {
    display: flex;
    align-items: center;
}
.msa-sponsor-time {
    font-size: 0.75rem;
    color: #64748b;
    display: flex;
    gap: 12px;
}
.msa-eeat-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    margin: 3rem 0;
    font-size: 0.9rem;
    font-family: sans-serif;
}
.msa-eeat-title {
    font-size: 1.1rem;
    color: var(--msa-theme-core);
    display: block;
    margin-bottom: 12px;
    font-weight: bold;
}
.msa-eeat-meta p {
    margin: 6px 0;
    color: #475569;
    line-height: 1.6;
}
.msa-cta-box {
    background: var(--msa-theme-soft);
    border-left: 4px solid var(--msa-theme-core);
    padding: 24px;
    border-radius: 0 12px 12px 0;
    margin: 3rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}
.msa-cta-title {
    font-size: 1.15rem;
    color: var(--msa-theme-core);
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}
.msa-cta-content {
    font-size: 0.95rem;
    color: #475569;
    margin-bottom: 16px;
    line-height: 1.6;
}
.msa-cta-btn {
    display: inline-block;
    background: var(--msa-theme-core);
    color: white !important;
    font-weight: bold;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    transition: opacity 0.2s;
}
.msa-cta-btn:hover {
    opacity: 0.9;
}
.msa-analogy-box {
    font-style: italic;
    color: #34495e;
    background: #f1f2f6;
    padding: 16px;
    border-radius: 8px;
    margin: 2rem 0;
    line-height: 1.6;
}
/* --- 🧜‍♀️ Mermaid Interactivity & High Readability Overrides (SOTA v39.3) --- */
.mermaid-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    margin: 2.5rem 0;
    overflow-x: auto;
    position: relative;
    padding: 1.5rem 1rem;
    background: #f8fafc;
    border: 1px solid var(--msa-border-main);
    border-radius: 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    cursor: zoom-in;
    transition: all 0.3s ease;
}

.mermaid-container:hover {
    border-color: var(--msa-theme-core);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.12);
}

.mermaid-zoom-badge {
    position: absolute;
    top: 12px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #cbd5e1;
    padding: 3px 10px;
    border-radius: 9999px;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    user-select: none;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 10;
}

.mermaid-container:hover .mermaid-zoom-badge {
    color: var(--msa-theme-core);
    border-color: #93c5fd;
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.15);
}

.mermaid-zoom-badge svg {
    width: 12px !important;
    height: 12px !important;
    min-width: 12px !important;
    max-width: 12px !important;
    margin: 0 !important;
    display: inline-block !important;
    fill: currentColor;
}

.mermaid-container pre.mermaid,
.mermaid-container div.mermaid,
.mermaid-container > pre.mermaid svg,
.mermaid-container > div.mermaid svg,
.mermaid-container > svg {
    margin: 0 auto !important;
    text-align: center !important;
    display: block !important;
    max-width: 100% !important;
    height: auto !important;
}

/* Force readable font sizes and prevent text truncation on desktop & mobile */
.mermaid svg foreignObject {
    overflow: visible !important;
}

.mermaid svg foreignObject div {
    overflow: visible !important;
    word-break: keep-all !important;
    white-space: normal !important;
    line-height: 1.4 !important;
    display: inline-block !important;
    padding: 2px 6px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    font-family: 'Inter', system-ui, sans-serif !important;
}

.mermaid svg text,
.mermaid svg .node label,
.mermaid svg .label {
    font-size: 15px !important;
    font-weight: 600 !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    overflow: visible !important;
}

.mermaid svg .edgeLabel text,
.mermaid svg .edgeLabel foreignObject div {
    font-size: 13px !important;
    font-weight: 500 !important;
}

/* Mermaid Interactive Pan & Zoom Fullscreen Modal (SOTA v39.4) */
.mermaid-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(8px);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    box-sizing: border-box;
}

.mermaid-modal-overlay.active {
    display: flex;
}

.mermaid-modal-box {
    background: #ffffff;
    border-radius: 1.5rem;
    padding: 1.25rem 1.5rem;
    width: 92vw;
    height: 88vh;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.mermaid-modal-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 0.75rem;
    user-select: none;
}

.mermaid-modal-hint {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.mermaid-tool-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.mermaid-tool-btn:hover {
    background: var(--msa-theme-core);
    color: #ffffff;
    border-color: var(--msa-theme-core);
}

.mermaid-modal-close {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #ef4444;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    margin-left: 0.5rem;
    transition: all 0.2s;
}

.mermaid-modal-close:hover {
    background: #ef4444;
    color: #ffffff;
}

.mermaid-modal-stage {
    flex: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    cursor: grab;
    background: #fafafa;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    border: 1px solid #e2e8f0;
}

.mermaid-modal-wrapper {
    transition: transform 0.05s linear;
    transform-origin: center center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
}

.mermaid-modal-wrapper svg {
    max-width: none !important;
    max-height: none !important;
    width: auto !important;
    height: auto !important;
    min-width: 500px !important;
    max-height: 80vh !important;
    overflow: visible !important;
}

.mermaid-modal-wrapper svg * {
    overflow: visible !important;
}

.mermaid-modal-wrapper svg foreignObject {
    overflow: visible !important;
}

.mermaid-modal-wrapper svg foreignObject div {
    overflow: visible !important;
    word-break: keep-all !important;
    white-space: normal !important;
    line-height: 1.4 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    font-family: 'Inter', system-ui, sans-serif !important;
}

.mermaid-modal-wrapper svg text,
.mermaid-modal-wrapper svg .node label,
.mermaid-modal-wrapper svg .label {
    font-size: 15px !important;
    font-weight: 600 !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    overflow: visible !important;
}

@media (max-width: 640px) {
    .mermaid-container {
        padding: 1rem 0.5rem;
    }
    .mermaid-container svg {
        min-width: 480px;
    }
}

.mermaid-link-container,
.mermaid-container .mermaid-link {
    text-align: center;
    margin-top: 8px;
    margin-bottom: 16px;
    display: inline-block;
}
.mermaid-link {
    font-size: 0.8rem;
    color: var(--msa-theme-core);
    text-decoration: underline;
}
.msa-comparison.three-cols th:nth-child(1) { width: 20%; }
.msa-comparison.three-cols th:nth-child(2) { width: 40%; }
.msa-comparison.three-cols th:nth-child(3) { width: 40%; }

/* --- 🍎 Apple Scientific Table Remastering (SOTA v18.5 Responsive Table Architecture) --- */
.msa-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin: 2.5rem 0;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
}

.msa-comparison,
.msa-comparison-table {
    width: 100%;
    min-width: 580px; /* Ensures table doesn't get squished below 580px, triggering smooth horizontal scroll on mobile */
    border-collapse: collapse;
    margin: 0 !important;
    font-size: 0.95rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    table-layout: auto !important; /* Auto column sizing based on content density */
}

.msa-comparison th,
.msa-comparison-table th {
    background: #f8fafc;
    color: #0f172a;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding: 14px 20px !important;
    border-bottom: 2px solid #cbd5e1;
    text-transform: uppercase;
    text-align: left;
}

.msa-comparison.two-cols th:nth-child(1),
.msa-comparison-table.two-cols th:nth-child(1) { width: 32%; }
.msa-comparison.two-cols th:nth-child(2),
.msa-comparison-table.two-cols th:nth-child(2) { width: 68%; }

.msa-comparison.three-cols th:nth-child(1),
.msa-comparison-table.three-cols th:nth-child(1) { width: 22%; }
.msa-comparison.three-cols th:nth-child(2),
.msa-comparison-table.three-cols th:nth-child(2) { width: 39%; }
.msa-comparison.three-cols th:nth-child(3),
.msa-comparison-table.three-cols th:nth-child(3) { width: 39%; }

.msa-comparison td,
.msa-comparison-table td {
    padding: 16px 20px !important;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    line-height: 1.6;
    vertical-align: top !important; /* Top-align across rows for effortless scanning */
}

.msa-comparison tr:nth-child(even) td,
.msa-comparison-table tr:nth-child(even) td {
    background: #fdfdfe;
}

.msa-comparison tr:hover td,
.msa-comparison-table tr:hover td {
    background: #f8fafc;
}

.msa-comparison td strong,
.msa-comparison-table td strong {
    color: #0f172a;
    font-weight: 700;
    display: inline-block;
}

/* Key Column Styling: 3+ Column Matrix Tables vs 2-Column Comparison Tables */
.msa-comparison.three-cols td:first-child,
.msa-comparison-table.three-cols td:first-child,
.msa-comparison.four-cols td:first-child,
.msa-comparison-table.four-cols td:first-child {
    font-weight: 700;
    color: #0f172a;
    background: #f8fafc;
    border-right: 1.5px solid #cbd5e1;
    white-space: nowrap;
}

.msa-comparison.two-cols td:first-child,
.msa-comparison-table.two-cols td:first-child {
    font-weight: 700;
    color: #0f172a;
    background: #ffffff;
    border-right: 1.5px solid #e2e8f0;
    white-space: normal;
}

/* Specific Myth vs Fact styling when classes exist */
.msa-comparison td.col-myth,
.msa-comparison-table td.col-myth {
    color: #be123c;
    font-weight: 600;
    white-space: normal;
}

.msa-comparison td.col-fact,
.msa-comparison-table td.col-fact {
    color: #0f172a;
    font-weight: 500;
    white-space: normal;
}

@media (max-width: 640px) {
    .msa-comparison th, .msa-comparison-table th,
    .msa-comparison td, .msa-comparison-table td {
        padding: 12px 14px !important;
        font-size: 0.88rem;
    }
}

/* ════════════════════════════════════════
   SOTA v18.0 - Premium Soft Border Callout Box Styles
   ════════════════════════════════════════ */
.msa-soft-card {
    margin: 3.5rem 0;
    padding: 3.5rem 4rem;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.02);
    line-height: 1.85;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.02), 0 1px 3px rgba(0, 0, 0, 0.01);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}
.msa-soft-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.04), 0 1px 5px rgba(0, 0, 0, 0.01);
}
.msa-theme-pathology {
    background: linear-gradient(135deg, #fff5f5 0%, #fffdfd 100%);
    border-left: 4px solid #be123c;
    border-color: rgba(190, 18, 60, 0.06);
}
.msa-theme-acute {
    background: linear-gradient(135deg, #f0f7ff 0%, #fbfdff 100%);
    border-left: 4px solid #2563eb;
    border-color: rgba(37, 99, 235, 0.06);
}
.msa-theme-recovery {
    background: linear-gradient(135deg, #f0fdf4 0%, #fbfefc 100%);
    border-left: 4px solid #047857;
    border-color: rgba(4, 120, 87, 0.06);
}
.msa-theme-myths {
    background: linear-gradient(135deg, #fdfaff 0%, #fffeff 100%);
    border-left: 4px solid #6d28d9;
    border-color: rgba(109, 40, 217, 0.06);
}
.msa-theme-neural {
    background: linear-gradient(135deg, #f5f7ff 0%, #fbfdff 100%);
    border-left: 4px solid #4f70ed;
    border-color: rgba(79, 112, 237, 0.06);
}
.msa-theme-training {
    background: linear-gradient(135deg, #fefdf0 0%, #fffefe 100%);
    border-left: 4px solid #d97706;
    border-color: rgba(217, 119, 6, 0.06);
}
@media (max-width: 640px) {
    .msa-soft-card {
        padding: 2rem 1.75rem;
        margin: 2.5rem 0;
        border-radius: 8px;
    }
}

/* ❓ SOTA FAQ Card Chunking Component */
.msa-faq {
    margin: 2.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.msa-faq-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--msa-theme-core, #2563eb);
    border-radius: 1rem;
    padding: 1.5rem 1.75rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.msa-faq-item:hover {
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.06);
    border-color: #cbd5e1;
}

.msa-faq-q {
    font-family: 'Noto Sans TC', 'Inter', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.85rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    line-height: 1.45;
}

.msa-faq-q .q-badge {
    background: var(--msa-theme-core, #2563eb);
    color: white;
    font-size: 0.75rem;
    font-weight: 900;
    padding: 0.2rem 0.55rem;
    border-radius: 0.35rem;
    flex-shrink: 0;
    margin-top: 0.15rem;
    letter-spacing: 0.05em;
}

.msa-faq-a {
    font-size: 1.02rem;
    color: #334155;
    line-height: 1.85;
    margin: 0;
    padding-left: 0.25rem;
}

/* ════════════════════════════════════════════════════════════════════
   📋 PT-MT 語意列點系統 (Semantic List System v1.0)
   四種用途：一般臨床說明 / 正向核准 / 步驟流程 / 警示紅旗
   ════════════════════════════════════════════════════════════════════ */

/* 共用基礎 */
.msa-clinical-list,
.msa-check-list,
.msa-step-list,
.msa-warn-list {
    list-style: none;
    padding: 0;
    margin: 1.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.msa-clinical-list li,
.msa-check-list li,
.msa-step-list li,
.msa-warn-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 1rem;
    line-height: 1.75;
    color: #334155;
    padding: 0.55rem 0.85rem;
    border-radius: 0.6rem;
    transition: background 0.15s ease;
}

/* ── 1. msa-clinical-list：藍色圓點 + 淡底  (一般機制說明 / 原因條列) ── */
.msa-clinical-list li::before {
    content: '';
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3b82f6;
    margin-top: 0.55rem;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.msa-clinical-list li:hover {
    background: #f0f7ff;
}

/* ── 2. msa-check-list：綠色勾 (適合：居家注意事項 / 正向行為許可清單) ── */
.msa-check-list li::before {
    content: '✓';
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #dcfce7;
    color: #15803d;
    font-size: 0.75rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.2rem;
    border: 1.5px solid #86efac;
}
.msa-check-list li:hover {
    background: #f0fdf4;
}

/* ── 3. msa-step-list：數字徽章 (適合：復健步驟 / SOP 流程 / 治療階段) ── */
.msa-step-list {
    counter-reset: step-counter;
}
.msa-step-list li {
    counter-increment: step-counter;
    padding: 0.7rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #3b82f6;
    border-radius: 0.75rem;
}
.msa-step-list li::before {
    content: counter(step-counter);
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #3b82f6;
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.15rem;
    letter-spacing: 0;
}
.msa-step-list li:hover {
    border-left-color: #1d4ed8;
    background: #f0f7ff;
}
/* 步驟標題加粗 */
.msa-step-list li strong:first-child {
    color: #1e40af;
}

/* ── 4. msa-warn-list：橘紅警示三角 (適合：紅旗症狀 / 注意事項 / 禁忌) ── */
.msa-warn-list li {
    background: #fff7f7;
    border: 1px solid #fecaca;
    border-left: 3px solid #ef4444;
    border-radius: 0.75rem;
    color: #7f1d1d;
    padding: 0.7rem 1rem;
}
.msa-warn-list li::before {
    content: '⚠';
    flex-shrink: 0;
    font-size: 0.9rem;
    color: #ef4444;
    margin-top: 0.05rem;
    filter: drop-shadow(0 0 2px rgba(239,68,68,0.3));
}
.msa-warn-list li:hover {
    background: #fff1f1;
    border-left-color: #dc2626;
}
.msa-warn-list li strong {
    color: #991b1b;
}

/* 手機適配 */
@media (max-width: 640px) {
    .msa-clinical-list li,
    .msa-check-list li,
    .msa-step-list li,
    .msa-warn-list li {
        font-size: 0.92rem;
        padding: 0.6rem 0.75rem;
    }
    .msa-step-list li,
    .msa-warn-list li {
        border-radius: 0.5rem;
    }
}

/* ════════════════════════════════════════════════════════════════════
   📱 Mermaid 手機體驗補強 (Mobile Touch Enhancement v1.1)
   問題：原 min-width: 480px 讓手機無法自適應縮放
   解決：手機改用 overflow-x scroll + touch-action + 手勢提示徽章
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* 手機上改為可水平滑動的捲動容器 */
    .mermaid-container {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
        cursor: default;
        padding: 1rem 0.75rem 0.5rem;
    }

    /* SVG 維持最小可讀寬度，讓使用者能左右滑動 */
    .mermaid-container svg,
    .mermaid-container pre.mermaid svg,
    .mermaid-container div.mermaid svg {
        min-width: 520px !important;
        max-width: none !important;
        height: auto !important;
    }

    /* 手機不顯示「點擊放大」cursor，改顯示手指滑動提示 */
    .mermaid-zoom-badge {
        display: none !important;
    }

    /* 手機版：在圖表下方顯示「← 左右滑動查看完整圖表 →」 */
    .mermaid-container::after {
        content: '← 左右滑動查看完整圖表 →';
        display: block;
        text-align: center;
        font-size: 0.72rem;
        color: #94a3b8;
        margin-top: 0.5rem;
        padding-bottom: 0.25rem;
        letter-spacing: 0.03em;
    }

    /* 手機全螢幕 Modal — 讓圖表在彈窗裡填滿螢幕 */
    .mermaid-modal-box {
        width: 98vw;
        height: 94vh;
        padding: 0.75rem 0.75rem;
        border-radius: 1rem;
    }

    .mermaid-modal-toolbar {
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .mermaid-modal-hint {
        font-size: 0.7rem;
        flex-basis: 100%;
    }

    /* 在 Modal 內，SVG 可以自由縮放 */
    .mermaid-modal-wrapper svg {
        min-width: 300px !important;
    }
}

/* 平板 (768px–1024px)：維持可用，稍微縮小字體 */
@media (min-width: 769px) and (max-width: 1024px) {
    .mermaid-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .mermaid-container svg {
        min-width: 480px;
    }
}
