/* --------------------------------------------------------------------------
   Buttons & cards (Bootstrap overrides)
   -------------------------------------------------------------------------- */

.btn-primary {
    --bs-btn-bg: var(--primary-color);
    --bs-btn-border-color: var(--primary-color);
    --bs-btn-hover-bg: var(--primary-hover-color, var(--primary-hover, var(--primary-color)));
    --bs-btn-hover-border-color: var(--primary-hover-color, var(--primary-hover, var(--primary-color)));
    --bs-btn-active-bg: var(--primary-active-color, var(--primary-hover-color, var(--primary-color)));
    --bs-btn-active-border-color: var(--primary-active-color, var(--primary-hover-color, var(--primary-color)));
    --bs-btn-active-shadow: none;
    --bs-btn-focus-shadow-rgb: 0, 0, 0;
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 500;
    transition: all var(--transition-speed) ease;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:focus-visible {
    color: #fff;
    background-color: var(--primary-hover-color, var(--primary-hover, var(--primary-color)));
    border-color: var(--primary-hover-color, var(--primary-hover, var(--primary-color)));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.btn-primary:active,
.btn-primary.active,
.show > .btn-primary.dropdown-toggle {
    color: #fff;
    background-color: var(--primary-active-color, var(--primary-hover-color, var(--primary-color)));
    border-color: var(--primary-active-color, var(--primary-hover-color, var(--primary-color)));
    box-shadow: none;
    transform: none;
}

a.btn-primary:link,
a.btn-primary:visited {
    color: #fff;
}

.btn-outline-primary {
    --bs-btn-color: var(--primary-color);
    --bs-btn-border-color: var(--primary-color);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--primary-color);
    --bs-btn-hover-border-color: var(--primary-color);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--primary-color);
    --bs-btn-active-border-color: var(--primary-color);
    --bs-btn-active-shadow: none;
    --bs-btn-disabled-color: var(--primary-color);
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: var(--primary-color);
    --bs-btn-focus-shadow-rgb: 0, 0, 0;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transition:
        color var(--transition-speed) ease,
        background-color var(--transition-speed) ease,
        border-color var(--transition-speed) ease,
        box-shadow var(--transition-speed) ease,
        transform var(--transition-speed) ease;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:focus-visible {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(0, 0, 0, 0.12);
}

.btn-outline-primary:active,
.btn-outline-primary.active,
.show > .btn-outline-primary.dropdown-toggle {
    color: #fff;
    background-color: var(--primary-active-color, var(--primary-hover-color, var(--primary-color)));
    border-color: var(--primary-active-color, var(--primary-hover-color, var(--primary-color)));
    box-shadow: none;
}

.btn-outline-primary:disabled,
.btn-outline-primary.disabled {
    color: var(--primary-color);
    background-color: transparent;
    border-color: var(--primary-color);
    opacity: 0.65;
    box-shadow: none;
}

/* --------------------------------------------------------------------------
   Form validation states
   -------------------------------------------------------------------------- */

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linecap='round' d='M6 3.5v3'/%3e%3ccircle cx='6' cy='8.5' r='.5' fill='%23dc3545'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.25rem;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.form-control.is-valid,
.form-select.is-valid {
    border-color: #198754;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.25rem;
}

.form-control.is-valid:focus,
.form-select.is-valid:focus {
    border-color: #198754;
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.15);
}

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: #dc3545;
}

.is-invalid ~ .invalid-feedback,
.was-validated .form-control:invalid ~ .invalid-feedback {
    display: block;
}

.valid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: #198754;
}

