/* ============================================
   Home Page Styles - Dark Tech Navigation
   ============================================ */

:root {
    --home-bg: #07111f;
    --home-bg-2: #0b1524;
    --home-panel: rgba(12, 25, 42, 0.82);
    --home-panel-strong: rgba(15, 31, 51, 0.94);
    --home-card: rgba(16, 32, 52, 0.78);
    --home-card-hover: rgba(20, 42, 67, 0.92);
    --home-line: rgba(125, 211, 252, 0.14);
    --home-line-strong: rgba(45, 212, 191, 0.34);
    --home-text: #d8e5f2;
    --home-muted: #8fa3b8;
    --home-dim: #5f7488;
    --home-cyan: #22d3ee;
    --home-teal: #2dd4bf;
    --home-blue: #38bdf8;
    --home-green: #84cc16;
    --home-accent: #22d3ee;
    --home-accent-2: #2dd4bf;
    --home-accent-rgb: 34, 211, 238;
    --home-accent-2-rgb: 45, 212, 191;
    --home-glow-a: rgba(34, 211, 238, 0.18);
    --home-glow-b: rgba(132, 204, 22, 0.1);
    --home-grid-color: rgba(125, 211, 252, 0.035);
    --home-grid-color-2: rgba(125, 211, 252, 0.03);
    --home-radius-card: 12px;
    --home-shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
    --pointer-x: 50vw;
    --pointer-y: 30vh;
    --category-accent: var(--home-accent);
    --category-accent-rgb: var(--home-accent-rgb);
}

html[data-theme="dark-minimal"] {
    --home-bg: #080b10;
    --home-bg-2: #10141c;
    --home-panel: rgba(15, 18, 25, 0.84);
    --home-panel-strong: rgba(18, 22, 30, 0.95);
    --home-card: rgba(20, 24, 32, 0.8);
    --home-card-hover: rgba(28, 33, 42, 0.94);
    --home-line: rgba(229, 231, 235, 0.12);
    --home-line-strong: rgba(229, 231, 235, 0.28);
    --home-text: #e7edf5;
    --home-muted: #a2adbc;
    --home-dim: #737f8f;
    --home-accent: #e5e7eb;
    --home-accent-2: #94a3b8;
    --home-accent-rgb: 229, 231, 235;
    --home-accent-2-rgb: 148, 163, 184;
    --home-glow-a: rgba(229, 231, 235, 0.09);
    --home-glow-b: rgba(148, 163, 184, 0.08);
    --home-grid-color: rgba(229, 231, 235, 0.028);
    --home-grid-color-2: rgba(229, 231, 235, 0.024);
}

html[data-theme="neon-purple"] {
    --home-bg: #0b0618;
    --home-bg-2: #150c2a;
    --home-panel: rgba(22, 12, 42, 0.84);
    --home-panel-strong: rgba(28, 16, 52, 0.95);
    --home-card: rgba(30, 18, 58, 0.78);
    --home-card-hover: rgba(44, 24, 80, 0.92);
    --home-line: rgba(196, 181, 253, 0.15);
    --home-line-strong: rgba(217, 70, 239, 0.36);
    --home-text: #eee8ff;
    --home-muted: #b7a8d6;
    --home-dim: #85749f;
    --home-accent: #a78bfa;
    --home-accent-2: #f472b6;
    --home-accent-rgb: 167, 139, 250;
    --home-accent-2-rgb: 244, 114, 182;
    --home-glow-a: rgba(167, 139, 250, 0.18);
    --home-glow-b: rgba(244, 114, 182, 0.11);
    --home-grid-color: rgba(196, 181, 253, 0.035);
    --home-grid-color-2: rgba(244, 114, 182, 0.026);
}

