:root {
    --bg: #f5f6fa;
    --bg-glow-1: rgba(99, 140, 255, 0.16);
    --bg-glow-2: rgba(255, 150, 190, 0.12);
    --card: rgba(255, 255, 255, 0.78);
    --card-solid: #ffffff;
    --text: #172033;
    --muted: #7a8496;
    --border: rgba(23, 32, 51, 0.08);
    --brand: var(--t-primary);
    --logo-l: 94%;
    --logo-s: 80%;
    --logo-fg-l: 44%;
    --shadow: 0 18px 40px rgba(23, 32, 51, 0.10);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f131b;
        --bg-glow-1: rgba(80, 120, 255, 0.18);
        --bg-glow-2: rgba(200, 90, 160, 0.12);
        --card: rgba(255, 255, 255, 0.05);
        --card-solid: #181d27;
        --text: #e8ecf3;
        --muted: #8a93a5;
        --border: rgba(255, 255, 255, 0.08);
        --brand: #7aa2ff;
        --logo-l: 20%;
        --logo-s: 45%;
        --logo-fg-l: 72%;
        --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(900px 500px at 15% -10%, var(--bg-glow-1), transparent 70%),
        radial-gradient(800px 500px at 95% 110%, var(--bg-glow-2), transparent 70%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
}

.page-shell {
    width: calc(100% - 32px);
    max-width: 900px;
    margin: 0 auto;
    padding: 12vh 0 64px;
}

.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    animation: fade-up 420ms ease both;
}

.header-mark {
    width: 60px;
    height: 60px;
    filter: drop-shadow(0 10px 18px rgba(91, 110, 245, 0.35));
    transition: transform 240ms ease;
}

.header-mark:hover {
    transform: rotate(-6deg) scale(1.05);
}

.header h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 440px;
    margin: 0 auto 40px;
    padding: 4px 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card);
    backdrop-filter: blur(12px);
    animation: fade-up 420ms 60ms ease both;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-icon {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    color: var(--muted);
    transition: color 160ms ease;
}

.search-container input {
    width: 100%;
    min-width: 0;
    padding: 10px 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 15px;
}

.search-container input::placeholder {
    color: var(--muted);
}

.search-container:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent);
}

.search-container:focus-within .search-icon {
    color: var(--brand);
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.nav-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    aspect-ratio: 1 / 0.74;
    padding: 20px 12px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--card);
    backdrop-filter: blur(12px);
    color: inherit;
    text-decoration: none;
    opacity: 0;
    animation: fade-up 380ms ease forwards;
    animation-delay: var(--delay);
    transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.nav-card:hover {
    transform: translateY(-4px);
    border-color: hsl(var(--hue) 60% 60% / 0.45);
    box-shadow: var(--shadow);
}

.nav-card:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent);
    outline-offset: 3px;
}

.nav-logo {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: hsl(var(--hue) var(--logo-s) var(--logo-l));
    color: hsl(var(--hue) 62% var(--logo-fg-l));
    transition: transform 200ms ease;
}

.nav-card:hover .nav-logo {
    transform: scale(1.08) rotate(-3deg);
}

.nav-logo svg {
    width: 28px;
    height: 28px;
}

.nav-title {
    max-width: 100%;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 28px 20px;
    color: var(--muted);
    text-align: center;
    animation: fade-up 220ms ease both;
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }
}

@media (max-width: 760px) {
    .page-shell {
        padding-top: 8vh;
    }

    .header h1 {
        font-size: 26px;
    }

    .nav-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .nav-logo {
        width: 52px;
        height: 52px;
    }
}
