/**
 * 今日运势 · 灵性解读 AI 过场 HUD（背景沿用 CosmicStarfield，本文件仅上层交互）
 */
.lj-ai-loader.is-daily-hud .lj-ai-loader__stage,
.lj-ai-loader.is-daily-hud .lj-ai-loader__daily-panel {
    display: none !important;
}

.lj-ai-loader.is-daily-hud .lj-ai-loader__daily-hud {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.lj-ai-loader.is-daily-hud.is-active .lj-ai-loader__daily-hud {
    opacity: 1;
}

.lj-daily-hud__frame {
    position: relative;
    width: min(92vw, 400px);
    padding: 28px 22px 24px;
    border-radius: 22px;
    border: 1px solid rgba(251, 191, 36, 0.22);
    background:
        linear-gradient(165deg, rgba(36, 22, 62, 0.88) 0%, rgba(10, 6, 22, 0.78) 48%, rgba(8, 5, 18, 0.92) 100%);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 28px 90px rgba(0, 0, 0, 0.55),
        0 0 80px rgba(124, 58, 237, 0.28),
        0 0 36px rgba(251, 191, 36, 0.1);
    backdrop-filter: blur(18px) saturate(1.25);
    animation: lj-daily-hud-in 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
    overflow: hidden;
}

.lj-daily-hud__frame::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(
        125deg,
        transparent 30%,
        rgba(255, 255, 255, 0.06) 48%,
        transparent 62%
    );
    animation: lj-daily-hud-shine 4.2s ease-in-out infinite;
}

.lj-daily-hud__frame::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(251, 191, 36, 0.35),
        rgba(168, 85, 247, 0.15) 40%,
        rgba(56, 189, 248, 0.2) 70%,
        rgba(251, 191, 36, 0.3)
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.65;
}

@keyframes lj-daily-hud-in {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes lj-daily-hud-shine {
    0%, 100% { opacity: 0; transform: translateX(-30%); }
    45% { opacity: 1; }
    55% { transform: translateX(30%); }
}

.lj-daily-hud__sigil {
    position: relative;
    width: 132px;
    height: 132px;
    margin: 0 auto 8px;
}

.lj-daily-hud__sigil-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px dashed rgba(251, 191, 36, 0.35);
    animation: lj-daily-sigil-spin 22s linear infinite;
}

.lj-daily-hud__sigil-ring--2 {
    inset: 10px;
    border-style: solid;
    border-color: rgba(168, 85, 247, 0.25);
    animation-direction: reverse;
    animation-duration: 16s;
}

.lj-daily-hud__sigil-orbit {
    position: absolute;
    inset: 18px;
    border-radius: 50%;
}

.lj-daily-hud__sigil-orbit span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    margin: -3px 0 0 -3px;
    border-radius: 50%;
    background: rgba(253, 224, 138, 0.9);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.8);
    animation: lj-daily-orbit 3.6s linear infinite;
}

.lj-daily-hud__sigil-orbit span:nth-child(1) { animation-delay: 0s; }
.lj-daily-hud__sigil-orbit span:nth-child(2) { animation-delay: -0.9s; }
.lj-daily-hud__sigil-orbit span:nth-child(3) { animation-delay: -1.8s; }
.lj-daily-hud__sigil-orbit span:nth-child(4) { animation-delay: -2.7s; }

@keyframes lj-daily-orbit {
    from { transform: rotate(0deg) translateX(42px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(42px) rotate(-360deg); }
}

@keyframes lj-daily-sigil-spin {
    to { transform: rotate(360deg); }
}

.lj-daily-hud__card-slot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 52px;
    height: 86px;
    transform: translate(-50%, -50%);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(251, 191, 36, 0.45);
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.5),
        0 0 24px rgba(168, 85, 247, 0.35);
    animation: lj-daily-card-float 3.2s ease-in-out infinite;
}

.lj-daily-hud__card-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lj-daily-hud__card-slot img.is-reversed {
    transform: rotate(180deg);
}

.lj-daily-hud__card-slot.is-placeholder {
    background: linear-gradient(145deg, #2e1065, #1e1033);
}

.lj-daily-hud__card-slot.is-placeholder::after {
    content: '✦';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(253, 224, 138, 0.5);
    font-size: 1.4rem;
}

@keyframes lj-daily-card-float {
    0%, 100% { transform: translate(-50%, -50%) translateY(0); }
    50% { transform: translate(-50%, -50%) translateY(-5px); }
}

.lj-daily-hud__ring-svg {
    position: absolute;
    inset: -4px;
    width: calc(100% + 8px);
    height: calc(100% + 8px);
    transform: rotate(-90deg);
}

.lj-daily-hud__ring-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 3;
}

