/* 基础样式重置 */
 * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
}

/* 全局头部样式 */
.global-header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    position: relative;
}

/* LOGO样式 */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #2c3e50;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-right: 10px;
    z-index: 10;
    /* 确保LOGO在其他元素之上 */
}

.logo-icon {
    font-size: 1.8rem;
    margin-right: 10px;
    color: red;
}

/* 搜索框样式 */
.search-container {
    position: relative;
    width: 320px;
    flex-shrink: 0;
    margin: 0 10px;
    z-index: 10;
}

.search-form {
    position: relative;
    display: flex;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.search-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #7f8c8d;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}

.search-suggestion-item {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
}

.search-suggestion-item:hover,
.search-suggestion-item.active {
    background-color: #f8f9fa;
}

.suggestion-code {
    font-weight: bold;
    color: #2c3e50;
}

.suggestion-name {
    color: #7f8c8d;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-left: 10px;
}

/* 导航菜单样式 */
.nav-btn {
    flex: 3;
    display: flex;
    align-items: center;
    z-index: 5;
}

/* Logo标题样式 */
.logo-text {
    font-weight: 700;
    font-size: 1.2rem;
}

/* 用户区域样式 */
.user-area {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

/* 用户头像样式 */
.user-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    color: #3498db;
    transition: all 0.3s ease;
}

.user-avatar:hover {
    background-color: #e0e0e0;
    transform: scale(1.05);
}

/* 导航链接样式 */
.nav-links {
    flex: 1;
    display: flex;
    justify-content: center;
}

.log-sign {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    gap: 10px;
}

.nav-links>ul {
    display: flex;
    align-items: center;
    padding: 0;
    margin: 0;
    list-style: none;
    height: 3rem;
}

.nav-link {
    position: relative;
    margin: 0 10px;
}

.nav-link>a {
    line-height: 3rem;
    color: #2c3e50;
    padding: 0 0.8rem;
    letter-spacing: 0;
    font-size: .95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .5s;
    text-decoration: none;
    z-index: 10;
    position: relative;
    white-space: nowrap;
    min-width: fit-content;
}

.nav-link:hover>a {
    transform: scale(1.03);
    color: #3498db;
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 10rem;
    transform: translateY(10px);
    opacity: 0;
    pointer-events: none;
    transition: .5s;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.dropdown ul {
    position: relative;
    list-style: none;
}

.dropdown-link>a {
    display: flex;
    background-color: #fff;
    color: #3498db;
    padding: .5rem 1rem;
    font-size: .9rem;
    align-items: center;
    justify-content: space-between;
    transition: .3s;
    text-decoration: none;
}

.dropdown-link:hover>a {
    background-color: #3498db;
    color: #fff;
}

.dropdown-link:not(:nth-last-child(2)) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.dropdown-link i {
    transform: rotate(-90deg);
}

.arrow {
    position: absolute;
    width: 11px;
    height: 11px;
    top: -5.5px;
    left: 32px;
    background-color: #fff;
    transform: rotate(45deg);
    cursor: pointer;
    transition: .3s;
    z-index: -1;
}

.dropdown-link:first-child:hover~.arrow {
    background-color: #3498db;
}

.dropdown-link {
    position: relative;
}

.dropdown.second {
    top: 0;
    left: -100%;
    padding-left: .8rem;
    cursor: pointer;
    transform: translateX(10px);
}

.dropdown.second .arrow {
    top: 10px;
    left: -5.5px;
}

.nav-link:hover>.dropdown,
.dropdown-link:hover>.dropdown {
    transform: translate(0, 0);
    opacity: 1;
    pointer-events: auto;
}

/* 汉堡菜单样式 */
.hamburger-menu-container {
    display: none;
    cursor: pointer;
    position: relative;
    z-index: 1001;
    width: 30px;
    height: 30px;
    /* 确保整个容器可点击 */
}

.hamburger-menu {
    width: 30px;
    height: 20px;
    position: relative;
}

.hamburger-menu div {
    width: 1.6rem;
    height: 3px;
    border-radius: 3px;
    background-color: #2c3e50;
    position: relative;
    z-index: 1001;
    transition: transform 0.3s;
}

.hamburger-menu div:before,
.hamburger-menu div:after {
    content: '';
    position: absolute;
    width: inherit;
    height: inherit;
    background-color: #2c3e50;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger-menu div:before {
    transform: translateY(-7px);
}

.hamburger-menu div:after {
    transform: translateY(7px);
}

#check {
    position: absolute;
    top: 50%;
    right: 1.5rem;
    transform: translateY(-50%);
    width: 2.5rem;
    height: 2.5rem;
    z-index: 90000;
    cursor: pointer;
    opacity: 0;
    display: none;
}

#check:checked~.hamburger-menu-container .hamburger-menu div {
    background-color: transparent;
}

