/* 收藏圈页面样式 */
:root {
    --main-color: #5D3FD3;
    --light-purple: #f0edff;
    --dark-purple: #4a2fb8;
    --gradient-primary: linear-gradient(135deg, #5D3FD3 0%, #8D71FF 100%);
    --border-color: #e1e8ed;
    --text-primary: #14171a;
    --text-secondary: #657786;
    --bg-hover: #f7f9fa;
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 确保页面布局正确，页脚在底部 */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 主内容区域自动填充剩余空间 */
.shoucangquan-container {
    flex: 1; /* 让收藏圈容器占据剩余空间 */
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f8f9fa;
    /* 移除min-height和padding-bottom，使用flex布局自动处理 */
}

/* 发布区域 */
.publish-section {
    max-width: 1200px;
    margin: 0 auto 20px auto;
    padding: 0 20px;
}

.publish-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.publish-card:hover {
    box-shadow: var(--shadow-medium);
}

.publish-header {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.publish-input {
    flex: 1;
}

.publish-input textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    font-size: 16px;
    line-height: 1.5;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.publish-input textarea:focus {
    outline: none;
    border-color: var(--main-color);
    box-shadow: 0 0 0 2px rgba(93, 63, 211, 0.1);
}

.publish-input textarea::placeholder {
    color: var(--text-secondary);
}

.publish-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.action-buttons {
    display: flex;
    gap: 15px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: white;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.action-btn:hover {
    background: var(--light-purple);
    border-color: var(--main-color);
    color: var(--main-color);
}

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

.publish-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.publish-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

/* 筛选区域 */
.filter-section {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.filter-tabs {
    display: flex;
    gap: 15px;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(93, 63, 211, 0.1);
    border: 1px solid rgba(93, 63, 211, 0.1);
}

.filter-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: #666;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 500;
}

.filter-tab:hover {
    background: rgba(93, 63, 211, 0.1);
    color: #5D3FD3;
}

.filter-tab.active {
    background: linear-gradient(135deg, #5D3FD3, #7B68EE);
    color: white;
    box-shadow: 0 2px 8px rgba(93, 63, 211, 0.3);
}

.filter-tab i {
    font-size: 16px;
}

/* 主内容区域 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    align-items: start;
}

/* 左侧动态区域 */
.moments-section {
    min-height: 500px;
}

/* 动态列表 */
.moments-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.moment-item {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease;
    font-size: 16px;
}

.moment-item:hover {
    box-shadow: var(--shadow-medium);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.moment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.user-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.username {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 17px;
}

.post-time {
    color: var(--text-secondary);
    font-size: 14px;
}

.post-type-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: white;
}

.post-type-badge.news {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
}

.post-type-badge.trade {
    background: linear-gradient(135deg, #00d2d3, #54a0ff);
}

.post-type-badge.share {
    background: linear-gradient(135deg, #5f27cd, #a55eea);
}

.post-type-badge.analysis {
    background: linear-gradient(135deg, #00d2d3, #01a3a4);
}

/* 动态内容 */
.moment-content {
    margin-bottom: 15px;
}

.content-text {
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 15px;
    word-wrap: break-word;
}

/* 交易信息卡片 */
.trade-info {
    background: linear-gradient(135deg, #f8f9ff, #f0edff);
    border: 1px solid rgba(93, 63, 211, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin: 12px 0;
}

.trade-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trade-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 18px;
}

.trade-specs {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.spec-item {
    color: var(--text-secondary);
    font-size: 14px;
    background: white;
    padding: 6px 10px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.trade-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--main-color);
}

/* 图片网格 */
.content-images {
    margin: 12px 0;
}

.image-grid {
    display: grid;
    gap: 8px;
    border-radius: 8px;
    overflow: hidden;
}

.image-grid.grid-1 {
    grid-template-columns: 1fr;
    max-width: 400px;
}

.image-grid.grid-2 {
    grid-template-columns: 1fr 1fr;
    max-width: 400px;
}

.image-grid.grid-3 {
    grid-template-columns: repeat(3, 1fr);
    max-width: 400px;
}

.image-grid.grid-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    max-width: 400px;
}

.image-grid img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-grid.grid-1 img {
    height: 200px;
}

.image-grid img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-medium);
}

/* 动态操作按钮 */
.moment-actions {
    display: flex;
    justify-content: space-around;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.moment-actions .action-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.3s ease;
}

.moment-actions .action-btn:hover {
    background: var(--bg-hover);
    color: var(--main-color);
}

.moment-actions .action-btn.liked {
    color: #e74c3c;
}

.moment-actions .action-btn.liked i {
    color: #e74c3c;
}

.moment-actions .action-btn .count {
    margin-left: 4px;
}

.contact-btn {
    background: var(--gradient-primary) !important;
    color: white !important;
}

.contact-btn:hover {
    background: var(--dark-purple) !important;
    color: white !important;
}

/* 加载更多 */
.load-more {
    text-align: center;
    margin: 30px 0;
}

.load-more-btn {
    background: white;
    border: 2px solid var(--main-color);
    color: var(--main-color);
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.load-more-btn:hover {
    background: var(--main-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.load-more-btn i {
    transition: transform 0.3s ease;
}

.load-more-btn:hover i {
    transform: rotate(180deg);
}

/* 发布弹窗 */
.publish-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.publish-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--shadow-heavy);
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-body textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
    margin-bottom: 15px;
}

.modal-body textarea:focus {
    outline: none;
    border-color: var(--main-color);
    box-shadow: 0 0 0 2px rgba(93, 63, 211, 0.1);
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--main-color);
    background: var(--light-purple);
}

.upload-placeholder i {
    font-size: 32px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.upload-placeholder p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 14px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: #f8f9fa;
}

.cancel-btn {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: var(--bg-hover);
    border-color: var(--text-secondary);
}

.confirm-btn {
    background: var(--gradient-primary);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.confirm-btn:hover {
    background: var(--dark-purple);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

/* 右侧边栏 */
.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 20px;
}

.sidebar-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(93, 63, 211, 0.1);
    border: 1px solid rgba(93, 63, 211, 0.1);
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #5D3FD3, #7B68EE);
    color: white;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.more-link {
    color: white;
    text-decoration: none;
    font-size: 12px;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.more-link:hover {
    opacity: 1;
}

/* 推荐买卖信息 */
.trade-recommendations {
    padding: 15px;
}

.trade-rec-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.trade-rec-item:last-child {
    border-bottom: none;
}

.trade-rec-item:hover {
    background-color: rgba(93, 63, 211, 0.05);
}

.trade-rec-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.trade-rec-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.trade-rec-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.trade-rec-title {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trade-rec-price {
    font-size: 17px;
    font-weight: 600;
    color: #5D3FD3;
}

.trade-rec-seller {
    font-size: 13px;
    color: #999;
}

/* 市场行情 */
.market-trends {
    padding: 15px;
}

.trend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.trend-item:last-child {
    border-bottom: none;
}

.trend-name {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.trend-price {
    text-align: right;
    font-size: 15px;
    font-weight: 600;
}

.trend-price.up {
    color: #e74c3c;
}

.trend-price.down {
    color: #27ae60;
}

.trend-change {
    font-size: 12px;
    margin-left: 5px;
}

/* 收藏知识 */
.knowledge-tips {
    padding: 15px;
}

.tip-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.tip-item:last-child {
    border-bottom: none;
}

.tip-title {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.tip-content {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .shoucangquan-container {
        padding: 10px;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sidebar-section {
        position: static;
        order: -1;
    }
    
    .filter-tabs {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .filter-tab {
        padding: 8px 15px;
        font-size: 13px;
    }
    
    .publish-card,
    .moment-item {
        padding: 15px;
    }
    
    .action-buttons {
        gap: 10px;
    }
    
    .action-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .trade-specs {
        gap: 8px;
    }
    
    .spec-item {
        font-size: 12px;
        padding: 3px 6px;
    }
    
    .image-grid.grid-3 {
        grid-template-columns: 1fr 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .publish-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .user-avatar {
        align-self: flex-start;
    }
    
    .publish-actions {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    .moment-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .moment-actions .action-btn {
        justify-content: center;
    }
    
    .image-grid.grid-2,
    .image-grid.grid-3 {
        grid-template-columns: 1fr;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--main-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

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

.empty-state h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: var(--text-primary);
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}