        :root {
            --cyan: #06b6d4;
            --emerald: #10b981;
            --amber: #f59e0b;
            --rose: #f43f5e;
            --dark: #030712;
            --panel: #0f172a;
            --sub: #1e293b;
            --text-main: #e5e7eb;
            --text-muted: #9ca3af;
        }

        body.light-mode {
            --dark: #f8fafc;
            --panel: #ffffff;
            --sub: #e2e8f0;
            --text-main: #0f172a; /* Slate-900: 19:1 contrast */
            --text-muted: #334155; /* Slate-700: 9.02:1 contrast (complying with AAA > 7:1) */
            --cyan: #155e75;    /* Cyan-800: 8.26:1 contrast (complying with AAA > 7:1) */
            --emerald: #065f46; /* Emerald-800: 7.83:1 contrast (complying with AAA > 7:1) */
            --amber: #92400e;   /* Amber-800: 7.41:1 contrast (complying with AAA > 7:1) */
        }

        /* 淺色模式全局覆蓋 - 專業辦公風格 */
        body.light-mode.bg-brand-darkBg, body.light-mode, body.light-mode .bg-brand-darkBg { background-color: var(--dark) !important; }
        body.light-mode .bg-brand-panelBg, 
        body.light-mode .bg-slate-900, 
        body.light-mode .bg-slate-950,
        body.light-mode .bg-\[\#0b1120\],
        body.light-mode .bg-\[\#111827\],
        body.light-mode .bg-\[\#0f172a\] { 
            background-color: var(--panel) !important; 
            border-color: var(--sub) !important;
        }
        
        body.light-mode .bg-brand-panelBg\/80,
        body.light-mode .bg-brand-panelBg\/50,
        body.light-mode .bg-brand-panelBg\/30,
        body.light-mode .bg-brand-panelBg\/20,
        body.light-mode .bg-slate-900\/80,
        body.light-mode .bg-slate-900\/60,
        body.light-mode .bg-\[\#111827\]\/80,
        body.light-mode .bg-brand-darkBg\/80 { background-color: rgba(255, 255, 255, 0.9) !important; }

        body.light-mode .bg-brand-subBg,
        body.light-mode .bg-slate-800,
        body.light-mode .bg-slate-900 { background-color: #f1f5f9 !important; }

        body.light-mode .text-white,
        body.light-mode .text-gray-200, 
        body.light-mode .text-gray-300 { color: var(--text-main) !important; }
        
        body.light-mode .text-gray-400,
        body.light-mode .text-gray-500 { color: var(--text-muted) !important; }

        body.light-mode .text-brand-cyan { color: var(--cyan) !important; }
        body.light-mode .text-brand-emerald { color: var(--emerald) !important; }
        body.light-mode .text-brand-amber { color: var(--amber) !important; }
        body.light-mode .text-brand-rose { color: #e11d48 !important; }

        body.light-mode .border-gray-800, 
        body.light-mode .border-slate-800,
        body.light-mode .border-slate-700,
        body.light-mode .border-gray-900 { border-color: var(--sub) !important; }

        body.light-mode h1, body.light-mode h2, body.light-mode h3 { color: var(--text-main) !important; }
        
        body.light-mode .from-brand-cyan, body.light-mode .to-brand-emerald {
            --tw-gradient-from: #0891b2 !important;
            --tw-gradient-to: #059669 !important;
        }

        body.light-mode input, body.light-mode select, body.light-mode textarea {
            background-color: #f8fafc !important;
            color: var(--text-main) !important;
            border: 1px solid var(--sub) !important;
        }
        body.light-mode input::placeholder { color: #94a3b8 !important; }

        body.light-mode .shadow-2xl, body.light-mode .shadow-xl {
            box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1) !important;
        }

        /* 淺色模式終端機特化 */
        body.light-mode .bg-brand-panelBg {
            background-color: #fcfcfc !important;
            border: 1px solid #d1d5db !important;
        }
        body.light-mode .text-emerald-400\/90 { color: var(--text-main) !important; }
        body.light-mode .bg-slate-900\/60 { background-color: #ffffff !important; border: 1px solid #e2e8f0 !important; }

        /* Light mode contrast hardening */
        body.light-mode .bg-brand-darkBg\/80,
        body.light-mode .bg-brand-darkBg\/50,
        body.light-mode .bg-brand-darkBg\/30,
        body.light-mode .bg-slate-950,
        body.light-mode .bg-slate-900,
        body.light-mode .bg-slate-900\/80,
        body.light-mode .bg-slate-900\/60,
        body.light-mode .bg-slate-800,
        body.light-mode .bg-slate-800\/50,
        body.light-mode .bg-slate-800\/40,
        body.light-mode .bg-\[\#030712\],
        body.light-mode .bg-\[\#0b1120\],
        body.light-mode .bg-\[\#0f172a\],
        body.light-mode .bg-\[\#111827\],
        body.light-mode .bg-\[\#111827\]\/80 {
            background-color: #ffffff !important;
            border-color: #cbd5e1 !important;
        }

        body.light-mode .bg-brand-subBg,
        body.light-mode .bg-brand-darkBg\/60,
        body.light-mode .bg-brand-panelBg/80,
        body.light-mode .bg-brand-panelBg/50,
        body.light-mode .bg-brand-panelBg/30,
        body.light-mode .bg-brand-panelBg/20 {
            background-color: #f8fafc !important;
            border-color: #cbd5e1 !important;
        }
        body.light-mode .bg-brand-subBg {
            color: #334155 !important;
        }

        body.light-mode .text-gray-300,
        body.light-mode .text-gray-400,
        body.light-mode .text-slate-400 {
            color: #334155 !important;
        }

        body.light-mode .text-gray-500,
        body.light-mode .text-slate-500 {
            color: #475569 !important;
        }

        body.light-mode .text-gray-600,
        body.light-mode .text-slate-600,
        body.light-mode .text-slate-700 {
            color: #64748b !important;
        }

        body.light-mode .border-gray-600,
        body.light-mode .border-gray-700,
        body.light-mode .border-gray-800,
        body.light-mode .border-gray-900,
        body.light-mode .border-slate-600,
        body.light-mode .border-slate-700,
        body.light-mode .border-slate-800,
        body.light-mode .border-slate-900 {
            border-color: #cbd5e1 !important;
        }

        body.light-mode .job-node,
        body.light-mode .rack-node,
        body.light-mode #draft-output,
        body.light-mode #chat-history,
        body.light-mode #syslog-stream,
        body.light-mode #raid-drives-grid > div {
            background-color: #ffffff !important;
            color: #0f172a !important;
            border-color: #cbd5e1 !important;
        }

        body.light-mode #chat-input {
            background-color: #ffffff !important;
            color: #0f172a !important;
            border-color: #94a3b8 !important;
        }

        body.light-mode .bg-brand-cyan\/10 {
            background-color: rgba(8, 145, 178, 0.12) !important;
        }

        body.light-mode .bg-brand-emerald\/10,
        body.light-mode .bg-brand-emerald\/20 {
            background-color: rgba(5, 150, 105, 0.12) !important;
        }

        body.light-mode .bg-brand-amber\/10 {
            background-color: rgba(217, 119, 6, 0.14) !important;
        }

        body.light-mode .bg-brand-rose\/10,
        body.light-mode .bg-brand-rose\/20 {
            background-color: rgba(225, 29, 72, 0.12) !important;
        }

        body.light-mode .text-emerald-300,
        body.light-mode .text-emerald-400 {
            color: #047857 !important;
        }

        body.light-mode .shadow-neon-cyan,
        body.light-mode .shadow-neon-emerald,
        body.light-mode .shadow-neon-amber,
        body.light-mode .shadow-neon-rose {
            box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12) !important;
        }

        body.light-mode #remote-ready {
            background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%) !important;
            border-color: #cbd5e1 !important;
        }

        body.light-mode #remote-ready h2,
        body.light-mode #remote-ready h3 {
            color: #0f172a !important;
        }

        body.light-mode #remote-ready p {
            color: #334155 !important;
        }

        body.light-mode #remote-ready .text-brand-amber {
            color: #b45309 !important;
        }

        body.light-mode #remote-ready .text-brand-cyan {
            color: #0891b2 !important;
        }

        @media print {
            .fixed, .sticky, #ai-zone, #mobile-menu-btn, #print-resume-btn, .backdrop-blur-md { display: none !important; }
            body { background: white !important; color: black !important; }
            .max-w-7xl { max-width: 100% !important; margin: 0 !important; padding: 0 !important; }
            section { padding-top: 2rem !important; padding-bottom: 2rem !important; page-break-inside: avoid; }
            h1, h2, h3 { color: black !important; }
            p, span, li { color: black !important; }
            .text-transparent { background-clip: initial !important; -webkit-background-clip: initial !important; background: none !important; color: black !important; }
            .bg-brand-panelBg, .bg-brand-darkBg, .bg-brand-panelBg\/80, .bg-brand-panelBg\/50, .bg-brand-darkBg\/70 { background: white !important; border: 1px solid #eee !important; }
            .shadow-neon-cyan, .shadow-2xl { box-shadow: none !important; }
            canvas { display: none !important; }
            a[href^="#"] { text-decoration: none !important; color: black !important; }
        }

        ::-webkit-scrollbar { width: 6px; height: 6px; }
        ::-webkit-scrollbar-track { background: var(--dark); }
        ::-webkit-scrollbar-thumb { background: var(--sub); border-radius: 3px; }
        ::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

        @keyframes blink { 50% { opacity: 0; } }
        .cursor-blink { animation: blink 1s step-end infinite; }

        @keyframes flowRight {
            from { stroke-dashoffset: 24; }
            to   { stroke-dashoffset: 0; }
        }
        .cable-flow {
            stroke-dasharray: 8, 4;
            animation: flowRight 0.8s linear infinite;
        }

        .pipeline-arrow { display: none; align-items: center; justify-content: center; }
        @media (min-width: 1024px) { .pipeline-arrow { display: flex; } }
        .pipeline-arrow-v { display: flex; align-items: center; justify-content: center; height: 2rem; }
        @media (min-width: 1024px) { .pipeline-arrow-v { display: none; } }

        .job-node:focus-visible, .rack-node:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

        @keyframes fadeInLog {
            from { opacity: 0; transform: translateY(4px); }
            to   { opacity: 1; transform: translateY(0); }
        }
        .log-entry { animation: fadeInLog 0.3s ease both; }

        html {
            scroll-behavior: smooth;
            scroll-padding-top: 5.5rem;
        }

        section[id] {
            scroll-margin-top: 5.5rem;
        }

        /* Chart.js 容器約束 */
        .chart-container { position: relative; width: 100%; height: 220px; max-height: 250px; margin: 0 auto; }
        @media (max-width: 768px) { .chart-container { height: 180px; } }

/* ============================================================
   無障礙列 (Option B) 與 Homelab 微動態 (Option C) 自訂樣式
   ============================================================ */

/* 字型大小縮放 - 適用於 HTML 根節點， Tailwind REM 會自適應縮放 */
html.font-size-large {
    font-size: 115% !important;
}
html.font-size-xlarge {
    font-size: 130% !important;
}

/* 易讀字體模式 - 拉大字距、行高，採用極易讀的 sans-serif 字型 */
body.dyslexic-font,
body.dyslexic-font p,
body.dyslexic-font span,
body.dyslexic-font li,
body.dyslexic-font button,
body.dyslexic-font h1,
body.dyslexic-font h2,
body.dyslexic-font h3,
body.dyslexic-font h4,
body.dyslexic-font h5,
body.dyslexic-font h6,
body.dyslexic-font input,
body.dyslexic-font select,
body.dyslexic-font textarea,
body.dyslexic-font div {
    font-family: 'Verdana', 'Arial', 'system-ui', sans-serif !important;
    letter-spacing: 0.12em !important;
    word-spacing: 0.22em !important;
    line-height: 1.85 !important;
}

/* 減少動態模式 - 強制停用所有 transitions 與 animations */
body.reduced-motion,
body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
    animation-delay: -1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    background-attachment: initial !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
    transition-delay: -1ms !important;
}

/* Homelab 實體設備微動態 3D Hover & 陰影映射 (Option C) */
.homelab-card {
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), 
                box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), 
                border-color 0.3s ease !important;
    will-change: transform, box-shadow;
}

