:root {
    --primary-gradient: linear-gradient(135deg, #6366f1, #a855f7);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: #f8fafc;
    display: grid;
    grid-template-areas:
        "header header"
        "sidebar main";
    grid-template-rows: 60px 1fr;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

/* 顶部导航 */
header {
    grid-area: header;
    background: var(--primary-gradient);
    color: white;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    width: 100%;
    height: 60px;
    z-index: 100;
    box-shadow: var(--shadow);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

/* 左侧导航 */
.sidebar {
    grid-area: sidebar;
    background: white;
    padding: 1rem;
    box-shadow: var(--shadow);
    position: fixed;
    left: 0;
    top: 60px;
    height: calc(100vh - 60px);
    width: 250px;
    overflow-y: auto;
}

.nav-item {
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.nav-item:hover {
    background: #f1f5f9;
}

.nav-item.active {
    background: var(--primary-gradient);
    color: white;
}

.nav-item img {
    width: 24px;
    height: 24px;
}

/* 主内容区 */
main {
    grid-area: main;
    padding: 2rem;
    margin-left: 250px;
    margin-top: 60px;
}

.content-section {
    display: none;
}

.content-section.active {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-5px);
}

.tool-card h3 {
    color: #1e293b;
    margin-bottom: 1rem;
}

.tool-card a {
    color: #6366f1;
    text-decoration: none;
}

.tool-card img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        grid-template-areas:
            "header"
            "main";
        grid-template-columns: 1fr;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    main {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: block;
        position: fixed;
        left: 1rem;
        top: 1rem;
        z-index: 101;
    }
}