:root {
    --bg-color: #f0f4f8;
    --text-color: #334e68;
    --link-bg-color: rgba(255, 255, 255, 0.7);
    --link-border-color: rgba(255, 255, 255, 0.5);
    --accent-color: #3498db;
    --link-hover-bg: rgba(255, 255, 255, 0.9);
    --category-title-color: #2a415a;
    --box-shadow-light: 0 8px 30px rgba(0, 0, 0, 0.08);
    --box-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.12);
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a232b;
        --text-color: #e2e8f0;
        --link-bg-color: rgba(45, 53, 62, 0.6);
        --link-border-color: rgba(60, 70, 80, 0.5);
        --accent-color: #2980b9;
        --link-hover-bg: rgba(45, 53, 62, 0.9);
        --category-title-color: #e2e8f0;
        --box-shadow-light: 0 8px 30px rgba(0, 0, 0, 0.2);
        --box-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.3);
    }
}

body {
    font-family: 'Helvetica Neue', 'Arial', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
}

.container {
    width: 100%;
    max-width: 900px;
    padding: 20px;
    box-sizing: border-box;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 3em;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -1px;
    margin-bottom: 0;
}

.search-container {
    margin-bottom: 40px;
    width: 100%;
}

#search-input {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid var(--link-border-color);
    border-radius: 8px;
    background-color: var(--link-bg-color);
    color: var(--text-color);
    font-size: 1em;
    transition: var(--transition);
    box-shadow: var(--box-shadow-light);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-sizing: border-box; 
}

#search-input::placeholder {
    color: var(--text-color);
    opacity: 0.6;
}

#search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.2);
}

.category-section {
    margin-bottom: 40px;
}

.category-title {
    font-size: 1.8em;
    font-weight: 600;
    color: var(--category-title-color);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--link-border-color);
    padding-bottom: 8px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    background-color: var(--link-bg-color);
    border: 1px solid var(--link-border-color);
    border-radius: 12px;
    padding: 15px 20px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 1em;
    /* font-weight: 600; */
    box-shadow: var(--box-shadow-light);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition);
}

.nav-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--box-shadow-hover);
    border-color: var(--accent-color);
}

.nav-item:active {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-light);
}

.nav-item-hidden {
    display: none !important;
}

/* 回到首页按钮 */
.back-to-home {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background-color: var(--link-bg-color);
    color: var(--text-color);
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 600;
    box-shadow: var(--box-shadow-light);
    transition: var(--transition);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.back-to-home:hover {
    transform: scale(1.05);
    box-shadow: var(--box-shadow-hover);
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 10px;
    }

    h1 {
        font-size: 1.6em;
    }

    .nav-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .nav-item {
        font-size: 0.8em;
        min-height: 60px;
    }

    .search-container {
        max-width: 900px
        margin-bottom: 20px;
    }

    #search-input {
        padding: 10px 15px;
        font-size: 0.9em;
        box-sizing: border-box; 
    }

    .category-title {
        font-size: 1.3em;
        margin-bottom: 12px;
    }
}
