/* 贊助頁、付款結果與我的贊助的版面。共用的元件在 common.css，顏色在 colors.css 與 dark.css */

/* ===== 贊助頁 ===== */
.pgB {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
	margin-top: 20px;
	align-items: start
}

@media (min-width: 821px) {
	.pgB {
		grid-template-columns: 400px 1fr
	}

	.intro {
		position: sticky;
		top: 16px
	}
}

/* 直播狀態在名字下面，通知說明接在同一行 */
.state {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 8px;
	margin: 6px 0 0;
	font-size: 12.5px;
	line-height: 1.6
}

.state .when {
	padding-left: 8px;
	border-left: 1px solid var(--line-2);
	color: var(--ink-2);
	white-space: nowrap
}

/* 名字下面的兩句話放在對話框裡，尖角朝上指向頭貼，像伶乃在說話。
   等「贊助伶乃」打完字才從尖角那一角冒出來，時間與曲線照通知徽章的彈出 */
.intro .say {
	margin-top: 16px;
	transform-origin: 30px 0;
	animation: pop var(--duration-very-slow) var(--ease-bounce) 1.1s both
}

/* 手機寬度時不要只剩一個字掉到下一行 */
.say .lead {
	margin: 0;
	text-wrap: pretty
}

.say .lead + .lead {
	margin-top: 2px
}

#sponsor .t-tabs, #sponsor .check, #form-error {
	margin: 0 0 22px
}

/* 只有文字贊助能選要不要上實況；影片贊助一定上實況，換成提示 */
#sponsor[data-kind="text"] .vid, #sponsor[data-kind="text"] .vnote, #sponsor[data-kind="video"] .check {
	display: none
}

.vnote {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	margin: 0 0 22px;
	font-size: 13px;
	color: var(--ink-2);
	line-height: 1.6
}

.vnote::before {
	content: "";
	flex: none;
	width: 8px;
	height: 8px;
	margin-top: 7px;
	border-radius: 50%;
	background: var(--dot)
}

.lb em.rate {
	color: var(--pink);
	font-weight: 500;
	font-size: 12.5px
}

.ccy {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
	font-size: 12px;
	color: var(--ink-3)
}

.vrow {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 88px;
	gap: 8px
}

.vcard {
	margin-top: 10px;
	display: flex;
	gap: 12px;
	padding: 12px;
	border-radius: 14px;
	background: var(--surface-2);
	border: 1px solid var(--line)
}

.vcard b {
	font-weight: 500;
	font-size: 13.5px;
	line-height: 1.5;
	display: block;
	text-wrap: pretty
}

.plays {
	margin: 6px 0 0;
	font-size: 12.5px;
	color: var(--ink-2);
	line-height: 1.6
}

.plays b {
	display: inline;
	color: var(--pink);
	font-size: 13px
}

@media (max-width: 480px) {
	.vcard {
		flex-direction: column
	}

	.thumb {
		width: 100%
	}
}

#sponsor .btn-pay, #checkout .btn-pay {
	width: 100%;
	margin-top: 28px
}

.fine {
	text-align: center;
	margin: 10px 0 0
}

.login {
	margin: 18px 0 0;
	padding-top: 14px;
	border-top: 1px solid var(--line)
}

/* 卡片底部的貓：本體在 cat.css，這裡只決定放哪一邊 */
.intro .peek {
	right: 36px
}

form .peek {
	left: 40px
}

/* 兩隻貓錯開眨眼 */
form .peek .open, form .peek .shut {
	animation-delay: 2.3s
}

form.card {
	animation-delay: var(--duration-micro)
}

@keyframes pop {
	from {
		opacity: 0;
		transform: scale(.4);
		filter: blur(var(--blur-small))
	}
}

/* ===== 付款結果頁 ===== */
/* 置中的結果卡：前往付款中、付款結果 */
.res {
	max-width: 540px;
	margin: 28px auto 0;
	text-align: center
}

.res h1 {
	margin: 0;
	font-size: 22px;
	font-weight: 500
}

.res .icon {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	margin: 0 auto 14px;
	font-size: 28px
}

.res .icon.ok {
	background: var(--mint-wash);
	color: var(--mint-ink)
}

.res .icon.wait {
	background: var(--lav-wash);
	color: var(--lav-ink)
}

.res .icon.fail {
	background: var(--pink-wash);
	color: var(--pink)
}

.res .icon svg {
	width: 36px;
	height: 36px
}

/* ===== 付款成功的勾：transitions-dev「Success check」配方只取畫線，不淡入也不轉 ===== */
.res .icon.ok .glyph {
	fill: currentColor;
	stroke: none
}

