/* Baijia Reviews Widget Styles */

.baijia-reviews-widget {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	padding: 20px 0;
}

/* 头部 */
.baijia-reviews-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 30px;
	padding-bottom: 20px;
	border-bottom: 1px solid #e0e0e0;
}

.baijia-reviews-summary {
	flex: 1;
}

.baijia-reviews-rating-display {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 8px;
}

.baijia-reviews-count {
	font-size: 14px;
	color: #666;
}

.baijia-reviews-showing {
	font-size: 13px;
	color: #999;
}

/* 星星评分 */
.baijia-stars {
	display: inline-flex;
	gap: 2px;
	font-size: 18px;
	line-height: 1;
}

.baijia-stars .star {
	color: #ddd;
}

.baijia-stars .star.full {
	color: #ffc107;
}

.baijia-stars .star.half {
	color: #ffc107;
	position: relative;
	overflow: hidden;
}

.baijia-stars .star.half::before {
	content: '★';
	position: absolute;
	left: 0;
	width: 50%;
	overflow: hidden;
	color: #ffc107;
}

/* 写评论按钮 */
.baijia-write-review-btn {
	display: inline-block;
	padding: 10px 24px;
	background-color: #8d7a6a;
	color: #fff !important;
	border: none;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.3s ease;
	white-space: nowrap;
	text-decoration: none;
}

.baijia-write-review-btn:hover {
	background-color: #6d5a4a;
	color: #fff !important;
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	text-decoration: none;
}

/* 评论列表 */
.baijia-reviews-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
	margin-bottom: 20px;
}

.baijia-review-item {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 16px;
	display: flex;
	gap: 12px;
	transition: box-shadow 0.3s ease;
}

.baijia-review-item:hover {
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* 头像 */
.baijia-review-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 18px;
	font-weight: 600;
	flex-shrink: 0;
}

/* 评论内容 */
.baijia-review-content {
	flex: 1;
	min-width: 0;
}

.baijia-review-author {
	font-weight: 600;
	font-size: 14px;
	color: #333;
	margin-bottom: 4px;
}

.baijia-review-rating {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}

.baijia-review-rating .baijia-stars {
	font-size: 14px;
}

.baijia-verified {
	color: #4caf50;
	font-size: 16px;
}

.baijia-review-title {
	font-size: 14px;
	font-weight: 600;
	color: #333;
	margin: 0 0 8px 0;
}

.baijia-review-text {
	font-size: 13px;
	line-height: 1.6;
	color: #666;
	margin-bottom: 10px;
}

.baijia-review-text p {
	margin: 0 0 8px 0;
}

.baijia-review-text p:last-child {
	margin-bottom: 0;
}

/* 评论图片 */
.baijia-review-images {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 10px;
}

.baijia-review-image {
	width: 60px;
	height: 60px;
	border-radius: 6px;
	overflow: hidden;
	border: 1px solid #e0e0e0;
	display: block;
	transition: transform 0.3s ease;
}

.baijia-review-image:hover {
	transform: scale(1.05);
}

.baijia-review-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* 无评论 */
.baijia-no-reviews {
	text-align: center;
	padding: 40px;
	color: #999;
	font-size: 14px;
}

/* 评论弹窗 */
.baijia-review-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 99999;
	display: none;
}

.baijia-review-modal.active {
	display: flex;
	align-items: center;
	justify-content: center;
}

.baijia-review-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(2px);
}

.baijia-review-modal-content {
	position: relative;
	width: 330px;
	max-width: calc(100% - 40px);
	max-height: calc(100vh - 40px);
	background: #fff;
	border-radius: 0;
	padding: 24px;
	overflow-y: auto;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
	animation: slideUp 0.3s ease;
}

@keyframes slideUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.baijia-review-modal-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 32px;
	height: 32px;
	background: #f5f5f5;
	border: none;
	border-radius: 50%;
	font-size: 20px;
	line-height: 1;
	color: #666;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.baijia-review-modal-close:hover {
	background: #e0e0e0;
	color: #333;
}

.baijia-review-modal h3 {
	margin: 0 0 20px 0;
	font-size: 18px;
	font-weight: 600;
	color: #333;
}

/* 表单样式 */
.baijia-review-form {
	display: flex;
	flex-direction: column;
	gap: 7px;
}

.baijia-form-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.baijia-form-field label {
	font-size: 13px;
	font-weight: 500;
	color: #333;
}

.baijia-form-field .required {
	color: #f44336;
}

