/* 原有CSS保持不变，只添加必要的样式 */

/* 添加可点击头像的样式 */
.clickable-avatar {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.clickable-avatar:hover {
    transform: scale(1.05);
}

/* Toast消息样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    color: white;
    font-weight: 500;
}

.toast-success {
    background: #2ed573;
}

.toast-error {
    background: #ff4757;
}

.toast-info {
    background: #3742fa;
}

/* 原有CSS保持不变 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 导航栏 */
.navbar {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
}

.nav-logo {
    display: flex;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    color: #ff2e63;
    cursor: pointer;
}

.nav-logo i {
    margin-right: 8px;
    font-size: 24px;
}

.nav-search {
    position: relative;
    flex: 0 1 400px;
}

.nav-search input {
    width: 100%;
    padding: 8px 40px 8px 16px;
    border: 1px solid #e8e8e8;
    border-radius: 20px;
    background: #f5f5f5;
    font-size: 14px;
}

.nav-search i {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.nav-actions {
    display: flex;
    gap: 12px;
}

/* 顶部主菜单 */
.nav-main-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 12px;
    flex: 0 1 auto;
}

.nav-main-menu .menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid #e8e8e8;
    background: #fff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all .2s ease;
    white-space: nowrap;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.nav-main-menu .menu-btn:hover {
    border-color: #ff2e63;
    color: #ff2e63;
}

.nav-main-menu .menu-btn i {
    width: 16px;
    text-align: center;
}

.nav-main-menu .menu-btn.active {
    background: #fff0f5;
    border-color: #ff2e63;
    color: #ff2e63;
    font-weight: 600;
}

.nav-main-menu .menu-btn:focus,
.nav-main-menu .menu-btn:focus-visible {
    outline: none;
    box-shadow: none;
}

.nav-main-menu .menu-btn:active:not(.active) {
    background: #fdf2f6;
    border-color: #ff2e63;
    color: #ff2e63;
}

.btn-primary,
.btn-secondary {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #ff2e63;
    color: white;
}

.btn-primary:hover {
    background: #e6004c;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #e8e8e8;
}

.btn-secondary:hover {
    background: #e8e8e8;
}

/* 用户状态 */
.user-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #ffa8a8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    cursor: pointer;
    font-weight: bold;
}

.user-name {
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

/* 登录/注册模态框 */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-modal.active {
    display: flex;
    opacity: 1;
}

.auth-content {
    background: white;
    border-radius: 16px;
    width: 400px;
    max-width: 90%;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.auth-modal.active .auth-content {
    transform: scale(1);
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-header h2 {
    font-size: 24px;
    margin-bottom: 8px;
    color: #ff2e63;
}

.auth-header p {
    color: #666;
    font-size: 14px;
}

.auth-form {
    display: block;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    border-color: #ff2e63;
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 46, 99, 0.1);
}

.phone-input-group {
    display: flex;
    gap: 10px;
}

.phone-input-group input {
    flex: 1;
}

.send-code-btn {
    background: #ff2e63;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0 16px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.send-code-btn:hover {
    background: #e6004c;
}

.send-code-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.auth-submit {
    width: 100%;
    padding: 12px;
    background: #ff2e63;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 10px;
}

.auth-submit:hover {
    background: #e6004c;
}

.auth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.auth-close:hover {
    background: #f5f5f5;
}

.form-error {
    color: #ff2e63;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.form-error.active {
    display: block;
}

/* 主布局 */
.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* 主内容区 */
.main-content {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.content-header h1 {
    font-size: 24px;
    font-weight: 600;
}

/* 帖子网格 */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

/* 帖子卡片 */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
}

.product-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.product-image {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.status-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #ff2e63;
}

.status-badge.sold {
    color: #666;
    background: rgba(0, 0, 0, 0.05);
}

.status-available {
    background: rgba(255, 255, 255, 0.9);
    color: #ff2e63;
}

.product-info {
    padding: 12px;
}

.product-title {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #ff2e63;
}

.seller-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #999;
    flex-wrap: wrap;
}

.seller-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.seller-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
}

.seller-name {
    font-size: 12px;
    color: #999;
}

.post-stats-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    font-size: 12px;
    color: #999;
}

.post-like-count {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    font-size: 12px;
    color: #999;
}

.post-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 帖子模态框 */
.product-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 95%;
    max-width: 1000px;
    max-height: 95vh;
    overflow-y: auto;
    z-index: 2000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    background: white;
    border-radius: 16px;
    opacity: 0;
    transition: all 0.4s ease;
}

