/* 全局样式 */
body {
    background-color: #121212;
    color: #ffffff;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-size: 14px;
}

/* 导航栏样式 */
.navbar {
    background-color: #1e1e1e !important; 
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    height: 60px;
    border-bottom: 1px solid #333;
}

.navbar-light .navbar-text,
.navbar-light .navbar-brand .fas {
    color: #ffffff;
}

.navbar-right {
    margin: 0 10px;
    padding: 5px;
}

/* 主布局 */
.main-container {
    display: flex;
    margin-top: 60px;
    height: calc(100vh - 60px); 
}

/* --------------------------------------------- */
/* 左侧边栏 */
.sidebar {
    background-color: #1e1e1e;
    height: 100%;
    width: 280px;
    position: fixed;
    overflow-y: auto;
    border: 1px solid #333;
    flex-grow:1;
    left: 0;
    z-index: 1000;

}

/* 功能卡片样式增强 */
.feature-card {
    align-items: center;
    margin: 10px;
    padding: 10px; 
    cursor: move;
    background: #2a2a2a;
    border-radius: 10px;
}

.feature-card-div{
    display: flex;
    justify-content: space-between;
    align-items: center;

}



/* --------------------------------------------- */
/*2 中间 主内容区 */
.main-content {
    margin-left: 280px;  
    margin-right: 320px; 
    padding: 0px 10px;
    flex-grow:2;
    background-color: #121212;
    min-height: calc(100vh - 60px);  
    padding: 20px;
}

/*21 上传区域 */
.upload-area {
    border: 2px dashed #333;
    border-radius: 8px;
    padding: 30px;
    background: #1e1e1e;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    position: relative;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: #0d6efd;
    background: #2a2a2a;
}

.upload-area.has-file {
    border-color: #198754;
    background: #1a2e22;
    align-items: flex-start;
    gap: 30px;
    cursor: default;
}

.upload-initial {
    text-align: center;
    width: 100%;
}

.upload-initial h4 {
    color: #fff;
    margin-bottom: 15px;
}

.upload-initial p {
    color: #aaa;
}

.replace-video-btn {
    position: absolute;
    top: 20px;

}
/*22 视频预览区域 */
.video-container {
    flex: 0 0 60%;
    text-align: center;
    margin: 20px 0;
}

.video-preview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    background: #2a2a2a;
}


/*23 工作区 */
.form-control, .form-select {
    background-color: #2d2d2d;
    border-color: #333;
    color: #ffffff;
}

.form-control:focus, .form-select:focus {
    background-color: #2d2d2d;
    border-color: #0d6efd;
    color: #ffffff;
    box-shadow: none;
}

/* 工作区样式优化 */
.workspace {
    background-color: #1a1a1a;
    border: 2px dashed #333;
    border-radius: 12px;
    padding: 25px;
    min-height: 100px;   
    margin: 20px 0;
    position: relative;
    transition: all 0.3s ease;
}

.workspace.dragover {
    border-color: #0d6efd;
    background: #1e2430;
    box-shadow: 0 0 15px rgba(13, 110, 253, 0.1);
}

.workspace-title {
    color: #aaa;
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.1em;
    letter-spacing: 0.5px;
}

.workspace.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.workspace.empty::after {
    content: '拖拽功能卡片到此处';
    color: #666;
    font-size: 0.9em;
}

/* 工作区内功能卡片样式 */
.feature-card.in-workspace {
    background: #242424;
    border: 1px solid #333;
    margin: 12px;
    padding: 15px;
    border-radius: 8px;
    cursor: default;
    position: relative;
    transition: all 0.3s ease;
}

.feature-card.in-workspace:hover {
    background: #2a2a2a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.feature-card.in-workspace .feature-card-div {
    padding: 8px;
    margin: -5px;
    border-radius: 6px;
}

/* 修改关闭按钮样式，使其始终显示 */
.feature-card.in-workspace .close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 13px;
    background: #dc3545;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 1; /* 改为始终显示 */
}

.feature-card.in-workspace:hover .close-btn {
    /* 移除hover时的显示控制 */
    background: #bb2d3b;
    transform: scale(1.1);
}

.feature-card.in-workspace .close-btn:hover {
    background: #bb2d3b;
    transform: scale(1.1) rotate(90deg);
}

/* 工作区内的表单控件 */
.workspace .form-control,
.workspace .form-select,
.workspace .input-group-text {
    background-color: #1e1e1e;
    border-color: #333;
    color: #fff;
}

