/* 组件样式 */
.file-upload-component {
	width: 100%;
}

/* 设置区域 */
.component-settings {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	margin-bottom: 16px;
	padding-bottom: 16px;
	border-bottom: 1px solid #f0f0f0;
}

.component-setting-group {
	display: flex;
	align-items: center;
	gap: 8px;
}

.component-setting-label {
	font-size: 12px;
	color: rgba(0, 0, 0, 0.65);
	white-space: nowrap;
}

.component-size-input {
	width: 80px;
	padding: 4px 8px;
	border: 1px solid #d9d9d9;
	border-radius: 4px;
	font-size: 12px;
}

/* 切换开关 */
.component-switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 22px;
}

.component-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.component-slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #d9d9d9;
	transition: .3s;
	border-radius: 22px;
}

.component-slider:before {
	position: absolute;
	content: "";
	height: 18px;
	width: 18px;
	left: 2px;
	bottom: 2px;
	background-color: white;
	transition: .3s;
	border-radius: 50%;
}

input:checked + .component-slider {
	background-color: #1890ff;
}

input:checked + .component-slider:before {
	transform: translateX(22px);
}

/* 拖拽区域 */
.component-upload-area {
	border: 1px dashed #d9d9d9;
	border-radius: 6px;
	text-align: center;
	cursor: pointer;
	transition: all 0.3s;
	background: #fafafa;
	/* margin-bottom: 16px; */
	overflow: hidden;
	min-height: 90px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	padding: 12px;
	position: relative;
	margin: 2px;
}

.component-upload-area:hover {
	border-color: #1890ff;
}

.component-upload-area.dragover {
	border-color: #1890ff;
	background: rgba(24, 144, 255, 0.05);
}

.component-upload-area.has-file {
	border-style: solid;
	/* border-color: #1890ff; */
	background: white;
	min-height: auto;
	padding: 16px;
	justify-content: flex-start;
}

.component-upload-area.has-file:hover {
	border-color: #40a9ff;
}

/* 拖拽提示区域 */
.component-upload-prompt {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	transition: all 0.3s;
}

.component-upload-area.has-file.single-mode .component-upload-prompt {
	display: none;
}

.component-upload-icon {
	font-size: 32px;
	color: #1890ff;
	margin-bottom: 8px;
}

.component-upload-text {
	color: rgba(0, 0, 0, 0.85);
	font-size: 14px;
	margin-bottom: 4px;
}

.component-upload-hint {
	color: rgba(0, 0, 0, 0.45);
	font-size: 12px;
}

/* 单文件显示区域 */
.component-single-file-display {
	display: none;
	width: 100%;
}

.component-upload-area.has-file.single-mode .component-single-file-display {
	display: block;
}

.component-file-card {
	display: flex;
	align-items: center;
	width: 100%;
	padding: 12px;
	background: white;
	border-radius: 4px;
	position: relative;
}

.component-file-thumbnail {
	width: 60px;
	height: 60px;
	border-radius: 4px;
	object-fit: cover;
	margin-right: 12px;
	flex-shrink: 0;
	border: 1px solid #f0f0f0;
	cursor: pointer;
}

.component-file-icon-large {
	width: 60px;
	height: 60px;
	border-radius: 4px;
	background: #f0f0f0;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-right: 12px;
	flex-shrink: 0;
	font-size: 24px;
}

.component-file-info {
	flex: 1;
	overflow: hidden;
}

.component-file-name {
	color: rgba(0, 0, 0, 0.85);
	font-weight: 500;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	margin-bottom: 4px;
	text-align: left;
}

.component-file-meta {
	display: flex;
	align-items: center;
	font-size: 11px;
	color: rgba(0, 0, 0, 0.45);
	margin-bottom: 6px;
}

.component-file-size {
	margin-right: 8px;
}

.component-file-last-modified-date {
	font-weight: 500;
	font-size: 11px;
	margin-right: 8px;
}

.component-file-status {
	font-weight: 500;
	font-size: 11px;
	margin-right: 8px;
}

.component-status-uploading {
	color: #1890ff;
}

.component-status-success {
	color: #52c41a;
}

.component-single-file-delete-btn {
	background: none;
	border: none;
	cursor: pointer;
	color: rgba(0, 0, 0, 0.45);
	font-size: 16px;
	padding: 8px;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	transition: all 0.2s;
	flex-shrink: 0;
}

.component-single-file-delete-btn:hover {
	color: #ff4d4f;
	background: rgba(255, 77, 79, 0.1);
}

/* 多文件列表 */
.component-multi-file-list {
	margin-top: 16px;
}