/* Hover 微傾角與發光映射 */
.homelab-card:hover {
    transform: translateY(-6px) scale(1.025) rotateX(2deg) rotateY(1deg) !important;
    border-color: var(--cyan) !important;
    box-shadow: 0 15px 30px rgba(6, 182, 212, 0.25), 
                0 0 15px rgba(6, 182, 212, 0.15) !important;
}

/* Telemetry 卡片或已選中設備額外特效 */
.homelab-card.border-brand-cyan {
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

/* 鍵盤 Focus 輪廓增強以滿足 WCAG 2.2 AAA */
.homelab-card:focus-visible,
#accessibility-bar button:focus-visible {
    outline: 2px solid var(--cyan) !important;
    outline-offset: 2px !important;
}

/* 下拉面板動畫 */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-slideDown {
    animation: slideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ============================================================
   Telemetry Monitor & AI Workspace & Tech Logs Styles
   ============================================================ */

/* Syslog Stream 樣式 */
#topology-syslog-stream::-webkit-scrollbar,
#telemetry-syslog-stream::-webkit-scrollbar {
    width: 4px;
}
#topology-syslog-stream::-webkit-scrollbar-track,
#telemetry-syslog-stream::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
}
#topology-syslog-stream::-webkit-scrollbar-thumb,
#telemetry-syslog-stream::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.3);
    border-radius: 2px;
}
#topology-syslog-stream::-webkit-scrollbar-thumb:hover,
#telemetry-syslog-stream::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.6);
}

