/* =================
   布局相关样式
   ================= */

/* 顶部导航栏 */
.top-header {
    background: #4E8EF7;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,.08);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s;
}

.top-header.scrolled {
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

body {
    padding-top: 52px;
}

.top-nav-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

/* Logo */
.logo {
    font-size: 20px;
    font-weight: bold;
    color: white;
    text-decoration: none;
    padding: 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 导航菜单 */
.nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.main-nav {
    display: flex;
    list-style: none;
    margin: 0;
}

.main-nav li {
    margin: 0;
}

.main-nav a {
    display: block;
    color: rgba(255,255,255,0.95);
    text-decoration: none;
    padding: 15px 18px;
    transition: all 0.2s;
    font-size: 14px;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* 用户菜单 */
.nav-right {
    display: flex;
    align-items: center;
}

.nav-right .navbar-userinfo {
    list-style: none;
    margin: 0;
    position: relative;
}

.nav-right .user-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.95);
    padding: 15px 18px;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
}

.nav-right .user-trigger:hover,
.nav-right .user-trigger:focus {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
}

.nav-right .user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5);
}

.nav-right .user-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* VIP会员用户名样式 - 简洁红色显示 */
.nav-right .user-name.vip-user {
    color: #c41400 !important;
}

.nav-right .caret {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 4px;
    vertical-align: middle;
    border-top: 4px solid;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}

/* 下拉菜单 */
.nav-right .dropdown-menu {
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    min-width: 180px;
    padding: 8px 0;
    margin-top: 2px;
    right: 0;
    left: auto;
}

.nav-right .dropdown-menu li {
    list-style: none;
}

.nav-right .dropdown-menu a {
    color: #606266;
    padding: 10px 20px;
    display: block;
    transition: all 0.2s;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}

.nav-right .dropdown-menu a:hover {
    background: #f5f7fa;
    color: #409EFF;
}

.nav-right .dropdown-menu .divider {
    height: 1px;
    background: #e8e8e8;
    margin: 6px 0;
}

.nav-right .dropdown-menu i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
    font-size: 14px;
}

/* 底部样式 */
.footer {
    background: #2c3e50;
    color: #bbb;
    padding: 40px 20px 30px;
    margin-top: 60px;
    border-top: 3px solid #4E8EF7;
}

.footer-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.footer-left {
    flex: 1;
}

.footer-links {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #bbb;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #4E8EF7;
}

.footer-copyright {
    color: #888;
    font-size: 13px;
    line-height: 1.8;
}

.footer-copyright a {
    color: #4E8EF7;
    text-decoration: none;
}

.footer-copyright a:hover {
    text-decoration: underline;
}

.footer-right {
    text-align: center;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.footer-qrcode-item {
    text-align: center;
}

.footer-qrcode {
    width: 120px;
    height: 120px;
    background: white;
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.footer-qrcode img {
    width: 100%;
    height: 100%;
    display: block;
}

.footer-qrcode-text {
    color: #bbb;
    font-size: 14px;
}

/* =================
   汉堡菜单样式
   ================= */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    position: relative;
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
    margin: 3px 0;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* 移动端遮罩层 */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
}

/* 移动端菜单打开时禁止body滚动 */
body.mobile-menu-open {
    overflow: hidden;
}

/* =================
   响应式布局 - 平板及以下
   ================= */
@media (max-width: 992px) {
    .top-nav-wrapper {
        padding: 0 15px;
    }
    
    .main-nav a {
        padding: 15px 12px;
        font-size: 13px;
    }
    
    .nav-right .user-trigger {
        padding: 15px 12px;
    }
}

/* =================
   响应式布局 - 移动端
   ================= */
@media (max-width: 768px) {
    /* 显示汉堡菜单按钮 */
    .hamburger-btn {
        display: flex;
        order: 3;
    }
    
    /* 显示遮罩层 */
    .mobile-overlay {
        display: block;
        pointer-events: none;
    }
    
    .mobile-overlay.active {
        pointer-events: auto;
    }
    
    /* 导航栏调整 */
    .top-nav-wrapper {
        flex-wrap: wrap;
        position: relative;
    }
    
    .logo {
        flex: 1;
        order: 1;
    }
    
    /* 中间导航菜单 - 移动端侧滑 */
    .nav-center {
        position: fixed;
        top: 52px;
        left: -280px;
        width: 280px;
        height: calc(100vh - 52px);
        background: white;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    }
    
    .nav-center.mobile-open {
        left: 0;
    }
    
    .main-nav {
        flex-direction: column;
        padding: 10px 0;
    }
    
    .main-nav a {
        color: #333;
        padding: 15px 20px;
        border-bottom: 1px solid #f0f0f0;
        font-size: 15px;
    }
    
    .main-nav a:hover {
        background: #f5f7fa;
        color: #4E8EF7;
    }
    
    /* 右侧用户菜单 - 移动端 */
    .nav-right {
        position: fixed;
        top: 52px;
        left: -280px;
        width: 280px;
        background: #f8f9fa;
        z-index: 1000;
        transition: left 0.3s ease;
        padding: 15px 0;
        border-top: 1px solid #e8e8e8;
        transform: translateY(calc(100vh - 52px - 70px));
    }
    
    .nav-right.mobile-open {
        left: 0;
    }
    
    .nav-right .user-trigger {
        color: #333;
        padding: 12px 20px;
    }
    
    .nav-right .user-trigger:hover {
        background: #e8eaed;
        color: #4E8EF7;
    }
    
    .nav-right .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 0;
        margin: 0;
    }
    
    .nav-right .dropdown-menu a {
        padding: 12px 30px;
    }
    
    /* 底部样式调整 */
    .footer {
        padding: 30px 15px 25px;
    }
    
    .footer-wrapper {
        flex-direction: column;
        text-align: center;
        gap: 25px;
    }
    
    .footer-left {
        order: 2;
    }
    
    .footer-right {
        order: 1;
        justify-content: center;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    .footer-qrcode {
        width: 100px;
        height: 100px;
    }
}
