/* ===== 基础重置 ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
}

body {
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: #fff;
    background: #0a0e1a;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    display: block;
}

/* ===== 导航栏 ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: linear-gradient(180deg, rgba(30, 30, 40, 0.85) 0%, rgba(20, 20, 30, 0.6) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 28px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #e8e8ef;
    transition: color 0.2s ease;
}

/* 原图是黑色线条 + 透明底，反色后在深色导航栏上才看得见 */
.nav-brand__logo {
    width: auto;
    height: 26px;
    filter: invert(1);
    opacity: 0.92;
    transition: opacity 0.2s ease;
}

.nav-brand:hover {
    color: #fff;
}

.nav-brand:hover .nav-brand__logo {
    opacity: 1;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 8px 20px;
    font-size: 15px;
    font-weight: 500;
    color: #c8c8d4;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-link--active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* ===== 星空背景 ===== */
.starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: radial-gradient(ellipse at center,
                #142038 0%,
                #0d1526 35%,
                #080c18 70%,
                #050810 100%);
}

#stars-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ===== 页面容器 ===== */
.page {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 88px 40px 48px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.page--active {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.page-inner {
    width: 100%;
    max-width: 400px;
}

/* ===== 按钮列表（左上竖排） ===== */
.menu-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

/* ===== 菜单按钮（同款） ===== */
.menu-button {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    min-height: 96px;
    padding: 18px 22px 26px;
    color: #eaf0ff;
    background: linear-gradient(180deg, rgba(96, 122, 172, 0.3) 0%, rgba(30, 46, 78, 0.26) 100%);
    border: 1px solid rgba(158, 184, 232, 0.32);
    border-radius: 8px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.09),
        0 10px 28px rgba(2, 6, 16, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.18s ease, box-shadow 0.18s ease,
                background 0.18s ease, border-color 0.18s ease;
}

/* 悬停时的一层边缘微光，用伪元素避免影响内容 */
.menu-button::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(115deg, rgba(190, 212, 255, 0.12), transparent 48%);
    opacity: 0;
    transition: opacity 0.18s ease;
    pointer-events: none;
}

.menu-button:hover {
    border-color: rgba(180, 205, 255, 0.6);
    background: linear-gradient(180deg, rgba(110, 140, 196, 0.38) 0%, rgba(36, 55, 92, 0.3) 100%);
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 14px 34px rgba(2, 6, 16, 0.5),
        0 0 22px rgba(110, 160, 235, 0.18);
}

.menu-button:hover::after {
    opacity: 1;
}

.menu-button:active {
    transform: translateY(0);
}

.menu-button:focus-visible {
    outline: 2px solid #cfe0ff;
    outline-offset: 4px;
}

.menu-button__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 56px;
    height: 56px;
}

.menu-button__icon img {
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
}

.menu-button__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.menu-button__eyebrow {
    font-size: 13px;
    letter-spacing: 0.2em;
    color: rgba(186, 204, 235, 0.58);
}

.menu-button__title {
    font-size: 29px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.05em;
    color: #eef3ff;
}

.menu-button__title--sm {
    font-size: 15px;
    font-weight: 500;
    font-family: ui-monospace, "SFMono-Regular", Consolas, "Courier New", monospace;
    letter-spacing: 0;
}

.menu-button__version {
    position: absolute;
    right: 14px;
    bottom: 9px;
    font-size: 11px;
    font-family: ui-monospace, "SFMono-Regular", Consolas, "Courier New", monospace;
    color: rgba(170, 190, 225, 0.45);
}

/* 版本条目：矮、只贴文字、不显示图标 */
.menu-button--version {
    min-height: 0;
    padding: 12px 16px;
    gap: 12px;
    border-radius: 6px;
}

.menu-button--version .menu-button__version {
    position: static;
    margin-left: auto;
    font-size: 11px;
    letter-spacing: 0;
    white-space: nowrap;
}

/* ===== 返回链接 ===== */
.back-link {
    display: inline-block;
    margin-bottom: 18px;
    font-size: 13px;
    letter-spacing: 0.08em;
    color: rgba(195, 210, 238, 0.6);
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #fff;
}

.back-link:focus-visible {
    outline: 2px solid #cfe0ff;
    outline-offset: 3px;
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
    .nav-container {
        height: 48px;
        padding: 0 16px;
    }

    .nav-brand {
        font-size: 18px;
    }

    .nav-brand__logo {
        height: 22px;
    }

    .nav-link {
        padding: 6px 14px;
        font-size: 14px;
    }

    .page {
        padding: 68px 18px 40px;
    }

    .menu-button {
        min-height: 84px;
        padding: 14px 16px 24px;
        gap: 13px;
    }

    .menu-button__icon {
        width: 48px;
        height: 48px;
    }

    .menu-button__icon img {
        width: 40px;
        height: 40px;
    }

    .menu-button__title {
        font-size: 23px;
    }

    .menu-button__title--sm {
        font-size: 14px;
    }

    .menu-button--version {
        min-height: 0;
        padding: 11px 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .page,
    .menu-button {
        transition-duration: 0.01ms;
    }

    .menu-button:hover {
        transform: none;
    }
}
