/* ===== 全局重置 & 字体 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
    background: #f5f5f5;
    color: #1c1c1e;
    padding-bottom: 70px; /* 底部导航预留 */
    min-height: 100vh;
}

/* ===== 顶部导航 ===== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(135deg, #1aad19 0%, #07c160 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    box-shadow: 0 2px 12px rgba(26, 173, 25, 0.3);
    backdrop-filter: blur(8px);
}

.header-left i,
.header-right i {
    font-size: 22px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.header-left i:hover,
.header-right i:hover {
    transform: scale(1.1);
}

.header-title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 1px;
}

/* ===== 动态流容器 ===== */
.feed-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ===== 动态卡片 ===== */
.post-card {
    background: white;
    border-radius: 18px;
    padding: 16px 18px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    transition: all 0.25s ease;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.post-card:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* 头像 + 用户信息 */
.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: #e0e0e0;
    border: 2px solid #f0f0f0;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 15px;
    color: #1c1c1e;
}

.post-time {
    font-size: 12px;
    color: #8e8e93;
    margin-top: 2px;
}

/* 正文 */
.post-content {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 12px;
    word-break: break-word;
}

/* 图片九宫格 */
.post-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-bottom: 12px;
    border-radius: 12px;
    overflow: hidden;
}

.post-images img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 6px;
    transition: transform 0.2s;
    cursor: pointer;
}

.post-images img:hover {
    transform: scale(1.02);
}

/* 单张图片特殊处理 */
.post-images:has(> :only-child) {
    grid-template-columns: 1fr;
    max-width: 220px;
}

.post-images:only-child img {
    aspect-ratio: auto;
    height: 180px;
    object-fit: cover;
}

/* 操作栏：点赞 / 评论 */
.post-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
    margin-top: 4px;
}

.action-btn {
    background: none;
    border: none;
    font-size: 14px;
    color: #6c6c70;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 20px;
    transition: all 0.2s;
}

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

.action-btn:hover {
    background: #f0f0f0;
    color: #07c160;
}

.action-btn.liked {
    color: #ff4757;
}

.action-btn.liked i {
    font-weight: 900;
}

/* ===== 底部标签栏 ===== */
.bottom-tab {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 10px;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.04);
    z-index: 20;
    border-top: 1px solid #f0f0f0;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #8e8e93;
    font-size: 11px;
    transition: color 0.2s;
    cursor: pointer;
    padding: 4px 12px;
    border-radius: 12px;
}

.tab-item i {
    font-size: 22px;
    margin-bottom: 2px;
}

.tab-item.active {
    color: #07c160;
}

.tab-item:hover {
    color: #07c160;
}

/* ===== 搜索弹窗 ===== */
.search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    z-index: 100;
    padding: 60px 20px;
}

.search-overlay.active {
    display: block;
}

.search-box {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 30px;
    padding: 6px 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    max-width: 500px;
    margin: 0 auto 20px;
}

.search-box i {
    color: #8e8e93;
    font-size: 18px;
    margin-right: 10px;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    padding: 10px 0;
    background: transparent;
}

.search-box button {
    background: none;
    border: none;
    font-size: 20px;
    color: #6c6c70;
    cursor: pointer;
    padding: 4px 8px;
}

.search-results {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 16px;
    min-height: 80px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    color: #6c6c70;
    font-size: 14px;
}

/* ===== 发布动态弹窗 ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: white;
    border-radius: 24px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px 10px;
    font-size: 18px;
    font-weight: 600;
}

.modal-header i {
    font-size: 22px;
    color: #6c6c70;
    cursor: pointer;
    padding: 4px;
}

.modal-body {
    padding: 0 20px 12px;
}

.modal-body textarea {
    width: 100%;
    border: 1px solid #e5e5ea;
    border-radius: 16px;
    padding: 14px;
    font-size: 15px;
    resize: vertical;
    outline: none;
    transition: border 0.2s;
}

.modal-body textarea:focus {
    border-color: #07c160;
}

.image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.image-preview img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #e5e5ea;
}

.upload-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px dashed #c7c7cc;
    border-radius: 16px;
    padding: 16px;
    margin-top: 12px;
    color: #8e8e93;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.upload-area:hover {
    background: #f9f9f9;
    border-color: #07c160;
    color: #07c160;
}

.upload-area input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.modal-footer {
    padding: 12px 20px 20px;
    display: flex;
    justify-content: flex-end;
}

.btn-primary {
    background: #07c160;
    color: white;
    border: none;
    padding: 10px 28px;
    border-radius: 28px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.3);
}

.btn-primary:hover {
    background: #06ad56;
    transform: scale(1.02);
}

.btn-primary:active {
    transform: scale(0.97);
}

/* ===== 空状态 & 加载 ===== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #8e8e93;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
    .app-header {
        padding: 10px 16px;
    }
    .header-title {
        font-size: 18px;
    }
    .feed-container {
        padding: 12px 8px;
        gap: 12px;
    }
    .post-card {
        padding: 14px 14px;
    }
    .post-images {
        gap: 3px;
    }
    .modal-card {
        border-radius: 18px;
    }
}

@media (min-width: 768px) {
    .feed-container {
        padding: 20px 24px;
    }
    .post-card {
        padding: 20px 24px;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #c7c7cc;
    border-radius: 8px;
}