/* --------------------------------------------------------------------------
   鼠标样式动效（仅精细指针桌面端）
   -------------------------------------------------------------------------- */

.oriel-cursor {
    position: fixed;
    inset: 0;
    /* 必须高于赞赏/分享/站点弹窗，否则自定义鼠标指示会被挡在弹出层下方 */
    z-index: 11000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.oriel-cursor.is-visible {
    opacity: 1;
}

.oriel-cursor__ring,
.oriel-cursor__dot,
.oriel-cursor__trail {
    position: fixed;
    top: 0;
    left: 0;
    display: block;
    pointer-events: none;
    will-change: transform;
}

.oriel-cursor__fx {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.oriel-cursor__click {
    position: absolute;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
}

.oriel-cursor__click-shard {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    margin: -3px 0 0 -3px;
    border-radius: 50%;
    background: var(--primary-color);
    transform: rotate(var(--shard-angle, 0deg)) translate(0, 0) scale(0.4);
    opacity: 0;
}

@media (hover: hover) and (pointer: fine) {
    body.has-cursor-effect,
    body.has-cursor-effect * {
        cursor: none !important;
    }

    body.has-cursor-effect--soft-dot .oriel-cursor__dot {
        width: 10px;
        height: 10px;
        margin: -5px 0 0 -5px;
        border-radius: 50%;
        background: var(--text-color);
        transition: width 0.18s ease, height 0.18s ease, margin 0.18s ease, background 0.18s ease, transform 0.12s ease;
    }

    body.has-cursor-effect--soft-dot .oriel-cursor__ring {
        display: none;
    }

    body.has-cursor-effect--soft-dot .oriel-cursor.is-hover .oriel-cursor__dot {
        width: 28px;
        height: 28px;
        margin: -14px 0 0 -14px;
        background: color-mix(in srgb, var(--primary-color) 72%, transparent);
    }

    body.has-cursor-effect--ink-ring .oriel-cursor__dot {
        width: 4px;
        height: 4px;
        margin: -2px 0 0 -2px;
        border-radius: 50%;
        background: var(--text-color);
    }

    body.has-cursor-effect--ink-ring .oriel-cursor__ring {
        width: 28px;
        height: 28px;
        margin: -14px 0 0 -14px;
        border: 1px solid var(--text-color);
        border-radius: 50%;
        background: transparent;
        transition: width 0.18s ease, height 0.18s ease, margin 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
    }

    body.has-cursor-effect--ink-ring .oriel-cursor.is-hover .oriel-cursor__ring {
        width: 44px;
        height: 44px;
        margin: -22px 0 0 -22px;
        border-color: var(--primary-color);
    }

    body.has-cursor-effect--accent-glow .oriel-cursor__dot {
        width: 12px;
        height: 12px;
        margin: -6px 0 0 -6px;
        border-radius: 50%;
        background: var(--primary-color);
        box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary-color) 18%, transparent);
        transition: width 0.18s ease, height 0.18s ease, margin 0.18s ease, box-shadow 0.18s ease;
    }

    body.has-cursor-effect--accent-glow .oriel-cursor__ring {
        width: 36px;
        height: 36px;
        margin: -18px 0 0 -18px;
        border-radius: 50%;
        background: color-mix(in srgb, var(--primary-color) 12%, transparent);
        border: 0;
        filter: blur(1px);
        transition: width 0.18s ease, height 0.18s ease, margin 0.18s ease;
    }

    body.has-cursor-effect--accent-glow .oriel-cursor.is-hover .oriel-cursor__dot {
        width: 18px;
        height: 18px;
        margin: -9px 0 0 -9px;
        box-shadow: 0 0 0 10px color-mix(in srgb, var(--primary-color) 22%, transparent);
    }

    body.has-cursor-effect--accent-glow .oriel-cursor.is-hover .oriel-cursor__ring {
        width: 56px;
        height: 56px;
        margin: -28px 0 0 -28px;
    }

    body.has-cursor-effect--crosshair .oriel-cursor__dot {
        width: 6px;
        height: 6px;
        margin: -3px 0 0 -3px;
        border-radius: 50%;
        background: var(--primary-color);
    }

    body.has-cursor-effect--crosshair .oriel-cursor__ring {
        width: 22px;
        height: 22px;
        margin: -11px 0 0 -11px;
        border: 0;
        border-radius: 0;
        background:
            linear-gradient(var(--text-color), var(--text-color)) center / 1px 100% no-repeat,
            linear-gradient(var(--text-color), var(--text-color)) center / 100% 1px no-repeat;
        transition: width 0.18s ease, height 0.18s ease, margin 0.18s ease, opacity 0.18s ease;
    }

    body.has-cursor-effect--crosshair .oriel-cursor.is-hover .oriel-cursor__ring {
        width: 34px;
        height: 34px;
        margin: -17px 0 0 -17px;
        background:
            linear-gradient(var(--primary-color), var(--primary-color)) center / 1px 100% no-repeat,
            linear-gradient(var(--primary-color), var(--primary-color)) center / 100% 1px no-repeat;
    }

    body.has-cursor-effect--square-frame .oriel-cursor__dot {
        width: 4px;
        height: 4px;
        margin: -2px 0 0 -2px;
        border-radius: 0;
        background: var(--text-color);
    }

    body.has-cursor-effect--square-frame .oriel-cursor__ring {
        width: 24px;
        height: 24px;
        margin: -12px 0 0 -12px;
        border: 1px solid var(--text-color);
        border-radius: 0;
        background: transparent;
        transition: width 0.18s ease, height 0.18s ease, margin 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
    }

    body.has-cursor-effect--square-frame .oriel-cursor.is-hover .oriel-cursor__ring {
        width: 40px;
        height: 40px;
        margin: -20px 0 0 -20px;
        border-color: var(--primary-color);
    }

    body.has-cursor-effect--trail-dots .oriel-cursor__dot {
        width: 8px;
        height: 8px;
        margin: -4px 0 0 -4px;
        border-radius: 50%;
        background: var(--text-color);
        z-index: 2;
    }

    body.has-cursor-effect--trail-dots .oriel-cursor__ring {
        display: none;
    }

    body.has-cursor-effect--trail-dots .oriel-cursor__trail {
        width: 7px;
        height: 7px;
        margin: -3.5px 0 0 -3.5px;
        border-radius: 50%;
        background: color-mix(in srgb, var(--primary-color) 70%, transparent);
        opacity: calc(0.72 - (var(--trail-i, 0) * 0.07));
        transform: scale(calc(1 - (var(--trail-i, 0) * 0.08)));
    }

    body.has-cursor-effect--trail-dots .oriel-cursor.is-hover .oriel-cursor__dot {
        background: var(--primary-color);
    }

    body.has-cursor-effect--text-mark .oriel-cursor__dot {
        width: 2px;
        height: 18px;
        margin: -9px 0 0 -1px;
        border-radius: 1px;
        background: var(--text-color);
        transition: height 0.18s ease, margin 0.18s ease, background 0.18s ease, width 0.18s ease;
    }

    body.has-cursor-effect--text-mark .oriel-cursor__ring {
        width: 18px;
        height: 2px;
        margin: 10px 0 0 -9px;
        border: 0;
        border-radius: 1px;
        background: var(--primary-color);
        transition: width 0.18s ease, margin 0.18s ease, opacity 0.18s ease;
    }

    body.has-cursor-effect--text-mark .oriel-cursor.is-hover .oriel-cursor__dot {
        height: 24px;
        margin: -12px 0 0 -1px;
        background: var(--primary-color);
    }

    body.has-cursor-effect--text-mark .oriel-cursor.is-hover .oriel-cursor__ring {
        width: 28px;
        margin: 14px 0 0 -14px;
    }

    /* 点击反馈 */
    body.has-cursor-click .oriel-cursor__click--ripple {
        border: 1px solid var(--primary-color);
        background: transparent;
    }

    body.has-cursor-click .oriel-cursor__click--ripple.is-on {
        animation: oriel-cursor-ripple 0.55s ease-out forwards;
    }

    body.has-cursor-click .oriel-cursor__click--pulse {
        background: color-mix(in srgb, var(--primary-color) 55%, transparent);
    }

    body.has-cursor-click .oriel-cursor__click--pulse.is-on {
        animation: oriel-cursor-pulse 0.45s ease-out forwards;
    }

    body.has-cursor-click .oriel-cursor__click--burst,
    body.has-cursor-click .oriel-cursor__click--ink-splash {
        background: transparent;
        opacity: 1;
    }

    body.has-cursor-click .oriel-cursor__click--burst.is-on .oriel-cursor__click-shard,
    body.has-cursor-click .oriel-cursor__click--ink-splash.is-on .oriel-cursor__click-shard {
        animation: oriel-cursor-burst 0.55s ease-out forwards;
    }

    body.has-cursor-click .oriel-cursor__click--ink-splash .oriel-cursor__click-shard {
        width: 8px;
        height: 8px;
        margin: -4px 0 0 -4px;
        border-radius: 40% 60% 55% 45%;
        background: color-mix(in srgb, var(--text-color) 82%, var(--primary-color));
    }
}

