/*
 * 头部样式 - 双层结构现代版
 * 顶部工具条 + 白底主导航
 */

/* =========================================
   顶部工具条 - 深色背景
========================================= */
.top-bar {
    background: #1a1a2e;
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    line-height: 1;
}

.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-city {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ffd700;
    text-decoration: none;
    font-weight: 500;
}

.top-city:hover {
    color: #ffe066;
}

.top-city i:first-child {
    font-size: 14px;
}

.top-city i:last-child {
    font-size: 10px;
    opacity: 0.7;
}

.top-divider {
    width: 1px;
    height: 14px;
    background: rgba(255,255,255,0.2);
}

.top-slogan {
    color: rgba(255,255,255,0.6);
    font-size: 12px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.top-link {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.top-link:hover {
    color: #fff;
}

.top-link i {
    font-size: 12px;
    opacity: 0.8;
}

/* =========================================
   主导航区 - 白色背景
========================================= */
.main-header {
    background: #ffffff;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    min-height: 72px;
}

/* =========================================
   Logo区域
========================================= */
.logo-section {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.logo-link {
    display: flex;
    align-items: center;
}

.site-logo {
    height: 48px;
    width: auto;
    display: block;
}

.logo-icon {
    font-size: 40px;
    color: #ff6b35;
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    text-decoration: none;
    letter-spacing: 1px;
}

.brand-name:hover {
    color: #ff6b35;
}

/* =========================================
   主导航菜单
========================================= */
.main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 5px;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item > a {
    display: block;
    padding: 24px 20px;
    color: #333;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    position: relative;
    white-space: nowrap;
}

.nav-item > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: #ff6b35;
    border-radius: 3px 3px 0 0;
    transition: width 0.3s ease;
}

.nav-item > a:hover {
    color: #ff6b35;
}

.nav-item > a:hover::after {
    width: 60%;
}

.nav-item.active > a {
    color: #ff6b35;
    font-weight: 600;
}

.nav-item.active > a::after {
    width: 100%;
}

/* =========================================
   右侧操作区
========================================= */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.search-box {
    display: flex;
    align-items: center;
    background: #f5f5f7;
    border-radius: 24px;
    padding: 8px 16px;
    border: 1px solid transparent;
}

.search-box:focus-within {
    border-color: #ff6b35;
    background: #fff;
}

.search-box .search-input {
    background: none;
    border: none;
    outline: none;
    width: 140px;
    font-size: 14px;
    color: #333;
    padding: 4px 8px;
}

.search-box .search-input::placeholder {
    color: #999;
}

.search-box .search-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 14px;
}

.search-box .search-btn:hover {
    color: #ff6b35;
}

.phone-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ff6b35 0%, #e54d1d 100%);
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.phone-btn:hover {
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
    color: #fff;
}

.phone-btn i {
    font-size: 14px;
}

.phone-btn .phone-text {
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* =========================================
   移动端汉堡按钮
========================================= */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    background: #f5f5f7;
}

.mobile-menu-toggle:active {
    background: #eee;
}

.mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #333;
    margin: 3px 0;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* =========================================
   移动端菜单覆盖层
========================================= */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 85vw;
    height: 100%;
    background: #fff;
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.mobile-menu-overlay.active .mobile-menu-content {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #ff6b35 0%, #e54d1d 100%);
}

.mobile-menu-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-menu-logo .mobile-logo {
    height: 36px;
    width: auto;
    border-radius: 6px;
}

.mobile-menu-logo .mobile-brand-name {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.mobile-menu-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    font-size: 18px;
}

.mobile-menu-close:active {
    background: rgba(255,255,255,0.3);
}

.mobile-menu-body {
    padding: 16px;
}

.mobile-nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-item {
    margin-bottom: 4px;
}

.mobile-nav-item > a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: #333;
    text-decoration: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
}

.mobile-nav-item > a:active {
    background: #f5f5f7;
}

.mobile-nav-item.active > a {
    background: linear-gradient(135deg, #ff6b35 0%, #e54d1d 100%);
    color: #fff;
}

.mobile-nav-item > a i {
    font-size: 14px;
    color: #ff6b35;
    width: 20px;
    text-align: center;
}

.mobile-nav-item.active > a i {
    color: #fff;
}

.mobile-phone-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.mobile-phone-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #ff6b35 0%, #e54d1d 100%);
    color: #fff;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
}

.mobile-phone-button:active {
    opacity: 0.9;
}

.mobile-phone-button i {
    font-size: 16px;
}

/* =========================================
   PC端样式 (>=769px)
========================================= */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }
}

/* =========================================
   平板端 (769px - 1200px)
========================================= */
@media (max-width: 1200px) and (min-width: 769px) {
    .main-nav {
        padding: 0 20px;
    }
    
    .nav-item > a {
        padding: 24px 14px;
        font-size: 14px;
    }
    
    .search-box .search-input {
        width: 100px;
    }
    
    .phone-btn {
        padding: 10px 18px;
        font-size: 14px;
    }
    
    .top-slogan {
        display: none;
    }
}

/* =========================================
   移动端样式 (<=768px)
========================================= */
@media (max-width: 768px) {
    /* 隐藏顶部工具条 */
    .top-bar {
        display: none;
    }
    
    /* 主导航简化 */
    .main-header {
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    }
    
    .header-inner {
        min-height: 60px;
        padding: 0;
    }
    
    .logo-section {
        gap: 10px;
    }
    
    .site-logo {
        height: 38px;
    }
    
    .brand-name {
        font-size: 17px;
    }
    
    /* 隐藏PC导航和操作区 */
    .main-nav,
    .header-actions {
        display: none !important;
    }
    
    /* 显示汉堡菜单 */
    .mobile-menu-toggle {
        display: flex !important;
    }
}

/* =========================================
   小屏手机 (<=480px)
========================================= */
@media (max-width: 480px) {
    .header-inner {
        min-height: 56px;
    }
    
    .site-logo {
        height: 34px;
    }
    
    .brand-name {
        font-size: 15px;
    }
    
    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
    }
    
    .mobile-menu-content {
        width: 280px;
    }
}
