/* ========================================================================== */
/*  CELESTIAL WORMHOLE DOSSIER // HYPERSPACE FOLDING & CAUSAL RESONANCE      */
/*  全息时空虫洞舱：跨学科因果光弦、双星对穿通道与真理跃迁控制台样式           */
/* ========================================================================== */

/* 1. 全局虫洞全息舱容器 */
.wormhole-dossier-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 86;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 24px 36px 88px 24px;
    box-sizing: border-box;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
}

.wormhole-dossier-overlay[hidden] {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

/* 2. 全息虫洞舱卡片主面板 */
.wormhole-dossier {
    pointer-events: auto;
    position: relative;
    width: 600px;
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at 100% 0%, rgba(26, 16, 52, 0.95) 0%, rgba(6, 12, 28, 0.97) 100%);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1.5px solid var(--wh-theme-border, rgba(192, 132, 252, 0.42));
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.82),
                0 0 45px var(--wh-theme-glow, rgba(192, 132, 252, 0.22)),
                inset 0 1px 0 rgba(255, 255, 255, 0.22);
    overflow: hidden;
    transform-origin: right center;
    animation: whDossierEntrance 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes whDossierEntrance {
    0% {
        opacity: 0;
        transform: translateX(45px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* 3. 顶部信息栏 */
.wh-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px 14px 22px;
    background: linear-gradient(90deg, rgba(192, 132, 252, 0.12) 0%, rgba(56, 189, 248, 0.08) 60%, rgba(0, 0, 0, 0) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    flex-shrink: 0;
}

.wh-header-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wh-badge-pulse {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(192, 132, 252, 0.18);
    border: 1px solid var(--wh-theme-border, rgba(192, 132, 252, 0.5));
    color: var(--wh-theme-accent, #c084fc);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.wh-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
    animation: whDotPulse 1.8s infinite ease-in-out;
}

@keyframes whDotPulse {
    0%, 100% { transform: scale(0.85); opacity: 0.6; }
    50% { transform: scale(1.3); opacity: 1; }
}

.wh-channel-tag {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.06em;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.wh-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.75);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wh-close-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.6);
    color: #ffffff;
    transform: scale(1.08);
}

/* 4. 标题与双星对穿通道条 */
.wh-hero {
    padding: 20px 24px 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.wh-title {
    margin: 0 0 14px 0;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.35;
    color: #ffffff;
    letter-spacing: 0.02em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.wh-conduit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.wh-star-pill {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.wh-star-pill--target {
    text-align: right;
}

.wh-star-sub {
    font-size: 11px;
    font-weight: 700;
    color: var(--wh-theme-accent, #c084fc);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.wh-star-name {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wh-conduit-filament {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0 6px;
    flex-shrink: 0;
}

.wh-filament-line {
    width: 48px;
    height: 2px;
    background: linear-gradient(90deg, #7dd3fc, var(--wh-theme-accent, #c084fc));
    box-shadow: 0 0 8px var(--wh-theme-accent, #c084fc);
    position: relative;
}

.wh-filament-line::after {
    content: "";
    position: absolute;
    right: -4px;
    top: -3px;
    width: 0;
    height: 0;
    border-left: 6px solid var(--wh-theme-accent, #c084fc);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}

.wh-filament-label {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* 5. 滚动内容主体 */
.wh-body {
    padding: 18px 24px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wh-body::-webkit-scrollbar {
    width: 4px;
}

.wh-body::-webkit-scrollbar-track {
    background: transparent;
}

.wh-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.wh-card-block {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 16px 18px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.wh-card-block:hover {
    background: rgba(255, 255, 255, 0.055);
    border-color: rgba(255, 255, 255, 0.12);
}

.wh-block-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.wh-block-icon {
    font-size: 15px;
    line-height: 1;
}

.wh-block-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--wh-theme-accent, #7dd3fc);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.wh-essence-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.7;
    color: rgba(240, 246, 255, 0.96);
    font-weight: 500;
    letter-spacing: 0.015em;
}

.wh-tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wh-tip-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(230, 238, 255, 0.9);
}

.wh-tip-bullet {
    color: var(--wh-theme-accent, #7dd3fc);
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

.wh-exam-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.65;
    color: rgba(220, 230, 255, 0.85);
}

/* 6. 底部操作栏 */
.wh-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.wh-btn-leap {
    flex: 1.6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--wh-theme-accent, #c084fc) 0%, #38bdf8 100%);
    border: none;
    color: #060b18;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.03em;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--wh-theme-glow, rgba(192, 132, 252, 0.45));
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.wh-btn-leap:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 26px var(--wh-theme-glow, rgba(192, 132, 252, 0.65));
    filter: brightness(1.08);
}

.wh-btn-leap:active {
    transform: translateY(0);
}

.wh-btn-collapse {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wh-btn-collapse:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* 7. 知识光谱卡片中的虫洞共振开启按钮 */
.stream-wormhole-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0 4px 0;
    padding: 10px 14px;
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(192, 132, 252, 0.16) 0%, rgba(56, 189, 248, 0.12) 100%);
    border: 1px solid rgba(192, 132, 252, 0.38);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.stream-wormhole-trigger:hover {
    background: linear-gradient(90deg, rgba(192, 132, 252, 0.26) 0%, rgba(56, 189, 248, 0.22) 100%);
    border-color: rgba(192, 132, 252, 0.65);
    box-shadow: 0 6px 22px rgba(192, 132, 252, 0.25);
    transform: translateY(-1px);
}

.wh-trigger-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.wh-trigger-icon {
    font-size: 16px;
    animation: whIconSpin 6s linear infinite;
}

@keyframes whIconSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.wh-trigger-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wh-trigger-tag {
    font-size: 10px;
    font-weight: 700;
    color: #c084fc;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.wh-trigger-title {
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wh-trigger-btn-text {
    font-size: 11px;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    padding: 4px 8px;
    border-radius: 6px;
    flex-shrink: 0;
}

/* 8. 避让与防遮挡模式 */
body.wormhole-mode-active #spectral-stream {
    transform: translateX(105%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}