#check:checked~.hamburger-menu-container .hamburger-menu div:before {
    transform: translateY(0) rotate(-45deg);
}

#check:checked~.hamburger-menu-container .hamburger-menu div:after {
    transform: translateY(0) rotate(45deg);
}

/* 登录/注册按钮 */
.btn {
    display: inline-block;
    padding: .5rem 1.3rem;
    font-size: .8rem;
    border-radius: 2rem;
    line-height: 1.5;
    margin: 0 .2rem;
    transition: .3s;
    text-transform: uppercase;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
}

/* 登录状态样式控制 */
.user-logged-in .user-avatar {
    display: flex;
}

.user-logged-in .log-sign {
    display: none;
}

.btn.solid,
.btn.transparent:hover {
    background-color: #ffb6c1; /* 浅粉色背景 */
    color: #fff;
    border: 2px solid #ffb6c1;
}

.btn.transparent,
.btn.solid:hover {
    background-color: transparent;
    color: #ffb6c1;
    border: 2px solid #ffb6c1;
}

/* 响应式设计 */
/* 平板设备样式 - 768px-992px宽度范围 */
@media (max-width: 992px) {
    .search-container {
        width: 250px;
    }
    
    /* 在中等屏幕上保持标题显示 */
    .logo-text {
        display: inline;
    }
    
    /* 汉堡菜单显示 */
    .hamburger-menu-container {
        display: flex !important;
        align-items: center;
        justify-content: center;
        z-index: 1001;
    }
    
    #check {
        display: block !important;
        position: absolute;
        right: 30px;
        top: 50%;
        transform: translateY(-50%);
        width: 30px;
        height: 30px;
        opacity: 0;
        cursor: pointer;
        z-index: 1002;
    }
    
    /* 导航菜单默认隐藏，点击汉堡菜单后显示 */
    .nav-btn {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: calc(100vh - 70px);
        background-color: white;
        box-shadow: -5px 0 10px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 20px;
        gap: 20px;
        transition: right 0.3s ease;
        z-index: 1000;
    }
    
    #check:checked ~ .nav-btn {
        right: 0;
        transform: translateX(0);
    }
    
    /* 确保所有导航链接在汉堡菜单中显示 */
    .nav-links {
        display: flex !important;
        width: 100%;
    }
    
    .nav-links > ul {
        flex-direction: column;
        width: 100%;
        height: auto;
        gap: 10px;
    }
    
    .nav-link {
        width: 100%;
        margin: 0;
    }
}

