/* 上传模态框样式 - 全屏模式 */
.upload-modal {
    overflow-x: hidden;
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: white;
    z-index: 3000;
    display: none;
    overflow-y: auto;
}

.upload-modal-content {
    width: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease-out;
}

/* 容器最大宽度限制 */
.upload-container {
    width: 100%;
    max-width: 1260px;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
}

/* Logo区域样式 */
.logo-area {
    padding: 20px 0;
    text-align: center;
    background-color: #1878ff;
}

.logo-area img {
    max-width: 100%;
    height: auto;
    display: inline-block;
}

/* 面包屑导航样式 */
.breadcrumb {
    padding: 15px 0;
    color: #666;
    font-size: 14px;
}

.breadcrumb a {
    color: #0066cc;
    text-decoration: none;
    cursor: pointer;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    margin: 0 8px;
    color: #999;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.upload-header {
    position: relative;
    text-align: center;
    padding: 20px 0;
    background-color: #0066cc;
    border-bottom: none;
    /* This area functions as the logo area */
}

.upload-header h2 {
    font-size: 20px;
    color: white;
    margin: 0;
    font-weight: 500;
}

.upload-close {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    font-size: 24px;
    color: white;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.upload-close:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.upload-body {
    padding: 0;
    flex: 1;
    background-color: #f5f5f5;
}

.upload-content-wrapper {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    /* 确保内容区域不会溢出 */
    box-sizing: border-box;
    overflow: hidden;
}

.upload-form-item {
    margin-bottom: 25px;
}

.upload-form-item label {
    display: block;
    margin-bottom: 10px;
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

/* 上传区域样式 - 适用于所有上传区域（图片、视频、推荐表） */
.upload-area {
    position: relative;
    width: 100%;
    border: 2px dashed #ddd;
    border-radius: 8px;
    transition: all 0.3s ease;
    background-color: #fafafa;
    cursor: pointer;
    box-sizing: border-box;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* 上传区域状态样式 */
.upload-area.uploading {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

.upload-area.uploading * {
    cursor: not-allowed !important;
}

.upload-area:hover {
    border-color: #0078d4;
    background-color: #f0f7ff;
}

.upload-area.dragover {
    border-color: #0078d4;
    background-color: #e6f2ff;
    transform: scale(1.02);
}

.upload-area.success {
    border-color: #34c759;
    background-color: #f0fff4;
}

.upload-area.error {
    border-color: #ff3b30;
    background-color: #fff0f0;
}

.upload-icon {
    /* 确保图标在容器中精确居中 */
    font-size: 40px;
    color: #ccc;
    transition: color 0.3s ease;
    z-index: 1;
    font-weight: 300;
    line-height: 1;
    position: relative;
    text-align: center;
}

/* 交互状态样式 */
.upload-area:hover .upload-icon {
    color: #0078d4;
}

.upload-area.dragover .upload-icon {
    color: #0078d4;
}

.upload-area.success .upload-icon {
    color: #34c759;
}

.upload-area.error .upload-icon {
    color: #ff3b30;
}



/* 文件输入框基本样式 */
input[type="file"] {
    cursor: pointer;
    outline: none;
}

/* 文件输入框状态样式 */
[id$="FileInput"].success {
    border-color: #34c759;
    background-color: #f0fff4;
}

[id$="FileInput"].error {
    border-color: #ff3b30;
    background-color: #fff0f0;
}

/* 移除重复的响应式调整，统一在下方响应式区块中定义 */


/* 预览容器基础样式 */
.image-preview-container, 
.video-preview-container, 
.recommend-preview-container {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%; /* 确保容器占据全部可用宽度 */
}

/* 动态创建的预览项包装器样式 */
.preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%; /* 确保包装器占据父容器全部宽度 */
}
.preview-item,
.image-preview,
.video-thumbnail,
.recommend-preview {
    position: relative;
    width: calc(25% - 8px); /* 每行显示4个，减去间距 */
    aspect-ratio: 1/1;
    max-width: 120px;
    min-width: 80px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
}

.preview-remove:hover {
    background-color: rgba(0, 0, 0, 0.8);
}
.add-more{
font-size: 12px;
  color: #999;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
/* 响应式调整 */
@media (max-width: 768px) {
    .upload-area, #imageUploadArea, #videoUploadArea, #recommendUploadArea {
        min-height: 100px;
        padding: 30px 15px;
    }
    
    .upload-icon {
        font-size: 36px;
    }
    
    .preview-item {
        width: 80px;
        height: 80px;
    }
    
    /* 响应式调整location-select容器 */
    .location-select-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .location-select {
        width: 100%; /* 在移动端设置为100%宽度 */
        min-width: auto;
    }
    
    /* 响应式调整提示文本 */
    .input-hint-text .upload-icon {
        font-size: 40px;
    }
    
    .input-hint-text .upload-text {
        font-size: 15px;
    }
    
    .input-hint-text .upload-hint {
        font-size: 13px;
    }
}

/* 已选文件展示区域 */
.selected-file {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    display: none;
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-name {
    font-size: 14px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 15px;
}

.file-size {
    font-size: 12px;
    color: #999;
    margin-right: 15px;
}

.remove-file {
    background: none;
    border: none;
    color: #ff3b30;
    cursor: pointer;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.remove-file:hover {
    background-color: #fff0f0;
}

/* 上传状态提示 */
.upload-status {
    margin-top: 10px;
    font-size: 14px;
    text-align: center;
    display: none;
}

.upload-status.loading { color: #0078d4; }
.upload-status.success { color: #34c759; }
.upload-status.error { color: #ff3b30; }


/* 三级联动地址选择器样式 */
.location-select-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    width: 100%;
    position: relative;
}

.location-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.95);
    color: #999;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
    white-space: nowrap;
}

.location-select {
    flex: 1;
    position: relative;
    width: 33%;
    min-width: 120px;
}

/* 地址选择错误状态 */
.location-select-container.error .form-select {
    border-color: #ff4d4f;
    box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.1);
}


/* 表单输入元素统一样式 */
.form-select,
input[type="text"],
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    color: #333;
    background-color: white;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    cursor: pointer;
}

.form-select:focus,
input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.form-select:hover:not(:disabled) {
    border-color: #1878ff;
}

.form-select:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

/* 表单元素错误状态 */
.form-select.error,
input[type="text"].error,
textarea.error {
    border-color: #ff3b30;
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.1);
}

.form-select.error:focus,
input[type="text"].error:focus,
textarea.error:focus {
    border-color: #ff3b30;
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.2);
}

textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

/* 文件描述文本 */
.upload-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    margin-top: -5px;
}

