/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: #f9f9f9;
    color: #333333;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

input, select {
    font-family: inherit;
    font-size: inherit;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 8px 12px;
    transition: all 0.3s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: #FF5A5F;
    box-shadow: 0 0 0 1px #FF5A5F;
}

/* 核心容器：彻底顶对齐 + 全局基线重置 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    /* 消除容器自身的对齐问题 */
    line-height: 1;
}

/* 全局容器内元素强制顶对齐 */
.container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    /* 强制所有元素基线对齐 */
    vertical-align: top;
}

/* 排序栏整体样式修复 */
.sort-container {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
}
.sort-container .sort-label {
    color: #666;
    font-size: 14px;
    white-space: nowrap;
}
/* 排序按钮组修复 */
.sort-btns {
    display: flex;
    gap: 8px;
}
.sort-btn {
    padding: 6px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.sort-btn.active {
    background: #1890FF;
    color: #fff;
    border-color: #1890FF;
}
.sort-btn:hover:not(.active) {
    border-color: #1890FF;
    color: #1890FF;
}
/* 小区数量文本修复 */
.count-text {
    color: #999;
    font-size: 14px;
    margin: 0 8px;
}
.count-text .num {
    color: #1890FF;
    font-weight: 500;
}
/* 视图切换按钮修复 */
.view-switch {
    display: flex;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-left: auto; /* 靠右对齐 */
}
.view-switch-btn {
    padding: 6px 16px;
    background: #fff;
    color: #666;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}
.view-switch-btn.active {
    background: #f5f5f5;
    color: #1890FF;
    font-weight: 500;
}
.view-switch-btn:first-child {
    border-right: 1px solid #e0e0e0;
}
/* 响应式适配（移动端） */
@media (max-width: 768px) {
    .sort-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .view-switch {
        margin-left: 0;
        margin-top: 8px;
    }
}

/* 颜色变量 */
:root {
    --primary: #FF5A5F;
    --primary-light: rgba(255, 90, 95, 0.1);
    --primary-dark: #e04a4f;
    --secondary: #333333;
    --light: #F5F5F5;
    --border: #E5E5E5;
    --success: #52C41A;
    --warning: #FAAD14;
    --blue: #1890FF;
    --gray-50: #f9f9f9;
    --gray-100: #f0f0f0;
    --gray-200: #e0e0e0;
    --gray-300: #d0d0d0;
    --gray-500: #999999;
    --gray-600: #666666;
    --gray-700: #555555;
}

/* 工具类 */
.text-primary { color: var(--primary); }
.bg-primary { background-color: var(--primary); }
.text-white { color: white; }
.rounded { border-radius: 4px; }
.rounded-full { border-radius: 50%; }
.shadow-card { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }

.space-x-2 > * + * { margin-left: 8px; }
.space-x-3 > * + * { margin-left: 12px; }
.space-x-4 > * + * { margin-left: 16px; }
.space-x-6 > * + * { margin-left: 24px; }
.space-y-2 > * + * { margin-top: 8px; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-8 > * + * { margin-top: 32px; }

.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mt-10 { margin-top: 40px; }

.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }

.w-full { width: 100%; }
.w-16 { width: 4rem; }
.w-20 { width: 5rem; }
.w-9 { width: 2.25rem; }
.h-full { height: 100%; }
.h-9 { height: 2.25rem; }
.h-8 { height: 2rem; }
.h-40 { height: 10rem; }
.h-64 { height: 16rem; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }

.border { border: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.relative { position: relative; }
.absolute { position: absolute; }
.top-2 { top: 8px; }
.left-2 { left: 8px; }
.right-3 { right: 12px; }
.top-1\/2 { top: 50%; }
.transform { transform: translate(-50%, -50%); }
.object-cover { object-fit: cover; }
.overflow-hidden { overflow: hidden; }
.opacity-50 { opacity: 0.5; }
.cursor-not-allowed { cursor: not-allowed; }

.hover\:text-primary:hover { color: var(--primary); }
.hover\:bg-primary\/90:hover { background-color: rgba(255, 90, 95, 0.9); }
.hover\:bg-gray-200:hover { background-color: var(--gray-200); }
.hover\:underline:hover { text-decoration: underline; }
.hover\:border-primary:hover { border-color: var(--primary); }
.hidden { display: none; }

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in-out forwards;
    opacity: 0;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 骨架屏动画 */
.skeleton-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}
@keyframes skeleton-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* 自定义组件样式 */
.filter-btn {
    padding: 4px 12px;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--secondary);
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* 消除按钮自身的偏移 */
    margin-top: 0 !important;
    vertical-align: top;
    transition: all 0.2s ease;
}
.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--primary-light);
}
.filter-btn.active {
    background-color: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* 优化分页按钮间距，解决拥挤问题 */
/* 分页容器整体样式 */
.pagination-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    justify-content: flex-end; /* 靠右对齐（可根据需求改为center） */
    flex-wrap: wrap; /* 移动端自动换行 */
}

