/* === 首页 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: var(--gradient-accent);
    color: #fff;
    box-shadow: 0 14px 28px rgba(255,111,60,0.26);
    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, #ff9a54 0%, #ff7a46 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; }

/* === 贡献排行 === */
.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: var(--secondary);
    color: #fff;
    border-color: var(--secondary);
}
.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)); }
}
@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: 12px; }
    .home-recommend-cover img { height: 140px; }
    .home-recommend-body { padding: 10px 12px 12px; }
    .home-recommend-title { font-size: 14px; }
}
@media (max-width: 480px) {
    .home-recommend-grid { grid-template-columns: 1fr; }
}
