/* =========================================================
   article_list.css — 文章列表页专用样式
   ========================================================= */

/* ── 整体容器 ── */
.al-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

/* ── 分类标签导航 ── */
.al-cat-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.al-cat-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid #e8e8e8;
    color: #555;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.18s;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.al-cat-tag:hover {
    border-color: #1890ff;
    color: #1890ff;
    background: #f0f7ff;
    text-decoration: none;
}

.al-cat-tag.active {
    background: #1890ff;
    border-color: #1890ff;
    color: #fff;
    font-weight: 500;
}

.al-cat-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: rgba(0,0,0,0.08);
    font-size: 11px;
    line-height: 1;
}

.al-cat-tag.active .al-cat-count {
    background: rgba(255,255,255,0.3);
}

/* 有子分类的tag - 带展开箭头 */
.al-cat-tag.has-sub {
    position: relative;
}

.al-cat-tag.has-sub .al-sub-arrow {
    font-size: 10px;
    transition: transform 0.2s;
    margin-left: 2px;
    opacity: 0.7;
}

.al-cat-tag.has-sub.open .al-sub-arrow {
    transform: rotate(180deg);
}

/* 子分类下拉容器 */
.al-sub-cat-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 100;
    padding: 6px;
    min-width: 160px;
    flex-direction: column;
    gap: 2px;
}

.al-sub-cat-dropdown.open {
    display: flex;
}

.al-sub-cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    border-radius: 7px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    gap: 8px;
}

.al-sub-cat-item:hover {
    background: #f0f7ff;
    color: #1890ff;
}

.al-sub-cat-item.active {
    background: #1890ff;
    color: #fff;
}

.al-sub-cat-item .al-cat-count {
    background: rgba(0,0,0,0.08);
}

.al-sub-cat-item.active .al-cat-count {
    background: rgba(255,255,255,0.3);
}

/* 父级tag包装（用于定位下拉） */
.al-cat-tag-wrap {
    position: relative;
}

/* ── 主体单栏布局（无右侧边栏） ── */
.al-body {
    display: block;
}

/* 侧边栏隐藏 */
.al-sidebar {
    display: none !important;
}

/* article-grid 在文章列表页的间距 */
.al-main .article-grid {
    margin-top: 0;
}

/* 分类标签（文章卡片meta中） */
.article-cat-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #1890ff;
    background: #f0f7ff;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
}

.article-cat-tag svg {
    fill: #1890ff;
    flex-shrink: 0;
}

/* ── 空状态 ── */
.al-empty {
    background: #fff;
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    color: #bbb;
}

.al-empty p {
    margin-top: 14px;
    font-size: 14px;
}

/* ── 文章列表 ── */
.al-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── 文章卡片 ── */
.al-card {
    display: flex;
    gap: 16px;
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.04);
    transition: box-shadow 0.2s, transform 0.2s;
    overflow: hidden;
}

.al-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.al-card-thumb {
    flex-shrink: 0;
    width: 140px;
    height: 94px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f7fa;
}

.al-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s;
}

.al-card-thumb img.loaded {
    opacity: 1;
}

.al-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.al-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: break-word;
}

.al-card:hover .al-card-title {
    color: #1890ff;
}

.al-card-desc {
    font-size: 13px;
    color: #777;
    line-height: 1.6;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    word-break: break-word;
    overflow-wrap: break-word;
}

.al-card-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.al-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: #aaa;
}

.al-card-meta svg {
    flex-shrink: 0;
    fill: #bbb;
}

.al-meta-cat {
    color: #1890ff !important;
    background: #f0f7ff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px !important;
}

.al-meta-cat svg {
    fill: #1890ff !important;
}

/* ── 分页 ── */
.al-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.al-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    background: #fff;
    color: #555;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.18s;
    cursor: pointer;
}

.al-page-btn:hover {
    border-color: #1890ff;
    color: #1890ff;
    text-decoration: none;
}

.al-page-btn.current {
    background: #1890ff;
    border-color: #1890ff;
    color: #fff;
    font-weight: 600;
    cursor: default;
}

.al-page-btn svg {
    fill: currentColor;
}

.al-page-ellipsis {
    color: #bbb;
    padding: 0 4px;
    font-size: 14px;
}

/* ── 侧边栏卡片 ── */
.al-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 80px;
}

.al-sidebar-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.04);
}

.al-sidebar-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.al-sidebar-title svg {
    fill: #1890ff;
    flex-shrink: 0;
}