/* 分页信息文本（显示1-6个...） */
.pagination-info {
    color: #666;
    font-size: 14px;
    margin-right: auto; /* 文本靠左，分页控件靠右 */
}

/* 翻页箭头按钮 */
.pagination-arrow {
    width: 32px;
    height: 32px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: border-color 0.2s;
}
.pagination-arrow:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.pagination-arrow:hover:not(:disabled) {
    border-color: #1890FF;
    color: #1890FF;
}

/* 页码按钮组 */
.pagination-numbers {
    display: flex;
    gap: 8px;
}
.pagination-number {
    width: 32px;
    height: 32px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s;
}
.pagination-number.active {
    background: #1890FF;
    color: #fff;
    border-color: #1890FF;
}
.pagination-number:hover:not(.active):not(:disabled) {
    border-color: #1890FF;
    color: #1890FF;
}

/* 跳页区域 */
.pagination-jump {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}
.pagination-jump input {
    width: 48px;
    height: 32px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 0 8px;
    text-align: center;
    outline: none;
}
.pagination-jump input:focus {
    border-color: #1890FF;
}
.pagination-jump button {
    height: 32px;
    padding: 0 12px;
    border: 1px solid #1890FF;
    border-radius: 4px;
    background: #1890FF;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}
.pagination-jump button:hover {
    background: #0F7AE5;
}
.pagination-btn {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--secondary);
    margin: 0 2px; /* 适中的间距，避免过挤 */
    transition: all 0.2s ease;
}
.pagination-btn:hover:not(.active):not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}
.pagination-btn.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}
.pagination-btn:disabled {
    color: var(--gray-500);
    cursor: not-allowed;
    opacity: 0.5;
    background-color: var(--gray-100);
}

.btn-primary {
    padding: 6px 16px;
    border-radius: 4px;
    background-color: var(--primary);
    color: white;
    font-size: 0.875rem;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.btn-primary:hover {
    background-color: rgba(255, 90, 95, 0.9);
    transform: translateY(-1px);
}

.btn-light {
    padding: 6px 16px;
    border-radius: 4px;
    background-color: var(--light);
    color: var(--secondary);
    font-size: 0.875rem;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}
.btn-light:hover {
    background-color: var(--gray-200);
    transform: translateY(-1px);
}

.badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 小区卡片样式 */
.community-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.community-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}
.community-card .card-img {
    width: 100%;
    height: 160px;
    overflow: hidden;
    position: relative;
}
.community-card .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block; /* 消除图片底部空白 */
}
.community-card:hover .card-img img {
    transform: scale(1.05);
}
.community-card .card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.community-stat {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-right: 12px;
    margin-bottom: 8px;
}
.community-stat i {
    margin-right: 4px;
    color: var(--gray-500);
    width: 16px;
    text-align: center;
}

/* 热门小区推荐样式 */
.hot-community-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.hot-community-item:last-child { border-bottom: none; }
.hot-community-item:hover {
    background-color: var(--primary-light);
    padding-left: 20px;
}

/* 价格走势样式 */
.price-trend {
    width: 100%;
    height: 120px;
    background-color: var(--light);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}
.trend-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.trend-line::after {
    content: '';
    position: absolute;
    bottom: 30%;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary);
    border-radius: 1px;
}
.trend-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary);
    transform: translate(-50%, 50%);
}

/* 响应式样式 - 修复视图切换问题 */
@media (min-width: 768px) {
    .md-flex { display: flex !important; }
    .md-hidden { display: none !important; }
    .md-flex-row { flex-direction: row !important; }
    .md-items-center { align-items: center !important; }
    .md-w-1\/3 { width: 33.333% !important; padding-right: 16px; }
    .md-w-2\/3 { width: 66.666% !important; padding-left: 16px; }
    .md-w-1\/4 { width: 25%; }
    .md-w-3\/4 { width: 75%; }
    .md-grid { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 20px !important; }
    .md-grid-cols-2 { display: grid !important; grid-template-columns: repeat(2, 1fr) !important; gap: 20px !important; }
    .md-mt-0 { margin-top: 0 !important; }
}

