/*
 * 会员组购买 - 弹窗收银台 / 二维码 / 积分与签到
 */

.mgb-checkout {
	max-width: 520px;
}

.mgb-checkout .mgb-order-sum {
	margin-bottom: 4px;
}

.mgb-co-loading {
	grid-column: 1 / -1;
	padding: 28px 0;
	text-align: center;
	color: #9aa0a6;
	font-size: .85rem;
}

/* 支付方式里余额不足的那一项 */
.mgb-pay-item.is-short .mgb-pay-box {
	opacity: .55;
	cursor: not-allowed;
}

.mgb-pay-short {
	color: #d14343 !important;
}

/* ---------------------------------------------------------------------------
 * 二维码
 * ------------------------------------------------------------------------- */

.mgb-qr-wrap {
	display: flex;
	gap: 20px;
	align-items: flex-start;
}

.mgb-qr-box {
	position: relative;
	flex: 0 0 180px;
	width: 180px;
	height: 180px;
	border: 1px solid rgba(39, 39, 39, .1);
	border-radius: 12px;
	padding: 8px;
	background: #fff;
}

.mgb-qr-box img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.mgb-qr-box.is-paid::after {
	content: "\f058";
	font-family: FontAwesome;
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(34, 197, 94, .92);
	color: #fff;
	font-size: 56px;
	border-radius: 12px;
}

.mgb-qr-mask {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: rgba(255, 255, 255, .95);
	border-radius: 12px;
	text-align: center;
	font-size: .82rem;
	color: #6c757d;
}

.mgb-qr-mask[hidden] {
	display: none;
}

.mgb-qr-mask i {
	font-size: 26px;
	color: #f59e0b;
}

.mgb-qr-mask .mgb-act {
	width: auto;
	flex: 0 0 auto;
	padding: 6px 16px;
	font-size: .8rem;
}

.mgb-qr-side {
	flex: 1 1 auto;
	min-width: 0;
}

.mgb-qr-amount {
	font-size: 1.9rem;
	font-weight: 700;
	color: #ff5d5b;
	line-height: 1.1;
}

.mgb-qr-amount small {
	font-size: .8rem;
	font-weight: 400;
	color: #9aa0a6;
}

