/* 文件列表简洁样式 */
.file-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
}

.file-item:hover {
    background-color: #f5f7fa;
}

.file-item:last-child {
    border-bottom: none;
}

.filename {
    flex: 1;
    margin-left: 8px;
    cursor: pointer;
    word-break: break-word;
    white-space: normal;
    line-height: 1.4;
}

.filename:hover {
    color: #409eff;
}

.file-size {
    color: #909399;
    font-size: 12px;
    margin-left: 8px;
}

.folder-section {
    margin: 20px 0;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* 面包屑导航样式 */
.breadcrumb-section {
    margin: 10px 0;
    background: #f8f9fa;
}

.breadcrumb-section .el-card__body {
    padding: 12px 20px;
}

/* 表格样式优化 */
.file-table {
    font-size: 13px;
    width: 100%;
    table-layout: auto;
}

.file-table .el-table__body-wrapper {
    overflow-x: auto;
}

/* 移动端优化 */
@media (max-width: 768px) {
    /* 整体容器优化 */
    #app {
        padding: 10px;
    }
    
    /* 表格容器优化 */
    .folder-section {
        margin-bottom: 10px;
    }
    
    .folder-section .el-card__body {
        padding: 10px;
    }
    
    /* 表格样式重置 */
    .file-table {
        font-size: 12px;
    }
    
    .file-table .el-table__header-wrapper,
    .file-table .el-table__body-wrapper {
        overflow-x: auto;
    }
    
    /* 表格头部优化 */
    .file-table .el-table__header th {
        background-color: #f8f9fa !important;
        font-weight: 600;
        font-size: 11px;
        padding: 6px 4px !important;
    }
    
    /* 表格边框优化 */
    .file-table .el-table--border {
        border: 1px solid #e4e7ed;
    }
    
    .file-table .el-table--border td,
    .file-table .el-table--border th {
        border-right: 1px solid #ebeef5;
    }
    
    /* 选择列优化 */
    .file-table .el-table__header th:nth-child(1),
    .file-table .el-table__body td:nth-child(1) {
        padding: 8px 4px !important;
        text-align: center;
    }
    
    /* 图标列优化 */
    .file-table .el-table__header th:nth-child(2),
    .file-table .el-table__body td:nth-child(2) {
        padding: 8px 4px !important;
        text-align: center;
    }
    
    /* 文件名列优化 - 完全自适应，不限制宽度 */
    .file-table .el-table__header th:nth-child(3),
    .file-table .el-table__body td:nth-child(3) {
        padding: 8px 6px !important;
    }
    
    /* 大小列 */
    .file-table .el-table__header th:nth-child(4),
    .file-table .el-table__body td:nth-child(4) {
        padding: 8px 4px !important;
        text-align: right;
        font-size: 11px;
    }
    
    /* 操作列 - 固定在右侧 */
    .file-table .el-table__header th:nth-child(5),
    .file-table .el-table__body td:nth-child(5) {
        padding: 8px 4px !important;
        text-align: center;
        position: sticky;
        right: 0;
        background-color: #fff;
        z-index: 10;
        border-left: 1px solid #ebeef5;
    }
    
    /* 按钮优化 */
    .file-table .el-button--mini {
        padding: 4px 6px;
        font-size: 10px;
        min-width: auto;
        border-radius: 3px;
        min-height: 28px;
        line-height: 1.2;
        touch-action: manipulation;
    }
    
    /* 按钮文字在移动端的优化 */
    .file-table .el-button--mini .el-icon-folder-opened,
    .file-table .el-button--mini .el-icon-download {
        margin-right: 2px;
    }
    
    /* 行高优化 - 自适应高度 */
    .file-table .el-table__row {
        height: auto;
        min-height: 40px;
    }
    
    .file-table .el-table__header-wrapper .el-table__header {
        height: 32px;
    }
    
    .file-table .el-table__body td {
        padding: 8px 4px;
        vertical-align: middle;
    }
    
    /* 文件名显示优化 - 完整显示，不截断 */
    .file-table .el-table__body td:nth-child(3) span {
        display: block;
        font-size: 12px;
        word-break: break-word;
        white-space: normal;
        line-height: 1.4;
    }
    
    /* 面包屑导航优化 */
    .breadcrumb-section {
        margin: 8px 0;
    }
    
    .breadcrumb-section .el-card__body {
        padding: 8px 12px;
    }
    
    .breadcrumb-section .el-breadcrumb__item {
        font-size: 11px;
    }
    
    .breadcrumb-section .el-breadcrumb__inner {
        font-size: 11px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 120px;
        display: inline-block;
    }
    
    /* 表单区域优化 */
    .r-form {
        padding: 10px;
    }
    
    .r-field {
        margin-bottom: 12px;
    }
    
    .r-field label {
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    .r-input {
        font-size: 12px;
        padding: 6px 8px;
    }
}

@media (max-width: 480px) {
    /* 超小屏幕优化 */
    .file-table {
        max-height: calc(100vh - 250px) !important;
    }
    
    .file-table .el-table__body-wrapper {
        max-height: calc(100vh - 300px) !important;
    }
    
    /* 图标列正常显示 */
    
    /* 表格列自适应设置 */
    .el-table .el-table__header-wrapper th,
    .el-table .el-table__body-wrapper td {
        padding: 8px 4px !important;
    }
    
    /* 选择列紧凑显示 */
    .el-table .el-table__header-wrapper th:nth-child(1),
    .el-table .el-table__body-wrapper td:nth-child(1) {
        padding: 0 !important;
    }
    
    .el-button--mini {
        padding: 2px 4px;
        font-size: 10px;
        min-height: 24px;
    }
    
    /* 文件名显示优化 */
    .el-table .el-table__body-wrapper td:nth-child(3) span {
        font-size: 12px;
        line-height: 1.2;
        display: block;
        word-break: break-all;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }
    
    /* 面包屑进一步优化 */
    .breadcrumb-section .el-breadcrumb__item {
        max-width: 60px;
    }
    
    .breadcrumb-section .el-breadcrumb__item .el-breadcrumb__inner {
        font-size: 11px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 50px;
        display: inline-block;
    }
    
    /* 表格行高优化 */
    .file-table .el-table__row {
        height: 40px !important;
    }
    
    .file-table .el-table__row td {
        padding: 4px 0 !important;
    }
    
    /* 表格头部优化 */
    .file-table .el-table__header-wrapper th {
        padding: 8px 0 !important;
        font-size: 11px;
    }
}

/* 下载弹窗样式 */
.download-dialog {
    max-height: 90vh;
}

.download-loading {
    margin-bottom: 20px;
}

.download-loading .el-icon-loading {
    animation: rotating 2s linear infinite;
}

@keyframes rotating {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.download-dialog .el-dialog__body {
    max-height: 70vh;
    overflow-y: auto;
    padding: 20px;
}

/* 弹窗内滚动条美化 */
.download-dialog .el-dialog__body::-webkit-scrollbar {
    width: 6px;
}

.download-dialog .el-dialog__body::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 3px;
}

.download-dialog .el-dialog__body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
    transition: background 0.3s ease;
}

