/* ===== 文章卡片（Material Design 3 Expressive） ===== */

.articles-container {
    margin: 0 auto;
    padding: 0 20px;
    column-count: 3;
    column-gap: 20px;
}

.post-card {
    width: 100%;
    margin: 0 0 20px 0;
    display: flex;
    flex-direction: column;
    break-inside: avoid;
    cursor: pointer;
    border-radius: 24px !important;
    overflow: hidden;
    background-color: var(--s-color-surface-container) !important;
    border: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: transform 0.4s cubic-bezier(0.2, 0, 0, 1),
                box-shadow 0.4s cubic-bezier(0.2, 0, 0, 1),
                background-color 0.3s ease,
                border-color 0.3s ease;
    will-change: transform;
}

.post-card:hover {
    transform: translateY(-6px);
    background-color: var(--s-color-surface-container-high) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1),
                0 4px 12px color-mix(in srgb, var(--s-color-primary) 12%, transparent);
}

.post-card:active {
    transform: translateY(-2px) scale(0.99);
}

.post-card:focus-visible {
    outline: 3px solid var(--s-color-primary);
    outline-offset: 2px;
}

/* 媒体区 */
.post-card__media {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background-color: var(--s-color-surface-container-high);
}

.post-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.2, 0, 0, 1);
}

.post-card:hover .post-card__img {
    transform: scale(1.07);
}

.post-card__media-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(0, 0, 0, 0) 50%,
        rgba(0, 0, 0, 0.22) 100%);
    pointer-events: none;
}

/* 分类徽章（封面左上角，毛玻璃） */
.post-card__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px 5px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--s-color-primary-container) 92%, transparent);
    color: var(--s-color-on-primary-container);
    backdrop-filter: blur(8px) saturate(160%);
    -webkit-backdrop-filter: blur(8px) saturate(160%);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.post-card__badge material-icon {
    font-size: 0.95rem;
}

.post-card__badge--inline {
    position: static;
    margin-bottom: 10px;
    box-shadow: none;
}

/* 主体 */
.post-card__body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 0;
}

.post-card__header {
    display: flex;
    flex-direction: column;
}

.post-card__title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--s-color-on-surface);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.25s ease;
}

.post-card:hover .post-card__title {
    color: var(--s-color-primary);
}

.post-card__excerpt {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--s-color-on-surface-variant);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

/* 元信息 */
.post-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid color-mix(in srgb, var(--s-color-outline-variant) 50%, transparent);
}

.post-card__date {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--s-color-on-surface-variant);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.post-card__date material-icon {
    font-size: 1rem;
}

.post-card__tags {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: flex-end;
}

.post-card__tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 9px 3px 7px;
    border-radius: 999px;
    background: var(--s-color-secondary-container);
    color: var(--s-color-on-secondary-container);
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.4;
}

.post-card__tag material-icon {
    font-size: 0.85rem;
}

.post-card__tag--more {
    background: var(--s-color-tertiary-container);
    color: var(--s-color-on-tertiary-container);
    padding: 3px 9px;
}

/* 阅读更多 */
.post-card__action {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    color: var(--s-color-primary);
    font-size: 0.82rem;
    font-weight: 500;
}

.post-card__arrow {
    font-size: 1.1rem !important;
    transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.post-card:hover .post-card__arrow {
    transform: translateX(4px);
}

/* 无文章 */
.no-articles {
    width: 100%;
    text-align: center;
    padding: 3rem 2rem;
    border-radius: 24px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* 响应式 */
@media (max-width: 1200px) {
    .articles-container {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .articles-container {
        column-count: 1;
        padding: 0 16px;
    }

    .post-card__media {
        height: 160px;
    }

    .post-card__body {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .post-card__title {
        font-size: 1.1rem;
    }

    .post-card__body {
        padding: 14px;
        gap: 10px;
    }

    .post-card__media {
        height: 150px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .post-card,
    .post-card__img,
    .post-card__title,
    .post-card__arrow {
        transition: none !important;
    }

    .post-card:hover {
        transform: none;
    }

    .post-card:hover .post-card__img {
        transform: none;
    }
}
