/* 节气/节假日加载场景动画（主界面与后台预览共用） */

.term-scene svg g,
.term-scene svg circle,
.term-scene svg path,
.term-scene svg ellipse,
.theme-preview-wrap svg g,
.theme-preview-wrap svg circle,
.theme-preview-wrap svg path,
.theme-preview-wrap svg ellipse {
    transform-box: fill-box;
    transform-origin: center;
}

.sc-sway {
    animation: sc-sway-k 3.2s ease-in-out infinite;
}

.sc-pulse {
    animation: sc-pulse-k 2.4s ease-in-out infinite;
}

.sc-fall {
    animation: sc-fall-k 2.6s linear infinite;
}

.sc-drift {
    animation: sc-drift-k 4.5s ease-in-out infinite;
}

.sc-grow {
    animation: sc-grow-k 2.2s ease-out infinite;
}

.sc-rise {
    animation: sc-rise-k 2.4s ease-out infinite;
}

.sc-twinkle {
    animation: sc-twinkle-k 1.8s ease-in-out infinite;
}

.sc-float {
    animation: sc-float-k 3.4s ease-in-out infinite;
}

.sc-flash {
    animation: sc-flash-k 1.6s ease-in-out infinite;
}

.sc-d2 {
    animation-delay: 0.5s;
}

@keyframes sc-sway-k {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

@keyframes sc-pulse-k {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.12); }
}

@keyframes sc-fall-k {
    0% { transform: translateY(-8px); opacity: 0; }
    25% { opacity: 1; }
    100% { transform: translateY(34px); opacity: 0; }
}

@keyframes sc-drift-k {
    0%, 100% { transform: translateX(-3px); }
    50% { transform: translateX(3px); }
}

@keyframes sc-grow-k {
    0% { transform: scaleY(0.2); opacity: 0.3; transform-origin: bottom; }
    100% { transform: scaleY(1); opacity: 1; transform-origin: bottom; }
}

@keyframes sc-rise-k {
    0% { transform: translateY(8px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes sc-twinkle-k {
    0%, 100% { opacity: 0.25; }
    50% { opacity: 1; }
}

@keyframes sc-float-k {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes sc-flash-k {
    0%, 30%, 70%, 100% { opacity: 0.15; }
    45%, 55% { opacity: 1; }
}

/* 节气/节日名称文字动画 */
.term-title {
    background: linear-gradient(90deg, var(--navy), var(--teal));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: term-title-in 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

html[data-theme="dark"] .term-title {
    background: linear-gradient(90deg, #3CC8BE, #7FE0FF);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes term-title-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.92);
        letter-spacing: 20px;
    }
    to {
        opacity: 1;
        transform: none;
        letter-spacing: 10px;
    }
}

/* 诗句/标语文案动画 */
.term-quote {
    animation: term-quote-in 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}

@keyframes term-quote-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* 自定义主题：画框按上传图片比例动态调整（JS 按视口最大化，不溢出屏幕）；
   图片完整展示不裁剪（contain）；名称不显示，文案放进下方固定信息框单独一行，
   框内再展示进度/百分比/加载文字 */
.custom-scene {
    position: relative;
    width: 320px;
    height: 240px; /* JS 加载图片后按比例与视口覆盖为最终尺寸 */
    max-width: 100%;
    margin: 0 auto;
    border-radius: 18px;
    overflow: hidden;
    background: rgba(4, 20, 94, 0.05);
    box-shadow: 0 10px 30px rgba(4, 20, 94, 0.14);
    /* 图片加载完成从占位尺寸平滑放大到最终尺寸，避免画面跳动 */
    transition: width 0.55s cubic-bezier(0.16, 1, 0.3, 1), height 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-scene img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.45s ease;
}

/* 图片加载完成：淡入展示（画框同步平滑放大） */
.custom-scene.img-loaded img {
    opacity: 1;
}

/* 图片加载失败：隐藏破图图标，保持占位框 */
.custom-scene.img-error img {
    display: none;
}

/* 下方固定信息框：不随图片比例缩放 */
.custom-info {
    width: 320px; /* JS 同步为画框宽度 */
    max-width: 100%;
    margin: 12px auto 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 6px 18px rgba(4, 20, 94, 0.08);
    /* 与画框同步平滑放大 */
    transition: width 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-info .custom-quote {
    margin: 0 0 8px;
    font-size: 13px;
    letter-spacing: 1px;
    color: var(--text-2);
    text-align: center;
    overflow-wrap: anywhere;
    animation: term-quote-in 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}

.custom-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-info .ps-loading-pct {
    margin: 0;
    font-size: 16px;
}

.custom-info .ps-loading-bar {
    flex: 1;
    width: auto;
    height: 6px;
    margin: 0;
}

.custom-info .ps-loading-text {
    margin-top: 6px;
    text-align: center;
}

html[data-theme="dark"] .custom-info {
    background: rgba(16, 22, 48, 0.72);
}
/* ============================================================
   统一底标（主页目录页脚 / admin 侧边栏底部 / admin 登录页共用）
   单行：呼吸小圆点 + 版本胶囊 + · + Powered by 华南数据分析（流光）
   ============================================================ */
.brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex-wrap: wrap;
    white-space: nowrap;
}

.brand-live {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--teal);
    animation: brandLivePulse 2.4s ease-in-out infinite;
}

.brand-version {
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid rgba(60, 200, 190, 0.5);
    background: rgba(60, 200, 190, 0.12);
    color: var(--navy);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    font-family: Consolas, monospace;
    animation: brandGlowPulse 2.8s ease-in-out infinite;
}

.brand-version:empty {
    display: none;
}

.brand-sep {
    opacity: 0.5;
    color: var(--text-3, rgba(0, 0, 40, 0.35));
}

.brand-powered {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.8px;
    background: linear-gradient(90deg, var(--teal), var(--sand, #F5DCBE), var(--teal));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: brandShimmer 4s linear infinite;
}

@keyframes brandLivePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(60, 200, 190, 0.45);
    }
    50% {
        box-shadow: 0 0 6px 1px rgba(60, 200, 190, 0.4);
    }
}

@keyframes brandGlowPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(60, 200, 190, 0.3);
    }
    50% {
        box-shadow: 0 0 10px 1px rgba(60, 200, 190, 0.32);
    }
}

@keyframes brandShimmer {
    to {
        background-position: 200% center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .brand-live,
    .brand-version,
    .brand-powered {
        animation: none;
    }
}
