/* ========== 公共头部样式 ========== */

/* 顶部通知栏 */
.top-bar {
    background: #f8f8f8;
    padding: 8px 0;
    font-size: 12px;
    color: #666;
    border-bottom: 1px solid #e8e8e8;
}

.top-bar .header-inner {
    max-width: 90%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left {
    display: flex;
    gap: 20px;
}

.top-bar-right {
    display: flex;
    gap: 20px;
}

.top-bar a {
    color: #666;
    text-decoration: none;
}

.top-bar a:hover {
    color: #1890ff;
}

/* 头部导航 */
.header {
    background: #fff;
    padding: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.header .header-inner {
    max-width: 90%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: #ff6b35;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 24px;
}

.logo-text h1 {
    font-size: 20px;
    color: #ff6b35;
    margin-bottom: 2px;
}

.logo-text p {
    font-size: 12px;
    color: #999;
}

/* 导航菜单 */
.nav-menu {
    display: flex;
    gap: 0px;
    align-items: center;
}

/* 下拉菜单容器 */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

/* 下拉菜单触发器 */
.dropdown-trigger {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    position: relative;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: block;
    cursor: pointer;
}

.dropdown-trigger::after {
    content: ' ▼';
    font-size: 10px;
    margin-left: 4px;
}

.dropdown-trigger:hover {
    color: #ff6b35;
    background: rgba(255, 107, 53, 0.08);
}

/* 下拉菜单 */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 160px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    padding: 8px 0;
    z-index: 1000;
    margin-top: 0;
    border: 1px solid #e8e8e8;
    padding-top: 15px;
}

/* 创建一个不可见的过渡区域 */
.dropdown-menu::after {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    right: 0;
    height: 15px;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    width: 12px;
    height: 12px;
    background: white;
    border-left: 1px solid #e8e8e8;
    border-top: 1px solid #e8e8e8;
    transform: rotate(45deg) translateY(-6px);
    z-index: 1;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.dropdown-menu a:hover {
    background: rgba(255, 107, 53, 0.08);
    color: #ff6b35;
    padding-left: 25px;
}

/* 鼠标悬停显示下拉菜单 */
.nav-dropdown:hover .dropdown-menu {
    display: block !important;
    animation: dropdownFadeIn 0.3s ease;
}

.nav-dropdown:hover .dropdown-trigger {
    color: #ff6b35;
    background: rgba(255, 107, 53, 0.08);
    border-radius: 6px 6px 0 0;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 导航链接 */
.nav-menu a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    position: relative;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-menu a:hover {
    color: #ff6b35;
    background: rgba(255, 107, 53, 0.08);
    transform: translateY(-1px);
}

.nav-menu a.active {
    color: #ff6b35;
    background: rgba(255, 107, 53, 0.12);
    font-weight: 600;
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: #ff6b35;
    border-radius: 2px;
}

/* 搜索框 */
.header .search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    max-width: none;
    width: auto;
}

.header .search-input {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 200px;
    font-size: 14px;
    flex: none;
    max-width: none;
    box-sizing: border-box;
}

.header .search-input:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* 按钮样式 */
.header .btn {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.header .btn-primary {
    background: #ff6b35;
    color: white;
}

.header .btn-primary:hover {
    background: #ff8c5a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.header .btn-outline {
    background: white;
    color: #ff6b35;
    border: 1px solid #ff6b35;
}

.header .btn-outline:hover {
    background: #ff6b35;
    color: white;
}

.header .btn-small {
    padding: 5px 15px;
    font-size: 12px;
    background: #ff6b35;
    color: white;
}

.header .btn-small:hover {
    background: #ff8c5a;
}

/* 用户下拉菜单 */
.user-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 12px;
    border-radius: 20px;
    transition: all 0.3s;
    white-space: nowrap;
}

.user-dropdown:hover {
    background: rgba(255, 107, 53, 0.08);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: #ff6b35;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.user-name {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 用户下拉菜单 */
.user-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 140px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    padding: 6px 0;
    z-index: 1000;
    margin-top: 8px;
    border: 1px solid #e8e8e8;
}

/* 透明桥接区域，防止鼠标移入间隙时菜单消失 */
.user-dropdown-menu::after {
    content: '';
    position: absolute;
    top: -16px;
    left: 0;
    right: 0;
    height: 16px;
}

.user-dropdown:hover .user-dropdown-menu {
    display: block;
    animation: dropdownFadeIn 0.3s ease;
}

.user-dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
    white-space: nowrap;
}

.user-dropdown-menu a:hover {
    background: rgba(255, 107, 53, 0.08);
    color: #ff6b35;
    padding-left: 25px;
}

.user-dropdown-menu a.logout-link {
    border-top: 1px solid #f0f0f0;
    color: #999;
}

.user-dropdown-menu a.logout-link:hover {
    color: #ff4d4f;
}

/* ========== 移动端响应式 ========== */
@media screen and (max-width: 768px) {
    /* 顶部栏隐藏 */
    .top-bar {
        display: none;
    }

    /* 头部调整 */
    .header {
        padding: 15px 0;
    }

    .header .header-inner {
        max-width: 100%;
        padding: 0 15px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .logo-text h1 {
        font-size: 16px;
    }

    .logo-text p {
        display: none;
    }

    /* 导航菜单移动端优化 */
    .header .nav-menu {
        order: 3;
        width: 100%;
        overflow-x: auto;
        gap: 5px;
        padding: 5px 0;
        -webkit-overflow-scrolling: touch;
    }

    .header .nav-menu a {
        padding: 6px 12px;
        font-size: 13px;
        white-space: nowrap;
    }

    /* 移动端下拉菜单 */
    .header .nav-dropdown {
        position: relative;
    }

    .header .dropdown-trigger {
        padding: 6px 12px;
        font-size: 13px;
        white-space: nowrap;
    }

    .header .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        background: white;
        min-width: 140px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        border-radius: 6px;
        padding: 5px 0;
        margin-top: 5px;
    }

    .header .dropdown-menu a {
        padding: 8px 15px;
        font-size: 13px;
    }

    .header .dropdown-menu a:hover {
        padding-left: 18px;
    }

    .header .search-box {
        flex: 1;
        min-width: 200px;
    }

    .header .search-input {
        width: 100%;
    }

    /* 移动端用户下拉 */
    .header .user-name {
        display: none;
    }

    .header .user-dropdown {
        padding: 4px 8px;
    }
}