@media (max-width: 767px) {
    .sm-hidden { display: none !important; }
    .sm-flex { display: flex !important; }
    .filter-btn { margin-bottom: 8px; }
    .price-trend { height: 100px; }
    .pagination-controls { flex-wrap: wrap; justify-content: center; }
    .jump-controls {
        margin-left: 0 !important;
        margin-top: 10px;
        width: 100%;
        justify-content: center;
    }
    /* 移动端主内容区顶对齐 */
    .main-content {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    .content-left {
        width: 100% !important;
        margin-bottom: 16px !important;
    }
    /* 移动端网格视图强制1列 */
    #community-list:not(.list-view) {
        grid-template-columns: 1fr !important;
    }
}

/* 底部样式 */
footer {
    background-color: #333;
    color: white;
    margin-top: 40px;
    padding: 40px 0;
    width: 100%;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}
@media (min-width: 768px) {
    .footer-grid { grid-template-columns: repeat(4, 1fr); }
}
.footer-bottom {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #555;
    text-align: center;
    font-size: 0.875rem;
    color: #999;
}

/* 分页容器样式 - 优化间距+顶对齐 */
.pagination-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 20px 16px !important;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    /* 仅保留必要的上间距，取消多余值 */
    margin-top: 20px !important;
    margin-bottom: 0;
}
@media (min-width: 768px) {
    .pagination-container {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    .community-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* 分页控件 - 优化间距 */
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px; /* 适中的间距，避免过挤 */
    margin-top: 16px;
}
@media (min-width: 768px) {
    .pagination-controls { margin-top: 0 !important; }
}
.jump-controls {
    display: flex;
    align-items: center;
    margin-left: 16px;
    gap: 8px;
}
.jump-controls input {
    width: 60px;
    text-align: center;
}

/* 搜索栏样式 - 修复功能+顶对齐 */
.search-bar {
    display: flex;
    align-items: center;
    height: 40px;
    width: 100%;
    max-width: 300px;
    /* 绝对顶对齐 */
    margin-top: 0 !important;
    padding-top: 0 !important;
}
.search-bar input {
    height: 100%;
    padding: 0 16px;
    border-radius: 4px 0 0 4px;
    border: 1px solid var(--border);
    flex: 1;
    width: 100%;
}
.search-bar button {
    height: 100%;
    padding: 0 16px;
    background-color: var(--primary-dark);
    color: white;
    border-radius: 0 4px 4px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.search-bar button:hover {
    background-color: var(--primary);
}

/* 主内容区布局 - 100%顶对齐 */
.main-content {
    display: flex;
    gap: 20px; /* 左右区域间距 */
    margin-top: 20px !important;
    /* 强制顶对齐（优先级最高） */
    align-items: flex-start !important;
    align-content: flex-start !important;
    justify-content: flex-start !important;
    /* 消除任何内边距干扰 */
    padding-top: 0 !important;
    border: 1px solid transparent; /* 消除塌陷 */
}

/* 左侧栏：绝对顶对齐 */
.content-left {
    width: 280px; /* 固定左侧宽度 */
    flex-shrink: 0; /* 防止收缩 */
    /* 清零所有可能的偏移 */
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    /* 强制内部元素顶对齐 */
    display: flex;
    flex-direction: column;
    align-items: flex-start !important;
}

/* 右侧内容区：完全顶对齐 */
.content-right {
    flex: 1 1 auto; /* 右侧自适应 */
    /* 清零所有偏移 */
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    /* 强制内部元素顶对齐 */
    display: flex;
    flex-direction: column;
    align-items: flex-start !important;
}

/* 工具栏样式 - 消除偏移+顶对齐 */
.tool-bar {
    width: 100%;
    margin-bottom: 16px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid var(--border);
    /* 绝对顶对齐 */
    margin-top: 0 !important;
    padding-top: 0 !important;
    /* 内部布局重置 */
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start !important;
    padding: 8px 0;
}

/* 工具栏内部元素顶对齐 */
.tool-bar .sort-options,
.tool-bar .view-options {
    margin-top: 0 !important;
    padding-top: 0 !important;
    display: flex;
    align-items: flex-start !important;
}

/* 筛选面板样式 - 精准顶对齐 */
.filter-panel {
    background-color: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    /* 绝对顶对齐 */
    margin-top: 0 !important;
    padding-top: 16px !important;
    /* 内部元素顶对齐 */
    display: block;
    width: 100%;
}

.filter-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    margin-top: 0 !important;
}

.filter-section {
    margin-bottom: 16px;
    margin-top: 0 !important;
}

/* 筛选按钮组：消除行高干扰 */
.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    /* 顶对齐 */
    align-items: flex-start !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 16px;
}

