:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #111128;
    --bg-card: #161638;
    --bg-card-hover: #1c1c4a;
    --bg-sidebar: #0e0e24;
    --text-primary: #e0e0f0;
    --text-secondary: #9090b8;
    --text-muted: #606090;
    --accent-cyan: #00e5ff;
    --accent-magenta: #ff00e5;
    --accent-green: #00ff88;
    --accent-yellow: #ffe600;
    --accent-red: #ff4466;
    --accent-orange: #ff8800;
    --border: #1e1e4a;
    --border-light: #2a2a5a;
    --shadow-glow-cyan: 0 0 20px rgba(0, 229, 255, 0.15);
    --shadow-glow-magenta: 0 0 20px rgba(255, 0, 229, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: all 0.2s;
}

a:hover {
    color: var(--accent-magenta);
    text-shadow: 0 0 8px rgba(255, 0, 229, 0.4);
}

/* Header */
header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text-primary) !important;
    text-shadow: none !important;
}

.logo-icon {
    font-size: 1.5rem;
    color: var(--accent-cyan);
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.logo-text {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 1.5rem;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

/* Layout */
.layout {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    flex: 1;
    gap: 32px;
}

/* Sidebar */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    padding: 32px 0;
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 2px;
}

.sidebar a {
    display: block;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar a:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-left-color: var(--accent-cyan);
}

.sidebar a.active {
    background: var(--bg-card);
    color: var(--accent-cyan);
    border-left-color: var(--accent-cyan);
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.3);
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

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

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

/* Main */
main {
    flex: 1;
    min-width: 0;
    padding: 32px 0 64px;
}

article {
    max-width: 780px;
}

/* Hero */
.hero {
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 12px;
}

.neon {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 48px;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    transition: all 0.3s;
}

.category-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-cyan);
    box-shadow: var(--shadow-glow-cyan);
    transform: translateY(-2px);
}

.category-card h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-cyan);
    margin-bottom: 12px;
    font-weight: 700;
}

.category-card ul {
    list-style: none;
}

.category-card li {
    margin-bottom: 4px;
}

.category-card a {
    font-size: 0.95rem;
    font-weight: 500;
}

/* Wiki Content */
.wiki-content {
    margin-bottom: 48px;
}

.wiki-content h1,
article h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.wiki-content h2,
article h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 36px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--accent-cyan);
}

.wiki-content h3,
article h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 28px 0 12px;
    color: var(--accent-magenta);
}

.wiki-content h4,
article h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 20px 0 8px;
    color: var(--accent-yellow);
}

.wiki-content p,
article p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.wiki-content ul,
article ul,
.wiki-content ol,
article ol {
    margin: 0 0 20px 24px;
    color: var(--text-secondary);
}

.wiki-content li,
article li {
    margin-bottom: 6px;
}

.wiki-content strong,
article strong {
    color: var(--text-primary);
}

.wiki-content hr,
article hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 32px 0;
}

/* Tables */
.wiki-content table,
article table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0 28px;
    font-size: 0.9rem;
}

.wiki-content th,
article th {
    background: var(--bg-card);
    color: var(--accent-cyan);
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border: 1px solid var(--border);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.wiki-content td,
article td {
    padding: 10px 16px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.wiki-content tr:nth-child(even),
article tr:nth-child(even) {
    background: rgba(22, 22, 56, 0.5);
}

.wiki-content tr:hover,
article tr:hover {
    background: var(--bg-card-hover);
}

/* Code */
.wiki-content code,
article code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--accent-green);
}

.wiki-content pre,
article pre {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    overflow-x: auto;
    margin: 20px 0 28px;
}

.wiki-content pre code,
article pre code {
    background: none;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Blockquotes */
.wiki-content blockquote,
article blockquote {
    border-left: 3px solid var(--accent-magenta);
    padding: 12px 20px;
    margin: 20px 0;
    background: rgba(255, 0, 229, 0.05);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.wiki-content blockquote p,
article blockquote p {
    margin-bottom: 0;
}

/* Screenshot Card */
.screenshot-card {
    margin-bottom: 32px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
    max-width: 400px;
}

.screenshot-card img {
    width: 100%;
    height: auto;
    display: block;
}

/* Gallery */
.gallery {
    margin-top: 48px;
}

.gallery h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--accent-cyan);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.gallery-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s;
}

.gallery-item:hover {
    border-color: var(--accent-magenta);
    box-shadow: var(--shadow-glow-magenta);
    transform: translateY(-2px);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-item span {
    display: block;
    padding: 8px 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* Download Button */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding: 14px 32px;
    background: var(--bg-card);
    border: 1px solid var(--accent-green);
    border-radius: var(--radius);
    color: var(--accent-green) !important;
    font-size: 1.05rem;
    font-weight: 700;
    transition: all 0.3s;
    text-shadow: none !important;
}

.download-btn:hover {
    background: var(--accent-green);
    color: var(--bg-primary) !important;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
    transform: translateY(-2px);
}

.download-btn .icon {
    font-size: 1.3rem;
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-download {
    margin-top: 8px;
}

.footer-download a {
    color: var(--accent-green);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        height: auto;
        max-height: calc(100vh - 60px);
        background: var(--bg-sidebar);
        border-bottom: 1px solid var(--border);
        padding: 16px 24px;
        z-index: 99;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    }

    .sidebar.open {
        display: block;
    }

    .menu-toggle {
        display: block;
    }

    .layout {
        padding: 0 16px;
        gap: 0;
    }

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

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 500px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .wiki-content table,
    article table {
        font-size: 0.8rem;
    }

    .wiki-content th,
    article th,
    .wiki-content td,
    article td {
        padding: 8px 10px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Selection */
::selection {
    background: rgba(0, 229, 255, 0.3);
    color: var(--text-primary);
}
