/* 跨页骨架屏过渡：主站 ↔ ReportCraft */

html.pt-lock-scroll {
    overflow: hidden;
}

#page-transition-root {
    --pt-fade-ms: 1000ms;
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--pt-fade-ms) cubic-bezier(0.4, 0, 0.2, 1),
        visibility var(--pt-fade-ms) cubic-bezier(0.4, 0, 0.2, 1);
}

#page-transition-root.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#page-transition-root.is-exiting {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* 主站：固定顶栏下方开始，内容左对齐（对齐 hero） */
#page-transition-root[data-pt-theme="main"] {
    padding: max(calc(var(--header-h, 76px) + 1.25rem), env(safe-area-inset-top))
        max(1.25rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom))
        max(1.25rem, env(safe-area-inset-left));
    background: linear-gradient(160deg, #f5f7fa 0%, #e9edf2 100%);
    --pt-sk-base: #e2e8f0;
    --pt-sk-highlight: #f8fafc;
}

#page-transition-root[data-pt-theme="main"] .pt-skeleton {
    max-width: min(var(--container, 1120px), 100%);
    margin-inline: auto;
    align-items: flex-start;
}

#page-transition-root[data-pt-theme="main"] .pt-skeleton__bar {
    width: min(10rem, 42%);
}

#page-transition-root[data-pt-theme="main"] .pt-skeleton__main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

#page-transition-root[data-pt-theme="main"] .pt-skeleton__block {
    max-width: 36rem;
    width: 100%;
    min-height: 10rem;
    max-height: 14rem;
}

/* ReportCraft：顶栏区 + 左右分栏（对齐 .container 下载区） */
#page-transition-root[data-pt-theme="reportcraft"] {
    padding: max(clamp(0.75rem, 2.5vw, 1rem), env(safe-area-inset-top))
        clamp(1rem, 4vw, 2rem) max(1rem, env(safe-area-inset-bottom))
        clamp(1rem, 4vw, 2rem);
    background: linear-gradient(160deg, #0a2a6e 0%, #1a73e8 45%, #0d4d9e 100%);
    --pt-sk-base: rgba(255, 255, 255, 0.12);
    --pt-sk-highlight: rgba(255, 255, 255, 0.22);
}

#page-transition-root[data-pt-theme="reportcraft"] .pt-skeleton {
    max-width: 1400px;
    margin-inline: auto;
    width: 100%;
    flex: 1;
    min-height: 0;
}

#page-transition-root[data-pt-theme="reportcraft"] .pt-skeleton__bar {
    width: min(14rem, 55%);
}

#page-transition-root[data-pt-theme="reportcraft"] .pt-skeleton__lines {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    flex: 1 1 min(100%, 24rem);
    max-width: 44rem;
    padding: clamp(0.5rem, 2vw, 1.5rem) 0;
}

#page-transition-root[data-pt-theme="reportcraft"] .pt-skeleton__block {
    flex: 1 1 min(100%, 20rem);
    min-height: clamp(10rem, 28vh, 16rem);
    max-height: none;
    margin-top: 0;
}

@media (min-width: 900px) {
    #page-transition-root[data-pt-theme="reportcraft"] .pt-skeleton__main {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: clamp(2rem, 8vw, 150px);
        flex: 1;
        min-height: 0;
    }
}

/* 共用骨架结构 */
.pt-skeleton {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    min-height: 0;
}

.pt-skeleton__bar {
    height: 2.75rem;
    border-radius: 0.75rem;
    flex-shrink: 0;
}

.pt-skeleton__main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
}

.pt-skeleton__line {
    height: 1.35rem;
    border-radius: 0.5rem;
}

.pt-skeleton__line--w60 {
    width: 60%;
}

.pt-skeleton__line--w45 {
    width: 45%;
}

.pt-skeleton__line--w80 {
    width: 80%;
}

.pt-skeleton__block {
    flex: 1;
    min-height: 8rem;
    border-radius: 1rem;
    max-height: 14rem;
}

.pt-skeleton__footer {
    height: 0.85rem;
    width: 35%;
    border-radius: 0.35rem;
    flex-shrink: 0;
    margin-top: auto;
}

.pt-shimmer {
    background: linear-gradient(90deg, var(--pt-sk-base) 25%, var(--pt-sk-highlight) 50%, var(--pt-sk-base) 75%);
    background-size: 200% 100%;
    animation: pt-shimmer 1.5s infinite;
}

@keyframes pt-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    #page-transition-root {
        transition: none;
    }

    .pt-shimmer {
        animation: none;
    }
}
