/*!
 * 全网热榜 · B2 子主题
 * ------------------------------------------------------------
 * 仅作用于 pageTemplates/page-hot.php 生成的 #hot-main。
 * 不引入第三方框架，颜色跟随站点主色 --b2color（默认 #dd3333）。
 * 修改时间：2026-11-06
 */

/* ========== 1. 页面外壳 ========== */
body.b2child-hot-page {
    background: #f7f5f6;
}

body.b2child-hot-page .b2-page-bg {
    display: none !important;
}

body.b2child-hot-page .site-header.mg-b {
    margin-bottom: 0;
}

body.b2child-hot-page #content.site-content {
    padding-top: 0;
    background: transparent;
}

/* ========== 2. 设计变量 ========== */
.hot-page {
    --hot-accent: var(--b2color, #dd3333);
    --hot-accent-deep: #b82424;
    --hot-soft: rgba(221, 51, 51, 0.07);

    --hot-heading: #151a26;
    --hot-text: #232838;
    --hot-muted: #5b6478;
    --hot-muted-2: #98a0ad;

    --hot-line: rgba(15, 23, 42, 0.08);
    --hot-line-soft: #f3f4f7;
    --hot-card: #ffffff;

    --hot-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 30px -24px rgba(15, 23, 42, 0.38);
    --hot-shadow: 0 3px 10px rgba(15, 23, 42, 0.05), 0 28px 54px -34px rgba(120, 30, 30, 0.42);

    --hot-radius: 20px;
    --hot-font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;

    position: relative;
    box-sizing: border-box;
    padding: 22px 0 36px;
    min-height: 72vh;
    overflow-x: clip;
    color: var(--hot-text);
    background-color: #f7f5f6;
    background-image:
        radial-gradient(900px 480px at 6% -10%, rgba(221, 51, 51, 0.10), transparent 62%),
        radial-gradient(780px 420px at 98% 0%, rgba(255, 150, 110, 0.13), transparent 60%),
        radial-gradient(920px 640px at 50% 112%, rgba(221, 51, 51, 0.06), transparent 64%);
    background-repeat: no-repeat;
    background-attachment: fixed;
    font-family: var(--hot-font);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hot-page,
.hot-page *,
.hot-page *::before,
.hot-page *::after {
    box-sizing: border-box;
}

.hot-wrap {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 22px;
}

/* ========== 3. 页头 ========== */
.hot-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 10px 2px 4px;
}

.hot-hero-main {
    min-width: 0;
}

.hot-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 10px;
    padding: 5px 12px 5px 10px;
    border: 1px solid rgba(221, 51, 51, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.66);
    color: var(--hot-accent);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.hot-dot {
    position: relative;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--hot-accent);
    box-shadow: 0 0 0 3px rgba(221, 51, 51, 0.14);
}

.hot-dot::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1px solid rgba(221, 51, 51, 0.35);
    animation: hot-pulse 2.4s ease-out infinite;
}

@keyframes hot-pulse {
    0% {
        transform: scale(0.7);
        opacity: 0.9;
    }
    70% {
        transform: scale(1.9);
        opacity: 0;
    }
    100% {
        transform: scale(1.9);
        opacity: 0;
    }
}

.hot-title {
    margin: 0;
    color: var(--hot-heading);
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.hot-desc {
    max-width: 720px;
    margin: 10px 0 0;
    color: var(--hot-muted);
    font-size: 13.5px;
    line-height: 1.75;
}

.hot-hero-side {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
    padding-bottom: 4px;
}

.hot-updated {
    color: var(--hot-muted-2);
    font-size: 12px;
    white-space: nowrap;
}

.hot-refresh {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 36px;
    padding: 0 15px;
    border: 1px solid rgba(221, 51, 51, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--hot-accent);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.hot-refresh svg {
    width: 14px;
    height: 14px;
}

.hot-refresh:hover {
    border-color: rgba(221, 51, 51, 0.3);
    background: #fff;
    box-shadow: 0 10px 22px -16px rgba(221, 51, 51, 0.8);
    color: var(--hot-accent);
    text-decoration: none;
}

/* ========== 4. 工具栏 ========== */
.hot-toolbar {
    position: sticky;
    top: var(--hot-sticky-top, 8px);
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0 22px;
    padding: 14px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--hot-shadow-sm);
}

.hot-search {
    position: relative;
    display: flex;
    align-items: center;
}

.hot-search > svg {
    position: absolute;
    left: 13px;
    width: 16px;
    height: 16px;
    color: #a0a7b4;
    pointer-events: none;
}

.hot-search input {
    width: 100%;
    height: 42px;
    padding: 0 40px 0 39px;
    border: 1px solid var(--hot-line);
    border-radius: 12px;
    background: #fff;
    color: var(--hot-text);
    font-family: inherit;
    font-size: 14px;
    line-height: 42px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.hot-search input::-webkit-search-cancel-button,
.hot-search input::-webkit-search-decoration {
    display: none;
}

.hot-search input::placeholder {
    color: #a8aebb;
}

.hot-search input:focus {
    outline: none;
    border-color: rgba(221, 51, 51, 0.45);
    box-shadow: 0 0 0 4px rgba(221, 51, 51, 0.08);
}

.hot-clear {
    position: absolute;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.06);
    color: #6b7280;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}

.hot-clear[hidden] {
    display: none !important;
}

.hot-clear:hover {
    background: rgba(15, 23, 42, 0.1);
    color: #374151;
}

.hot-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hot-chip {
    height: 32px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.045);
    color: #4b5563;
    font-family: inherit;
    font-size: 13px;
    line-height: 30px;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.hot-chip:hover {
    background: rgba(221, 51, 51, 0.08);
    color: var(--hot-accent);
}

.hot-chip.is-active {
    background: var(--hot-accent);
    color: #fff;
    box-shadow: 0 8px 18px -10px rgba(221, 51, 51, 0.75);
}

.hot-chip:focus-visible,
.hot-refresh:focus-visible,
.hot-link:focus-visible,
.hot-more:focus-visible,
.hot-clear:focus-visible {
    outline: 2px solid rgba(221, 51, 51, 0.55);
    outline-offset: 2px;
}

/* ========== 5. 双列瀑布流与卡片 ========== */
.hot-grid {
    column-count: 2;
    column-gap: 18px;
}

.hot-grid.is-single {
    column-count: 1;
}

.hot-grid.is-single .hot-card {
    display: block;
    max-width: 640px;
    margin: 0 auto 18px;
}

.hot-card {
    display: inline-block;
    width: 100%;
    margin: 0 0 18px;
    padding: 17px 17px 7px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--hot-radius);
    background: var(--hot-card);
    box-shadow: var(--hot-shadow-sm);
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    vertical-align: top;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hot-card[hidden],
.hot-item[hidden] {
    display: none !important;
}

@media (hover: hover) {
    .hot-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--hot-shadow);
    }
}