.workspace .form-control:focus,
.workspace .form-select:focus {
    background-color: #242424;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

/* 拖拽效果 */
.dragging {
    opacity: 0.6;
    transform: scale(1.05);
    pointer-events: none;
}

/* 放置指示器 */
.drop-indicator {
    height: 2px;
    background-color: #0d6efd;
    margin: 10px 0;
    transition: all 0.2s ease;
    opacity: 0;
}

.drop-indicator.active {
    opacity: 1;
    height: 4px;
}

/* 工作区内的表单控件 */
.card{
    background-color:#2a2a2a;
}

.workspace .form-control,
.workspace .form-select {
    background-color: #232323;
    border-color: #444;
    color: #fff;
    transition: all 0.3s ease;
}

.workspace .form-control:focus,
.workspace .form-select:focus {
    background-color: #2a2a2a;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
}

/*25 进度条样式 */
.progress {
    height: 25px;
    background-color: #2a2a2a;
    border-radius: 8px;
    margin: 15px 0;
}

.progress-bar {
    background-color: #0d6efd;
    border-radius: 8px;
    transition: width 0.3s ease;
}

/* 文件信息卡片 */
.file-info {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.file-info-item {
    display: flex;
    align-items: center;
    margin: 10px 0;
    color: #aaa;
}

.file-info-item i {
    width: 20px;
    margin-right: 10px;
    color: #0d6efd;
}




/* 操作按钮组 */
.action-buttons1 {
    display: flex;
    gap: 10px;
    /* margin: 20px 35%;     */
    align-items: center;
    justify-content: center;  
}

.action-buttons1 .btn {
    
    align-items: center;
    justify-content: space-evenly;  
    gap: 5px;
    width: 200px; 
    font-size: 14px;   
}


/* 错误提示样式 */
.error-message {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 0.9em;
}

.feature-card.in-workspace {
    background: #2a2a2a;
    border-color: #444;
    margin: 10px;
    cursor: default;
}




/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}



/*24 按钮样式 */
.btn-primary {
    background-color: #0d6efd;
    border: none;
}

.btn-outline-light {
    color: #fff;
    border-color: #fff;
}


.action-buttons1 {
    flex-direction: column; 
    gap: 8px;
}


.action-buttons1 .btn {
    width: 100%;
    padding: 8px;
}   




/* --------------------------------------------- */
/* 右侧边栏 */
.right-sidebar {
    background-color: #1e1e1e;
    height: 100%;
    width: 320px;
    position: fixed;
    overflow-y: auto; 
    border: 1px solid #333;
    flex-grow:1;
    right: 0;
    z-index: 1000;
}


.video-name { 
    display: flex;
    justify-content: space-between;
    padding: 5px; 
    margin: 5px;
}


.action-buttons button,.action-buttons a { 
    font-size: 12px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    /* margin: 20px 35%; */   
}

.action-buttons .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}


