/* ==================== 主题变量 ==================== */
:root {
    --app-color-primary: #1989fa;
    --app-color-primary-dark: #3f7efc;
    --app-color-admin: #283593;
    --app-text-color: #323233;
    --app-text-color-secondary: #646566;
    --app-text-color-tertiary: #969799;
    --app-text-color-placeholder: #999;
    --app-bg-color: #f5f5f5;
    --app-bg-color-light: #f7f8fa;
    --app-border-color: #f0f0f0;
}

/* ==================== 页面布局 ==================== */

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100vh;
    background-color: var(--app-bg-color);
}

.app-container.app-container-no-nav {
    /* 无导航栏页面保留顶部安全区，避免首页/登录页内容贴到状态栏 */
    padding-top: constant(safe-area-inset-top);
    padding-top: env(safe-area-inset-top);
}

.app-nav-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}

.app-header {
    background: linear-gradient(135deg, var(--app-color-primary) 0%, var(--app-color-primary-dark) 100%);
    padding: 16px;
    color: white;
    min-height: 80px;
}

.app-content {
    flex: 1;
    min-height: 0;
    padding: 0;
    overflow-y: auto;
    padding-bottom: 12px;
    padding-bottom: calc(12px + constant(safe-area-inset-bottom));
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

.bottom-action-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    gap: 12px;
    padding: 12px 0;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    background: #fff;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
}

.bottom-action-bar .van-button {
    flex: 1;
}

/* ==================== 通用列表与卡片 ==================== */





.card {
    position: relative;
    overflow: hidden;
    background: #fff;
    box-shadow: none;
    transition: background-color 0.2s;
}

.card:active {
    background-color: #f7f8fa;
}

.card-content {
    overflow: hidden;
    padding: 16px;
    background: #fff;
}



.card-section {
    padding: 20px 16px;
    background: #fff;
    box-shadow: none;
}





.card-title {
    padding: var(--van-cell-group-title-padding);
    color: var(--van-cell-group-title-color);
    font-size: var(--van-cell-group-title-font-size);
    line-height: var(--van-cell-group-title-line-height);
}

.card-header > .card-title {
    flex: 1;
    min-width: 0;
    margin-right: 12px;
    padding: 0;
    overflow: hidden;
    color: #323233;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-row {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #646566;
    font-size: 13px;
}

.card-row + .card-row {
    margin-top: 6px;
}



.stats-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--van-primary-color);
}

.stats-label {
    font-size: 12px;
    color: var(--app-text-color-tertiary);
}



.stat-card,
.target-card {
    padding: 16px 8px;
    text-align: center;
}

.stat-value,
.target-value {
    margin-bottom: 4px;
    color: var(--app-color-primary);
    font-size: 24px;
    font-weight: 600;
}

.stat-label,
.target-label {
    color: var(--app-text-color-placeholder);
    font-size: 12px;
}

.card-actions {
    display: flex;
    border-top: 1px solid #f0f0f0;
}

.card-btn {
    flex: 1;
    padding: 12px 0;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.card-btn:active {
    background-color: #f5f5f5;
}

.card-btn + .card-btn {
    border-left: 1px solid #f0f0f0;
}

/* ==================== 通用颜色 ==================== */

.profile-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 0;
}

.profile-card-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--app-text-color);
}

.building-stats .stat-item,
.community-stats .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.building-stats .stat-value,
.community-stats .stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #323233;
}

.building-stats .stat-label,
.community-stats .stat-label {
    font-size: 12px;
    color: #969799;
}

.primary-color {
    color: var(--van-primary-color);
}

.success-color {
    color: var(--van-success-color);
}

.warning-color {
    color: var(--van-warning-color);
}

.danger-color {
    color: var(--van-danger-color);
}

/* ==================== 通用标题 ==================== */

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--app-text-color);
    font-size: 16px;
    font-weight: 600;
}

/* ==================== 加载状态 ==================== */

.loading-center {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

/* ==================== 全屏 Tabs 布局 ==================== */

.tabs-page {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f7f8fa;
}

.tabs-full {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tabs-full .van-sticky,
.tabs-full .van-tabs__wrap {
    flex-shrink: 0;
}

.tabs-full .van-tabs__content {
    flex: 1;
    min-height: 0;
    display: flex;
    overflow: hidden;
}

.tabs-full .van-tab__panel {
    display: flex;
    flex: 1;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.tabs-panel {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.tabs-empty {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f7f8fa;
}

/* ==================== 通用卡片区块 ==================== */

.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin-bottom: 12px;
}

.card-section {
    margin: 0 16px 12px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* ==================== 通用 Banner ==================== */

.header-banner {
    background: linear-gradient(135deg, #1989fa 0%, #3f7efc 100%);
    padding: 40px 20px 32px;
    color: white;
    border-radius: 0 0 24px 24px;
}

.header-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.header-subtitle {
    font-size: 14px;
    opacity: 0.9;
}

/* ==================== 通用统计数字 ==================== */

.stat-num {
    display: block;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
}

.stat-desc,
.stat-label {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}

/* ==================== 积分颜色 ==================== */

.score-positive {
    color: #07c160;
}

.score-negative {
    color: #ee0a24;
}

/* ==================== 排名徽章 ==================== */

.ranking-order {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: #edf4ff;
    color: #1989fa;
    flex-shrink: 0;
}

.rank-1 {
    background: #fff4d6;
    color: #c58b00;
}

.rank-2 {
    background: #eef2f7;
    color: #6b7785;
}

.rank-3 {
    background: #fdeee4;
    color: #c96e36;
}

/* ==================== 通用空提示 ==================== */

.empty-tip {
    text-align: center;
    color: #999;
    font-size: 14px;
    padding: 20px 0;
}

/* ==================== 通用加载居中 ==================== */

.my-4 {
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

/* ==================== 通用上传标签 ==================== */

.upload-label {
    margin-bottom: 8px;
    color: #646566;
    font-size: 14px;
}

/* ==================== 通用退出按钮 ==================== */

:deep(.logout-cell .van-cell__title) {
    color: var(--van-danger-color, #ee0a24);
}

/* ==================== 通用记录列表项 ==================== */

.record-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f2f3f5;
}

.record-item:last-child {
    border-bottom: none;
}

.record-info {
    flex: 1;
    min-width: 0;
}

.record-name {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.record-time {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.record-score {
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ==================== 通用卡片底栏 ==================== */

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f2f3f5;
}
