/* ===== 主头部样式 ===== */
.main-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    z-index: 100;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    
    /* 拟态效果 */
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1),
                inset 0 -1px 1px rgba(255, 255, 255, 0.5),
                inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

.main-header.scrolled {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

/* ===== 头部内容布局 ===== */
.header-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; /* 为搜索框定位提供参照 */
}

/* ===== 网站标题 ===== */
.site-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
    letter-spacing: 1px;
}

/* ===== 右侧容器 (搜索+logo) ===== */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* ===== 搜索按钮 ===== */
.search-toggle {
    background: none;
    border: none;
    color: #2d3748;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.search-toggle:hover {
    color: #1a202c;
    transform: scale(1.1);
}

/* ===== Logo样式 ===== */
.header-logo {
    height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* ===== 搜索框容器 ===== */
.search-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 90;
    display: flex;
    align-items: center;
    transform: translateY(-20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.search-container.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    font-size: 1rem;
    border: 2px solid #f0f0f0;
    border-radius: 30px;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

.search-close {
    margin-left: 10px;
    background: none;
    border: none;
    color: #666;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s ease;
}


/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
    .main-header {
        height: 57px;
        padding: 0 1.3rem;
    }
    
    .site-title {
        font-size: 1.2rem;
    }
    
    .header-logo {
        height: 36px;
        width: 36px;
    }
    
    .header-right {
        gap: 15px;
    }
    
    .search-container {
        padding: 12px 1.3rem;
    }
    
    .search-input {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .search-close {
        right: 25px;
        font-size: 1.2rem;
    }
}