/* ESP Launchpad 弹窗样式 - 仅针对ESP弹窗，避免全局冲突 */
#esp-launchpad-modal.modal {
    z-index: 13000 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    outline: 0 !important;
}

#esp-launchpad-modal .modal-backdrop {
    z-index: 12999 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
}

/* ensure modal dialog centering (namespaced) */
#esp-launchpad-modal.modal.show .modal-dialog,
#esp-launchpad-modal .modal-dialog {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 13001 !important;
    width: 90% !important;
    max-width: 900px !important;
    max-height: 90vh !important;
    height: auto !important;
    margin: 0 !important;
}

.console-container {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 10px;
    height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.2;
}

.console-output {
    height: 100%;
    overflow-y: auto;
    /* 自定义滚动条样式，让其融入黑色背景 */
    scrollbar-width: thin;
    scrollbar-color: #555 #1e1e1e;
}

.console-output::-webkit-scrollbar {
    width: 8px;
}

.console-output::-webkit-scrollbar-track {
    background: #1e1e1e;
    border-radius: 4px;
}

.console-output::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.console-output::-webkit-scrollbar-thumb:hover {
    background: #777;
}

.console-line {
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: flex-start;
}

.console-timestamp {
    color: #888;
    margin-right: 8px;
    flex-shrink: 0;
    font-size: 11px;
}

.console-text {
    color: #fff;
    flex: 1;
    word-break: break-word;
    white-space: pre-wrap;
    line-height: 1.2;
}

.console-text.error {
    color: #ff6b6b;
}

.console-text.success {
    color: #51cf66;
}

.console-text.warning {
    color: #ffd43b;
}

.console-text.info {
    color: #74c0fc;
}

/* ESP Launchpad 弹窗标题栏样式优化 - 仅针对弹窗内部 */
#esp-launchpad-modal .modal-header .modal-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.console-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.console-controls .btn {
    white-space: nowrap;
}

.console-controls .form-select {
    min-width: 180px;
}

/* ESP Launchpad 进度条样式 - 仅针对弹窗内部 */
/* Progress bar fallback styling scoped */
#esp-launchpad-modal .progress { 
    background-color: #999; 
    height: 20px; 
    border-radius: 0.25rem; 
    overflow: hidden; 
    position: relative;
}
#esp-launchpad-modal .progress-bar { 
    background-color: #0d6efd; 
    width: 0%; 
    height: 100%; 
    transition: width 0.3s ease; }


#esp-launchpad-modal #esp-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    color: #fff !important;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
    margin-bottom: 0 !important;
}

/* 标题栏控制按钮样式优化 */
#esp-launchpad-modal .esp-controls {
    flex-wrap: wrap;
    gap: 8px !important;
}

#esp-launchpad-modal .esp-controls .btn-group {
    flex-shrink: 0;
}

#esp-launchpad-modal .esp-controls .form-select,
#esp-launchpad-modal .esp-controls .form-control,
#esp-launchpad-modal .esp-controls .btn {
    flex-shrink: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #esp-launchpad-modal .modal-dialog {
        margin: 10px;
    }

    #esp-launchpad-modal .console-container {
        height: 250px;
        font-size: 11px;
    }

    #esp-launchpad-modal .modal-header .modal-title {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    #esp-launchpad-modal .esp-controls {
        width: 100%;
        justify-content: space-between;
        gap: 5px;
        margin-top: 10px;
    }

    #esp-launchpad-modal .esp-controls .btn,
    #esp-launchpad-modal .esp-controls .form-select,
    #esp-launchpad-modal .esp-controls .form-control {
        flex: 1;
        min-width: 0;
    }

    #esp-launchpad-modal .esp-controls .form-select {
        min-width: 120px;
    }

    #esp-launchpad-modal .esp-controls .form-control {
        min-width: 100px;
    }
}

@media (max-width: 576px) {
    #esp-launchpad-modal .esp-controls {
        flex-direction: column;
        gap: 8px;
    }

    #esp-launchpad-modal .esp-controls .btn,
    #esp-launchpad-modal .esp-controls .form-select,
    #esp-launchpad-modal .esp-controls .form-control {
        width: 150px;
    }
}

/* -----------------------------
   Modal-scoped Bootstrap-like helpers
   (Minimal, namespaced to #esp-launchpad-modal)
   ----------------------------- */

/* Basic modal internal layout */
#esp-launchpad-modal .modal-content {
    background-color: #fff;
    max-width: 100%;
    border-radius: 0.5rem;
    border: 1px solid rgba(0,0,0,0.125);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3), 0 1px 8px rgba(0,0,0,0.1);
}

