/* ===== 紧凑顶栏 ===== */
.top-bar-compact {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(15,15,26,0.82);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--border-light);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.4s var(--ease);
}
[data-theme="light"] .top-bar-compact {
    background: rgba(255,255,255,0.85);
}
.logo-icon { font-size: 1.25em; }
.logo-text { font-size: 1.15em; font-weight: 800; color: var(--accent); letter-spacing: 0.5px; }

/* 顶栏编辑模式 */
.top-bar-edit { justify-content: space-between; }
.text-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 2px;
    transition: color 0.2s var(--ease);
}
.text-btn:active { color: var(--accent); }
.text-btn-accent { color: var(--accent); }
.top-title { font-size: 1em; font-weight: 700; }

/* ===== 页面切换 ===== */
.page { display: none; padding-bottom: 88px; }
.page-active { display: block; animation: pageFadeIn 0.25s var(--ease); }
@keyframes pageFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ===== 欢迎横幅 ===== */
.welcome-banner {
    margin: 16px 24px 4px;
    padding: 24px 24px;
    background: linear-gradient(135deg, rgba(240,112,48,0.12) 0%, rgba(240,112,48,0.04) 60%, var(--bg-card) 100%);
    border: 1px solid rgba(240,112,48,0.15);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s var(--ease);
}
[data-theme="light"] .welcome-banner {
    background: linear-gradient(135deg, rgba(232,98,42,0.08) 0%, rgba(232,98,42,0.02) 60%, var(--bg-card) 100%);
}
.welcome-banner::before {
    content: '\2699';
    position: absolute;
    right: -12px;
    top: -12px;
    font-size: 5em;
    opacity: 0.05;
}
.wb-title { font-size: 1.28em; font-weight: 800; color: var(--accent); margin-bottom: 6px; }
.wb-desc { font-size: 0.84em; color: var(--text-muted); line-height: 1.6; }

/* ===== 广告轮播栏 ===== */
.ad-carousel-wrap {
    margin: 8px 24px 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    transition: all 0.4s var(--ease);
    overflow: hidden;
}
.ad-carousel { position: relative; overflow: hidden; border-radius: var(--radius); height: 100%; }
.ad-track { display: flex; height: 100%; transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.ad-slide {
    min-width: 100%; padding: 16px; display: flex; align-items: center; gap: 14px;
    box-sizing: border-box; cursor: default;
}
.ad-slide-body { flex: 1; min-width: 0; }
.ad-slide-title { font-size: 1em; font-weight: 700; color: var(--text-primary); white-space: nowrap; }
.ad-slide-desc { font-size: 0.8em; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-slide-info {
    background: linear-gradient(135deg, rgba(99,102,241,0.12) 0%, rgba(59,130,246,0.08) 100%);
}
.ad-slide-event {
    background: linear-gradient(135deg, rgba(244,63,94,0.10) 0%, rgba(251,146,60,0.08) 100%);
}
.ad-slide-icon { font-size: 2.2em; line-height: 1; }


.ad-dots {
    position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 6px;
}
.ad-dot {
    width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted);
    opacity: 0.4; transition: all 0.3s;
}
.ad-dot.active { opacity: 1; background: var(--accent); width: 16px; border-radius: 3px; }

/* ===== 分类标签 ===== */
.quick-cats {
    display: flex;
    gap: 8px;
    padding: 16px 24px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.quick-cats::-webkit-scrollbar { display: none; }
.cat-chip {
    flex-shrink: 0;
    padding: 8px 20px;
    border-radius: 24px;
    font-size: 0.86em;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid var(--border-strong);
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: all 0.25s var(--ease);
    box-shadow: var(--shadow-sm);
}
.cat-chip:active { transform: scale(0.95); transition: transform 0.1s; }
.cat-chip.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 2px 16px var(--accent-glow);
}
.sub-cats {
    display: flex;
    gap: 6px;
    padding: 0 24px;
    margin-bottom: 4px;
}
.sub-chip {
    font-size: 0.78em;
    padding: 4px 10px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    opacity: 0.85;
}
.sub-chip.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    opacity: 1;
}

/* ===== 排序标签 ===== */
.sort-tabs { display: flex; gap: 0; padding: 12px 24px 0; }
.sort-tab {
    padding: 8px 18px;
    font-size: 0.84em;
    font-weight: 600;
    color: var(--text-dim);
    cursor: pointer;
    border-bottom: 2.5px solid transparent;
    transition: all 0.25s var(--ease);
}
.sort-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ===== 区块标题 ===== */
.section-title {
    padding: 24px 24px 10px;
    font-size: 0.78em;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
}


/* ===== 首页广告+快捷卡片行 ===== */
.home-cards-row {
    display: flex;
    gap: 8px;
    padding: 8px 24px 0;
    align-items: stretch;
}
/* 新版广告栏卡片 */
.home-banner-card {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}
.home-banner-card:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}
.home-banner-info {
    background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, rgba(59,130,246,0.05) 100%);
}
.home-banner-event {
    background: linear-gradient(135deg, rgba(244,63,94,0.08) 0%, rgba(251,146,60,0.05) 100%);
}
.hbc-icon {
    font-size: 1.8em;
    flex-shrink: 0;
}
.hbc-text {
    flex: 1;
    min-width: 0;
}
.hbc-title {
    font-size: 0.95em;
    font-weight: 700;
    color: var(--text-primary);
}
.hbc-desc {
    font-size: 0.75em;
    color: var(--text-muted);
    margin-top: 2px;
}

.home-ad-wrap {
    flex: 1;
    min-width: 0;
    margin: 0 !important;
}
.home-ad-wrap {
    flex: 1;
    min-width: 0;
    margin: 0 !important;  /* 覆盖 ad-carousel-wrap 原有 margin */
}
.home-quick-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}
.home-quick-card {
    width: 64px;
    height: 64px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    position: relative;
    box-shadow: var(--shadow-sm);
}
.home-quick-card:active {
    transform: scale(0.95);
    background: var(--bg-hover);
}
.home-card-icon {
    width: 22px;
    height: 22px;
    opacity: 0.7;
}
.home-card-label {
    font-size: 0.7em;
    font-weight: 700;
    color: var(--text-muted);
}
.home-card-search .home-card-icon { opacity: 0.85; color: var(--accent); }
.home-msg-dot {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff4d4f;
}

/* ===== 搜索页 ===== */
.search-back-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}
.search-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 0 14px;
    gap: 8px;
    height: 36px;
}
.search-input-icon {
    width: 16px;
    height: 16px;
    opacity: 0.4;
    flex-shrink: 0;
}
.search-input-wrap input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.9em;
    padding: 0;
}
.search-input-wrap input::placeholder {
    color: var(--text-dim);
}
.search-go-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 0 16px;
    font-size: 0.85em;
    font-weight: 700;
    cursor: pointer;
    height: 36px;
    flex-shrink: 0;
    transition: opacity 0.15s;
}
.search-go-btn:active { opacity: 0.8; }
.search-cats {
    display: flex;
    gap: 8px;
    padding: 12px 24px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.search-cats::-webkit-scrollbar { display: none; }

/* QQ授权等待动画 */
.qq-spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: qq-spin 0.8s linear infinite;
}
@keyframes qq-spin { to { transform: rotate(360deg); } }
#qq-wait-overlay {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
