.xg-referral-validate-message { display: block; margin-top: 4px; font-size: 0.9em; }
.xg-referral-validate-message.xg-referral-error { color: #b32d2e; }
.xg-referral-validate-message.xg-referral-ok { color: #00a32a; }

/* LINE 推薦碼彈窗 */
.xg-referral-modal-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0,0,0,0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100000;
}
.xg-referral-modal-backdrop.xg-referral-modal-hidden { display: none; }
.xg-referral-modal {
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.15);
	max-width: 400px;
	width: 90%;
	padding: 1.5rem;
}
.xg-referral-modal-title { margin-top: 0; margin-bottom: 0.5rem; font-size: 1.25rem; }
.xg-referral-modal-desc { margin-bottom: 1rem; color: #50575e; font-size: 0.9rem; }
.xg-referral-modal-body { margin-bottom: 1rem; }
.xg-referral-modal-body label { display: block; margin-bottom: 4px; font-weight: 600; }
.xg-referral-modal-input { width: 100%; padding: 8px; font-size: 1rem; }
.xg-referral-modal-validate { display: block; margin-top: 4px; font-size: 0.85em; }
.xg-referral-modal-validate.xg-referral-error { color: #b32d2e; }
.xg-referral-modal-validate.xg-referral-ok { color: #00a32a; }
.xg-referral-modal-actions { display: flex; align-items: center; gap: 1rem; }
.xg-referral-modal-actions .button-link { margin-left: auto; }

/* My Account 推薦中心 */
.xg-referral-myaccount { margin-top: 1em; }
.xg-referral-block { margin-bottom: 1.5rem; }
.xg-referral-block h3 { margin-bottom: 0.5rem; }
.xg-referral-code-row, .xg-referral-link-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.xg-referral-link-row code { word-break: break-all; }

/* Reward list – flex layout */
.xgr-list {
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	overflow: visible;
}

.xgr-list-head,
.xgr-list-row {
	display: flex;
	align-items: center;
	padding: 10px 16px;
	gap: 12px;
}

.xgr-list-head {
	background: #f8fafc;
	font-size: .85em;
	font-weight: 600;
	color: #64748b;
	border-bottom: 1px solid #e2e8f0;
}

.xgr-list-row {
	border-bottom: 1px solid #f1f5f9;
	font-size: .92em;
}

.xgr-list-row:last-child {
	border-bottom: none;
}

.xgr-list-row:hover {
	background: #f8fafc;
}

.xgr-col-name {
	flex: 0 0 120px;
}

.xgr-col-status {
	flex: 0 0 100px;
}

.xgr-col-date {
	flex: 0 0 130px;
}

.xgr-col-content {
	flex: 1 1 0%;
	min-width: 0;
}

@media (max-width: 600px) {
	.xgr-list-head {
		display: none;
	}

	.xgr-list-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
		padding: 12px 16px;
	}

	.xgr-col-name,
	.xgr-col-status,
	.xgr-col-date,
	.xgr-col-content {
		flex: none;
		width: 100%;
	}

	.xgr-list-row .xgr-col::before {
		content: attr(data-label) '：';
		font-weight: 600;
		color: #64748b;
		font-size: .85em;
	}

	.xgr-coupon-state-wrap {
		display: block;
    font-size: 0.9em;
	}
}

/* Coupon code highlight + click-to-copy */
:root {
	--primary-100: #8dc5a2;
}

.xgr-coupon-code {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 4px;
	background: var(--primary-100);
	color: #1a1a1a;
	font-weight: 600;
	font-size: .92em;
	letter-spacing: .5px;
	cursor: pointer;
	user-select: all;
	transition: filter .15s, box-shadow .15s;
	margin-right: 4px;
}

.xgr-coupon-code:hover {
	filter: brightness(.92);
	box-shadow: 0 1px 4px rgba(0,0,0,.12);
}

.xgr-coupon-code:active {
	filter: brightness(.85);
}

.xgr-coupon-code.xgr-copied {
	position: relative;
}

.xgr-coupon-code.xgr-copied::after {
	content: '已複製';
	position: absolute;
	bottom: calc(100% + 6px);
	left: 50%;
	transform: translateX(-50%);
	padding: 3px 10px;
	border-radius: 4px;
	background: #1e293b;
	color: #f1f5f9;
	font-size: 11px;
	font-weight: 400;
	white-space: nowrap;
	pointer-events: none;
	animation: xgr-fade-up .3s ease;
}

@keyframes xgr-fade-up {
	from { opacity: 0; transform: translateX(-50%) translateY(4px); }
	to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Coupon info tooltip */
.xgr-tip-wrap {
	position: relative;
	display: inline-block;
	vertical-align: middle;
	cursor: pointer;
}

.xgr-tip-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	font-size: 16px;
	line-height: 1;
	color: #646970;
	transition: color .15s;
}

.xgr-tip-wrap:hover .xgr-tip-icon,
.xgr-tip-wrap:focus .xgr-tip-icon {
	color: #2563eb;
}

.xgr-tip-box {
	display: none;
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	min-width: 180px;
	max-width: 280px;
	padding: 10px 14px;
	border-radius: 6px;
	background: #1e293b;
	color: #f1f5f9;
	font-size: 12px;
	line-height: 1.6;
	white-space: normal;
	text-align: left;
	box-shadow: 0 4px 12px rgba(0,0,0,.15);
	z-index: 100;
	pointer-events: none;
}

.xgr-tip-box::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: #1e293b;
}

.xgr-tip-wrap:hover .xgr-tip-box,
.xgr-tip-wrap:focus .xgr-tip-box {
	display: block;
}