@keyframes oriel-cursor-ripple {
    0% {
        opacity: 0.9;
        transform: scale(0.35);
    }
    100% {
        opacity: 0;
        transform: scale(3.4);
    }
}

@keyframes oriel-cursor-pulse {
    0% {
        opacity: 0.75;
        transform: scale(0.5);
    }
    55% {
        opacity: 0.35;
        transform: scale(1.8);
    }
    100% {
        opacity: 0;
        transform: scale(2.4);
    }
}

@keyframes oriel-cursor-burst {
    0% {
        opacity: 0.95;
        transform: rotate(var(--shard-angle, 0deg)) translate(0, 0) scale(0.5);
    }
    100% {
        opacity: 0;
        transform: rotate(var(--shard-angle, 0deg)) translate(0, -28px) scale(0.2);
    }
}

@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
    .oriel-cursor {
        display: none !important;
    }

    body.has-cursor-effect,
    body.has-cursor-effect * {
        cursor: auto !important;
    }
}

/* --------------------------------------------------------------------------
   页面滚动条样式（仅覆盖文档滚动条，不打断组件内隐藏滚动条）
   -------------------------------------------------------------------------- */

html:has(body.has-scrollbar--thin-ink),
html:has(body.has-scrollbar--paper),
html:has(body.has-scrollbar--accent),
html:has(body.has-scrollbar--soft),
html:has(body.has-scrollbar--minimal) {
    scrollbar-gutter: stable;
}

