/* Skip to main content link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100000;
    border-radius: 0 0 4px 0;
}
.skip-to-content:focus {
    top: 0;
}

/* Admin link styling */
.admin-link {
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
}

.admin-link:hover {
    background: rgba(255, 255, 255, 0.3) !important;
}

/* Fixed navbar with padding compensation - 会被_AnnouncementBar中的动态计算覆盖 */
body {
    padding-top: 70px; /* 默认值，当有公告时会动态调整 */
    margin: 0; /* 移除body默认margin */
}

/* 移除html的默认margin和padding */
html {
    margin: 0;
    padding: 0;
}

/* Navbar search styling - OpenRouter inspired */
.navbar-search {
    min-width: 280px;
    max-width: 400px;
}

.navbar-search .input-group {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.navbar-search .input-group:hover {
    background: rgba(255, 255, 255, 0.2);
}

.navbar-search .input-group:focus-within {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.navbar-search .input-group-text {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    padding-left: 1rem;
}

.navbar-search .form-control {
    background: transparent;
    border: none;
    color: white;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
}

.navbar-search .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.navbar-search .form-control:focus {
    background: transparent;
    border: none;
    color: white;
    box-shadow: none;
    outline: none;
}

.navbar-search .btn-outline-light {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.navbar-search .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: scale(1.05);
}

@media (max-width: 991px) {
    .navbar-search {
        display: none !important;
    }
}

/* 导航栏固定定位 - 确保始终悬浮在顶部 */
.modern-navbar {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    backdrop-filter: blur(10px);
    margin: 0;
    transition: all 0.3s ease;
    /* 默认状态：完全不透明 */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* 滚动后的透明状态 */
.modern-navbar.scrolled {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.6) 0%, rgba(118, 75, 162, 0.6) 100%) !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* 手机端更高透明度 */
@media (max-width: 768px) {
    .modern-navbar.scrolled {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%) !important;
        backdrop-filter: blur(25px);
    }
}

/* 当有公告时，导航栏位置动态调整 */
.navbar.fixed-top {
    top: var(--announcement-height, 0px) !important;
}

/* 主内容区域 - 添加顶部间隙 */
.main-content {
    padding-top: 30px;
}

/* 容器内边距调整 */
.main-content > .container,
.main-content > div:not(.toast-container) {
    padding-top: 0;
}

/* Logo样式 - 精致小巧设计 */
.navbar-brand-hero {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.95) !important;
    transition: all 0.3s ease;
}

.navbar-brand-hero:hover {
    transform: translateY(-2px);
}

.navbar-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: all 0.3s ease;
}

.navbar-brand-hero:hover .navbar-icon {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: rotate(-5deg);
}

.modern-navbar .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 15px !important;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.modern-navbar .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.modern-navbar .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: white;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.modern-navbar .nav-link:hover::after {
    width: 80%;
}

.modern-navbar .nav-link i {
    font-size: 1.1rem;
}

.user-points {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 6px 15px !important;
}

.vip-badge-nav {
    background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(246, 173, 85, 0.3);
}

.logout-btn {
    border: none;
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none;
}

.logout-btn:hover {
    color: white !important;
}

/* 下拉菜单现代化样式 */
.dropdown-menu-modern {
    background: white;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 8px;
    min-width: 200px;
    margin-top: 10px;
}

.dropdown-menu-modern .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: #2d3748;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.dropdown-menu-modern .dropdown-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateX(3px);
}

.dropdown-menu-modern .dropdown-item i {
    font-size: 1.1rem;
    width: 20px;
}

.dropdown-menu-modern .dropdown-divider {
    margin: 8px 0;
    border-color: #e5e7eb;
}

/* VIP徽章小尺寸 - 移除重复定义 */

/* 管理后台图标样式 */
.admin-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
}

/* 移动端覆盖层 */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

/* 移动端菜单面板 */
.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background: white;
    z-index: 1050;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
}

.mobile-menu-panel.active {
    right: 0;
}

/* 菜单头部 */
.mobile-menu-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-menu-header h5 {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-menu-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* 菜单内容 */
.mobile-menu-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.mobile-menu-section {
    margin-bottom: 10px;
}

.mobile-menu-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #e0e0e0, transparent);
    margin: 15px 0;
}

/* 菜单项 */
.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    margin: 5px 0;
    background: #f8f9fa;
    border-radius: 12px;
    text-decoration: none;
    color: #2d3748;
    transition: all 0.3s ease;
    border: none;
    width: 100%;
    text-align: left;
}

.mobile-menu-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.mobile-menu-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 10px;
    font-size: 1.3rem;
    color: #667eea;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.mobile-menu-item:hover .mobile-menu-icon {
    background: rgba(255, 255, 255, 0.95);
    transform: scale(1.1);
}

.mobile-menu-text {
    flex: 1;
}

.mobile-menu-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 3px;
}

.mobile-menu-desc {
    font-size: 0.85rem;
    opacity: 0.7;
}

.mobile-menu-item > i.bi-chevron-right {
    opacity: 0.5;
    transition: all 0.3s ease;
}

.mobile-menu-item:hover > i.bi-chevron-right {
    opacity: 1;
    transform: translateX(3px);
}

/* 用户信息卡片 */
.mobile-menu-user-info {
    display: flex;
    gap: 15px;
    padding: 20px;
    margin: 5px 0 15px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
}

.mobile-menu-user-avatar {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 2rem;
}

.mobile-menu-user-details {
    flex: 1;
}

.mobile-menu-user-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.mobile-menu-user-points {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.mobile-menu-logout {
    background: #fff3f3 !important;
}

.mobile-menu-logout:hover {
    background: linear-gradient(135deg, #fc8181 0%, #f56565 100%) !important;
}

/* 桌面端隐藏移动菜单按钮 */
@media (min-width: 992px) {
    .modern-toggler {
        display: none !important;
    }
}

/* 移动端显示 */
@media (max-width: 991px) {
    .navbar-collapse {
        display: none !important;
    }

    .modern-navbar .nav-link span {
        display: none;
    }
}
