/* css/navbar.css — 全站统一导航栏，与首页完全一致 */

/* ===== 导航栏容器 ===== */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: all 0.3s ease;
    background: transparent;
    padding: 24px 0;
}
#navbar.scrolled {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px 0;
}
#navbar .nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===== Logo ===== */
#navbar .nav-logo {
    display: flex;
    align-items: center;
    gap: 0;
    text-decoration: none;
    isolation: isolate;
    background: #030305;
    padding: 2px 4px;
    border-radius: 6px;
}
#navbar .logo-img {
    height: 44px;
    width: auto;
    position: relative;
    z-index: 2;
    mix-blend-mode: screen;
}
#navbar .logo-text {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
    margin-left: -8px;
    transform: skewX(-12deg);
}

/* ===== 导航链接 ===== */
#navbar .nav-links {
    display: none;
    align-items: center;
    gap: 32px;
}
@media (min-width: 768px) {
    #navbar .nav-links { display: flex; }
}
#navbar .nav-link {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.3s ease;
    text-decoration: none;
    cursor: pointer;
}
#navbar .nav-link:hover,
#navbar .nav-link.active {
    color: #fff;
}

/* ===== 右侧操作区 ===== */
#navbar .nav-actions {
    display: none;
    align-items: center;
    gap: 16px;
}
@media (min-width: 768px) {
    #navbar .nav-actions { display: flex; }
}

/* 公告按钮 */
#navbar .nav-notice-link {
    margin-right: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 8px !important;
    opacity: 1 !important;
    text-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    transition: color 0.3s ease;
    cursor: pointer;
    position: relative;
}
#navbar .nav-notice-link:hover {
    color: #fff;
    background: transparent !important;
}
#navbar .nav-notice-link svg {
    width: 16px;
    height: 16px;
}
#navbar .notice-dot {
    position: absolute;
    top: 2px;
    right: 0;
    width: 6px;
    height: 6px;
    background: #ef4444;
    border-radius: 50%;
    animation: notice-pulse 2s ease-in-out infinite;
}
@keyframes notice-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* 登录按钮 */
#navbar .nav-login-btn {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}
#navbar .nav-login-btn:hover { color: #fff; }

/* 注册按钮 */
#navbar .nav-register-btn {
    font-size: 14px;
    font-weight: 500;
    color: #000;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    background: #fff;
    transition: background 0.3s ease;
}
#navbar .nav-register-btn:hover { background: rgba(255, 255, 255, 0.85); }

/* 用户头像下拉（登录后由 nav-auth.js 注入） */
#navbar .user-dropdown { position: relative; display: inline-block; }

#navbar .user-avatar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 14px 4px 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.25s ease;
}
#navbar .user-avatar-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}
#navbar .avatar-circle {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: #fff;
    flex-shrink: 0;
}
#navbar .avatar-img {
    width: 30px; height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
#navbar .user-nickname {
    font-size: 13px; color: rgba(255, 255, 255, 0.85); font-weight: 500;
}
#navbar .user-avatar-btn svg { opacity: 0.4; transition: transform 0.25s ease; }
#navbar .user-dropdown.open .user-avatar-btn svg { transform: rotate(180deg); opacity: 0.7; }

#navbar .dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: -8px;
    min-width: 240px;
    background: rgba(30, 30, 50, 0.5);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.96);
    transform-origin: top right;
    transition: all 0.2s cubic-bezier(0.34, 1.2, 0.64, 1);
    z-index: 200;
    overflow: hidden;
}
#navbar .user-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* 下拉菜单用户信息头部 */
#navbar .dropdown-user-header {
    padding: 16px 18px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
}
#navbar .dropdown-user-header .avatar-circle,
#navbar .dropdown-user-header .avatar-img {
    width: 40px; height: 40px;
    font-size: 16px;
}
#navbar .dropdown-user-info { flex: 1; min-width: 0; }
#navbar .dropdown-user-name { font-size: 14px; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#navbar .dropdown-user-email { font-size: 12px; color: rgba(255, 255, 255, 0.4); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#navbar .dropdown-items { padding: 6px; }
#navbar .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}
#navbar .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}
#navbar .dropdown-item.danger { color: #ff6b6b; }
#navbar .dropdown-item.danger:hover { background: rgba(255, 107, 107, 0.08); color: #ff8787; }
#navbar .dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 4px 8px;
}

/* ===== 移动端汉堡按钮 ===== */
#navbar .mobile-toggle {
    display: flex;
    z-index: 50;
    color: #fff;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
}
@media (min-width: 768px) {
    #navbar .mobile-toggle { display: none; }
}

/* ===== 移动端响应 ===== */
@media (max-width: 768px) {
    #navbar .logo-img { height: 32px; }
    #navbar .logo-text { font-size: 1.2rem; }
}

/* ===== 移动端菜单面板（由 mobile-nav.js 动态创建） ===== */
.nav-mobile-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 90;
}
.nav-mobile-backdrop.active { display: block; }

.nav-mobile-menu {
    display: none;
    position: fixed;
    top: 0; right: 0;
    width: 75vw; max-width: 320px;
    height: 100vh;
    background: rgba(10, 10, 12, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 100;
    padding: 80px 24px 24px;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}
.nav-mobile-menu.open {
    display: flex;
    transform: translateX(0);
}

/* 导航链接 */
.nav-mobile-links {
    display: flex !important;
    flex-direction: column;
    gap: 0;
}
.nav-mobile-links a {
    display: block;
    padding: 14px 0;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: color 0.2s;
}
.nav-mobile-links a:hover { color: #fff; }

/* 右侧操作按钮（登录/注册/公告） */
.nav-mobile-actions {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.nav-mobile-actions a,
.nav-mobile-actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s;
    cursor: pointer;
}
.nav-mobile-actions a:hover,
.nav-mobile-actions button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* 桌面端隐藏菜单面板和遮罩 */
@media (min-width: 769px) {
    .nav-mobile-menu,
    .nav-mobile-backdrop { display: none !important; }
}

/* ===== 通用按钮（确认弹窗等使用，全站统一） ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 24px;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
    font-family: inherit;
    letter-spacing: 0.2px;
}
.btn-primary {
    background: #fff;
    color: #000;
}
.btn-primary:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.15);
}
.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
