:root { 
    --bg: #f4f7f6; 
    --text: #2c3e50; 
    --sidebar: #1e2b3c; 
    --sidebar-text: #ecf0f1; 
    --accent: #007bff; 
    --danger: #dc3545; 
    --warning: #ffc107; 
    --critical: #8b0000;
    --info: #17a2b8;
    --success: #28a745;
    --code-bg: #f8f9fa;
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 4px 20px rgba(0,0,0,0.03);
    --shadow-md: 0 8px 25px rgba(0,0,0,0.08);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent;
}

body { 
    margin: 0; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 
    display: flex; 
    height: 100vh;
    height: 100dvh;
    color: var(--text); 
    background: var(--bg); 
    line-height: 1.6;
    overflow: hidden;
}

nav { 
    width: 280px; 
    background: var(--sidebar); 
    color: var(--sidebar-text); 
    padding: 30px 20px; 
    overflow-y: auto; 
    box-shadow: 2px 0 15px rgba(0,0,0,0.1);
    z-index: 10;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

nav h2 { 
    margin-top: 0; 
    font-size: 1.1rem; 
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #adb5bd;
    border-bottom: 1px solid #34495e; 
    padding-bottom: 15px; 
    margin-bottom: 20px;
}

nav ul { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
}

nav ul li { 
    margin-bottom: 8px; 
}

nav ul li a { 
    color: #ced4da; 
    text-decoration: none; 
    font-size: 0.95rem; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

nav ul li a:hover { 
    color: #fff; 
    background: rgba(255,255,255,0.1); 
    padding-left: 20px;
}

main { 
    flex: 1; 
    padding: clamp(20px, 4vw, 40px) clamp(15px, 5vw, 60px); 
    overflow-y: auto; 
    background: var(--bg); 
    scroll-behavior: smooth;
}

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

h1 { 
    font-size: clamp(1.75rem, 5vw, 2.2rem); 
    margin-top: 0;
    margin-bottom: 15px; 
    color: #111; 
    border-bottom: 3px solid #e9ecef; 
    padding-bottom: 15px;
}

h2 { 
    font-size: clamp(1.3rem, 4vw, 1.5rem); 
    margin-top: 25px; 
    color: #222; 
    border-bottom: 1px solid #e9ecef; 
    padding-bottom: 10px; 
}

h3 { 
    font-size: clamp(1.05rem, 3vw, 1.1rem); 
    color: #444; 
    margin-top: 25px; 
}

p { 
    margin-bottom: 15px; 
}

section { 
    margin-bottom: 40px; 
    background: #fff;
    padding: clamp(20px, 4vw, 30px);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid #e9ecef;
}

.setup-notice {
    background: #e8f4f8;
    border-left: 5px solid var(--info);
    padding: clamp(15px, 3vw, 20px);
    border-radius: var(--radius-sm);
    margin-bottom: 30px;
}

.setup-notice h4 { 
    margin: 0 0 10px 0; 
    color: #0c5460; 
    font-size: 1.05rem; 
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 20px;
    margin-top: 20px;
}

.download-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: var(--radius-sm);
    padding: clamp(15px, 4vw, 25px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.download-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: #b8daff;
}

.download-card h4 {
    margin-top: 0;
    color: #343a40;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.download-card .url-source {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 15px;
    word-break: break-all;
}

.download-card .url-source a { 
    color: var(--accent); 
    text-decoration: none; 
}

.download-card .url-source a:hover { 
    text-decoration: underline; 
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent);
    color: white;
    padding: 12px 20px;
    text-align: center;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    margin-top: auto;
    transition: background-color 0.3s;
    width: 100%;
}

.download-btn:hover { 
    background-color: #0056b3; 
}

code { 
    background: var(--code-bg); 
    padding: 4px 8px; 
    border-radius: 4px; 
    font-family: 'Consolas', 'Courier New', monospace; 
    font-size: 0.9em; 
    color: #d63384;
    border: 1px solid #e9ecef;
    word-break: break-word;
}

pre { 
    background: #212529; 
    color: #f8f9fa; 
    padding: clamp(15px, 4vw, 20px); 
    border-radius: var(--radius-sm); 
    overflow-x: auto; 
    font-family: 'Consolas', 'Courier New', monospace; 
    font-size: 0.9rem;
    line-height: 1.5;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    -webkit-overflow-scrolling: touch;
}

pre code {
    word-break: normal;
    border: none;
    padding: 0;
    background: transparent;
    color: inherit;
}

.badge { 
    display: inline-flex; 
    align-items: center;
    padding: 4px 10px; 
    border-radius: 20px; 
    font-size: 0.75rem; 
    font-weight: 700; 
    color: #fff; 
    margin-left: 8px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-critical { background: var(--critical); }
.badge-high { background: var(--danger); }
.badge-medium { background: var(--warning); color: #000; }

.meta-grid {
    display: grid;
    grid-template-columns: minmax(140px, max-content) 1fr;
    gap: 12px;
    margin: 20px 0;
    padding: clamp(15px, 4vw, 20px);
    background: #f8f9fa;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--sidebar);
}

.meta-label { 
    font-weight: 600; 
    color: #495057; 
}

.fix-box {
    background: #f0fdf4;
    border: 1px solid #c3e6cb;
    padding: clamp(15px, 4vw, 25px);
    border-radius: var(--radius-sm);
    margin-top: 30px;
}

.fix-box h4 {
    color: #155724;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

th, td {
    border: 1px solid #e9ecef;
    padding: clamp(10px, 3vw, 15px);
    text-align: left;
    font-size: 0.95rem;
    min-width: 120px;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

td code { 
    font-size: 0.85rem; 
}

::-webkit-scrollbar { 
    width: 8px; 
    height: 8px; 
}

::-webkit-scrollbar-track { 
    background: transparent; 
}

::-webkit-scrollbar-thumb { 
    background: #cbd5e1; 
    border-radius: 10px; 
}

::-webkit-scrollbar-thumb:hover { 
    background: #94a3b8; 
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    nav {
        width: 100%;
        padding: 15px 20px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }

    nav h2 {
        margin-bottom: 15px;
        padding-bottom: 12px;
        font-size: 1rem;
    }

    nav ul {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
        -ms-overflow-style: none; 
        scrollbar-width: none; 
    }

    nav ul::-webkit-scrollbar { 
        display: none; 
    }

    nav ul li { 
        margin-bottom: 0; 
        flex-shrink: 0; 
    }

    nav ul li a {
        padding: 8px 16px;
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.05);
    }

    nav ul li a:hover { 
        padding-left: 16px; 
        background: rgba(255,255,255,0.15); 
    }

    .meta-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}
