
.dynamic-item {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 20px;
    margin: 10px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    width: 270px;      /* 固定宽度 */
    height: 400px;     /* 固定高度 */
    overflow: hidden;   /* 隐藏溢出内容 */

}
.dynamic-content {
    flex: 1;
    overflow-y: auto;  /* 垂直滚动 */
    padding-right: 8px;
}
.dynamic-item:hover {
    transform: translateY(-3px);
}

.dynamic-item img {
    height: 180px;     /* 固定图片高度 */
    object-fit: cover; /* 保持图片比例 */
}

.dynamic-item h4 {
    color: var(--primary-blue);
    margin-bottom: 10px;
    font-size: 1.2em;
}

.dynamic-item p {
    flex: 1;
    margin-bottom: 10px;
    color: var(--text-color);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dynamic-item span {
    color: #666;
    font-size: 0.9em;
}

.dynamic-list {
    display: grid;
    gap: 15px;  /* 缩小间距 */
    padding: 1rem;
}

/* 桌面端保持4列（≥1200px） */
@media (min-width: 1200px) {
    .dynamic-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 中等桌面（992px-1199px） */
@media (min-width: 992px) and (max-width: 1199px) {
    .dynamic-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 平板端（768px-991px） */
@media (min-width: 768px) and (max-width: 991px) {
    .dynamic-list {
        grid-template-columns: repeat(3, 1fr);
    }
  
    .dynamic-item {
        width: 260px;
        height: 360px;
        padding: 15px;
    }
  
    .dynamic-item img {
        height: 150px;
    }
}

/* 大手机端（600px-767px） */
@media (min-width: 600px) and (max-width: 767px) {
    .dynamic-list {
        grid-template-columns: repeat(2, 1fr);
    }
  
    .dynamic-item {
        width: calc(50% - 10px); /* 自适应宽度 */
        height: 340px;
        margin: 5px;
    }
  
    .dynamic-item img {
        height: 140px;
    }
}

/* 小手机端（≤599px） */
@media (max-width: 599px) {
    .dynamic-list {
        grid-template-columns: repeat(1, 1fr);
    }
  
    .dynamic-item {
        width: 200px;
        height: 250px;
        padding: 12px;
        margin: 5px;
    }
  
    .dynamic-item img {
        height: 100px;
    }
  
    .dynamic-item p {
        -webkit-line-clamp: 2;
        font-size: 0.9em;
    }
}