/* ==================== Header Elementor Widget 样式 ==================== */
/* 基于xin8模板样式：深色背景、币安黄色主色调 */

/* Header 容器 - 匹配xin8模板的 fixed w-full z-50 transition-all duration-300 bg-dark/80 backdrop-blur-md */
.header-widget {
    position: fixed;
    width: 100%;
    z-index: 50;
    transition: all 0.3s ease;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
}

/* Header 内部布局 - 匹配xin8模板的 container mx-auto px-4 sm:px-6 lg:px-8 */
.header-widget-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 16px;
}

@media (min-width: 640px) {
    .header-widget-container {
        padding: 16px 24px;
    }
}

@media (min-width: 1024px) {
    .header-widget-container {
        padding: 16px 32px;
    }
}

/* Logo 区域 - 匹配xin8模板的 flex items-center */
.header-widget .flex.items-center {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.header-widget .flex.items-center > a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

/* Logo图标 - 匹配xin8模板的 w-10 h-10 rounded-lg bg-primary */
.header-widget .w-10.h-10.rounded-lg.gold-gradient {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: #F3BA2F;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

.header-widget .w-10.h-10.rounded-lg.gold-gradient span {
    color: #0F172A;
    font-weight: 700;
    font-size: 20px;
    line-height: 28px;
}

/* Logo文字 - 匹配xin8模板的 text-2xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-primary to-yellow-400 */
.header-widget .text-xl.font-bold.text-white.hidden.sm\\:block {
    font-size: 24px;
    line-height: 32px;
    font-weight: 700;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    background-image: linear-gradient(to right, #F3BA2F, #FACC15);
}

@media (max-width: 640px) {
    .header-widget .text-xl.font-bold.text-white.hidden.sm\\:block {
        display: none;
    }
}

/* 导航区域 - 匹配xin8模板的 hidden md:flex items-center space-x-8 */
.header-widget-nav {
    display: none;
    flex: 1;
    align-items: center;
    margin-left: 32px;
}

@media (min-width: 768px) {
    .header-widget-nav {
        display: flex;
    }
}

/* 桌面端导航菜单 */
.header-widget-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 32px;
}

.header-widget-menu > li {
    position: relative;
    display: inline;
}

/* 导航链接 - 匹配xin8模板的 text-gray-300 hover:text-white font-medium */
.header-widget-menu > li > a {
    display: block;
    color: #D1D5DB;
    font-size: 16px;
    line-height: 24px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.header-widget-menu > li > a:hover {
    color: #FFFFFF;
}

/* 选中/激活状态 */
.header-widget-menu > li.active > a,
.header-widget-menu > li.current-menu-item > a {
    color: #F3BA2F;
}

/* 下拉菜单 - 匹配xin8模板的 rounded-md shadow-lg bg-dark-light ring-1 ring-gray-800 */
.header-widget-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 192px;
    background-color: #1E293B;
    list-style: none;
    margin: 8px 0 0 0;
    padding: 4px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    border: 1px solid #1F2937;
    z-index: 51;
}

.header-widget-menu > li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-widget-menu .sub-menu li {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.header-widget-menu .sub-menu li:first-child {
    border-top: none;
}

/* 下拉菜单链接 - 匹配xin8模板的 block px-4 py-2 text-sm text-gray-300 hover:bg-dark-lighter hover:text-white */
.header-widget-menu .sub-menu li a {
    display: block;
    padding: 8px 16px;
    color: #D1D5DB;
    font-size: 14px;
    line-height: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.header-widget-menu .sub-menu li a:hover {
    color: #FFFFFF;
    background-color: #334155;
}

/* 桌面端按钮容器 - 匹配xin8模板的 hidden md:flex items-center space-x-4 */
.header-widget .hidden.md\\:flex.items-center.space-x-4 {
    display: none;
    align-items: center;
    gap: 16px;
}

@media (min-width: 768px) {
    .header-widget .hidden.md\\:flex.items-center.space-x-4 {
        display: flex;
    }
}

/* 登录按钮 - 匹配xin8模板的 px-4 py-2 text-gray-300 hover:text-white font-medium transition-colors */
.header-widget-login-btn {
    display: inline-flex;
    padding: 8px 16px;
    color: #D1D5DB;
    font-size: 16px;
    line-height: 24px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.header-widget-login-btn:hover {
    color: #FFFFFF;
}

/* 注册按钮 - 匹配xin8模板的 px-4 py-2 bg-primary text-dark font-medium rounded-lg hover:bg-primary/90 transition-colors */
.header-widget-register-btn {
    display: inline-flex;
    padding: 8px 16px;
    background-color: #F3BA2F;
    color: #0F172A;
    font-size: 16px;
    line-height: 24px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.header-widget-register-btn:hover {
    background-color: rgba(243, 186, 47, 0.9);
}

/* 移动端菜单按钮 - 汉堡菜单 - 匹配xin8模板的 md:hidden text-gray-300 hover:text-white */
.header-widget-menu-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 40px;
    height: 40px;
    color: #D1D5DB;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease;
    margin-left: auto;
    align-self: center;
}

.header-widget-menu-toggle:hover {
    color: #FFFFFF;
}

@media (min-width: 768px) {
    .header-widget-menu-toggle {
        display: none;
    }
}

/* 汉堡图标线条 */
.header-widget-menu-toggle span {
    display: block;
    height: 3px;
    width: 24px;
    background: currentColor;
    border-radius: 3px;
    opacity: 1;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
}

/* 汉堡菜单激活状态 - 变成X */
.header-widget-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translateY(4.5px);
}

.header-widget-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.header-widget-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-4.5px);
}

/* 遮罩层 */
.header-widget-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.header-widget-overlay.active {
    display: block;
    opacity: 1;
    visibility: visible;
}

/* ==================== 移动端样式 ==================== */

/* 移动端导航菜单 - 匹配xin8模板的 md:hidden hidden bg-dark-light border-t border-gray-800 */
@media screen and (max-width: 767px) {
    .header-widget-nav {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 72px;
        left: 0;
        width: 100%;
        height: calc(100vh - 72px);
        background-color: #1E293B;
        border-top: 1px solid #1F2937;
        padding: 12px 16px;
        z-index: 45;
        overflow-y: auto;
        margin-left: 0;
    }

    .header-widget-nav.active {
        display: flex;
    }

    .header-widget-menu {
        flex-direction: column;
        width: 100%;
        gap: 0;
        flex: 1;
    }

    .header-widget-menu > li {
        width: 100%;
        margin: 0;
    }

    /* 移动端导航链接 - 匹配xin8模板的 block py-2 text-gray-300 hover:text-white font-medium */
    .header-widget-menu > li > a {
        display: block;
        padding: 8px 0;
        color: #D1D5DB;
        font-size: 16px;
        line-height: 24px;
        font-weight: 500;
    }

    .header-widget-menu > li > a:hover {
        color: #FFFFFF;
    }

    /* 移动端下拉菜单 */
    .header-widget-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        background-color: #0F172A;
        box-shadow: none;
        border-radius: 0;
        min-width: auto;
        margin: 0;
        border: none;
    }

    .header-widget-menu .sub-menu.show {
        display: block;
    }

    /* 移动端下拉菜单链接 - 匹配xin8模板的 block text-sm text-gray-400 hover:text-white */
    .header-widget-menu .sub-menu li a {
        padding: 6px 0 6px 16px;
        color: #9CA3AF;
        font-size: 14px;
        line-height: 20px;
    }

    .header-widget-menu .sub-menu li a:hover {
        color: #FFFFFF;
        background-color: transparent;
    }

    /* 移动端登录/注册按钮容器 - 匹配xin8模板的 pt-2 flex flex-col space-y-3 */
    .header-widget-mobile-actions {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-top: auto;
        padding-top: 16px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* 移动端登录按钮 - 匹配xin8模板的 px-4 py-2 text-center text-gray-300 hover:text-white font-medium border border-gray-700 rounded-lg */
    .header-widget-mobile-actions .header-widget-login-btn {
        display: block;
        width: 100%;
        padding: 12px 16px;
        text-align: center;
        color: #D1D5DB;
        font-size: 16px;
        line-height: 24px;
        font-weight: 500;
        border: 1px solid #374151;
        border-radius: 8px;
        transition: all 0.3s ease;
    }

    .header-widget-mobile-actions .header-widget-login-btn:hover {
        color: #FFFFFF;
    }

    /* 移动端注册按钮 - 匹配xin8模板的 px-4 py-2 text-center bg-primary text-dark font-medium rounded-lg */
    .header-widget-mobile-actions .header-widget-register-btn {
        display: block;
        width: 100%;
        padding: 12px 16px;
        text-align: center;
        background-color: #F3BA2F;
        color: #0F172A;
        font-size: 16px;
        line-height: 24px;
        font-weight: 500;
        border-radius: 8px;
        transition: all 0.3s ease;
    }

    .header-widget-mobile-actions .header-widget-register-btn:hover {
        background-color: rgba(243, 186, 47, 0.9);
    }

    /* 显示遮罩层 */
    .header-widget-overlay.active {
        display: block;
        opacity: 1;
        visibility: visible;
    }
}

/* 小屏手机 (480px 以下) */
@media screen and (max-width: 480px) {
    .header-widget-container {
        padding: 12px 16px;
    }

    .header-widget .w-10.h-10.rounded-lg.gold-gradient {
        width: 36px;
        height: 36px;
    }

    .header-widget .w-10.h-10.rounded-lg.gold-gradient span {
        font-size: 18px;
        line-height: 26px;
    }
}