.is-valid ~ .valid-feedback,
.was-validated .form-control:valid ~ .valid-feedback {
    display: block;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.btn-outline-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

@supports (background: color-mix(in srgb, #000 10%, #fff 90%)) {
    .btn-primary:hover,
    .btn-primary:focus,
    .btn-primary:focus-visible {
        box-shadow: 0 4px 12px color-mix(in srgb, var(--primary-color) 35%, transparent);
    }

    .btn-primary:active,
    .btn-primary.active,
    .show > .btn-primary.dropdown-toggle {
        background-color: color-mix(in srgb, var(--primary-color) 78%, #000 22%);
        border-color: color-mix(in srgb, var(--primary-color) 78%, #000 22%);
    }

    .btn-outline-primary:hover,
    .btn-outline-primary:focus,
    .btn-outline-primary:focus-visible {
        box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--primary-color) 28%, transparent);
    }

    .btn-outline-primary:hover {
        box-shadow: 0 4px 12px color-mix(in srgb, var(--primary-color) 28%, transparent);
    }

    .btn-outline-primary:active,
    .btn-outline-primary.active,
    .show > .btn-outline-primary.dropdown-toggle {
        background-color: color-mix(in srgb, var(--primary-color) 85%, #000 15%);
        border-color: color-mix(in srgb, var(--primary-color) 85%, #000 15%);
        box-shadow: 0 2px 6px color-mix(in srgb, var(--primary-color) 20%, transparent);
    }
}

.card {
    overflow: hidden;
}

.card-title {
    font-size: 1.125rem;
}

/* --------------------------------------------------------------------------
   Breadcrumb
   -------------------------------------------------------------------------- */

.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    --bs-breadcrumb-divider: "";
    --bs-breadcrumb-divider-color: currentColor;
    --bs-breadcrumb-item-padding-x: 0;
}

.breadcrumb-item + .breadcrumb-item {
    padding-left: 0;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    max-width: 100%;
}

.breadcrumb-item + .breadcrumb-item::before {
    float: none;
    content: "";
    box-sizing: border-box;
    flex: 0 0 auto;
    align-self: center;
    width: 0.38em;
    height: 0.38em;
    margin: 0 0.55rem;
    padding: 0;
    border: 0;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.55;
}

.breadcrumb-item a {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    gap: 0.35rem;
    opacity: 0.9;
    transition: color 0.25s ease, opacity 0.25s ease;
}

.breadcrumb-item a:hover {
    opacity: 1;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: inherit;
    font-weight: 500;
    opacity: 0.95;
}

.breadcrumb-item.active span[itemprop="name"] {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    max-width: min(100%, 320px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-hero .breadcrumb,
.page-landing-hero .breadcrumb {
    margin-bottom: 0.75rem;
}

.page-hero .breadcrumb-item + .breadcrumb-item::before,
.page-landing-hero .breadcrumb-item + .breadcrumb-item::before {
    color: currentColor;
    opacity: 0.65;
}

.error-page .site-breadcrumb {
    margin-bottom: 1.5rem;
    text-align: left;
}

.error-page .site-breadcrumb .breadcrumb-item a,
.error-page .site-breadcrumb .breadcrumb-item.active {
    color: var(--gray-600);
}

.error-page .site-breadcrumb .breadcrumb-item a:hover {
    color: var(--primary-color);
}

/* --------------------------------------------------------------------------
   Pagination & alerts
   -------------------------------------------------------------------------- */

.pagination-wrap {
    display: flex;
    justify-content: center;
}

.theme-pagination {
    width: 100%;
}

.theme-pagination .pagination,
.pagination-wrap .pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    padding-left: 0;
    margin-bottom: 0;
}

.theme-pagination .pagination .page-item,
.pagination-wrap .pagination .page-item {
    list-style: none;
}

.theme-pagination .pagination .page-link,
.pagination-wrap .pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.375rem;
    height: 2.375rem;
    padding: 0 0.75rem;
    margin-left: 0;
    border-radius: var(--border-radius);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
    background-color: #fff;
    background-color: var(--surface-color, #fff);
    text-decoration: none;
    line-height: 1;
    transition: color var(--transition-speed) ease, background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.theme-pagination .pagination .page-link:hover,
.pagination-wrap .pagination .page-link:hover {
    z-index: 1;
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: var(--gray-50, #f9fafb);
}

@supports (background: color-mix(in srgb, #000 10%, #fff 90%)) {
    .theme-pagination .pagination .page-link:hover,
    .pagination-wrap .pagination .page-link:hover {
        border-color: color-mix(in srgb, var(--primary-color) 35%, transparent);
        background-color: color-mix(in srgb, var(--primary-color) 6%, transparent);
    }
}

.theme-pagination .pagination .page-item.active .page-link,
.pagination-wrap .pagination .page-item.active .page-link {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.theme-pagination .pagination .page-item.disabled .page-link,
.pagination-wrap .pagination .page-item.disabled .page-link {
    color: var(--gray-400);
    background-color: var(--gray-50);
    border-color: var(--gray-200);
    pointer-events: none;
}

.theme-pagination .pagination .pagination-ellipsis .page-link,
.pagination-wrap .pagination .pagination-ellipsis .page-link {
    min-width: 2rem;
    padding-inline: 0.35rem;
    border-color: transparent;
    background: transparent;
}

.theme-pagination .pagination .pagination-nav .page-link,
.pagination-wrap .pagination .pagination-nav .page-link {
    min-width: auto;
    padding-inline: 0.875rem;
    font-size: 0.875rem;
}

.pagination-load-more__btn {
    min-width: 10rem;
    padding-inline: 1.75rem;
    transition:
        color var(--transition-speed) ease,
        background-color var(--transition-speed) ease,
        border-color var(--transition-speed) ease,
        box-shadow var(--transition-speed) ease,
        transform var(--transition-speed) ease,
        opacity var(--transition-speed) ease;
}

.pagination-load-more__btn:not(:disabled):not(.is-loading):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.pagination-load-more__btn:not(:disabled):not(.is-loading):active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pagination-load-more__btn:focus,
.pagination-load-more__btn:focus-visible {
    outline: none;
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(0, 0, 0, 0.12);
}

.pagination-load-more__btn:disabled,
.pagination-load-more__btn.is-loading,
.pagination-load-more__btn:disabled:focus,
.pagination-load-more__btn.is-loading:focus {
    color: var(--primary-color);
    background-color: var(--gray-50, #f9fafb);
    border-color: var(--primary-color);
    opacity: 0.85;
    pointer-events: none;
    box-shadow: none;
}

@supports (background: color-mix(in srgb, #000 10%, #fff 90%)) {
    .pagination-load-more__btn:not(:disabled):not(.is-loading):hover {
        box-shadow: 0 6px 16px color-mix(in srgb, var(--primary-color) 30%, transparent);
    }

    .pagination-load-more__btn:not(:disabled):not(.is-loading):active {
        box-shadow: 0 2px 8px color-mix(in srgb, var(--primary-color) 22%, transparent);
    }

    .pagination-load-more__btn:focus,
    .pagination-load-more__btn:focus-visible {
        box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--primary-color) 28%, transparent);
    }

    .pagination-load-more__btn:disabled,
    .pagination-load-more__btn.is-loading,
    .pagination-load-more__btn:disabled:focus,
    .pagination-load-more__btn.is-loading:focus {
        background-color: color-mix(in srgb, var(--primary-color) 8%, transparent);
    }
}

.pagination-load-more__btn.is-loading::after {
    content: '';
    display: inline-block;
    width: 0.875rem;
    height: 0.875rem;
    margin-left: 0.5rem;
    border: 2px solid var(--primary-color);
    border-right-color: transparent;
    border-radius: 50%;
    animation: category-load-spin 0.65s linear infinite;
    vertical-align: -0.125em;
}

.pagination-load-more__done {
    display: inline-block;
    animation: category-fade-up 0.45s ease both;
}

.category-archive-entry {
    opacity: 0;
    transform: translateY(1.25rem);
    transition:
        opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--enter-delay, 0s);
    will-change: opacity, transform;
}

.category-archive-entry--visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes category-load-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes category-fade-up {
    from {
        opacity: 0;
        transform: translateY(0.5rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .category-archive-entry {
        opacity: 1;
        transform: none;
        transition: none;
        will-change: auto;
    }

    .pagination-load-more__btn.is-loading::after {
        animation: none;
    }

    .pagination-load-more__btn:not(:disabled):not(.is-loading):hover,
    .pagination-load-more__btn:not(:disabled):not(.is-loading):active,
    .btn-outline-primary:hover,
    .btn-outline-primary:active {
        transform: none;
    }

    .pagination-load-more__done {
        animation: none;
    }
}

.alert-info {
    background: var(--gray-50, #f9fafb);
    border-color: var(--gray-200, #e5e7eb);
    color: var(--gray-800);
    border-radius: var(--border-radius);
}

@supports (background: color-mix(in srgb, #000 10%, #fff 90%)) {
    .alert-info {
        background: color-mix(in srgb, var(--primary-color) 8%, transparent);
        border-color: color-mix(in srgb, var(--primary-color) 20%, transparent);
    }
}

/* --------------------------------------------------------------------------
   Empty & error states
   -------------------------------------------------------------------------- */

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--card-bg, #fff);
    border: 1px dashed var(--gray-300);
    border-radius: var(--border-radius);
}

.empty-state__icon {
    width: 3rem;
    height: 3rem;
    font-size: 3rem;
    display: block;
    margin: 0 auto 1rem;
    flex-shrink: 0;
    color: color-mix(in srgb, var(--primary-color, #ff6b6b) 28%, var(--text-muted, var(--gray-500, #6b7280)));
    opacity: 0.45;
}

.empty-state__text {
    color: var(--gray-600);
    margin: 0;
    font-size: 1rem;
}

.error-page {
    padding: 3rem 1rem 4rem;
}

.error-page__code {
    font-size: clamp(5rem, 18vw, 8rem);
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.error-page__title {
    color: var(--gray-900);
}

.error-page__desc {
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* --------------------------------------------------------------------------
   Floating action buttons
   -------------------------------------------------------------------------- */

.floating-actions {
    position: fixed;
    right: calc(1.25rem + env(safe-area-inset-right, 0px));
    z-index: 1040;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    align-items: flex-end;
}

.floating-actions--bottom {
    bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
}

.floating-actions--center {
    top: 50%;
    transform: translateY(-50%);
    bottom: auto;
}

.floating-actions__btn,
.floating-actions a.floating-actions__btn,
.floating-actions button.floating-actions__btn {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(15, 23, 42, 0.08);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    text-decoration: none;
    color: var(--primary-color);
    background: #ffffff none;
    background-color: #ffffff;
    background-image: none;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
    isolation: isolate;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    transition:
        transform var(--transition-speed) ease,
        box-shadow var(--transition-speed) ease,
        background-color var(--transition-speed) ease,
        border-color var(--transition-speed) ease,
        color var(--transition-speed) ease,
        opacity 0.3s ease,
        visibility 0.3s ease;
}

.floating-actions__btn::before,
.floating-actions a.floating-actions__btn::before,
.floating-actions button.floating-actions__btn::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    background-color: #ffffff;
    pointer-events: none;
}

.floating-actions__btn:hover,
.floating-actions__btn:focus,
.floating-actions a.floating-actions__btn:hover,
.floating-actions a.floating-actions__btn:focus,
.floating-actions button.floating-actions__btn:hover,
.floating-actions button.floating-actions__btn:focus {
    -webkit-transform: translateY(-3px) translateZ(0);
    transform: translateY(-3px) translateZ(0);
    color: var(--primary-color);
    background: #ffffff none;
    background-color: #ffffff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.16);
}

.floating-actions__btn i,
.floating-actions__btn .fab,
.floating-actions__btn .fas,
.floating-actions__btn .far,
.floating-actions__btn .floating-actions__emoji,
.floating-actions__btn > * {
    position: relative;
    z-index: 1;
    color: inherit;
}

.floating-actions__btn--round {
    border-radius: 999px;
}

.floating-actions__btn--square {
    border-radius: var(--border-radius);
}

.floating-actions__emoji {
    font-size: 1.2rem;
    line-height: 1;
}

.floating-actions__btn--theme .theme-toggle-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.floating-actions__btn--theme .theme-toggle-icon__layer i {
    font-size: 1.15rem;
    color: var(--primary-color);
}

.floating-actions__btn--top.back-to-top {
    opacity: 0;
    visibility: hidden;
    -webkit-transform: translateY(12px) translateZ(0);
    transform: translateY(12px) translateZ(0);
    pointer-events: none;
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease,
        transform 0.3s ease,
        box-shadow var(--transition-speed) ease,
        background-color var(--transition-speed) ease,
        color var(--transition-speed) ease;
}

.floating-actions__btn--top.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    -webkit-transform: translateY(0) translateZ(0);
    transform: translateY(0) translateZ(0);
    pointer-events: auto;
}

.floating-actions__btn--top.back-to-top.is-visible:hover {
    -webkit-transform: translateY(-3px) translateZ(0);
    transform: translateY(-3px) translateZ(0);
}

.floating-actions__qrcode-wrap,
.floating-actions__wechat,
.floating-actions__mp {
    position: relative;
}

.floating-actions__btn--mp {
    color: var(--floating-mp-accent, var(--primary-color));
}

.floating-actions__qrcode {
    position: absolute;
    right: calc(100% + 0.75rem);
    bottom: 0;
    z-index: 2;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    min-width: 156px;
    color: var(--text-color, #2d3436);
    background-color: #ffffff;
    background-image: none;
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow:
        0 10px 28px rgba(15, 23, 42, 0.14),
        0 2px 8px rgba(15, 23, 42, 0.06);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(10px) scale(0.96);
    transition:
        opacity 0.22s ease,
        visibility 0.22s ease,
        transform 0.22s ease;
}

.floating-actions__qrcode-wrap:hover .floating-actions__qrcode,
.floating-actions__qrcode-wrap:focus-within .floating-actions__qrcode,
.floating-actions__qrcode-wrap.is-open .floating-actions__qrcode,
.floating-actions__wechat:hover .floating-actions__qrcode,
.floating-actions__wechat:focus-within .floating-actions__qrcode,
.floating-actions__wechat.is-open .floating-actions__qrcode {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0) scale(1);
}

.floating-actions__qrcode img {
    display: block;
    border-radius: 4px;
    background: #fff;
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-section {
    animation: fadeInUp 0.45s ease-out;
}

/* --------------------------------------------------------------------------
   Theme toggle (dark mode switch)
   -------------------------------------------------------------------------- */

.theme-toggle-btn {
    position: relative;
    overflow: visible;
}

.theme-toggle-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
}

.theme-toggle-icon__layer {
    position: absolute;
    inset: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: rotate(-90deg) scale(0.55);
    transition:
        opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.4s cubic-bezier(0.34, 1.4, 0.64, 1);
    pointer-events: none;
}

.theme-toggle-icon__layer i {
    font-size: 1rem;
    line-height: 1;
}

.theme-toggle-btn[data-active-theme="dark"] .theme-toggle-icon__sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-toggle-btn[data-active-theme="light"] .theme-toggle-icon__moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-toggle-btn[data-active-theme="system"] .theme-toggle-icon__auto {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-toggle-btn[data-active-theme="dark"]:hover .theme-toggle-icon__sun,
.theme-toggle-btn[data-active-theme="light"]:hover .theme-toggle-icon__moon,
.theme-toggle-btn[data-active-theme="system"]:hover .theme-toggle-icon__auto {
    transform: rotate(15deg) scale(1.06);
}

.theme-toggle-icon__sun i {
    color: var(--accent-color);
}

.theme-toggle-icon__moon i {
    color: var(--gray-700, #374151);
}

.theme-toggle-icon__auto i {
    color: var(--primary-color);
}

html.dark-mode-active .theme-toggle-icon__moon i {
    color: var(--gray-600);
}

/* --------------------------------------------------------------------------
   Archive list grids (category / tag / search / tags center)
   注：须在全局组件 CSS 中加载；09-home.css 仅首页按需引入
   -------------------------------------------------------------------------- */

.category-archive__grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(var(--category-posts-cols, 2), minmax(0, 1fr));
}

.category-archive__list {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(var(--category-posts-cols, 1), minmax(0, 1fr));
}

.category-archive__list .post-card {
    max-width: 100%;
    height: auto;
}

.category-archive__item {
    min-width: 0;
}

.tag-archive > .theme-container,
.tag-center-archive > .theme-container,
.collection-archive > .theme-container,
.author-archive > .theme-container,
.date-archive > .theme-container,
.search-archive > .theme-container {
    padding-top: 1.5rem;
}

/* 分类页关闭/无子分类导航时，补齐 Hero 与内容区间距；有 .category-subnav 时仍由其自身 margin 控制，避免叠加上边距 */
.category-archive > .page-hero + .theme-container {
    padding-top: 1.5rem;
}

.tag-center-archive__grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(var(--tag-center-cols, var(--category-posts-cols, 4)), minmax(0, 1fr));
}

@media (max-width: 991.98px) {
    .category-archive__grid,
    .category-archive__list,
    .tag-center-archive__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .category-archive__list {
        grid-template-columns: 1fr;
    }

    .tag-center-archive__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .tag-center-card__content,
    .tag-center-card__body {
        padding: 0.875rem 1rem;
    }

    .tag-center-card__title {
        font-size: 0.9375rem;
    }
}

@media (max-width: 379.98px) {
    .tag-center-archive__grid {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   Product & collection components (product-card / tag-center-card / collection-card)
   注：从 08-responsive.css 迁移至此，保持架构分层一致性
   -------------------------------------------------------------------------- */

/* 产品分类导航：复用 .category-subnav 结构与样式，仅保留产品页间距微调 */
.product-categories-nav.category-subnav {
    margin-top: 0;
}

.product-categories-nav--sub.category-subnav {
    margin-top: 0.75rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--bs-border-color, rgba(0, 0, 0, 0.08));
}

.product-categories-nav--sub .category-subnav__item {
    font-size: 0.8125rem;
}

.product-card {
    height: 100%;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--product-card-bg, var(--surface-color, #fff));
    transition: box-shadow 0.2s, transform 0.2s;
}

.product-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.product-card__link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.product-card__image {
    position: relative;
    aspect-ratio: var(--product-cover-aspect, 1 / 1);
    background: var(--gray-100, #f3f4f6);
    overflow: hidden;
}

.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 1rem 1.125rem 1.25rem;
}

.product-card__category {
    display: inline-block;
    align-self: flex-start;
    max-width: 100%;
    margin: 0;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary-color, #64748b) 10%, transparent);
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card__title {
    font-size: 1rem;
    margin: 0;
    line-height: 1.4;
}

/* 列表运营标签：与详情页一致（文本 + ·），不依赖 product.css 是否已加载 */
.product-card__ops-tags.nova-product-ops-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.2rem;
    margin: 0;
    color: var(--text-muted, var(--gray-500, #6b7280));
    font-size: 0.8125rem;
    line-height: 1.45;
}

.product-card__ops-tags .nova-product-ops-sep {
    margin: 0 0.15rem;
    color: var(--gray-300, var(--bs-border-color, #d1d5db));
}

.product-card__ops-tags .nova-product-ops-tag {
    display: inline;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font-size: inherit;
    font-weight: 400;
    line-height: inherit;
}

.product-card__desc {
    margin: 0;
    font-size: 0.875rem;
    color: var(--gray-600, #6b7280);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card__badges {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    max-width: 100%;
    pointer-events: none;
}

.product-card__badges--media {
    position: absolute;
    top: 0.45rem;
    left: 0.45rem;
    z-index: 3;
    max-width: calc(100% - 0.9rem);
}

.product-card--card-overlay .product-card__badges--media {
    z-index: 4;
}

.product-card--list-media-right .product-card__badges--media {
    left: auto;
    right: 0.45rem;
}

/* 纯文本模式：角标定位容器；圆角裁切见下方 pad 规则 */
.product-card--card-text .product-card__link,
.product-card--list-text .product-card__link {
    position: relative;
    border-radius: inherit;
    overflow: hidden;
}

.product-card--card-text .product-card__badges--text,
.product-card--list-text .product-card__badges--text {
    position: absolute;
    top: 0.45rem;
    left: 0.45rem;
    z-index: 3;
    margin: 0;
    max-width: calc(100% - 0.9rem);
}

.product-card--card-text.product-card--has-text-badges .product-card__body,
.product-card--list-text.product-card--has-text-badges .product-card__body {
    /* 给绝对定位角标让出高度；水平仍由内容布局内边距控制 */
    padding-top: max(var(--product-card-pad, 0px), calc(0.45rem + 1.35rem));
}

.product-card--card-text.product-card--has-text-badges.product-card--pad-media-flush-body-flush .product-card__body,
.product-card--list-text.product-card--has-text-badges.product-card--pad-media-flush-body-flush .product-card__body {
    padding-top: calc(0.45rem + 1.35rem);
    padding-bottom: var(--product-card-pad, 0px);
    padding-left: 0;
    padding-right: 0;
}

.product-card--card-text.product-card--has-text-badges.product-card--pad-media-flush-body-inset .product-card__body,
.product-card--list-text.product-card--has-text-badges.product-card--pad-media-flush-body-inset .product-card__body {
    padding-top: max(var(--product-card-pad, 0px), calc(0.45rem + 1.35rem));
}

.product-card--card-text.product-card--has-text-badges.product-card--pad-inset .product-card__body,
.product-card--list-text.product-card--has-text-badges.product-card--pad-inset .product-card__body {
    /* link 已有四周内边距；只补角标多出来的高度 */
    padding-top: max(0px, calc(0.45rem + 1.35rem - var(--product-card-pad, 0px)));
}

.product-card__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.42rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 400;
    line-height: 1.25;
    color: #fff;
    white-space: nowrap;
}

.product-card__badge--hot {
    background-color: #ef4444;
}

.product-card__badge--new {
    background-color: #f59e0b;
}

.product-card__price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.15rem;
}

.product-card__price-current {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--danger-color, #dc2626);
}

.product-card__price-original {
    font-size: 0.8125rem;
    color: var(--gray-500, #9ca3af);
    text-decoration: line-through;
}

.product-price {
    display: inline-flex;
    align-items: baseline;
    font-variant-numeric: tabular-nums;
}

.product-price__symbol {
    margin-right: 0.05em;
}

.product-price__int {
    font-size: 1em;
    font-weight: inherit;
}

.product-price__dec {
    font-size: 0.72em;
    font-weight: 600;
    opacity: 0.92;
}

.product-card__price-original .product-price,
.product-price--original {
    color: inherit;
    font-weight: 500;
}

.product-card__stock {
    margin-top: 0;
    font-size: 0.75rem;
    line-height: 1.3;
}

.product-card__stock.is-in-stock {
    color: var(--success-color, #16a34a);
}

.product-card__stock.is-out-of-stock {
    color: var(--danger-color, #dc2626);
    font-weight: 600;
}

/* 产品归档：卡片/列表间距由主题设置驱动 */
.product-archive .category-archive__grid {
    gap: var(--product-card-gap, 1.5rem);
}

.product-archive .category-archive__list {
    gap: var(--product-list-gap, 1.5rem);
    grid-template-columns: 1fr;
}

.product-archive--list-divider .category-archive__list > .product-card + .product-card {
    border-top: 1px solid var(--product-list-divider-color, var(--bs-border-color, rgba(15, 23, 42, 0.12)));
}

/* 卡片布局：纯文本 / 上图下文 / 上文下图 */
.product-card--card-text .product-card__link,
.product-card--card-image-top .product-card__link,
.product-card--card-image-bottom .product-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card--card-image-top .product-card__link,
.product-card--card-image-bottom .product-card__link {
    gap: var(--product-media-gap, 0px);
}

.product-card--card-image-bottom .product-card__link {
    flex-direction: column-reverse;
}

/* 卡片布局：图文叠加 — 四角统一圆角，文字高对比 */
.product-card--card-overlay {
    overflow: hidden;
    border-radius: var(--border-radius, 12px);
}

.product-card--card-overlay.product-card--pad-media-flush-body-flush {
    overflow: hidden;
    border-radius: var(--border-radius, 12px);
}

.product-card--card-overlay .product-card__link {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: var(--product-cover-aspect, 16 / 9);
    overflow: hidden;
    border-radius: inherit;
}

.product-card--card-overlay .product-card__media {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 0;
}

.product-card--card-overlay .product-card__body {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 1;
    padding: 1.25rem 1rem 1.05rem;
    color: #fff;
}

.product-card--card-overlay.product-card--overlay-bottom .product-card__body {
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.58) 32%, rgba(15, 23, 42, 0.86) 68%, rgba(15, 23, 42, 0.94) 100%);
}

.product-card--card-overlay.product-card--overlay-top .product-card__body {
    top: 0;
    background: linear-gradient(0deg, transparent 0%, rgba(15, 23, 42, 0.58) 32%, rgba(15, 23, 42, 0.86) 68%, rgba(15, 23, 42, 0.94) 100%);
}

.product-card--card-overlay.product-card--overlay-center .product-card__body {
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.72);
}

.product-card--card-overlay .product-card__title,
.product-card--card-overlay .product-card__desc,
.product-card--card-overlay .product-card__stock,
.product-card--card-overlay .product-card__price-original {
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.product-card--card-overlay .product-card__desc {
    opacity: 0.95;
}

.product-card--card-overlay .product-card__category {
    background: rgba(255, 255, 255, 0.18);
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.product-card--card-overlay .product-card__ops-tags.nova-product-ops-tags,
.product-card--card-overlay .product-card__ops-tags .nova-product-ops-tag {
    color: rgba(255, 255, 255, 0.88);
}

.product-card--card-overlay .product-card__ops-tags .nova-product-ops-sep {
    color: rgba(255, 255, 255, 0.45);
}

.product-card--card-overlay .product-card__price-current {
    color: #fecaca !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* 列表布局：左图右文 / 左文右图 / 纯文本 */
.product-card--list-media-left .product-card__link,
.product-card--list-media-right .product-card__link {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: 100%;
    gap: var(--product-media-gap, 0.9rem);
}

.product-card--list-media-right .product-card__link {
    flex-direction: row-reverse;
}

.product-card--list-media-left .product-card__image,
.product-card--list-media-right .product-card__image {
    width: 240px;
    max-width: 40%;
    flex-shrink: 0;
}

.product-card--list-media-left .product-card__body,
.product-card--list-media-right .product-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.product-card--list-text .product-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 通栏图文：图文间距优先 media-gap；未设时回退内边距，避免与正文 padding 叠距 */
.product-card--card-image-top.product-card--pad-media-flush-body-flush .product-card__link,
.product-card--card-image-bottom.product-card--pad-media-flush-body-flush .product-card__link {
    gap: var(--product-media-gap, var(--product-card-pad, 14px));
}

.product-card--card-image-top.product-card--pad-media-flush-body-flush .product-card__body,
.product-card--card-image-bottom.product-card--pad-media-flush-body-flush .product-card__body {
    padding: 0;
}

.product-card--card-image-top.product-card--pad-media-flush-body-inset .product-card__link,
.product-card--card-image-bottom.product-card--pad-media-flush-body-inset .product-card__link {
    gap: 0;
}

/* 内容布局：含内边距布局用 -box；列表通栏正文仍用上下内边距 */
.product-card--list.product-card--pad-media-flush-body-flush .product-card__body {
    padding: var(--product-card-pad, 14px) 0;
}

/* 通栏图文 / 通栏文图：图片四角统一圆角（不依赖外层盒子裁切） */
.product-card--pad-media-flush-body-flush {
    overflow: visible;
    border-radius: 0;
}

.product-card--pad-media-flush-body-flush .product-card__image,
.product-card--pad-media-flush-body-flush .product-card__media {
    border-radius: var(--border-radius, 12px);
    overflow: hidden;
}

.product-card--pad-media-flush-body-flush .product-card__image img {
    border-radius: inherit;
}

/* 纯文本无封面：外层保留圆角并用 overflow 裁切四角文字，勿沿用通栏图文的 overflow:visible */
.product-card--card-text.product-card--pad-media-flush-body-flush,
.product-card--list-text.product-card--pad-media-flush-body-flush,
.product-card--card-text.product-card--pad-media-flush-body-inset,
.product-card--list-text.product-card--pad-media-flush-body-inset,
.product-card--card-text.product-card--pad-inset,
.product-card--list-text.product-card--pad-inset {
    overflow: hidden;
    border-radius: var(--border-radius, 12px);
}

.product-card--pad-media-flush-body-inset .product-card__body {
    padding: var(--product-card-pad-box, var(--product-card-pad, 14px));
}

.product-card--pad-inset .product-card__link {
    padding: var(--product-card-pad-box, var(--product-card-pad, 14px));
    gap: var(--product-media-gap, calc(var(--product-card-pad, 14px) * 0.65));
}

.product-card--pad-inset .product-card__body {
    padding: 0;
}

.product-card--pad-inset .product-card__image {
    /* 图文内嵌模式：图片圆角直接跟随全局主题圆角，与内边距解耦 */
    border-radius: var(--border-radius, 12px);
}

/* 列表布局下三种内容布局的横排间距 */
.product-card--list.product-card--pad-media-flush-body-flush .product-card__link {
    gap: var(--product-media-gap, 0.9rem);
}

.product-card--list.product-card--pad-media-flush-body-inset .product-card__link {
    gap: 0;
}

.product-card--list.product-card--pad-inset .product-card__link {
    gap: var(--product-media-gap, calc(var(--product-card-pad, 14px) * 0.75));
}

/* 移动端：卡片退化为上图下文，列表退化为上图下文，避免窄屏挤压 */
@media (max-width: 768px) {
    .product-card--card-image-bottom .product-card__link {
        flex-direction: column;
    }

    .product-card--card-overlay .product-card__link {
        display: flex;
        flex-direction: column;
        aspect-ratio: auto;
        height: auto;
    }

    .product-card--card-overlay .product-card__media {
        position: relative;
        inset: auto;
        width: 100%;
        aspect-ratio: var(--product-cover-aspect, 16 / 9);
    }

    .product-card--card-overlay .product-card__body {
        position: static;
        padding: var(--product-card-pad-box, var(--product-card-pad, 14px));
        transform: none;
        background: none;
        color: inherit;
    }

    .product-card--card-overlay .product-card__title,
    .product-card--card-overlay .product-card__desc,
    .product-card--card-overlay .product-card__stock,
    .product-card--card-overlay .product-card__price-original,
    .product-card--card-overlay .product-card__price-current,
    .product-card--card-overlay .product-card__category {
        text-shadow: none;
    }

    .product-card--card-overlay .product-card__title {
        color: inherit !important;
    }

    .product-card--card-overlay .product-card__desc,
    .product-card--card-overlay .product-card__stock,
    .product-card--card-overlay .product-card__price-original {
        color: var(--gray-600, #6b7280) !important;
        opacity: 1;
    }

    .product-card--card-overlay .product-card__price-current {
        color: var(--danger-color, #dc2626) !important;
    }

    .product-card--card-overlay .product-card__category {
        color: var(--primary-color) !important;
    }

    .product-card--list-media-left .product-card__link,
    .product-card--list-media-right .product-card__link {
        flex-direction: column;
    }

    .product-card--list-media-left .product-card__image,
    .product-card--list-media-right .product-card__image {
        width: 100%;
        max-width: 100%;
    }
}

.tag-center-card {
    height: 100%;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--card-bg, #fff);
    border: none;
    box-shadow: none;
    transition: box-shadow 0.2s, transform 0.2s;
}

.collection-card {
    height: 100%;
    border-radius: var(--border-radius);
    overflow: hidden;
    /* 未设置专题卡片背景色时保持透明，不回落到全局 --card-bg / 白色 */
    background: var(--collection-card-bg, transparent);
    border: none;
    box-shadow: none;
    transition: box-shadow 0.2s, transform 0.2s;
}

.collection-center-archive .collection-card,
.page-collections .collection-card {
    border: none !important;
    outline: none;
    box-shadow: none;
}

.tag-center-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.collection-card.collection-card--has-bg:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.tag-center-card__link,
.collection-card__link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.tag-center-card--plain .tag-center-card__link {
    display: flex;
    flex-direction: column;
    min-height: 7.5rem;
}

.tag-center-card__media {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: clamp(7.5rem, 22vw, 10rem);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.tag-center-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.15) 0%, rgba(15, 23, 42, 0.72) 100%);
}

.tag-center-card__content {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 1rem 1.125rem;
    color: #fff;
}

.tag-center-card--has-cover .tag-center-card__title {
    color: #fff;
    margin: 0 0 0.35rem;
}

.tag-center-card--has-cover .tag-center-card__count {
    color: rgba(255, 255, 255, 0.9);
}

.tag-center-card__body,
.collection-card__body {
    padding: 1rem 1.125rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tag-center-card--list .tag-center-card__link,
.collection-card--list .collection-card__link {
    flex-direction: row;
    align-items: stretch;
}

.tag-center-card__title,
.collection-card__title {
    font-size: 1rem;
    margin: 0 0 0.5rem;
    line-height: 1.4;
}

.tag-center-card__desc,
.collection-card__desc {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-600, #6b7280);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tag-center-card__count,
.collection-card__count {
    font-size: 0.8125rem;
    color: var(--gray-500, #868e96);
}

.collection-card--plain .collection-card__link {
    display: flex;
    flex-direction: column;
    min-height: 7.5rem;
}

.collection-card--stacked .collection-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: transparent;
}

.collection-card--stacked .collection-card__body {
    flex: 1;
    background: transparent;
    border-top: 0;
}

/* 有背景色或内嵌内容布局时，内容区可显示底色（无边框） */
.collection-card--has-bg.collection-card--stacked .collection-card__body,
.collection-card--pad-inset.collection-card--stacked .collection-card__body,
.collection-card--pad-media-flush-body-inset.collection-card--stacked .collection-card__body {
    background: var(--collection-card-bg, transparent);
    border: none;
}

.collection-card--has-bg.collection-card--pad-inset,
.collection-card--has-bg.collection-card--pad-media-flush-body-inset {
    background: var(--collection-card-bg, transparent);
}

.collection-card--overlay .collection-card__link {
    display: block;
    height: 100%;
}

.collection-card__media {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: var(--collection-card-aspect, 16 / 9);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.collection-card--overlay .collection-card__content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    padding: 1.35rem 1.125rem 1rem;
    color: #fff;
    text-align: left;
    background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0) 0%,
        rgba(15, 23, 42, 0.42) 42%,
        rgba(15, 23, 42, 0.82) 100%
    );
}

.collection-card--overlay.collection-card--has-cover .collection-card__title {
    color: #fff;
    margin: 0 0 0.35rem;
}

.collection-card--overlay.collection-card--has-cover .collection-card__desc {
    color: rgba(255, 255, 255, 0.92);
}

.collection-card--overlay.collection-card--has-cover .collection-card__count {
    color: rgba(255, 255, 255, 0.9);
}

.collection-card__image {
    position: relative;
    aspect-ratio: var(--collection-card-aspect, 16 / 9);
    background: var(--gray-100, #f3f4f6);
    overflow: hidden;
    flex-shrink: 0;
}

.collection-card--stacked.collection-card--has-cover .collection-card__count--badge {
    position: absolute;
    left: 0.65rem;
    bottom: 0.65rem;
    z-index: 2;
    padding: 0.2rem 0.55rem;
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.92);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    line-height: 1.3;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.collection-card--list .collection-card__image {
    width: clamp(140px, 30%, 220px);
    flex-shrink: 0;
}

.collection-card--list .collection-card__link {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: 100%;
}

.collection-card--media-right .collection-card__link {
    flex-direction: row-reverse;
}

.collection-card--list-style-text .collection-card__link {
    flex-direction: column;
}

.collection-card--image_bottom .collection-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.collection-card--image_bottom .collection-card__body {
    border: none;
}

/* 通栏文本 / 通栏图文 / 通栏文图：无白底盒、无边框；圆角交给图片本身 */
.collection-card--pad-flush,
.collection-card--pad-media-flush-body-flush {
    background: var(--collection-card-bg, transparent);
    border: none;
    box-shadow: none;
    overflow: visible;
    border-radius: 0;
}

.collection-card--pad-flush:hover,
.collection-card--pad-media-flush-body-flush:hover {
    box-shadow: none;
    transform: none;
}

.collection-card--pad-flush .collection-card__body,
.collection-card--pad-media-flush-body-flush .collection-card__body,
.collection-card--pad-flush .collection-card__link,
.collection-card--pad-media-flush-body-flush .collection-card__link {
    background: transparent;
    border: none;
}

/* 通栏布局：图片四角圆角 */
.collection-card--pad-flush .collection-card__image,
.collection-card--pad-flush .collection-card__media,
.collection-card--pad-media-flush-body-flush .collection-card__image,
.collection-card--pad-media-flush-body-flush .collection-card__media {
    border-radius: calc(var(--border-radius) * 0.65);
    overflow: hidden;
}

.collection-card--overlay-pos-top .collection-card__content {
    top: 0;
    bottom: auto;
    background: linear-gradient(
        0deg,
        rgba(15, 23, 42, 0) 0%,
        rgba(15, 23, 42, 0.42) 42%,
        rgba(15, 23, 42, 0.82) 100%
    );
}

.collection-card--overlay-pos-center .collection-card__content {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.55);
}

.collection-card--pad-inset .collection-card__body,
.collection-card--pad-media-flush-body-inset .collection-card__body {
    padding: var(--collection-card-padding-box, var(--card-content-padding-box, var(--collection-card-padding, var(--card-content-padding, 14px))));
}

.collection-card--pad-media-flush-body-flush .collection-card__body,
.collection-card--pad-flush .collection-card__body {
    padding: var(--collection-card-padding, var(--card-content-padding, 14px)) 0;
}

.collection-card--pad-inset .collection-card__image,
.collection-card--pad-inset .collection-card__media {
    margin: var(--collection-card-padding-box, var(--card-content-padding-box, var(--collection-card-padding, var(--card-content-padding, 14px))));
    margin-bottom: 0;
    border-radius: calc(var(--border-radius) * 0.65);
    overflow: hidden;
}

.collection-card--pad-media-flush-body-inset:not(.collection-card--image_bottom):not(.collection-card--list) .collection-card__image,
.collection-card--pad-media-flush-body-inset:not(.collection-card--image_bottom):not(.collection-card--list) .collection-card__media {
    border-radius: 0;
}

.collection-card--pad-inset.collection-card--image_bottom .collection-card__image {
    margin-top: 0;
    margin-bottom: var(--collection-card-padding, var(--card-content-padding, 14px));
}

.collection-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
}

.collection-center-archive__list {
    gap: var(--article-list-card-gap, var(--layout-grid-gap, 16px));
}

/* --------------------------------------------------------------------------
   List loading animations
   -------------------------------------------------------------------------- */

/* Fade-in animation */
.list-loading--fade-in .article-card,
.list-loading--fade-in .product-card {
    opacity: 0;
    transform: translateY(12px);
    animation: listFadeIn 0.5s ease forwards;
}

.list-loading--fade-in .article-card:nth-child(2),
.list-loading--fade-in .product-card:nth-child(2) {
    animation-delay: 0.08s;
}

.list-loading--fade-in .article-card:nth-child(3),
.list-loading--fade-in .product-card:nth-child(3) {
    animation-delay: 0.16s;
}

.list-loading--fade-in .article-card:nth-child(4),
.list-loading--fade-in .product-card:nth-child(4) {
    animation-delay: 0.24s;
}

.list-loading--fade-in .article-card:nth-child(5),
.list-loading--fade-in .product-card:nth-child(5) {
    animation-delay: 0.32s;
}

.list-loading--fade-in .article-card:nth-child(6),
.list-loading--fade-in .product-card:nth-child(6) {
    animation-delay: 0.40s;
}

.list-loading--fade-in .article-card:nth-child(n+7),
.list-loading--fade-in .product-card:nth-child(n+7) {
    animation-delay: 0.48s;
}

@keyframes listFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Skeleton screen */
.skeleton-card {
    background: var(--card-bg, #fff);
    border-radius: var(--border-radius, 12px);
    overflow: hidden;
    box-shadow: var(--box-shadow-md, none);
}

.skeleton-card__image {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
}

.skeleton-card__body {
    padding: 14px;
}

.skeleton-card__line {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    margin-bottom: 8px;
}

.skeleton-card__line--title {
    height: 18px;
    width: 80%;
    margin-bottom: 12px;
}

.skeleton-card__line--text {
    width: 100%;
}

.skeleton-card__line--text-short {
    width: 60%;
}

.skeleton-card__line--meta {
    height: 12px;
    width: 40%;
    margin-top: 12px;
}

html.dark-mode-active .skeleton-card__image,
html.dark-mode-active .skeleton-card__line {
    background: linear-gradient(90deg, #2d2d44 25%, #3a3a5c 50%, #2d2d44 75%);
    background-size: 200% 100%;
}

@keyframes skeletonShimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* --------------------------------------------------------------------------
   Search real-time preview dropdown
   -------------------------------------------------------------------------- */

.search-preview-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: var(--card-bg, #fff);
    border-radius: 0 0 var(--border-radius, 12px) var(--border-radius, 12px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-top: 1px solid var(--gray-200, #e5e7eb);
    max-height: 400px;
    overflow-y: auto;
    margin-top: 4px;
}

html.dark-mode-active .search-preview-dropdown {
    background: var(--dark-card-bg, #1e1e38);
    border-top-color: var(--gray-700, #374151);
}

.search-preview__loading,
.search-preview__empty {
    padding: 16px 20px;
    text-align: center;
    color: var(--text-muted, #6b7280);
    font-size: 14px;
}

.search-preview__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text-color, #2d3436);
    transition: background-color 0.15s ease;
    border-bottom: 1px solid var(--gray-100, #f3f4f6);
}

.search-preview__item:hover {
    background: var(--gray-50, #f9fafb);
    color: var(--primary-color);
}

html.dark-mode-active .search-preview__item {
    border-bottom-color: var(--gray-700, #374151);
}

html.dark-mode-active .search-preview__item:hover {
    background: var(--gray-800, #1f2937);
}

.search-preview__item-cover {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.search-preview__item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-preview__item-title {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.search-preview__item-arrow {
    font-size: 12px;
    color: var(--text-muted, #9ca3af);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.search-preview__item:hover .search-preview__item-arrow {
    opacity: 1;
}

.search-preview__more {
    display: block;
    padding: 12px 16px;
    text-align: center;
    text-decoration: none;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
    border-top: 1px solid var(--gray-100, #f3f4f6);
    transition: background-color 0.15s ease;
}

.search-preview__more:hover {
    background: var(--gray-50, #f9fafb);
}

html.dark-mode-active .search-preview__more {
    border-top-color: var(--gray-700, #374151);
}

html.dark-mode-active .search-preview__more:hover {
    background: var(--gray-800, #1f2937);
}

/* ============================================================
   语音搜索按钮
   ============================================================ */

.voice-search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted, #9ca3af);
    background: transparent;
    border: none;
    transition: all 0.2s ease;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
}

.voice-search-btn:hover {
    color: var(--primary-color);
    background: var(--gray-50, #f9fafb);
}

@supports (background: color-mix(in srgb, #000 10%, #fff 90%)) {
    .voice-search-btn:hover {
        background: color-mix(in srgb, var(--primary-color) 8%, transparent);
    }
}

.voice-search-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 聆听中 — 红色呼吸动画 */
.voice-search-btn--listening {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    animation: voicePulse 1.2s ease-in-out infinite;
}

.voice-search-btn--listening:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

@keyframes voicePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
}

/* 提示文字 */
.voice-search-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    border-radius: 6px;
    background: var(--gray-800, #1f2937);
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.voice-search-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--gray-800, #1f2937);
}

/* 深色模式适配 */
html.dark-mode-active .voice-search-btn {
    color: var(--gray-400, #9ca3af);
}

html.dark-mode-active .voice-search-btn:hover {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
}

@supports (background: color-mix(in srgb, #000 10%, #fff 90%)) {
    html.dark-mode-active .voice-search-btn:hover {
        background: color-mix(in srgb, var(--primary-color) 12%, transparent);
    }
}

html.dark-mode-active .voice-search-tooltip {
    background: var(--gray-200, #e5e7eb);
    color: var(--gray-900, #111827);
}

html.dark-mode-active .voice-search-tooltip::after {
    border-top-color: var(--gray-200, #e5e7eb);
}

/* --------------------------------------------------------------------------
   Scroll Cards Widget（横向滚动卡片）
   -------------------------------------------------------------------------- */

.widget-scroll-cards {
    margin-bottom: 1.5rem;
    --scroll-cards-gap: 1rem;
    --scroll-cards-per-row-active: var(--scroll-cards-per-row, 4);
    max-width: 100%;
    overflow-x: clip;
}

@supports not (overflow: clip) {
    .widget-scroll-cards {
        overflow-x: hidden;
    }
}

.widget-scroll-cards--articles {
    --article-list-aspect: var(--scroll-card-aspect, 4 / 3);
    --article-title-lines: var(--scroll-card-title-lines, 2);
    --article-excerpt-lines: var(--scroll-card-excerpt-lines, 2);
    --scroll-card-title-size: 1.125rem;
    --scroll-card-title-line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

@media (max-width: 991.98px) {
    .widget-scroll-cards--articles {
        --scroll-card-title-size: 1rem;
    }
}

@media (max-width: 767.98px) {
    .widget-scroll-cards {
        --scroll-cards-per-row-active: var(--scroll-cards-per-row-mobile, 2);
    }
}

.scroll-cards__header.section-header--inline {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.scroll-cards__heading {
    flex: 1 1 auto;
    min-width: 0;
}

.scroll-cards__heading .widget-simple-header {
    margin-bottom: 0;
}

.scroll-cards__viewport {
    position: relative;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
    container-type: inline-size;
    container-name: scroll-cards;
}

.scroll-cards__viewport.is-animating {
    scroll-snap-type: none;
}

.widget-scroll-cards.is-dragging,
.widget-scroll-cards.is-dragging .scroll-card {
    cursor: grabbing;
    user-select: none;
}

.scroll-cards__viewport::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.scroll-cards__track {
    position: relative;
    display: flex;
    gap: var(--scroll-cards-gap);
    width: max-content;
    min-width: 100%;
}

.scroll-card[data-scroll-card-clone="true"] {
    pointer-events: none;
    user-select: none;
}

.scroll-card:not(.scroll-card--article),
.scroll-card.scroll-card--article {
    flex-grow: 0;
    flex-shrink: 0;
    box-sizing: border-box;
    /* 百度 X5 / 旧系统 WebView 不支持 100cqw；用 100% 相对视口容器，避免裸 100vw 撑开页面 */
    width: calc((100% - (var(--scroll-cards-per-row-active) - 1) * var(--scroll-cards-gap)) / var(--scroll-cards-per-row-active));
    max-width: 100%;
    min-width: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    -webkit-user-drag: none;
    user-select: none;
}

/* 无 cqw 时 track 是 max-content，100% 会循环；退回受控的小屏宽度 */
@supports not (width: 1cqw) {
    .scroll-cards__viewport {
        width: 100%;
    }

    .scroll-card:not(.scroll-card--article),
    .scroll-card.scroll-card--article {
        width: calc((100vw - 2.5rem - (var(--scroll-cards-per-row-active) - 1) * var(--scroll-cards-gap)) / var(--scroll-cards-per-row-active));
        max-width: calc(100vw - 2.5rem);
    }
}

@supports (width: 1cqw) {
    .scroll-card:not(.scroll-card--article),
    .scroll-card.scroll-card--article {
        flex: 0 0 calc((100cqw - (var(--scroll-cards-per-row-active) - 1) * var(--scroll-cards-gap)) / var(--scroll-cards-per-row-active));
        width: auto;
        max-width: none;
    }
}

.scroll-card:not(.scroll-card--article) {
    border-radius: var(--card-border-radius);
    background-color: #ffffff;
    background-color: var(--card-bg, #ffffff);
    border: 1px solid rgba(15, 23, 42, 0.08);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.scroll-card:not(.scroll-card--article):hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    color: inherit;
}

@supports (background: color-mix(in srgb, #000 10%, #fff 90%)) {
    .scroll-card:not(.scroll-card--article):hover {
        box-shadow: 0 10px 28px color-mix(in srgb, var(--primary-color) 12%, transparent);
    }
}

.scroll-card.scroll-card--article {
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    height: 100%;
}

.scroll-card.scroll-card--article:hover {
    transform: none;
    box-shadow: none;
}

.scroll-card.scroll-card--article .article-list-card__inner {
    height: 100%;
}

.scroll-card.scroll-card--article.scroll-card--list .article-list-card__inner--list {
    min-height: 100%;
}

/* 列表样式在横向轨道内收窄封面，避免挤占标题区 */
.widget-scroll-cards--list .scroll-card--list .article-list-card__inner--list .article-list-card__media-link {
    width: 42%;
    max-width: 9rem;
}

.widget-scroll-cards--list .scroll-card--list .article-list-card__inner--list.article-list-card__inner--card-pad-media-flush-body-inset .article-list-card__media-link,
.widget-scroll-cards--list .scroll-card--list .article-list-card__inner--list.article-list-card__inner--card-pad-inset .article-list-card__media-link {
    width: 42%;
    max-width: 9rem;
}

.scroll-card.scroll-card--article .article-list-card__body,
.scroll-card.scroll-card--article .article-list-card__title-link {
    min-width: 0;
    max-width: 100%;
}

/*
 * 短标题 / 长标题在微信、X5、Chrome 移动端会被「字体放大」按文本量分别缩放，
 * 导致同一排卡片 title 字号不一致。用固定字号 + max-height 关掉自动缩放。
 */
.widget-scroll-cards--articles .article-list-card__title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--article-title-lines, 2);
    line-clamp: var(--article-title-lines, 2);
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    font-size: var(--scroll-card-title-size, 1.125rem);
    font-weight: 600;
    line-height: var(--scroll-card-title-line-height, 1.5);
    max-height: calc(var(--scroll-card-title-line-height, 1.5) * 1em * var(--article-title-lines, 2));
    word-break: break-word;
    overflow-wrap: anywhere;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.scroll-card__media {
    position: relative;
    display: block;
    width: 100%;
    flex-shrink: 0;
    overflow: hidden;
    height: 0;
    padding-bottom: 75%;
    background: #f3f4f6;
}

@supports (aspect-ratio: 1 / 1) {
    .scroll-card__media {
        height: auto;
        padding-bottom: 0;
        aspect-ratio: var(--scroll-card-aspect, 4 / 3);
        background: linear-gradient(135deg, var(--gray-100, #f3f4f6) 0%, var(--gray-200, #e5e7eb) 100%);
    }
}

@supports (aspect-ratio: 1 / 1) and (background: color-mix(in srgb, #000 10%, #fff 90%)) {
    .scroll-card__media {
        background: linear-gradient(
            135deg,
            color-mix(in srgb, var(--primary-color) 12%, transparent) 0%,
            color-mix(in srgb, var(--secondary-color) 12%, transparent) 100%
        );
    }
}

.scroll-card__media > img,
.scroll-card__media > .nova-image-guard,
.scroll-card__image {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center;
}

.scroll-card__media-link {
    display: block;
    width: 100%;
    flex-shrink: 0;
    color: inherit;
    text-decoration: none;
}

.scroll-card__placeholder {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 3rem;
}

.scroll-card__badge {
    position: absolute;
    left: 0.65rem;
    bottom: 0.65rem;
    padding: 0.2rem 0.55rem;
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.92);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
}

.scroll-card__body {
    padding: 0.85rem 1rem 1rem;
}

.scroll-card__title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.scroll-card__desc {
    font-size: 0.8125rem;
    color: var(--gray-600, #6b7280);
    margin: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.scroll-cards__nav {
    flex: 0 0 auto;
    align-items: center;
    gap: 0.5rem;
}

.scroll-cards__nav-btn {
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 50%;
    background: var(--surface-color, #fff);
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

@supports (background: color-mix(in srgb, #000 10%, #fff 90%)) {
    .scroll-cards__nav-btn {
        border-color: color-mix(in srgb, var(--primary-color) 25%, transparent);
    }
}

@media (max-width: 767.98px) {
    .scroll-cards__nav-btn {
        width: 2rem;
        height: 2rem;
    }

    .scroll-cards__nav-btn + .scroll-cards__nav-btn {
        margin-left: 0;
    }
}

.scroll-cards__nav-btn:hover {
    background: var(--gray-50, #f9fafb);
}

@supports (background: color-mix(in srgb, #000 10%, #fff 90%)) {
    .scroll-cards__nav-btn:hover {
        background: color-mix(in srgb, var(--primary-color) 8%, transparent);
    }
}

.scroll-cards__nav-btn + .scroll-cards__nav-btn {
    margin-left: 0;
}

html.dark-mode-active .scroll-card:not(.scroll-card--article) {
    background: var(--card-bg);
    border-color: rgba(255, 255, 255, 0.12);
}

html.dark-mode-active .scroll-cards__nav-btn {
    background: var(--card-bg);
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--primary-color);
}

html.dark-mode-active .scroll-card__badge {
    background: var(--dark-background-color, #1f1f1f);
    color: var(--primary-color);
}

@supports (background: color-mix(in srgb, #000 10%, #fff 90%)) {
    html.dark-mode-active .scroll-card:not(.scroll-card--article) {
        border-color: color-mix(in srgb, var(--primary-color) 18%, transparent);
    }

    html.dark-mode-active .scroll-cards__nav-btn {
        border-color: color-mix(in srgb, var(--primary-color) 28%, transparent);
    }

    html.dark-mode-active .scroll-card__badge {
        background: color-mix(in srgb, var(--dark-background-color) 82%, #000000 18%);
    }
}

/* --------------------------------------------------------------------------
   分类展示卡片小部件 (category-showcase)
   -------------------------------------------------------------------------- */

.widget-category-showcase {
    margin-bottom: 1.5rem;
}

.category-showcase__grid {
    display: grid;
    gap: var(--category-showcase-gap, var(--layout-grid-gap, 1rem));
    grid-template-columns: repeat(var(--category-showcase-cols-desktop, 4), minmax(0, 1fr));
}

@media (max-width: 991.98px) {
    .category-showcase__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .category-showcase__grid {
        grid-template-columns: repeat(var(--category-showcase-cols-mobile, 2), minmax(0, 1fr));
    }
}

.category-showcase-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: var(--card-border-radius);
    overflow: hidden;
    background: var(--card-bg, #fff);
    border: none;
    box-shadow: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    text-decoration: none;
    color: inherit;
}

.category-showcase-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    color: inherit;
}

@supports (background: color-mix(in srgb, #000 10%, #fff 90%)) {
    .category-showcase-card:hover {
        box-shadow: 0 10px 28px color-mix(in srgb, var(--primary-color) 12%, transparent);
    }
}

.category-showcase-card__media {
    position: relative;
    display: grid;
    grid-template: 1fr / 1fr;
    overflow: hidden;
    width: 100%;
    aspect-ratio: var(--category-showcase-aspect, 1 / 1);
}

.category-showcase-card__image,
.category-showcase-card__placeholder,
.category-showcase-card__overlay {
    grid-area: 1 / 1;
}

.category-showcase-card__image {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 100%;
    min-width: 100%;
    object-fit: cover;
    object-position: center;
}

.category-showcase-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 100%;
    background: linear-gradient(135deg, var(--gray-100, #f3f4f6) 0%, var(--gray-200, #e5e7eb) 100%);
}

@supports (background: color-mix(in srgb, #000 10%, #fff 90%)) {
    .category-showcase-card__placeholder {
        background: linear-gradient(
            135deg,
            color-mix(in srgb, var(--primary-color) 12%, transparent) 0%,
            color-mix(in srgb, var(--secondary-color) 12%, transparent) 100%
        );
    }
}

.category-showcase-card__emoji {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1;
}

.category-showcase-card--overlay {
    display: block;
}

.category-showcase-card--overlay .category-showcase-card__media {
    height: auto;
}

.category-showcase-card__count-badge {
    position: absolute;
    left: 0.65rem;
    bottom: 0.65rem;
    z-index: 2;
    padding: 0.2rem 0.55rem;
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.92);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    line-height: 1.3;
}

.category-showcase-card__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0) 20%, rgba(15, 23, 42, 0.72) 100%);
    pointer-events: none;
}

.category-showcase-card__content {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 1.25rem;
    color: #fff;
    pointer-events: auto;
}

.category-showcase-card__body {
    padding: 1rem;
    text-align: center;
}

.category-showcase-card__title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    line-height: 1.4;
    font-weight: 700;
}

.category-showcase-card--overlay .category-showcase-card__title {
    color: #fff;
}

.category-showcase-card--stacked .category-showcase-card__title {
    color: var(--text-color, #1f2937);
}

.category-showcase-card__count {
    margin: 0 0 0.35rem;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.88);
}

.category-showcase-card__desc {
    margin: 0 0 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.6;
}

.category-showcase-card--overlay .category-showcase-card__desc {
    color: rgba(255, 255, 255, 0.92);
}

.category-showcase-card--stacked .category-showcase-card__desc {
    color: var(--gray-600, #6b7280);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-showcase-card__btn {
    display: inline-block;
    margin-top: auto;
    padding: 0.35rem 1rem;
    border-radius: 2rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.category-showcase-card__btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.category-showcase-card__btn--primary {
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: #fff;
}

.category-showcase-card__btn--primary:hover {
    background-color: var(--primary-hover-color);
    border-color: var(--primary-hover-color);
    color: #fff;
}

.category-showcase-card__btn--secondary {
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.95);
    color: #1f2937;
}

.category-showcase-card--stacked .category-showcase-card__btn--secondary {
    background-color: var(--surface-color, #fff);
    border-color: var(--gray-300, #d1d5db);
    color: var(--text-color, #1f2937);
}

.category-showcase-card__btn--outline {
    background-color: transparent;
    border: 1px solid currentColor;
    color: inherit;
}

.category-showcase-card--overlay .category-showcase-card__btn--outline {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.92);
}

.category-showcase-card--stacked .category-showcase-card__btn--outline {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.category-showcase-card--link {
    cursor: pointer;
}

.category-showcase-card--link .category-showcase-card__btn-hint {
    pointer-events: none;
}

/* Sponsor / ad slots (custom HTML) */
.oriel-ad-slot {
    width: 100%;
}

.oriel-ad-slot__inner {
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
}

.oriel-ad-slot__inner img {
    max-width: 100%;
    height: auto;
}

.oriel-ad-slot--home-banner .oriel-ad-slot__inner {
    max-width: var(--layout-width, 1400px);
    padding-inline: 1rem;
}

.oriel-ad-slot--article .oriel-ad-slot__inner {
    padding: 1rem;
    border-radius: var(--card-border-radius, 12px);
    background: var(--gray-50, #f9fafb);
    border-width: 1px;
    border-style: dashed;
    border-color: var(--gray-300, #d1d5db);
}

@supports (background: color-mix(in srgb, #000 10%, #fff 90%)) {
    .oriel-ad-slot--article .oriel-ad-slot__inner {
        background: color-mix(in srgb, var(--primary-color) 5%, transparent);
        border-color: color-mix(in srgb, var(--primary-color) 16%, transparent);
    }
}

/* --------------------------------------------------------------------------
   Top toast (forms, newsletter, comments, etc.)
   -------------------------------------------------------------------------- */

.site-toast-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1045;
    display: flex;
    justify-content: center;
    padding: 0.75rem 1rem;
    pointer-events: none;
}

.site-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: min(100%, 36rem);
    padding: 0.875rem 1rem;
    border-radius: var(--border-radius);
    background-color: var(--surface-color);
    border: 1px solid var(--gray-200);
    box-shadow: var(--box-shadow-md);
    color: var(--text-color);
    transform: translateY(calc(-100% - 1rem));
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.35s ease;
}

.site-toast.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.site-toast--success {
    border-color: #6ee7b7;
    background-color: #ecfdf5;
}

.site-toast--success .site-toast__icon {
    color: #10b981;
}

.site-toast--warning {
    border-color: var(--gray-200, #e5e7eb);
    background-color: var(--surface-color, #fff);
}

.site-toast--warning .site-toast__icon {
    color: var(--accent-color);
}

.site-toast--danger {
    border-color: #fecaca;
    background-color: #fef2f2;
}

.site-toast--danger .site-toast__icon {
    color: #ef4444;
}

.site-toast__icon {
    flex-shrink: 0;
    font-size: 1.125rem;
}

.site-toast__message {
    flex: 1;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.site-toast__close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: none;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--gray-500);
    cursor: pointer;
    transition: color var(--transition-speed) ease,
                background-color var(--transition-speed) ease;
}

.site-toast__close:hover,
.site-toast__close:focus-visible {
    color: var(--gray-700);
    background-color: var(--gray-100, #f3f4f6);
}

@supports (background: color-mix(in srgb, #000 10%, #fff 90%)) {
    .site-toast--success {
        border-color: color-mix(in srgb, #10b981 35%, var(--gray-200));
        background-color: color-mix(in srgb, #10b981 8%, var(--surface-color));
    }

    .site-toast--warning {
        border-color: color-mix(in srgb, var(--accent-color) 35%, var(--gray-200));
        background-color: color-mix(in srgb, var(--accent-color) 8%, var(--surface-color));
    }

    .site-toast--danger {
        border-color: color-mix(in srgb, #ef4444 35%, var(--gray-200));
        background-color: color-mix(in srgb, #ef4444 8%, var(--surface-color));
    }

    .site-toast__close:hover,
    .site-toast__close:focus-visible {
        background-color: color-mix(in srgb, var(--gray-900) 6%, transparent);
    }
}

