/* 背景遮罩 */
.modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
	display: none; /* 初始關閉 */
	align-items: center;
	justify-content: center;
	z-index: 1000;
}
.modal-backdrop.open {
	display: flex;
}

/* 視窗 */
.modal {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
	width: min(640px, 90vw); /* 預設 640px，最大不超過視窗寬 90% */
	max-width: 90%; /* 如需嚴格 90% 上限可保留這行 */
	max-height: 85vh;
	overflow: auto;
	position: relative;
}

/* 標題列與關閉鈕 */
.modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	border-bottom: 1px solid #eee;
}
.modal-title {
	font-size: 16px;
	font-weight: 600;
}
.modal-close {
	appearance: none;
	border: none;
	background: transparent;
	cursor: pointer;
	font-size: 20px;
	line-height: 1;
	padding: 6px;
	border-radius: 8px;
}
.modal-close:hover {
	background: #f2f2f2;
}

.modal-body {
	padding: 16px;
}

/* 底部 OK 置中 */
.modal-footer {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	padding: 14px 16px;
	border-top: 1px solid #eee;
}
.btn {
	padding: 0.6rem 1.1rem;
	border: 1px solid #ddd;
	background: #f9f9f9;
	border-radius: 10px;
	cursor: pointer;
}
.btn.primary {
	background: #1a73e8;
	color: #fff;
	border-color: #1a73e8;
}
.btn.primary:hover {
	filter: brightness(0.95);
}