/* 页面标题样式 - 精准顶对齐 */
.page-header {
    background-color: white;
    padding: 20px 0 !important;
    border-bottom: 1px solid var(--border);
}

.page-header-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    /* 强制顶对齐 */
    align-items: flex-start !important;
    justify-content: flex-start !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* 大屏下页面头部对齐 */
@media (min-width: 768px) {
    .page-header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start !important;
    }
    .page-header-content > div {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    margin-top: 0 !important;
}

.page-subtitle {
    color: var(--gray-600);
    margin-top: 0 !important;
}

/* 导航栏样式 */
header {
    background-color: white;
    border-bottom: 1px solid var(--border);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.nav-list {
    display: flex;
}

.nav-list li {
    margin-right: 24px;
}

.nav-list a {
    font-size: 0.9375rem;
    padding: 8px 0;
    display: inline-block;
}
.nav-list a:hover {
    color: var(--primary);
}
.nav-list a.active {
    color: var(--primary);
    font-weight: 500;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* 视图切换按钮样式 */
.view-toggle {
    display: flex;
    margin-left: 16px;
}

.view-toggle button {
    padding: 4px 8px;
    border: 1px solid var(--border);
    background-color: white;
    transition: all 0.2s ease;
}

.view-toggle button:first-child {
    border-radius: 4px 0 0 4px;
}

.view-toggle button:last-child {
    border-radius: 0 4px 4px 0;
}

.view-toggle button.active-view {
    background-color: var(--primary-light) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}
.view-toggle button:hover:not(.active-view) {
    border-color: var(--gray-300);
    background-color: var(--gray-100);
}

/* 排序按钮样式 */
.sort-options {
    display: flex;
    align-items: center;
}

.sort-btn {
    margin-left: 12px;
    color: var(--gray-600);
    font-size: 0.875rem;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}
.sort-btn:hover {
    color: var(--primary);
    background-color: var(--primary-light);
}
.sort-btn.active {
    color: var(--primary);
    font-weight: 500;
    background-color: var(--primary-light);
}

/* 加载层样式 - 修复转圈问题 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    /* 默认隐藏，避免一直转圈 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

/* 加载中状态（由JS控制） */
.loading-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-100);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 小区网格列表：绝对顶对齐 */
#community-list {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    /* 彻底清零顶部间距 */
    margin-top: 0 !important;
    padding-top: 0 !important;
    /* 消除网格布局的默认偏移 */
    align-content: flex-start !important;
    width: 100%;
}

/* 列表视图样式 - 配合JS切换 */
#community-list.list-view {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
}

/* 列表视图下的卡片样式 */
#community-list.list-view .community-card {
    flex-direction: row !important;
    height: auto !important;
    padding: 8px;
}

/* 列表视图的图片容器 */
#community-list.list-view .community-card .card-img {
    width: 200px !important;
    height: 150px !important;
    flex-shrink: 0;
    margin-right: 16px;
}

/* 列表视图的卡片内容 */
#community-list.list-view .community-card .card-body {
    flex: 1;
    padding: 8px 16px;
}

/* 大屏下网格视图恢复默认 */
@media (min-width: 768px) {
    #community-list:not(.list-view) {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 18px !important;
    }
    /* 网格视图卡片恢复默认样式 */
    #community-list:not(.list-view) .community-card {
        flex-direction: column !important;
        height: 100% !important;
    }
    #community-list:not(.list-view) .community-card .card-img {
        width: 100% !important;
        height: 160px !important;
        margin-right: 0 !important;
    }
}

/* 小屏下列表视图适配 */
@media (max-width: 767px) {
    #community-list.list-view .community-card .card-img {
        width: 150px !important;
        height: 120px !important;
    }
    /* 小屏网格视图强制1列 */
    #community-list:not(.list-view) {
        grid-template-columns: 1fr !important;
    }
}

