/* ========== B站风格配色系统 ========== */
:root {
    --bilibili-pink: #FB7299;
    --bilibili-blue: #00A1D6;
    --primary-color: #FB7299;
    --bg-color: #F4F4F4;
    --card-bg: #FFFFFF;
    --text-primary: #212121;
    --text-secondary: #757575;
    --border-color: #E0E0E0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* ========== 全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    padding-bottom: calc(65px + env(safe-area-inset-bottom)); /* 底部导航栏高度 */
    overflow-x: hidden;
}

.top-stack {
    position: sticky;
    top: 0;
    z-index: 120;
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    gap: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* ========== 顶部栏 ========== */
.top-bar {
    position: relative;
    background: var(--card-bg);
    padding: 5px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    box-shadow: none;
    overflow: hidden;
}

.logo {
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
}

.logo-img {
    height: 26px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
    display: block;
}

@media (min-width: 768px) {
    .logo-img {
        height: 48px;
        max-width: 320px;
    }
}

@media (max-width: 360px) {
    .logo-img {
        height: 26px;
        max-width: 200px;
    }
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
    flex-wrap: nowrap;
}

.top-help-btn {
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.035);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 800;
    padding: 7px 10px;
    border-radius: 999px;
    cursor: pointer;
    flex: 0 0 auto;
    min-height: 38px;
    white-space: nowrap;
}

.top-help-btn:active {
    transform: scale(0.98);
}

.top-search {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.035);
    min-width: 180px;
    flex: 1;
    min-width: 0;
    min-height: 38px;
    overflow: hidden;
    flex-basis: 0;
}

.top-search-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--text-secondary);
    opacity: 0.7;
}

.top-search-input {
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    width: auto;
    flex: 1;
    min-width: 0;
    flex-basis: 0;
}

.top-search-input::placeholder {
    color: var(--text-secondary);
}

.top-search-clear {
    border: none;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-secondary);
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
    visibility: hidden;
    pointer-events: none;
}

.top-search-clear.is-visible{
    visibility: visible;
    pointer-events: auto;
}

.top-search-clear svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
}

.top-search-clear:active {
    transform: scale(0.94);
}

.top-search-btn {
    border: none;
    background: var(--primary-color);
    color: white;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 999px;
    cursor: pointer;
    min-height: 30px;
}

.top-search-btn:active {
    transform: scale(0.96);
}

/* ========== 分类栏（横向滚动）========== */
.category-scroll-container {
    position: relative;
    background: var(--card-bg);
    padding: 3px 0;
    box-shadow: none;
    overflow: hidden;
    overflow-y: hidden;
    padding-right: 48px; /* 右侧留出"下拉更多"按钮空间 */
    touch-action: pan-x;
    overscroll-behavior-x: contain;
}

.category-list {
    display: flex;
    gap: 8px;
    padding: 0 12px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: none;
    /* 隐藏滚动条 */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* 分类栏右侧下拉按钮 */
.category-more-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 5;
}

.category-more-btn:active {
    transform: translateY(-50%) scale(0.96);
}

/* 分类下拉面板 */
.category-dropdown-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 35000;
    padding: 12px;
}

.category-dropdown-panel {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.category-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}

.category-dropdown-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.category-dropdown-close {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: rgba(0, 0, 0, 0.03);
    cursor: pointer;
    color: var(--text-secondary);
}

