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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #0d0f12;
    color: #fff;
}

.app {
    display: flex;
    min-height: 100vh;
    position: relative; /* For overlay positioning */
}

/* Overlay styles */
.overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Black with 60% opacity */
    z-index: 99; /* Below sidebar but above main content */
}

.sidebar.active ~ .overlay {
    display: block; /* Show when sidebar is active */
}

/* Sidebar styles */
.sidebar {
    width: 280px;
    background-color: #1a1d21;
    padding: 24px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #2a2d31;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    z-index: 100; /* Above overlay */
}

.menu-toggle {
    display: none; /* Hidden by default, shown on mobile */
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    position: relative;
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

.menu-toggle .hamburger {
    display: block;
}

.menu-toggle .close {
    display: none;
}

.sidebar.active .menu-toggle .hamburger {
    display: none;
}

.sidebar.active .menu-toggle .close {
    display: block;
}

.wallet-info {
    margin-top: 16px;
    padding: 16px;
    background-color: #2a2d31;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.wallet-info .balance-item {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    background-color: #1a1d21;
}

.wallet-info .token-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wallet-info .balance-label {
    color: #8b8d90;
    font-size: 14px;
    min-width: 40px;
}

.wallet-info .balance-value {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

.wallet-info .price-trend {
    font-size: 14px;
    padding: 2px 8px;
    border-radius: 4px;
    background-color: #2a2d31;
}

.wallet-info .price-trend.positive {
    color: #4caf50;
}

.wallet-info .price-trend.negative {
    color: #ff4d4d;
}

.wallet-info .wallet-address {
    font-size: 12px;
    color: #8b8d90;
    word-break: break-all;
    text-align: center;
    padding-top: 8px;
    border-top: 1px solid #2a2d31;
}

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

.logo img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.logo span {
    font-size: 20px;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 32px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    transition: background-color 0.2s;
}

.nav-item:hover,
.nav-item.active {
    background-color: #2a2d31;
}

.nav-item svg {
    width: 20px;
    height: 20px;
}

.social-links {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid #2a2d31;
}

.social-links h3 {
    font-size: 14px;
    color: #8b8d90;
    margin-bottom: 16px;
}

.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.social-buttons a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    transition: background-color 0.2s;
    background-color: #2a2d31;
}

.social-buttons a:hover {
    background-color: #3a3d41;
}

.connect-wallet {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    background-color: #ffd60a;
    color: #000;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.connect-wallet:hover {
    background-color: #ffde3a;
}

/* Main content styles */
.main-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.header {
    margin-bottom: 32px;
}

.featured-section h1 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    margin-bottom: 8px;
}

.featured-section p {
    color: #8b8d90;
}

.categories {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #2a2d31;
    background-color: transparent;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.category-btn:hover,
.category-btn.active {
    background-color: #ffd60a;
    border-color: #ffd60a;
    color: #000;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.tool-card {
    background-color: #1a1d21;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #2a2d31;
    transition: transform 0.2s;
}

.tool-card:hover {
    transform: translateY(-4px);
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.tool-logo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

.tool-info h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.tool-category {
    font-size: 14px;
    color: #8b8d90;
}

.tool-description {
    color: #8b8d90;
    margin-bottom: 24px;
    line-height: 1.5;
}

.tool-links {
    display: flex;
    gap: 12px;
}

.tool-link {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s;
}

.tool-link.website {
    background-color: #2a2d31;
    color: #fff;
}

.tool-link.website:hover {
    background-color: #3a3d41;
}

.tool-link.access {
    background-color: #ffd60a;
    color: #000;
}

.tool-link.access:hover {
    background-color: #ffde3a;
}

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

    .sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 100;
        background-color: #1a1d21;
        padding: 16px;
        display: flex;
        align-items: center;
        flex-direction: row;
        flex-wrap: nowrap;
    }

    .logo {
        margin-bottom: 0;
        position: absolute; /* Keep logo fixed in top-left */
        top: 16px;
        left: 16px;
    }

    .nav-menu,
    .wallet-info,
    .social-links {
        display: none; /* Hidden by default on mobile */
    }

    .menu-toggle {
        display: block; /* Show on mobile */
        order: 2;
        margin-left: auto;
    }

    .sidebar.active {
        flex-direction: column; /* Stack elements vertically when active */
        height: auto; /* Allow height to adjust to content */
        padding-top: 60px; /* Space for fixed logo */
        padding-bottom: 16px; /* Add padding at bottom */
    }

    .sidebar.active .nav-menu,
    .sidebar.active .wallet-info,
    .sidebar.active .social-links {
        display: flex; /* Show when sidebar is active */
        position: static; /* Natural flow */
        width: 100%;
        background-color: #1a1d21;
        padding: 0; /* Reset padding */
    }

    .sidebar.active .social-links h3 {
        display: none; /* Hide "Connect with us" when active */
    }

    .social-buttons {
        flex-direction: row;
        justify-content: space-between;
        gap: 8px;
    }

    .social-buttons a,
    .connect-wallet {
        flex: 1;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 12px;
        min-width: 0;
        white-space: nowrap;
    }

    .main-content {
        margin-top: 80px;
        padding: 16px;
    }

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

    .nav-menu {
        flex-direction: column;
        width: 100%;
        margin-bottom: 16px;
    }

    .nav-item {
        width: 100%;
    }

    /* 移除重复的样式 */
}