.component-multi-file-item {
	display: flex;
	align-items: center;
	padding: 12px;
	border: 1px solid #f0f0f0;
	border-radius: 6px;
	margin-bottom: 8px;
	font-size: 13px;
	transition: all 0.2s;
}

.component-multi-file-item:hover {
	border-color: #d9d9d9;
}

.component-multi-file-thumbnail {
	width: 40px;
	height: 40px;
	border-radius: 4px;
	object-fit: cover;
	margin-right: 12px;
	flex-shrink: 0;
	border: 1px solid #f0f0f0;
	cursor: pointer;
}

.component-multi-file-icon {
	width: 40px;
	height: 40px;
	border-radius: 4px;
	background: #f0f0f0;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-right: 12px;
	flex-shrink: 0;
	font-size: 16px;
}

.component-multi-file-info {
	flex: 1;
	overflow: hidden;
}

.component-multi-file-name {
	color: rgba(0, 0, 0, 0.85);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	margin-bottom: 4px;
}

.component-multi-file-meta {
	display: flex;
	align-items: center;
	font-size: 11px;
	color: rgba(0, 0, 0, 0.45);
	margin-bottom: 4px;
}

.component-multi-file-size {
	margin-right: 8px;
}

.component-multi-file-delete-btn {
	background: none;
	border: none;
	cursor: pointer;
	color: rgba(0, 0, 0, 0.45);
	font-size: 14px;
	padding: 6px;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	transition: all 0.2s;
	flex-shrink: 0;
}

.component-multi-file-delete-btn:hover {
	color: #ff4d4f;
	background: rgba(255, 77, 79, 0.1);
}

/* 进度条 */
.component-progress-bar {
	width: 100%;
	height: 3px;
	background: #f0f0f0;
	border-radius: 1.5px;
}

.component-progress-fill {
	height: 100%;
	background: #1890ff;
	border-radius: 1.5px;
	transition: width 0.3s;
}

/* 统计信息 */
.component-stats {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	color: rgba(0, 0, 0, 0.45);
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #f0f0f0;
}

/* 空状态 */
.component-empty-state {
	text-align: center;
	padding: 16px;
	color: rgba(0, 0, 0, 0.25);
	font-size: 13px;
}

/* 错误提示 */
.component-error-text {
	font-size: 11px;
	color: #ff4d4f;
	margin-top: 4px;
}

/* 缩略图预览模态框 */
.component-preview-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.75);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s;
}

.component-preview-modal.active {
	opacity: 1;
	visibility: visible;
}

.component-preview-content {
	max-width: 80%;
	max-height: 80%;
	position: relative;
}

.component-preview-image {
	max-width: 100%;
	max-height: 80vh;
	border-radius: 8px;
}

.component-close-preview {
	position: absolute;
	top: -40px;
	right: 0;
	background: rgba(255, 255, 255, 0.1);
	border: none;
	color: white;
	font-size: 18px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.component-close-preview:hover {
	background: rgba(255, 255, 255, 0.2);
}

/* 响应式 */
@media (max-width: 768px) {
	body {
		padding: 20px;
	}
	
	.demo-container {
		flex-direction: column;
		gap: 20px;
	}
	
	.demo-section {
		padding: 16px;
	}
	
	.component-file-thumbnail,
	.component-file-icon-large {
		width: 50px;
		height: 50px;
	}
	
	.component-multi-file-thumbnail,
	.component-multi-file-icon {
		width: 36px;
		height: 36px;
	}
}

/* 隐藏原生input */
.component-file-input {
	display: none;
}

/* 动画 */
@keyframes componentFadeIn {
	from { opacity: 0; transform: translateY(-8px); }
	to { opacity: 1; transform: translateY(0); }
}

.component-fade-in {
	animation: componentFadeIn 0.3s ease;
}

/* 代码显示区 */
.code-container {
	background: #282c34;
	border-radius: 6px;
	padding: 16px;
	margin-top: 20px;
	overflow-x: auto;
}

.code-container pre {
	color: #abb2bf;
	font-family: 'Consolas', 'Monaco', monospace;
	font-size: 13px;
	line-height: 1.5;
	margin: 0;
}

.code-title {
	color: rgba(0, 0, 0, 0.85);
	font-size: 14px;
	font-weight: 500;
	margin-bottom: 8px;
}

.token.comment { color: #5c6370; }
.token.keyword { color: #c678dd; }
.token.string { color: #98c379; }
.token.function { color: #61aeee; }
.token.number { color: #d19a66; }
.token.operator { color: #56b6c2; }