/* 同城聊 H5 布局 */

.community-body {
    background: var(--cm-bg);
    color: var(--cm-text);
    min-height: 100vh;
    padding-top: 0;
    padding-bottom: 0;
}

@media (min-width: 768px) {
    .community-body {
        padding-bottom: 0;
        padding-top: var(--cm-pc-nav-height);
    }
}

.community-container {
    max-width: var(--cm-container-max);
    margin: 0 auto;
    padding: 0 12px;
}

.community-main {
    min-height: calc(100vh - var(--cm-tabbar-height) - var(--cm-header-height));
}

@media (min-width: 768px) {
    .community-main {
        min-height: calc(100vh - var(--cm-pc-nav-height) - 60px);
        padding: 16px 0 32px;
    }
}

/* 手机顶栏 */
.community-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, var(--cm-primary) 0%, #00b5bf 100%);
    padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 10px;
}

.community-header-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.community-header .city-select {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
}

.community-header .search-entry {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 20px;
    padding: 8px 14px;
    color: var(--cm-text-muted);
    font-size: 13px;
    text-decoration: none;
}

.community-header .search-entry .fa {
    font-size: 14px;
}

.community-header .search-entry-full {
    flex: 1;
    max-width: 100%;
}

.community-header-no-city .community-header-inner {
    justify-content: stretch;
}

/* PC 顶栏 */
.community-pc-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: #fff;
    box-shadow: var(--cm-shadow);
}

.community-pc-nav-inner {
    display: flex;
    align-items: center;
    height: var(--cm-pc-nav-height);
}

.community-pc-nav .brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--cm-text);
    text-decoration: none;
    margin-right: 24px;
    white-space: nowrap;
}

.brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--cm-primary);
}

.pc-nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    gap: 4px;
}

.pc-nav-list li a {
    display: block;
    position: relative;
    padding: 8px 14px;
    color: var(--cm-text-secondary);
    font-size: 14px;
    text-decoration: none;
    border-radius: var(--cm-radius-sm);
    transition: color 0.2s, background 0.2s;
}

.pc-nav-list li a .fa {
    margin-right: 4px;
}

.pc-nav-badge {
    display: inline-block;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    padding: 0 4px;
    margin-left: 4px;
    font-size: 10px;
    font-style: normal;
    text-align: center;
    color: #fff;
    background: #ff4757;
    border-radius: 8px;
    vertical-align: top;
}

.pc-nav-list li.active a,
.pc-nav-list li a:hover {
    color: var(--cm-primary);
    background: var(--cm-primary-light);
}

.pc-nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.city-select-pc {
    color: var(--cm-text-secondary);
    font-size: 14px;
    text-decoration: none;
}

.city-select-pc:hover {
    color: var(--cm-primary);
}

.avatar-xs {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.btn-community-outline {
    color: var(--cm-primary) !important;
    border-color: var(--cm-primary) !important;
    background: transparent !important;
}

.btn-community-outline:hover {
    background: var(--cm-primary-light) !important;
}

/* 手机底栏 */
.community-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    border-top: 1px solid var(--cm-border);
    padding-bottom: var(--cm-safe-bottom);
}

.tabbar-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: var(--cm-tabbar-height);
    max-width: var(--cm-container-max);
    margin: 0 auto;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 0;
    color: var(--cm-text-muted);
    text-decoration: none;
    font-size: 11px;
}

.tab-item .tab-icon {
    font-size: 20px;
    margin-bottom: 2px;
}

.tab-item.active {
    color: var(--cm-primary);
}

.tab-item-mid {
    position: relative;
    top: -12px;
}

.tab-mid-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cm-primary) 0%, #00b5bf 100%);
    color: #fff;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(0, 195, 206, 0.4);
    margin-bottom: 2px;
}

.tab-item-mid.active .tab-mid-btn {
    transform: scale(1.05);
}

/* PC 页脚 */
.community-footer {
    text-align: center;
    padding: 24px 16px;
    color: var(--cm-text-muted);
    font-size: 13px;
    background: #fff;
    border-top: 1px solid var(--cm-border);
}

.community-footer a {
    color: var(--cm-text-muted);
}

/* 手机底栏占位（避免 fixed 底栏遮挡内容） */
@media (max-width: 767px) {
    .community-tabbar-gap {
        height: var(--cm-tabbar-gap);
        flex-shrink: 0;
        pointer-events: none;
    }
}

/* 无手机底栏 */
@media (max-width: 767px) {
    .community-no-tabbar.community-body {
        padding-bottom: 0;
    }

    .community-no-mobile-header .community-main {
        min-height: calc(100vh - var(--cm-tabbar-gap));
    }

    .community-no-tabbar .community-main,
    .community-no-tabbar.community-no-mobile-header .community-main {
        min-height: 100vh;
    }
}

/* 聊天全屏（无顶栏、无底栏） */
@media (max-width: 767px) {
    .community-body.community-chat-mode {
        padding-bottom: 0;
        height: 100dvh;
        height: 100vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .community-body.community-chat-mode .community-main {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
}
