/* ============================================================
   小蓝模板扩展组件样式（含暗黑模式适配）
   ============================================================ */

/* ---------- 全站字体 ---------- */
html, body {
    font-family: Lantinghei SC, "Open Sans", Arial, "Hiragino Sans GB",
        "Microsoft YaHei", "微软雅黑", STHeiti, "WenQuanYi Micro Hei", sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
pre, code, kbd, samp {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Courier New", "Microsoft YaHei", monospace !important;
}

/* ---------- 分类快捷入口宫格 ---------- */
.xl-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
@media (min-width: 768px) {
    .xl-quick-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 16px; }
}
.xl-quick-item { display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; }
.xl-quick-icon {
    width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 20px;
    transition: transform .2s ease, box-shadow .2s ease;
    box-shadow: 0 4px 12px rgba(22, 93, 255, .18);
}
.xl-quick-item:hover .xl-quick-icon { transform: translateY(-3px) scale(1.04); }
.xl-quick-name { font-size: 13px; color: var(--fontColor, #374151); max-width: 100%; }
.xl-grad-1 { background: linear-gradient(135deg, #3b82f6, #165dff); }
.xl-grad-2 { background: linear-gradient(135deg, #f59e0b, #ff7d00); }
.xl-grad-3 { background: linear-gradient(135deg, #10b981, #00b42a); }
.xl-grad-4 { background: linear-gradient(135deg, #8b5cf6, #722ed1); }
.xl-grad-5 { background: linear-gradient(135deg, #06b6d4, #14c9c9); }
.xl-grad-6 { background: linear-gradient(135deg, #ec4899, #f53f3f); }
.xl-grad-7 { background: linear-gradient(135deg, #6366f1, #4338ca); }
.xl-grad-8 { background: linear-gradient(135deg, #84cc16, #389e0d); }

/* ---------- 公告跑马灯 ---------- */
.xl-notice-bar {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; overflow: hidden;
}
.xl-notice-badge {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600; color: #165dff;
    background: rgba(22, 93, 255, .1); border-radius: 999px; padding: 4px 12px;
}
.xl-notice-viewport { flex: 1; min-width: 0; height: 26px; overflow: hidden; position: relative; }
.xl-notice-list { list-style: none; margin: 0; padding: 0; position: absolute; width: 100%;
    animation: xlNoticeRoll 14s linear infinite; }
.xl-notice-bar:hover .xl-notice-list { animation-play-state: paused; }
.xl-notice-item { height: 26px; line-height: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xl-notice-item a { font-size: 13px; color: var(--fontColor, #374151); text-decoration: none; }
.xl-notice-item a:hover { color: #165dff; }
.xl-notice-more { flex-shrink: 0; font-size: 12px; color: #165dff; text-decoration: none; }
@keyframes xlNoticeRoll {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

/* ---------- 通用 TAB（资源精选 / 排行榜） ---------- */
.xl-tab-btn {
    display: inline-flex; align-items: center;
    padding: 6px 16px; border-radius: 999px; border: 1px solid var(--borderColor, #e5e7eb);
    background: transparent; color: var(--fontColor, #374151);
    font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
    transition: all .18s ease;
}
.xl-tab-btn:hover { color: #165dff; border-color: #165dff; }
.xl-tab-btn.active {
    background: #165dff; border-color: #165dff; color: #fff;
    box-shadow: 0 4px 10px rgba(22, 93, 255, .25);
}
.xl-tab-panel { display: none; }
.xl-tab-panel.active { display: block; animation: xlFadeIn .25s ease; }
@keyframes xlFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- 排行榜 ---------- */
.xl-rank-list { list-style: none; margin: 0; padding: 0; }
.xl-rank-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 4px; border-bottom: 1px dashed var(--borderColor, #e5e7eb);
}
.xl-rank-item:last-child { border-bottom: none; }
.xl-rank-no {
    flex-shrink: 0; width: 22px; height: 22px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: #9ca3af;
    background: var(--bgSoftColor, #f3f4f6);
}
.xl-rank-no.xl-rank-top { color: #fff; font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
.xl-rank-no.xl-rank-1 { background: linear-gradient(135deg, #ffe066, #ffb300); box-shadow: 0 2px 10px rgba(255, 183, 0, .55); }
.xl-rank-no.xl-rank-2 { background: linear-gradient(135deg, #f8fafc, #c3cdd9); box-shadow: 0 2px 10px rgba(178, 190, 205, .55); }
.xl-rank-no.xl-rank-3 { background: linear-gradient(135deg, #ffb37a, #ff7a45); box-shadow: 0 2px 10px rgba(255, 122, 69, .5); }
.xl-rank-title { flex: 1; min-width: 0; font-size: 14px; color: var(--fontColor, #374151); text-decoration: none; }
.xl-rank-title:hover { color: #165dff; }
.xl-rank-views { flex-shrink: 0; font-size: 12px; color: #9ca3af; }
.xl-rank-views i { margin-right: 2px; }

/* ---------- 侧栏热门文章 ---------- */
.xl-side-hot { display: flex; flex-direction: column; gap: 2px; }
.xl-side-rank { flex-shrink: 0; width: 28px; display: flex; justify-content: center; align-items: center; margin-top: 1px; }
.xl-side-hot-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 8px 8px; border-radius: 10px;
    text-decoration: none;
    transition: background .15s ease;
}
.xl-side-hot-item:hover { background: rgba(22, 93, 255, .06); }
.xl-side-hot-title {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    overflow: hidden; text-overflow: ellipsis;
    font-size: 13.5px; font-weight: 500; line-height: 1.5;
    color: var(--fontColor, #374151);
    transition: color .15s ease;
}
.xl-side-hot-item:hover .xl-side-hot-title { color: #165dff; }
.xl-side-hot-meta {
    display: flex; align-items: center; gap: 4px;
    margin-top: 3px; font-size: 11.5px; color: #9ca3af; white-space: nowrap;
}
.xl-side-hot-meta i { font-size: 10.5px; }
.dark .xl-side-hot-item:hover { background: rgba(108, 162, 255, .1); }
.dark .xl-side-hot-title { color: #e5e7eb; }
.dark .xl-side-hot-item:hover .xl-side-hot-title { color: #6ca2ff; }
.dark .xl-side-hot-meta { color: #6b7280; }

/* ---------- 首页最近热门数据 ---------- */
.xl-hotdata { display: flex; flex-direction: column; }
.xl-hotdata-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 8px; border-radius: 12px;
    transition: background .15s ease;
}
.xl-hotdata-item:hover { background: rgba(22, 93, 255, .05); }
.xl-hotdata-item .xl-side-rank { margin-top: 0; }
.xl-hotdata-thumb {
    width: 96px; height: 64px; border-radius: 10px; object-fit: cover;
    display: block; flex-shrink: 0;
    transition: transform .2s ease;
}
.xl-hotdata-item:hover .xl-hotdata-thumb { transform: scale(1.05); }
.xl-hotdata-title {
    font-size: 15px; font-weight: 600; line-height: 1.5; margin: 0;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    overflow: hidden; text-overflow: ellipsis;
}
.xl-hotdata-title a { color: var(--fontColor, #1f2937); text-decoration: none; transition: color .15s ease; }
.xl-hotdata-item:hover .xl-hotdata-title a { color: #165dff; }
.xl-hotdata-excerpt {
    font-size: 12.5px; color: #9ca3af; line-height: 1.5; margin: 2px 0 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.xl-hotdata-meta {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-top: 5px; font-size: 12px; color: #9ca3af;
}
.xl-hotdata-views { color: #9ca3af; }
.xl-hotdata-views i { margin-right: 3px; font-size: 11px; }
.dark .xl-hotdata-item:hover { background: rgba(108, 162, 255, .08); }
.dark .xl-hotdata-title a { color: #e5e7eb; }
.dark .xl-hotdata-item:hover .xl-hotdata-title a { color: #6ca2ff; }
.dark .xl-hotdata-excerpt { color: #6b7280; }
.dark .xl-hotdata-meta { color: #6b7280; }
.dark .xl-hotdata-views { color: #6b7280; }

/* ---------- 用户评价页 ---------- */
.xl-review-hero {
    border-radius: 16px;
    padding: 26px 24px;
    border: 1px solid rgba(22, 93, 255, .16);
    background:
        linear-gradient(135deg, rgba(22, 93, 255, .07) 0%, rgba(255, 125, 0, .05) 55%, rgba(22, 93, 255, .03) 100%),
        var(--tw-card, #fff);
}
.xl-review-chip {
    display: inline-flex; align-items: center;
    padding: 4px 12px; border-radius: 999px;
    background: var(--tw-card, #fff);
    border: 1px solid var(--tw-border, #e5e6eb);
    font-weight: 600;
}
.xl-review-stats {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px; min-width: 260px;
}
.xl-stat-box {
    background: var(--tw-card, #fff);
    border: 1px solid var(--tw-border, #e5e6eb);
    border-radius: 12px; padding: 14px 8px; text-align: center;
}
.xl-stat-num { font-size: 24px; font-weight: 800; color: #165dff; line-height: 1.2; }
.xl-stat-label { font-size: 12px; color: #86909c; margin-top: 2px; }
.xl-review-grid {
    display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 16px;
}
@media (min-width: 768px) { .xl-review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .xl-review-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.xl-review-card {
    position: relative;
    background: var(--tw-card, #fff);
    border: 1px solid var(--tw-border, #e5e6eb);
    border-radius: 14px; padding: 18px;
    transition: transform .18s ease, box-shadow .18s ease;
}
.xl-review-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(22, 93, 255, .1);
    border-color: rgba(22, 93, 255, .35);
}
.xl-review-quote {
    position: absolute; top: 10px; right: 16px;
    font-family: Georgia, serif; font-size: 42px; line-height: 1;
    color: rgba(22, 93, 255, .12); pointer-events: none;
}
.xl-review-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 17px; flex-shrink: 0;
}
.xl-review-stars { color: #ffb300; font-size: 12.5px; letter-spacing: 2px; margin-top: 2px; }
.xl-star-off { color: #dcdfe6; }
.xl-review-content {
    font-size: 13.5px; line-height: 1.7; color: #4e5969;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4;
    overflow: hidden; text-overflow: ellipsis;
}
.dark .xl-review-hero { background: linear-gradient(135deg, rgba(22,93,255,.12) 0%, rgba(255,125,0,.07) 55%, rgba(22,93,255,.05) 100%), #161a24; border-color: rgba(108,162,255,.25); }
.dark .xl-review-hero h1 { color: #e5e7eb !important; }
.dark .xl-review-hero p { color: #9ca3af !important; }
.dark .xl-review-chip { background: #161a24; }
.dark .xl-stat-box { background: #161a24; }
.dark .xl-stat-label { color: #6b7280; }
.dark .xl-review-card { background: #161a24; }
.dark .xl-review-card p[style*="#1d2129"] { color: #e5e7eb !important; }
.dark .xl-review-content { color: #9ca3af; }
.dark .xl-star-off { color: #374151; }

/* ---------- 面包屑 ---------- */
.xl-breadcrumb {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    font-size: 13px; margin-bottom: 12px; color: #6b7280;
}
.xl-breadcrumb a { color: #6b7280; text-decoration: none; }
.xl-breadcrumb a:hover { color: #165dff; }
.xl-breadcrumb i { font-size: 11px; color: #9ca3af; }

/* ---------- 点赞 / 收藏按钮 ---------- */
.xl-log-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.xl-action-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 18px; border-radius: 999px;
    border: 1px solid var(--borderColor, #e5e7eb); background: transparent;
    color: var(--fontColor, #374151); font-size: 13px; cursor: pointer;
    transition: all .18s ease;
}
.xl-action-btn i { font-size: 14px; }
.xl-action-btn b { font-weight: 600; }
.xl-action-btn:hover { border-color: #165dff; color: #165dff; }
.xl-like-btn.liked { background: rgba(245, 63, 63, .08); border-color: #f53f3f; color: #f53f3f; }
.xl-like-btn.liked i { animation: xlPop .35s ease; }
.xl-collect-btn.collected { background: rgba(255, 125, 0, .1); border-color: #ff7d00; color: #ff7d00; }
.xl-collect-btn.collected i { animation: xlPop .35s ease; }
@keyframes xlPop { 0% { transform: scale(1); } 50% { transform: scale(1.45); } 100% { transform: scale(1); } }

/* ---------- 下载卡 ---------- */
.xl-down-card {
    margin-top: 20px;
    padding: 18px 20px;
    border: 1px solid rgba(22, 93, 255, .18);
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(22, 93, 255, .05) 0%, rgba(77, 139, 255, .02) 45%, transparent 100%),
        var(--bgCardColor, #fff);
    box-shadow: 0 8px 24px rgba(22, 93, 255, .07);
}
.xl-down-row {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.xl-down-ico {
    flex-shrink: 0;
    width: 56px; height: 56px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: #fff;
    background: linear-gradient(135deg, #3b82f6, #165dff);
    box-shadow: 0 6px 16px rgba(22, 93, 255, .32);
}
.xl-down-info { flex: 1; min-width: 220px; }
.xl-down-t1 { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.xl-down-tag {
    display: inline-flex; align-items: center;
    padding: 1px 10px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600; letter-spacing: .5px;
    color: #165dff; background: rgba(22, 93, 255, .12);
}
.xl-down-title {
    font-size: 16px; font-weight: 700; color: #1f2937;
    margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.xl-down-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.xl-down-times { font-size: 12.5px; color: #6b7280; }
.xl-down-times i { margin-right: 4px; color: #165dff; }
.xl-down-times b { font-weight: 700; color: #165dff; font-size: 14px; }
.xl-down-hint { font-size: 12.5px; color: #9ca3af; }
.xl-down-hint i { margin-right: 4px; }
.xl-down-btn {
    flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 13px 30px; border-radius: 999px;
    font-size: 15px; font-weight: 700; letter-spacing: 1px;
    color: #fff !important; text-decoration: none !important;
    background: linear-gradient(135deg, #3b82f6 0%, #165dff 100%);
    box-shadow: 0 10px 24px rgba(22, 93, 255, .35);
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.xl-down-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(22, 93, 255, .42);
    filter: brightness(1.04);
}
.xl-down-btn i { font-size: 16px; }
.xl-down-pwd { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.xl-down-pwd-label { font-size: 12px; color: #6b7280; }
.xl-down-pwd-label i { margin-right: 3px; color: #ff7d00; }
.xl-down-pwd-code {
    padding: 3px 12px; border-radius: 6px; font-size: 14px; font-weight: 700; letter-spacing: 2px;
    background: rgba(22, 93, 255, .08); color: #165dff; border: 1px dashed rgba(22, 93, 255, .35);
}
.xl-copy-pwd {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 12px; border-radius: 6px; border: none; cursor: pointer;
    background: #165dff; color: #fff; font-size: 12px;
    transition: opacity .15s ease;
}
.xl-copy-pwd:hover { opacity: .85; }
/* 网盘标识徽章 */
.xl-pan-badge {
    display: inline-flex; align-items: center;
    padding: 2px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600; color: var(--pan-color, #165dff);
    background: color-mix(in srgb, var(--pan-color, #165dff) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--pan-color, #165dff) 35%, transparent);
}

/* ---------- 多地址下载弹窗 ---------- */
.xl-down-modal { position: fixed; inset: 0; z-index: 99990; display: flex; align-items: center; justify-content: center; }
.xl-down-modal[hidden] { display: none; }
.xl-down-modal-mask { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px); }
.xl-down-modal-box {
    position: relative; width: 92%; max-width: 400px;
    background: var(--tw-card, #fff); border-radius: 14px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .3); overflow: hidden;
}
.xl-down-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--tw-border, #e5e6eb);
    font-size: 15px; font-weight: 700; color: #1d2129;
}
.xl-down-modal-head i { color: #165dff; margin-right: 6px; }
.xl-down-modal-close {
    border: none; background: none; color: #86909c; font-size: 15px; cursor: pointer;
    padding: 4px 8px; border-radius: 6px;
}
.xl-down-modal-close:hover { color: #165dff; background: rgba(22, 93, 255, .08); }
.xl-down-modal-body { padding: 8px; }
.xl-down-modal-body .xl-down-pwd { padding: 0 10px 12px; }
.xl-down-opt {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 12px; margin: 4px 0; border-radius: 10px;
    text-decoration: none !important;
    border: 1px solid var(--tw-border, #e5e6eb);
    transition: border-color .15s, background .15s, transform .15s;
}
.xl-down-opt:hover {
    border-color: #165dff; background: rgba(22, 93, 255, .05); transform: translateX(2px);
}
.xl-down-opt-badge {
    flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #3b82f6, #165dff);
    color: #fff; font-size: 13px; font-weight: 700;
}
.xl-down-opt-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.xl-down-opt-label { font-size: 12.5px; color: #86909c; }
.xl-down-opt-go { color: #c9cdd4; font-size: 13px; }
.xl-down-opt:hover .xl-down-opt-go { color: #165dff; }
.dark .xl-down-modal-box { background: #161a24; }
.dark .xl-down-modal-head { color: #e5e7eb; border-bottom-color: #2b3445; }
.dark .xl-down-opt { border-color: #2b3445; }
.dark .xl-down-opt:hover { background: rgba(108, 162, 255, .08); border-color: #6ca2ff; }
.dark .xl-down-opt-label { color: #6b7280; }

/* ---------- 文章内容标题 ---------- */
.article-content, .resource-content { counter-reset: xlheading; }
.article-content h1, .article-content h2, .article-content h3,
.article-content h4, .article-content h5, .resource-content h1, .resource-content h2,
.resource-content h3, .resource-content h4, .resource-content h5 {
    background: none !important;
    border-radius: 0 !important;
    border-left: none !important;
    padding: 0 !important;
    margin: 1.6em 0 .75em !important;
    font-weight: 800;
    color: #111827;
    line-height: 1.5;
}
.article-content h1, .article-content h2, .resource-content h1, .resource-content h2 {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
    counter-increment: xlheading;
    font-size: 1.28em;
}
.article-content h1::before, .article-content h2::before,
.resource-content h1::before, .resource-content h2::before {
    content: counter(xlheading);
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 26px; height: 26px; padding: 0 6px;
    border-radius: 9px;
    background: linear-gradient(135deg, #3b82f6, #165dff);
    color: #fff;
    font-size: 13px; font-weight: 800;
    box-shadow: 0 3px 8px rgba(22, 93, 255, .35);
}
.article-content h3, .resource-content h3 {
    display: flex; align-items: center; gap: 9px;
    font-size: 1.18em;
}
.article-content h3::before, .resource-content h3::before {
    content: '';
    flex-shrink: 0;
    width: 6px; height: 18px;
    border-radius: 4px;
    background: linear-gradient(180deg, #3b82f6, #165dff);
}
.article-content h4, .article-content h5, .resource-content h4, .resource-content h5 {
    display: flex; align-items: center; gap: 8px;
    font-size: 1.08em;
    padding: 0 !important;
    border-left: none !important;
}
.article-content h4::before, .article-content h5::before,
.resource-content h4::before, .resource-content h5::before {
    content: '';
    flex-shrink: 0;
    width: 5px; height: 15px;
    border-radius: 3px;
    background: linear-gradient(180deg, #3b82f6, #165dff);
}
.dark .article-content h1, .dark .article-content h2, .dark .article-content h3,
.dark .article-content h4, .dark .article-content h5,
.dark .resource-content h1, .dark .resource-content h2, .dark .resource-content h3,
.dark .resource-content h4, .dark .resource-content h5 { color: #f3f4f6; }

/* ---------- 排行皇冠（内联SVG矢量，金银铜） ---------- */
.xl-crown-svg { width: 23px; height: 20px; display: block; }
.xl-crown-svg-1 { filter: drop-shadow(0 1px 3px rgba(255, 179, 0, .7)); }
.xl-crown-svg-2 { filter: drop-shadow(0 1px 3px rgba(176, 196, 216, .75)); }
.xl-crown-svg-3 { filter: drop-shadow(0 1px 3px rgba(255, 130, 80, .65)); }

/* ---------- 顶部LOGO ---------- */
.xl-header-logo {
    height: 36px; width: auto; max-width: 170px;
    object-fit: contain; display: block; border-radius: 8px;
}

/* ---------- 列表页 子分类Tab / 排序切换 ---------- */
.xl-sort-tabs { flex-wrap: wrap; }
.xl-sort-tab {
    display: inline-flex; align-items: center;
    padding: 5px 16px; border-radius: 999px;
    border: 1px solid var(--borderColor, #e5e7eb);
    font-size: 13px; color: var(--fontColor, #374151); text-decoration: none;
    transition: all .18s ease;
}
.xl-sort-tab:hover { color: #165dff; border-color: #165dff; }
.xl-sort-tab.active { background: #165dff; border-color: #165dff; color: #fff; }
.xl-order-btn {
    display: inline-flex; align-items: center;
    padding: 4px 14px; border-radius: 8px;
    font-size: 12.5px; color: #6b7280; text-decoration: none;
    border: 1px solid transparent;
}
.xl-order-btn:hover { color: #165dff; }
.xl-order-btn.active {
    color: #165dff; background: rgba(22, 93, 255, .08);
    border-color: rgba(22, 93, 255, .3); font-weight: 600;
}

/* ---------- 图片灯箱 ---------- */
.xl-lightbox {
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(10, 12, 18, .92);
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
}
.xl-lightbox[hidden] { display: none; }
.xl-lightbox img {
    max-width: 92vw; max-height: 86vh; border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
    transition: transform .15s ease;
}
.xl-lightbox-loading img { opacity: .35; }
.xl-lb-close, .xl-lb-prev, .xl-lb-next {
    position: absolute; display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255, 255, 255, .12); color: #fff; border: none;
    cursor: pointer; font-size: 18px; transition: background .15s ease;
}
.xl-lb-close:hover, .xl-lb-prev:hover, .xl-lb-next:hover { background: rgba(255, 255, 255, .28); }
.xl-lb-close { top: 22px; right: 26px; }
.xl-lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.xl-lb-next { right: 20px; top: 50%; transform: translateY(-50%); }
.xl-lb-counter {
    position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
    color: rgba(255, 255, 255, .85); font-size: 13px; letter-spacing: 1px;
    background: rgba(255, 255, 255, .1); padding: 4px 14px; border-radius: 999px;
}
.article-content img, .resource-content img { cursor: zoom-in; }

/* ---------- 文章目录 TOC ---------- */
.xl-toc {
    position: fixed; right: 18px; top: 120px; z-index: 800;
    width: 230px; max-height: 60vh;
    border-radius: 12px; border: 1px solid var(--borderColor, #e5e7eb);
    background: var(--bgCardColor, #fff);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .06);
    display: flex; flex-direction: column; overflow: hidden;
}
.xl-toc[hidden] { display: none; }
.xl-toc-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; border-bottom: 1px solid var(--borderColor, #e5e7eb);
    font-size: 13px; font-weight: 600; color: var(--fontColor, #1f2937);
}
.xl-toc-head i { margin-right: 6px; color: #165dff; }
.xl-toc-toggle {
    border: none; background: transparent; color: #9ca3af; cursor: pointer;
    font-size: 12px; padding: 2px 4px;
}
.xl-toc-toggle:hover { color: #165dff; }
.xl-toc-body { overflow-y: auto; padding: 8px 6px; }
.xl-toc.collapsed .xl-toc-body { display: none; }
.xl-toc-item {
    display: block; padding: 5px 10px; margin: 1px 0;
    font-size: 12.5px; line-height: 1.5; color: #6b7280;
    text-decoration: none; border-radius: 6px; border-left: 2px solid transparent;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.xl-toc-item.lvl-3 { padding-left: 24px; }
.xl-toc-item:hover { color: #165dff; background: rgba(22, 93, 255, .06); }
.xl-toc-item.active {
    color: #165dff; background: rgba(22, 93, 255, .1);
    border-left-color: #165dff; font-weight: 600;
}
@media (max-width: 1400px) { .xl-toc { display: none; } }

/* ---------- 轻提示 Toast ---------- */
.xl-toast {
    position: fixed; left: 50%; bottom: 12%; transform: translateX(-50%) translateY(10px);
    background: rgba(17, 24, 39, .88); color: #fff;
    padding: 9px 22px; border-radius: 999px; font-size: 13px;
    opacity: 0; pointer-events: none; z-index: 999998;
    transition: all .25s ease; max-width: 80vw; white-space: nowrap;
}
.xl-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 资源精选卡片网格（不依赖预编译 Tailwind 响应式类） ---------- */
.xl-feat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
@media (min-width: 640px) { .xl-feat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 768px) { .xl-feat-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.xl-feat-img {
    width: 100%; height: 112px; object-fit: cover; display: block;
    transition: transform .3s ease;
}
.xl-feat-card { overflow: hidden; }
.xl-feat-card:hover .xl-feat-img { transform: scale(1.05); }
.xl-feat-title { min-height: 2.5rem; }

/* ---------- 最近更新缩略图微调 ---------- */
.xl-latest-thumb {
    width: 44px; height: 44px; border-radius: var(--marRadius, 8px);
    object-fit: cover; display: block;
}
.xl-latest-views { white-space: nowrap; }

/* ================= 暗黑模式适配 ================= */
.dark .xl-quick-name { color: #e5e7eb; }
.dark .xl-tab-btn { border-color: #2b3445; color: #e5e7eb; }
.dark .xl-tab-btn.active { background: #165dff; border-color: #165dff; color: #fff; }
.dark .xl-rank-item { border-bottom-color: #232b3b; }
.dark .xl-rank-no { background: #1f2430; color: #9ca3af; }
.dark .xl-rank-title { color: #e5e7eb; }
.dark .xl-rank-title:hover { color: #6ca2ff; }
.dark .xl-breadcrumb, .dark .xl-breadcrumb a { color: #9ca3af; }
.dark .xl-breadcrumb a:hover { color: #6ca2ff; }
.dark .xl-action-btn { border-color: #2b3445; color: #e5e7eb; }
.dark .xl-action-btn:hover { border-color: #6ca2ff; color: #6ca2ff; }
/* 下载卡 v2 暗黑 */
.dark .xl-down-card {
    border-color: rgba(108, 162, 255, .25);
    background:
        linear-gradient(135deg, rgba(22, 93, 255, .1) 0%, rgba(77, 139, 255, .04) 45%, transparent 100%),
        #161a24;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.dark .xl-down-title { color: #e5e7eb; }
.dark .xl-down-tag { color: #6ca2ff; background: rgba(108, 162, 255, .16); }
.dark .xl-down-times { color: #9ca3af; }
.dark .xl-down-times i, .dark .xl-down-times b { color: #6ca2ff; }
.dark .xl-down-hint { color: #6b7280; }
.dark .xl-down-pwd-label { color: #9ca3af; }
.dark .xl-down-pwd-code { background: rgba(108, 162, 255, .12); color: #6ca2ff; border-color: rgba(108, 162, 255, .4); }
.dark .xl-notice-item a { color: #e5e7eb; }
.dark .xl-notice-item a:hover { color: #6ca2ff; }
.dark .xl-notice-badge { background: rgba(108, 162, 255, .14); color: #6ca2ff; }
.dark .xl-sort-tab { border-color: #2b3445; color: #e5e7eb; }
.dark .xl-sort-tab.active { background: #165dff; border-color: #165dff; }
.dark .xl-order-btn { color: #9ca3af; }
.dark .xl-order-btn:hover { color: #6ca2ff; }
.dark .xl-order-btn.active { background: rgba(108, 162, 255, .12); border-color: rgba(108, 162, 255, .35); color: #6ca2ff; }
.dark .xl-toc { background: #161a24; border-color: #2b3445; box-shadow: 0 6px 24px rgba(0, 0, 0, .4); }
.dark .xl-toc-head { color: #e5e7eb; border-bottom-color: #2b3445; }
.dark .xl-toc-item { color: #9ca3af; }
.dark .xl-toc-item:hover { color: #6ca2ff; background: rgba(108, 162, 255, .08); }
.dark .xl-toc-item.active { color: #6ca2ff; background: rgba(108, 162, 255, .12); border-left-color: #6ca2ff; }
/* 文章标题暗黑 */
.dark .article-content h1, .dark .article-content h2, .dark .article-content h3,
.dark .article-content h4, .dark .article-content h5,
.dark .resource-content h1, .dark .resource-content h2, .dark .resource-content h3,
.dark .resource-content h4, .dark .resource-content h5 { color: #e5e7eb; }

/* 正文内嵌视频/iframe：限制高度，宽高比自适应 */
.article-content iframe, .resource-content iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto !important;
    max-height: 70vh;
    border: none;
    border-radius: 8px;
}

/* m3u8 视频播放器 */
.xl-video-box {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    margin: 14px 0;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}
.xl-video-box video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
}
.xl-video-tip {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-size: 14px;
    color: #fff;
    background: rgba(0, 0, 0, .55);
    text-align: center;
    pointer-events: none;
}
.dark .xl-video-box { border: 1px solid rgba(255, 255, 255, .08); }
.tw-festive-mode .xl-video-tip { color: #ffd9d4; }

/* ================= 庆新春模式适配（xl-upgrade 组件） ================= */
/* 新春红 #E63946 / 深红 #C02739 / 金 #FFB703 / 浅红底 #FFF5F5 / 粉边 #F8D2D3 */

/* 公告滚动条 */
.tw-festive-mode .xl-notice-badge { color: #E63946 !important; background: rgba(230, 57, 70, .1) !important; }
.tw-festive-mode .xl-notice-item a:hover { color: #E63946 !important; }
.tw-festive-mode .xl-notice-more { color: #E63946 !important; }

/* 分类宫格 */
.tw-festive-mode .xl-quick-icon { background: linear-gradient(135deg, #E63946, #C02739) !important; box-shadow: 0 4px 12px rgba(230, 57, 70, .3); }
.tw-festive-mode .xl-quick-item:hover .xl-quick-name { color: #E63946; }

/* TAB 按钮（资源精选/排行榜） */
.tw-festive-mode .xl-tab-btn { border-color: #F8D2D3 !important; color: #6B3A3E !important; }
.tw-festive-mode .xl-tab-btn:hover { color: #E63946 !important; border-color: #E63946 !important; }
.tw-festive-mode .xl-tab-btn.active { background: linear-gradient(135deg, #E63946, #C02739) !important; border-color: #E63946 !important; color: #FFECB3 !important; box-shadow: 0 4px 10px rgba(230, 57, 70, .3); }

/* 排行榜：序号底色/标题 hover */
.tw-festive-mode .xl-rank-no { background: #FFF5F5 !important; color: #C08083 !important; }
.tw-festive-mode .xl-rank-title:hover { color: #E63946 !important; }
.tw-festive-mode .xl-rank-views { color: #E63946 !important; }

/* 热门/列表 hover 与点赞收藏 */
.tw-festive-mode .xl-side-hot-item:hover { background: rgba(230, 57, 70, .06) !important; }
.tw-festive-mode .xl-side-hot-item:hover .xl-side-hot-title { color: #E63946 !important; }
.tw-festive-mode .xl-hotdata-item:hover { background: rgba(230, 57, 70, .05) !important; }
.tw-festive-mode .xl-hotdata-item:hover .xl-hotdata-title a { color: #E63946 !important; }
.tw-festive-mode .xl-hotdata-views { color: #E63946 !important; }
.tw-festive-mode .xl-action-btn:hover { border-color: #E63946 !important; color: #E63946 !important; }
.tw-festive-mode .xl-side-hot-meta i { color: #E63946 !important; }

/* 面包屑 */
.tw-festive-mode .xl-breadcrumb a:hover { color: #E63946 !important; }

/* 文章标题：竖线/序号徽章改新春红金 */
.tw-festive-mode .article-content h1::before, .tw-festive-mode .article-content h2::before,
.tw-festive-mode .resource-content h1::before, .tw-festive-mode .resource-content h2::before {
    background: linear-gradient(180deg, #E63946, #FFB703) !important;
}
.tw-festive-mode .article-content h3::before, .tw-festive-mode .resource-content h3::before {
    background: linear-gradient(180deg, #E63946, #FFB703) !important;
}
.tw-festive-mode .article-content h4::before, .tw-festive-mode .article-content h5::before,
.tw-festive-mode .resource-content h4::before, .tw-festive-mode .resource-content h5::before {
    background: linear-gradient(180deg, #E63946, #FFB703) !important;
}

/* 下载卡 */
.tw-festive-mode .xl-down-card { border-color: rgba(230, 57, 70, .2) !important; background: linear-gradient(135deg, rgba(230,57,70,.06) 0%, rgba(255,183,3,.03) 45%, transparent 100%), #fff !important; }
.tw-festive-mode .xl-down-ico { background: linear-gradient(135deg, #E63946, #C02739) !important; box-shadow: 0 6px 16px rgba(230, 57, 70, .3) !important; }
.tw-festive-mode .xl-down-tag { color: #E63946 !important; background: rgba(230, 57, 70, .1) !important; }
.tw-festive-mode .xl-down-times i, .tw-festive-mode .xl-down-times b { color: #E63946 !important; }
.tw-festive-mode .xl-down-pwd-code { color: #E63946 !important; background: rgba(230, 57, 70, .08) !important; border-color: rgba(230, 57, 70, .35) !important; }
.tw-festive-mode .xl-copy-pwd { background: #E63946 !important; }
.tw-festive-mode .xl-down-btn { background: linear-gradient(135deg, #E63946 0%, #C02739 100%) !important; box-shadow: 0 10px 24px rgba(230, 57, 70, .35) !important; }
.tw-festive-mode .xl-down-btn:hover { filter: brightness(1.05); }
.tw-festive-mode .xl-down-pwd-label i { color: #FFB703 !important; }
/* 多地址弹窗 */
.tw-festive-mode .xl-down-modal-box { border-radius: 14px; }
.tw-festive-mode .xl-down-modal-head i { color: #E63946 !important; }
.tw-festive-mode .xl-down-opt-badge { background: linear-gradient(135deg, #E63946, #C02739) !important; }
.tw-festive-mode .xl-down-opt:hover { border-color: #E63946 !important; background: rgba(230, 57, 70, .05) !important; }
.tw-festive-mode .xl-down-opt:hover .xl-down-opt-go { color: #E63946 !important; }

/* 列表页：子分类 Tab / 排序按钮 */
.tw-festive-mode .xl-sort-tab { border-color: #F8D2D3 !important; color: #6B3A3E !important; }
.tw-festive-mode .xl-sort-tab:hover { color: #E63946 !important; border-color: #E63946 !important; }
.tw-festive-mode .xl-sort-tab.active { background: linear-gradient(135deg, #E63946, #C02739) !important; border-color: #E63946 !important; color: #FFECB3 !important; }
.tw-festive-mode .xl-order-btn:hover { color: #E63946 !important; }
.tw-festive-mode .xl-order-btn.active { color: #E63946 !important; background: rgba(230, 57, 70, .08) !important; border-color: rgba(230, 57, 70, .3) !important; }

/* TOC */
.tw-festive-mode .xl-toc-head i { color: #E63946 !important; }
.tw-festive-mode .xl-toc-item:hover { color: #E63946 !important; background: rgba(230, 57, 70, .06) !important; }
.tw-festive-mode .xl-toc-item.active { color: #E63946 !important; background: rgba(230, 57, 70, .1) !important; border-left-color: #E63946 !important; }

/* 资源精选卡片 hover */
.tw-festive-mode .xl-feat-card:hover { border-color: rgba(230, 57, 70, .5) !important; }

/* 多路下载徽章（无 --pan-color 时跟随主题） */
.tw-festive-mode .xl-pan-badge {
    color: #E63946 !important;
    background: rgba(230, 57, 70, .1) !important;
    border-color: rgba(230, 57, 70, .35) !important;
}
.dark.tw-festive-mode .xl-pan-badge, .tw-festive-mode.dark .xl-pan-badge {
    color: #ff8a94 !important;
    background: rgba(230, 57, 70, .15) !important;
    border-color: rgba(230, 57, 70, .4) !important;
}

/* 庆新春 + 暗黑 */
.tw-festive-mode.dark .xl-tab-btn.active, .tw-festive-mode.dark .xl-sort-tab.active { background: #7A1F26 !important; color: #FFE7A0 !important; }
.tw-festive-mode.dark .xl-down-card { background: linear-gradient(135deg, rgba(230,57,70,.12) 0%, rgba(255,183,3,.05) 45%, transparent 100%), #161a24 !important; }
.tw-festive-mode.dark .xl-down-btn { background: #7A1F26 !important; box-shadow: 0 10px 24px rgba(230, 57, 70, .25) !important; }

/* 首页图片广告弹窗 */
.xl-pop {
    position: fixed;
    inset: 0;
    z-index: 999999;
}
.xl-pop-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .58);
}
.xl-pop-card {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    animation: xlpopIn .25s ease-out;
}
@keyframes xlpopIn {
    from { opacity: 0; transform: translate(-50%, -47%) scale(.94); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.xl-pop-card img {
    display: block;
    margin: 0 auto;
    max-width: min(560px, 86vw);
    max-height: 68vh;
    border-radius: 10px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .4);
    cursor: pointer;
}
.xl-pop-close-wrap {
    margin-top: 16px;
    text-align: center;
}
.xl-pop-close {
    display: inline-block;
    padding: 8px 34px;
    border: 2px solid rgba(255, 255, 255, .9);
    border-radius: 999px;
    color: #fff;
    font-size: 14px;
    letter-spacing: 4px;
    cursor: pointer;
    transition: all .18s;
    user-select: none;
}
.xl-pop-close:hover {
    background: rgba(255, 255, 255, .18);
}