/* 侧边栏分类列表 */
.al-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.al-cat-list li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #555;
    text-decoration: none;
    transition: all 0.15s;
}

.al-cat-list li a:hover {
    background: #f5f7fa;
    color: #1890ff;
    text-decoration: none;
}

.al-cat-list li a.active {
    background: #f0f7ff;
    color: #1890ff;
    font-weight: 500;
}

.al-cat-list-count {
    font-size: 11px;
    color: #bbb;
    background: #f5f5f5;
    padding: 1px 7px;
    border-radius: 10px;
    flex-shrink: 0;
}

.al-cat-list li a.active .al-cat-list-count {
    background: #e0f0ff;
    color: #1890ff;
}

/* 热门文章列表 - 首页风格 */
.al-hot-articles-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.al-hot-article-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
    border-bottom: 1px solid #f5f5f5;
}

.al-hot-article-item:last-child {
    border-bottom: none;
}

.al-hot-article-item:hover {
    background: #f8f9fa;
    text-decoration: none;
    color: inherit;
}

.al-hot-article-thumb {
    position: relative;
    flex-shrink: 0;
    width: 64px;
    height: 44px;
    border-radius: 6px;
    overflow: hidden;
    background: #f0f2f5;
}

.al-hot-article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.al-hot-article-item.al-hot-featured .al-hot-article-thumb {
    width: 100%;
    height: 110px;
    border-radius: 8px;
}

.al-hot-article-item.al-hot-featured {
    flex-direction: column;
    align-items: stretch;
    padding: 0 0 10px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 2px;
}

.al-hot-rank-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    line-height: 1.4;
    color: #fff;
}

.al-hot-rank-badge.rank-1 { background: linear-gradient(135deg,#ff6b35,#f7931e); }
.al-hot-rank-badge.rank-2 { background: linear-gradient(135deg,#667eea,#764ba2); }
.al-hot-rank-badge.rank-3 { background: linear-gradient(135deg,#11998e,#38ef7d); }
.al-hot-rank-badge.rank-gray { background: rgba(0,0,0,0.35); }

.al-hot-article-info {
    flex: 1;
    min-width: 0;
}

.al-hot-article-title {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    margin: 0 0 4px;
    line-height: 1.45;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.al-hot-article-item.al-hot-featured .al-hot-article-title {
    font-size: 14px;
    font-weight: 600;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-top: 8px;
}

.al-hot-article-item:hover .al-hot-article-title {
    color: #1890ff;
}

.al-hot-article-meta {
    font-size: 11px;
    color: #bbb;
}

/* 最新文章列表 */
.al-latest-articles-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.al-latest-article-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 4px;
    border-radius: 6px;
    font-size: 13px;
    color: #555;
    text-decoration: none;
    transition: color 0.15s;
    border-bottom: 1px solid #f5f5f5;
}

.al-latest-article-item:last-child {
    border-bottom: none;
}

.al-latest-article-item:hover {
    color: #1890ff;
    text-decoration: none;
}

.al-latest-article-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: #f0f0f0;
    font-size: 11px;
    font-weight: 700;
    color: #999;
    flex-shrink: 0;
}

.al-latest-article-item:nth-child(1) .al-latest-article-num { background: #ff4d4f; color: #fff; }
.al-latest-article-item:nth-child(2) .al-latest-article-num { background: #ff7a45; color: #fff; }
.al-latest-article-item:nth-child(3) .al-latest-article-num { background: #ffa940; color: #fff; }

.al-latest-article-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.al-latest-article-date {
    font-size: 11px;
    color: #bbb;
    flex-shrink: 0;
}

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1024px) {
    .al-card-thumb {
        width: 110px;
        height: 76px;
    }
}

@media (max-width: 768px) {
    .al-wrapper {
        padding: 14px 10px 30px;
    }

    .al-body {
        display: block;
    }

    .al-main {
        width: 100%;
    }

    .al-cat-nav {
        gap: 6px;
        margin-bottom: 14px;
    }

    .al-cat-tag {
        padding: 4px 10px;
        font-size: 12px;
    }

    .al-card {
        padding: 12px;
        gap: 12px;
    }

    .al-card-thumb {
        width: 90px;
        height: 64px;
    }

    .al-card-title {
        font-size: 14px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin: 0 0 6px;
    }

    .al-card-desc {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 12px;
        margin: 0 0 6px;
    }

    .al-card-meta {
        gap: 10px;
    }

    .al-page-btn {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .al-card-thumb {
        width: 80px;
        height: 56px;
    }

    .al-card-title {
        font-size: 13px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}
