
.kf_search:focus {
    outline: none;
}
.kf_search:focus::placeholder {
    color: transparent;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 导航栏主样式 (桌面端) */
.x-header, .x-header .nav-lv1 {
    background: url('huazhao/static/image/wenyang.jpg') center center/cover no-repeat !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    color: #fff !important;
}

.x-header .nav-link, .x-header .nav-tit, .x-header .nav-lv1 > li {
    color: #fff !important;
    font-size: 18px;
    font-family: 'Microsoft YaHei', Arial, Tahoma, Helvetica, sans-serif;
}

.x-header .nav-lv1 > li.cur, .x-header .nav-lv1 > li:hover {
    background: #a52a2a !important;
}

.x-header .nav-lv2 {
    background: rgba(139, 0, 0, 0.59) !important;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    backdrop-filter: blur(2px);
}

.x-header .nav-mod, .x-header .nav-link, .x-header .nav-tit {
    background: rgb(163, 6, 6) !important;
}

.x-header .nav-lv2 > ul,
.x-header .nav-lv2 > div,
.x-header .nav-lv2 .nav-grp,
.x-header .nav-lv2 .nav-item,
.x-header .nav-lv2 .nav-tit,
.x-header .nav-lv2 .nav-tit > a,
.x-header .nav-lv2 li {
    background: none !important;
}

.x-header .nav-lv2 .nav-link {
    color: #fff !important;
    font-size: 16px;
    padding: 10px 28px;
    display: block;
    transition: background 0.2s, color 0.2s;
}

.x-header .nav-lv2 .nav-link:hover {
    color: #fff8dc !important;
    background: none !important;
}

.calendar-box {
    color: #fff !important;
    background: transparent !important;
    font-size: 16px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-login-btn {
    color: #fff;
    background: #a52a2a;
    border: none;
    border-radius: 4px;
    padding: 6px 18px;
    font-size: 16px;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-login-btn:hover {
    background: #ffd700;
    color: #8b0000;
}

/* 登录成功后的圆形按钮样式 */
.nav-login-btn.logged-in {
    width: 20px !important;
    height: 20px !important;
    border-radius: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    color: white !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    box-shadow: none !important;
    min-width: 20px !important;
    max-width: 20px !important;
    min-height: 20px !important;
    max-height: 20px !important;
}

.nav-login-btn.logged-in:hover {
    background: transparent !important;
    transform: scale(1.1) !important;
    box-shadow: none !important;
}

/* Profile容器样式 */
.profile-container {
    position: fixed;
    top: 60px; /* 导航栏高度 */
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    background: rgba(0, 0, 0, 0.8);
    z-index: 1500;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.profile-content {
    width: 100%;
    height: 100%;
    background: #f5f5dc;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* 防止整体滚动 */
}

/* Profile页面样式 */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #fff8dc, #f0e6d2);
    border-bottom: 2px solid #d4af37;
    flex-shrink: 0; /* 防止压缩 */
}

.profile-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(45deg, #8b0000, #d4af37);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.profile-user-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.profile-user-name {
    font-size: 18px;
    font-weight: bold;
    color: #8b0000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-user-level {
    font-size: 14px;
    color: #666;
}

.profile-user-points {
    font-size: 12px;
    color: #999;
}

.profile-user-online-time {
    font-size: 11px;
    color: #8b0000;
    font-weight: normal;
    background: rgba(139, 0, 0, 0.08);
    padding: 2px 6px;
    border-radius: 10px;
    border: 1px solid rgba(139, 0, 0, 0.2);
}

.profile-action-icons {
    display: flex;
    gap: 15px;
}

.profile-icon {
    width: 30px;
    height: 30px;
    background: #fff;
    border: 1px solid #d4af37;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.profile-icon:hover {
    background: #d4af37;
    color: white;
}

.profile-game-btn {
    background: linear-gradient(135deg, #8b0000, #a52a2a);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    margin-left: 15px;
}

.profile-game-btn:hover {
    background: linear-gradient(135deg, #a52a2a, #8b0000);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.3);
}

.profile-title-section {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #fff8dc, #f0e6d2);
    border-bottom: 2px solid #d4af37;
    flex-shrink: 0; /* 防止压缩 */
}

.profile-main-title {
    font-size: 24px;
    font-weight: bold;
    color: #8b0000;
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.profile-subtitle {
    font-size: 14px;
    color: #666;
}

.profile-flower-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    padding: 15px;
    max-width: 1200px;
    margin: 0 auto;
    flex: 1; /* 占据剩余空间 */
    overflow-y: auto; /* 只在花神网格区域滚动 */
    align-content: start; /* 从顶部开始排列 */
}

.profile-flower-card {
    background: white;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    height: fit-content;
}

.profile-flower-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    border-color: #d4af37;
}

.profile-flower-card.locked {
    opacity: 0.6;
    filter: grayscale(100%);
}

.profile-flower-avatar {
    width: 60px;
    height: 60px;
    margin: 0 auto 8px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    position: relative;
    overflow: hidden;
}

.profile-flower-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-flower-name {
    font-size: 11px;
    font-weight: bold;
    color: #8b0000;
    margin-bottom: 4px;
    line-height: 1.2;
}

.profile-flower-status {
    font-size: 9px;
    color: #666;
}

.profile-flower-status.unlocked {
    color: #27ae60;
}

.profile-flower-status.locked {
    color: #e74c3c;
}

/* 关闭按钮 */
.profile-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(139, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1600;
}

.profile-close-btn:hover {
    background: rgba(139, 0, 0, 1);
    transform: scale(1.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .profile-flower-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 15px;
    }
    
    .profile-main-title {
        font-size: 24px;
    }
    
    .profile-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .profile-container {
        top: 50px;
        height: calc(100vh - 50px);
    }

    
}

.x-header {
    /* 1. 恢复为 fixed 定位，让fullPage.js更好地管理它 */
    position: fixed !important; 
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2000; 
    /* 2. 添加过渡效果，让显示/隐藏更平滑 */
    transition: transform 0.5s ease-in-out;
}

/* 3. 新增一个类，用于隐藏导航栏 */
.x-header.hidden-nav {
    transform: translateY(-100%); /* 向上移出屏幕 */
}

@media (max-width: 1440px) {
    .x-header .nav-link, .x-header .nav-tit, .x-header .nav-lv1 > li {
        font-size: 16px;
    }
    .x-header .nav-lv2 .nav-link {
        padding: 8px 16px;
    }
}        

@media screen and (max-width: 750px) {
    
    /* 1. 顶部Header Bar的高度和内部元素大小 */
    .x-header {
        height: 1.5rem !important; /* 关键修复：使用固定的像素高度替代rem */
    }
    .x-header .menu-head {
        height: 100% !important;
        background-color: transparent !important;
        border-bottom: none !important;
    }
    
    /* 2. 汉堡按钮样式 */
    .menu-btn {
        right: 0.25rem;
        width: 0.8rem;
        height: 0.8rem;
    }
    .menu-btn .line, .menu-btn .line:before, .menu-btn .line:after {
        width: 0.5rem;
        border-width: 2px;
        border-color: #fff;
    }
    .menu-btn .line:before { transform: translateY(-0.2rem); }
    .menu-btn .line:after { transform: translateY(0.2rem); }

    .x-header.menu-open .line { border-color: transparent !important; }
    .x-header.menu-open .line:before, .x-header.menu-open .line:after {
        border-color: #fff !important;
    }
    .menu-open .line:before { transform: rotate(45deg); }
    .menu-open .line:after { transform: rotate(-45deg); }

    /* 3. 菜单面板 */
    .nav-mod {
        position: fixed !important;
        top: 0; left: 0; width: 100%; height: 100%;
        padding-top: 1.5rem; /* 关键修复：匹配新的header高度 */
        background-color: #a31e1e !important;
        transform: translateY(-100%);
        transition: transform 0.5s ease-in-out;
        z-index: -1;
    }
    .x-header.menu-open .nav-mod {
        transform: translateY(0%);
    }

    /* 4. 移动端搜索框 */
    .nav-mod .search-box {
        padding: 0.2rem 0.25rem !important;
        border-bottom: 1px solid rgba(255,255,255,0.3) !important;
    }
    .nav-mod .search-txt {
        position: relative;
        border: 1px solid #fff !important;
        border-radius: 2rem !important;
        padding-left: 0.8rem !important; /* 关键：使用rem */
        height: 0.8rem; /* 关键：使用rem */
        line-height: 0.76rem;
    }
    .nav-mod .search-txt .i {
        position: absolute;
        left: 0.3rem; /* 关键：使用rem */
        top: 50%;
        transform: translateY(-50%);
        width: 0.4rem;
        height: 0.4rem;
    }
    .nav-mod .search-txt .i:after {
        content: '\e853'; font-family: "xfont"; font-size: 0.4rem; color: #fff;
    }
    .nav-mod .search-txt .i:before { display: none; }

    .nav-mod .search-txt input {
        width: 100%; height: 100%; color: #fff; background: transparent; font-size: 0.3rem; /* 关键：使用rem */
    }
    .nav-mod .search-txt input::placeholder {
        color: rgba(255,255,255,0.7);
    }
    

    .nav-mod .search-btn {
        width: 1.4rem !important;
        height: 0.8rem !important;
        background: #fff !important;
        color: #a31e1e !important;
        font-size: 0.3rem !important;
        border-radius: 2rem !important;
        

        display: flex !important;
        justify-content: center !important; /* 水平居中 */
        align-items: center !important;    /* 垂直居中 */
        padding: 0; /* 清除可能影响布局的内边距 */
    }

    /* 5. 菜单项 */
    .nav-mod .nav-lv1 > .nav-item { float: none; text-align: left; }
    .nav-mod .nav-item + .nav-item { border-top: 1px solid rgba(255,255,255,0.2) !important; }
    .nav-mod .nav-link { font-size: 0.36rem !important; padding: 0.3rem 0.5rem !important; background: none !important; }
    .nav-mod .nav-lv2 { display: none !important; }
}