/* 移动设备样式 - 768px以下 */
@media (max-width: 768px) {
    /* 在小屏幕上隐藏网站标题 */
    .logo-text {
        display: none;
    }
    
    /* 确保Logo图标显示 */
    .logo-icon {
        margin-right: 0;
    }
    
    .search-container {
        position: relative;
        width: calc(100% - 40px);
        margin: 0 20px 15px 20px;
        z-index: 100;
        display: block !important;
    }
    
    /* 优化手机端搜索框样式 */
    .search-input {
        padding: 12px 15px;
        font-size: 1rem;
        border-radius: 24px;
        width: 100%;
    }
    
    /* 搜索按钮样式调整 */
    .search-button {
        right: 10px;
        padding: 8px;
    }
    
    /* 在较小屏幕上隐藏主导航，通过汉堡菜单显示 */
    .nav-links {
        display: none;
    }
    
    /* 汉堡菜单打开时，显示导航链接 */
    #check:checked~.nav-btn .nav-links {
        display: flex;
        width: 100%;
    }
    
    #check:checked~.nav-btn .nav-links>ul {
        flex-direction: column;
        width: 100%;
    }
    
    #check:checked~.nav-btn .nav-link {
        width: 100%;
    }
    
    #check:checked~.nav-btn .nav-link>a {
        line-height: 1;
        padding: 1.6rem 2rem;
        justify-content: flex-start;
    }
}

/* 小屏幕手机优化 - 480px以下 */
@media (max-width: 480px) {
    .search-container {
        width: calc(100% - 60px);
        margin: 0 30px 15px 30px;
    }
    
    .logo-text {
        display: none;
    }
    
    .logo-icon {
        margin-right: 0;
    }
    
    /* 导航菜单在小屏幕上的展开样式 */
    #check:checked~.nav-btn {
        transform: translateX(0);
        width: 100%;
    }
    
    .nav-links {
        flex: initial;
        width: 100%;
    }
    
    .nav-links>ul {
        flex-direction: column;
    }
    
    .nav-link {
        width: 100%;
    }
    
    .nav-link>a {
        line-height: 1;
        padding: 1.6rem 2rem;
    }
    
    .nav-link:hover>a {
        transform: scale(1);
        background-color: #f0f7ff;
    }
    
    .dropdown, .dropdown.second {
        position: initial;
        top: initial;
        left: initial;
        transform: initial;
        opacity: 1;
        pointer-events: auto;
        width: 100%;
        padding: 0;
        background-color: #f8f9fa;
        display: none;
        box-shadow: none;
    }
    
    .nav-link:hover>.dropdown, .dropdown-link:hover>.dropdown {
        display: block;
    }
    
    .dropdown-link>a {
        background-color: transparent;
        color: #2c3e50;
        padding: 1.2rem 2rem;
        line-height: 1;
    }
    
    .dropdown.second .dropdown-link>a {
        padding: 1.2rem 2rem 1.2rem 3rem;
    }
    
    .dropdown.second .dropdown.second .dropdown-link>a {
        padding: 1.2rem 2rem 1.2rem 4rem;
    }
    
    .dropdown-link:not(:nth-last-child(2)) {
        border-bottom: none;
    }
    
    .arrow {
        display: none;
    }
    
    .log-sign {
        flex: initial;
        width: 100%;
        padding: 1.5rem 1.9rem;
        justify-content: flex-start;
        display: flex;
    }
    
    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        display: none;
        z-index: 998;
    }
    
    #check:checked~.overlay {
        display: block;
    }
}

/* 登录弹窗样式 */
.login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-modal-content {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
}

.login-modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.login-modal-header h2 {
    margin: 0;
    color: #2c3e50;
}

.login-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.login-modal-close:hover {
    background-color: #f8f9fa;
}

/* 选项卡样式 */
.tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 15px;
    cursor: pointer;
    color: #2c3e50;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tab.active {
    background: white;
    border-bottom: 3px solid #ffb6c1;
    color: #ff69b4;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* 表单容器样式 */
.form-container {
    padding: 20px;
}

.form {
    display: none;
}

.form.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单组样式 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

/* 带图标的输入框样式 */
.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.input-with-icon input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.input-with-icon input:focus {
    border-color: #ff69b4;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.1);
}

/* 消息提示样式 */
.message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 0.95rem;
    display: none;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Toast提示样式 */
.toast-message {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 24px;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10000;
}

.toast-message.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .login-modal-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
    
    .form-container {
        padding: 15px;
    }
}