:root {
    --plyr-color-main: #0052d9;
}

body {
    font-family: 'Inter', 'Noto Sans SC', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-button { /* 滚动条两端的按钮 */
    width:0px;
    height: 0px;
    background-color: #ededed;
}
::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 0px;
}
.dark ::-webkit-scrollbar-thumb {
    background: #3f3f46;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb {
    background: #d4d4d8;
    border-radius: 3px;
}
.dark ::-webkit-scrollbar-thumb:hover {
    background: #52525b;
}
::-webkit-scrollbar-thumb:hover {
    background: #a1a1aa;
}
::-webkit-scrollbar-thumb {
    cursor: pointer !important;
}
::-webkit-scrollbar-corner { /* 边角 */
    width: 0px;
    height: 0px;
    background-color: transparent;
}

.flash-highlight {
    position: absolute;
    background: #0052d959; /* 金黄色高亮半透明 */
    z-index: 20;
    animation: fadeOutHighlight 2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes fadeOutHighlight {
    0% {
        background: #0052d980;
    }
    15% {
        background: #0052d980;
    }
    100% {
        background: #0052d900;
    }
}

@keyframes logFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.animate-log-in {
    animation: logFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 编辑器和高亮覆盖层样式 */
#editor-container {
    position: relative;
    font-family: 'Fira Code', Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
}
#editing-textarea, #highlight-pre {
    margin: 0;
    padding: 16px;
    border: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    white-space: pre;
    word-wrap: normal;
    background: transparent;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    tab-size: 4;
}
#editing-textarea {
    position: absolute;
    top: 0;
    left: 0;
    color: transparent;
    caret-color: #1e1e1e; /* 亮色模式默认黑光标 */
    resize: none;
    z-index: 1;
    outline: none;
}
.dark #editing-textarea {
    caret-color: #60a5fa; /* 暗色模式天蓝光标 */
}
#highlight-pre {
    position: relative;
    z-index: 0;
    pointer-events: none;
}

/* 主题过渡动画 */
.theme-transition {
    transition: background-color 0.2s, border-color 0.2s, color 0.15s;
}

/* 棋盘格背景（用于图片透明度预览） */
.bg-checkered {
    background-image: linear-gradient(45deg, #e4e4e7 25%, transparent 25%), 
                      linear-gradient(-45deg, #e4e4e7 25%, transparent 25%), 
                      linear-gradient(45deg, transparent 75%, #e4e4e7 75%), 
                      linear-gradient(-45deg, transparent 75%, #e4e4e7 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}
.dark .bg-checkered {
    background-image: linear-gradient(45deg, #222 25%, transparent 25%), 
                      linear-gradient(-45deg, #222 25%, transparent 25%), 
                      linear-gradient(45deg, transparent 75%, #222 75%), 
                      linear-gradient(-45deg, transparent 75%, #222 75%);
}

.color-badge {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 1px solid #858585;
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.1s, box-shadow 0.1s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

button i {
    display: inline-block;
}

/* 菜单动画和全局样式 */
.context-menu-enter {
    animation: menuFadeIn 0.12s cubic-bezier(0.1, 0.9, 0.2, 1);
}
@keyframes menuFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
.menu-item {
    transition: background 0.08s linear;
}
.menu-divider {
    margin: 6px 8px;
}

.json-duplicate-value {
    position: absolute;
    background-color: rgba(231, 76, 60, 0.15) !important; /* 淡淡的红底色 */
    border-bottom: 1px dashed #e74c3c !important;         /* 红色虚线下划线 */
    color: #e74c3c !important;                             /* 让文字本身也变红（可选） */
    z-index: 20;
}

.json-dollar-variable {
    position: absolute;
    background-color: rgba(52, 152, 219, 0.08) !important; /* 淡淡的蓝色底色 */
    border-bottom: 1px dashed #3498db !important;          /* 蓝色虚线下划线 */
    color: #2980b9 !important;                              /* 文字变成深蓝色 */
    z-index: 20;
    
    /* 【核心】强行开启该高亮层的鼠标交互响应，否则 Hover 和点击都无法穿透 */
    pointer-events: auto !important; 
    /* cursor: pointer !important; */
    /* transition: all 0.15s ease; */
}

/* 鼠标 Hover 时的状态变化 */
.json-dollar-variable:hover {
    background-color: rgba(52, 152, 219, 0.2) !important;  /* 蓝底加深 */
    border-bottom: 1px solid #2980b9 !important;           /* 下划线变实线 */
    box-shadow: 0 0 4px rgba(52, 152, 219, 0.4);            /* 淡淡的蓝色发光特效 */
}

.json-anim-variable {
    position: absolute;
    background-color: rgba(85, 219, 52, 0.08) !important; 
    border-bottom: 1px dashed rgb(85, 219, 52) !important;       
    color: rgb(85, 219, 52) !important;      
    z-index: 20;
    pointer-events: auto !important; 
    /* cursor: pointer !important; */
}

.json-commonName-variable {
    position: absolute;
    background-color: rgba(219, 180, 52, 0.08) !important; 
    border-bottom: 1px dashed rgb(219, 180, 52) !important;       
    color: rgb(219, 180, 52) !important;      
    z-index: 20;
    pointer-events: auto !important; 
    /* cursor: pointer !important; */
}

.json-commonName-variable:hover {
    background-color: rgba(219, 180, 52, 0.2) !important;  /* 蓝底加深 */
    border-bottom: 1px solid rgb(219, 180, 52) !important;           /* 下划线变实线 */
    box-shadow: 0 0 4px rgba(219, 180, 52, 0.4);            /* 淡淡的蓝色发光特效 */
}

.json-anim-variable:hover {
    background-color: rgba(85, 219, 52, 0.2) !important;  /* 蓝底加深 */
    border-bottom: 1px solid rgb(85, 219, 52) !important;           /* 下划线变实线 */
    box-shadow: 0 0 4px rgba(85, 219, 52, 0.4);            /* 淡淡的蓝色发光特效 */
}

.json-array-variable {
    position: absolute;
    background-color: rgba(219, 188, 52, 0.08) !important; 
    border-bottom: 1px dashed rgb(219, 188, 52) !important;       
    color: rgb(219, 188, 52) !important;      
    z-index: 20;
    pointer-events: auto !important; 
    /* cursor: pointer !important; */
}
.json-array-variable:hover {
    background-color: rgba(219, 188, 52, 0.2) !important;  /* 蓝底加深 */
    border-bottom: 1px solid rgb(219, 188, 52) !important;           /* 下划线变实线 */
    box-shadow: 0 0 4px rgba(219, 188, 52, 0.4);            /* 淡淡的蓝色发光特效 */
}

.player-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: 100%;
}

.player-wrapper .plyr {
    height: 100%;
}

.layout_undefined, .property_undefined, .property_invalid  {
    position: absolute;
    background-color: #ff000042 !important; 
    /* border-bottom: 1px dashed rgb(255, 0, 0) !important;        */
    color: #ff000042 !important;      
    z-index: 20;
    pointer-events: auto !important; 
}


@keyframes OutElastic {
    0% {
        transform: translateX(-100px);
    }
    20% {
        transform: translateX(-120px);  /* 超过目标 */
    }
    40% {
        transform: translateX(10px);    /* 弹回 */
    }
    60% {
        transform: translateX(-10px);   /* 再次弹回 */
    }
    80% {
        transform: translateX(5px);     /* 微调 */
    }
    100% {
        transform: translateX(0);       /* 最终位置 */
    }
}