/* 结算面板（宿主重建） */
#gameContainer .resultPanel {
    border: 2px solid rgba(112, 205, 221, .55) !important;
    border-radius: 20px !important;
    /* 游戏自带的斜切角会与本边框叠出缺口，关掉 */
    -webkit-clip-path: none !important;
    clip-path: none !important;
    background: rgba(8, 24, 44, .97) !important;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .05) !important;
    padding: 18px 22px 20px !important;
    box-sizing: border-box;
    overflow: hidden;
}

/* 原面板内容在重建后隐藏 */
.se-hidden {
    display: none !important;
}

/* 游戏自带的渐变遮罩会盖在重建内容之上，直接去掉 */
#gameContainer .resultPanel::before,
#gameContainer .resultPanel::after {
    display: none !important;
}

.se-result {
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: #cfe3f5;
}

.se-result-head {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 12px;
}

.se-result-head-label {
    font-size: 32px;
    line-height: 1.1;
    color: #9dc3e2;
}

.se-result-head-score {
    font-family: "Bahnschrift", "DIN Alternate", "Segoe UI Variable Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 32px;
    line-height: 1.1;
    color: #ffd54a;
}

.se-result-comments {
    display: flex;
    align-items: stretch;
    gap: 14px;
    padding: 10px 0;
    border-top: 1px solid rgba(112, 205, 221, .25);
    border-bottom: 1px solid rgba(112, 205, 221, .25);
}

.se-comments-label {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-right: 18px;
    border-right: 1px solid rgba(112, 205, 221, .28);
    font-size: 26px;
    font-weight: 700;
    color: #70cddd;
}

.se-comments-lines {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.se-comment {
    font-size: 24px;
    line-height: 1.45;
}

.se-comment-from {
    margin-right: 6px;
    color: #9dc3e2;
}

.se-comment-en {
    color: #ffb74d;
}

.se-comment-cn {
    margin-left: .4em;
    color: #ffb74d;
}

.se-result-words {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 22px;
    /* 8 词必须一屏放下：正常不设滚动，溢出时由脚本降行数，实在放不下才在这里兜底 */
    max-height: none;
    overflow: visible;
    padding: 2px;
    font-size: 1.8vw;
}

.se-wrow {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.se-word {
    flex: 0 0 auto;
    min-width: 6.5em;
    line-height: 1.2;
    color: #cfe3f5;
}

.se-l-letter {
    color: #cfe3f5;
}

.se-l-normal {
    color: #cfe3f5;
}

.se-l-fixed {
    color: #9dc3e2;
}

.se-l-purple {
    color: #c58cff;
}

.se-l-orange {
    color: #ff9f43;
}

.se-l-miss {
    color: #ff5b5b;
}

.se-hint {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: 1.35em;
    overflow: hidden;
}

/* 口诀词表的提示较长（5 个区域），先按两行预留，实际高度由脚本按行数撑开 */
.se-hint.se-hint-mnemonic {
    height: 2.4em;
}

.se-hint-mnemonic .se-hint-item {
    justify-content: flex-start;
    text-align: left;
    padding-right: 4px;
    line-height: 1.2;
}

/* 口诀结算列表：行高更大，行距收紧 */
.se-result-words.se-result-words-mnemonic {
    gap: 4px 22px;
    max-height: none;
}

/* 释义最多排三行，由脚本逐条缩字号并撑开高度 */
.se-hint-item {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity .5s ease;
    font-size: 100%;
    line-height: 1.35;
    color: #9dc3e2;
    white-space: normal;
    overflow-wrap: anywhere;
    overflow: hidden;
}

.se-hint-item.active {
    opacity: 1;
}

/* 联想模式：单词旁的记忆法视频按钮 */
.se-word-video {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7em;
    height: 1.7em;
    padding: 0;
    margin-left: -6px;
    border: 1px solid rgba(112, 205, 221, .5);
    border-radius: 6px;
    background: rgba(12, 36, 62, .55);
    color: #70cddd;
    font-size: .78em;
    line-height: 1;
    cursor: pointer;
}

.se-word-video:hover {
    color: #fff;
    border-color: rgba(112, 205, 221, .95);
    background: rgba(20, 62, 100, .8);
}

/* 结算页内嵌播放器：覆盖在结算面板上；遮罩只做轻微压暗，主要用来吃掉点击 */
.se-video-mask {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(3, 12, 24, .26);
    -webkit-backdrop-filter: blur(1.5px);
    backdrop-filter: blur(1.5px);
}

.se-video-frame {
    position: relative;
    width: min(86vw, 960px);
    box-sizing: border-box;
    padding: 42px 12px 12px;
    border: 1px solid rgba(112, 205, 221, .55);
    border-radius: 10px;
    background: #06121f;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}

.se-video-frame video {
    display: block;
    width: 100%;
    max-height: 68vh;
    border-radius: 6px;
    background: #000;
}

.se-video-close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #cfe3f5;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.se-video-close:hover {
    color: #fff;
    background: rgba(112, 205, 221, .18);
}

.se-video-title {
    position: absolute;
    left: 14px;
    right: 48px;
    top: 13px;
    color: #9dc3e2;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.se-result-actions {
    display: flex;
    justify-content: space-between;
    width: min(58%, 680px);
    margin: 22px auto 0;
    gap: 24px;
}

.se-result-btn {
    flex: 1 1 170px;
    max-width: 190px;
    min-width: 0;
    height: 42px;
    padding: 0 18px;
    border-radius: 23px;
    border: 1px solid rgba(112, 205, 221, .5);
    background: rgba(17, 44, 74, .92);
    color: #cfe3f5 !important;
    font-size: 16px;
    cursor: pointer;
    transition: background-color .18s ease;
}

.se-result-btn:hover {
    background: rgba(30, 74, 116, .95);
}

@media screen and (orientation: portrait) {
    .se-result-head-label,
    .se-result-head-score {
        font-size: 24px;
    }

    .se-result-comments {
        gap: 10px;
    }

    .se-comments-label {
        padding: 0 4px;
        border-right: 0;
        writing-mode: vertical-rl;
        letter-spacing: 4px;
        font-size: 15px;
    }

    .se-comment {
        font-size: 16px;
    }

    .se-comment-cn {
        display: block;
        margin-left: 0;
    }

    .se-result-words {
        grid-template-columns: minmax(0, 1fr);
        max-height: 40vh;
        overflow-y: auto;
        font-size: 4vw;
    }

    .se-hint-item {
        font-size: 100%;
    }

    .se-result-actions {
        width: auto;
        justify-content: center;
        gap: 10px;
        margin-top: 12px;
    }

    .se-result-btn {
        flex: 0 1 auto;
        max-width: none;
        min-width: 74px;
        height: 30px;
        padding: 0 10px;
        border-radius: 16px;
        font-size: 12px;
    }
}