html[data-theme="glass"] {
    --home-bg: #08141e;
    --home-bg-2: #102332;
    --home-panel: rgba(18, 35, 50, 0.58);
    --home-panel-strong: rgba(19, 38, 54, 0.78);
    --home-card: rgba(24, 45, 62, 0.5);
    --home-card-hover: rgba(30, 60, 78, 0.72);
    --home-line: rgba(186, 230, 253, 0.2);
    --home-line-strong: rgba(56, 189, 248, 0.38);
    --home-text: #edf8ff;
    --home-muted: #abc5d7;
    --home-dim: #7b94a7;
    --home-accent: #7dd3fc;
    --home-accent-2: #99f6e4;
    --home-accent-rgb: 125, 211, 252;
    --home-accent-2-rgb: 153, 246, 228;
    --home-glow-a: rgba(125, 211, 252, 0.16);
    --home-glow-b: rgba(153, 246, 228, 0.11);
}

html[data-theme="warm-night"] {
    --home-bg: #140f0a;
    --home-bg-2: #21170f;
    --home-panel: rgba(35, 24, 16, 0.84);
    --home-panel-strong: rgba(44, 30, 19, 0.95);
    --home-card: rgba(46, 31, 20, 0.78);
    --home-card-hover: rgba(60, 40, 25, 0.92);
    --home-line: rgba(251, 191, 36, 0.15);
    --home-line-strong: rgba(249, 115, 22, 0.34);
    --home-text: #fff2df;
    --home-muted: #d6b996;
    --home-dim: #9f8160;
    --home-accent: #f59e0b;
    --home-accent-2: #fb7185;
    --home-accent-rgb: 245, 158, 11;
    --home-accent-2-rgb: 251, 113, 133;
    --home-glow-a: rgba(245, 158, 11, 0.16);
    --home-glow-b: rgba(251, 113, 133, 0.1);
    --home-grid-color: rgba(251, 191, 36, 0.03);
    --home-grid-color-2: rgba(251, 113, 133, 0.022);
}

body {
    background:
        radial-gradient(circle at 20% -10%, rgba(var(--home-accent-rgb), 0.12), transparent 34%),
        radial-gradient(circle at 78% 8%, rgba(var(--home-accent-2-rgb), 0.12), transparent 30%),
        linear-gradient(135deg, var(--home-bg) 0%, var(--home-bg-2) 46%, var(--home-bg) 100%);
    overflow-x: hidden;
}

.nav-home {
    display: flex;
    min-height: 100vh;
    position: relative;
    isolation: isolate;
}

.home-bg-layer {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
}

.home-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--home-grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--home-grid-color-2) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 78%);
}

.home-scanline {
    position: absolute;
    top: 0;
    left: 244px;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--home-accent-rgb), 0.75), transparent);
    opacity: 0.45;
    animation: homeScan 8s ease-in-out infinite;
}

.home-mouse-glow {
    position: absolute;
    left: var(--pointer-x);
    top: var(--pointer-y);
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--home-accent-rgb), 0.16), transparent 68%);
    transform: translate(-50%, -50%);
    opacity: 0.65;
    transition: opacity 0.2s ease;
}

.home-particles span {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(var(--home-accent-rgb), 0.55);
    box-shadow: 0 0 18px rgba(var(--home-accent-rgb), 0.45);
    opacity: 0.45;
    animation: particleFloat 10s ease-in-out infinite;
}

.home-particles span:nth-child(1) { left: 18%; top: 22%; animation-delay: -1s; }
.home-particles span:nth-child(2) { left: 43%; top: 12%; animation-delay: -4s; }
.home-particles span:nth-child(3) { right: 18%; top: 28%; animation-delay: -2s; }
.home-particles span:nth-child(4) { left: 32%; bottom: 22%; animation-delay: -6s; }
.home-particles span:nth-child(5) { right: 28%; bottom: 34%; animation-delay: -3s; }
.home-particles span:nth-child(6) { right: 9%; top: 58%; animation-delay: -7s; }

.ambient-glow {
    position: fixed;
    pointer-events: none;
    z-index: -1;
    filter: blur(8px);
    opacity: 0.9;
}

