#site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: transparent;
}

.header-top {
    background: #f5f5f5;
    border-bottom: 1px solid #eee;
    padding: 6px 0;
    font-size: 12px;
    color: #666;
    line-height: 1.6;
}

.header-top .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: auto !important;
}

.header-top .top-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.header-top .top-left .welcome {
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

.header-top .top-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.header-top .top-right a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
}

.header-top .top-right a:hover {
    color: #667eea;
}

.header-top .service-phone {
    color: #667eea;
    font-weight: 600;
    white-space: nowrap;
}

.header-main {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 16px 0;
}

.header-main .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 32px;
    min-height: auto !important;
}

.header-main .logo {
    font-size: 24px;
    font-weight: 700;
    color: white;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-main .logo:hover {
    opacity: 0.9;
}

.header-main .search-box {
    flex: 1;
    max-width: 500px;
    display: flex;
    position: relative;
    border-radius: 8px;
}

.header-main .search-box input {
    flex: 1;
    padding: 10px 16px;
    border: none;
    font-size: 14px;
    outline: none;
    border-radius: 8px 0 0 8px;
}

.header-main .search-box button {
    background: #ff6b35;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.header-main .search-box button:first-of-type {
    border-radius: 0;
}

.header-main .search-box button:last-of-type {
    border-radius: 0 8px 8px 0;
}

/* 搜索建议下拉框 */
.search-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 320px;
    overflow-y: auto;
}

.suggestion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f0f0f0;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: #f5f5f5;
}

.suggestion-name {
    font-size: 14px;
    color: #333;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggestion-code {
    font-size: 12px;
    color: #999;
    margin-left: 12px;
    flex-shrink: 0;
}

.header-main .search-box button:hover {
    background: #e55a2b;
}

#price-btn {
    background: #22c55e;
}

#price-btn:hover {
    background: #16a34a;
}

#size-btn {
    background: #3b82f6;
}

#size-btn:hover {
    background: #2563eb;
}

.header-main .header-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.header-main .action-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.header-main .action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}

.header-main .action-btn .cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #e74c3c;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    display: none;
}

.header-nav {
    background: #fff;
    border-bottom: 2px solid #667eea;
}

.header-nav .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    min-height: auto !important;
}

.header-nav .nav-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.header-nav .nav-menu .nav-item {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 24px;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 悬停高亮仅在鼠标设备生效，避免平板触控点击后颜色残留 */
@media (hover: hover) and (pointer: fine) {
    .header-nav .nav-menu .nav-item:hover {
        color: #667eea;
    }
}

.header-nav .nav-menu .nav-item.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.header-nav .user-area {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
    padding: 0 16px;
}

.header-nav .user-area a {
    color: #666;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.header-nav .user-area a:hover {
    color: #667eea;
}

.header-nav .user-area .btn-admin {
    background: #667eea;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
}

.header-nav .user-area .btn-admin:hover {
    background: #5a6fd6;
}

@media (min-width: 769px) {
    body {
        padding-top: 160px;
    }
}

/* 平板 / 中等宽度：压缩尺寸，保持横向排列，避免中文逐字换行导致竖排 */
@media (min-width: 769px) and (max-width: 1024px) {
    body {
        padding-top: 180px;
    }

    .header-main {
        padding: 12px 0;
    }

    .header-main .container {
        gap: 16px;
    }

    .header-main .logo {
        font-size: 20px;
    }

    .header-main .search-box {
        max-width: none;
        min-width: 0;
    }

    .header-main .search-box input {
        min-width: 0;
        padding: 10px 12px;
    }

    .header-main .search-box button {
        padding: 10px 14px;
        font-size: 13px;
    }

    .header-main .header-actions {
        gap: 8px;
    }

    .header-main .action-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .header-nav .nav-menu .nav-item {
        padding: 12px 14px;
        font-size: 13px;
    }

    .header-nav .user-area {
        gap: 10px;
        padding: 0 8px;
    }

    .header-nav .user-area a {
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    #site-header {
        display: none;
    }
    
    body {
        padding-top: 0;
    }
}