/* 交易详情页面样式 */
.trade-detail-page {
    padding: 20px 0;
}

.error-container {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.error-container i {
    font-size: 64px;
    color: #ccc;
    margin-bottom: 20px;
}

.error-container h2 {
    color: #333;
    margin-bottom: 10px;
}

.error-container p {
    color: #666;
    margin-bottom: 20px;
}

.btn-back {
    display: inline-block;
    padding: 10px 24px;
    background: linear-gradient(135deg, #5D3FD3 0%, #8B5CF6 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    transition: transform 0.2s;
}

.btn-back:hover {
    transform: translateY(-2px);
}

/* 详情布局 */
.trade-detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* 图片区域 */
.trade-images-section {
    position: sticky;
    top: 100px;
}

.main-image-container {
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.main-image {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
}

.no-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #999;
}

.no-image i {
    font-size: 64px;
    margin-bottom: 10px;
}

.image-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding: 5px 0;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: #5D3FD3;
}

/* 信息区域 */
.trade-info-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.trade-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.trade-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.badge-sell {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8787 100%);
    color: #fff;
}

.badge-buy {
    background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
    color: #fff;
}

.trade-title {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
    margin: 0;
}

/* 价格盒子 */
.trade-price-box {
    background: linear-gradient(135deg, #FFF7ED 0%, #FEF3C7 100%);
    border-radius: 10px;
    padding: 20px;
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.price-label {
    font-size: 14px;
    color: #666;
}

.price-value {
    font-size: 32px;
    font-weight: 700;
    color: #DC2626;
}

.price-unit {
    font-size: 16px;
    color: #666;
}

.price-meta {
    display: flex;
    gap: 20px;
    margin-top: 12px;
    font-size: 14px;
    color: #666;
}

/* 规格信息 */
.trade-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 20px;
    background: #F9FAFB;
    border-radius: 10px;
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.spec-label {
    font-size: 13px;
    color: #666;
}

.spec-value {
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
}

/* 商品描述 */
.trade-description {
    padding: 20px;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
}

.trade-description h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}

.trade-description p {
    font-size: 14px;
    color: #4B5563;
    line-height: 1.6;
    margin: 0;
    white-space: pre-wrap;
}

/* 卖家信息 */
.seller-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: #F9FAFB;
    border-radius: 10px;
}

.seller-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.seller-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5D3FD3 0%, #8B5CF6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    overflow: hidden;
}

.seller-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.seller-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.seller-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.seller-stats {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #666;
}

.seller-stats i {
    color: #F59E0B;
    margin-right: 4px;
}

.btn-visit-shop {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #5D3FD3;
    color: #5D3FD3;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-visit-shop:hover {
    background: #5D3FD3;
    color: #fff;
}

/* 操作按钮 */
.trade-actions {
    display: flex;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid #E5E7EB;
}

.trade-actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-favorite {
    background: #fff;
    border: 1px solid #E5E7EB !important;
    color: #666;
}

.btn-favorite:hover {
    border-color: #FF6B6B !important;
    color: #FF6B6B;
}

.btn-favorite.favorited {
    border-color: #FF6B6B !important;
    color: #FF6B6B;
}

.btn-chat {
    background: #fff;
    border: 1px solid #5D3FD3 !important;
    color: #5D3FD3;
}

.btn-chat:hover {
    background: #F3F0FF;
}

.btn-buy {
    flex: 1;
    background: linear-gradient(135deg, #5D3FD3 0%, #8B5CF6 100%);
    color: #fff;
}

.btn-buy:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(93, 63, 211, 0.4);
}

.btn-buy.disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 购买弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
}

.modal-body {
    padding: 24px;
}

.buy-item-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #F9FAFB;
    border-radius: 8px;
    margin-bottom: 20px;
}

.item-name {
    font-weight: 500;
    color: #1a1a1a;
}

.item-price {
    color: #DC2626;
    font-weight: 600;
}

.buy-quantity {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.buy-quantity label {
    font-size: 14px;
    color: #666;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    overflow: hidden;
}

.quantity-control button {
    width: 36px;
    height: 36px;
    border: none;
    background: #F9FAFB;
    font-size: 18px;
    cursor: pointer;
}

.quantity-control button:hover {
    background: #E5E7EB;
}

.quantity-control input {
    width: 60px;
    height: 36px;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
}

.available-hint {
    font-size: 13px;
    color: #999;
}

.buy-summary {
    border-top: 1px dashed #E5E7EB;
    padding-top: 15px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: #666;
}

.summary-row.total {
    border-top: 1px solid #E5E7EB;
    margin-top: 10px;
    padding-top: 15px;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.summary-row.total span:last-child {
    color: #DC2626;
    font-size: 20px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #E5E7EB;
}

.modal-footer button {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    border: none;
}

.btn-cancel {
    background: #F3F4F6;
    color: #666;
}

.btn-confirm {
    background: linear-gradient(135deg, #5D3FD3 0%, #8B5CF6 100%);
    color: #fff;
}

/* 响应式 */
@media (max-width: 768px) {
    .trade-detail-layout {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .trade-images-section {
        position: static;
    }
    
    .trade-actions {
        flex-wrap: wrap;
    }
    
    .trade-actions button {
        flex: 1;
        min-width: calc(50% - 6px);
    }
    
    .btn-buy {
        min-width: 100%;
        order: -1;
    }
}
