/* Mission 01 translation scaffold: English first, Chinese on demand. */
.click-translate {
    cursor: pointer;
    transition: text-shadow .18s ease, text-decoration-color .18s ease;
}

.click-translate:hover,
.click-translate.is-translation-open {
    text-decoration-line: underline;
    text-decoration-style: dotted;
    text-decoration-color: rgba(70, 227, 242, .68);
    text-underline-offset: 4px;
    text-shadow: 0 0 8px rgba(70, 227, 242, .12);
}

.translation-popover {
    position: fixed;
    z-index: 14440;
    display: block;
    width: max-content;
    max-width: min(430px, calc(100vw - 128px));
    box-sizing: border-box;
    padding: 9px 13px 10px;
    border: 1px solid rgba(70, 227, 242, .48);
    border-radius: 7px;
    background: linear-gradient(180deg, rgba(7, 25, 55, .97), rgba(4, 17, 43, .97));
    box-shadow: 0 12px 30px rgba(0, 5, 22, .42), 0 0 20px rgba(70, 227, 242, .12);
    color: #eefcff;
    font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.55;
    letter-spacing: 0;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}

.translation-popover.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
}

.translation-popover::before {
    content: "";
    position: absolute;
    top: -5px;
    left: var(--translation-arrow-left, 18px);
    width: 8px;
    height: 8px;
    border-top: 1px solid rgba(70, 227, 242, .48);
    border-left: 1px solid rgba(70, 227, 242, .48);
    background: rgba(7, 25, 55, .97);
    transform: rotate(45deg);
}

.translation-popover.is-above::before {
    top: auto;
    bottom: -5px;
    transform: rotate(225deg);
}

/* Legacy translations are normalized by JS before display. */
.translation-content,
.translation {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .click-translate,
    .translation-popover {
        transition: none !important;
    }
}