/* Tabs 動態下底線過渡 */
.tab-active {
    color: var(--cyan) !important;
    border-bottom: 2px solid var(--cyan) !important;
    font-weight: bold;
}

/* Telemetry Circular Progress Rings */
#nas-ram-ring, #nas-disk-ring {
    stroke-dashoffset: 0;
    transform-origin: center;
    transition: stroke-dasharray 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Mode 監控與 Tab 特化 */
body.light-mode #telemetry .bg-\[\#0f172a\],
body.light-mode #telemetry .bg-\[\#0f172a\]\/80,
body.light-mode #tech-logs .bg-brand-panelBg\/60 {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05) !important;
}

body.light-mode #topology-syslog-stream,
body.light-mode #telemetry-syslog-stream {
    color: #1e293b !important;
}

body.light-mode #topology-syslog-stream::-webkit-scrollbar-thumb,
body.light-mode #telemetry-syslog-stream::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.3);
}

body.light-mode #topology-syslog-stream::-webkit-scrollbar-track,
body.light-mode #telemetry-syslog-stream::-webkit-scrollbar-track {
    background: #f1f5f9 !important;
}

body.light-mode #topology-syslog-stream .opacity-50,
body.light-mode #telemetry-syslog-stream .opacity-50 {
    opacity: 0.75 !important;
    color: #475569 !important;
}

