/*
 * site-list.css —— 子页面列表的「统一卡片 + 统一分页」样式
 *
 * 背景：赛事 / 优秀作品 / 教程 / 提示词 / 行业招聘 / 优秀创作者 / AI应用 七个列表页
 * 各自维护过一套卡片与「加载更多」，圆角 6~24px、标题 16~20px、间距 14~24px 各不相同。
 * 这里把外壳收成一套（圆角 8px / 1px 描边 / #0b0b0c 底 / hover 上浮 3px），
 * 页面只负责卡片内部字段，不再各自定义容器。
 *
 * 加载顺序：必须在各页自有 <style> 与 aidir-editorial.css 之后引入。
 */

/* ── 1. 卡片外壳：统一圆角 / 描边 / 底色 / 悬停 ───────────────── */
body:not(.home-v2) :is(.event-card, .video-card, .tutorial-card, .prompt-card, .job-card, .community-creator-card, .vc-card) {
    border: 1px solid var(--a-line, rgba(255, 255, 255, .12)) !important;
    border-radius: 8px !important;
    background: var(--a-surface, #0b0b0c) !important;
    box-shadow: none !important;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease !important;
}
body:not(.home-v2) :is(.event-card, .video-card, .tutorial-card, .prompt-card, .job-card, .community-creator-card, .vc-card):hover {
    transform: translateY(-3px) !important;
    border-color: var(--a-line-strong, rgba(255, 255, 255, .22)) !important;
    background: var(--a-surface-2, #111214) !important;
}

/* 文本型卡片：内边距与描边同一套 */
body:not(.home-v2) :is(.event-card, .job-card, .community-creator-card) {
    padding: 20px !important;
}

/* 封面型卡片：封面通栏 16:10，正文统一 18px 内边距 */
body:not(.home-v2) :is(.video-card, .tutorial-card, .prompt-card, .vc-card) {
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    overflow: hidden !important;
}
/* 同一行里标题长短不一时，底部动作按钮仍然齐平 */
body:not(.home-v2) :is(.video-card, .tutorial-card, .prompt-card, .vc-card) :is(.video-thumb, .tutorial-thumb, .card-thumb, .vc-cover) {
    flex: 0 0 auto !important;
}
body:not(.home-v2) :is(.video-card, .tutorial-card, .prompt-card, .vc-card) :is(.video-body, .tutorial-body, .prompt-body, .vc-body, .card-body) {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    padding: 18px !important;
}
body:not(.home-v2) :is(.video-card, .tutorial-card, .prompt-card, .vc-card) :is(.video-footer, .tutorial-footer, .card-footer, .vc-footer) {
    margin-top: auto !important;
}
body:not(.home-v2) :is(.video-card, .tutorial-card, .prompt-card, .vc-card) :is(.video-thumb, .tutorial-thumb, .tutorial-cover, .prompt-cover, .vc-cover, .card-thumb) {
    aspect-ratio: 16 / 10 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border-bottom: 1px solid var(--a-line, rgba(255, 255, 255, .12)) !important;
}
body:not(.home-v2) :is(.video-card, .tutorial-card, .prompt-card, .vc-card) :is(.video-body, .tutorial-body, .prompt-body, .vc-body, .card-body) {
    padding: 18px !important;
}

/* ── 2. 卡片文字层级：标题 18 / 摘要 13 / 元信息 13 ───────────── */
body:not(.home-v2) :is(.event-card, .video-card, .tutorial-card, .prompt-card, .job-card, .community-creator-card, .vc-card) :is(h2, h3) {
    font-size: 18px !important;
    line-height: 1.45 !important;
    font-weight: 600 !important;
    letter-spacing: -.01em !important;
    color: var(--a-text, #f5f5f3) !important;
}
body:not(.home-v2) :is(.event-card, .video-card, .tutorial-card, .prompt-card, .job-card, .community-creator-card, .vc-card) :is(.event-meta, .video-meta, .tutorial-meta, .prompt-meta, .card-meta, .job-meta, .job-meta-item, .vc-meta, .vc-summary, .community-tags, .job-desc, .event-prize) {
    font-size: 13px !important;
    line-height: 1.7 !important;
    color: rgba(255, 255, 255, .55) !important;
}

/* 卡片底部操作按钮：提示词页的 .prompt-btn 也收进同一套 */
body:not(.home-v2) .prompt-card .prompt-btn {
    height: 40px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, .08) !important;
    background: rgba(255, 255, 255, .04) !important;
    color: rgba(255, 255, 255, .84) !important;
    font-size: 13px !important;
}
body:not(.home-v2) .prompt-card .prompt-btn:hover {
    background: rgba(255, 255, 255, .07) !important;
    border-color: rgba(255, 255, 255, .14) !important;
    color: #fff !important;
}

/* 卡片底部「查看详情」按钮：高度 / 圆角统一 */
body:not(.home-v2) :is(.event-card, .video-card, .tutorial-card, .prompt-card, .job-card) .detail-link {
    height: 40px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
}

/* 标签：统一成站内 .badge 规格（28px 高 / 3px 圆角 / 12px）；AI应用的 .vc-meta-item 由 vibecoding.css 接管 */
body:not(.home-v2) :is(.event-card, .video-card, .tutorial-card, .prompt-card, .job-card, .community-creator-card, .vc-card) :is(.event-tag, .event-badge, .community-tags span, .tutorial-tag, .prompt-tag, .job-tag, .badge) {
    height: 24px !important;
    padding: 0 9px !important;
    border-radius: 3px !important;
    border: 1px solid rgba(255, 255, 255, .08) !important;
    background: rgba(255, 255, 255, .04) !important;
    color: rgba(255, 255, 255, .62) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
}

/* ── 3. 栅格节奏：封面型 4 列 / 文本型 3 列，间距统一 20px ──────── */
body:not(.home-v2) :is(.videos-grid, .tutorials-grid, .prompt-grid, .vc-grid) {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 20px !important;
}
body:not(.home-v2) :is(.events-grid, .jobs-grid, .community-results) {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 20px !important;
}
@media (max-width: 1100px) {
    body:not(.home-v2) :is(.videos-grid, .tutorials-grid, .prompt-grid, .vc-grid) {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
    body:not(.home-v2) :is(.events-grid, .jobs-grid, .community-results) {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}
@media (max-width: 767px) {
    body:not(.home-v2) :is(.videos-grid, .tutorials-grid, .prompt-grid, .vc-grid, .events-grid, .jobs-grid, .community-results) {
        grid-template-columns: 1fr !important;
    }
}

/* 岗位/教程的说明型小胶囊也统一成 3px 直角标签 */
body:not(.home-v2) :is(.job-card, .tutorial-card, .prompt-card) :is(.job-meta-item, .tutorial-type) {
    border-radius: 3px !important;
    background: rgba(255, 255, 255, .04) !important;
    border-color: rgba(255, 255, 255, .08) !important;
    color: rgba(255, 255, 255, .62) !important;
    font-size: 12px !important;
}

/* 创作者卡片：青色点缀收回到站内紫色主色 */
body:not(.home-v2) .community-profile-link {
    width: 28px !important;
    height: 28px !important;
    border: 1px solid rgba(255, 255, 255, .1) !important;
    background: rgba(255, 255, 255, .03) !important;
    color: rgba(255, 255, 255, .55) !important;
}
body:not(.home-v2) .community-profile-link:hover {
    border-color: rgba(109, 94, 246, .5) !important;
    background: rgba(109, 94, 246, .16) !important;
    color: #fff !important;
}
body:not(.home-v2) .community-avatar-fallback { color: rgba(255, 255, 255, .55) !important; }
body:not(.home-v2) .community-loader { border-top-color: #6D5EF6 !important; }

/* ── 4. 统一分页条（SitePager 生成）：页码 + 上一页/下一页 + 跳页 ───────── */
.site-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px 20px;
    flex-wrap: wrap;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, .06);
    transition: opacity .16s ease;
}
.site-pager[hidden] { display: none !important; }
.site-pager.is-loading { opacity: .6; }
.site-pager-status {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, .42);
    letter-spacing: 0;
    white-space: nowrap;
}
.site-pager-status strong {
    color: var(--a-text, #f5f5f3);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.site-pager-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* 每页数量：分段控件 */
.site-pager-sizes {
    display: inline-flex;
    align-items: stretch;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    background: rgba(255, 255, 255, .03);
    overflow: hidden;
}
.site-pager-sizes[hidden] { display: none !important; }
.site-pager-sizes-label {
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border-right: 1px solid rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .34);
    font-size: 12px;
    user-select: none;
}
.site-pager-size {
    min-width: 42px;
    padding: 0 10px;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, .08);
    background: transparent;
    color: rgba(255, 255, 255, .55);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
}
.site-pager-size:last-child { border-right: 0; }
.site-pager-size:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.site-pager-size.is-active,
.site-pager-size[aria-pressed="true"] {
    background: rgba(109, 94, 246, .18);
    color: #cfc8ff;
}

/* 只有一页时这两个块会被 [hidden] 收起（作者样式里的 inline-flex 会盖掉 UA 的 display:none） */
.site-pager-pages[hidden],
.site-pager-jump[hidden] { display: none !important; }

/* 页码：上一页 / 1 … 7 / 下一页 */
.site-pager-pages {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.site-pager-step,
.site-pager-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    min-width: 34px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    background: rgba(255, 255, 255, .03);
    color: rgba(255, 255, 255, .62);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.site-pager-step { gap: 5px; }
.site-pager-step .fa { font-size: 13px; line-height: 1; }
.site-pager-num { padding: 0 8px; font-variant-numeric: tabular-nums; }
.site-pager-step:hover:not(:disabled),
.site-pager-num:hover:not(.is-active) {
    background: rgba(255, 255, 255, .07);
    border-color: rgba(255, 255, 255, .18);
    color: #fff;
}
.site-pager-num.is-active {
    background: #442DD8;
    border-color: #442DD8;
    color: #fff;
    font-weight: 600;
    cursor: default;
}
.site-pager-step:disabled {
    opacity: .32;
    cursor: not-allowed;
}
.site-pager-gap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 34px;
    color: rgba(255, 255, 255, .3);
    font-size: 13px;
    user-select: none;
}

/* 跳页 */
.site-pager-jump {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 12px;
    color: rgba(255, 255, 255, .42);
}
.site-pager-jump-label { user-select: none; }
.site-pager-jump-unit { user-select: none; }
.site-pager-jump-input {
    width: 48px;
    height: 34px !important;
    min-height: 0 !important;
    padding: 0 6px !important;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    background: rgba(255, 255, 255, .03);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    line-height: normal;
    text-align: center;
    box-shadow: none;
    transition: border-color .16s ease, background .16s ease;
}
.site-pager-jump-input::placeholder { color: rgba(255, 255, 255, .26); font-size: 12px; }
.site-pager-jump-input:focus {
    outline: none;
    border-color: rgba(109, 94, 246, .6);
    background: rgba(109, 94, 246, .1);
}
.site-pager-jump-input.is-invalid {
    border-color: rgba(255, 107, 107, .8);
    background: rgba(255, 107, 107, .1);
}
.site-pager-jump-btn {
    height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 8px;
    background: rgba(255, 255, 255, .04);
    color: rgba(255, 255, 255, .78);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.site-pager-jump-btn:hover {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .2);
    color: #fff;
}

.site-pager-step:focus-visible,
.site-pager-num:focus-visible,
.site-pager-size:focus-visible,
.site-pager-jump-btn:focus-visible {
    outline: 1px solid #66dcff;
    outline-offset: 2px;
}

@media (max-width: 1080px) {
    .site-pager-controls { width: 100%; justify-content: flex-start; }
    /* 换行后跳页控件靠右收口，避免孤零零贴在左边 */
    .site-pager-jump { margin-left: auto; }
}

@media (max-width: 700px) {
    .site-pager {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }
    .site-pager-status { white-space: normal; }
    .site-pager-controls {
        justify-content: space-between;
        gap: 10px;
    }
    /* 页码整行居中排在最前，手机上好点 */
    .site-pager-pages { order: -1; width: 100%; justify-content: center; flex-wrap: wrap; }
    .site-pager-step { padding: 0 9px; }
    .site-pager-step span { display: none; }
    .site-pager-sizes-label { padding: 0 8px; }
    .site-pager-size { min-width: 38px; padding: 0 8px; }
}

@media (max-width: 359px) {
    .site-pager-pages { gap: 5px; }
    .site-pager-step,
    .site-pager-num { min-width: 30px; padding: 0 6px; }
    .site-pager-jump-input { width: 42px; }
}
