/*
 * 顶部导航专用样式
 * 作用域限定在 .top-nav-container 内，不污染全局
 */

/* ================================
   顶部导航容器 
   ================================ */
.top-nav-container {
    width: 100%;
    background-color: #393D49;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ================================
   Logo 区域（左侧）
   ================================ */
.top-nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.top-nav-logo .layui-icon {
    font-size: 24px;
    color: #5FB878;
}

/* ================================
   右侧区域：菜单 + 搜索框
   ================================ */
.top-nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ================================
   搜索框
   ================================ */
.top-nav-search {
    display: flex;
    align-items: center;
    height: 34px;
    background-color: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: all 0.25s ease;
}

.top-nav-search:hover {
    background-color: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
}

.top-nav-search:focus-within {
    background-color: rgba(255, 255, 255, 0.22);
    border-color: #5FB878;
    box-shadow: 0 0 0 2px rgba(95, 184, 120, 0.25);
}

.top-nav-search-input {
    flex: 1;
    width: 160px;
    height: 100%;
    padding: 0 10px;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 14px;
}

.top-nav-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.top-nav-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    transition: color 0.2s ease;
    padding: 0;
}

.top-nav-search-btn:hover {
    color: #5FB878;
}

/* ================================
   LayUI 导航覆盖（右侧菜单）
   ================================ */
.top-nav-container .layui-nav {
    background: transparent;
    border-radius: 0;
}

.top-nav-container .layui-nav .layui-nav-item {
    line-height: 60px;
}

.top-nav-container .layui-nav .layui-nav-item a {
    padding: 0 20px;
    font-size: 15px;
}

/* 当前选中项底部指示条覆盖 LayUI 默认样式 */
.top-nav-container .layui-nav .layui-nav-item.layui-this {
    background-color: transparent;
}

.top-nav-container .layui-nav .layui-nav-item.layui-this a::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    height: 3px;
    background-color: #5FB878;
    border-radius: 2px 2px 0 0;
}

/* 覆盖 LayUI 默认的红色滑块样式，使用绿色主题 */
.top-nav-container .layui-nav-bar {
    background-color: #5FB878 !important;
    height: 3px !important;
    border-radius: 0 !important;
}

/* ================================
   响应式：小屏幕时 logo 和菜单自适应
   ================================ */
@media screen and (max-width: 768px) {
    .top-nav-inner {
        flex-direction: column;
        height: auto;
        padding: 10px;
        gap: 8px;
    }

    .top-nav-logo {
        margin-bottom: 0;
    }

    .top-nav-right {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }

    .top-nav-container .layui-nav .layui-nav-item a {
        padding: 0 12px;
        font-size: 14px;
    }

    .top-nav-search {
        width: 100%;
    }

    .top-nav-search-input {
        width: 0;
    }
}