/* 确保视图切换按钮样式生效 */
.view-toggle button.active-view {
    background-color: var(--primary-light) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

/* Toast全局提示样式 */
#globalToast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 关注按钮样式 */
.follow-btn {
    transition: all 0.2s ease;
}
.follow-btn.followed {
    color: var(--warning);
    border-color: var(--warning);
}
.follow-btn.followed:hover {
    background-color: rgba(250, 173, 20, 0.1);
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 加载中状态 */
.community-card.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* 空数据提示样式 */
.empty-tip {
    grid-column: 1/-1;
    padding: 40px;
    text-align: center;
    color: var(--gray-500);
}
.empty-tip i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    color: var(--gray-300);
}
.empty-tip p {
    font-size: 16px;
    margin-bottom: 8px;
}
.empty-tip .text-sm {
    font-size: 14px;
    color: var(--gray-400);
}

/* 标签样式 */
.bg-primary { background-color: var(--primary); }
.bg-warning { background-color: var(--warning); }
.bg-blue { background-color: var(--blue); }

/* 标题栏样式 */
.page-header {
    background-color: var(--primary);
    padding: 24px 0;
    width: 100%;
}
.page-header-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
@media (min-width: 768px) {
    .page-header-content { flex-direction: row; align-items: center; }
}
.page-title {
    color: white;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 8px;
}
.page-subtitle {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
}

/* 导航栏样式 */
header {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}
.nav-list {
    display: flex;
    align-items: center;
    list-style: none;
}
.nav-list li { margin-right: 24px; }
.nav-list li a { font-size: 15px; font-weight: 500; }
.nav-actions { display: flex; align-items: center; }

/* 标题栏样式 */
.page-header {
    background-color: var(--primary);
    padding: 24px 0;
    width: 100%;
}
.page-header-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
@media (min-width: 768px) {
    .page-header-content { flex-direction: row; align-items: center; }
}
.page-title {
    color: white;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 8px;
}
.page-subtitle {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
}

/* 搜索栏样式（关联到header中的搜索功能） */
.search-bar {
    display: flex;
    align-items: center;
    height: 40px;
    width: 100%;
    max-width: 300px;
}
.search-bar input {
    height: 100%;
    padding: 0 16px;
    border-radius: 4px 0 0 4px;
    border: none;
    flex: 1;
    width: 100%;
}
.search-bar button {
    height: 100%;
    padding: 0 16px;
    background-color: var(--primary-dark);
    color: white;
    border-radius: 0 4px 4px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 分页容器整体布局修复 */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between; /* 信息左对齐，控件右对齐 */
    padding: 16px 0;
    flex-wrap: wrap; /* 移动端自动换行，避免溢出 */
    gap: 12px; /* 元素间距，防止拥挤 */
}

/* 分页信息文本样式优化 */
.pagination-container .text-sm {
    color: #666;
    font-size: 14px;
    margin: 0; /* 清除默认边距 */
}
.pagination-container .text-primary {
    color: #1890FF; /* 主色突出数量 */
    font-weight: 500;
}

/* 分页控件核心布局 */
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px; /* 按钮/输入框间距统一 */
    flex-wrap: wrap; /* 小屏适配 */
}

/* 分页按钮通用样式（上一页/下一页/页码） */
.pagination-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 14px;
    transition: all 0.2s ease;
    padding: 0; /* 清除默认内边距 */
}
/* 选中页码样式 */
.pagination-btn.active {
    background: #1890FF;
    color: #fff;
    border-color: #1890FF;
}
/* 禁用状态样式 */
.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
/* 非禁用hover效果 */
.pagination-btn:hover:not(:disabled):not(.active) {
    border-color: #1890FF;
    color: #1890FF;
}

/* 页码按钮容器 */
.page-number-container {
    display: flex;
    gap: 8px; /* 页码之间的间距 */
}

