* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

:root {
    --bg: #f5f7fa;
    --card-bg: rgba(255,255,255,0.92);
    --text: #222;
    --text-secondary: #555;
    --text-desc: #888;
    --primary: #409eff;
    --hover-bg: #409eff;
    --hover-color: #fff;
    --mask: rgba(255,255,255,0.85);
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
}

[data-theme="dark"] {
    --bg: #121212;
    --card-bg: rgba(30,30,30,0.9);
    --text: #eaeaea;
    --text-secondary: #c0c0c0;
    --text-desc: #808080;
    --primary: #409eff;
    --hover-bg: #409eff;
    --hover-color: #fff;
    --mask: rgba(0,0,0,0.7);
    --shadow: 0 2px 12px rgba(0,0,0,0.2);
}

body {
    background-color: var(--bg);
    background-image: url(https://picsum.photos/1920/1080?blur=2&random=nav);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    padding: 20px;
    position: relative;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--mask);
    z-index: -1;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    padding-bottom: 40px;
}

.theme-switch,
.back-top {
    position: fixed;
    right: 20px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--card-bg);
    border: none;
    color: var(--text);
    font-size: 17px;
    cursor: pointer;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.theme-switch {
    top: 20px;
}

.back-top {
    bottom: 20px;
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.2s;
}

.back-top.show {
    opacity: 1;
    visibility: visible;
}

.theme-switch:hover,
.back-top:hover {
    transform: scale(1.08);
}

.back-top:hover {
    background: var(--primary);
    color: #fff;
}

.header {
    text-align: center;
    margin: 50px 0 30px;
}

.header h1 {
    font-size: 34px;
    color: var(--text);
    font-weight: 500;
}

.search-wrap {
    max-width: 620px;
    margin: 0 auto 40px;
    position: relative;
}

.search-box {
    display: flex;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--card-bg);
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    padding: 16px 22px;
    font-size: 16px;
    background: transparent;
    color: var(--text);
}

.search-box button {
    padding: 16px 26px;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.search-box button:hover {
    opacity: 0.92;
}

.suggest-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-radius: 0 0 10px 10px;
    box-shadow: var(--shadow);
    list-style: none;
    max-height: 240px;
    overflow-y: auto;
    display: none;
    z-index: 999;
    margin-top: 4px;
}

.suggest-item {
    padding: 11px 22px;
    cursor: pointer;
    color: var(--text);
    font-size: 15px;
}

.suggest-item:hover {
    background-color: rgba(64,158,255,0.12);
    color: var(--primary);
}

.nav-group {
    margin-bottom: 35px;
}

.nav-group h2 {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    padding-left: 6px;
    font-weight: 500;
}

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

.nav-item {
    background: var(--card-bg);
    backdrop-filter: blur(6px);
    padding: 17px 10px;
    border-radius: 10px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    position: relative;
    font-size: 15px;
}

.nav-item-text {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item:hover {
    background: var(--hover-bg);
    color: var(--hover-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(64,158,255,0.25);
}

.nav-item .tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 10;
}

.nav-item .tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.nav-item:hover .tooltip {
    opacity: 1;
}

[data-theme="dark"] .nav-item .tooltip {
    background: #444;
}
[data-theme="dark"] .nav-item .tooltip::after {
    border-color: #444 transparent transparent transparent;
}

.footer {
    text-align: center;
    margin-top: 60px;
    color: var(--text-desc);
    font-size: 14px;
}

@media (max-width: 768px) {
    .nav-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    .header h1 {
        font-size: 28px;
    }
}