.baijia-form-field input[type="text"],
.baijia-form-field input[type="email"],
.baijia-form-field textarea {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 13px;
	font-family: inherit;
	transition: all 0.3s ease;
	box-sizing: border-box;
}

.baijia-form-field input:focus,
.baijia-form-field textarea:focus {
	outline: none;
	border-color: #8d7a6a;
	box-shadow: 0 0 0 3px rgba(141, 122, 106, 0.1);
}

.baijia-form-field textarea {
	resize: vertical;
	min-height: 80px;
}

/* 评分输入 */
.baijia-rating-input {
	display: flex;
	flex-direction: row-reverse;
	justify-content: flex-end;
	gap: 4px;
}

.baijia-rating-input input[type="radio"] {
	display: none;
}

.baijia-rating-input label {
	font-size: 28px;
	color: #ddd;
	cursor: pointer;
	transition: all 0.2s ease;
	margin: 0;
}

.baijia-rating-input label:hover,
.baijia-rating-input label:hover ~ label,
.baijia-rating-input input[type="radio"]:checked ~ label {
	color: #ffc107;
}

/* 图片上传按钮 */
.baijia-upload-trigger {
	width: 100%;
	padding: 12px;
	border: 2px dashed #ddd;
	border-radius: 6px;
	background: #fafafa;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-size: 13px;
	color: #666;
	font-weight: 500;
}

.baijia-upload-trigger:hover {
	border-color: #8d7a6a;
	background: #fff;
	color: #8d7a6a;
}

.baijia-upload-trigger:hover .upload-icon {
	stroke: #8d7a6a;
}

.baijia-upload-trigger .upload-icon {
	width: 20px;
	height: 20px;
	stroke: #666;
	transition: stroke 0.3s ease;
}

.baijia-upload-trigger .upload-text {
	font-size: 13px;
}

.baijia-image-preview {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 12px;
}

.baijia-image-preview-item {
	position: relative;
	width: 80px;
	height: 80px;
	border-radius: 6px;
	border: 2px solid #e0e0e0;
	transition: all 0.3s ease;
}

.baijia-image-preview-item:hover {
	border-color: #8d7a6a;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.baijia-image-preview-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 4px;
}

.baijia-image-preview-remove {
	position: absolute;
	top: -8px;
	right: -8px;
	width: 22px;
	height: 22px;
	background: #f44336;
	color: #fff;
	border: 2px solid #fff;
	border-radius: 50%;
	font-size: 14px;
	line-height: 18px;
	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;
}

.baijia-image-preview-remove:hover {
	background: #d32f2f;
	transform: scale(1.1);
}

/* 骨架加载动画 */
.baijia-image-preview-item.baijia-skeleton {
	position: relative;
	overflow: hidden;
	background: #f0f0f0;
}

.baijia-skeleton .skeleton-loader {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	overflow: hidden;
}

.baijia-skeleton .skeleton-pulse {
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(
		90deg,
		transparent,
		rgba(255, 255, 255, 0.6),
		transparent
	);
	animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
	0% {
		left: -100%;
	}
	50% {
		left: 100%;
	}
	100% {
		left: 100%;
	}
}

/* 表单操作 */
.baijia-form-actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 8px;
}

.baijia-submit-review {
	width: 100%;
	padding: 12px;
	background: #8d7a6a;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.3s ease;
}

.baijia-submit-review:hover {
	background: #6d5a4a;
}

.baijia-submit-review:disabled {
	background: #ccc;
	cursor: not-allowed;
}

.baijia-form-message {
	padding: 10px;
	border-radius: 6px;
	font-size: 13px;
	text-align: center;
	display: none;
}

.baijia-form-message.success {
	display: block;
	background: #e8f5e9;
	color: #2e7d32;
	border: 1px solid #81c784;
}

.baijia-form-message.error {
	display: block;
	background: #ffebee;
	color: #c62828;
	border: 1px solid #ef5350;
}

/* 响应式 */
@media (max-width: 768px) {
	.baijia-reviews-list {
		grid-template-columns: 1fr;
	}
	
	.baijia-reviews-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 16px;
	}
	
	.baijia-write-review-btn {
		width: 100%;
	}
	
	.baijia-review-modal-content {
		width: 100%;
		max-width: calc(100% - 20px);
	}
}

/* 编辑器提示 */
.baijia-reviews-notice {
	padding: 20px;
	background: #fff3cd;
	border: 1px solid #ffc107;
	border-radius: 8px;
	color: #856404;
	text-align: center;
}

