:root {
    --header-height: 64px;
}

/* 覆盖原有的 main-body 样式，移除右侧 padding */
#main-body {
    padding-right: 0 !important;
}

/* 新的 Header 样式 */
#header-new {
    height: auto;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    border-bottom: none;
    flex-shrink: 0;
    position: relative;
    z-index: 200;
    position: sticky;
    top: 0;
}

.header-top-row {
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    justify-content: space-between;
    border-bottom: none;
    position: relative;
    z-index: 200;
}

.header-logo {
    display: flex;
    align-items: center;
    height: 48px;
    margin-right: 20px;
    margin-top: 4px;
}

.header-logo .logo {
    height: 100%;
    width: auto;
    display: block;
    cursor: pointer;
}

.header-bottom-row {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 24px 0 12px;
    background-color: #fff;
    justify-content: space-between;
    position: relative;
    z-index: 150;
}

/* 统一的搜索栏容器 */
.unified-search-bar {
    display: flex;
    align-items: center;
    background-color: #f5f5f5;
    border-radius: 8px;
    height: 44px;
    flex: 1;
    margin-right: 20px;
    padding: 0 12px 0 20px;
    position: relative; /* Ensure it can contain absolute children */
    transition: border-radius 0.2s;
}

.unified-search-bar.expanded {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    z-index: 2001; /* Ensure it stays above overlay if any */
}

/* 搜索范围选择 */
.search-scope-wrapper {
    position: relative;
    margin-right: 16px;
    height: 100%;
    display: flex;
    align-items: center;
}

.search-scope {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    flex-shrink: 0;
    user-select: none;
    height: 100%;
    padding: 0 8px; /* Add some padding for clickable area */
}

.search-scope::after {
    content: '';
    display: none; /* Hide the CSS arrow to avoid duplication with SVG arrow */
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #333;
    margin-left: 6px;
    margin-top: 2px;
}

.search-scope-popover {
    position: absolute;
    top: calc(100% + 4px); /* Slightly below */
    left: -20px; /* Align with left */
    width: 100px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    padding: 8px 0;
    z-index: 1002;
    display: flex;
    flex-direction: column;
}

.search-scope-item {
    padding: 10px 0 10px 28px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.search-scope-item:hover {
    background-color: #f5f5f5;
    font-weight: bold;
}

/* 竖线分隔符 */
.search-divider {
    width: 1px;
    height: 18px;
    background-color: #e0e0e0;
    margin-right: 16px;
}

/* 搜索图标 */
.search-icon-img {
    width: 18px;
    height: 18px;
    opacity: 0.5;
    margin-right: 10px;
}

/* 输入框 */
.search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: #333;
    flex: 1;
    min-width: 120px;
}

.search-input::placeholder {
    color: #999;
}

/* 嵌入式标签组 (在搜索栏内部) */
.header-tags-embedded {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 16px;
    flex-shrink: 0;
}

.header-tag-embedded {
    font-size: 12px;
    color: #666;
    padding: 4px 12px;
    background-color: #fff;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.header-tag-embedded:hover {
    color: #e64a19;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.header-tag-embedded.highlight {
    color: #e64a19;
    font-weight: bold;
}

/* 头部右侧功能区 */
.header-right-area {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-left: auto;
    margin-top: 14px;
}

.header-right-functions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-func-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #333;
    font-size: 13px;
    transition: color 0.2s;
}

.header-func-item:hover {
    color: #e64a19;
}

.header-func-item .icon {
    width: 20px;
    height: 20px;
}

.header-avatar-box {
    position: relative;
    cursor: pointer;
    margin-right: 24px;
}

.header-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #f0f0f0;
}

