﻿/* ============================================================
   专题列表页（Pages/collection.php）专用样式
   作用域：#jitheme-collection-page
   用途：按新版卡片设计重绘专题列表，不影响其他页面
   ============================================================ */

/* 本页作用域变量（品牌强调色 + 字号；其余颜色沿用全局主题变量） */
#jitheme-collection-page {
    --color-accent: #ff5722;
    /* --fs-sm/--fs-xs 由 Ji_main.php 全局统一提供（13px/12px 档） */
}

/* ---- 顶部横幅（居中） ---- */
#jitheme-collection-page .collection-top {
    text-align: center;
    margin-top: -16px;
}

#jitheme-collection-page .pianli {
    text-align: center;
}

/* ---- 卡片网格（列数由后台 collection_row_number 控制，默认 4 列） ---- */
#jitheme-collection-page .collection-box {
    display: grid;
    grid-template-columns: repeat(var(--b2-col-cols, 4), 1fr);
    gap: 20px;
    width: 100%;
    margin-top: var(--gap);
    align-items: stretch;
}

/* 覆盖父主题 .collection-item 的 50% 宽度布局 */
#jitheme-collection-page .collection-item {
    width: auto;
    padding: 0;
    position: relative;
    z-index: 2;
    box-sizing: border-box;
}

#jitheme-collection-page .collection-item + .collection-item {
    margin-top: 0;
}

/* ---- 卡片主体 ---- */
#jitheme-collection-page .topic-card {
    background: var(--bg-card);
    border-radius: var(--b2radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transform: translateY(-5px);
    box-shadow: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* ---- 顶部专题大封面 ---- */
#jitheme-collection-page .card-cover {
    position: relative;
    height: 170px;
    overflow: hidden;
    background: #333;
}

#jitheme-collection-page .card-cover > a {
    display: block;
    height: 100%;
}

#jitheme-collection-page .card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

#jitheme-collection-page .topic-card:hover .card-cover img {
    transform: scale(1.05);
}

/* “专题”标签（封面右上角） */
#jitheme-collection-page .badge-topic {
    position: absolute;
    top: 0;
    right: 12px;
    background: rgba(255, 241, 230, 0.95);
    color: #d46b08;
    font-size: var(--fs-xs);
    padding: 4px 8px;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    z-index: 2;
}

/* “第N期”角标（封面右下角） */
#jitheme-collection-page .cover-issue-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--overlay-deep);
    color: #fff;
    font-size: var(--fs-xs);
    padding: 3px 8px;
    border-top-left-radius: 6px;
    line-height: 1.2;
    z-index: 2;
    backdrop-filter: blur(2px);
}

/* ---- 内容区 ---- */
#jitheme-collection-page .card-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

#jitheme-collection-page .main-title {
    font-size: var(--fs-sm);
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.4;
}

#jitheme-collection-page .main-title a {
    color: inherit;
    text-decoration: none;
}

#jitheme-collection-page .main-title a:hover {
    color: var(--color-accent);
}

#jitheme-collection-page .main-desc {
    font-size: var(--fs-xs);
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- 文章列表（只显示前 2 篇） ---- */
#jitheme-collection-page .article-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    flex-grow: 1;
}

#jitheme-collection-page .article-item:nth-child(n+3) {
    display: none;
}

#jitheme-collection-page .article-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-radius: var(--b2radius);
    text-decoration: none;
    transition: background-color 0.2s;
    background-color: var(--bg-subtle);
}

#jitheme-collection-page .article-item:hover {
    background-color: #eef4ff;
}

/* 文章小缩略图 */
#jitheme-collection-page .article-thumb {
    width: 100px;
    height: 60px;
    border-radius: var(--b2radius);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-muted);
}

/* 文章文字信息 */
#jitheme-collection-page .article-info {
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#jitheme-collection-page .article-title {
    font-size: var(--fs-sm);
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 文章分类标签 */
#jitheme-collection-page .article-category {
    font-size: var(--fs-xs);
    color: var(--text-secondary);
    background-color: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    align-self: flex-start;
    line-height: 1.2;
}

/* ---- 底部区域 ---- */
#jitheme-collection-page .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

#jitheme-collection-page .date {
    font-size: var(--fs-xs);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

#jitheme-collection-page .btn-view {
    font-size: var(--fs-xs);
    color: #fff;
    background-color: var(--color-accent);
    border: 1px solid transparent;
    padding: 4px 12px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s;
}

#jitheme-collection-page .btn-view:hover {
    background-color: #e64a19;
    color: #fff;
}

/* ---- 分页 ---- */
#jitheme-collection-page .collection-nav {
    margin-top: 20px;
}

/* ---- 响应式 ---- */
@media (max-width: 1024px) {
    #jitheme-collection-page .collection-box {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    #jitheme-collection-page .collection-box {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    #jitheme-collection-page .card-cover {
        height: 140px;
    }
}

@media (max-width: 480px) {
    #jitheme-collection-page .collection-box {
        grid-template-columns: 1fr;
    }
}

/* ---- 强制列表与 wrapper 等宽对齐 ---- */
#jitheme-collection-page.b2-collection-page {
    padding: 0;
    margin: 0;
}

#jitheme-collection-page .site-main {
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
}

#jitheme-collection-page .collection-box {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

/* ============ 暗夜模式适配（collection.css） ============ */
[data-theme="dark"] #jitheme-collection-page .badge-topic { color: var(--gold); }
[data-theme="dark"] #jitheme-collection-page .article-item:hover { background-color: #223047; }
[data-theme="dark"] #jitheme-collection-page .article-thumb { background: #2a2d33; }
[data-theme="dark"] #jitheme-collection-page .article-category { background-color: #2a2d33; }