/* 首页样式 */
.home-page {
    background: #f8f9fa;
    min-height: 100vh;
    padding-bottom: 80px; /* 为底部导航留出空间 */
}

/* Banner 区域 */
.banner-section {
    background: linear-gradient(135deg, #1ABC9C 0%, #16A085 100%);
    color: white;
    padding: 20px 20px 30px;
    border-radius: 0 0 20px 20px;
    margin-bottom: 20px;
    /* 避免状态栏遮挡 */
    padding-top: max(20px, env(safe-area-inset-top));
}

.banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.greeting-text {
    flex: 1;
    min-width: 150px;
}

.greeting-text h1 {
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.greeting-text p {
    font-size: 14px;
    margin: 0;
    opacity: 0.9;
    line-height: 1.3;
}

.progress-info {
    display: flex;
    gap: 20px;
    flex-shrink: 0;
}

.progress-item {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.progress-label {
    font-size: 12px;
    opacity: 0.8;
    white-space: nowrap;
}

.progress-value {
    font-size: 18px;
    font-weight: bold;
    white-space: nowrap;
}

/* 快捷功能区 */
.quick-actions {
    margin: 0 20px 30px;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 15px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.action-item {
    background: white;
    border-radius: 12px;
    padding: 18px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.action-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.action-item:active {
    transform: translateY(0);
}

.action-icon {
    font-size: 24px;
    line-height: 1;
}

.action-label {
    font-size: 12px;
    color: #2c3e50;
    text-align: center;
    font-weight: 500;
    line-height: 1.2;
}

/* 社区动态 */
.community-section {
    margin: 0 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.view-more {
    font-size: 14px;
    color: #1ABC9C;
    cursor: pointer;
    text-decoration: none;
}

.view-more:hover {
    text-decoration: underline;
}

.posts-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.post-item {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.3s ease;
}

.post-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1ABC9C;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
}

.post-user-info {
    flex: 1;
}

.post-username {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 2px;
}

.post-time {
    font-size: 12px;
    color: #7f8c8d;
}

.post-content {
    font-size: 14px;
    line-height: 1.5;
    color: #2c3e50;
    margin-bottom: 10px;
}

.post-image {
    width: 100%;
    height: 120px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.post-image:hover {
    transform: scale(1.02);
}

.post-image-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.post-image-icon {
    font-size: 36px;
    line-height: 1;
}

.post-image-label {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-align: center;
}

.post-actions {
    display: flex;
    gap: 20px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.post-action {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #7f8c8d;
    cursor: pointer;
    transition: color 0.3s ease;
}

.post-action:hover {
    color: #1ABC9C;
}

.post-action-icon {
    font-size: 14px;
}

/* 加载更多 */
.load-more {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
    font-size: 14px;
}

.load-more-btn {
    background: #1ABC9C;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background: #16A085;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .banner-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .greeting-text {
        width: 100%;
        text-align: center;
    }
    
    .progress-info {
        justify-content: center;
    }
    
    .actions-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    .action-item {
        padding: 15px 8px;
    }
    
    .action-icon {
        font-size: 22px;
    }
    
    .action-label {
        font-size: 11px;
    }
}

@media (max-width: 360px) {
    .banner-section {
        padding: 15px 15px 25px;
    }
    
    .greeting-text h1 {
        font-size: 20px;
    }
    
    .progress-value {
        font-size: 16px;
    }
    
    .actions-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .action-item {
        padding: 12px 6px;
    }
    
    .action-icon {
        font-size: 20px;
    }
    
    .action-label {
        font-size: 10px;
    }
    
    .quick-actions,
    .community-section {
        margin: 0 15px 25px;
    }
}

/* 滚动优化 */
.home-page {
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
}

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #7f8c8d;
    font-size: 14px;
}

.loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #1ABC9C;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 安全区域适配 */
@supports (padding: env(safe-area-inset-top)) {
    .home-page {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }
}