/* 下载历史 */
.download-item {
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.info-card {
    background-color: #1e1e1e;
    /* border: 1px solid #333; */
    border-radius: 8px;
    /* padding: 15px; */
    margin-bottom: 15px; 
}


 /* 添加移动端样式 */
 @media (max-width: 768px) {

    .sidebar.show,
    .right-sidebar.show {
        display: block !important;
        position: fixed;
        /* top: 60px; */ 
        bottom: 0;
        z-index: 1000;
        overflow-y: auto; 
       
    }

    .sidebar.show {
        left: 0;
        width: 80%;
    }

    .right-sidebar.show {
        right: 0;
        width: 80%;
    }

    .overlay.show {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .toggle {
        
        border: 1px solid #333;
        position: fixed;
        top: 50px;
        display: flex;
        justify-content: space-between;
        z-index: 10000;
        background-color: #1e1e1e;
    }

    .sidebar,
    .right-sidebar {
        display: none;
        width: 100%;
    }

    .main-content {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }


    .text-truncate {
        max-width: 10ch;
        display: inline-block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* 移动端适配优化 */
@media (max-width: 768px) {
    /* 导航栏适配 */
    .navbar {
        padding: 5px 10px;
    }

    .navbar-brand {
        font-size: 1.1em;
    }

    /* 侧边栏切换按钮组 */
    .toggle {
        width: 100%;
        border-bottom: 1px solid #333;
        position: fixed;
        top: 60px;
        display: flex;
        justify-content: center;
        gap: 10px;
        padding: 8px;
        z-index: 1000;
        background-color: #1a1a1a;
    }

    .toggle button {
        flex: 1;
        max-width: 150px;
        font-size: 0.9em;
        padding: 6px 12px;
    }

    /* 侧边栏响应式样式 */
    .sidebar {
        display: none;
        width: 50%;  
        height: calc(100vh - 110px);
        top: 110px;
        position: fixed;
        z-index: 999;
        padding: 15px;
        transition: transform 0.3s ease;
    }

    .right-sidebar { 
        display: none;
        width: 80%;  
        height: calc(100vh - 110px);
        top: 110px;
        position: fixed;
        z-index: 999;
        padding: 15px;
        transition: transform 0.3s ease;
    }

    .sidebar.show {
        display: block;
        transform: translateX(0);
    }

    .right-sidebar.show {
        display: block;
        transform: translateX(0);
    }

    /* 主内容区域适配 */
    .main-content {
        margin: 110px 0 0 0;
        padding: 15px;
        width: 100%;
    }

    /* 上传区域适配 */
    .upload-area {
        padding: 0px;
    }

    .upload-initial h4 {
        font-size: 1.1em;
    }

    /* 工作区适配 */
    .workspace {
        padding: 15px;
        margin: 15px 0;
    }

    .feature-card.in-workspace {
        margin: 8px 0;
    }


    .replace-video-btn{
        position: relative; 
        top: 0;
    }
    .action-buttons1 .btn{
        display:0;
    }



    /* 表单控件适配 */
    .form-control,
    .form-select {
        font-size: 16px; /* 防止iOS自动缩放 */
        padding: 8px;
    }

    /* 视频预览区域适配 */
    .video-container {
        margin: 10px 0;
    }

    .video-preview {
        max-height: 300px;
    }

    /* 历史记录项适配 */
    .download-item {
        padding: 10px;
        margin-bottom: 8px;
    }

    .video-name {
        display: flex;
        justify-content: space-between;
        padding: 5px; 
        margin: 5px;  
    }

    /* 文本截断优化 */
    .text-truncate {
        max-width: 200px;
    }
}

/* 移动端侧边栏滑动效果 */
@media (max-width: 768px) {
    /* 侧边栏基础样式 */
    .sidebar,
    .right-sidebar {
        position: fixed;
        top: 110px;
        height: calc(100vh - 110px);
        width: 85%;
        padding: 15px;
        z-index: 1001;
        transition: transform 0.3s ease-in-out;
        display: block; /* 改为block，用transform控制显示 */
        background-color: #1e1e1e;
    }

    /* 左侧边栏定位和动画 */
    .sidebar {
        left: 0;
        transform: translateX(-100%);
        border-right: 1px solid #333;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
    }

    /* 右侧边栏定位和动画 */
    .right-sidebar {
        right: 0;
        transform: translateX(100%);
        border-left: 1px solid #333;
        box-shadow: -2px 0 5px rgba(0, 0, 0, 0.3);
    }

    /* 显示状态的样式 */
    .sidebar.show {
        transform: translateX(0);
        visibility: visible;
    }

    .right-sidebar.show {
        transform: translateX(0);
        visibility: visible;
    }

    /* 遮罩层样式 */
    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .overlay.show {
        display: block;
        opacity: 1;
    }

    /* 切换按钮样式 */
    .toggle {
        width: 100%;
        position: fixed;
        top: 60px;
        left: 0;
        padding: 8px;
        background-color: #1a1a1a;
        border-bottom: 1px solid #333;
        z-index: 999;
        display: flex;
        justify-content: space-around;
        gap: 10px;
    }

    .toggle button {
        flex: 1;
        max-width: 150px;
        padding: 8px 15px;
        font-size: 0.9em;
        border-radius: 4px;
        background-color: #2d2d2d;
        color: #fff;
        border: 1px solid #333;
    }

    .toggle button.active {
        background-color: #0d6efd;
        border-color: #0d6efd;
    }

    /* 主内容区域适配 */
    .main-content {
        margin: 110px 0 0 0;
        padding: 15px;
        width: 100%;
        transition: transform 0.3s ease-in-out;
    }
}

/* 小屏幕设备额外优化 */
@media (max-width: 480px) {
    .sidebar,
    .right-sidebar {
        width: 90%;
    }

    .main-content.sidebar-open {
        transform: translateX(90%);
    }

    .main-content.rightbar-open {
        transform: translateX(-90%);
    }
}

/* 小屏幕设备额外优化 */
@media (max-width: 480px) {
    .navbar {
        height: 50px;
    }

    .toggle {
        top: 50px;
    }

    .main-content {
        margin-top: 100px;
        padding: 10px;
    }

    .action-buttons1 .btn {
        font-size: 0.9em;
    }

    .feature-card-div i {
        font-size: 1.5em;
    }
}

/* 小屏幕额外优化 */
@media (max-width: 480px) {
    .sidebar,
    .right-sidebar {
        width: 100%;
    }

    .toggle button {
        font-size: 0.8em;
        padding: 6px 12px;
    }
}
