/* === 首页 Hero 区域 === */
.home-hero { position: relative; overflow: hidden; }
.home-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(255,255,255,0.18), transparent 34%),
        radial-gradient(circle at right center, rgba(255,214,102,0.18), transparent 28%);
    pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }

/* Hero 搜索框 —— 覆盖 frontend.css 的普通搜索框样式 */
.home-hero .hero-search-box {
    max-width: 640px;
    margin: 0 auto 20px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}
.home-hero .hero-search-box form { display: block; }
.home-hero .hero-search-switches {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 14px;
}
.home-hero .hero-search-switch {
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.18);
    color: #fff;
    border-radius: var(--radius-full);
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
}
.home-hero .hero-search-switch:hover,
.home-hero .hero-search-switch.active {
    background: #fff;
    color: #163047;
    border-color: #fff;
    box-shadow: 0 10px 24px rgba(255,255,255,0.18);
}
.home-hero .hero-search-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 6px 6px 6px 12px;
    border-radius: var(--radius-xl);
    background: rgba(255,255,255,0.98);
    border: 1px solid rgba(255,255,255,0.9);
    box-shadow: 0 18px 40px rgba(8,15,28,0.14);
}
.home-hero .hero-search-input-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    color: #7c8a97;
    font-size: 15px;
}
.home-hero .hero-search-box input {
    min-width: 0;
    border: 0;
    padding: 12px 0;
    border-radius: 0;
    background: transparent;
    color: #163047;
    font-size: 14px;
    box-shadow: none;
}
.home-hero .hero-search-box input::placeholder { color: #7a8794; }
.home-hero .hero-search-submit,
.home-hero .hero-search-box button.hero-search-submit {
    width: auto;
    height: 44px;
    padding: 0 16px;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-deep) 100%);
    color: #fff;
    box-shadow: 0 14px 28px rgba(16,118,110,0.28);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
}
.home-hero .hero-search-submit::after { content: '搜索'; margin-left: 6px; }
.home-hero .hero-search-submit:hover,
.home-hero .hero-search-box button.hero-search-submit:hover {
    background: linear-gradient(135deg, #26a368 0%, #155f50 100%);
    transform: translateY(-1px);
}

/* === 首页推荐区块 === */
.home-recommend-section { padding-top: 30px; padding-bottom: 30px; }
.home-recommend-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
}
.home-recommend-tab {
    border: 2px solid #e2e8f0;
    background: #fff;
    color: var(--text-soft);
    border-radius: var(--radius-md);
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all .24s ease;
}
.home-recommend-tab:hover { border-color: var(--color-brand); color: var(--color-brand); }
.home-recommend-tab.active {
    background: var(--color-brand);
    color: #fff;
    border-color: var(--color-brand);
    box-shadow: 0 8px 24px rgba(31,118,101,.24);
}
.home-recommend-panel { display: none; }
.home-recommend-panel.active { display: block; }