.category-dropdown-grid {
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.category-dropdown-grid .category-btn {
    width: 100%;
    justify-content: center;
}

@media (max-width: 480px) {
    .category-dropdown-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ========== 解压密码说明弹窗内容排版 ========== */
.pwd-guide {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pwd-block {
    padding: 14px;
    border-radius: 14px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
}

.pwd-title {
    font-size: 15px;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.pwd-line {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.pwd-code {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 900;
}

.pwd-note {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
}

.pwd-sub {
    margin-top: 4px;
    font-size: 14px;
    font-weight: 900;
    color: var(--text-primary);
}

.pwd-paragraph {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.category-list::-webkit-scrollbar {
    display: none;
}

.category-btn {
    flex-shrink: 0;
    padding: 4px 10px;
    background: white;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    line-height: 1.2;
}

.category-btn:active,
.category-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.category-btn:not(.active):hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ========== 主内容区 ========== */
.main-content {
    padding: 6px;
    min-height: calc(100vh - 200px);
}

@media (min-width: 768px) {
    /* PC 两侧留白，形成“侧边栏”空间 */
    .main-content {
        max-width: 1240px;
        margin: 0 auto;
        padding: 22px 56px;
    }
}
/* ========== 顶部Banner ========== */
.top-banner {
    width: 100%;
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.top-banner.is-fallback{
    background: var(--card-bg);
    cursor: default;
}

.top-banner-fallback-single{
    position: relative;
    width: 100%;
}

.top-banner-fallback-single-thumb{
    width: 100%;
    aspect-ratio: 16 / 9;
    background: rgba(0,0,0,0.035);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.top-banner-fallback-single-img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.top-banner-fallback-single-title{
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 12px;
    background: linear-gradient(180deg, rgba(0,0,0,0.00) 0%, rgba(0,0,0,0.55) 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-banner-fallback{
    padding: 10px;
}

.top-banner-fallback-track{
    display: flex;
    align-items: stretch;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.top-banner-fallback-track::-webkit-scrollbar{display:none;}

.top-banner-fallback-card{
    flex: 0 0 148px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    padding: 0;
    text-align: left;
    cursor: pointer;
}

.top-banner-fallback-card:active{transform: scale(0.99);}

.top-banner-fallback-thumb{
    width: 100%;
    height: 86px;
    background: rgba(0,0,0,0.035);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.top-banner-fallback-thumb img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.top-banner-fallback-emoji{
    font-size: 34px;
    line-height: 1;
}

.top-banner-fallback-title{
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-banner img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.top-banner:active {
    transform: scale(0.99);
    transition: transform 0.1s;
}
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 6px;
}

/* ========== 游戏卡片 ========== */
.game-card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.game-card:hover {
    box-shadow: var(--shadow-hover);
}

.game-card:active {
    transform: scale(0.99);
}

.game-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    position: relative;
}

/* 封面中心“水滴波纹”引导（叠在图片上方，常驻，轻量） */
.game-image::before,
.game-image::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    transform: translate(-50%, -50%) scale(0.6);
    opacity: 0;
    z-index: 2;
    pointer-events: none;
}

.game-image::before {
    animation: cardRipple 1.8s ease-out infinite;
}

.game-image::after {
    animation: cardRipple 1.8s ease-out infinite;
    animation-delay: 0.9s;
}

@keyframes cardRipple {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 0.5;
    }
    100% {
        transform: translate(-50%, -50%) scale(4.5);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .game-image::before,
    .game-image::after {
        animation: none;
        opacity: 0;
    }
}

.game-category-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    max-width: calc(100% - 16px);
    padding: 4px 8px;
    border-radius: 8px;
    background: var(--primary-color);
    color: white;
    font-size: 11px;
    font-weight: 700;
    box-shadow: var(--shadow);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 3;
}

.game-top-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    border-radius: 8px;
    background: var(--bilibili-blue);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    box-shadow: var(--shadow);
    z-index: 3;
}

.game-image img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-info {
    padding: 10px;
}

.game-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.game-footer {
    padding: 0 10px 10px;
    display: flex;
    gap: 6px;
}

.card-download-btn {
    width: 100%;
    border: none;
    background: var(--primary-color);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: var(--shadow);
}

.card-download-btn-half {
    flex: 1;
    min-width: 0;
    gap: 4px;
}

.card-download-btn:active {
    transform: scale(0.98);
}

.card-download-btn.is-disabled {
    background: #bdbdbd;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
}

.btn-icon svg {
    width: 16px;
    height: 16px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ========== B站风格底部导航栏 ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 0;
    transition: all 0.3s;
    color: var(--text-secondary);
    position: relative;
}

.nav-item:active {
    transform: scale(0.9);
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}

.nav-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    fill: none;
    stroke: currentColor;
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
}

/* 中间大按钮（PWA安装）*/
.nav-center {
    position: relative;
    margin-top: -20px;
}

/* 下载引导流光圈 */
.nav-center::before,
.nav-center::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 66px;
    height: 66px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.nav-center::before {
    border: 2px solid rgba(251, 114, 153, 0.55);
    box-shadow: 0 0 0 0 rgba(251, 114, 153, 0.45);
    animation: navRingPulse 1.6s ease-out infinite;
}

.nav-center::after {
    background: conic-gradient(from 0deg, transparent 0deg, rgba(251, 114, 153, 0.85) 50deg, transparent 110deg);
    mask: radial-gradient(closest-side, transparent 62%, #000 63%);
    -webkit-mask: radial-gradient(closest-side, transparent 62%, #000 63%);
    animation: navRingSweep 2.1s linear infinite;
    opacity: 0.9;
}

@keyframes navRingPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.92);
        opacity: 0.9;
        box-shadow: 0 0 0 0 rgba(251, 114, 153, 0.35);
    }
    70% {
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 0;
        box-shadow: 0 0 0 14px rgba(251, 114, 153, 0);
    }
    100% {
        opacity: 0;
    }
}

@keyframes navRingSweep {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.center-plus {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), #FF6B9D);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(251, 114, 153, 0.4);
    transition: all 0.3s;
}

.center-plus .center-icon {
    width: 24px;
    height: 24px;
    display: block;
    stroke: #fff;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.nav-center:active .center-plus {
    transform: scale(0.9);
}

.center-plus span {
    font-size: 28px;
    color: white;
    font-weight: 300;
}

/* ========== 模态框 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-radius: 20px 20px 0 0;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.modal-header {
    position: sticky;
    top: 0;
    background: var(--card-bg);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: var(--bg-color);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 详情页底部下载按钮常驻区 */
.modal-footer {
    position: sticky;
    bottom: 0;
    background: var(--card-bg);
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

.modal-footer .download-btn {
    margin-top: 10px;
}

.modal-image {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 16px;
}

.modal-section {
    margin-bottom: 20px;
}

.modal-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.modal-section p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.download-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.download-btn:active {
    transform: scale(0.98);
    filter: brightness(0.95);
}

/* ========== 响应式设计 ========== */
@media (min-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 18px;
    }

    .game-image {
        height: 220px;
        font-size: 72px;
    }
    
    .bottom-nav {
        display: none; /* PC端隐藏底部导航 */
    }
    
    body {
        padding-bottom: 0;
    }
    
    .modal-content {
        max-width: 500px;
        left: 50%;
        transform: translateX(-50%);
        bottom: auto;
        top: 50%;
        transform: translate(-50%, -50%);
        border-radius: 20px;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }
    
    .game-image {
        aspect-ratio: 16 / 9;
        height: auto;
    }
}

/* ========== 加载更多（不闪烁）========== */
.load-more {
    grid-column: 1/-1;
    display: flex;
    justify-content: center;
    padding: 18px 0;
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 14px;
}

/* ========== 弹窗和广告样式（保留兼容性）========== */
.floating-ad-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 40000;
    backdrop-filter: blur(5px);
}

.floating-ad {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 40001;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: popupFadeIn 0.3s ease;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.floating-ad img {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 20px;
}

.floating-ad-content {
    color: #333;
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.floating-ad-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.floating-ad-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

.custom-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 40001;
    max-width: 500px;
    width: 90%;
    animation: popupSlide 0.3s ease;
}

/* 小屏优化：顶部搜索更紧凑 */
@media (max-width: 480px) {
    .top-bar {
        padding: 5px 10px;
    }

    .logo {
        font-size: 18px;
    }

    .top-search-input {
        width: auto;
    }

    .top-actions {
        gap: 6px;
    }

    .top-help-btn {
        padding: 6px 9px;
        font-size: 11px;
        min-height: 36px;
    }

    .top-search {
        padding: 6px 8px;
        min-height: 36px;
        gap: 4px;
    }

    .top-search-btn {
        padding: 6px 10px;
        min-height: 28px;
        font-size: 12px;
    }

}

@keyframes popupSlide {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}