.ambient-glow-a {
    width: 420px;
    height: 420px;
    left: 220px;
    top: -160px;
    background: radial-gradient(circle, var(--home-glow-a), transparent 68%);
}

.ambient-glow-b {
    width: 520px;
    height: 520px;
    right: -180px;
    top: 160px;
    background: radial-gradient(circle, var(--home-glow-b), transparent 66%);
}

/* Sidebar */
.sidebar {
    width: 244px;
    background: linear-gradient(180deg, rgba(7, 17, 31, 0.96), rgba(10, 24, 40, 0.92));
    border-right: 1px solid var(--home-line);
    box-shadow: 18px 0 60px rgba(0, 0, 0, 0.24);
    color: var(--home-text);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.sidebar-header {
    padding: 18px 16px 14px;
    border-bottom: 1px solid var(--home-line);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(var(--home-accent-rgb), 0.25);
    box-shadow: 0 0 26px rgba(var(--home-accent-rgb), 0.16);
    object-fit: cover;
}

.brand-copy {
    min-width: 0;
}

.site-title {
    font-size: 17px;
    font-weight: 800;
    line-height: 1.25;
    margin: 0;
    color: #f8fbff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-kicker {
    display: block;
    margin-top: 2px;
    color: var(--home-dim);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

/* Category Navigation */
.category-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    margin: 3px 0;
}

.category-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 9px 10px;
    color: var(--home-muted);
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 10px;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
    font-size: 13px;
    position: relative;
}

.category-link:hover {
    background: rgba(var(--category-accent-rgb), 0.08);
    border-color: rgba(var(--category-accent-rgb), 0.18);
    color: #eef8ff;
}

.category-link.active {
    background: linear-gradient(135deg, rgba(var(--category-accent-rgb), 0.17), rgba(var(--home-accent-2-rgb), 0.09));
    border-color: rgba(var(--category-accent-rgb), 0.34);
    color: #f8fbff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02), 0 8px 24px rgba(var(--category-accent-rgb), 0.1);
}

.category-link.active::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    background: linear-gradient(180deg, var(--category-accent), var(--home-accent-2));
    border-radius: 0 5px 5px 0;
}

.category-icon {
    font-size: 17px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.category-icon img,
.category-icon-lg img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
}

.category-icon.has-image-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.category-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 650;
}

.category-count {
    min-width: 25px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 7px;
    border-radius: 999px;
    border: 1px solid rgba(125, 211, 252, 0.12);
    background: rgba(125, 211, 252, 0.08);
    color: color-mix(in srgb, var(--category-accent) 72%, #ffffff);
    font-size: 11px;
    font-weight: 800;
}

.sidebar-footer {
    padding: 12px 10px 16px;
    border-top: 1px solid var(--home-line);
}

.admin-link {
    display: flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(var(--home-accent-2-rgb), 0.24);
    border-radius: 10px;
    color: #bff7ee;
    background: rgba(var(--home-accent-2-rgb), 0.07);
    text-decoration: none;
    font-size: 13px;
    font-weight: 750;
    transition: all 0.18s ease;
}

.admin-link:hover {
    color: #ffffff;
    background: rgba(var(--home-accent-2-rgb), 0.14);
    border-color: rgba(var(--home-accent-2-rgb), 0.42);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.62);
    z-index: 199;
    backdrop-filter: blur(5px);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 244px;
    min-height: 100vh;
    position: relative;
}

