html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: #2f3129;
    overflow: hidden;
}

.container-fluid {
    margin: 0;
    padding: 0;
}

/* 2. 让 row 使用 no-gutters，去掉默认的左右内间距 */
.row.no-gutters {
    margin-right: 0;
    margin-left: 0;
}

/* 也可再覆盖 col 默认的padding */
.col-sm-8, .col-md-4 {
    padding: 0 !important;
}

.ace_editor .ace_content span,
.ace_editor .ace_content .ace_line {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace !important;
}

img {
    max-width: 100%;
}

.btn-area {
    height: 56px;
    background-color: #2f3129;
    position: relative;
    z-index: 30;
}

.btn-area button {
    float: left;
    color: #fff;
    border-radius: 0;
    border-width: 0;
    height: 100%;
    width: 80px;
    cursor: pointer;
    /* 新增交互动效 */
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

/* 按钮各自配色 */
#run {
    float: left;
    background-color: #a7c336;
    color: #fff;
    border-radius: 0;
    border-width: 0;
    height: 100%;
    width: 80px;
}

#save {
    background-color: #6dddf2;
}

#open {
    background-color: #f53855;
}

#download {
    background-color: #7f6df2;
}

#share {
    background-color: #a7c336;
}

#home {
    background-color: #ef7d62;
}

/* hover 效果：轻微抬起、放大、加阴影、提亮 */
.btn-area button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

/* active 效果：按下时缩回、减弱阴影、变暗 */
.btn-area button:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    filter: brightness(0.9);
}

.btn-area .bootstrap-select .dropdown-toggle:hover {
    transform: none !important;
    filter: none !important;
    box-shadow: none !important;
}

.help-link-container a {
    color: #fff;
}

.choose-container {
    color: #fff;
    padding-left: 5px;
    padding-right: 5px;
    display: flex;
    display: -webkit-flex;
    align-items: center;
}

.theme-choose {
    color: #fff;
    padding-left: 5px;
    padding-right: 5px;
    display: flex;
    display: -webkit-flex;
    align-items: center;
}

.editor-layout-row {
    --desktop-console-width: 420px;
    height: calc(100vh - 56px);
    flex-wrap: nowrap;
    background: #1f201b;
    position: relative;
}

.code-container {
    padding-left: 0;
    padding-right: 0;
    height: 100%;
    overflow: hidden;
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    max-width: none;
    min-width: 0;
}

#editor {
    height: 100%;
    width: 100%;
}

.console-resizer {
    flex: 0 0 8px;
    width: 8px;
    cursor: col-resize;
    background: linear-gradient(180deg, rgba(125, 134, 156, 0.42), rgba(76, 82, 95, 0.35));
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    border-right: 1px solid rgba(0, 0, 0, 0.35);
    transition: background 0.2s ease;
}

.console-resizer:hover {
    background: linear-gradient(180deg, rgba(170, 184, 214, 0.75), rgba(115, 128, 152, 0.72));
}

.console-column {
    flex: 0 0 var(--desktop-console-width) !important;
    width: var(--desktop-console-width) !important;
    max-width: none !important;
    min-width: 300px;
    height: 100%;
    display: flex;
    background: #0b0e13;
}

.console-shell {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    background: radial-gradient(circle at 30% 0, rgba(66, 82, 110, 0.25), transparent 52%), #090b0f;
}

.console-toolbar {
    height: 44px;
    padding: 0 10px 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, #1a2433, #101824);
}

.console-title {
    color: #d9e2f5;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.console-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.console-action-btn {
    border: 1px solid #4e607c;
    color: #ecf1ff;
    background: #1b293c;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    line-height: 1.2;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.console-action-btn:hover {
    border-color: #8098c2;
    background: #273a56;
    transform: translateY(-1px);
}

.console-action-btn:active {
    transform: translateY(0);
}

.console-action-btn-secondary {
    border-color: #7f5f80;
    background: #352837;
}

.console-action-btn-secondary:hover {
    border-color: #b78cb8;
    background: #4a3750;
}

.console {
    width: 100%;
    height: auto;
    flex: 1 1 auto;
    background-color: #000;
    color: #FFF;
    font-size: 20px;
    font-weight: 700;
    border-width: 0;
    font-family: 'Monaco', 'Consolas', serif;
    padding: 10px 12px;
    white-space: pre;
    word-break: normal;
    overflow-wrap: normal;
    overflow-x: auto;
    overflow-y: auto;
    resize: none;
}

.console.console-wrap-enabled {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.console .console-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0;
}

.console .console-input-prompt {
    flex: 0 0 auto;
}

.console .console-inline-input {
    flex: 1;
    min-width: 0;
    background-color: #111;
    color: #fff;
    border: 1px solid #666;
    padding: 3px 8px;
    border-radius: 4px;
    outline: none;
}

.editor-layout-row.console-collapsed .console-column,
.editor-layout-row.console-collapsed .console-resizer {
    display: none !important;
}

.console-expand-trigger {
    position: fixed;
    top: 44%;
    right: 16px;
    z-index: 26;
    border: 1px solid #8ba3cc;
    background: linear-gradient(160deg, rgba(25, 50, 88, 0.96), rgba(10, 23, 45, 0.96));
    color: #eff4ff;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    box-shadow: 0 12px 24px rgba(5, 8, 14, 0.45);
    opacity: 0;
    pointer-events: none;
    transform: translateX(120%);
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.console-expand-trigger.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.console-expand-trigger:hover {
    border-color: #bfd0ef;
    filter: brightness(1.08);
}

body.console-resizing {
    cursor: col-resize;
}

body.console-resizing * {
    user-select: none !important;
}

.modal-dialog {
    margin: 0.5rem auto; /* 上下微距，左右居中 */
    max-width: 70%; /* 默认大屏时的最大宽度 */
    width: auto;
}

/* 弹窗内容如果超出一定高度，产生滚动条，以防在小屏时撑出屏幕 */
.modal-content {
    max-height: 80vh;
    overflow-y: auto;
}

/* 针对小屏幕做自适应，让弹窗更大，几乎全屏 */
@media (max-width: 768px) {
    .modal-dialog {
        max-width: 95% !important;
        margin: 1rem auto;
    }
}

/* Add custom styles for bootstrap-select in dark theme */
.bootstrap-select .dropdown-toggle {
    background-color: #4a4a4a;
    border-color: #666;
    color: white;
}

.bootstrap-select .dropdown-toggle:hover {
    background-color: #5a5a5a;
}

/* ====== 复制成功提示的动画样式 ====== */
.copy-success {
    display: none;
    color: #28a745;
    font-weight: bold;
    margin-top: 10px;
    /* 简单的渐入渐出动画 */
    animation: fadeInOut 2s forwards;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* ========== 自定义右键菜单样式 ========== */
#custom-context-menu {
    position: absolute;
    z-index: 9999;
    background-color: #3c3c3c; /* 稍微比页面底色深一些 */
    border: 1px solid #4f4f4f;
    border-radius: 5px;
    min-width: 180px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    display: none;
}

#custom-context-menu ul {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

#custom-context-menu li {
    padding: 8px 12px;
    cursor: pointer;
    color: #ffffff;
    font-size: 14px;
}

#custom-context-menu li:hover {
    background-color: #575757;
}

.sidebar-action .sidebar-action-icon .bi {
    font-size: 18px;
    line-height: 1;
}

.sidebar-logo-svg {
    object-fit: contain;
}