/* 工具按钮区 (右下角) */
.header-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.tool-btn.capsule {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 20px;
    background-color: #f5f5f5;
    border-radius: 22px;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.tool-btn.capsule.wide {
    width: 80px;
    position: relative;
    z-index: 1001;
    background-color: #f5f5f5;
    border-radius: 22px;
}

/* When filter sidebar is active, we might want to style this button differently if needed */
.tool-btn.capsule.wide.active {
    background-color: #f5f5f5;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: none;
    border-radius: 22px 22px 0 0;
}

.tool-btn.capsule:hover {
    background-color: #e0e0e0;
}

.tool-btn.capsule img,
.tool-btn.capsule svg {
    width: 20px;
    height: 20px;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .header-tags-embedded {
        display: none;
    }
}

/* Rotate animation for arrows */
.search-scope-arrow.rotated, 
.product-filter-arrow svg.rotated,
.brand-filter-arrow svg.rotated {
    transform: rotate(180deg);
}

/* VIP Modal Styles */
.vip-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.vip-modal-content {
    width: 1060px;
    background: #fff;
    border-radius: 16px;
    position: relative;
    font-family: sans-serif;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.vip-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    z-index: 10001;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}
.vip-modal-close:hover {
    color: #333;
}
.vip-modal-header {
    background: linear-gradient(135deg, #fdf6e3, #f9e8c3);
    padding: 24px 32px 20px;
    display: flex;
    align-items: center;
    position: relative;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
}
.vip-modal-header::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 200px;
    height: 100%;
    background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,215,0,0.1) 10px, rgba(255,215,0,0.1) 20px);
}
.vip-modal-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid #fff;
}
.vip-modal-user-info {
    position: relative;
    z-index: 2;
}
.vip-modal-username {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}
.vip-modal-status {
    font-size: 12px;
    color: #666;
}
.vip-modal-tabs {
    display: flex;
    padding: 0 32px;
    border-radius: 0 0 24px 24px;
    background: #fff;
    position: relative;
    top: -1px;
    padding-top: 16px;
    border-bottom: 1px solid #f0f0f0;
}
.vip-modal-tab {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: #666;
    padding: 12px 0;
    cursor: pointer;
    position: relative;
}
.vip-modal-tab.active {
    color: #d48806;
}
.vip-modal-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: #fadb14;
    border-radius: 4px 4px 0 0;
}
.vip-modal-bodies {
    display: grid;
}
.vip-modal-bodies > .vip-modal-body {
    grid-area: 1 / 1;
}
.vip-modal-body.tab-hidden {
    visibility: hidden;
    pointer-events: none;
    z-index: 0;
}
.vip-modal-body:not(.tab-hidden) {
    z-index: 1;
}
.vip-modal-body {
    display: flex;
    padding: 24px;
    background: #fff;
    border-radius: 0 0 16px 16px;
    box-sizing: border-box;
}
.vip-modal-left {
    width: 200px;
    border-right: 1px solid #f0f0f0;
    padding-right: 20px;
}
.vip-modal-left[style*="border-right: none"] {
    border-right: none !important;
}
.vip-privilege-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 16px;
}
.vip-privilege-group {
    margin-bottom: 16px;
}
.vip-privilege-group-title {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}
.vip-privilege-item {
    font-size: 12px;
    color: #666;
    line-height: 1.8;
}
.vip-view-all {
    font-size: 12px;
    color: #1890ff;
    text-decoration: none;
    display: block;
    margin-top: 16px;
}
.vip-modal-right {
    flex: 1;
    padding: 0 24px;
}
.vip-cards {
    display: flex;
    flex-wrap: nowrap;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
}
.vip-card {
    flex: 1;
    min-width: 100px;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 20px 8px;
    text-align: center;
    position: relative;
    cursor: pointer;
    box-sizing: border-box;
}
.vip-card.active {
    background: #fffbe6;
    border-color: #ffe58f;
}
.vip-card-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ff4d4f;
    color: #fff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px 10px 10px 0;
    z-index: 1;
}
.vip-card-title {
    font-size: 14px;
    color: #333;
    margin-bottom: 12px;
}
.vip-card-price {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}
.vip-card-price .currency {
    font-size: 16px;
    margin-right: 4px;
}
.vip-card-origin-price {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
    margin-bottom: 12px;
}
.vip-card-bottom {
    background: #faad14;
    color: #fff;
    font-size: 12px;
    padding: 4px 0;
    border-radius: 0 0 11px 11px;
    margin: 0 -8px -20px;
}
.vip-gift-box {
    background: #fafafa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}
.vip-gift-title {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
}
.vip-gift-item {
    background: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    display: inline-block;
    font-size: 14px;
    color: #d48806;
    border: 1px solid #ffe58f;
}
.vip-addons {
    margin-bottom: 24px;
}
.vip-addon-title {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
}
.vip-addon-list {
    display: flex;
    gap: 16px;
}
.vip-addon-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}
.vip-addon-item input {
    margin-right: 8px;
}
.vip-addon-price {
    color: #ff4d4f;
    margin-left: 4px;
}
.vip-modal-pay {
    width: 200px;
    border-left: 1px solid #f0f0f0;
    padding-left: 20px;
    text-align: center;
}
.vip-pay-price {
    font-size: 40px;
    font-weight: bold;
    color: #ff4d4f;
    margin-bottom: 8px;
}
.vip-pay-price .currency {
    font-size: 20px;
    margin-right: 4px;
}
.vip-pay-coupon {
    font-size: 12px;
    color: #666;
    margin-bottom: 20px;
}
.vip-pay-coupon .coupon-text {
    color: #ff4d4f;
    margin-left: 4px;
}
.vip-pay-qrcode {
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}
.qrcode-placeholder {
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
    background: #fafafa;
    border: 1px dashed #d9d9d9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #999;
}
.vip-pay-btn {
    width: 100%;
    background: #333;
    color: #fff;
    border: none;
    padding: 10px 0;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
}
.vip-pay-methods {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.pay-method {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    border-radius: 50%;
    color: #fff;
    font-size: 10px;
}
.pay-method.wechat {
    background: #07c160;
}
.pay-method.alipay {
    background: #1677ff;
}
.vip-pay-agreement {
    font-size: 12px;
    color: #999;
    margin-bottom: 24px;
}
.vip-pay-agreement a {
    color: #1890ff;
    text-decoration: none;
}
.vip-pay-links {
    font-size: 12px;
    color: #666;
}
.vip-pay-links a {
    color: #666;
    text-decoration: none;
}
.vip-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    z-index: 10001;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}
.vip-modal-close:hover {
    color: #333;
}
.vip-gift-icon {
    display: inline-block;
    vertical-align: middle;
}