/* 遮罩看亮度，筆畫過的白色地方才露出勾。
   筆長 28.11（getTotalLength() 量的）取 29；空白比筆長多 6、起點往回退 3，
   圓頭半徑 2.2 才不會在還沒開始畫時先露出一點 */
.res .icon.ok .pen {
	stroke: #fff;
	stroke-width: 4.4;
	stroke-dasharray: 29 35;
	stroke-dashoffset: 32;
	animation: t-check-draw var(--check-path-dur) var(--check-ease-path) var(--check-path-delay, 0ms) forwards;
}

@keyframes t-check-draw {
	to {
		stroke-dashoffset: 0;
	}
}

/* 付款失敗也用畫線：先畫三角形，再畫驚嘆號。長度用 getTotalLength() 量過（59.46、4.40），空白與起點的取法同勾 */
.res .icon.fail .tri {
	stroke-dasharray: 60 64;
	stroke-dashoffset: 62;
	animation: t-check-draw var(--check-path-dur) var(--check-ease-path) var(--check-path-delay) forwards
}

.res .icon.fail .mark {
	stroke-dasharray: 5 9;
	stroke-dashoffset: 7;
	animation: t-check-draw var(--check-path-dur) var(--check-ease-path) calc(var(--check-path-delay) + var(--check-path-dur) * .6) forwards
}

/* 動效全關時要直接顯示畫好的圖示，不然會停在還沒畫的樣子 */
@media (prefers-reduced-motion: reduce) {
	.res .icon.ok .pen, .res .icon.fail path {
		animation: none !important;
		stroke-dashoffset: 0 !important;
	}
}

/* 等待付款：三個點輪流往上跳。transitions.dev 沒有這種配方，自己寫 */
.res .icon .dots {
	display: flex;
	gap: 5px
}

.res .icon .dots i {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
	animation: hop 1.2s ease-in-out infinite
}

.res .icon .dots i:nth-child(2) {
	animation-delay: .15s
}

.res .icon .dots i:nth-child(3) {
	animation-delay: .3s
}

@keyframes hop {
	0%, 60%, 100% {
		transform: translateY(0);
		opacity: .4
	}
	30% {
		transform: translateY(-6px);
		opacity: 1
	}
}

/* 說明文字裡的 \n 要換行，HTML 預設會把換行當成空白 */
.res .lead {
	margin: 6px 0 18px;
	white-space: pre-line
}

.sum {
	text-align: left
}

.sum div {
	display: flex;
	gap: 16px;
	font-size: 13px
}

.sum dt {
	min-width: 64px;
	color: var(--ink-3)
}

.sum dd {
	margin: 0;
	color: var(--ink)
}

.res .btns {
	display: flex;
	gap: 10px;
	justify-content: center;
	margin-top: 20px;
	flex-wrap: wrap
}

.res .foot {
	margin: 16px 0 0
}

/* ===== 我的贊助 ===== */
.mine {
	max-width: 760px;
	margin: 24px auto 0
}

.mine .lead {
	margin-bottom: 18px
}

/* 有沒有通知的分頁在左，付款失敗與已取消的開關在右，手機擠不下時開關換到下一行 */
.mfilter {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	margin-bottom: 10px
}

.mine .none .btn-spon {
	margin-top: 12px
}

.mrow {
	display: grid;
	grid-template-columns: 120px 90px 1fr auto;
	gap: 12px;
	align-items: center;
	padding: 14px 0;
	border-bottom: 1px solid var(--line);
	font-size: 13px
}

.mrow:last-child {
	border-bottom: 0
}

.mrow .tm, .mrow .amt {
	font-variant-numeric: tabular-nums
}

.mrow .amt {
	font-weight: 500
}

/* 留言可能是一長串網址，不斷開會把狀態擠出卡片 */
.mrow .m {
	overflow-wrap: anywhere
}

.mrow .m small {
	display: block
}

/* 狀態欄：標籤右邊放取消，已取號的在下面寫繳費期限 */
.mrow .st {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 4px 8px
}

.mrow .st small {
	flex-basis: 100%;
	text-align: right
}

@media (max-width: 560px) {
	.mrow {
		grid-template-columns: 1fr auto;
		grid-template-areas: "amt st" "m m" "tm tm";
		row-gap: 2px
	}

	.mrow .amt {
		grid-area: amt
	}

	.mrow .m {
		grid-area: m
	}

	.mrow .tm {
		grid-area: tm
	}

	.mrow .st {
		grid-area: st
	}
}

/* 換篩選時換上來的列表只淡入，浮上來只留給剛進頁面 */
#mine-list.is-swap {
	animation: fade var(--duration-slow) var(--ease-smooth-out) both
}

#mine-list.is-swap .card {
	animation: none
}

@keyframes fade {
	from {
		opacity: 0
	}
}