#esp-launchpad-modal .modal-header {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
}

#esp-launchpad-modal .modal-body {
    padding: 0.5rem 0.75rem;
}

/* Buttons (small, primary/outline/secondary) */
#esp-launchpad-modal .btn {
    display: inline-block;
    font-weight: 400;
    color: #212529;
    text-align: center;
    vertical-align: middle;
    -webkit-user-select: none;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.35rem 0.6rem;
    font-size: 0.875rem;
    line-height: 1.2;
    border-radius: 0.25rem;
    cursor: pointer;
}

#esp-launchpad-modal .btn:disabled {
    border-color: #0d6efd;
    opacity: 0.65;
    cursor: not-allowed;
}

#esp-launchpad-modal .btn-sm {
    padding: 0.25rem 0.45rem;
    font-size: 0.75rem;
}

#esp-launchpad-modal .btn-primary {
    color: #fff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

#esp-launchpad-modal .btn-outline-primary {
    color: #0d6efd;
    background-color: transparent;
    border-color: #0d6efd;
}

#esp-launchpad-modal .btn-outline-secondary {
    color: #6c757d;
    background-color: transparent;
    border-color: #6c757d;
}

#esp-launchpad-modal .btn-warning {
    background-color: #ffc107; 
    border-color: #ffc107; }
#esp-launchpad-modal .btn-info {
    background-color: #0dcaf0; 
    border-color: #0dcaf0; 
}
#esp-launchpad-modal .btn-danger, 
#esp-launchpad-modal .btn-outline-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff; 
}

/* Form controls */
#esp-launchpad-modal .form-select,
#esp-launchpad-modal .form-control {
    display: inline-block;
    width: auto;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.2;
    color: #212529;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

#esp-launchpad-modal .form-control[disabled],
#esp-launchpad-modal .form-select[disabled] {
    background-color: #e9ecef;
}

/* Dropdown menu (minimal) */
#esp-launchpad-modal .dropdown {
    position: relative;
}

#esp-launchpad-modal .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 2000;
    display: none;
    min-width: 10rem;
    padding: 0.25rem 0;
    margin: 0.125rem 0 0;
    font-size: 0.875rem;
    color: #212529;
    text-align: left;
    background-color: #fff;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 0.25rem;
}

#esp-launchpad-modal .dropdown.show .dropdown-menu,
#esp-launchpad-modal .dropdown-menu.show {
    display: block;
}

#esp-launchpad-modal .dropdown-item {
    display: block;
    width: 100%;
    padding: 0.25rem 1rem;
    clear: both;
    color: #212529;
    text-decoration: none;
    background-color: transparent;
}

#esp-launchpad-modal .dropdown-item.active,
#esp-launchpad-modal .dropdown-item:active {
    background-color: #0d6efd;
    color: white;
}

/* Flex / spacing utilities scoped to modal */
#esp-launchpad-modal .d-flex { display: flex !important; }
#esp-launchpad-modal .align-items-center { align-items: center !important; }
#esp-launchpad-modal .justify-content-between { justify-content: space-between !important; }
#esp-launchpad-modal .gap-2 { gap: 0.5rem !important; }
#esp-launchpad-modal .me-1 { margin-right: 0.25rem !important; }
#esp-launchpad-modal .me-2 { margin-right: 0.5rem !important; }
#esp-launchpad-modal .py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
#esp-launchpad-modal .p-0 { padding: 0 !important; }
#esp-launchpad-modal .mx-3 { margin-left: 1rem !important; margin-right: 1rem !important; }
#esp-launchpad-modal .mt-3 { margin-top: 1rem !important; }
#esp-launchpad-modal .mb-2 { margin-bottom: .5rem !important; }
#esp-launchpad-modal .text-center { text-align: center !important; }
#esp-launchpad-modal .small { font-size: 0.875em !important; }
#esp-launchpad-modal .text-muted { color: #6c757d !important; }

/* Display helpers */
#esp-launchpad-modal .d-none { display: none !important; }
#esp-launchpad-modal .w-100 { width: 100% !important; }
#esp-launchpad-modal .mb-0 { margin-bottom: 0 !important; }
#esp-launchpad-modal .mb-3 { margin-bottom: 1rem !important; }

/* Dropdown toggle minimal caret */
#esp-launchpad-modal .dropdown-toggle::after {
    display: inline-block;
    margin-left: .255em;
    vertical-align: .255em;
    content: "";
    border-top: .3em solid;
    border-right: .3em solid transparent;
    border-left: .3em solid transparent;
}