/* Page Transition Overlay */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.9);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.page-transition-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.page-transition-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff3b30;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Coin Recharge UI */
.coin-cards {
    display: flex;
    flex-wrap: nowrap;
    gap: 16px;
    align-items: stretch;
    margin-bottom: 24px;
}
.coin-card {
    flex: 1;
    min-width: 100px;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 20px 8px;
    text-align: center;
    position: relative;
    cursor: pointer;
    background: #fff;
    overflow: hidden;
    box-sizing: border-box;
}
.coin-card.active {
    border-color: #ff4d4f;
    background: #fffafa;
}
.coin-card-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #ff4d4f;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-bottom-left-radius: 8px;
}
.coin-card-badge.gray {
    background: #d9d9d9;
}
.coin-card-title {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
}
.coin-card-price {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 16px;
}
.coin-card.active .coin-card-price {
    color: #ff4d4f;
}
.coin-card-price .currency {
    font-size: 16px;
    margin-right: 2px;
}
.coin-card-bottom {
    background: #ff4d4f;
    color: #fff;
    font-size: 12px;
    padding: 4px 0;
    border-radius: 0 0 11px 11px;
    margin: 0 -8px -20px;
}
.coin-card-bottom.gray {
    background: #f0f0f0;
    color: #999;
}
.coin-card.custom {
    justify-content: center;
    align-items: center;
    padding: 24px 12px;
}
.coin-card-custom-btn {
    background: #f5f5f5;
    color: #666;
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 12px;
}