html:has(body.has-scrollbar--thin-ink) {
    scrollbar-width: thin;
    scrollbar-color: var(--text-color) transparent;
}

html:has(body.has-scrollbar--paper) {
    scrollbar-width: thin;
    scrollbar-color: var(--text-color) var(--bs-border-color);
}

html:has(body.has-scrollbar--accent) {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bs-border-color);
}

html:has(body.has-scrollbar--soft) {
    scrollbar-width: auto;
    scrollbar-color: var(--gray-500) var(--background-color);
}

html:has(body.has-scrollbar--minimal) {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--text-color) 35%, transparent) transparent;
}

html:has(body.has-scrollbar)::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

html:has(body.has-scrollbar--thin-ink)::-webkit-scrollbar,
html:has(body.has-scrollbar--minimal)::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

html:has(body.has-scrollbar--soft)::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

html:has(body.has-scrollbar)::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

html:has(body.has-scrollbar--thin-ink)::-webkit-scrollbar-track,
html:has(body.has-scrollbar--minimal)::-webkit-scrollbar-track {
    background: transparent;
}

html:has(body.has-scrollbar--paper)::-webkit-scrollbar-track,
html:has(body.has-scrollbar--accent)::-webkit-scrollbar-track {
    background: var(--bs-border-color);
}

html:has(body.has-scrollbar--soft)::-webkit-scrollbar-track {
    background: var(--background-color);
}

html:has(body.has-scrollbar)::-webkit-scrollbar-thumb {
    border: 0;
    border-radius: 0;
    background: var(--text-color);
}