body.light-mode #topology .absolute.-top-3 {
    background-color: #e2e8f0 !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-mode #telemetry-syslog-container {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05) !important;
}

body.light-mode #telemetry .text-white,
body.light-mode #tech-logs .text-white {
    color: var(--text-main) !important;
}

/* Public RAG query: light resume surface with restrained technical accents. */
.rag-shell {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 1rem;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.rag-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 2rem 2rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
}

.rag-kicker {
    color: #0891b2;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.rag-header h2 {
    margin: 0.45rem 0 0.55rem;
    color: #0f172a;
    font-size: clamp(1.35rem, 2.5vw, 1.85rem);
    font-weight: 700;
}

.rag-header p {
    max-width: 42rem;
    margin: 0;
    color: #475569;
    line-height: 1.7;
}

.rag-status {
    flex: 0 0 auto;
    border: 1px solid #bae6fd;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    color: #0369a1;
    background: #f0f9ff;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.72rem;
    white-space: nowrap;
}

.rag-status[data-state="loading"] {
    color: #92400e;
    border-color: #fde68a;
    background: #fffbeb;
}

.rag-status[data-state="success"] {
    color: #047857;
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.rag-status[data-state="error"] {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fef2f2;
}

.rag-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    padding: 1.1rem 2rem 0;
}