.product-modal.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.modal-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.3s ease;
    font-weight: bold;
}

.modal-user-avatar:hover {
    transform: scale(1.1);
}

.modal-user-details h3 {
    font-size: 16px;
    margin-bottom: 2px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-user-details h3:hover {
    color: #ff2e63;
}

.modal-user-details .post-time {
    font-size: 12px;
    color: #999;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f5f5f5;
    transform: rotate(90deg);
}

.modal-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-height: calc(95vh - 80px);
}

.modal-image-container {
    width: min(100%, 420px);
    aspect-ratio: 9 / 16;
    max-height: 80vh;
    overflow: hidden;
    position: relative;
    margin: 0 auto 20px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.modal-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.modal-content-container {
    width: min(100%, 720px);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: visible;
    padding: 20px;
    position: relative;
}

.modal-user-section {
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(100%, 720px);
    padding: 15px 20px;
    background: white;
    position: sticky;
    top: 0;
    z-index: 150;
    border-bottom: 1px solid #e8e8e8;
    margin: 0 auto;
}

.modal-back-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-back-btn:hover {
    color: #ff2e63;
}

.modal-user-section .modal-close {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    margin-left: auto;
}

.modal-user-avatar-large {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    font-weight: bold;
    flex-shrink: 0;
}

.modal-user-details-large h3 {
    font-size: 18px;
    margin-bottom: 4px;
    cursor: pointer;
}

.modal-user-details-large .post-time {
    font-size: 14px;
    color: #999;
}

.post-content-section {
    margin-bottom: 20px;
}

.post-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #2c3e50;
    line-height: 1.3;
}

.post-content {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
}

.product-details-section {
    margin-bottom: 20px;
    display: none;
}

.product-details-section.active {
    display: block;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #ff2e63;
}

.detail-label {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 4px;
    font-weight: 500;
}

.detail-value {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 600;
}

.condition {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.condition-used {
    background-color: #fff9e6;
    color: #f39c12;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.tag {
    display: inline-block;
    padding: 4px 8px;
    background: #eef2f7;
    border-radius: 4px;
    font-size: 12px;
    color: #4a5568;
}

.interaction-section {
    padding: 15px 0;
    margin-bottom: 15px;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.interaction-stats {
    display: flex;
    gap: 25px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: #7f8c8d;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: #f8f9fa;
}

.stat-item.likes.active i {
    color: #e74c3c;
}

.stat-item.likes.active .fa-heart {
    color: #e74c3c;
}

.stat-item i {
    font-size: 18px;
    transition: all 0.3s ease;
}

/* 点赞动画特效 */
@keyframes likeAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.stat-item.likes.animating i {
    animation: likeAnimation 0.4s ease;
}

/* 评论区样式 */
.comments-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: auto;
    margin-top: 20px;
}

.comments-section h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
}

.comments-list {
    flex: 1;
    margin-bottom: 15px;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
}

.comment-item {
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}

.comment-avatar.small {
    width: 24px;
    height: 24px;
    font-size: 10px;
}

.comment-author {
    font-size: 14px;
    font-weight: 600;
}

.comment-time {
    font-size: 12px;
    color: #999;
    margin-left: auto;
}

.comment-content {
    font-size: 14px;
    line-height: 1.5;
    color: #000;
    padding-left: 48px;
    margin-bottom: 8px;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-left: 48px;
    margin-top: 8px;
}

.comment-action {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
}

.comment-action:hover {
    color: #ff2e63;
}

.comment-action.liked {
    color: #e74c3c;
}

.comment-action.liked i {
    color: #e74c3c;
}

/* 评论点赞动画 */
.comment-action.animating i {
    animation: likeAnimation 0.4s ease;
}

.comment-reply {
    font-size: 12px;
    color: #666;
    cursor: pointer;
}

.comment-reply:hover {
    color: #ff2e63;
}

.reply-form {
    margin-top: 10px;
    padding-left: 48px;
    display: none;
}

.reply-form.active {
    display: flex;
    gap: 10px;
}

.reply-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e8e8e8;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}

.reply-input:focus {
    border-color: #ff2e63;
}

.reply-submit {
    background: #ff2e63;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
}

.comment-input-container {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    position: sticky;
    bottom: 0;
    background: white;
    z-index: 10;
}

.comment-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e8e8e8;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.comment-input:focus {
    border-color: #ff2e63;
}

.comment-submit {
    background: #ff2e63;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.comment-submit:hover {
    background: #e6004c;
}

