.font-size-small .custom .text {
    font-size: 18px !important;
}

.font-size-normal .custom .text {
    font-size: 25px !important;
}

.font-size-large .custom .text {
    font-size: 35px !important;
}

.font-size-small .custom .char {
    height: 34px;
}

.font-size-normal .custom .char {
    height: 44px;
}

.font-size-large .custom .char {
    height: 54px;
}

/* 隱藏原生輸入容器 */
.input-container {
    /* opacity: 0 !important; */
}

/* 基礎容器 */
.custom {
    line-height: 1.8;
    padding: 24px;
    font-family: 'Inter', 'Roboto', sans-serif;
    color: #e2e8f0;
}

/* 字組容器 - 採用微玻璃擬態與平滑過渡 */
.custom .word {
    background-color: transparent;
    border: none;
    ;
    border-radius: 12px;
    /* margin: 4px; */
    /* min-width: 50px; */
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 字組文字顯示 */
.custom .word .display {
    font-size: 38px;
    font-weight: 600;
    color: #94a3b8;
    line-height: 1.2;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    border-bottom: 4px solid transparent;
}

/* 字組文字容器 */
.custom .word-char-text-container {
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* 當前字組高亮 - 發光玻璃效果 */
.custom .word.current {
    transform: translateY(-2px);
}

.custom .word.current .word-char-text-container {
    background: rgba(255, 255, 255, 0.05);
    /* 支援深色模式的玻璃背景 */
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
}

.custom .word .display.current {
    color: #ffffff;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
    border-bottom: 4px solid #6366f1;
}

/* 字符編碼顯示 */
.custom .chars {
    position: relative;
    gap: 4px;
    display: flex;
}

.custom .char {
    transition: all 0.2s ease;
    border-radius: 4px;
    padding: 2px;
    border: 1px solid transparent;
}

.custom .char .text {
    padding: 0 4px;
    font-size: 15px;
    font-weight: 500;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    color: #64748b;
}

.custom .char .code {
    padding: 0 4px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    color: #94a3b8;
}

.custom .word .display.current,
.char.current {
    border-bottom: none;
}



.custom .char.current {
    background: linear-gradient(135deg, #414141, #232323);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
    /* zoom: 1.1; */
    transform: scale(1.1);
}

.custom .char.current .code,
.custom .char.current .text {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 正確輸入樣式 */
.custom .char.correct:not(.wrong):not(.once-wronged) {
    background: rgba(34, 197, 94, 0.1) !important;
    border: 1px solid rgba(34, 197, 94, 0.2);
    animation: success-pulse 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.custom .word .display.typed.correct,
.custom .char.typed.correct .code,
.custom .char.typed.correct .text,
.custom .display.correct {
    color: #22c55e !important;
    text-shadow: 0 0 15px rgba(34, 197, 94, 0.3);
}

/* 曾經錯誤的提示 (Once Wronged) */
.custom .word .char.typed.correct.once-wronged,
.custom .char.typed.correct.once-wronged {
    background: rgba(234, 179, 8, 0.1) !important;
    border: 1px solid rgba(234, 179, 8, 0.2);
    animation: warning-pulse 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.custom .word .display.typed.correct.once-wronged {
    color: #eab308;
    background: transparent !important;
}

.custom .char.once-wronged.correct .code,
.custom .char.once-wronged.correct .text {
    color: #eab308 !important;
}

/* 錯誤輸入樣式 */
.custom .word .char.typed.wrong {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    animation: error-shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) forwards;
}

.custom .word .char.typed.wrong .code,
.custom .word .char.typed.wrong .text {
    color: #ef4444;
}

.custom .word .display.typed.wrong {
    color: #ef4444;
    text-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
    animation: error-shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) forwards;
}

.custom .char.typed.wrong {
    color: #ef4444;
}

/* 動畫定義 */
@keyframes success-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 10px 2px rgba(34, 197, 94, 0.2);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

@keyframes warning-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 10px 2px rgba(234, 179, 8, 0.2);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(234, 179, 8, 0);
    }
}

@keyframes error-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-4px);
    }

    40%,
    80% {
        transform: translateX(4px);
    }
}

/* 特殊處理 */
.custom .word .display.space::after {
    content: "⎵";
    color: #475569;
    font-size: 22px;
    opacity: 0.6;
}

.custom .char.code-space {
    display: block;
    position: absolute;
    bottom: -24px;
    width: 100%;
    text-align: center;
}

.custom .char.code-space .text::after {
    content: "\2423";
    color: #64748b;
}

/* 字體大小處理 */
.font-size-small .custom .char.code-space {
    bottom: -16px;
}

.font-size-normal .custom .char.code-space {
    bottom: -20px;
}

.font-size-large .custom .char.code-space {
    bottom: -28px;
}

.font-size-small .custom .chars {
    /* margin-bottom: 24px; */
}

.font-size-normal .custom .chars {
    /* margin-bottom: 28px; */
}

.font-size-large .custom .chars {
    /* margin-bottom: 36px; */
}

/* 提示框 */
.custom .word-img-container {
    display: none;
}