html:has(body.has-scrollbar--accent)::-webkit-scrollbar-thumb {
    background: var(--primary-color);
}

html:has(body.has-scrollbar--soft)::-webkit-scrollbar-thumb {
    background: var(--gray-500);
    border: 2px solid var(--background-color);
}

html:has(body.has-scrollbar--minimal)::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--text-color) 35%, transparent);
}

html:has(body.has-scrollbar)::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

html:has(body.has-scrollbar--soft)::-webkit-scrollbar-thumb:hover {
    background: var(--text-color);
}

html:has(body.has-scrollbar--minimal)::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--text-color) 62%, transparent);
}

/* --------------------------------------------------------------------------
   卡片悬停效果（仅精细指针桌面端，覆盖各卡片写死的悬停行为）
   -------------------------------------------------------------------------- */

body.has-hover {
    --oriel-hover-lift: -4px;
    --oriel-hover-lift-sm: -2px;
    --oriel-hover-scale: 1.04;
    --oriel-hover-tilt: -1.5deg;
}

body.hover-strength--subtle {
    --oriel-hover-lift: -2px;
    --oriel-hover-lift-sm: -1px;
    --oriel-hover-scale: 1.02;
    --oriel-hover-tilt: -0.8deg;
}

body.hover-strength--strong {
    --oriel-hover-lift: -7px;
    --oriel-hover-lift-sm: -4px;
    --oriel-hover-scale: 1.07;
    --oriel-hover-tilt: -2.4deg;
}