.main-content::before {
    content: '';
    position: fixed;
    inset: 0 0 0 244px;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(125, 211, 252, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(125, 211, 252, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent 70%);
    z-index: -1;
}

/* Search Header */
.search-header {
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 68px;
    background: rgba(7, 17, 31, 0.78);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--home-line);
    padding: 10px 22px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.mobile-menu-btn {
    display: none;
    width: 44px;
    height: 44px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: rgba(125, 211, 252, 0.08);
    border: 1px solid rgba(125, 211, 252, 0.16);
    cursor: pointer;
    border-radius: 10px;
}

.mobile-menu-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: color-mix(in srgb, var(--home-accent) 35%, #ffffff);
    border-radius: 2px;
    transition: all 0.24s ease;
}

.mobile-brand {
    display: none;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: #f8fbff;
    font-size: 14px;
    font-weight: 800;
}

.mobile-brand img {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.search-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 820px;
    margin: 0 auto;
    padding: 6px;
    border: 1px solid rgba(125, 211, 252, 0.16);
    border-radius: 14px;
    background: rgba(11, 24, 40, 0.78);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.18);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.search-container.is-focused {
    border-color: rgba(var(--home-accent-rgb), 0.58);
    background: rgba(12, 28, 47, 0.9);
    box-shadow: 0 0 0 4px rgba(var(--home-accent-rgb), 0.08), 0 16px 42px rgba(0, 0, 0, 0.26);
}

.search-engine-selector {
    display: flex;
    gap: 3px;
    padding: 2px;
    border-radius: 10px;
    background: rgba(3, 10, 19, 0.56);
    border: 1px solid rgba(125, 211, 252, 0.1);
}

.engine-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    opacity: 0.62;
}

.engine-btn:hover {
    opacity: 1;
    background: rgba(125, 211, 252, 0.08);
}

.engine-btn.active {
    opacity: 1;
    background: rgba(var(--home-accent-rgb), 0.14);
    border-color: rgba(var(--home-accent-rgb), 0.36);
    box-shadow: 0 0 20px rgba(var(--home-accent-rgb), 0.12);
}

.engine-icon {
    width: 19px;
    height: 19px;
    object-fit: contain;
}

.search-field {
    flex: 1;
    min-width: 0;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    height: 38px;
    padding: 0 76px 0 12px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    background: transparent;
    color: #f3fbff;
    outline: none;
}

.search-input::placeholder {
    color: #668096;
}

.search-input.is-empty {
    animation: inputNudge 0.22s ease;
}

.search-shortcut {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding: 0 8px;
    border: 1px solid rgba(125, 211, 252, 0.13);
    border-radius: 7px;
    color: #7d91a4;
    background: rgba(3, 10, 19, 0.38);
    font-size: 11px;
    font-weight: 800;
}

.search-btn {
    width: 40px;
    height: 38px;
    background: linear-gradient(135deg, var(--home-accent) 0%, var(--home-accent-2) 100%);
    color: #03111d;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 8px 22px rgba(var(--home-accent-rgb), 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(var(--home-accent-rgb), 0.28);
}