.rag-topic {
    border: 1px solid #cbd5e1;
    border-radius: 0.45rem;
    padding: 0.45rem 0.7rem;
    color: #334155;
    background: #f8fafc;
    font-size: 0.82rem;
    transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.rag-topic:hover {
    border-color: #06b6d4;
    color: #0e7490;
    background: #ecfeff;
}

.rag-form {
    padding: 1.25rem 2rem 2rem;
}

.rag-form label {
    display: block;
    margin-bottom: 0.45rem;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 600;
}

.rag-form textarea {
    display: block;
    width: 100%;
    min-height: 4.5rem;
    resize: vertical;
    border: 1px solid #94a3b8;
    border-radius: 0.55rem;
    padding: 0.75rem 0.85rem;
    color: #0f172a;
    background: #ffffff;
    line-height: 1.6;
}

.rag-form textarea::placeholder {
    color: #64748b;
}

.rag-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.8rem;
}

.rag-form-footer p {
    margin: 0;
    color: #64748b;
    font-size: 0.75rem;
}

.rag-submit {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    border: 0;
    border-radius: 0.55rem;
    padding: 0.65rem 1rem;
    color: #ffffff;
    background: linear-gradient(135deg, #0891b2, #059669);
    font-weight: 700;
    transition: opacity 160ms ease, transform 160ms ease;
}

.rag-submit:hover:not(:disabled) {
    transform: translateY(-1px);
}

.rag-submit:disabled {
    cursor: wait;
    opacity: 0.65;
}

.rag-result {
    margin: 0 2rem 2rem;
    border: 1px solid #bae6fd;
    border-left: 3px solid #06b6d4;
    border-radius: 0.55rem;
    padding: 1rem 1.1rem;
    background: #f8fafc;
}

.rag-result-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: #0e7490;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.76rem;
}

.rag-answer {
    margin-top: 0.7rem;
    color: #1e293b;
    line-height: 1.75;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.rag-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid #e2e8f0;
}

.rag-source {
    color: #0369a1;
    font-size: 0.78rem;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

body:not(.light-mode) .rag-shell {
    border-color: #334155;
    background: #0f172a;
}

body:not(.light-mode) .rag-header {
    border-color: #334155;
}

body:not(.light-mode) .rag-header h2,
body:not(.light-mode) .rag-answer {
    color: #e2e8f0;
}

body:not(.light-mode) .rag-header p,
body:not(.light-mode) .rag-form-footer p {
    color: #94a3b8;
}

body:not(.light-mode) .rag-topic,
body:not(.light-mode) .rag-form textarea {
    border-color: #475569;
    color: #e2e8f0;
    background: #111827;
}

body:not(.light-mode) .rag-topic:hover {
    background: #164e63;
}

body:not(.light-mode) .rag-form label {
    color: #cbd5e1;
}

body:not(.light-mode) .rag-result {
    border-color: #155e75;
    background: #111827;
}

body:not(.light-mode) .rag-sources {
    border-color: #334155;
}

@media (max-width: 640px) {
    .rag-header,
    .rag-topics,
    .rag-form {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .rag-header,
    .rag-form-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .rag-status {
        align-self: flex-start;
    }

    .rag-submit {
        width: 100%;
    }

    .rag-result {
        margin-right: 1rem;
        margin-left: 1rem;
    }
}

/* Universal custom focus styles for interactive elements (WCAG 2.2 AAA compliance) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="tab"]:focus-visible,
[role="button"]:focus-visible,
[role="radio"]:focus-visible {
    outline: 3px solid var(--cyan) !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.6) !important;
}
