/* ===========================
   通用导航栏样式
   =========================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
}

/* 导航栏容器 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.navbar-container {
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    height: 70px;
}

/* 左侧区域 */
.navbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Logo */
.navbar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.3s;
}

.navbar-logo:hover {
    transform: scale(1.05);
}

.logo-img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: white;
    letter-spacing: 1px;
}

/* 导航菜单 */
.navbar-menu {
    display: flex;
    list-style: none;
    gap: 10px;
    align-items: center;
}

.navbar-menu li {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s;
    position: relative;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-link i {
    font-size: 16px;
}

/* 右侧区域 */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 按钮通用样式 */
.btn {
    padding: 10px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: white;
    color: #667eea;
}

.btn-primary:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-outline {
    background-color: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* 用户下拉菜单 */
.user-dropdown {
    position: relative;
}

.user-info-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.user-info-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

.user-info-btn i.fa-user-circle {
    font-size: 24px;
}

.user-info-btn i.fa-chevron-down {
    font-size: 12px;
    transition: transform 0.3s;
}

.user-info-btn:hover i.fa-chevron-down {
    transform: rotate(180deg);
}

/* 下拉菜单内容 */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    overflow: hidden;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
}

.dropdown-item i {
    font-size: 16px;
    color: #667eea;
    width: 20px;
    text-align: center;
}

.dropdown-divider {
    height: 1px;
    background-color: #e0e0e0;
    margin: 8px 0;
}

/* 访客区域 */
#guest-section {
    display: flex;
    gap: 12px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .navbar-menu {
        gap: 5px;
    }

    .nav-link {
        padding: 8px 15px;
        font-size: 14px;
    }

    .logo-text {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .navbar-container {
        padding: 0 15px;
        height: 60px;
    }

    .navbar-left {
        gap: 20px;
    }

    .navbar-menu {
        display: none; /* 移动端隐藏导航菜单，可以后续添加汉堡菜单 */
    }

    .logo-text {
        font-size: 18px;
    }

    .logo-img {
        width: 35px;
        height: 35px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .logo-text {
        display: none;
    }

    #guest-section {
        flex-direction: column;
        gap: 5px;
    }

    .btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}
