/* ============================================
   占星产品卡片组件样式
   ============================================ */
.astro-product-cards {
    display: grid;
    gap: var(--spacing-xs);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.astro-product-card {
    position: relative;
    cursor: pointer;
    transition: var(--transition-base);
    margin-bottom: var(--spacing-sm);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* 卡片的三个部分组成艺术边框 */
.astro-product-card__top {
    width: 100%;
    height: 15px;
    background-image: url('/static/images/home/analysis-card-top.png');
    background-repeat: no-repeat;
    background-position: left top;
    background-size: 100% 100%;
}

.astro-product-card__middle {
    width: 100%;
    background-image: url('/static/images/home/analysis-card-middle.png');
    background-repeat: repeat-y;
    background-position: left top;
    background-size: 100% auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-lg);
    min-height: 50px;
    position: relative;
}

/* 中间部分添加白色背景 */
.astro-product-card__middle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10px;
    right: 10px;
    bottom: 0;
    background: var(--color-bg-primary);
    z-index: 0;
}

.astro-product-card__bottom {
    width: 100%;
    height: 15px;
    background-image: url('/static/images/home/analysis-card-bottom.png');
    background-repeat: no-repeat;
    background-position: left bottom;
    background-size: 100% 100%;
}

.astro-product-card:hover {
    transform: translateX(2px);
}

.astro-product-card:hover .astro-product-card__middle {
    background-color: rgba(var(--color-primary-rgb), 0.05);
}

/* 缩略图样式 */
.astro-product-card__thumbnail {
    width: 72px;
    height: 72px;
    font-size: 15px;
    margin-right: var(--spacing-md);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    overflow: hidden;
    border-radius: 4px;
}

.astro-product-card__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.astro-product-card__content {
    flex: 1;
    padding-right: var(--spacing-md);
    position: relative;
    z-index: 1;
    min-width: 0; /* 允许内容收缩 */
    overflow: hidden; /* 防止内容溢出 */
}

/* 当有缩略图时，调整内容区域 */
.astro-product-card--with-thumb .astro-product-card__content {
    padding-right: var(--spacing-sm);
}

.astro-product-card__title {
    font-size: var(--font-size-base);
    color: var(--color-text-primary);
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--spacing-xs);
    /* 最多显示两行，超出省略 */
    display: -webkit-box;
    display: -moz-box;
    -webkit-line-clamp: 2;
    -moz-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    -moz-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.astro-product-card__desc {
    font-size: calc(var(--font-size-small) );
    color: #6D6147;
    line-height: var(--line-height-normal);
    /* 只显示一行，超出省略 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.astro-product-card__arrow {
    width: 24px;
    height: 24px;
    background: url('/static/images/home/right-arrow.png') no-repeat center;
    background-size: contain;
    flex-shrink: 0;
    transition: var(--transition-base);
    position: relative;
    z-index: 1;
    opacity: 0.6;
    text-decoration: none;
    display: block;
}

.astro-product-card:hover .astro-product-card__arrow {
    transform: translateX(3px);
    opacity: 1;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .astro-product-card__middle {
        padding: var(--spacing-xs) var(--spacing-md);
    }

    .astro-product-card__title {
        font-size: var(--font-size-large);
    }

    .astro-product-card__desc {
        font-size: calc(var(--font-size-base) + 1px);
    }

    /* 移动端缩略图尺寸调整 */
    .astro-product-card__thumbnail {
        width: 60px;
        height: 60px;
        margin-right: var(--spacing-sm);
    }
}