/* === 推荐网格 === */
.home-recommend-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}
.home-recommend-card {
    display: block;
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform .24s ease, box-shadow .24s ease;
    text-decoration: none;
    color: inherit;
}
.home-recommend-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.home-recommend-cover { position: relative; overflow: hidden; }
.home-recommend-cover::after {
    content: '';
    position: absolute;
    inset: auto 0 0;
    height: 40%;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.45) 100%);
    pointer-events: none;
}
.home-recommend-cover img { width: 100%; height: 180px; object-fit: cover; display: block; }
.home-recommend-cover .difficulty-badge { position: absolute; top: 10px; right: 10px; z-index: 1; }
.home-recommend-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
.home-recommend-badge.is-free { background: rgba(16,185,129,0.92); }
.home-recommend-badge.is-paid { background: rgba(249,115,22,0.92); }
.home-recommend-body { padding: 14px 16px 16px; }
.home-recommend-title {
    margin: 0 0 8px;
    font-size: 15px;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.home-recommend-meta { display: flex; gap: 14px; color: #6b7280; font-size: 13px; margin-bottom: 10px; }
.home-recommend-footer { display: flex; gap: 16px; color: #9ca3af; font-size: 12px; }
.home-recommend-footer .home-recommend-stat:first-child { margin-right: auto; }
.home-recommend-stat { display: inline-flex; align-items: center; gap: 4px; }

/* === 最新线路：查看更多按钮 === */
.new-routes-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: #fff;
    border: 1px dashed #cdd9e3;
    border-radius: var(--radius);
    color: var(--color-brand);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s ease;
}
.new-routes-more:hover {
    border-color: var(--color-brand);
    border-style: solid;
    background: #f2faf7;
}
.new-routes-more i {
    transition: transform .2s ease;
}
.new-routes-more:hover i {
    transform: translateX(4px);
}

/* === 首页最新活动组队 === */
.activity-list-home {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}
.activity-card-home {
    display: block;
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform .24s ease, box-shadow .24s ease;
    text-decoration: none;
    color: inherit;
}
.activity-card-home:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.activity-card-home-cover { position: relative; overflow: hidden; }
.activity-card-home-cover img { width: 100%; height: 180px; object-fit: cover; display: block; }
.home-activity-placeholder {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8f5e9;
    color: #4caf50;
    font-size: 48px;
}
.home-activity-status {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
.home-activity-status.status-0 { background: rgba(16,185,129,0.92); }
.home-activity-status.status-1 { background: rgba(249,115,22,0.92); }
.home-activity-status.status-2 { background: rgba(156,163,175,0.92); }
.home-activity-status.status-3 { background: rgba(59,130,246,0.92); }
.home-activity-status.status-4 { background: rgba(156,163,175,0.92); }
.home-activity-status.status-5 { background: rgba(239,68,68,0.92); }
.home-activity-featured {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(249,115,22,0.92);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
.activity-card-home-body { padding: 14px 16px 16px; }
.home-activity-type {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 4px;
    background: #e8f5e9;
    color: #388e3c;
    font-size: 12px;
    margin-bottom: 8px;
}
.activity-card-home-body h4 {
    margin: 0 0 10px;
    font-size: 15px;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.home-activity-meta {
    display: flex;
    gap: 14px;
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.home-activity-footer { display: flex; gap: 16px; color: #9ca3af; font-size: 12px; }
.home-activity-author { display: inline-flex; align-items: center; gap: 4px; }
.home-activity-footer .home-activity-author { margin-right: auto; }
.home-activity-cost { display: inline-flex; align-items: center; }
.home-activity-cost .cost-free { color: #10b981; font-weight: 700; }
.home-activity-cost .cost-paid { color: #f97316; font-weight: 700; }


/* === 贡献排行 === */
.contribution-rank-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-lg);
    padding: 14px;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(15,23,42,.04);
}
.contribution-rank-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.rank-tab {
    flex: 1;
    justify-content: center;
    background: #fff;
    color: var(--text-soft);
    border: 1px solid #dbe3ef;
}
.rank-tab.active {
    background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-deep) 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 16px rgba(16,118,110,0.22);
}
.rank-list { display: none; gap: 10px; }
.rank-list.active { display: grid; }
.rank-item { display: flex; align-items: center; gap: 10px; }
.rank-no {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background: var(--text-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.rank-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.rank-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rank-info strong,
.rank-info strong a { color: var(--text-primary); text-decoration: none; }
.rank-info span { color: var(--text-soft); font-size: 12px; }

.new-routes-section,
.col-side { display: flex; flex-direction: column; }
.col-side { align-self: flex-start; }
.home-route-list { flex: 1; }
.contribution-rank-card { flex: 0 0 auto; }

.page-first, .page-last { font-size: 13px; padding: 6px 10px; }
.page-dots { padding: 6px 4px; color: #9ca3af; }

/* === 响应式 === */
@media (max-width: 1024px) {
    .home-recommend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .activity-list-home { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .home-hero .hero-search-box { padding: 0; }
    .home-hero .hero-search-switches { gap: 8px; margin-bottom: 12px; }
    .home-hero .hero-search-switch { padding: 7px 14px; font-size: 13px; }
    .home-hero .hero-search-main {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 6px;
        padding: 5px 5px 5px 10px;
        border-radius: 16px;
    }
    .home-hero .hero-search-box input { padding: 10px 0; font-size: 14px; }
    .home-hero .hero-search-submit,
    .home-hero .hero-search-box button.hero-search-submit {
        min-width: 48px;
        height: 40px;
        padding: 0 12px;
        border-radius: 12px;
    }
    .home-hero .hero-search-submit::after { content: ''; margin-left: 0; }

    .home-recommend-tabs { gap: 8px; margin-bottom: 20px; }
    .home-recommend-tab { padding: 10px 20px; font-size: 14px; border-radius: 10px; }
    .home-recommend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .home-recommend-cover img { height: 110px; }
    .home-recommend-body { padding: 8px 10px 10px; }
    .home-recommend-title { font-size: 13px; margin-bottom: 6px; }
    .home-recommend-meta { gap: 8px; font-size: 11px; margin-bottom: 6px; }
    .home-recommend-footer { gap: 10px; font-size: 10px; flex-wrap: wrap; }
    .new-routes-more { padding: 12px; font-size: 13px; }
    .activity-list-home { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .activity-card-home-cover img,
    .home-activity-placeholder { height: 140px; }
    .activity-card-home-body { padding: 10px 12px 12px; }
    .activity-card-home-body h4 { font-size: 14px; }
}
@media (max-width: 480px) {
    .home-recommend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .home-recommend-cover img { height: 92px; }
    .home-recommend-body { padding: 6px 8px 8px; }
    .home-recommend-title { font-size: 12px; margin-bottom: 4px; }
    .home-recommend-meta { font-size: 10px; }
    .home-recommend-footer { font-size: 9px; gap: 8px; }
    .activity-list-home { grid-template-columns: 1fr; }
}

/* === 通用：视觉隐藏（SEO h1） === */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* === 有 Banner 首页：搜索框叠加到 Banner 底部 === */
.banner-section .home-search-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 18px;
    z-index: 6;
    background: transparent;
    padding: 0;
    box-shadow: none;
}
.banner-section .home-search-bar .hero-search-switch {
    background: rgba(15, 118, 110, 0.55);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(4px);
}
.banner-section .home-search-bar .hero-search-switch:hover,
.banner-section .home-search-bar .hero-search-switch.active {
    background: #fff;
    color: var(--color-brand-deep);
    border-color: #fff;
}
.banner-section .home-search-bar .hero-search-box { margin-bottom: 0; }
.banner-section .home-search-bar .hero-search-box button,
.banner-section .home-search-bar .hero-search-box button.hero-search-submit {
    background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-deep) 100%);
    box-shadow: none;
}
.banner-section .home-search-bar .hero-search-box button:hover {
    background: linear-gradient(135deg, #26a368 0%, #155f50 100%);
    transform: scale(1.05);
}
@media (max-width: 768px) {
    .banner-section .home-search-bar { bottom: 10px; }
    .banner-section .home-search-bar .hero-search-switch { padding: 6px 14px; font-size: 13px; }
}

/* === 通用动画 === */
@keyframes hwFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* === 有 Banner 首页：轻量轮播 === */
.banner-section .swiper-slide { display: none; touch-action: pan-y; }
.banner-section .swiper-slide:first-child { display: block; }
.banner-section.js-banner-active .swiper-slide { display: none; }
.banner-section.js-banner-active .swiper-slide.active { display: block; animation: hwFadeIn .5s ease; }
.banner-section .swiper-wrapper { position: relative; }
.banner-section .swiper-pagination {
    position: absolute;
    top: 16px;
    left: 0;
    right: 0;
    z-index: 7;
    display: flex;
    justify-content: center;
    gap: 8px;
}
.banner-section .swiper-pagination .banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: all .3s ease;
    border: none;
    padding: 0;
}
.banner-section .swiper-pagination .banner-dot.active {
    width: 22px;
    border-radius: 5px;
    background: #fff;
}

/* === 公告轮播 === */
.notice-scroll a:first-child { display: block; flex: 1; }
.notice-scroll.js-rotating a { display: none; }
.notice-scroll.js-rotating a.active { display: block; flex: 1; animation: hwFadeIn .45s ease; }

/* === 精选圈子文章：封面缩略图 === */
.circle-posts-two-col-layout .circle-post-item {
    display: flex;
    gap: 12px;
    align-items: center;
}
.circle-posts-two-col-layout .post-title-row {
    margin-bottom: 0;
}
.circle-posts-two-col-layout .post-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #eef1f5;
}
.circle-posts-two-col-layout .post-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8f6f1, #d3ece2);
    color: #1f7665;
    font-size: 22px;
    text-decoration: none;
}
.circle-posts-two-col-layout .post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.circle-posts-two-col-layout .post-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* === 推荐 tab / 排行 tab 切换动画 === */
.home-recommend-panel.active { animation: hwFadeIn .35s ease; }
.rank-list.active { animation: hwFadeIn .3s ease; }
