/* 专题容器 */
.zib-category-topics {
    width: 100%;
    padding: 0;
    margin: 0 -8px;
}

/* 网格布局 */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 0 8px;
}

/* 专题卡片 */
.topic-card {
    background: var(--theme-item-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    border: 1px solid var(--theme-border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    border-color: var(--theme-color-light);
}

/* 背景图区域 */
.topic-header {
    position: relative;
    height: 140px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-bottom: 1px solid var(--theme-border-color);
}

/* 背景图遮罩 */
.topic-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.7));
}

/* 标题区域内容 */
.topic-header-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    z-index: 2;
}

/* 专题标题 */
.topic-title {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
}

.topic-title a {
    color: #fff;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.topic-title a:hover {
    color: #fff;
    text-decoration: underline;
}

/* 文章数量 */
.topic-count {
    font-size: 12px;
    color: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
}

.topic-count:before {
    content: "📝";
    margin-right: 5px;
    font-size: 14px;
}

/* 文章列表 */
.topic-posts {
    padding: 12px;
    max-height: 200px;
    overflow: hidden;
}

/* 文章项 */
.topic-post-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    margin-bottom: 4px;
    border-radius: 6px;
    color: var(--theme-font-color);
    text-decoration: none;
    transition: all 0.2s;
}

.topic-post-item:last-child {
    margin-bottom: 0;
}

.topic-post-item:hover {
    background: var(--theme-hover-bg);
    color: var(--theme-color);
}

/* 文章标题 */
.post-title {
    flex: 1;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
}

/* 文章日期 */
.post-date {
    font-size: 12px;
    color: var(--theme-gray-color);
    white-space: nowrap;
    background: rgba(var(--theme-color-rgb), 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

/* 今日发布 - 红色 */
.post-date.is-today {
    background: rgba(255, 77, 79, 0.15);
    color: #ff4d4f;
    font-weight: 600;
}

/* 昨日发布 - 橙色 */
.post-date.is-yesterday {
    background: rgba(251, 113, 133, 0.15);
    color: #fb7185;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .topics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .topics-grid {
        grid-template-columns: 1fr;
    }
    
    .topic-header {
        height: 120px;
    }
    
    .topic-title {
        font-size: 16px;
    }
}

/* 暗色主题适配 */
[data-theme="dark"] .topic-card {
    border-color: var(--theme-dark-border);
    background: var(--theme-dark-item);
}

[data-theme="dark"] .topic-header {
    border-bottom-color: var(--theme-dark-border);
}

[data-theme="dark"] .topic-post-item:hover {
    background: var(--theme-dark-hover);
}

[data-theme="dark"] .post-date {
    background: rgba(var(--theme-color-rgb), 0.2);
}

[data-theme="dark"] .post-date.is-today {
    background: rgba(255, 77, 79, 0.25);
}

[data-theme="dark"] .post-date.is-yesterday {
    background: rgba(251, 113, 133, 0.25);
}

/* 动画效果 */
.topic-post-item {
    position: relative;
    overflow: hidden;
}

.topic-post-item:before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--theme-color-rgb), 0.05), transparent);
    transition: all 0.5s;
}

.topic-post-item:hover:before {
    left: 100%;
}