.mgb-qr-subject {
	font-size: .84rem;
	color: var(--bs-body-color, #2c3038);
	margin: 6px 0 12px;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.mgb-qr-countdown {
	font-size: .8rem;
	color: #6c757d;
	margin-bottom: 8px;
}

.mgb-qr-countdown b {
	font-family: ui-monospace, Menlo, Consolas, monospace;
	color: var(--bs-body-color, #2c3038);
}

.mgb-qr-countdown b.is-soon {
	color: #d14343;
}

.mgb-qr-hint {
	font-size: .76rem;
	color: #9aa0a6;
	line-height: 1.7;
	margin-bottom: 10px;
}

.mgb-qr-status {
	font-size: .82rem;
	color: #1d4ed8;
	padding: 7px 12px;
	border-radius: 8px;
	background: rgba(78, 156, 255, .08);
}

.mgb-qr-open {
	display: inline-block;
	margin-top: 10px;
	font-size: .76rem;
	color: #6c757d;
	text-decoration: none;
}

.mgb-qr-open:hover {
	color: var(--bs-primary, #4e9cff);
}

/* ---------------------------------------------------------------------------
 * 积分与签到
 * ------------------------------------------------------------------------- */

.mgb-points-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
}

.mgb-points-now span {
	display: block;
	font-size: .78rem;
	color: #9aa0a6;
}

.mgb-points-now b {
	font-size: 2.1rem;
	font-weight: 700;
	color: var(--bs-primary, #4e9cff);
	line-height: 1.1;
}

.mgb-checkin {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}

.mgb-checkin-info {
	font-size: .84rem;
	color: #5c636d;
	text-align: right;
}

.mgb-checkin-info b {
	color: #ff8a3d;
	font-size: 1.1rem;
}

.mgb-checkin-info small {
	display: block;
	font-size: .74rem;
	color: #9aa0a6;
}

.mgb-checkin-btn {
	flex: 0 0 auto;
	width: auto;
	min-width: 132px;
}

.mgb-checkin-btn.is-done,
.mgb-checkin-btn:disabled {
	background: rgba(39, 39, 39, .08);
	color: #9aa0a6;
	box-shadow: none;
	transform: none;
}

.mgb-p-in {
	color: #15803d;
}

.mgb-p-out {
	color: #d14343;
}

/* ---------------------------------------------------------------------------
 * 响应式 / 暗色
 * ------------------------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
	.mgb-qr-box {
		background: #fff;
	}

	.mgb-qr-mask {
		background: rgba(30, 30, 32, .95);
	}
}

@media (max-width: 575.98px) {
	.mgb-qr-wrap {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.mgb-qr-side {
		width: 100%;
	}

	.mgb-points-head {
		justify-content: center;
		text-align: center;
	}

	.mgb-checkin {
		width: 100%;
		justify-content: space-between;
	}

	.mgb-checkin-info {
		text-align: left;
	}
}

/* ---------------------------------------------------------------------------
 * 会员组卡片：权益等高、按钮对齐同一水平线
 * ------------------------------------------------------------------------- */

.mgb-group-list .mgb-card .card-body {
	display: flex;
	flex-direction: column;
	height: 100%;
}

/* 权益列表撑开剩余空间，把按钮推到卡片底部 */
.mgb-group-list .mgb-benefits {
	flex: 1 1 auto;
	margin-bottom: 18px !important;
}

.mgb-card-foot {
	margin-top: auto;
}

.mgb-act-buy {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	width: 100%;
	padding: 13px 16px;
	border: 0;
	border-radius: 10px;
	background: var(--mgb-color, #4e9cff);
	color: #fff;
	font-size: .95rem;
	font-weight: 600;
	letter-spacing: .02em;
	cursor: pointer;
	text-decoration: none;
	box-shadow: 0 3px 10px rgba(0, 0, 0, .1);
	transition: all .22s ease;
}

.mgb-act-buy:hover:not(:disabled) {
	color: #fff;
	filter: brightness(1.08);
	transform: translateY(-2px);
	box-shadow: 0 7px 18px rgba(0, 0, 0, .16);
}

.mgb-act-buy:active:not(:disabled) {
	transform: translateY(0);
}

.mgb-act-buy:disabled,
.mgb-act-buy.is-owned {
	background: rgba(39, 39, 39, .07);
	color: #9aa0a6;
	box-shadow: none;
	cursor: default;
	font-weight: 500;
}

.mgb-card-note {
	margin-top: 8px;
	font-size: .72rem;
	color: #9aa0a6;
	line-height: 1.5;
}

/* 推荐档位的按钮再突出一点 */
.mgb-card-hot .mgb-act-buy {
	padding: 15px 16px;
	font-size: 1rem;
}

@media (prefers-color-scheme: dark) {
	.mgb-act-buy:disabled,
	.mgb-act-buy.is-owned {
		background: rgba(255, 255, 255, .07);
	}
}


/* ===========================================================================
 * 每日签到小工具
 *
 * 结构照参考图：描边卡片 + 左上角 legend 标签 + 头像堆 + 药丸按钮 + 周历 + 底栏。
 * 配色走主题的 --bs-primary，不写死颜色。
 * ========================================================================= */

.mgb-signin {
	/*
	 * 签到强调色走主题的 --bs-dark（黑色描边那一套），不要用 --bs-primary。
	 * keqing-master 的小工具本来就是「黑描边 + 黑字」的风格，
	 * 跟着 primary 走会变成一块紫，和旁边的搜索 / 标签云对不上。
	 */
	--mgb-sg: var(--bs-dark, #0f172a);
	--mgb-sg-rgb: var(--bs-dark-rgb, 15, 23, 42);
}

/* ---------- 顶部：头像堆 + 按钮 ---------- */
.mgb-signin-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 18px;
}

.mgb-signin-who {
	min-width: 0;
}

.mgb-signin-faces {
	display: flex;
	align-items: center;
	margin-bottom: 8px;
}

.mgb-signin-face {
	display: block;
	width: 30px;
	height: 30px;
	margin-right: -8px;
	border-radius: 50%;
	overflow: hidden;
	border: 2px solid var(--bs-body-bg, #fff);
	background: #eef0f3;
	flex: 0 0 auto;
}

.mgb-signin-face img {
	width: 100%;
	height: 100%;
	display: block;
	border-radius: 50%;
}

.mgb-signin-more {
	margin-left: 14px;
	color: #9aa3b0;
	font-size: 1rem;
	letter-spacing: 1px;
	line-height: 1;
}

.mgb-signin-count {
	font-size: .88rem;
	font-weight: 600;
	color: var(--bs-body-color, #1f2328);
}

/* 黑色药丸按钮（图里的风格），hover 走主题色 */
.mgb-signin-btn {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 10px 20px;
	border: 2px solid var(--bs-dark, #272727);
	border-radius: 26px;
	background: var(--bs-dark, #272727);
	color: #fff;
	font-size: .9rem;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
	text-decoration: none;
	transition: all .2s ease;
}

.mgb-signin-btn:hover:not(:disabled) {
	color: #fff;
	background: var(--mgb-sg);
	border-color: var(--mgb-sg);
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(var(--mgb-sg-rgb), .35);
}

.mgb-signin-btn.is-done,
.mgb-signin-btn:disabled {
	background: var(--bs-body-bg, #fff);
	color: #6b7280;
	border-color: var(--bs-dark, #272727);
	cursor: default;
	transform: none;
	box-shadow: none;
}

/* ---------- 周历 ---------- */
.mgb-signin-days {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
}

.mgb-signin-day {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 16px 4px;
	border: 2px solid transparent;
	border-radius: 14px;
	min-height: 92px;
}

.mgb-signin-dow {
	font-size: .82rem;
	line-height: 1;
}

.mgb-signin-mark {
	font-size: 1.3rem;
	line-height: 1;
	font-weight: 700;
}

/* 已过去 */
.mgb-signin-day.is-past {
	background: #eceef1;
}

.mgb-signin-day.is-past .mgb-signin-dow {
	color: #9aa3b0;
}

.mgb-signin-day.is-past .mgb-signin-mark {
	color: #b4bbc5;
}

/* 还没到 */
.mgb-signin-day.is-future {
	border: 2px dashed #e2e6ec;
	background: #fafbfc;
}

.mgb-signin-day.is-future .mgb-signin-dow,
.mgb-signin-day.is-future .mgb-signin-mark {
	color: #d2d7df;
}

/* 今天：粗描边，和主题的卡片描边同色 */
.mgb-signin-day.is-today {
	border-color: var(--bs-dark, #272727);
	background: var(--bs-body-bg, #fff);
}

.mgb-signin-day.is-today .mgb-signin-dow,
.mgb-signin-day.is-today .mgb-signin-mark {
	color: var(--bs-body-color, #1f2328);
	font-weight: 700;
}

/* 签到过的用主题色打勾 */
.mgb-signin-day.is-signed .mgb-signin-mark {
	color: var(--mgb-sg);
}

.mgb-signin-day.is-past.is-signed {
	background: rgba(var(--mgb-sg-rgb), .09);
}

.mgb-signin-day.is-past.is-signed .mgb-signin-dow {
	color: rgba(var(--mgb-sg-rgb), .75);
}

.mgb-signin-day.is-today.is-signed {
	border-color: var(--mgb-sg);
}

.mgb-signin-day.is-today.is-signed .mgb-signin-dow {
	color: var(--mgb-sg);
}

/* ---------- 底栏 ---------- */
.mgb-signin-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 16px;
	font-size: .78rem;
	color: #9aa3b0;
}

.mgb-signin-stat b {
	color: var(--bs-body-color, #1f2328);
	font-size: 1rem;
	margin: 0 3px;
}

.mgb-signin-gain {
	padding: 3px 12px;
	border-radius: 20px;
	background: #eceef1;
	color: #6b7280;
}

.mgb-signin-gain.is-done {
	background: rgba(var(--mgb-sg-rgb), .1);
	color: var(--mgb-sg);
}

.mgb-signin .mgb-msg {
	margin: 12px 0 0;
}

@media (prefers-color-scheme: dark) {
	.mgb-signin-btn,
	.mgb-signin-day.is-today {
		border-color: rgba(255, 255, 255, .55);
	}

	.mgb-signin-btn {
		background: rgba(255, 255, 255, .92);
		color: #1f2328;
	}

	.mgb-signin-btn.is-done,
	.mgb-signin-btn:disabled {
		background: transparent;
		color: #aab4c4;
	}

	.mgb-signin-day.is-past {
		background: rgba(255, 255, 255, .07);
	}

	.mgb-signin-day.is-future {
		background: transparent;
		border-color: rgba(255, 255, 255, .14);
	}

	.mgb-signin-gain {
		background: rgba(255, 255, 255, .08);
	}
}

/* 窄侧栏时三列更合适 */
@media (max-width: 420px) {
	.mgb-signin-days {
		grid-template-columns: repeat(3, 1fr);
	}
}
