/* 顶部图片广告横幅 - 适应浏览器显示 */
.top-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #f8f9fa;
    padding: 20px;
    margin: 0;
    display: flex; /* 显示广告横幅 */
    align-items: center;
    justify-content: center;
    overflow: hidden;
    height: auto;
    min-height: 120px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.top-banner-content {
    width: 50%;
    max-width: 600px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.top-banner img {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    aspect-ratio: auto;
}

.top-banner img:hover {
    transform: scale(1.05);
}

/* 修复导航栏位置，避免与横幅冲突 */
.navbar {
    top: auto !important; /* 动态调整位置 */
    transition: top 0.3s ease;
}

/* 移除重复的样式定义 */

/* 横幅背景渐变效果 */
.top-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    z-index: -1;
}

/* 横幅内容区域样式 */
.top-banner-content {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 10px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* 移除QR相关样式，因为现在使用真实图片 */

/* 移除信息文本样式，因为现在使用真实图片 */

.top-banner-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: #333;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 10001; /* 确保在最顶层 */
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    font-weight: bold;
    user-select: none; /* 防止文本选择 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.top-banner-close:hover {
    background-color: rgba(255, 255, 255, 1);
    color: #333;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .top-banner {
        display: flex; /* 在移动端也显示横幅 */
        min-height: 100px; /* 移动端最小高度 */
        padding: 15px;
    }
    
    .top-banner-content {
        width: 80%; /* 移动端增加宽度 */
        max-width: 400px;
    }
    
    .navbar {
        top: auto !important; /* 动态调整 */
    }
    
    .top-banner-close {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
    
    .top-banner-content {
        padding: 8px;
    }
    
    .top-banner img {
        max-height: 80%;
    }
}

@media (max-width: 480px) {
    .top-banner {
        display: flex; /* 在小屏幕也显示横幅 */
        min-height: 80px; /* 小屏幕最小高度 */
        padding: 10px;
    }
    
    .top-banner-content {
        width: 90%; /* 小屏幕进一步增加宽度 */
        max-width: 300px;
    }
    
    .navbar {
        top: auto !important; /* 动态调整 */
    }
    
    .top-banner-close {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    
    .top-banner-content {
        padding: 6px;
    }
    
    .top-banner img {
        max-height: 70%;
    }
}

/* 为页面内容添加顶部边距，避免被横幅遮挡 */
body {
    padding-top: 0 !important; /* 动态调整 */
    margin: 0 !important;
    overflow-x: hidden !important;
    transition: padding-top 0.3s ease;
}

/* 隐藏横幅时的样式 */
.top-banner.hidden {
    display: none !important;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

body.no-banner {
    padding-top: 0 !important;
}

body.no-banner .navbar {
    top: 0 !important;
} 