/* 美化导航栏样式 - 覆盖原有样式 */

/* 头部导航栏 - 现代化设计 */
.header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08) !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    border-bottom: 1px solid rgba(223, 177, 99, 0.1) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.12) !important;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    height: 85px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Logo样式优化 */
.logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.logo a {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #DFB163 0%, #c99d4f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: 0.5px;
    display: block;
    transition: all 0.3s ease;
    font-family: "Poppins", "Microsoft YaHei", sans-serif;
    position: relative;
}

.logo a::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(135deg, #DFB163 0%, #c99d4f 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.logo a:hover::before {
    transform: scaleX(1);
}

.logo a:hover {
    transform: translateY(-2px);
}

/* 导航菜单 */
.nav {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 100%;
}

.nav > a {
    color: #2c3e50;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 24px;
    height: auto;
    display: flex;
    align-items: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    letter-spacing: 0.3px;
    border-radius: 8px;
    margin: 0 5px;
}

.nav > a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(223, 177, 99, 0.1) 0%, rgba(201, 157, 79, 0.1) 100%);
    border-radius: 8px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.nav > a::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 3px;
    background: linear-gradient(135deg, #DFB163 0%, #c99d4f 100%);
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav > a:hover {
    color: #DFB163;
    transform: translateY(-2px);
}

.nav > a:hover::before {
    opacity: 1;
    transform: scale(1);
}

.nav > a:hover::after {
    transform: translateX(-50%) scaleX(1);
}

.nav > a.active {
    color: #DFB163;
    font-weight: 700;
}

.nav > a.active::before {
    opacity: 1;
    transform: scale(1);
}

.nav > a.active::after {
    transform: translateX(-50%) scaleX(1);
}

/* 下拉菜单容器 */
.nav-dropdown {
    position: relative;
    height: auto;
    display: flex;
    align-items: center;
}

/* 桌面端：确保下拉菜单区域可以hover */
@media (min-width: 992px) {
    .nav-dropdown {
        padding-bottom: 5px; /* 增加底部padding，创建连接区域 */
    }
}

.dropdown-toggle {
    cursor: pointer;
    user-select: none;
    color: #2c3e50;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    letter-spacing: 0.3px;
    border-radius: 8px;
    margin: 0 5px;
}

.dropdown-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(223, 177, 99, 0.1) 0%, rgba(201, 157, 79, 0.1) 100%);
    border-radius: 8px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.dropdown-toggle::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 3px;
    background: linear-gradient(135deg, #DFB163 0%, #c99d4f 100%);
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-toggle:hover {
    color: #DFB163;
    transform: translateY(-2px);
}

.dropdown-toggle:hover::before {
    opacity: 1;
    transform: scale(1);
}

.dropdown-toggle:hover::after {
    transform: translateX(-50%) scaleX(1);
}

.dropdown-toggle.active {
    color: #DFB163;
    font-weight: 700;
}

.dropdown-toggle.active::before {
    opacity: 1;
    transform: scale(1);
}

.dropdown-toggle.active::after {
    transform: translateX(-50%) scaleX(1);
}

/* 下拉箭头 - 使用SVG图标 */
.dropdown-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    width: 16px;
    height: 16px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    vertical-align: middle;
}

.dropdown-arrow::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid currentColor;
    transition: all 0.3s ease;
}

.nav-dropdown:hover .dropdown-arrow,
.nav-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* 下拉菜单 */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    min-width: 260px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 1000;
    border: 1px solid rgba(223, 177, 99, 0.1);
    overflow: hidden;
    margin-top: 0;
    pointer-events: none;
}

/* 桌面端：创建一个连接区域，防止鼠标移动时断开 */
@media (min-width: 992px) {
    .nav-dropdown::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        height: 8px;
        z-index: 999;
        background: transparent;
        pointer-events: none;
    }
    
    /* 当hover时，让连接区域和下拉菜单都可以接收鼠标事件 */
    .nav-dropdown:hover::after,
    .nav-dropdown.open::after {
        pointer-events: auto;
    }
    
    .nav-dropdown:hover .dropdown-menu,
    .nav-dropdown.open .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
        pointer-events: auto;
    }
    
    /* 确保下拉菜单区域可以接收鼠标事件 */
    .nav-dropdown:hover .dropdown-menu a,
    .nav-dropdown.open .dropdown-menu a {
        pointer-events: auto;
    }
}

/* 移动端：使用open类控制 */
@media (max-width: 991px) {
    .nav-dropdown.open .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
        pointer-events: auto;
    }
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #ffffff;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    margin: 2px 0;
    position: relative;
    height: auto;
}

.dropdown-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleX(0);
    width: 3px;
    height: 60%;
    background: linear-gradient(135deg, #DFB163 0%, #c99d4f 100%);
    border-radius: 0 3px 3px 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-menu a:hover {
    background: linear-gradient(135deg, rgba(223, 177, 99, 0.08) 0%, rgba(201, 157, 79, 0.08) 100%);
    color: #DFB163;
    transform: translateX(5px);
    padding-left: 22px;
}

.dropdown-menu a:hover::before {
    transform: translateY(-50%) scaleX(1);
}

.dropdown-menu a.active {
    background: linear-gradient(135deg, rgba(223, 177, 99, 0.12) 0%, rgba(201, 157, 79, 0.12) 100%);
    color: #DFB163;
    font-weight: 700;
    padding-left: 22px;
}

.dropdown-menu a.active::before {
    transform: translateY(-50%) scaleX(1);
}

.case-count {
    font-size: 12px;
    color: #9ca3af;
    background: rgba(223, 177, 99, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    margin-left: 8px;
    transition: all 0.2s ease;
}

.dropdown-menu a:hover .case-count {
    background: rgba(223, 177, 99, 0.2);
    color: #DFB163;
}

/* 移动端响应式 */
@media (max-width: 991px) {
    .header .container {
        padding: 0 20px;
        height: 70px;
    }
    
    .logo a {
        font-size: 24px;
    }
    
    .nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
        background: #ffffff;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        border-radius: 12px;
        padding: 10px;
        margin-top: 10px;
    }
    
    .nav > a,
    .dropdown-toggle {
        padding: 14px 20px;
        margin: 2px 0;
        border-radius: 8px;
    }
    
    .dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        background: rgba(223, 177, 99, 0.05);
        margin-top: 5px;
        border-radius: 8px;
        min-width: auto;
        width: 100%;
    }
    
    .nav-dropdown.open .dropdown-menu {
        transform: none;
    }
}

/* 移动端菜单按钮（如果需要） */
@media (max-width: 991px) {
    .mobile-menu-toggle {
        display: block;
        width: 32px;
        height: 32px;
        position: relative;
        cursor: pointer;
        z-index: 1001;
    }
    
    .mobile-menu-toggle span {
        display: block;
        position: absolute;
        height: 3px;
        width: 100%;
        background: #2c3e50;
        border-radius: 3px;
        opacity: 1;
        left: 0;
        transform: rotate(0deg);
        transition: all 0.3s ease;
    }
    
    .mobile-menu-toggle span:nth-child(1) {
        top: 8px;
    }
    
    .mobile-menu-toggle span:nth-child(2) {
        top: 16px;
    }
    
    .mobile-menu-toggle span:nth-child(3) {
        top: 24px;
    }
}