/* 跳页控件布局 */
.jump-controls {
    display: flex;
    align-items: center;
    gap: 6px; /* 文本/输入框/按钮间距 */
}
/* 跳页输入框样式 */
.jump-controls input {
    width: 48px;
    height: 32px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 0 8px;
    text-align: center;
    font-size: 14px;
    outline: none;
}
/* 输入框聚焦样式 */
.jump-controls input:focus {
    border-color: #1890FF;
}
/* 确定按钮样式 */
.jump-controls .btn-light {
    height: 32px;
    padding: 0 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #f9f9f9;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}
.jump-controls .btn-light:hover {
    background: #f0f0f0;
    border-color: #1890FF;
    color: #1890FF;
}

/* 移动端适配（768px以下） */
@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column; /* 纵向排列 */
        align-items: flex-start; /* 左对齐 */
    }
    .pagination-controls {
        width: 100%; /* 占满宽度 */
        justify-content: flex-start; /* 左对齐 */
    }
}

/* 工具栏整体容器 */
.tool-bar {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0; /* 底部分隔线，区分内容区 */
}

.tool-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* 移动端自动换行 */
    gap: 12px; /* 排序区和视图区的间距（小屏生效） */
}

/* 排序选项区域 */
.sort-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* 排序按钮过多时自动换行 */
    gap: 8px; /* 排序标签与按钮、按钮之间的间距 */
}

.sort-options .text-sm {
    color: #666;
    font-size: 14px;
    white-space: nowrap; /* 排序标签不换行 */
}

/* 排序按钮样式 */
.sort-btn {
    padding: 6px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-btn.active {
    background: #1890FF;
    color: #fff;
    border-color: #1890FF;
}

.sort-btn:hover:not(.active) {
    border-color: #1890FF;
    color: #1890FF;
}

/* 视图选项区域 */
.view-options {
    display: flex;
    align-items: center;
    gap: 12px; /* 数量文本和视图切换的间距 */
    flex-wrap: wrap; /* 小屏适配 */
}

.view-options .text-sm {
    color: #999;
    font-size: 14px;
    white-space: nowrap; /* 数量文本不换行 */
}

.view-options .text-primary {
    color: #1890FF;
    font-weight: 500;
}

/* 视图切换按钮容器 */
.view-toggle {
    display: flex;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden; /* 圆角生效，隐藏按钮边框 */
}

/* 视图切换按钮样式 */
.view-toggle .btn-light {
    padding: 6px 16px;
    border: none; /* 清除默认边框，用外层容器边框统一 */
    background: #fff;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.view-toggle .btn-light.active {
    background: #f5f5f5;
    color: #1890FF;
    font-weight: 500;
}

.view-toggle .btn-light:not(.active):hover {
    color: #1890FF;
    background: #fafafa;
}

/* 移除按钮默认边距/内边距 */
.view-toggle .btn-light i {
    margin-right: 4px; /* 图标与文字间距 */
}

/* 移动端适配（768px以下） */
@media (max-width: 768px) {
    .tool-bar-content {
        flex-direction: column; /* 纵向排列 */
        align-items: flex-start; /* 左对齐 */
    }
    .view-options {
        width: 100%; /* 占满宽度 */
        justify-content: space-between; /* 数量文本左，视图切换右 */
    }
    .sort-options {
        width: 100%; /* 排序区占满宽度 */
    }
}
/* 视图选项区域 - 重点修复垂直居中 */
.view-options {
    display: flex;
    align-items: center; /* 强制子元素垂直居中 */
    gap: 12px; /* 数量文本和视图切换的间距 */
    flex-wrap: wrap; /* 小屏适配 */
    line-height: 1; /* 清除文字默认行高干扰 */
    height: 34px; /* 与按钮高度一致（按钮：6px上下内边距 + 22px文字行高 = 34px） */
}

.view-options .text-sm {
    color: #999;
    font-size: 14px;
    white-space: nowrap; /* 数量文本不换行 */
    margin: 0; /* 清除默认边距 */
    padding: 0; /* 清除默认内边距 */
    display: flex;
    align-items: center; /* 文字自身垂直居中 */
    height: 100%; /* 继承容器高度，确保对齐 */
}

.view-options .text-primary {
    color: #1890FF;
    font-weight: 500;
}

/* 视图切换按钮容器 */
.view-toggle {
    display: flex;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden; /* 圆角生效，隐藏按钮边框 */
    height: 34px; /* 与view-options容器高度一致 */
}

/* 视图切换按钮样式 - 确保高度匹配 */
.view-toggle .btn-light {
    padding: 6px 16px;
    border: none; /* 清除默认边框，用外层容器边框统一 */
    background: #fff;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    height: 100%; /* 填满容器高度 */
    display: flex;
    align-items: center; /* 图标+文字垂直居中 */
}