/* 同城聊 H5 组件 */

/* 首页头部色块延伸 */
.home-page {
    background: var(--cm-bg);
}

.home-header-bg {
    padding-bottom: 8px;
}

@media (max-width: 767px) {
    /* 首页：顶栏与轮播区同色衔接，去掉中间空白带 */
    .community-body[data-nav="home"] .community-main {
        background: linear-gradient(180deg, var(--cm-primary) 0%, var(--cm-primary) 32px, var(--cm-bg) 120px);
    }

    .community-body[data-nav="home"] .home-header-bg {
        background: transparent;
        padding-top: 0;
        margin-top: 0;
    }

    .community-body[data-nav="home"] .banner-section {
        padding-top: 0;
    }

    .community-body[data-nav="home"] .community-header {
        padding-bottom: 8px;
    }
}

@media (min-width: 768px) {
    .home-header-bg {
        background: var(--cm-bg);
        padding-top: 0;
    }
}

/* 轮播 */
.banner-section {
    padding: 0 0 12px;
}

@media (min-width: 768px) {
    .banner-section {
        padding: 0 0 16px;
    }
}

.banner-carousel {
    border-radius: var(--cm-radius);
    overflow: hidden;
    box-shadow: var(--cm-shadow);
}

.banner-carousel .carousel-inner > .item > img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

@media (min-width: 768px) {
    .banner-carousel .carousel-inner > .item > img {
        height: 280px;
    }
}

.banner-placeholder {
    height: 160px;
    background: var(--cm-card-bg);
    border-radius: var(--cm-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cm-text-muted);
    font-size: 14px;
    box-shadow: var(--cm-shadow);
}

@media (min-width: 768px) {
    .banner-placeholder {
        height: 280px;
    }
}

/* 菜单宫格 */
.menu-section {
    background: var(--cm-card-bg);
    border-radius: var(--cm-radius);
    padding: 16px 8px 12px;
    box-shadow: var(--cm-shadow);
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 12px;
}

@media (min-width: 768px) {
    .menu-section {
        margin-bottom: 16px;
    }
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px 4px;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--cm-text);
}

.menu-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    overflow: hidden;
}

.menu-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.menu-icon-text {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}

.menu-label {
    font-size: 12px;
    text-align: center;
    line-height: 1.3;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 推荐区块 */
.recommend-section {
    padding-bottom: 16px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 12px;
}

@media (min-width: 768px) {
    .recommend-section {
        margin-bottom: 16px;
    }
}

.section-card {
    background: var(--cm-card-bg);
    border-radius: var(--cm-radius);
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: var(--cm-shadow);
}

.section-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--cm-text);
    margin: 0;
}

.section-card-more {
    font-size: 13px;
    color: var(--cm-text-muted);
    text-decoration: none;
}

.section-card-more:hover {
    color: var(--cm-primary);
}

.recommend-placeholder {
    padding: 24px;
    text-align: center;
    color: var(--cm-text-muted);
    font-size: 13px;
    background: var(--cm-bg);
    border-radius: var(--cm-radius-sm);
}

/* 通用卡片列表项（后续模块复用） */
.cm-card {
    background: var(--cm-card-bg);
    border-radius: var(--cm-radius);
    box-shadow: var(--cm-shadow);
    margin-bottom: 12px;
    overflow: hidden;
}

.cm-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--cm-text-muted);
}

.cm-empty .fa {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

/* 主色按钮 */
.btn-community {
    background: var(--cm-primary);
    border-color: var(--cm-primary);
    color: #fff;
}

/* 城市选择弹层 */
.city-picker {
    padding: 12px 16px 16px;
}

.city-picker-search {
    margin-bottom: 12px;
}

.city-picker-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 50vh;
    overflow-y: auto;
}

.city-picker-item {
    display: inline-block;
    padding: 8px 16px;
    background: var(--cm-bg);
    border-radius: 20px;
    color: var(--cm-text);
    font-size: 14px;
    text-decoration: none;
    border: 1px solid transparent;
}

.city-picker-item.active,
.city-picker-item:hover {
    background: var(--cm-primary-light);
    color: var(--cm-primary);
    border-color: var(--cm-primary);
}

/* 发布中心 */
.publish-page {
    padding: 12px 0 24px;
}

.page-card {
    margin-bottom: 12px;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 6px;
}

.page-desc {
    margin: 0;
    font-size: 13px;
}

.publish-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.publish-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--cm-card-bg);
    border-radius: var(--cm-radius);
    padding: 16px;
    box-shadow: var(--cm-shadow);
    text-decoration: none;
    color: var(--cm-text);
}

