/* 两种课程页共用的逐词详情浮层。 */
.caption-word-modal[hidden] {
    display: none !important;
}

.caption-word-modal {
    position: fixed;
    inset: 0;
    z-index: 2600;
    display: block;
    padding: 0;
    pointer-events: none;
}

.caption-word-dialog {
    position: fixed;
    width: min(330px, calc(100vw - 16px));
    max-height: min(390px, calc(100vh - 16px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #d6e1f2;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(31, 52, 88, 0.16);
    color: #19243a;
    pointer-events: auto;
}

.caption-word-dialog-head {
    min-height: 48px;
    padding: 8px 9px 7px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #e5ebf3;
    background: #fff;
}

.caption-word-dialog-head h2 {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    color: #172238;
    font: inherit;
    font-size: 20px;
    font-weight: 850;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.caption-word-dialog-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.caption-word-save,
.caption-word-close {
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 1px solid #c9d7f2;
    border-radius: 50%;
    background: #f8fbff;
    color: #2f66e9;
    box-shadow: none;
    cursor: pointer;
    font: inherit;
    font-size: 17px;
    font-weight: 750;
    line-height: 1;
}

.caption-word-close {
    color: #697993;
    font-size: 21px;
    font-weight: 350;
}

.caption-word-save:hover,
.caption-word-save:focus-visible,
.caption-word-save.is-saved {
    border-color: #2f66e9;
    outline: none;
    background: #2f66e9;
    color: #fff;
}

.caption-word-close:hover,
.caption-word-close:focus-visible {
    border-color: #a9c0f3;
    outline: none;
    background: #edf3ff;
    color: #2f66e9;
}

.caption-word-save:disabled {
    cursor: wait;
    opacity: 0.62;
}

.caption-word-save.is-saved:disabled {
    cursor: default;
    opacity: 1;
}

.caption-word-dialog-body {
    padding: 9px 10px 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.caption-word-accent-note {
    width: max-content;
    max-width: 100%;
    margin: 0 0 7px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #edf3ff;
    color: #5873aa;
    font-size: 9px;
    font-weight: 700;
}

.caption-word-pronunciations {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.caption-word-pronunciation {
    min-width: 0;
    min-height: 34px;
    padding: 4px 7px;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 4px;
    border: 1px solid #d6e1f2;
    border-radius: 9px;
    background: #fbfcff;
    color: #6d7e99;
    cursor: pointer;
    font: inherit;
    font-size: 10px;
    text-align: left;
}

.caption-word-pronunciation strong {
    color: #2f66e9;
    white-space: nowrap;
}

.caption-word-pronunciation span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.caption-word-pronunciation-icon {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #edf3ff;
    color: #2f66e9;
}

.caption-word-pronunciation-icon svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.caption-word-pronunciation:hover,
.caption-word-pronunciation:focus-visible,
.caption-word-pronunciation.is-playing {
    border-color: #a9c0f3;
    outline: none;
    background: #f4f7ff;
}

.caption-word-pronunciation.is-loading {
    cursor: wait;
    opacity: 0.62;
}

.caption-word-context-card {
    position: relative;
    margin-top: 7px;
    padding: 8px 9px;
    overflow: hidden;
    border: 1px solid #dce6f5;
    border-radius: 10px;
    background: #f7faff;
}

.caption-word-context-card::before {
    display: none;
}

.caption-word-chinese {
    margin: 0;
    color: #344866;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.4;
}

.caption-word-context-row > span,
.caption-word-lexical-details span,
.caption-word-source-sentence > span {
    display: block;
    margin-bottom: 2px;
    color: #74839a;
    font-size: 9px;
    font-weight: 800;
}

.caption-word-context-row > p {
    margin: 0;
    color: #344866;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.42;
}

.caption-word-context-row.is-in-sentence {
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid #dce6f5;
}

.caption-word-context-row.is-in-sentence > p {
    color: #1f5dcc;
}

.caption-word-lexical-details {
    margin-top: 7px;
    border-top: 1px solid #e5ebf3;
}

.caption-word-lexical-details > div {
    padding: 7px 2px 0;
}

.caption-word-lexical-details p {
    margin: 0;
    color: #40516c;
    font-size: 11px;
    line-height: 1.42;
}

.caption-word-source-sentence {
    margin-top: 7px;
    padding: 7px 2px 0;
    border-top: 1px solid #e5ebf3;
}

.caption-word-source-sentence p {
    margin: 0;
    color: #6b7990;
    font-size: 10px;
    line-height: 1.4;
}

.caption-word-source-sentence p[lang="en"] {
    margin-bottom: 2px;
    color: #344866;
    font-size: 10.5px;
    font-weight: 720;
}

@media (max-width: 620px) {
    .caption-word-dialog {
        width: min(310px, calc(100vw - 16px));
        max-height: min(370px, calc(100vh - 16px));
    }

    .caption-word-dialog-head {
        min-height: 46px;
        padding: 7px 8px 6px 11px;
    }

    .caption-word-dialog-head h2 {
        font-size: 19px;
    }

    .caption-word-save,
    .caption-word-close {
        width: 29px;
        min-width: 29px;
        height: 29px;
        min-height: 29px;
    }

    .caption-word-dialog-body {
        padding: 8px 9px 9px;
    }
}