.download-dialog .el-dialog__body::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.download-item {
    margin-bottom: 20px;
}

.download-item:last-child {
    margin-bottom: 0;
}

.download-card {
    border: 1px solid #e4e7ed;
    border-radius: 8px;
}

.download-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.download-header h4 {
    margin: 0;
    color: #303133;
    font-size: 16px;
    word-break: break-all;
    flex: 1;
    min-width: 200px;
}

.file-info {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ua-info {
    margin-bottom: 15px;
}

.ua-info label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #606266;
}

.ua-input {
    width: 100%;
}

.download-url-section {
    margin-bottom: 15px;
}

.url-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 10px;
}

.url-controls label {
    font-weight: 600;
    color: #606266;
    margin: 0;
}

.url-switch-buttons {
    display: flex;
    gap: 5px;
}

.download-url-input {
    width: 100%;
}

.download-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.download-actions .el-button {
    margin: 0;
}

/* 手机端弹窗优化 */
@media (max-width: 768px) {
    .download-dialog {
        margin: 0 auto;
    }
    
    .download-dialog .el-dialog {
        margin-top: 5vh !important;
        margin-bottom: 5vh !important;
    }
    
    .download-dialog .el-dialog__body {
        padding: 10px;
        max-height: 75vh;
    }
    
    .download-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .download-header h4 {
        font-size: 14px;
        min-width: auto;
        width: 100%;
    }
    
    .file-info {
        width: 100%;
        justify-content: flex-start;
    }
    
    .url-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .url-switch-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .download-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .download-actions .el-button {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .download-actions .el-button:last-child {
        margin-bottom: 0;
    }
    
    .ua-input .el-input-group__append,
    .download-url-input .el-input-group__append {
        padding: 0 10px;
    }
    
    .ua-input .el-button,
    .download-url-input .el-button {
        font-size: 12px;
        padding: 0 8px;
    }
}

@media (max-width: 480px) {
    /* 超小屏幕优化 */
    #app {
        padding: 5px;
    }
    
    /* 表格进一步优化 */
    .file-table {
        font-size: 11px;
    }
    
    /* 复选框列 - 超小屏幕 */
    .file-table .el-table__header th:nth-child(1),
    .file-table .el-table__body td:nth-child(1) {
        padding: 6px 2px !important;
        text-align: center;
    }
    
    /* 图标列 - 超小屏幕 */
    .file-table .el-table__header th:nth-child(2),
    .file-table .el-table__body td:nth-child(2) {
        padding: 6px 2px !important;
        text-align: center;
    }
    
    /* 文件名列 - 超小屏幕完全自适应 */
    .file-table .el-table__header th:nth-child(3),
    .file-table .el-table__body td:nth-child(3) {
        padding: 6px 4px !important;
    }
    
    /* 大小列 - 超小屏幕 */
    .file-table .el-table__header th:nth-child(4),
    .file-table .el-table__body td:nth-child(4) {
        padding: 6px 2px !important;
        text-align: right;
        font-size: 10px;
    }
    
    /* 操作列 - 超小屏幕 */
    .file-table .el-table__header th:nth-child(5),
    .file-table .el-table__body td:nth-child(5) {
        padding: 6px 2px !important;
        text-align: center;
        position: sticky;
        right: 0;
        background-color: #fff;
        z-index: 10;
        border-left: 1px solid #ebeef5;
    }
    
    /* 按钮进一步缩小 */
    .file-table .el-button--mini {
        padding: 2px 4px;
        font-size: 9px;
        min-width: auto;
        border-radius: 2px;
    }
    
    /* 行高调整 - 超小屏幕自适应 */
    .file-table .el-table__row {
        height: auto;
        min-height: 36px;
    }
    
    .file-table .el-table__header-wrapper .el-table__header {
        height: 28px;
    }
    
    /* 文件名字体调整 - 超小屏幕完整显示 */
    .file-table .el-table__body td:nth-child(3) span {
        font-size: 11px;
        word-break: break-word;
        white-space: normal;
        line-height: 1.3;
    }
    
    /* 面包屑进一步优化 */
    .breadcrumb-section .el-card__body {
        padding: 6px 8px;
    }
    
    .breadcrumb-section .el-breadcrumb__item {
        font-size: 10px;
    }
    
    .breadcrumb-section .el-breadcrumb__inner {
        font-size: 10px;
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
    }
    
    /* 表单区域进一步优化 */
    .r-form {
        padding: 8px;
    }
    
    .r-field {
        margin-bottom: 10px;
    }
    
    .r-field label {
        font-size: 11px;
    }
    
    .r-input {
        font-size: 11px;
        padding: 5px 6px;
    }
    
    /* 按钮组优化 */
    .r-field .el-button {
        padding: 8px 12px;
        font-size: 12px;
        margin: 2px;
    }
    
    /* 下载弹窗优化 */
    .download-dialog {
    }
    
    .download-dialog .el-dialog__header {
        padding: 15px 15px 0;
    }
    
    .download-dialog .el-dialog__body {
        padding: 5px;
    }
    
    .download-card .el-card__body {
        padding: 10px;
    }
    
    .download-header h4 {
        font-size: 13px;
    }
    
    .file-info .el-tag {
        font-size: 10px;
        padding: 0 4px;
        height: 20px;
        line-height: 18px;
    }
    
    .url-switch-buttons .el-button--mini {
        padding: 2px 4px;
        font-size: 10px;
    }
}