.litheme-top-page {
    background: #f6f7fb;
    color: #1f2937;
    min-height: 100vh;
}

.litheme-top-page .container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
}

.top-stats-section {
    background: #ffffff;
    border-bottom: 1px solid rgba(229, 231, 235, .85);
}

.top-stats-banner {
    padding: 15px 0 6px;
    background: #ffffff;
    color: #666;
    font-size: 15px;
    line-height: 1.45;
}

.top-stats-brand {
    color: #000;
    font-weight: 700;
}

.top-stats-count {
    margin: 0 2px;
    color: #e11d2e;
    font-size: 16px;
    font-weight: 700;
}

.top-list-wrap {
    padding: 18px 0 42px;
}

.top-featured-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    width: 100%;
    margin-bottom: 24px;
}

.top-featured-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 32px;
    padding: 6px 16px;
    border-radius: 5px;
    background: #9aa4ab;
    color: #ffffff;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 800;
    text-align: center;
    overflow-wrap: anywhere;
}

.top-featured-link:hover {
    background: #7f8a92;
    color: #ffffff;
}

.top-list-section {
    margin-bottom: 28px;
}

.top-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.top-section-title {
    min-width: 0;
    flex: 1 1 auto;
}

.top-section-head h2 {
    margin: 0;
    color: #111827;
    font-size: 26px;
    line-height: 1.35;
    font-weight: 800;
}

.top-section-head p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.7;
}

.top-detail-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
    min-height: 34px;
    padding: 0 4px 0 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #2563eb;
    font-size: 14px;
    line-height: 1;
    font-weight: 700;
    box-shadow: none;
    white-space: nowrap;
    transition: color .18s ease;
}

.top-detail-link::before {
    content: "";
    position: absolute;
    inset: -5px -8px;
    border-radius: 999px;
    background: transparent;
    transition: background .18s ease;
}

.top-detail-link:hover {
    color: #1d4ed8;
}

.top-detail-link:hover::before {
    background: rgba(37, 99, 235, .07);
}

.top-detail-link > * {
    position: relative;
    z-index: 1;
}

.top-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.top-detail-head h1 {
    min-width: 0;
    margin: 0;
    color: #111827;
    font-size: 26px;
    line-height: 1.35;
    font-weight: 800;
}

.top-detail-back {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 10px 0 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #2563eb;
    font-size: 14px;
    line-height: 1;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: none;
    transition: color .18s ease;
}

.top-detail-back::before {
    content: "";
    position: absolute;
    inset: -5px -8px;
    border-radius: 999px;
    background: transparent;
    transition: background .18s ease;
}

.top-detail-back:hover {
    color: #1d4ed8;
}

.top-detail-back:hover::before {
    background: rgba(37, 99, 235, .07);
}

.top-detail-back > * {
    position: relative;
    z-index: 1;
}

.top-product-grid {
    display: grid;
    gap: 14px;
}

.top-product-rail {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.top-product-rail:focus {
    outline: 2px solid rgba(37, 99, 235, 0.22);
    outline-offset: 4px;
}

.top-archive-grid {
    grid-auto-flow: column;
    grid-template-rows: repeat(3, minmax(0, 1fr));
    grid-auto-columns: minmax(520px, calc((100% - 14px) / 2));
    grid-template-columns: none;
    align-items: stretch;
}

.top-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.top-product-card {
    position: relative;
    display: grid;
    grid-template-columns: 124px minmax(0, 1fr);
    gap: 14px;
    min-height: 190px;
    padding: 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.top-product-rank {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    min-width: 38px;
    height: 26px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #111827;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
}

.top-product-cover {
    display: block;
    aspect-ratio: 2 / 3;
    border-radius: 7px;
    overflow: hidden;
    background: #e5e7eb;
}

.top-product-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.top-product-no-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #94a3b8;
    font-size: 30px;
}

.top-product-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.top-product-heading {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.top-product-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 17px;
    line-height: 1.45;
    font-weight: 800;
}

.top-product-title a {
    color: #111827;
}

.top-product-title a:hover {
    color: #2563eb;
}

.top-product-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 8px;
    border-radius: 6px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 12px;
    font-weight: 700;
}

