/* ===== 复用之前的样式 ===== */
.editor-wrapper {
    display: flex;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    background: #1e1e2e;
    overflow: hidden;
    min-height: 340px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    position: relative;
}
.line-numbers {
    flex: 0 0 48px;
    background: #181825;
    color: #6c7086;
    padding: 12px 0;
    text-align: right;
    user-select: none;
    overflow: hidden;
    border-right: 1px solid #313244;
    font-size: 14px;
    line-height: 1.6;
    font-family: inherit;
    padding-right: 10px;
    min-height: 100%;
}
.line-numbers .line-num {
    display: block;
    height: 22.4px;
    padding: 0 4px 0 0;
    color: #6c7086;
    font-size: 13px;
    text-align: right;
    transition: color 0.15s;
}
.line-numbers .line-num.active {
    color: #cdd6f4;
    font-weight: 600;
}
.code-editor {
    flex: 1;
    background: #1e1e2e;
    color: #cdd6f4;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    resize: vertical;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.6;
    font-family: inherit;
    min-height: 340px;
    tab-size: 4;
    -moz-tab-size: 4;
    white-space: pre;
    overflow: auto;
    letter-spacing: 0.02em;
}
.code-editor:focus {
    border: none !important;
    box-shadow: none !important;
    background: #1e1e2e;
}
.code-editor::selection {
    background: #45475a;
    color: #cdd6f4;
}
.code-editor::-webkit-scrollbar,
.line-numbers::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.code-editor::-webkit-scrollbar-track,
.line-numbers::-webkit-scrollbar-track {
    background: #181825;
}
.code-editor::-webkit-scrollbar-thumb,
.line-numbers::-webkit-scrollbar-thumb {
    background: #45475a;
    border-radius: 4px;
}
.code-editor::-webkit-scrollbar-thumb:hover,
.line-numbers::-webkit-scrollbar-thumb:hover {
    background: #585b70;
}
.output-area {
    background: #0f0f1a;
    color: #cdd6f4;
    padding: 16px 20px;
    border-radius: 0.375rem;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.7;
    min-height: 120px;
    max-height: 380px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    border: 1px solid #313244;
}
.output-area .out-stdout { color: #a6e3a1; }
.output-area .out-stderr { color: #f38ba8; }
.output-area .out-error { color: #f9e2af; background: #1e1e2e; padding: 4px 8px; border-radius: 4px; display: inline-block; }
.output-area .out-info { color: #89b4fa; }
.output-area .out-time { color: #94e2d5; font-size: 13px; }
.output-area .out-empty { color: #6c7086; font-style: italic; user-select: none; }

.toolbar-btn {
    border-radius: 6px;
    font-weight: 500;
    font-size: 13px;
    padding: 6px 16px;
    transition: all 0.2s;
}
.toolbar-btn:active { transform: scale(0.96); }
.btn-run { background: #89b4fa; color: #1e1e2e; border: none; }
.btn-run:hover { background: #74c7ec; color: #1e1e2e; }
.btn-run:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-clear { background: #45475a; color: #cdd6f4; border: none; }
.btn-clear:hover { background: #585b70; color: #cdd6f4; }
.btn-example { background: #313244; color: #cdd6f4; border: none; }
.btn-example:hover { background: #45475a; color: #cdd6f4; }
.btn-copy { background: #313244; color: #cdd6f4; border: none; font-size: 13px; padding: 4px 14px; border-radius: 6px; }
.btn-copy:hover { background: #45475a; color: #cdd6f4; }

.status-badge {
    font-size: 13px;
    font-weight: 500;
    padding: 4px 14px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}
.status-badge.loading { background: #f9e2af; color: #1e1e2e; }
.status-badge.ready { background: #a6e3a1; color: #1e1e2e; }
.status-badge.error { background: #f38ba8; color: #1e1e2e; }
.status-badge.running { background: #89b4fa; color: #1e1e2e; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.card-dark {
    background: #181825;
    border: 1px solid #313244;
    border-radius: 12px;
    overflow: hidden;
}
.card-dark .card-header {
    background: #1e1e2e;
    border-bottom: 1px solid #313244;
    color: #cdd6f4;
    padding: 12px 20px;
    font-weight: 500;
    font-size: 15px;
}
.card-dark .card-body {
    background: #181825;
    padding: 16px 20px 20px 20px;
}

.alert-custom {
    background: #313244;
    border: none;
    color: #cdd6f4;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 14px;
}
.alert-custom a { color: #89b4fa; text-decoration: none; }
.alert-custom a:hover { text-decoration: underline; }

.loading-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(30, 30, 46, 0.85);
    backdrop-filter: blur(3px);
    z-index: 10;
    border-radius: 0.375rem;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: #cdd6f4;
    font-size: 15px;
}
.loading-overlay.show { display: flex; }
.loading-overlay .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #313244;
    border-top-color: #89b4fa;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.key-hint {
    color: #6c7086;
    font-size: 12px;
    background: #313244;
    padding: 2px 10px;
    border-radius: 4px;
    font-family: monospace;
    letter-spacing: 0.5px;
}

/* 进度条样式 */
.loading-overlay .progress-container {
    width: 70%;
    max-width: 400px;
    margin-top: 20px;
}
.loading-overlay .progress {
    height: 8px;
    background: #313244;
    border-radius: 20px;
    overflow: hidden;
}
.loading-overlay .progress-bar {
    background: linear-gradient(90deg, #89b4fa, #74c7ec);
    transition: width 0.3s ease;
    height: 100%;
    width: 0%;
    border-radius: 20px;
}
.loading-overlay .load-status-text {
    font-size: 14px;
    color: #a6e3a1;
    margin-top: 10px;
    font-weight: 500;
}
.loading-overlay .load-detail {
    font-size: 12px;
    color: #6c7086;
    margin-top: 4px;
}

@media (max-width: 576px) {
    .editor-wrapper { font-size: 12px; min-height: 240px; }
    .line-numbers { flex: 0 0 36px; font-size: 12px; padding-right: 6px; }
    .line-numbers .line-num { height: 19.2px; font-size: 11px; }
    .code-editor { font-size: 12px; padding: 10px 12px; min-height: 240px; }
    .output-area { font-size: 12px; padding: 12px 14px; min-height: 80px; max-height: 260px; }
    .toolbar-btn { font-size: 12px; padding: 4px 12px; }
}