.hot-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 11px;
}

.hot-logo {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 11px;
    background: #f4f5f7;
    color: var(--hot-brand, var(--hot-accent));
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.2px;
}

@supports (background: color-mix(in srgb, red, blue)) {
    .hot-logo {
        border-color: color-mix(in srgb, var(--hot-brand) 14%, #fff);
        background: color-mix(in srgb, var(--hot-brand) 10%, #fff);
    }
}

.hot-card-name {
    flex: 1 1 auto;
    min-width: 0;
}

.hot-card-name h2 {
    margin: 0;
    color: var(--hot-heading);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}

.hot-card-name p {
    margin: 2px 0 0;
    color: var(--hot-muted-2);
    font-size: 11.5px;
    line-height: 1.4;
}

.hot-more {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 1px;
    color: var(--hot-accent);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.hot-more svg {
    width: 12px;
    height: 12px;
}

.hot-more:hover {
    color: var(--hot-accent-deep);
    text-decoration: none;
}

.hot-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.hot-item {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8.5px 0;
    border-top: 1px solid var(--hot-line-soft);
}

.hot-item:first-child {
    border-top: 0;
}

.hot-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: #f4f5f7;
    color: #9aa1ad;
    font-size: 11.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.hot-rank--1 {
    background: linear-gradient(135deg, #ef5350, #dd3333);
    color: #fff;
    box-shadow: 0 6px 12px -8px rgba(221, 51, 51, 0.9);
}

.hot-rank--2 {
    background: linear-gradient(135deg, #ff8a4c, #f05e23);
    color: #fff;
}

.hot-rank--3 {
    background: linear-gradient(135deg, #ffc24b, #f0a020);
    color: #fff;
}

.hot-link {
    min-width: 0;
    overflow: hidden;
    color: #333a4a;
    font-size: 13.5px;
    line-height: 1.7;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.hot-link:hover {
    color: var(--hot-accent);
    text-decoration: none;
}

.hot-heat {
    max-width: 92px;
    overflow: hidden;
    color: #a0a7b4;
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========== 6. 空状态与说明 ========== */
.hot-empty {
    margin: 34px 0;
    padding: 34px 20px;
    border: 1px dashed rgba(15, 23, 42, 0.12);
    border-radius: var(--hot-radius);
    background: rgba(255, 255, 255, 0.6);
    color: var(--hot-muted-2);
    font-size: 14px;
    text-align: center;
}

.hot-empty--show {
    display: block;
}

.hot-note {
    margin: 8px 0 0;
    padding: 0 4px;
    color: #a6acb8;
    font-size: 11.5px;
    line-height: 1.7;
    text-align: center;
}

/* ========== 7. 响应式 ========== */
@media (max-width: 900px) {
    .hot-grid {
        column-count: 1;
    }
}

@media (max-width: 767px) {
    .hot-page {
        padding-top: 16px;
        background-attachment: scroll;
    }

    .hot-wrap {
        padding: 0 14px;
    }

    .hot-hero {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .hot-title {
        font-size: 25px;
        letter-spacing: -0.3px;
    }

    .hot-desc {
        margin-top: 8px;
        font-size: 12.5px;
        line-height: 1.7;
    }

    .hot-hero-side {
        width: 100%;
        justify-content: space-between;
        padding-bottom: 0;
    }

    .hot-toolbar {
        margin: 16px 0 18px;
        padding: 12px;
        border-radius: 16px;
    }

    .hot-search input {
        height: 40px;
        font-size: 13.5px;
    }

    .hot-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .hot-chips::-webkit-scrollbar {
        display: none;
    }

    .hot-chip {
        flex: 0 0 auto;
    }

    .hot-card {
        margin-bottom: 14px;
        padding: 15px 14px 6px;
        border-radius: 17px;
    }

    .hot-item {
        grid-template-columns: 20px minmax(0, 1fr) auto;
        gap: 8px;
        padding: 8px 0;
    }

    .hot-link {
        font-size: 13px;
    }

    .hot-heat {
        max-width: 70px;
        font-size: 11px;
    }

    /* 本站移动端有 55px 固定底栏，给页脚留出安全距离 */
    body.b2child-hot-page #colophon.footer {
        padding-bottom: calc(64px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 420px) {
    .hot-heat {
        display: none;
    }

    .hot-item {
        grid-template-columns: 20px minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hot-dot::after {
        animation: none;
    }

    .hot-card,
    .hot-refresh,
    .hot-chip,
    .hot-link {
        transition: none;
    }
}