.top-product-nickname {
    margin-top: 5px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

.top-product-reason {
    margin-top: 10px;
    color: #334155;
    font-size: 14px;
    line-height: 1.75;
}

.top-product-block-title {
    margin-bottom: 5px;
    color: #111827;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 800;
}

.top-product-reason-body p {
    margin: 0 0 6px;
}

.top-product-reason-body p:last-child {
    margin-bottom: 0;
}

.top-product-portal {
    margin-top: auto;
    padding-top: 12px;
}

.top-product-portal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.top-product-portal .pm-action-buttons {
    display: flex;
    flex: 0 0 auto;
    min-width: 0;
    gap: 0.5rem;
}

.top-product-portal .pm-btn-action {
    flex: 0 0 auto;
    width: 7.5em;
    min-height: 40px;
    padding: 0 0.75em;
    background: #f8fafc;
    border: 1px solid #dbe3ea;
    border-radius: 6px;
    color: #333333;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    white-space: nowrap;
    transition: background-color 0.2s, border-color 0.2s;
}

.top-product-portal .pm-btn-action:active,
.top-product-portal .pm-btn-action:hover {
    background: #eef2f7;
    border-color: #cbd5e1;
    color: #333333;
}

.top-product-portal .pm-btn-action.is-open {
    background: #eef2f7;
    border-color: #94a3b8;
    color: #111827;
}

.top-product-purchase-template {
    display: none !important;
}

.top-product-purchase-floating-popover {
    position: fixed;
    z-index: 9999;
    display: none;
    width: min(100%, calc(100vw - 24px));
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.top-product-purchase-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.top-product-purchase-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #edf0f3;
    border-radius: 6px;
    color: #334155;
    text-decoration: none;
    background: #f8fafc;
}

.top-product-purchase-link:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.top-product-purchase-icon {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.top-product-purchase-main {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.top-product-purchase-icon-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 18px;
}

.top-product-purchase-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-product-purchase-price {
    flex: 0 0 auto;
    color: #dc2626;
    font-weight: 700;
}

.top-empty {
    padding: 28px;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    text-align: center;
}

.top-empty-page {
    margin-top: 20px;
}

.top-pagination {
    margin-top: 26px;
    text-align: center;
}

@media (max-width: 900px) {
    .top-archive-grid {
        grid-auto-columns: minmax(420px, 88vw);
    }

    .top-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .litheme-top-page {
        padding-top: 44px;
    }
}

@media (max-width: 560px) {
    .litheme-top-page .container {
        padding: 0 14px;
    }

    .top-list-wrap {
        padding: 14px 0 34px;
    }

    .top-featured-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 18px;
    }

    .top-featured-nav.is-compact {
        flex-wrap: nowrap;
        overflow: visible;
    }

    .top-featured-nav.is-two-row {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-auto-flow: row;
        overflow: visible;
    }

    .top-featured-nav.is-scrollable {
        display: grid;
        grid-auto-flow: column;
        grid-template-rows: repeat(2, minmax(34px, auto));
        grid-auto-columns: max-content;
        align-items: stretch;
        padding-bottom: 4px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .top-featured-nav.is-scrollable::-webkit-scrollbar {
        display: none;
    }

    .top-featured-link {
        min-width: 0;
        max-width: 152px;
        min-height: 34px;
        padding: 6px 10px;
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .top-featured-nav.is-compact .top-featured-link {
        flex: 1 1 0;
        min-width: 0;
        max-width: none;
    }

    .top-featured-nav.is-two-row .top-featured-link {
        max-width: none;
    }

    .top-featured-nav.is-scrollable .top-featured-link {
        min-width: 104px;
    }

    .top-section-head,
    .top-detail-head {
        gap: 10px;
        margin-bottom: 12px;
    }

    .top-section-head h2,
    .top-detail-head h1 {
        font-size: 22px;
        line-height: 1.35;
    }

    .top-section-head p {
        margin-top: 4px;
        font-size: 13px;
        line-height: 1.55;
    }

    .top-detail-link,
    .top-detail-back {
        min-height: 34px;
        font-size: 13px;
    }

    .top-archive-grid {
        grid-auto-columns: minmax(300px, 86vw);
    }

    .top-product-card {
        grid-template-columns: 96px minmax(0, 1fr);
        min-height: 0;
        gap: 10px;
        padding: 10px;
    }

    .top-product-title {
        font-size: 15px;
    }

    .top-product-portal .pm-btn-action {
        width: 7em;
        padding: 0 0.6em;
    }
}