.publish-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    flex-shrink: 0;
}

.publish-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.publish-meta span {
    font-size: 12px;
    color: var(--cm-text-muted);
}

.publish-arrow {
    color: var(--cm-text-muted);
    font-size: 18px;
}

/* 我的 */
.my-page {
    padding-bottom: 24px;
}

.my-header {
    background: linear-gradient(135deg, var(--cm-primary) 0%, #00b5bf 100%);
    padding: 32px 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: #fff;
}

@media (min-width: 768px) {
    .my-header {
        border-radius: var(--cm-radius);
        margin-bottom: 16px;
    }
}

.my-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    object-fit: cover;
}

.my-nickname {
    font-size: 20px;
    margin: 0 0 6px;
    color: #fff;
}

.my-bio {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85) !important;
}

.my-menu {
    margin-top: -12px;
    position: relative;
    z-index: 1;
}

.my-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--cm-card-bg);
    padding: 14px 16px;
    margin-bottom: 1px;
    color: var(--cm-text);
    text-decoration: none;
    box-shadow: var(--cm-shadow);
}

.my-menu-item:first-child {
    border-radius: var(--cm-radius) var(--cm-radius) 0 0;
}

.my-menu-item:last-child {
    border-radius: 0 0 var(--cm-radius) var(--cm-radius);
    margin-bottom: 12px;
}

.my-menu-item .fa:first-child {
    width: 20px;
    text-align: center;
    color: var(--cm-primary);
}

.my-menu-logout {
    border-radius: var(--cm-radius) !important;
    color: #e74c3c;
}

.my-menu-logout .fa {
    color: #e74c3c !important;
}

/* 搜索 */
.search-page {
    padding: 12px 0 24px;
}

.search-form {
    margin-bottom: 8px;
}

.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--cm-card-bg);
    border-radius: 24px;
    padding: 8px 12px 8px 16px;
    box-shadow: var(--cm-shadow);
}

.search-input-wrap .fa-search {
    color: var(--cm-text-muted);
}

.search-input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    min-width: 0;
}

.recommend-block {
    margin-bottom: 12px;
}

.rec-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cm-bg);
    color: var(--cm-text-muted);
}

/* 动态推荐 */
.rec-feed-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rec-feed-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-decoration: none;
    color: var(--cm-text);
}

.rec-feed-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.rec-feed-body {
    flex: 1;
    min-width: 0;
}

.rec-feed-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.rec-feed-text {
    font-size: 13px;
    color: var(--cm-text-secondary);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rec-feed-time {
    font-size: 12px;
    color: var(--cm-text-muted);
    margin-top: 4px;
}

.rec-feed-cover {
    width: 56px;
    height: 56px;
    border-radius: var(--cm-radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

/* 分类信息横向卡片 */
.rec-card-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
    padding-bottom: 4px;
}

.rec-card-scroll::-webkit-scrollbar {
    display: none;
}

.rec-info-row {
    display: flex;
    gap: 10px;
    padding: 0 4px;
}

.rec-info-card {
    flex: 0 0 140px;
    width: 140px;
    text-decoration: none;
    color: var(--cm-text);
    border-radius: var(--cm-radius-sm);
    overflow: hidden;
    background: var(--cm-bg);
}

@media (min-width: 768px) {
    .rec-info-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    .rec-info-card {
        flex: none;
        width: auto;
    }
}

.rec-info-cover {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.rec-info-body {
    padding: 8px 10px 10px;
}

.rec-info-title {
    font-size: 13px;
    line-height: 1.4;
    height: 36px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 6px;
}

.rec-info-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 12px;
}

.rec-info-cate {
    color: var(--cm-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rec-info-price {
    color: #ff6b35;
    font-weight: 600;
    flex-shrink: 0;
}

/* 活动推荐 */
.rec-activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rec-activity-item {
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: var(--cm-text);
}

.rec-activity-cover {
    width: 88px;
    height: 66px;
    border-radius: var(--cm-radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.rec-activity-body {
    flex: 1;
    min-width: 0;
}

.rec-activity-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rec-activity-meta {
    font-size: 12px;
    color: var(--cm-text-muted);
}

/* 交友推荐 */
.rec-friend-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 12px;
}

@media (min-width: 768px) {
    .rec-friend-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.rec-friend-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--cm-text);
}

.rec-friend-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 6px;
}

.rec-friend-name {
    font-size: 12px;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