.comment-replies {
    margin-top: 12px;
    padding-left: 20px;
    margin-left: 16px;
    border-left: 2px solid #f0f0f0;
}

.reply-item {
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.reply-item:hover {
    background-color: #f1f3f5;
    border-color: #dee2e6;
}

.reply-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.reply-item-new {
    background-color: #fff3cd;
    border-color: #ffc107;
    animation: highlightReply 0.6s ease;
}

@keyframes highlightReply {
    0% {
        background-color: #fff3cd;
        transform: scale(1);
    }
    50% {
        background-color: #ffe69c;
        transform: scale(1.02);
    }
    100% {
        background-color: #f8f9fa;
        transform: scale(1);
    }
}

.reply-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.reply-content {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 8px;
    padding-left: 0;
}

.reply-prefix {
    color: #666;
    font-size: 13px;
}

.reply-mention {
    color: #ff2e63;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
}

.reply-mention:hover {
    color: #e6004c;
    text-decoration: underline;
}

.reply-colon {
    color: #666;
    margin-right: 4px;
}

.reply-text {
    color: #333;
    word-break: break-word;
}

.reply-item .comment-actions {
    padding-left: 0;
    margin-top: 6px;
}

.expand-replies {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.3s ease;
    margin-top: 8px;
}

.expand-replies:hover {
    color: #ff2e63;
}

.expand-replies i {
    font-size: 10px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    padding: 15px 0;
    background: white;
}

.btn {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #2573a7);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #27ae60, #219653);
    transform: translateY(-2px);
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1999;
}

.overlay.active {
    display: block;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

.loading i {
    margin-right: 8px;
}

.hidden {
    display: none !important;
}

.error-message {
    background: #ffe6e6;
    color: #d63031;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.no-posts {
    text-align: center;
    padding: 40px;
    color: #666;
    grid-column: 1 / -1;
}

.load-more {
    text-align: center;
    margin-top: 30px;
}

.btn-load-more {
    background: white;
    border: 1px solid #e8e8e8;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-load-more:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.btn-load-more:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.footer {
    text-align: center;
    padding: 20px;
    color: #666;
    border-top: 1px solid #e8e8e8;
    margin-top: 40px;
}

/* 图片轮播容器样式 */
.image-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
}

.carousel-slide {
    flex: 0 0 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    transform: translateY(-50%);
    z-index: 10;
}

.carousel-btn {
    background: rgba(255, 255, 255, 0.8);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.carousel-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 10;
}

.carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicator.active {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.2);
}

.image-counter {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 10;
}

/* 鼠标拖拽支持 */
.carousel-track.grabbing {
    cursor: grabbing;
    transition: none;
}

/* 响应式设计 */
@media (max-width: 1400px) {
    .posts-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 10px;
    }
    /* 移动端优化：编辑资料按钮缩小为图标按钮，避免挤占用户名 */
    #editProfileBtn {
        width: auto;
        display: inline-flex;
        padding: 6px 8px;
        min-width: auto;
        gap: 6px;
        flex: 0 0 auto;
        line-height: 1;
        height: 32px;
    }
    #editProfileBtn i {
        font-size: 16px;
        margin: 0;
    }
    #editProfileBtn span {
        display: none;
    }
    .sidebar {
        position: static;
        height: auto;
        flex: none;
        margin-bottom: 20px;
    }
    .nav-container {
        flex-direction: column;
        gap: 12px;
    }
    .nav-search {
        flex: none;
        width: 100%;
    }
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .content-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    .product-modal {
        width: 98%;
        height: 98%;
    }
    .modal-body {
        flex-direction: column;
    }
    .modal-image-container {
        flex: 0 0 300px;
    }
    .details-grid {
        grid-template-columns: 1fr;
    }
    .comment-content {
        padding-left: 0;
    }
    .comment-actions {
        padding-left: 0;
    }
    .reply-form {
        padding-left: 0;
    }
    .comment-replies {
        padding-left: 20px;
    }
    .carousel-btn {
        width: 32px;
        height: 32px;
    }
    .carousel-nav {
        padding: 0 10px;
    }
}