.search-btn:active {
    transform: translateY(0);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.header-admin-link {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 1px solid rgba(125, 211, 252, 0.16);
    border-radius: 10px;
    color: #c6e8f6;
    background: rgba(125, 211, 252, 0.06);
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    transition: all 0.18s ease;
}

.header-admin-link:hover {
    color: #ffffff;
    border-color: rgba(var(--home-accent-2-rgb), 0.34);
    background: rgba(var(--home-accent-2-rgb), 0.1);
}

.display-settings {
    position: relative;
}

.display-settings-btn,
.theme-toggle {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(var(--home-accent-rgb), 0.18);
    border-radius: 10px;
    color: #c9e9f8;
    background: rgba(var(--home-accent-rgb), 0.07);
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.display-settings-btn:hover,
.theme-toggle:hover,
.display-settings.is-open .display-settings-btn {
    color: #ffffff;
    background: rgba(var(--home-accent-rgb), 0.13);
    border-color: rgba(var(--home-accent-rgb), 0.42);
    transform: translateY(-1px);
}

.theme-toggle {
    display: none;
}

.display-settings-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(320px, calc(100vw - 24px));
    padding: 14px;
    border: 1px solid rgba(var(--home-accent-rgb), 0.2);
    border-radius: 14px;
    background: var(--home-panel-strong);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top right;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 130;
}

.display-settings.is-open .display-settings-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.settings-group + .settings-group {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(125, 211, 252, 0.1);
}

.settings-label {
    display: block;
    margin-bottom: 9px;
    color: #f3fbff;
    font-size: 12px;
    font-weight: 850;
}

.theme-preset-list {
    display: grid;
    gap: 7px;
}

.theme-preset,
.density-option {
    min-height: 44px;
    border: 1px solid rgba(125, 211, 252, 0.12);
    border-radius: 10px;
    color: var(--home-muted);
    background: rgba(3, 10, 19, 0.28);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.theme-preset {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 0 10px;
    text-align: left;
}

.theme-preset:hover,
.density-option:hover {
    color: #ffffff;
    border-color: rgba(var(--home-accent-rgb), 0.32);
    background: rgba(var(--home-accent-rgb), 0.08);
}

.theme-preset.active,
.density-option.active {
    color: #ffffff;
    border-color: rgba(var(--home-accent-rgb), 0.46);
    background: linear-gradient(135deg, rgba(var(--home-accent-rgb), 0.16), rgba(var(--home-accent-2-rgb), 0.09));
    box-shadow: 0 10px 24px rgba(var(--home-accent-rgb), 0.1);
}

.theme-swatch {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.swatch-cyan { background: linear-gradient(135deg, #06111f, #22d3ee 52%, #2dd4bf); }
.swatch-minimal { background: linear-gradient(135deg, #080b10, #e5e7eb); }
.swatch-purple { background: linear-gradient(135deg, #0b0618, #a78bfa 50%, #f472b6); }
.swatch-glass { background: linear-gradient(135deg, rgba(8, 20, 30, 0.8), #7dd3fc 55%, #99f6e4); }
.swatch-warm { background: linear-gradient(135deg, #140f0a, #f59e0b 52%, #fb7185); }

.density-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.density-option {
    padding: 0 12px;
}

/* Content Area */
.content-area {
    padding: 16px 22px 96px;
    max-width: 1500px;
    width: 100%;
    margin: 0 auto;
}

.overview-strip {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    padding: 8px 12px;
    border: 1px solid rgba(125, 211, 252, 0.12);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(14, 31, 51, 0.68), rgba(8, 20, 35, 0.42));
}

.stat-item {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.stat-number {
    font-size: 22px;
    font-weight: 850;
    color: color-mix(in srgb, var(--home-accent) 68%, #ffffff);
    text-shadow: 0 0 18px rgba(var(--home-accent-rgb), 0.24);
}

.stat-label {
    font-size: 12px;
    color: var(--home-muted);
    font-weight: 700;
}

.overview-note {
    margin-left: auto;
    min-width: 0;
    color: #6f879b;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Category Section */
.category-section {
    margin-bottom: 28px;
    scroll-margin-top: 86px;
}

.category-header {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.category-title-wrapper {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.category-icon-lg {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(var(--category-accent-rgb), 0.26);
    background: linear-gradient(135deg, rgba(var(--category-accent-rgb), 0.16), rgba(var(--home-accent-2-rgb), 0.07));
    border-radius: 10px;
    font-size: 21px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 22px rgba(var(--category-accent-rgb), 0.1);
    flex-shrink: 0;
}

.category-icon-lg img {
    width: 26px;
    height: 26px;
}

.category-title {
    font-size: 18px;
    font-weight: 820;
    line-height: 1.25;
    margin: 0;
    color: #f3fbff;
}

.category-subtitle {
    display: block;
    margin-top: 1px;
    font-size: 12px;
    color: var(--home-dim);
    font-weight: 700;
}

.category-actions {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

.category-collapse-btn,
.category-anchor {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    color: #6d8499;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.18s ease;
}

.category-collapse-btn {
    background: transparent;
    cursor: pointer;
}

.category-collapse-btn svg {
    transition: transform 0.2s ease;
}

.category-section.is-collapsed .category-collapse-btn svg {
    transform: rotate(180deg);
}

.category-section.is-collapsed .sites-grid {
    display: none;
}

.category-section.is-collapsed {
    margin-bottom: 14px;
}

.category-collapse-btn:hover,
.category-anchor:hover {
    color: var(--category-accent);
    border-color: rgba(var(--category-accent-rgb), 0.2);
    background: rgba(var(--category-accent-rgb), 0.08);
}

/* Sites Grid */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
    gap: 11px;
}

/* Site Card */
.site-card {
    min-width: 0;
    min-height: 82px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    background: linear-gradient(145deg, var(--home-card), rgba(8, 19, 34, 0.72));
    border: 1px solid rgba(var(--category-accent-rgb), 0.14);
    border-radius: var(--home-radius-card);
    text-decoration: none;
    color: var(--home-muted);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.site-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(110deg, transparent 0%, rgba(var(--category-accent-rgb), 0.1) 36%, transparent 62%),
        radial-gradient(circle at 12% 0%, rgba(var(--category-accent-rgb), 0.16), transparent 42%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.site-card::after {
    content: '';
    position: absolute;
    left: -42%;
    top: 0;
    width: 42%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--category-accent-rgb), 0.95), transparent);
    opacity: 0;
    transition: transform 0.46s ease, opacity 0.2s ease;
}

.site-card:hover {
    transform: translateY(-3px);
    background: linear-gradient(145deg, var(--home-card-hover), rgba(10, 24, 40, 0.9));
    border-color: rgba(var(--category-accent-rgb), 0.42);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.26), 0 0 0 1px rgba(var(--category-accent-rgb), 0.07), 0 0 34px rgba(var(--category-accent-rgb), 0.08);
}

.site-card:hover::before {
    opacity: 1;
}

.site-card:hover::after {
    opacity: 1;
    transform: translateX(340%);
}

.site-card:focus-visible,
.category-link:focus-visible,
.engine-btn:focus-visible,
.search-btn:focus-visible,
.header-admin-link:focus-visible,
.admin-link:focus-visible,
.back-to-top:focus-visible,
.mobile-menu-btn:focus-visible,
.display-settings-btn:focus-visible,
.theme-toggle:focus-visible,
.theme-preset:focus-visible,
.density-option:focus-visible,
.category-collapse-btn:focus-visible,
.mobile-category-pill:focus-visible {
    outline: 2px solid rgba(var(--home-accent-rgb), 0.82);
    outline-offset: 2px;
}

.site-icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    overflow: hidden;
    flex-shrink: 0;
    background:
        radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.22), transparent 28%),
        linear-gradient(135deg, rgba(var(--category-accent-rgb), 0.2), rgba(var(--home-accent-2-rgb), 0.08));
    border: 1px solid rgba(var(--category-accent-rgb), 0.24);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 24px rgba(var(--category-accent-rgb), 0.12);
    position: relative;
    z-index: 1;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.site-icon-wrapper::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(var(--category-accent-rgb), 0.24), transparent 52%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.site-card:hover .site-icon-wrapper {
    border-color: rgba(var(--category-accent-rgb), 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 30px rgba(var(--category-accent-rgb), 0.22);
    transform: translateY(-1px);
}

.site-card:hover .site-icon-wrapper::before {
    opacity: 1;
}

.site-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

.site-info {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.site-name {
    font-size: 14px;
    font-weight: 780;
    line-height: 1.25;
    margin: 0 0 4px 0;
    color: #f4fbff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-description {
    font-size: 12px;
    color: var(--home-muted);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.45;
}

.site-arrow {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #08131f;
    background: rgba(var(--category-accent-rgb), 0.78);
    opacity: 0;
    transform: translateX(-7px) rotate(-18deg);
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 900;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.site-card:hover .site-arrow {
    opacity: 1;
    transform: translateX(0) rotate(0);
}

html[data-card-density="compact"] .sites-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 8px;
}

html[data-card-density="compact"] .site-card {
    min-height: 68px;
    gap: 10px;
    padding: 10px 11px;
}

html[data-card-density="compact"] .site-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

html[data-card-density="compact"] .site-icon {
    width: 24px;
    height: 24px;
}

html[data-card-density="compact"] .site-name {
    margin-bottom: 2px;
}

html[data-card-density="compact"] .site-description {
    -webkit-line-clamp: 1;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 78px 20px;
    border: 1px solid rgba(125, 211, 252, 0.12);
    border-radius: 14px;
    background: rgba(12, 25, 42, 0.56);
}

.empty-icon {
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    border: 1px solid rgba(var(--home-accent-rgb), 0.2);
    border-radius: 15px;
    color: var(--home-accent);
    font-size: 28px;
}

.empty-state h2 {
    font-size: 22px;
    margin-bottom: 8px;
    color: #f4fbff;
}

.empty-state p {
    color: var(--home-muted);
    margin-bottom: 24px;
}

.empty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 22px;
    background: linear-gradient(135deg, var(--home-accent) 0%, var(--home-accent-2) 100%);
    color: #03111d;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 850;
    transition: all 0.18s ease;
    box-shadow: 0 10px 24px rgba(var(--home-accent-rgb), 0.22);
}

.empty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(var(--home-accent-rgb), 0.28);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 80px;
    right: 22px;
    width: 44px;
    height: 44px;
    background: rgba(12, 25, 42, 0.86);
    color: #bff7ee;
    border: 1px solid rgba(var(--home-accent-2-rgb), 0.28);
    border-radius: 12px;
    font-size: 18px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px);
    transition: all 0.22s ease;
    box-shadow: var(--home-shadow);
    z-index: 50;
    backdrop-filter: blur(12px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    color: #03111d;
    background: var(--home-accent-2);
    transform: translateY(-2px);
}

.mobile-category-bar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    min-height: 58px;
    padding: 8px max(12px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-right));
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    background: linear-gradient(180deg, rgba(7, 17, 31, 0.68), rgba(7, 17, 31, 0.94));
    border-top: 1px solid var(--home-line);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.mobile-category-bar::-webkit-scrollbar {
    display: none;
}

.mobile-category-pill {
    min-width: 64px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 1px solid rgba(var(--category-accent-rgb), 0.14);
    border-radius: 999px;
    color: var(--home-muted);
    background: rgba(12, 25, 42, 0.72);
    text-decoration: none;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 850;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.mobile-category-pill.active {
    color: #06111f;
    border-color: rgba(var(--category-accent-rgb), 0.65);
    background: linear-gradient(135deg, var(--category-accent), var(--home-accent-2));
    box-shadow: 0 8px 24px rgba(var(--category-accent-rgb), 0.18);
}

.mobile-category-pill:active {
    transform: scale(0.97);
}

/* Responsive Design */
@media (max-width: 1180px) {
    .sites-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .main-content::before {
        left: 0;
    }

    .home-scanline {
        left: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .mobile-brand {
        display: flex;
        max-width: 160px;
    }

    .mobile-brand span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .search-header {
        padding: 10px 14px;
    }

    .search-container {
        max-width: none;
        margin: 0;
    }

    .header-admin-link {
        display: none;
    }

    .content-area {
        padding: 14px 14px 132px;
    }

    .mobile-category-bar {
        display: flex;
    }

    .mobile-category-bar:has(+ #music-player-mount .aplayer) {
        bottom: 66px;
    }
}

@media (max-width: 680px) {
    .search-header {
        flex-wrap: wrap;
        gap: 10px;
        min-height: 112px;
    }

    .search-container {
        flex-basis: 100%;
        order: 3;
    }

    .search-engine-selector {
        display: none;
    }

    .search-shortcut {
        display: none;
    }

    .search-input {
        padding-right: 12px;
    }

    .overview-strip {
        gap: 12px;
        margin-bottom: 14px;
    }

    .overview-note {
        display: none;
    }

    .sites-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .site-card {
        min-height: 92px;
        align-items: center;
        padding: 14px;
        touch-action: manipulation;
    }

    .site-icon-wrapper {
        width: 46px;
        height: 46px;
    }

    .site-icon {
        width: 30px;
        height: 30px;
    }

    .site-arrow {
        display: none;
    }

    .site-description {
        -webkit-line-clamp: 1;
    }

    .category-section {
        margin-bottom: 20px;
        scroll-margin-top: 124px;
    }

    .category-collapse-btn {
        width: 40px;
        height: 40px;
    }

    .category-anchor {
        display: none;
    }

    .display-settings-panel {
        right: -2px;
    }
}

@media (max-width: 430px) {
    .mobile-brand {
        max-width: calc(100vw - 86px);
    }

    .sites-grid {
        grid-template-columns: 1fr;
    }

    html[data-card-density="compact"] .sites-grid {
        grid-template-columns: 1fr;
    }

    .category-title {
        font-size: 17px;
    }

    .stat-number {
        font-size: 20px;
    }

    .content-area {
        padding-inline: 12px;
    }

    .overview-strip {
        padding-inline: 10px;
    }
}

@keyframes inputNudge {
    0%, 100% { transform: translateX(0); }
    35% { transform: translateX(-4px); }
    70% { transform: translateX(4px); }
}

@keyframes homeScan {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.12;
    }
    45%, 55% {
        opacity: 0.48;
    }
    50% {
        transform: translateY(72vh);
    }
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate3d(0, 0, 0);
        opacity: 0.22;
    }
    45% {
        transform: translate3d(12px, -18px, 0);
        opacity: 0.58;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .home-scanline,
    .home-particles,
    .home-mouse-glow {
        display: none;
    }
}

/* Scrollbar */
.sidebar::-webkit-scrollbar,
.category-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track,
.category-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb,
.category-nav::-webkit-scrollbar-thumb {
    background: rgba(125, 211, 252, 0.14);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.category-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(125, 211, 252, 0.26);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-section {
    animation: fadeInUp 0.36s ease both;
}

.sites-grid .site-card {
    animation: fadeInUp 0.28s ease both;
}

.sites-grid .site-card:nth-child(1) { animation-delay: 0.02s; }
.sites-grid .site-card:nth-child(2) { animation-delay: 0.04s; }
.sites-grid .site-card:nth-child(3) { animation-delay: 0.06s; }
.sites-grid .site-card:nth-child(4) { animation-delay: 0.08s; }
.sites-grid .site-card:nth-child(5) { animation-delay: 0.1s; }
.sites-grid .site-card:nth-child(6) { animation-delay: 0.12s; }

/* APlayer dark theme */
.aplayer {
    background: rgba(12, 25, 42, 0.94) !important;
    color: var(--home-text) !important;
    border: 1px solid rgba(125, 211, 252, 0.14) !important;
    box-shadow: var(--home-shadow) !important;
}

.aplayer .aplayer-body {
    background: rgba(12, 25, 42, 0.94) !important;
    color: var(--home-text) !important;
}

.aplayer .aplayer-icon svg path,
.aplayer .aplayer-icon svg circle {
    fill: var(--home-text) !important;
}

.aplayer .aplayer-info .aplayer-music .aplayer-title {
    color: #f4fbff !important;
}

.aplayer .aplayer-info .aplayer-music .aplayer-author {
    color: var(--home-muted) !important;
}

.aplayer .aplayer-list {
    background: rgba(12, 25, 42, 0.98);
    border-top: 1px solid rgba(125, 211, 252, 0.14);
}

.aplayer .aplayer-list li {
    border-top: 1px solid rgba(125, 211, 252, 0.08);
    color: var(--home-text);
}

.aplayer .aplayer-list li:hover,
.aplayer .aplayer-list li.aplayer-list-light {
    background: rgba(var(--home-accent-rgb), 0.08);
}