/* Popover Banners */
.popover-banners {
    padding: 0 8px 8px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.popover-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
}
.vip-banner-blue {
    background: #e6f4ff;
}
.vip-banner-blue .banner-text {
    color: #666;
    white-space: nowrap;
}
.vip-banner-blue .banner-action {
    color: #ff4d4f;
    font-size: 11px;
    white-space: nowrap;
    margin-left: 4px;
}
.coin-banner-yellow {
    background: #fffbe6;
}
.coin-banner-yellow .banner-text {
    color: #666;
    white-space: nowrap;
}
.coin-banner-yellow .banner-action {
    color: #d48806;
    font-size: 11px;
    white-space: nowrap;
    margin-left: 4px;
}

#home-sidebar-popover {
    position: fixed;
    top: 0;
    left: 60px;
    right: 0;
    height: 100%;
    background-color: #fff;
    z-index: 999;
    box-shadow: 4px 0 16px rgba(0,0,0,0.1);
    transform: translateX(-120%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    overflow: hidden;
}

#home-sidebar-popover.active {
    transform: translateX(0);
}

#home-sidebar-popover .popover-header {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80px;
    padding: 0 24px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

#home-sidebar-popover .popover-title {
    font-size: 28px;
    font-weight: bold;
    color: #e1251b;
    letter-spacing: 1px;
    line-height: 1.2;
}

#home-sidebar-popover .popover-title-sub {
    font-size: 14px;
    color: #333;
    margin-top: 4px;
    font-weight: normal;
    letter-spacing: 0;
}

#home-sidebar-popover .close-btn {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
}

#home-sidebar-popover .close-btn:hover svg {
    fill: #333;
}

#home-sidebar-popover .popover-content {
    height: calc(100% - 80px);
    overflow: hidden;
}

/* Copyright line spacing below footer columns */
#home-sidebar-popover .popover-content > div:last-child {
    margin-top: 28px;
}

/* Social Icon QR Popover */
.social-icon-wrapper {
    position: relative;
    display: inline-flex;
}

.social-qr-popover {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.social-icon-wrapper:hover .social-qr-popover {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

.social-qr-popover::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
}

.social-qr-popover img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 1px solid #f0f0f0;
}

.social-qr-popover span {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

/* Carousel Transition */
.carousel-fade-enter-active, .carousel-fade-leave-active {
    transition: opacity 0.8s ease;
}
.carousel-fade-enter, .carousel-fade-leave-to {
    opacity: 0;
}

/* Global Search Popover */
.unified-search-popover {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: auto;
    min-height: 220px;
    background-color: #f5f5f5;
    z-index: 2000;
    padding: 8px 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    align-content: flex-start;
    flex-wrap: nowrap;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1);
    border-top: none;
    border-radius: 0 0 8px 8px;
    transform: none;
    margin-top: 0;
}

.unified-search-popover::after {
    content: "";
    position: absolute;
    top: 36px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    border: 1px dashed #dcdcdc;
    background-color: #fff;
    border-radius: 8px;
    z-index: -1;
}

.unified-search-popover .close-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    z-index: 10;
}

.unified-search-popover .main {
    flex: 0 0 auto;
    margin: 0;
    align-self: stretch;
    padding-top: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    box-sizing: border-box;
    z-index: 1;
}

.unified-search-popover .upload-btn {
    background-color: #e1251b;
    color: #fff;
    padding: 8px 24px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 12px;
}

.unified-search-popover .upload-tip {
    font-size: 12px;
    color: #999;
    margin-bottom: 20px;
}

.unified-search-popover .upload-input {
    display: flex;
    width: 300px;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
}

.unified-search-popover .upload-input input {
    flex: 1;
    border: none;
    padding: 8px 12px;
    font-size: 12px;
    outline: none;
}

.unified-search-popover .upload-input .search-btn {
    background-color: #f5f5f5;
    color: #666;
    padding: 8px 16px;
    font-size: 12px;
    cursor: pointer;
    border-left: 1px solid #eee;
}
