:root {
    --bg:           #0d1117;
    --bg-card:      #161b22;
    --bg-code:      #1c2128;
    --border:       #30363d;
    --border-light: #21262d;
    --text:         #e6edf3;
    --text-muted:   #b0bac5;
    --text-dim:     #9ba5b0;
    --accent:       #4d9eff;
    --accent-dim:   #3d8ef0;
    --green:        #3fb950;
    --yellow:       #e3b341;
    --purple:       #d2a8ff;
    --red:          #f85149;
    --tag-bg:       #1f2d3d;
    --tag-text:     #93c9ff;
    --font-mono:    'DM Mono', 'Fira Code', Consolas, monospace;
    --font-ui:      'DM Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-ui);
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
}

/* ── SKIP LINK ────────────────────────────────────────────── */
.skip-link {
    position: absolute;
    top: -999px;
    left: -999px;
    background: var(--accent);
    color: #000;
    padding: 8px 16px;
    z-index: 999;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 8px;
    left: 8px;
}

/* ── PAGE HEADER ──────────────────────────────────────────── */
.page-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-header img {
    height: 48px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.page-header-text h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.3px;
}

.page-header-text p {
    font-size: 14px;
    color: var(--text-dim);
    margin-top: 1px;
}

/* ── NOTICE BANNER ────────────────────────────────────────── */
.notice-banner {
    background: rgba(248, 81, 73, 0.08);
    border-bottom: 1px solid rgba(248, 81, 73, 0.25);
    padding: 12px 32px;
    font-size: 15px;
    color: #ffa198;
    line-height: 1.6;
}

.notice-banner a {
    color: var(--accent);
    text-decoration: underline;
}
.notice-banner a:hover {
    text-decoration: underline;
}
.notice-banner strong { font-weight: 600; color: var(--red); }

/* ── TAB NAV ──────────────────────────────────────────────── */
.tab-nav {
    display: flex;
    gap: 0;
    padding: 0 32px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    margin-bottom: -1px;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ── TAB CONTENT ──────────────────────────────────────────── */
.tab-panel { display: none; }
.tab-panel.active { display: flex; }

/* ── LIBRARIES LAYOUT ─────────────────────────────────────── */
.libraries-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 230px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    padding: 16px 0;
    background: var(--bg-card);
}

.nav-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-dim);
    padding: 8px 16px 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 7px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.15s, background 0.15s;
    border-left: 2px solid transparent;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(77, 158, 255, 0.08);
    border-left-color: var(--accent);
}

.nav-link .sri-tag {
    font-size: 10px;
    font-weight: 600;
    background: rgba(63, 185, 80, 0.15);
    color: var(--green);
    border: 1px solid rgba(63, 185, 80, 0.3);
    border-radius: 3px;
    padding: 1px 5px;
    margin-left: auto;
}

/* ── MAIN CONTENT ─────────────────────────────────────────── */
.main-content {
    flex: 1;
    min-width: 0;
    padding: 32px 40px;
    max-width: 900px;
}

.intro-text {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 24px;
    line-height: 1.7;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.intro-text strong { color: var(--text); }

.sri-notice {
    margin-bottom: 24px;
    padding: 14px 16px;
    background: rgba(227, 179, 65, 0.08);
    border: 1px solid rgba(227, 179, 65, 0.25);
    border-radius: 6px;
    color: var(--yellow);
    font-size: 15px;
    line-height: 1.6;
}

.sri-notice code {
    font-family: var(--font-mono);
    font-size: 13px;
}

/* ── LIBRARY SECTIONS ─────────────────────────────────────── */
.library-section { margin-bottom: 40px; }

.library-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lib-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--tag-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.version-block {
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.version-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.version-badge {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    background: var(--tag-bg);
    color: var(--tag-text);
    border: 1px solid rgba(147, 201, 255, 0.2);
    border-radius: 4px;
    padding: 2px 8px;
}

.version-header a {
    text-decoration: underline;
    margin-left: auto;
    color: var(--text-muted);
    font-size: 13px;
    transition: color 0.15s;
}

.version-header a:hover { color: var(--accent); }

.file-list { list-style: none; }
.file-item { border-bottom: 1px solid var(--border-light); }
.file-item:last-child { border-bottom: none; }

.file-row {
    display: flex;
    align-items: stretch;
    min-height: 46px;
}

.file-path {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    min-width: 0;
}

.file-type {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
}

.file-type.css {
    background: rgba(210, 168, 255, 0.15);
    color: var(--purple);
    border: 1px solid rgba(210, 168, 255, 0.25);
}

.file-type.js {
    background: rgba(227, 179, 65, 0.15);
    color: var(--yellow);
    border: 1px solid rgba(227, 179, 65, 0.25);
}

.file-link {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}

.file-link:hover { color: var(--tag-text); text-decoration: underline; }

.file-note {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 2px;
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    flex-shrink: 0;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 5px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.copy-btn:hover {
    background: rgba(77, 158, 255, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

.copy-btn.copied {
    background: rgba(63, 185, 80, 0.1);
    border-color: var(--green);
    color: var(--green);
}

/* ── SRI BLOCK ────────────────────────────────────────────── */
.sri-block {
    margin: 0 14px 12px;
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.sri-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    border-bottom: 1px solid var(--border);
    background: rgba(63, 185, 80, 0.05);
}

.sri-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--green);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sri-label::before {
    content: '✓';
    width: 16px;
    height: 16px;
    background: rgba(63, 185, 80, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.sri-code {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-muted);
    padding: 10px 12px;
    word-break: break-all;
    line-height: 1.8;
    white-space: pre-wrap;
}

.sri-code .attr { color: var(--tag-text); }
.sri-code .val  { color: #c9e0ff; }
.sri-code .hash { color: var(--green); }

.sub-section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    padding: 8px 14px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

/* ── IMAGES TAB ───────────────────────────────────────────── */
.images-layout {
    padding: 32px 40px;
    max-width: 1000px;
    width: 100%;
}

.images-intro {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    line-height: 1.7;
}

.image-section { margin-bottom: 40px; }

.image-section h2 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.image-section h2 a {
    text-decoration: underline;
    font-size: 13px;
    color: var(--accent);
    font-weight: 400;
}

.image-section h2 a:hover { text-decoration: underline; }

.image-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.image-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-card);
}

.image-card.white-logo .image-preview { background: #5c9ccc; }

.image-preview {
    background: var(--bg-code);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    border-bottom: 1px solid var(--border);
}

.image-preview img {
    max-width: 100%;
    max-height: 80px;
    width: auto;
    height: auto;
}

.image-info { padding: 12px 14px; }

.image-info p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.image-info .image-path {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    display: block;
    margin-top: 6px;
    word-break: break-all;
}

.image-info .image-path:hover { text-decoration: underline; }

.image-none {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    background: var(--bg-code);
    border-bottom: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 14px;
    font-style: italic;
}

/* ── FOOTER ───────────────────────────────────────────────── */
.page-footer {
    padding: 16px 32px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
}

.page-footer a {
    color: var(--accent);
    text-decoration: underline;
}

.page-footer a:hover { text-decoration: underline; }

/* ── SCROLLBAR ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content, .images-layout { padding: 20px; }
    .page-header { padding: 12px 20px; }
    .tab-nav { padding: 0 20px; }
    .notice-banner { padding: 10px 20px; }
    .image-grid { grid-template-columns: 1fr; }
}