/* 首页特定样式 */
.home-content {
    background-color: var(--background-color);
}

/* 标签栏 */
.tab-container {
    background-color: var(--card-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 44px;
    z-index: 10;
}

.tab-bar {
    display: flex;
    height: 44px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar {
    display: none;
}

.tab-item {
    flex: 1;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary-color);
    font-size: 14px;
    position: relative;
    transition: all 0.3s ease;
}

.tab-item.active {
    color: var(--primary-color);
    font-weight: 600;
}

.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* 帖子列表 */
.post-list {
    padding: 8px 0;
}

.post-item {
    background-color: var(--card-color);
    margin-bottom: 8px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.post-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.post-user-info {
    flex: 1;
}

.post-username {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-color);
    margin-bottom: 2px;
}

.post-time {
    font-size: 12px;
    color: var(--text-secondary-color);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.post-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary-color);
}

.post-location .iconify {
    font-size: 12px;
}

.post-content {
    padding: 0 16px 12px;
    font-size: 15px;
    line-height: 1.4;
    color: var(--text-color);
}

/* 图片网格 */
.post-images {
    padding: 0 16px 12px;
}

.image-grid {
    display: grid;
    gap: 4px;
}

.image-grid.single {
    grid-template-columns: 1fr;
}

.image-grid.double {
    grid-template-columns: 1fr 1fr;
}

.image-grid.triple {
    grid-template-columns: 1fr 1fr 1fr;
}

.image-grid.quad {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.image-grid.many {
    grid-template-columns: 1fr 1fr 1fr;
}

.post-image {
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* 转发预览 */
.repost-preview {
    margin: 0 16px 12px;
    padding: 12px;
    background-color: var(--background-color);
    border-radius: 8px;
    font-size: 14px;
}

.repost-link {
    text-decoration: none;
    color: var(--text-secondary-color);
}

.repost-link:hover {
    text-decoration: none;
}

/* 帖子操作栏 */
.post-actions {
    padding: 8px 16px 12px;
    display: flex;
    justify-content: space-around;
    gap: 24px;
    border-top: 1px solid var(--border-color);
    margin-left: 4px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    background: none;
    border: none;
    padding: 8px 0;
    color: var(--text-secondary-color);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    color: var(--primary-color);
}

.action-btn.liked {
    color: var(--danger-color);
}

.action-btn.favorited {
    color: var(--accent-color);
}

.action-icon {
    font-size: 18px;
    margin-right: 6px;
}

.action-count {
    font-size: 13px;
}

/* 三个点更多菜单 */
.more-menu-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-secondary-color);
    font-size: 18px;
}

.more-menu-dropdown {
    position: absolute;
    right: 16px;
    top: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 160px;
    z-index: 100;
    overflow: hidden;
    display: none;
}

.more-menu-dropdown.show {
    display: block;
}

.more-menu-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.more-menu-item:hover {
    background: #f5f5f5;
}

.more-menu-item.topped {
    color: #ff9500;
}

.more-menu-item.essenced {
    color: #ff2d55;
}

.more-menu-item.danger {
    color: #e54d4d;
}

.more-menu-item svg {
    margin-right: 10px;
    font-size: 18px;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-text {
    font-size: 15px;
    color: var(--text-secondary-color);
    margin-bottom: 8px;
}

.empty-subtext {
    font-size: 13px;
    color: var(--text-secondary-color);
    opacity: 0.8;
}

/* 加载更多 */
.load-more {
    padding: 20px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary-color);
}

.load-more-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px 24px;
    border-radius: 20px;
    color: var(--primary-color);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background-color: rgba(0, 122, 255, 0.1);
}

/* 下拉刷新 */
.pull-refresh {
    position: relative;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-secondary-color);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.pull-refresh.active {
    transform: translateY(0);
}

/* 适配暗黑模式 */
@media (prefers-color-scheme: dark) {
    .post-item {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }
}

/* 响应式调整 */
@media (max-width: 320px) {
    .post-header {
        padding: 10px 12px;
    }
    
    .post-content {
        padding: 0 12px 10px;
        font-size: 14px;
    }
    
    .post-images {
        padding: 0 12px 10px;
    }
    
    .repost-preview {
        margin: 0 12px 10px;
        padding: 10px;
        font-size: 13px;
    }
    
    .post-actions {
        padding: 6px 12px 10px;
        margin-left: 4px;
    }
    
    .action-btn {
        padding: 6px 0;
        font-size: 13px;
    }
    
    .action-icon {
        font-size: 16px;
        margin-right: 4px;
    }
    
    .post-image {
        cursor: pointer;
    }
}

/* 位置卡片样式 */
.moment-location-card {
    margin: 0 16px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.moment-location-card:hover {
    background: rgba(0, 122, 255, 0.05);
    border-color: rgba(0, 122, 255, 0.2);
}

.location-pin {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.location-pin svg {
    width: 14px;
    height: 14px;
    fill: #E53935;
    vertical-align: middle;
}

.location-text {
    font-size: 13px;
    color: var(--text-color);
}

/* 位置链接（IP定位等无精准坐标时显示） */
.moment-location-link {
    margin: 0 16px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.moment-location-link:active {
    opacity: 0.7;
}

/* 图片查看器样式 */
.image-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.image-viewer-overlay.show {
    opacity: 1;
    visibility: visible;
}

.image-viewer-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.image-viewer-close {
    position: absolute;
    top: max(env(safe-area-inset-top), 20px);
    right: 20px;
    width: 44px;
    height: 44px;
    background: #e53935;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    border: none;
    box-shadow: 0 2px 8px rgba(229, 57, 53, 0.4);
}

.image-viewer-close svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

.image-viewer-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.image-viewer-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 16px;
    border-radius: 20px;
}

.image-viewer-prev,
.image-viewer-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.image-viewer-prev {
    left: 20px;
}

.image-viewer-next {
    right: 20px;
}

.image-viewer-prev::before {
    content: '';
    width: 12px;
    height: 12px;
    border-left: 3px solid #fff;
    border-bottom: 3px solid #fff;
    transform: rotate(45deg);
    margin-left: 4px;
}

.image-viewer-next::before {
    content: '';
    width: 12px;
    height: 12px;
    border-right: 3px solid #fff;
    border-top: 3px solid #fff;
    transform: rotate(45deg);
    margin-right: 4px;
}