/* ===== 基础样式 ===== */
body {
    background-color: #f8f9fa;
    margin: 0;
}

/* ===== 导航栏样式 ===== */
.navbar {
    background-color: #000;
    min-height: 54px;
    padding: 8px 0;
}

.navbar-brand {
    color: silver !important;
    font-size: 1.5rem;
    font-weight: bold;
}

.navbar-brand:hover {
    color: #ccc !important;
}

/* ===== 上传区域样式 ===== */
.upload-area {
    text-align: center;
    background-color: #fff;
    border: 2px dashed #ccc;
    border-radius: 8px;
    margin-bottom: 20px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

#drag-drop-area {
    width: 100%;
}

/* ===== 代码容器样式 ===== */
.code-container {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    height: calc(100vh - 200px);
    min-height: 500px;
}

.code-area {
    height: calc(100% - 50px);
    overflow-y: auto;
    background-color: #fff;
    margin: 0;
    padding: 15px;
    font-size: 14px;
    line-height: 1.4;
}

.code-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
}

/* ===== 选项卡样式 ===== */
.nav-tabs {
    border: none;
    margin: 0;
}

.nav-tabs .nav-link {
    border: none;
    background: none;
    color: #666;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 0;
}

.nav-tabs .nav-link.active {
    color: #007bff;
    background-color: transparent;
    border-bottom: 2px solid #007bff;
}

/* ===== 按钮样式 ===== */
.code-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    padding: 6px 10px;
    font-size: 14px;
    border: 1px solid #ddd;
    background: #fff;
    color: #666;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-icon:hover {
    background: #f8f9fa;
    color: #333;
    border-color: #bbb;
}

/* ===== 广告样式 ===== */
.ad-sidebar {
    min-height: 600px;
}

.ad-banner {
    height: 90px;
    width: 100%;
}

/* ===== 响应式布局调整 ===== */
@media (max-width: 991px) {
    .ad-sidebar {
        display: none;
    }

    .ad-banner {
        display: block;
    }

    .row.code-row {
        flex-direction: column;
    }

    .code-container {
        height: 400px;
        margin-bottom: 20px;
    }
}

@media (min-width: 992px) {
    .ad-sidebar {
        display: block;
    }

    .ad-banner {
        display: none;
    }
}

/* ===== Uppy拖拽区域样式优化 ===== */
.uppy-DragDrop-container {
    padding: 1rem !important;
    border-radius: 8px !important;
    border: none !important;
    background: transparent !important;
}

.uppy-DragDrop-label {
    font-size: 16px !important;
    color: #666 !important;
}

/* ===== 修复焦点轮廓问题 ===== */
.uppy-DragDrop-container:focus,
.uppy-DragDrop-container:focus-visible,
.uppy-DragDrop-input:focus,
.uppy-DragDrop-input:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* 可选：如果需要保留可访问性，可以添加自定义焦点样式 */
.uppy-DragDrop-container:focus-visible {
    outline: 2px solid #007bff !important;
    outline-offset: 2px !important;
}

/* ===== Tab内容区域 ===== */
.tab-content {
    height: calc(100% - 50px);
}

.tab-pane {
    height: 100%;
}

.tab-pane pre {
    height: 100%;
    margin: 0;
    border: none;
    border-radius: 0;
    background: #fff;
}

.tab-pane code {
    height: 100%;
    display: block;
    overflow-y: auto;
    padding: 15px;
    background: #fff;
    font-size: 14px;
    line-height: 1.4;
}

.code-container {
    position: relative; /* Required for the overlay to position correctly */
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--bs-border-radius);
    display: none; /* Hidden by default */
}
