/* ============================================================
 * qqshiye 全站公共顶部 nav 样式（方案 A）
 *
 * 从global-vision index.php 抽取，所有子站统一引用
 * 配套使用：<link rel="stylesheet" href="/css/nav.css">
 * 配套组件：/includes/nav.php
 *
 * 设计基调：暗色电影感（与global-vision主站一致）
 * 颜色用项目统一 CSS 变量（--moon-white / --horizon-gold / --mist-blue）
 * ============================================================ */

/* nav 容器 */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem 2rem;
    padding: clamp(0.9rem, 2vh, 1.25rem) 4vw;
    /* 常驻极淡顶部压暗渐变：不破坏沉浸感，又压出地球背景上的可读性 */
    background: linear-gradient(to bottom,
        rgba(6, 10, 16, 0.62) 0%,
        rgba(6, 10, 16, 0.28) 62%,
        transparent 100%);
    transition: background-color 0.45s ease, box-shadow 0.45s ease;
}

/* 滚动后：实底加深 + 底缘发丝分割 */
.nav.is-scrolled {
    background-color: rgba(8, 13, 20, 0.88);
    box-shadow:
        0 1px 0 rgba(147, 168, 189, 0.12),
        0 12px 32px rgba(4, 8, 14, 0.45);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

/* 品牌字样：衬线小字 + 轻辉光 */
.nav__brand {
    font-family: var(--serif-cn, "Songti SC", "STSong", "SimSun", serif);
    font-weight: 500;
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    letter-spacing: 0.32em;
    color: var(--moon-white, #e8eef5);
    text-decoration: none;
    text-shadow:
        0 0 14px rgba(147, 168, 189, 0.4),
        0 0 40px rgba(147, 168, 189, 0.16);
    white-space: nowrap;
}

.nav__menu {
    display: flex;
    align-items: center;
    gap: clamp(1.1rem, 2.2vw, 2.2rem);
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav__link {
    position: relative;
    display: inline-block;
    padding: 0.3em 0;
    font-size: clamp(0.72rem, 1vw, 0.8rem);
    letter-spacing: 0.18em;
    color: rgba(200, 214, 228, 0.78);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.35s ease, text-shadow 0.35s ease;
}

/* 下方细金线：悬停/激活时自中心生长 */
.nav__link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(217, 179, 132, 0.85) 50%,
        transparent);
    transform: scaleX(0);
    transition: transform 0.35s ease;
}

.nav__link:hover {
    color: var(--horizon-gold, #d9b384);
    text-shadow: 0 0 14px rgba(217, 179, 132, 0.35);
}
.nav__link:hover::after { transform: scaleX(1); }

/* 当前页激活态 */
.nav__link.is-active {
    color: var(--horizon-gold, #d9b384);
}
.nav__link.is-active::after { transform: scaleX(1); }

/* 窄屏：品牌与菜单上下两行，菜单条横向可滑不折行不重叠 */
@media (max-width: 720px) {
    .nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0.55rem;
        padding: 0.8rem 5vw 0.55rem;
    }
    .nav__brand { text-align: center; }
    .nav__menu {
        gap: 1.15rem;
        overflow-x: auto;
        padding-bottom: 0.35rem;
        scrollbar-width: none;
    }
    .nav__menu::-webkit-scrollbar { display: none; }
}

/* 减弱动态偏好：导航取消过渡 */
@media (prefers-reduced-motion: reduce) {
    .nav, .nav__link, .nav__link::after { transition: none; }
}

/* ============================================================
 * nav 右侧登录/用户区（#navAuth 由 /js/auth.js 渲染）
 * 极简版：未登录显示「登录」按钮，已登录显示「已登录」+ 下拉「退出登录」
 * ============================================================ */
#navAuth { display: inline-flex; align-items: center; }
#navAuth .n-btn-out {
    display: inline-block;
    color: #d9b384;
    background: transparent;
    border: 1px solid #d9b384;
    padding: 4px 13px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 4px;
    transition: .2s;
    cursor: pointer;
    text-decoration: none;
}
#navAuth .n-btn-out:hover { background: rgba(217, 179, 132, 0.12); }
#navAuth .n-user {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 4px;
    border-radius: 18px;
    cursor: pointer;
    transition: .2s;
    margin-left: 4px;
}
#navAuth .n-user:hover { background: rgba(147, 168, 189, 0.10); }
#navAuth .n-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0;
}
#navAuth .n-name {
    font-size: 12px;
    color: rgba(200, 214, 228, 0.78);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
#navAuth .n-arrow {
    font-size: 10px;
    color: #93a8bd;
    transition: .2s;
}
#navAuth .n-user:hover .n-arrow { color: #d9b384; }
#navAuth .n-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 140px;
    background: rgba(11, 17, 24, 0.96);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(147, 168, 189, 0.18);
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(4, 8, 14, 0.65);
    padding: 4px 0;
    display: none;
    z-index: 1000;
}
#navAuth .n-menu.on { display: block; }
#navAuth .n-menu-item {
    display: block;
    padding: 8px 14px;
    font-size: 12px;
    color: #e8eef5;
    text-decoration: none;
    transition: .15s;
    cursor: pointer;
    letter-spacing: 0.06em;
}
#navAuth .n-menu-item:hover {
    background: rgba(217, 179, 132, 0.10);
    color: #d9b384;
}
#navAuth .n-menu-div {
    height: 1px;
    background: rgba(147, 168, 189, 0.18);
    margin: 4px 0;
}
