/* ===== 公共 Header 样式 ===== */
.container {
    max-width: 1450px;
}

.magazine-header {
    position: sticky;
    top: 0;
    background: #fff;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.magazine-header .main-nav {
    display: flex;
    align-items: center;
    padding: 0;
    height: 64px;
}

/* 左侧：Logo + 导航 */
.magazine-header .nav-left {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

/* Logo */
.magazine-header .logo-img {
    width: 100px;
}

/* 水平导航链接 */
.magazine-header .nav-links {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 8px;
}
.magazine-header .nav-links li a {
    display: block;
    padding: 20px 16px;
    text-decoration: none;
    color: #333;
    font-size: 16px;
    transition: all 0.25s ease;
    position: relative;
    white-space: nowrap;
    font-weight: 600;
}
.magazine-header .nav-links li a:hover,
.magazine-header .nav-links li.active a {
    color: #c9302c;
}
.magazine-header .nav-links li.active a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: #c9302c;
    border-radius: 1px;
}

/* 右侧：搜索 + 购物车 + 订单 + 用户 */
.magazine-header .nav-right {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-shrink: 0;
    margin-left: auto;
}

/* 搜索框 */
.magazine-header .search-wrap {
    position: relative;
    display: flex;
}
.magazine-header .search-wrap form {
    display: flex;
    align-items: center;
}
.magazine-header .search-wrap input {
    width: 220px;
    height: 38px;
    padding: 0 48px 0 15px;
    border: 1px solid #e0e0e0;
    border-right: none;
    border-radius: 4px 0 0 4px;
    background: #fff;
    font-size: 13px;
    color: #333;
    outline: none;
    transition: all 0.3s ease;
}
.magazine-header .search-wrap input::placeholder {
    color: #bbb;
    font-size: 12px;
}
.magazine-header .search-wrap input:focus {
    border-color: #c9302c;
    width: 280px;
}
.magazine-header .search-wrap button {
    position: absolute;
    right: 0;
    top: 0;
    width: 42px;
    height: 38px;
    background: #c9302c;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 4px 4px 0;
    transition: background 0.25s ease;
}
.magazine-header .search-wrap button:hover {
    background: #b02a26;
}

/* 购物车 & 我的订单 通用图标链接样式 */
.magazine-header .icon-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #555;
    font-size: 13px;
    gap: 5px;
    position: relative;
    transition: color 0.25s;
    white-space: nowrap;
}
.magazine-header .icon-link:hover {
    color: #c9302c;
}

/* 购物车 */
.magazine-header .cart-link .cart-icon-wrap {
    position: relative;
    font-size: 20px;
}
.magazine-header .cart-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    background: #c9302c;
    color: #fff;
    font-size: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-weight: 500;
}

/* 我的订单 */
.magazine-header .order-link-icon {
    font-size: 20px;
}

/* 分隔线 */
.magazine-header .nav-divider-v {
    width: 1px;
    height: 18px;
    background: #e0e0e0;
}

/* 用户登录/注册 */
.magazine-header .user-auth {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}
.magazine-header .user-auth a {
    color: #666;
    text-decoration: none;
    transition: color 0.25s;
    white-space: nowrap;
}
.magazine-header .user-auth a:hover {
    color: #c9302c;
}
.magazine-header .user-welcome {
    color: #c9302c;
    font-size: 13px;
}

/* ===== 分类下拉面板（暂不需要） ===== */
/*
.magazine-header .category-menu {
    position: fixed;
    top: 64px;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    z-index: 999;
    display: none;
    border-bottom: 1px solid #eee;
}
.magazine-header .category-menu.show {
    display: block;
}
.magazine-header .category-menu-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 15px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0;
}
.magazine-header .cate-item {
    border-right: 1px solid #f5f5f5;
    border-bottom: 1px solid #f5f5f5;
}
.magazine-header .cate-link {
    display: flex;
    align-items: center;
    padding: 14px 12px;
    color: #444;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.25s ease;
    gap: 10px;
}
.magazine-header .cate-link:hover {
    color: #c9302c;
    background: #fafafa;
}
.magazine-header .cate-icon {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f7f7f7;
    display: flex;
    align-items: center;
    justify-content: center;
}
.magazine-header .cate-icon img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}
.magazine-header .cate-arrow {
    margin-left: auto;
    font-size: 11px;
    color: #ddd;
    transition: all 0.25s;
}
.magazine-header .cate-link:hover .cate-arrow {
    color: #c9302c;
    transform: translateX(3px);
}
*/

/* ===== 响应式 ===== */
@media (max-width: 992px) {
    .magazine-header .main-nav {
        height: 56px;
    }
    .magazine-header .nav-links {
        gap: 4px;
    }
    .magazine-header .nav-links li a {
        padding: 20px 10px;
        font-size: 13px;
    }
    .magazine-header .search-wrap input {
        width: 160px;
        height: 34px;
    }
    .magazine-header .search-wrap button {
        width: 38px;
        height: 34px;
    }
    .magazine-header .search-wrap input:focus {
        width: 200px;
    }
    /*
    .magazine-header .category-menu-inner {
        grid-template-columns: repeat(4, 1fr);
    }
    */
}

@media (max-width: 768px) {
    .magazine-header .nav-links {
        display: none;
    }
    .magazine-header .search-wrap input {
        width: 120px;
        height: 32px;
        font-size: 12px;
    }
    .magazine-header .search-wrap button {
        width: 36px;
        height: 32px;
    }
    .magazine-header .icon-link span:last-child {
        display: none;
    }
    .magazine-header .user-auth span:not(.user-welcome) {
        display: none;
    }
    /*
    .magazine-header .category-menu-inner {
        grid-template-columns: repeat(3, 1fr);
    }
    */
}
