:root {
    --bg-primary: #0a0a0b;
    --bg-secondary: #131316;
    --bg-tertiary: #1a1a1f;
    --bg-hover: #222228;
    --border: #2a2a32;
    --border-light: #3a3a44;
    --text-primary: #f0f0f2;
    --text-secondary: #a0a0a8;
    --text-muted: #606068;
    --accent: #8b5cf6;
    --accent-dim: #7c3aed;
    --accent-glow: rgba(139, 92, 246, 0.15);
    --success: #22c55e;
    --error: #ef4444;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    overflow: hidden;
}

/* ── App Shell ── */
.app {
    display: flex;
    height: 100vh;
    height: 100dvh;
}

/* ── Sidebar (Desktop) ── */
.sidebar {
    width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.nav-items {
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent);
}

.nav-item.active svg {
    stroke: var(--accent);
}

/* ── Main Content ── */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 32px 40px;
    padding-bottom: 32px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.panel-header {
    margin-bottom: 32px;
}

.panel-header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.panel-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    font-family: inherit;
}

/* ── Tools Grid ── */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 12px;
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.tool-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-light);
    transform: translateY(-1px);
}

.tool-card:active {
    transform: translateY(0);
}

.tool-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    color: var(--accent);
    font-weight: 600;
}

.tool-card:hover .tool-icon {
    background: var(--accent-glow);
    border-color: var(--accent);
}

.tool-info {
    flex: 1;
    min-width: 0;
}

.tool-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
    letter-spacing: -0.2px;
}

.tool-desc {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: inherit;
    line-height: 1.4;
}

.tool-arrow {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.tool-card:hover .tool-arrow {
    color: var(--accent);
    transform: translateX(2px);
}

/* ── Updates List ── */
.updates-list {
    display: flex;
    flex-direction: column;
}

.update-date-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px 0 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.update-date-header:first-child {
    padding-top: 0;
}

.update-entry {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.update-entry:last-child {
    border-bottom: none;
}

.update-time {
    font-size: 13px;
    color: var(--text-muted);
    flex-shrink: 0;
    width: 80px;
    padding-top: 1px;
    font-variant-numeric: tabular-nums;
}

.update-body {
    flex: 1;
    min-width: 0;
}

.update-tool {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-glow);
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.update-desc {
    font-size: 14px;
    color: var(--text-secondary);
    font-family: inherit;
    line-height: 1.5;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 60px 20px;
    font-size: 15px;
}

/* ── Bottom Navigation (Mobile) ── */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 100;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
}

.bottom-nav-item.active {
    color: var(--accent);
}

.bottom-nav-item.active svg {
    stroke: var(--accent);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .app {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .nav-items {
        display: none;
    }

    .bottom-nav {
        display: flex;
    }

    .panel-header {
        display: none;
    }

    .content {
        padding: 24px 20px;
        padding-top: calc(24px + 85px);
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }

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

    .tool-card {
        padding: 16px;
    }

    .tool-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .update-time {
        width: 70px;
        font-size: 12px;
    }

    .content {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .content::-webkit-scrollbar {
        display: none;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 20px 16px;
        padding-top: calc(20px + 85px);
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }

    .tool-arrow {
        display: none;
    }
}

/* Scrollbar */
.content::-webkit-scrollbar {
    width: 6px;
}

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

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

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