@media (max-width: 576px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    /* 更小屏幕下进一步压缩编辑按钮尺寸 */
    #editProfileBtn {
        width: auto;
        display: inline-flex;
        padding: 4px 6px;
        border-radius: 8px;
        height: 28px;
        line-height: 1;
    }
    #editProfileBtn i {
        font-size: 14px;
        margin: 0;
    }
    .nav-actions {
        flex-direction: column;
        width: 100%;
    }
    /* 顶部主菜单在手机上一行展示并占满宽度 */
    .nav-main-menu {
        flex: 1 1 auto;
        margin: 0 8px;
        gap: 8px;
        justify-content: space-between;
    }
    .nav-main-menu .menu-btn {
        flex: 1 1 25%;
        justify-content: center;
        padding: 8px 6px;
        font-size: 13px;
    }
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    /* 模态框移动端优化 */
    .product-modal {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: none;
    }
    .product-modal.active {
        transform: none;
    }
    /* 手机端隐藏轮播左右箭头 */
    .carousel-nav {
        display: none;
    }
    .modal-body {
        flex-direction: column;
        max-height: 100vh;
    }
    .modal-image-container {
        width: 100vw;
        max-width: 100vw;
        aspect-ratio: 9 / 16;
        height: auto;
        margin: 0 -15px 20px;
        border-radius: 0;
    }
    .modal-image-container img {
        width: 100%;
        height: 100%;
    }
    .modal-content-container {
        width: min(100%, 92vw);
        padding: 15px;
        flex: 1;
    }
    .modal-user-section {
        margin-bottom: 15px;
    }
    .modal-user-avatar-large {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    .modal-user-details-large h3 {
        font-size: 16px;
    }
    .post-title {
        font-size: 20px;
        margin-bottom: 10px;
    }
    .post-content {
        font-size: 14px;
        line-height: 1.5;
    }
    .details-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .interaction-stats {
        gap: 15px;
    }
    .stat-item {
        font-size: 14px;
        padding: 6px 10px;
    }
    .comments-section h3 {
        font-size: 1rem;
    }
    .comment-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    .comment-content {
        font-size: 14px;
    }
    .comment-input-container {
        margin-left: -15px;
        margin-right: -15px;
        padding: 12px 15px 18px;
    }
    .action-buttons {
        flex-direction: column;
        gap: 10px;
        padding: 15px 0;
    }
    .action-buttons .btn {
        width: 100%;
    }
}

/* 添加额外的超小屏幕适配 */
@media (max-width: 400px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .product-card {
        border-radius: 12px;
    }
    .product-info {
        padding: 12px;
    }
    .product-title {
        font-size: 1rem;
        height: 2.4em;
    }
    .product-price {
        font-size: 1.2rem;
    }
    .modal-image-container {
        width: 100vw;
        max-width: 100vw;
        aspect-ratio: 9 / 16;
        height: auto;
        margin: 0 -12px 18px;
    }
    .modal-image-container img {
        width: 100%;
        height: 100%;
    }
}

/* 桌面端大屏幕优化 - 图片居中显示 */
@media (min-width: 992px) {
    .modal-image-container {
        width: min(420px, 40vw);
        max-height: 85vh;
    }
    .modal-content-container {
        width: min(720px, 60vw);
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }
.product-card:nth-child(7) { animation-delay: 0.35s; }
.product-card:nth-child(8) { animation-delay: 0.4s; }
.product-card:nth-child(9) { animation-delay: 0.45s; }
.product-card:nth-child(10) { animation-delay: 0.5s; }
.product-card:nth-child(11) { animation-delay: 0.55s; }
.product-card:nth-child(12) { animation-delay: 0.6s; }

.post-type-filter {
    display: flex;
    gap: 10px;
    margin-right: auto;
    margin-left: 20px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    background: white;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.filter-btn:hover {
    border-color: #ff2e63;
    color: #ff2e63;
}

.filter-btn.active {
    background: #ff2e63;
    border-color: #ff2e63;
    color: white;
}

.filter-btn:focus,
.filter-btn:focus-visible {
    outline: none;
    box-shadow: none;
}

.filter-btn:active:not(.active) {
    background: #f5f5f5;
}

.user-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
}

.user-header-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #ffa8a8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    cursor: pointer;
    font-weight: bold;
    flex-shrink: 0;
}

.user-header-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    max-width: 400px;
}

.user-header-info h2 {
    font-size: 24px;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
}

.user-header-info p {
    color: #666;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
}

.user-stats {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

.user-stat {
    text-align: center;
    min-width: 30px;
}

.user-stat-number {
    font-size: 18px;
    color: #050001;
    margin-bottom: 2px;
}

.user-stat-label {
    font-size: 12px;
    color: #999;
    font-weight: 500;
}

.nav-logo-img {
    width: 24px;
    /* 调整图片大小 */
    height: 24px;
    margin-right: 8px;
    object-fit: contain;
    /* 保持图片比例 */
}

