/* AioPay — front-end styles (light theme, theme-agnostic) */

.aiopay-post {
	--ap-bg: #ffffff;
	--ap-soft: #f7f9fc;
	--ap-ink: #1f2937;
	--ap-muted: #6b7280;
	--ap-border: #e5e7eb;
	--ap-primary: #1677ff;
	--ap-green: #07c160;
	--ap-price: #e4393c;
}

.aiopay-box {
	display: flex;
	gap: 18px;
	align-items: flex-start;
	box-sizing: border-box;
	margin: 28px auto;
	padding: 26px 28px;
	max-width: 720px;
	border: 1px dashed #c9d4e5;
	border-radius: 16px;
	background: linear-gradient(135deg, #f9fbff 0%, #f4f7fd 100%);
	color: var(--ap-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.aiopay-box * { box-sizing: border-box; }

.aiopay-box__icon {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 14px;
	background: #e8f1ff;
	color: var(--ap-primary);
}

.aiopay-box__body { flex: 1 1 auto; min-width: 0; }

.aiopay-box__title {
	margin: 2px 0 8px;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--ap-ink);
}

.aiopay-box__desc {
	margin: 0 0 16px;
	font-size: 14px;
	line-height: 1.7;
	color: var(--ap-muted);
}

.aiopay-box__price-row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 14px;
	margin-bottom: 20px;
}

.aiopay-box__price {
	font-size: 30px;
	font-weight: 800;
	line-height: 1;
	color: var(--ap-price);
	letter-spacing: -0.5px;
}

.aiopay-box__price em {
	margin-right: 3px;
	font-size: 17px;
	font-style: normal;
	font-weight: 600;
}

.aiopay-box__channels {
	font-size: 13px;
	color: var(--ap-muted);
}

.aiopay-box__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.aiopay-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 0 20px;
	border: 1px solid transparent;
	border-radius: 9px;
	font-size: 14px;
	font-weight: 600;
	font-family: inherit;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

a.aiopay-btn:hover,
a.aiopay-btn:focus { text-decoration: none; color: #fff; }

.aiopay-btn:hover { transform: translateY(-1px); }
.aiopay-btn:active { transform: translateY(0); }
.aiopay-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.aiopay-btn--primary {
	background: var(--ap-primary);
	color: #fff;
	box-shadow: 0 6px 16px rgba(22, 119, 255, .22);
}
.aiopay-btn--primary:hover { background: #0f63db; }

.aiopay-btn--ghost {
	background: #fff;
	border-color: var(--ap-border);
	color: var(--ap-ink);
}
.aiopay-btn--ghost:hover { border-color: #b9c6da; background: #fbfdff; }

.aiopay-box__note {
	margin: 16px 0 0;
	font-size: 12px;
	line-height: 1.6;
	color: #94a3b8;
}

.aiopay-teaser {
	margin: 0 0 8px;
	font-size: 15px;
	line-height: 1.9;
	color: #475569;
}

.aiopay-hidden-notice {
	padding: 12px 16px;
	border-radius: 8px;
	background: #f3f4f6;
	color: var(--ap-muted);
	font-size: 13px;
}

.aiopay-inline-msg {
	margin: 10px 0 0;
	font-size: 13px;
	color: var(--ap-price);
}

/* ---------- Modal ---------- */
.aiopay-modal[hidden] { display: none; }

.aiopay-modal {
	--ap-bg: #ffffff;
	--ap-ink: #1f2937;
	--ap-muted: #6b7280;
	--ap-border: #e5e7eb;
	--ap-primary: #1677ff;
	--ap-green: #07c160;
	--ap-price: #e4393c;
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
	color: var(--ap-ink);
}

.aiopay-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, .52);
	backdrop-filter: blur(3px);
}

.aiopay-modal__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 430px;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	padding: 26px 26px 22px;
	border-radius: 18px;
	background: var(--ap-bg);
	box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
	text-align: center;
	animation: aiopay-pop .22s ease-out;
}

@keyframes aiopay-pop {
	from { opacity: 0; transform: translateY(10px) scale(.98); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

.aiopay-modal__close {
	position: absolute;
	top: 12px;
	right: 14px;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #94a3b8;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}
.aiopay-modal__close:hover { background: #f1f5f9; color: var(--ap-ink); }

.aiopay-modal__dialog h2 {
	margin: 0 0 6px;
	font-size: 20px;
	font-weight: 700;
}

.aiopay-modal__amount {
	margin: 0 0 16px;
	font-size: 13px;
	color: var(--ap-muted);
}
.aiopay-modal__amount strong {
	margin-left: 6px;
	font-size: 24px;
	color: var(--ap-price);
}

.aiopay-modal__tabs {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin-bottom: 18px;
}
.aiopay-modal__tabs[hidden] { display: none; }

.aiopay-tab {
	min-width: 104px;
	padding: 9px 14px;
	border: 1px solid var(--ap-border);
	border-radius: 10px;
	background: #fff;
	font-size: 14px;
	font-weight: 600;
	font-family: inherit;
	color: var(--ap-muted);
	cursor: pointer;
}
.aiopay-tab:hover { border-color: #b9c6da; }
.aiopay-tab.is-active[data-channel="alipay"] { border-color: var(--ap-primary); color: var(--ap-primary); background: #f0f7ff; }
.aiopay-tab.is-active[data-channel="wechat"] { border-color: var(--ap-green); color: #059348; background: #f0fbf5; }

.aiopay-modal__qr {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 232px;
	height: 232px;
	margin: 0 auto 12px;
	padding: 8px;
	border: 1px solid var(--ap-border);
	border-radius: 14px;
	background: #fff;
	overflow: hidden;
}
.aiopay-modal__qr canvas,
.aiopay-modal__qr img { display: block; max-width: 100%; height: auto; }

.aiopay-modal__placeholder {
	font-size: 13px;
	line-height: 1.8;
	color: var(--ap-muted);
}

.aiopay-modal__status {
	margin: 4px 0 4px;
	font-size: 14px;
	font-weight: 600;
	color: var(--ap-ink);
}
.aiopay-modal__status.is-error { color: var(--ap-price); }
.aiopay-modal__status.is-success { color: #059348; }

.aiopay-modal__hint {
	margin: 0 0 4px;
	font-size: 12px;
	line-height: 1.7;
	color: var(--ap-muted);
}

.aiopay-modal__countdown {
	margin: 0 0 14px;
	font-size: 12px;
	color: #94a3b8;
}
.aiopay-modal__countdown strong { color: var(--ap-ink); font-variant-numeric: tabular-nums; }

.aiopay-modal__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	margin-bottom: 12px;
}
.aiopay-modal__actions .aiopay-btn { min-height: 36px; padding: 0 14px; font-size: 13px; }
.aiopay-modal__actions [hidden] { display: none; }

.aiopay-modal__order {
	margin: 0;
	font-size: 11px;
	color: #a3adbb;
}
.aiopay-modal__order code { font-size: 11px; word-break: break-all; }

.aiopay-post--unlocked { animation: aiopay-fade .35s ease-in; }
@keyframes aiopay-fade { from { opacity: .55; } to { opacity: 1; } }

@media (max-width: 600px) {
	.aiopay-box { flex-direction: column; gap: 12px; padding: 20px; }
	.aiopay-box__price { font-size: 26px; }
	.aiopay-modal__dialog { padding: 22px 18px 18px; }
	.aiopay-modal__qr { width: 210px; height: 210px; }
}