.lj-daily-hud__ring-progress {
    fill: none;
    stroke: url(#ljDailyRingGrad);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.5));
}

.lj-daily-hud__eyebrow {
    margin: 4px 0 0;
    text-align: center;
    font-size: 0.62rem;
    letter-spacing: 0.32em;
    color: rgba(196, 181, 253, 0.65);
}

.lj-daily-hud__title {
    margin: 6px 0 0;
    text-align: center;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: #faf5ff;
    text-shadow: 0 0 24px rgba(168, 85, 247, 0.45);
}

.lj-daily-hud__card-meta {
    margin: 6px 0 0;
    text-align: center;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    color: rgba(253, 224, 138, 0.88);
}

.lj-daily-hud__status {
    margin: 12px 0 0;
    min-height: 2.6em;
    text-align: center;
    font-size: 0.86rem;
    line-height: 1.55;
    color: rgba(221, 214, 254, 0.88);
    letter-spacing: 0.06em;
    transition: opacity 0.3s ease;
}

.lj-daily-hud__status.is-fading {
    opacity: 0.25;
}

.lj-daily-hud__steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.lj-daily-hud__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px 4px;
    border-radius: 12px;
    border: 1px solid rgba(168, 85, 247, 0.15);
    background: rgba(0, 0, 0, 0.22);
    font-size: 0.58rem;
    color: rgba(196, 181, 253, 0.5);
    letter-spacing: 0.04em;
    transition: border-color 0.35s, color 0.35s, box-shadow 0.35s, background 0.35s;
}

.lj-daily-hud__step i {
    font-size: 0.85rem;
    opacity: 0.7;
}

.lj-daily-hud__step.is-active {
    color: rgba(253, 224, 138, 0.95);
    border-color: rgba(251, 191, 36, 0.42);
    background: rgba(124, 58, 237, 0.22);
    box-shadow: 0 0 18px rgba(168, 85, 247, 0.28);
}

.lj-daily-hud__step.is-active i {
    opacity: 1;
    animation: lj-daily-step-pulse 1.2s ease-in-out infinite;
}

.lj-daily-hud__step.is-done {
    color: rgba(167, 139, 250, 0.85);
    border-color: rgba(168, 85, 247, 0.32);
}

@keyframes lj-daily-step-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

.lj-daily-hud__dims {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 14px;
}

.lj-daily-hud__dim {
    padding: 8px 6px 7px;
    border-radius: 10px;
    border: 1px solid rgba(168, 85, 247, 0.18);
    background: rgba(0, 0, 0, 0.25);
    text-align: center;
    font-size: 0.62rem;
    color: rgba(196, 181, 253, 0.5);
    transition: border-color 0.35s, box-shadow 0.35s, color 0.35s;
}

.lj-daily-hud__dim em {
    display: block;
    margin-top: 2px;
    font-style: normal;
    font-size: 0.52rem;
    letter-spacing: 0.14em;
    opacity: 0.55;
}

.lj-daily-hud__dim.is-scan {
    color: rgba(253, 224, 138, 0.95);
    border-color: rgba(251, 191, 36, 0.45);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.35);
}

.lj-daily-hud__dim.is-done {
    color: rgba(196, 181, 253, 0.9);
    border-color: rgba(168, 85, 247, 0.38);
}

.lj-daily-hud__dim-bar {
    display: block;
    height: 3px;
    margin-top: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.lj-daily-hud__dim-bar span {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #6d28d9, #fbbf24);
    transition: width 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.lj-daily-hud__dim.is-scan .lj-daily-hud__dim-bar span {
    width: 78%;
    animation: lj-daily-dim-pulse 1s ease-in-out infinite alternate;
}

.lj-daily-hud__dim.is-done .lj-daily-hud__dim-bar span {
    width: 100%;
}

@keyframes lj-daily-dim-pulse {
    from { width: 22%; opacity: 0.7; }
    to { width: 88%; opacity: 1; }
}

.lj-daily-hud__progress-wrap {
    margin-top: 18px;
}

.lj-daily-hud__progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    color: rgba(196, 181, 253, 0.7);
}

.lj-daily-hud__progress-pct {
    font-variant-numeric: tabular-nums;
    color: rgba(253, 224, 138, 0.92);
    font-weight: 700;
}

.lj-daily-hud__progress-track {
    position: relative;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.lj-daily-hud__progress-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    animation: lj-daily-progress-sweep 2.2s ease-in-out infinite;
    pointer-events: none;
    z-index: 2;
}

@keyframes lj-daily-progress-sweep {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(320px); }
}

.lj-daily-hud__progress-fill {
    position: relative;
    z-index: 1;
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #5b21b6, #a855f7, #fbbf24, #a855f7, #5b21b6);
    background-size: 220% 100%;
    animation: lj-daily-progress-flow 2.4s linear infinite;
    box-shadow: 0 0 14px rgba(251, 191, 36, 0.45);
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes lj-daily-progress-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 220% 50%; }
}

.lj-ai-loader.is-daily-hud.is-complete .lj-daily-hud__frame {
    animation: lj-daily-hud-complete 0.55s ease-out;
}

.lj-ai-loader.is-daily-hud.is-complete .lj-daily-hud__sigil-ring {
    border-color: rgba(251, 191, 36, 0.55);
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.25);
}

@keyframes lj-daily-hud-complete {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.15); box-shadow: 0 0 100px rgba(251, 191, 36, 0.2); }
    100% { filter: brightness(1); }
}

.lj-ai-loader.is-daily-hud.is-exiting .lj-daily-hud__frame {
    opacity: 0;
    transform: translateY(-12px) scale(0.97);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

@media (max-width: 360px) {
    .lj-daily-hud__steps {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .lj-daily-hud__frame,
    .lj-daily-hud__sigil-ring,
    .lj-daily-hud__sigil-orbit span,
    .lj-daily-hud__card-slot,
    .lj-daily-hud__progress-glow,
    .lj-daily-hud__progress-fill,
    .lj-daily-hud__step.is-active i {
        animation: none;
    }
}
