/**
 * 分享面板 - 底部浮层（淘宝风格）
 * 用于详情页和沙箱页的分享功能
 */

/* ===== 遮罩层 ===== */
.share-panel-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 99990;
	display: none;
	opacity: 0;
	transition: opacity 0.3s ease;
	align-items: flex-end;
	justify-content: center;
}
.share-panel-overlay.is-visible {
	display: flex;
}
.share-panel-overlay.is-active {
	opacity: 1;
}

/* ===== 底部面板 ===== */
.share-panel-sheet {
	width: 100%;
	max-width: 500px;
	background: #fff;
	border-radius: 16px 16px 0 0;
	padding: 0 0 env(safe-area-inset-bottom, 16px);
	transform: translateY(100%);
	transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
	box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
}
.share-panel-overlay.is-active .share-panel-sheet {
	transform: translateY(0);
}

/* ===== 头部 ===== */
.share-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px 12px;
	border-bottom: 1px solid #f0f0f0;
}
.share-panel-title {
	font-size: 1rem;
	font-weight: 600;
	color: #1a1a1a;
}
.share-panel-close {
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	background: #f5f5f5;
	border-radius: 50%;
	color: #666;
	cursor: pointer;
	padding: 0;
	transition: background 0.2s;
}
.share-panel-close:hover {
	background: #e8e8e8;
}

/* ===== 分享选项网格 ===== */
.share-panel-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
	padding: 20px 16px;
}

/* ===== 单个选项 ===== */
.share-panel-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 12px 4px;
	border: none;
	background: none;
	cursor: pointer;
	border-radius: 12px;
	transition: background 0.2s;
}
.share-panel-item:hover,
.share-panel-item:active {
	background: #f8f9fa;
}

/* ===== 图标圆圈 ===== */
.share-panel-icon {
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: #f5f5f5;
	color: #555;
	transition: transform 0.2s;
}
.share-panel-item:active .share-panel-icon {
	transform: scale(0.92);
}

/* 各平台图标颜色 */
.share-icon-copy { background: #e8f4fd; color: #1890ff; }
.share-icon-wechat { background: #e8f8e8; color: #07C160; }
.share-icon-qq { background: #e8f0fe; color: #12B7F5; }
.share-icon-weibo { background: #fce8e8; color: #E6162D; }
.share-icon-qrcode { background: #f0e8fd; color: #7B61FF; }
.share-icon-more { background: #f5f5f5; color: #666; }

/* ===== 标签 ===== */
.share-panel-label {
	font-size: 0.72rem;
	color: #555;
	text-align: center;
	line-height: 1.2;
	white-space: nowrap;
}

/* ===== 取消按钮 ===== */
.share-panel-cancel {
	display: block;
	width: calc(100% - 32px);
	margin: 0 16px 16px;
	padding: 12px;
	border: none;
	background: #f5f5f5;
	border-radius: 12px;
	font-size: 0.95rem;
	font-weight: 500;
	color: #333;
	cursor: pointer;
	transition: background 0.2s;
}
.share-panel-cancel:hover,
.share-panel-cancel:active {
	background: #e8e8e8;
}

/* ===== Toast 提示（分享结果） ===== */
.share-toast {
	position: fixed;
	bottom: 120px;
	left: 50%;
	transform: translateX(-50%);
	background: #1f2937;
	color: #fff;
	padding: 10px 24px;
	border-radius: 8px;
	font-size: 0.85rem;
	z-index: 99999;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.3s;
	white-space: nowrap;
}
.share-toast.is-visible {
	opacity: 1;
}

/* ===== 响应式：小屏幕调整网格 ===== */
@media (max-width: 360px) {
	.share-panel-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}
