body {
    font-family: 'Inter', sans-serif;
    background-color: #F3F4F6;
    -webkit-tap-highlight-color: transparent;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 编辑器外层包裹 */
.editor-wrapper {
    display: flex;
    width: 100%;
    height: 300px;
    border-radius: 0.75rem;
    background-color: white;
    border: 1px solid #E5E7EB;
    overflow: hidden; /* 防止内部溢出 */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.editor-wrapper:focus-within {
    border-color: #6366F1;
    ring: 2px solid #6366F1;
}

/* 左侧行号栏 */
.gutter {
    width: 1.5rem;
    flex-shrink: 0;
    background-color: #F9FAFB;
    border-right: 1px solid #E5E7EB;
    color: #9CA3AF;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
    text-align: right;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    overflow: hidden;
    user-select: none;
}

.gutter-line {
    padding-right: 0.25rem;
    padding-left: 0.1rem;
    height: 21px;
    box-sizing: content-box;
}

/* 右侧编辑区容器 */
.editor-container {
    position: relative;
    flex-grow: 1;
    height: 100%;
    overflow: hidden; 
}

/* 背景高亮层 */
.backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    padding: 0.5rem;
    overflow: hidden;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
    color: transparent;
    white-space: pre;
}

/* 前景输入层 */
.textarea-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    padding: 0.5rem;
    border: none;
    background-color: transparent;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
    color: #1F2937;
    resize: none;
    outline: none;
    white-space: pre;
    overflow: auto;
}

/* 错误样式 */
.line-whole-error {
    background-color: rgba(254, 202, 202, 0.5); 
    width: 100%;
    display: inline-block;
}

.gutter-error {
    background-color: rgba(254, 202, 202, 0.5); 
    color: #991B1B;
    font-weight: bold;
}

#editor-placeholder {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    color: #9CA3AF;
    pointer-events: none;
    font-size: 14px;
    z-index: 3;
    display: block;
}

.loader {
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top: 3px solid white;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 自定义下拉框样式 */
.custom-options {
    max-height: 200px;
    overflow-y: auto;
    transition: all 0.2s ease-in-out;
}

.custom-option:active {
    background-color: #EEF2FF; /* Indigo-50 */
}