/* 字符计数样式 */
.char-count {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.char-count-exceeded {
    color: #ff4444;
    font-weight: bold;
}

/* 表单操作按钮区域 */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

/* 按钮样式 */
.upload-submit-btn {
    flex: 1;
    height: 48px;
    background-color: #0078d4;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn {
    flex: 1;
    height: 48px;
    background-color: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background-color: #e0e0e0;
    border-color: #ccc;
}

.upload-submit-btn:hover:not(:disabled) {
    background-color: #005a9e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
}

.upload-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.upload-submit-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}



/* 为预览项添加背景色，保持统一的视觉效果 */
.image-preview,
.video-thumbnail,
.recommend-preview {
    background-color: #f5f5f5;
    border-radius: 8px;
}

.image-preview img,
.video-thumbnail img,
.recommend-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-thumbnail::after {
    content: '📹';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-preview {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background-color: #ff3b30;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.remove-preview:hover {
    background-color: #d70015;
    transform: scale(1.1);
}

/* 响应式设计 */
/* 统一响应式设计 */
@media screen and (max-width: 768px) {
    .upload-modal-content {
        width: 100%;
    }

    .upload-form-item {
        margin-bottom: 20px;
    }

    .form-actions {
        flex-direction: column;
        gap: 12px;
        margin-top: 25px;
    }

    .form-actions button {
        width: 100%;
    }

    .upload-body {
        padding: 10px 0;
    }

    .upload-icon {
        font-size: 40px;
    }

    .upload-text {
        font-size: 15px;
    }

    .upload-hint {
        font-size: 13px;
    }

    .location-select-container {
        flex-direction: column;
    }

    .form-select,
    input[type="text"],
    textarea {
        font-size: 15px;
        padding: 11px 14px;
    }

    .upload-submit-btn,
    .cancel-btn {
        height: 46px !important;
        font-size: 15px;
        padding: 0 16px;
        min-height: 46px;
    }
    
    /* 手机版checkbox文本样式 */
    .checkbox-text {
        font-size: 14px;
        font-weight: normal;
    }

    .image-preview,
    .video-thumbnail,
    .recommend-preview {
        width: 90px;
        height: 90px;
    }

    /* 平板设备上传区域调整 */
    .upload-area {
        min-height: 100px;
    }
}

@media screen and (max-width: 480px) {
    .upload-modal-content {
        width: 100%;
        margin: 0;
        overflow-x: hidden;
    }

    /* 修复小屏幕上的横向溢出问题 */
    .upload-container {
        padding: 0 10px;
    }

    /* 限制上传区域在小屏幕上的内边距 */
    .upload-content-wrapper {
        padding: 15px 10px;
    }

    .upload-header {
        padding: 15px 0;
    }

    .upload-header h2 {
        font-size: 18px;
    }

    .upload-close {
        width: 30px;
        height: 30px;
        font-size: 20px;
        right: 10px;
    }

    /* 保持预览容器在小屏幕上也使用自动换行布局 */
    .image-preview-container,
    .video-preview-container,
    .recommend-preview-container {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    /* 响应式调整预览项大小 - 每行显示2个 */
    .preview-item,
    .image-preview,
    .video-thumbnail,
    .recommend-preview {
        width: calc(50% - 5px);
        max-width: none;
    }

    /* 小屏幕上传区域调整 */
    .upload-area {
        min-height: 80px;
    }

    /* 小屏幕图标调整 */
    .upload-icon {
        font-size: 32px;
    }

    /* 小屏幕提示文本进一步调整 */
    .input-hint-text .upload-icon {
        font-size: 36px;
    }
}


/* 表单必填项样式 */
.upload-form-item.required label::after {
    content: ' *';
    color: #ff3b30;
}