@media (hover: hover) and (pointer: fine) {
    body.has-hover .post-card,
    body.has-hover .product-card,
    body.has-hover .tag-center-card,
    body.has-hover .collection-card,
    body.has-hover .article-post-card {
        transition: transform 0.28s ease, box-shadow 0.28s ease;
    }

    body.has-hover .collection-card__image img,
    body.has-hover .product-card__image img,
    body.has-hover .post-card__cover,
    body.has-hover .article-post-card__cover-link img {
        transition: transform 0.28s ease;
    }

    /* 标签卡封面为背景图：用伪层放大，避免标题文字一起缩放 */
    body.has-hover .tag-center-card--has-cover .tag-center-card__media {
        overflow: hidden;
        isolation: isolate;
        background-image: none !important;
    }

    body.has-hover .tag-center-card--has-cover .tag-center-card__media::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 0;
        background-image: var(--tag-center-cover);
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        transition: transform 0.28s ease;
        pointer-events: none;
    }

    body.has-hover .tag-center-card--has-cover .tag-center-card__overlay,
    body.has-hover .tag-center-card--has-cover .tag-center-card__content {
        z-index: 1;
    }

    /* 关闭：压掉写死位移与阴影 */
    body.has-hover--none .post-card:hover,
    body.has-hover--none .product-card:hover,
    body.has-hover--none .tag-center-card:hover,
    body.has-hover--none .collection-card:hover,
    body.has-hover--none .collection-card.collection-card--has-bg:hover,
    body.has-hover--none .article-post-card:hover,
    body.has-hover--none .post-card:hover .post-card__cover,
    body.has-hover--none .product-card:hover .product-card__image img,
    body.has-hover--none .collection-card:hover .collection-card__image img,
    body.has-hover--none .tag-center-card--has-cover:hover .tag-center-card__media::before,
    body.has-hover--none .article-post-card:hover .article-post-card__cover-link img {
        transform: none;
        box-shadow: none;
    }

    /* 仅图片放大：卡片本身不上浮 */
    body.has-hover--zoom .post-card:hover,
    body.has-hover--zoom .product-card:hover,
    body.has-hover--zoom .tag-center-card:hover,
    body.has-hover--zoom .collection-card:hover,
    body.has-hover--zoom .collection-card.collection-card--has-bg:hover,
    body.has-hover--zoom .article-post-card:hover {
        transform: none;
    }

    body.has-hover--zoom .post-card:hover .post-card__cover,
    body.has-hover--zoom .product-card:hover .product-card__image img,
    body.has-hover--zoom .collection-card:hover .collection-card__image img,
    body.has-hover--zoom .tag-center-card--has-cover:hover .tag-center-card__media::before,
    body.has-hover--zoom .article-post-card:hover .article-post-card__cover-link img {
        transform: scale(var(--oriel-hover-scale));
    }

    /* 仅卡片上浮 */
    body.has-hover--lift .post-card:hover,
    body.has-hover--lift .tag-center-card:hover,
    body.has-hover--lift .collection-card:hover,
    body.has-hover--lift .article-post-card:hover {
        transform: translateY(var(--oriel-hover-lift));
    }

    body.has-hover--lift .product-card:hover {
        transform: translateY(var(--oriel-hover-lift-sm));
    }

    body.has-hover--lift .post-card:hover .post-card__cover,
    body.has-hover--lift .product-card:hover .product-card__image img,
    body.has-hover--lift .collection-card:hover .collection-card__image img,
    body.has-hover--lift .tag-center-card--has-cover:hover .tag-center-card__media::before,
    body.has-hover--lift .article-post-card:hover .article-post-card__cover-link img {
        transform: none;
    }

    /* 轻微倾斜 */
    body.has-hover--tilt .post-card:hover,
    body.has-hover--tilt .product-card:hover,
    body.has-hover--tilt .tag-center-card:hover,
    body.has-hover--tilt .collection-card:hover,
    body.has-hover--tilt .article-post-card:hover {
        transform: translateY(var(--oriel-hover-lift-sm)) rotate(var(--oriel-hover-tilt));
    }

    body.has-hover--tilt .post-card:hover .post-card__cover,
    body.has-hover--tilt .product-card:hover .product-card__image img,
    body.has-hover--tilt .collection-card:hover .collection-card__image img,
    body.has-hover--tilt .tag-center-card--has-cover:hover .tag-center-card__media::before,
    body.has-hover--tilt .article-post-card:hover .article-post-card__cover-link img {
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   滚动进场动画（类名由 scroll-effects.js 注入，未启用脚本时内容保持可见）
   -------------------------------------------------------------------------- */

.reveal-item {
    opacity: 1;
    transform: none;
    transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.reveal-item.is-reveal-pending {
    opacity: 0;
}

.reveal-item.is-reveal-pending.reveal-item--fade-up {
    transform: translateY(26px);
}

.reveal-item.is-reveal-pending.reveal-item--zoom-in {
    transform: scale(0.96);
}

.reveal-item.is-revealed {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .reveal-item,
    .reveal-item.is-reveal-pending,
    .reveal-item.is-revealed {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* --------------------------------------------------------------------------
   视差滚动（仅横幅封面，位移由 scroll-effects.js 计算）
   背景层向外扩一圈，避免 translate 后上下左右露底
   -------------------------------------------------------------------------- */

body.has-parallax .page-hero--has-cover {
    overflow: hidden;
}

body.has-parallax .page-hero__bg {
    /* 覆盖 .page-hero__bg 的 inset:0，预留视差位移余量 */
    inset: auto;
    top: -28%;
    right: -10%;
    bottom: -28%;
    left: -10%;
    width: auto;
    height: auto;
    transform-origin: center center;
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
    body.has-parallax .page-hero__bg {
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        transform: none !important;
        will-change: auto;
    }
}

/* --------------------------------------------------------------------------
   页面切换过渡（@view-transition 规则由 layout-style.php 按需输出）
   -------------------------------------------------------------------------- */

@keyframes oriel-pt-fade-out {
    to {
        opacity: 0;
    }
}

@keyframes oriel-pt-fade-in {
    from {
        opacity: 0;
    }
}

@keyframes oriel-pt-slide-out {
    to {
        opacity: 0;
        transform: translateY(-18px);
    }
}

@keyframes oriel-pt-slide-in {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
}

@keyframes oriel-pt-zoom-out {
    to {
        opacity: 0;
        transform: scale(1.02);
    }
}

@keyframes oriel-pt-zoom-in {
    from {
        opacity: 0;
        transform: scale(0.97);
    }
}

@media (prefers-reduced-motion: reduce) {
    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
        animation: none !important;
    }
}
