/* ========== index.css - 首页样式 ========== */

/* ========== 排序栏（最新/热门） ========== */
.sort-bar {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 12px 6px;
    display: flex;
    gap: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* ========== 搜索状态栏 ========== */
.search-status-bar {
    max-width: 600px;
    margin: 0 auto;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(16, 185, 129, 0.08);
    border-bottom: 1px solid rgba(16, 185, 129, 0.15);
}

.search-status-bar .search-label {
    color: #6b7d95;
    font-size: 14px;
}

.search-status-bar .search-keyword {
    color: #10b981;
    font-size: 14px;
    font-weight: 600;
    flex: 1;
}

.search-status-bar .clear-search-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.search-status-bar .clear-search-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.sort-btn {
    padding: 8px 16px 10px;
    border: none;
    background: none;
    color: #6b7d95;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.25s;
    position: relative;
}

.sort-btn::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 24px;
    height: 2px;
    background: #10b981;
    border-radius: 2px;
    transition: transform 0.25s;
}

.sort-btn:hover {
    color: #cbd5e1;
}

.sort-btn.active {
    color: #e2e8f0;
}

.sort-btn.active::after {
    transform: translateX(-50%) scaleX(1);
}

/* ========== 公告栏 ========== */
.announcement-bar {
    max-width: 600px;
    margin: 0 auto 8px;
    padding: 0 12px;
}

.announcement-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
    color: #a7f3d0;
}

.announcement-inner i.fa-bullhorn {
    color: #10b981;
    flex-shrink: 0;
}

.announcement-inner span {
    flex: 1;
    line-height: 1.5;
}

.announcement-close {
    background: none;
    border: none;
    color: #6b7d95;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: color 0.2s;
    flex-shrink: 0;
}

.announcement-close:hover {
    color: #e2e8f0;
}

/* ========== 主内容区 ========== */
main {
    max-width: 600px;
    margin: 0 auto;
    padding: 14px 12px;
}

/* ========== 帖子卡片 ========== */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 14px;
    margin-bottom: 14px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
}

.card:active {
    transform: scale(0.985);
}

/* ========== 帖子内部结构样式 ========== */
.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.post-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #10b981, #34d399);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

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

.post-author {
    color: #e2e8f0;
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

.post-meta {
    color: var(--emerald);
    font-size: 12px;
    margin: 0;
}

.post-time {
    color: #94a3b8;
    font-size: 13px;
    flex-shrink: 0;
}

/* ========== 媒体类型图标 ========== */
.media-type-icon {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #94a3b8;
    font-size: 16px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.06);
    padding: 5px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
}

.media-type-icon i {
    font-size: 15px;
}

/* ========== 操作栏 ========== */
.post-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin-top: 2px;
}

.post-actions .action-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 10px;
    transition: background 0.2s, color 0.2s;
    color: #94a3b8;
    font-weight: 500;
}

.action-btn:hover {
    background: rgba(255,255,255,0.06);
}

.action-btn i {
    font-size: 16px;
}

/* 展开按钮 - 绿色 */
.action-btn.expand-btn {
    color: #10b981;
    padding-left: 4px;
}

/* 点赞按钮 - 动态颜色 */
.action-btn.like-btn {
    color: #94a3b8;
}

.action-btn.like-btn.liked {
    color: #ef4444;
}

.action-btn .like-count {
    font-weight: 600;
    margin-left: 2px;
}

/* ========== 图片网格 ========== */
.tree-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    background: #1a1f2e;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.image-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.image-overlay {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 600;
}

/* 视频 */
.limited-video {
    max-height: 180px;
    overflow: hidden;
    border-radius: 14px;
}

/* ========== 文字内容样式（首页折叠版） ========== */
.text-content {
    font-size: var(--content-font-size, 16.5px);
    line-height: 1.7;
    color: #e2e8f0;
    text-indent: 2em;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    transition: all 0.3s ease;
}

.text-content.expanded {
    -webkit-line-clamp: unset;
    text-indent: 2em;
}

/* ========== 图片网格：默认只显示前3张 ========== */
.post-image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 12px 0;
    position: relative;
}

.post-image-grid.show-all {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}

/* 更多图片浮层 */
.more-images-overlay {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 4px 11px;
    border-radius: 999px;
    cursor: pointer;
    z-index: 3;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* ========== 底部导航（移动端） ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 60;
    background: rgba(10, 14, 22, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 8px var(--safe-bottom);
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: calc(60px + var(--safe-bottom));
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #6b7d95;
    font-size: 11px;
    font-weight: 500;
    transition: color 0.25s;
    cursor: pointer;
    min-width: 48px;
    min-height: 48px;
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: 12px;
}

.bottom-nav .nav-item.active {
    color: var(--emerald);
}

.bottom-nav .nav-item i {
    font-size: 20px;
    transition: transform 0.25s;
}

.bottom-nav .nav-item:active i {
    transform: scale(0.85);
}

.nav-publish {
    position: relative;
    top: -16px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--emerald), var(--emerald-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
    transition: all 0.3s;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.nav-publish:active {
    transform: scale(0.9);
}
