/**
 * 图片上传组件样式 - Story 35
 */

/* 模态框 */
.upload-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.upload-modal.show {
    display: flex;
}

.upload-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.upload-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.upload-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.upload-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
}

.upload-modal-close:hover {
    color: #333;
}

.upload-modal-body {
    padding: 20px;
}

.upload-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #eee;
}

/* 上传区域 */
.upload-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: #4a90d9;
    background: #f0f7ff;
}

.upload-zone-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-zone p {
    margin: 8px 0;
    color: #666;
}

.upload-hint {
    font-size: 12px;
    color: #999 !important;
}

/* 上传操作按钮 */
.upload-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.btn-upload-action {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-upload-action:hover {
    background: #f5f5f5;
    border-color: #4a90d9;
}

/* 预览区域 */
.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-remove:hover {
    background: rgba(220, 53, 69, 0.9);
}

.preview-size {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    text-align: center;
}

/* 设置区域 */
.upload-settings {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.upload-settings .form-group {
    margin-bottom: 16px;
}

.upload-settings label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

.upload-settings select,
.upload-settings input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.upload-settings select:focus,
.upload-settings input[type="text"]:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.visibility-options {
    display: flex;
    gap: 20px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    cursor: pointer;
}

/* 关键词标签 */
.keywords-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.keyword-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #e9ecef;
    border-radius: 4px;
    font-size: 12px;
}

.keyword-tag button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #666;
}

/* 进度条 */
.upload-progress {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a90d9, #67b26f);
    border-radius: 4px;
    transition: width 0.3s;
    width: 0%;
}

.progress-text {
    margin-top: 8px;
    text-align: center;
    font-size: 14px;
    color: #666;
}

/* 按钮 */
.btn-cancel {
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 14px;
}

.btn-cancel:hover {
    background: #f5f5f5;
}

.btn-submit {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    background: #4a90d9;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.btn-submit:hover:not(:disabled) {
    background: #3a7fc8;
}

.btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 移动端适配 */
@media (max-width: 600px) {
    .upload-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .upload-zone {
        padding: 20px;
    }
    
    .upload-icon {
        font-size: 36px;
    }
    
    .upload-actions {
        flex-direction: column;
    }
    
    .preview-item {
        width: 70px;
        height: 70px;
    }
}
