/* B-P0 extracted from index.html */
/* 导航栏字体放大 - 参考 real_time_water.html */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 桌面端：logo 参与 flex 布局；移动端见 navbar-shell / 各页 responsive 的 absolute 定位 */
@media (min-width: 1025px) {
    .navbar .logo-container {
        position: relative;
        left: auto;
        flex-shrink: 0;
    }
}

.navbar .logo-text {
    font-size: 32px !important;
    font-weight: 800;
}

.navbar .nav-link {
    font-size: 20px !important;
    font-weight: 600;
}

/* 右侧导航文字改为黑色，左侧 logo/湖银 保持不动 */
.navbar-right .nav-link,
.navbar-right .nav-login-btn,
.navbar-right .nav-user-name,
.navbar-right .nav-more-btn {
    color: #0f172a !important;
}
.navbar-right .nav-link:hover,
.navbar-right .nav-login-btn:hover,
.navbar-right .nav-user-name:hover,
.navbar-right .nav-more-btn:hover {
    color: #07d96c !important;
}
.mobile-nav-link {
    color: #0f172a !important;
}
.mobile-nav-link:hover {
    color: #07d96c !important;
}

/* 导航栏右侧区域（导航菜单 + 用户信息） */
.navbar-right {
    display: flex;
    align-items: center;
    margin-left: auto; /* 让整个右侧区域靠右 */
}

/* 用户登录区域样式 - 在导航菜单内 */
.nav-user-area {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 30px; /* 与导航链接的间距 */
}

/* 登录按钮 - 与其他导航链接完全一致的样式 */
.nav-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    padding: 5px 0;
    color: #1e6fa8;
    font-size: 20px !important;
    font-weight: 600;
    text-decoration: none;
    position: relative;
    transition: color 0.3s;
    cursor: pointer;
}

/* 登录按钮的下划线效果（与其他导航链接一致） */
.nav-login-btn::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, #3a9ad9, #07d96c);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.nav-login-btn:hover {
    color: #07d96c;
    transform: none;
    box-shadow: none;
}

.nav-login-btn:hover::after {
    transform: scaleX(1);
}

.nav-login-btn i {
    font-size: 16px;
    margin-right: 2px;
}

.nav-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.nav-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3a9ad9, #07d96c);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.nav-user-avatar:hover {
    transform: scale(1.05);
    border-color: #07d96c;
    box-shadow: 0 0 10px rgba(7, 217, 108, 0.3);
}

.nav-user-menu {
    position: relative;
}

.nav-user-name {
    font-size: 20px !important; /* 与其他导航链接一致的字体大小 */
    font-weight: 600;
    color: #1e6fa8;
    cursor: pointer;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s;
    text-decoration: none; /* 移除默认下划线 */
    display: inline-block; /* 让下划线效果生效 */
}

/* 用户名的下划线效果（与其他导航链接一致） */
.nav-user-name::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, #3a9ad9, #07d96c);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.nav-user-name:hover {
    color: #07d96c;
    background: none;
    text-decoration: none; /* 确保悬停时也没有下划线 */
}

.nav-user-name:hover::after {
    transform: scaleX(1);
}

.nav-user-menu:hover .nav-user-actions {
    display: block;
}

.nav-user-actions {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    min-width: 150px;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid rgba(58, 154, 217, 0.1);
}

.nav-user-action {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #1e6fa8;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(58, 154, 217, 0.1);
    font-size: 16px;
}

.nav-user-action:last-child {
    border-bottom: none;
}

.nav-user-action:hover {
    background: rgba(7, 217, 108, 0.1);
    color: #07d96c;
}

/* 移动端用户区域样式 */
.mobile-user-area {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 1rem;
    padding-top: 1rem;
}

.mobile-login-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 15px 20px;
    background: none;
    color: #1e6fa8 !important;
    text-align: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.mobile-login-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #07d96c !important;
}

.mobile-user-info {
    padding: 1rem 0;
}

.mobile-user-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.mobile-user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3a9ad9, #07d96c);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 30px;
    border: 2px solid rgba(7, 217, 108, 0.3);
}

.mobile-user-name {
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.mobile-user-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-user-action {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(7, 217, 108, 0.2);
}

.mobile-user-action:hover {
    background: rgba(7, 217, 108, 0.2);
    border-color: #07d96c;
    color: #07d96c;
}

.hidden {
    display: none !important;
}

/* 优化导航栏整体美观度 */
.nav-menu {
    align-items: center;
    gap: 0;
    display: flex; /* 确保是 flex 布局 */
}

.nav-item {
    white-space: nowrap;
}

/* 导航项之间的视觉分隔（展开时显示） */
.nav-menu.expanded .nav-item:not(:first-child):not(.nav-user-area):not(.nav-more-btn-container) {
    position: relative;
}

.nav-menu.expanded .nav-item:not(:first-child):not(.nav-user-area):not(.nav-more-btn-container)::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 20px;
    background: linear-gradient(to bottom, transparent, rgba(30, 111, 168, 0.3), transparent);
    opacity: 0.5;
}

/* 优化更多按钮图标动画 */
.nav-more-btn .more-icon {
    transition: transform 0.3s ease;
}

/* 导航栏折叠功能样式 */
.nav-item-hidden {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.nav-menu.expanded .nav-item-hidden {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.nav-more-btn-container {
    position: relative;
    margin-right: 20px; /* 增加与登录按钮的间距 */
}

.nav-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 8px;
    color: #1e6fa8;
    transition: all 0.3s ease;
    position: relative;
}

.nav-more-btn:hover {
    color: #07d96c;
}

/* 三条杠图标样式 */
.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    transition: all 0.3s ease;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background: currentColor;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* 悬停时三条杠稍微分开 */
.nav-more-btn:hover .hamburger-icon {
    height: 20px;
}

/* 展开时三条杠变成X */
.nav-menu.expanded .hamburger-line:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.nav-menu.expanded .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-menu.expanded .hamburger-line:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* 更多按钮的下划线效果（与其他导航链接一致） */
.nav-more-btn::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, #3a9ad9, #07d96c);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.nav-more-btn:hover::after {
    transform: scaleX(1);
}

/* 移动端：始终显示所有导航项 */
@media (max-width: 1024px) {
    .nav-item-hidden {
        display: block !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .nav-more-btn-container {
        display: none;
    }
}

/* 移动端：logo 固定左侧，汉堡菜单在右侧（避免 relative + left:auto 把 logo 挤到右边） */
@media (max-width: 1024px) {
    .navbar .logo-container {
        position: absolute !important;
        left: max(16px, env(safe-area-inset-left, 0px)) !important;
        right: auto !important;
        top: env(safe-area-inset-top, 0px) !important;
        height: 70px;
        display: flex !important;
        align-items: center;
        margin: 0 !important;
        z-index: 1000;
    }

    .navbar .mobile-menu-toggle {
        margin-left: auto;
        flex-shrink: 0;
    }
}
