/* 公开牌谱 2D 回放 (#74575) */
.qj-paipu-page {
	max-width: 1320px;
	margin: 0 auto;
	padding: 2rem 1.25rem 4rem;
	font-family: var(--qj-font-body);
}

.qj-paipu-landing__box {
	width: 100%;
}

.qj-paipu-session__bar {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 0.5rem 0.75rem;
	margin-bottom: 0.5rem;
}

.qj-paipu-session__info {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.35rem 0.5rem;
	min-width: 0;
}

.qj-paipu-session__title {
	margin: 0;
	font-family: var(--qj-font-display);
	font-size: 1.05rem;
	font-weight: 700;
	color: #ffe8b8;
	letter-spacing: var(--qj-ls-nav, 0.04em);
}

.qj-paipu-session__label {
	font-size: 0.78rem;
	opacity: 0.72;
}

.qj-paipu-session__id {
	font-size: 0.82rem;
	word-break: break-all;
	color: #e8c896;
}

.qj-paipu-session__back::before,
.qj-paipu-session__back::after {
	content: none !important;
	display: none !important;
}

.qj-paipu-session__back {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.52rem 1rem 0.62rem;
	border-radius: 8px;
	border: 1px solid rgba(232, 200, 150, 0.32);
	background: rgba(13, 10, 20, 0.55);
	color: var(--qj-nav-text, #ffe8b8);
	font-family: var(--qj-font-display);
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: var(--qj-ls-nav, 0.04em);
	cursor: pointer;
	white-space: nowrap;
	text-shadow:
		0 1px 3px rgba(0, 0, 0, 0.75),
		0 2px 12px rgba(13, 10, 20, 0.45);
	transition: background 0.15s ease, border-color 0.15s ease;
}

.qj-paipu-session__back:hover {
	background: rgba(232, 200, 150, 0.14);
	border-color: rgba(232, 200, 150, 0.48);
}

.qj-paipu-search--landing {
	align-items: stretch;
	margin-bottom: 0;
}

.qj-paipu-search--landing input[type='text'] {
	flex: 1 1 auto;
	min-width: 0;
}

.qj-paipu-page__title {
	font-family: var(--qj-font-display);
	font-size: clamp(1.5rem, 3vw, 2rem);
	font-weight: 700;
	letter-spacing: var(--qj-ls-nav, 0.04em);
	margin: 0 0 0.5rem;
}

.qj-paipu-page__lead {
	color: var(--qj-muted, rgba(255, 255, 255, 0.72));
	margin: 0 0 1.5rem;
}

.qj-paipu-search {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: flex-end;
	margin-bottom: 1.5rem;
}

.qj-paipu-search label {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	flex: 1 1 16rem;
	font-size: 0.9rem;
}

.qj-paipu-search input[type='text'] {
	padding: 0.65rem 0.85rem;
	border-radius: 8px;
	border: 1px solid rgba(232, 200, 150, 0.35);
	background: rgba(13, 10, 20, 0.55);
	color: inherit;
	font-size: 1rem;
}

.qj-paipu-search button {
	padding: 0.65rem 1.25rem;
	border-radius: 8px;
	border: none;
	background: linear-gradient(135deg, #c9a45c, #e8c896);
	color: #1a1428;
	font-weight: 600;
	cursor: pointer;
}

.qj-paipu-search button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.qj-paipu-flash {
	padding: 0.75rem 1rem;
	border-radius: 8px;
	margin-bottom: 1rem;
}

.qj-paipu-flash--error {
	background: rgba(180, 40, 40, 0.25);
	border: 1px solid rgba(255, 120, 120, 0.45);
}

.qj-paipu-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	padding: 2.5rem 1rem;
	color: var(--qj-muted, rgba(255, 255, 255, 0.75));
	font-size: 0.95rem;
}

/* ponytail: class display:flex 会盖掉 [hidden] 默认 display:none，加载完仍可见 */
.qj-paipu-loading[hidden] {
	display: none !important;
}

.qj-paipu-loading__spinner {
	width: 1.25rem;
	height: 1.25rem;
	border: 2px solid rgba(232, 200, 150, 0.25);
	border-top-color: #e8c896;
	border-radius: 50%;
	animation: qj-paipu-spin 0.75s linear infinite;
}

@keyframes qj-paipu-spin {
	to {
		transform: rotate(360deg);
	}
}

.qj-paipu-replay {
	border: 1px solid rgba(232, 200, 150, 0.22);
	border-radius: 12px;
	background: rgba(8, 6, 14, 0.65);
	padding: 1rem;
	outline: none;
	overflow-anchor: none;
}

.qj-paipu-replay:focus-visible {
	box-shadow: 0 0 0 2px rgba(232, 200, 150, 0.45);
}

.qj-paipu-meta {
	display: flex;
	justify-content: center;
	align-items: center;
	margin-bottom: 0.5rem;
	font-size: 0.95rem;
	color: var(--qj-muted, rgba(255, 255, 255, 0.75));
}

.qj-paipu-table-col {
	min-width: 0;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.qj-paipu-meta__action {
	font-family: var(--qj-font-display);
	font-weight: 700;
	color: #e8c896;
	text-align: center;
	font-size: 1rem;
	line-height: 1.45;
	letter-spacing: 0.02em;
}

.qj-paipu-seat [data-score],
.qj-paipu-seat__score {
	font-size: 0.92em;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: #ffe8b8;
	letter-spacing: 0.02em;
	white-space: nowrap;
}

.qj-paipu-seat__score {
	position: absolute;
	top: 0.35rem;
	right: 0.45rem;
	z-index: 2;
	line-height: 1.2;
	pointer-events: none;
	padding: 0.34rem 0.72rem;
	border-radius: 999px;
	border: 1px solid rgba(232, 200, 150, 0.48);
	background: linear-gradient(165deg, rgba(42, 34, 26, 0.96) 0%, rgba(16, 12, 10, 0.94) 100%);
	box-shadow:
		inset 0 1px 0 rgba(255, 230, 180, 0.15),
		0 2px 8px rgba(0, 0, 0, 0.38);
}

.qj-paipu-dora {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.35rem 0.5rem;
	padding: 0.35rem 0.55rem;
	border-radius: 8px;
	background: rgba(255, 220, 150, 0.08);
	border: 1px solid rgba(232, 200, 150, 0.22);
}

.qj-paipu-dora[hidden] {
	display: none !important;
}

.qj-paipu-dora__label {
	font-size: 0.82em;
	font-weight: 700;
	color: #e8c896;
}

.qj-paipu-dora__tiles {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--qj-tile-gap, 0.07rem);
}

.qj-paipu-dora--table {
	position: absolute;
	top: 0.45rem;
	left: 0.45rem;
	z-index: 3;
	margin: 0;
	background: rgba(6, 5, 12, 0.72);
	backdrop-filter: blur(4px);
}

.qj-paipu-settle {
	position: absolute;
	inset: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.75rem;
	border-radius: 10px;
	background: rgba(0, 0, 0, 0.55);
}

.qj-paipu-settle[hidden] {
	display: none !important;
}

.qj-paipu-settle__box {
	width: min(94%, 38rem);
	max-height: 92%;
	overflow: auto;
	padding: 1.35rem 1.5rem;
	border-radius: 12px;
	background: linear-gradient(180deg, rgba(22, 18, 30, 0.98) 0%, rgba(10, 8, 16, 0.98) 100%);
	border: 1px solid rgba(232, 200, 150, 0.35);
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
	font-size: 1.05rem;
}

.qj-paipu-settle__title {
	margin: 0 0 0.5rem;
	font-size: 1.35rem;
	color: #e8c896;
}

.qj-paipu-settle__result {
	margin: 0 0 0.75rem;
	font-size: 1.15rem;
	font-weight: 700;
	color: #ffe8b8;
}

.qj-paipu-settle__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 1.02rem;
}

.qj-paipu-settle__table th,
.qj-paipu-settle__table td {
	padding: 0.55rem 0.45rem;
	border-bottom: 1px solid rgba(232, 200, 150, 0.12);
	text-align: left;
}

.qj-paipu-settle__table th {
	color: #e8c896;
	font-weight: 700;
}

.qj-paipu-settle__table tr.is-winner td {
	color: #ffe082;
}

.qj-paipu-settle__delta--plus {
	color: #81c784;
}

.qj-paipu-settle__delta--minus {
	color: #ef9a9a;
}

.qj-paipu-round {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem 0.5rem;
	padding: 0.35rem 0.55rem;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(232, 200, 150, 0.18);
}

.qj-paipu-round[hidden] {
	display: none !important;
}

.qj-paipu-round--table {
	position: absolute;
	top: 0.45rem;
	right: 0.45rem;
	z-index: 3;
	margin: 0;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.2rem;
	background: rgba(6, 5, 12, 0.72);
	backdrop-filter: blur(4px);
	padding: 0.35rem 0.38rem;
	border-radius: 8px;
	border: 1px solid rgba(232, 200, 150, 0.22);
	max-width: 7.5rem;
}

.qj-paipu-round__count {
	font-size: 0.75rem;
	font-weight: 700;
	color: #e8c896;
	white-space: nowrap;
}

.qj-paipu-round__hint {
	font-size: 0.68rem;
	line-height: 1.35;
	color: rgba(232, 200, 150, 0.82);
	max-width: 7.5rem;
	text-align: right;
}

.qj-paipu-settle__note {
	margin: 0 0 0.45rem;
	font-size: 0.95rem;
	line-height: 1.45;
	color: rgba(232, 200, 150, 0.88);
}

.qj-paipu-round select {
	background: rgba(13, 10, 20, 0.8);
	color: inherit;
	border: 1px solid rgba(232, 200, 150, 0.3);
	border-radius: 6px;
	padding: 0.35rem 0.5rem;
	font-size: 0.88rem;
	min-width: 6rem;
	max-width: 100%;
}

.qj-paipu-round select:disabled {
	opacity: 0.88;
	cursor: default;
}

.qj-paipu-layout {
	display: grid;
	grid-template-columns: minmax(346px, 415px) minmax(0, 1fr);
	gap: 1rem;
	align-items: start;
}

.qj-paipu-meta {
	margin-bottom: 0.35rem;
}

.qj-paipu-steps-wrap {
	min-width: 0;
}

.qj-paipu-steps {
	position: sticky;
	top: 1rem;
	max-height: min(52vh, 480px);
	display: flex;
	flex-direction: column;
	border: 1px solid rgba(232, 200, 150, 0.2);
	border-radius: 10px;
	background: rgba(6, 5, 12, 0.75);
	overflow: hidden;
}

.qj-paipu-steps__title {
	margin: 0;
	padding: 0.65rem 0.85rem;
	font-size: 0.85rem;
	font-weight: 700;
	color: #e8c896;
	border-bottom: 1px solid rgba(232, 200, 150, 0.15);
	flex-shrink: 0;
}

.qj-paipu-steps__list {
	list-style: none;
	margin: 0;
	padding: 0.35rem;
	overflow-y: auto;
	flex: 1;
}

.qj-paipu-step-item {
	display: grid;
	grid-template-columns: 4rem minmax(0, 1fr);
	gap: 0.35rem 0.5rem;
	align-items: center;
	width: 100%;
	padding: 0.45rem 0.5rem;
	margin-bottom: 0.2rem;
	border: 1px solid transparent;
	border-radius: 8px;
	background: transparent;
	color: inherit;
	text-align: left;
	cursor: pointer;
	font-size: 0.78rem;
	line-height: 1.35;
}

.qj-paipu-step-item:hover {
	background: rgba(255, 255, 255, 0.05);
}

.qj-paipu-step-item.is-current {
	border-color: rgba(232, 200, 150, 0.55);
	background: rgba(201, 164, 92, 0.14);
}

.qj-paipu-step-item__num {
	font-variant-numeric: tabular-nums;
	opacity: 0.92;
	font-size: 1.38rem;
	font-weight: 700;
	text-align: center;
}

.qj-paipu-step-item__body {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem 0.4rem;
	min-width: 0;
}

.qj-paipu-step-item__player {
	font-weight: 700;
	color: #e8c896;
}

.qj-paipu-step-item__action {
	opacity: 0.92;
}

.qj-paipu-table-wrap {
	border-radius: 12px;
	padding: 0;
	background: #080604;
	border: none;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
	position: relative;
	--qj-tile-w: 1.72rem;
	--qj-tile-h: 2.28rem;
	--qj-tile-gap: 0.09rem;
}

.qj-paipu-table {
	font-size: 1.12rem;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr);
	grid-template-rows: auto minmax(0, 1fr) auto;
	gap: 0.45rem;
	min-height: 0;
	padding: 0.55rem;
	border-radius: 10px;
	position: relative;
	overflow: visible;
	border: 7px solid #5a3820;
	box-shadow: inset 0 0 0 1px rgba(232, 200, 150, 0.12);
	background:
		radial-gradient(ellipse 90% 80% at 50% 45%, rgba(255, 255, 255, 0.06) 0%, transparent 55%),
		radial-gradient(ellipse at center, #1f7a55 0%, #186848 42%, #124f38 100%);
	box-shadow: inset 0 0 48px rgba(0, 0, 0, 0.35);
}

.qj-paipu-seat {
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.22);
	padding: 0.35rem 0.45rem;
	font-size: 0.78em;
	border: 2px solid rgba(255, 255, 255, 0.08);
	box-shadow: none;
	transition: border-color 0.15s ease, background 0.15s ease;
	display: flex;
	flex-direction: column;
	position: relative;
}

.qj-paipu-seat.is-active .qj-paipu-seat__score {
	border-color: rgba(255, 220, 150, 0.72);
	color: #fff3d0;
	box-shadow:
		inset 0 1px 0 rgba(255, 240, 200, 0.22),
		0 0 10px rgba(255, 210, 120, 0.28),
		0 2px 8px rgba(0, 0, 0, 0.38);
}

.qj-paipu-tile.is-highlight {
	position: relative;
	z-index: 1;
	box-shadow:
		inset 0 0 0 2px #ffd54f,
		0 0 8px rgba(255, 213, 79, 0.55);
}

.qj-paipu-meld.is-highlight {
	box-shadow: 0 0 0 2px #ffd54f;
	border-radius: 4px;
}

.qj-paipu-seat.is-active {
	border-color: rgba(255, 220, 150, 0.85);
	background: rgba(0, 0, 0, 0.32);
	box-shadow: inset 0 0 16px rgba(255, 210, 120, 0.1);
}

.qj-paipu-seat__head {
	display: flex;
	justify-content: center;
	align-items: flex-start;
	gap: 0.5rem;
	margin-bottom: 0.4rem;
	font-weight: 600;
	min-height: 2.75rem;
	padding-right: 4.25rem;
}

.qj-paipu-seat__player {
	display: flex;
	flex-direction: column;
	gap: 0.12rem;
	min-width: 0;
	max-width: 100%;
	border: none;
	padding: 0;
	margin: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
	border-radius: 6px;
	align-items: flex-start;
}

.qj-paipu-seat__player:hover,
.qj-paipu-seat__player:focus-visible {
	outline: none;
	box-shadow: 0 0 0 2px rgba(255, 220, 150, 0.35);
}

.qj-paipu-seat--bottom .qj-paipu-seat__player,
.qj-paipu-seat--top .qj-paipu-seat__player,
.qj-paipu-seat--left .qj-paipu-seat__player,
.qj-paipu-seat--right .qj-paipu-seat__player {
	align-items: center;
	text-align: left;
}

.qj-paipu-seat__player:hover .qj-paipu-seat__nick,
.qj-paipu-seat__player:focus-visible .qj-paipu-seat__nick {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.qj-paipu-seat__identity {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.2rem;
	padding: 0.5rem 0.9rem;
	border: 1px solid rgba(232, 200, 150, 0.5);
	border-radius: 10px;
	background:
		linear-gradient(165deg, rgba(36, 28, 48, 0.94) 0%, rgba(14, 11, 22, 0.9) 100%);
	box-shadow:
		inset 0 1px 0 rgba(255, 230, 180, 0.14),
		0 3px 10px rgba(0, 0, 0, 0.32);
	min-width: 8.75rem;
	max-width: 11.5rem;
	width: max-content;
	text-align: left;
}

.qj-paipu-seat__nick {
	font-weight: 700;
	color: #ffe8b8;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
	font-size: 0.92em;
	line-height: 1.25;
}

.qj-paipu-seat__duanwei {
	font-size: 0.82em;
	font-weight: 600;
	color: #e8c896;
	opacity: 0.95;
	text-align: left;
	width: 100%;
}

.qj-paipu-seat__duanwei.is-empty {
	display: none;
}

.qj-paipu-seat__uid {
	font-size: 0.68em;
	font-weight: 500;
	opacity: 0.72;
	font-family: ui-monospace, monospace;
	word-break: break-all;
	min-height: 0.95rem;
}

.qj-paipu-seat__uid.is-empty {
	visibility: hidden;
}

.qj-paipu-seat__badge {
	flex-shrink: 0;
	padding: 0.15rem 0.45rem;
	border-radius: 999px;
	font-size: 0.68em;
	font-weight: 700;
	background: rgba(255, 220, 150, 0.22);
	color: #ffe8b8;
}

.qj-paipu-seat__action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-wrap: nowrap;
	gap: 0.4rem;
	margin: 0.35rem auto 0.25rem;
	padding: 0.38rem 0.72rem;
	min-width: 7.75rem;
	max-width: 100%;
	border-radius: 999px;
	border: 1px solid rgba(232, 200, 150, 0.42);
	background: linear-gradient(165deg, rgba(36, 28, 48, 0.92) 0%, rgba(14, 11, 22, 0.88) 100%);
	box-shadow:
		inset 0 1px 0 rgba(255, 230, 180, 0.12),
		0 2px 8px rgba(0, 0, 0, 0.28);
	font-size: 0.78em;
	font-weight: 700;
	color: #ffe8b8;
	min-height: 1.95rem;
	height: auto;
	overflow: hidden;
	visibility: hidden;
	opacity: 0;
	transform: translateY(2px);
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.qj-paipu-seat__action.is-visible {
	visibility: visible;
	opacity: 1;
	transform: translateY(0);
}

.qj-paipu-seat.is-active .qj-paipu-seat__action.is-visible {
	border-color: rgba(255, 220, 150, 0.72);
	color: #fff3d0;
	box-shadow:
		inset 0 1px 0 rgba(255, 240, 200, 0.2),
		0 0 10px rgba(255, 210, 120, 0.22),
		0 2px 8px rgba(0, 0, 0, 0.32);
}

.qj-paipu-seat__action [data-seat-action-text] {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	min-width: 0;
	flex: 1 1 auto;
}

.qj-paipu-seat__action [data-seat-action-tile] {
	flex: 0 0 1.12rem;
	width: 1.12rem;
	height: 1.48rem;
}

.qj-paipu-seat__action[hidden] {
	display: none !important;
}

.qj-paipu-seat--top {
	grid-column: 2;
	grid-row: 1;
	align-items: center;
	justify-self: center;
	width: 130%;
	max-width: none;
	z-index: 2;
}

.qj-paipu-seat--top .qj-paipu-seat__identity {
	min-width: 11.4rem;
	max-width: 15rem;
}

.qj-paipu-seat--top .qj-paipu-seat__head,
.qj-paipu-seat--top .qj-paipu-melds,
.qj-paipu-seat--top .qj-paipu-tiles,
.qj-paipu-seat--top .qj-paipu-seat__action {
	align-self: center;
	justify-content: center;
	text-align: center;
}

.qj-paipu-seat--top .qj-paipu-seat__head {
	justify-content: center;
}

.qj-paipu-seat--top .qj-paipu-tiles,
.qj-paipu-seat--top .qj-paipu-melds {
	width: 100%;
}

.qj-paipu-seat--left {
	grid-column: 1;
	grid-row: 2;
	align-items: center;
}

.qj-paipu-seat--left .qj-paipu-seat__head,
.qj-paipu-seat--left .qj-paipu-melds,
.qj-paipu-seat--left .qj-paipu-tiles,
.qj-paipu-seat--left .qj-paipu-seat__action,
.qj-paipu-seat--right .qj-paipu-seat__head,
.qj-paipu-seat--right .qj-paipu-melds,
.qj-paipu-seat--right .qj-paipu-tiles,
.qj-paipu-seat--right .qj-paipu-seat__action {
	align-self: center;
	justify-content: center;
	text-align: center;
}

.qj-paipu-seat--left .qj-paipu-seat__head,
.qj-paipu-seat--right .qj-paipu-seat__head {
	justify-content: center;
	width: 100%;
}

.qj-paipu-seat--left .qj-paipu-tiles,
.qj-paipu-seat--left .qj-paipu-melds,
.qj-paipu-seat--right .qj-paipu-tiles,
.qj-paipu-seat--right .qj-paipu-melds {
	margin-left: auto;
	margin-right: auto;
}

.qj-paipu-seat--center {
	grid-column: 2;
	grid-row: 2;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	justify-content: stretch;
	text-align: center;
	background: rgba(0, 0, 0, 0.18);
	border: 1px dashed rgba(255, 255, 255, 0.12);
	border-radius: 8px;
	padding: 0.35rem;
	min-height: 0;
	overflow: visible;
}

.qj-paipu-river {
	display: grid;
	grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr) minmax(0, 0.95fr);
	grid-template-rows: auto auto auto;
	gap: 0.22rem 0.3rem;
	width: 100%;
	height: auto;
	min-height: 0;
	align-items: start;
}

.qj-paipu-river__turn {
	grid-column: 2;
	grid-row: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
}

.qj-paipu-discards--river-top {
	grid-column: 1 / -1;
	grid-row: 1;
}

.qj-paipu-discards--river-left {
	grid-column: 1;
	grid-row: 2;
}

.qj-paipu-discards--river-right {
	grid-column: 3;
	grid-row: 2;
}

.qj-paipu-discards--river-bottom {
	grid-column: 1 / -1;
	grid-row: 3;
}

.qj-paipu-turn {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.28rem;
	padding: 0.55rem 0.75rem;
	width: 100%;
	text-align: center;
}

.qj-paipu-turn__seat {
	display: inline-block;
	padding: 0.18rem 0.62rem;
	border-radius: 999px;
	border: 1px solid rgba(232, 200, 150, 0.42);
	background: rgba(232, 200, 150, 0.12);
	font-family: var(--qj-font-display);
	font-size: 0.92em;
	font-weight: 700;
	color: #ffe8b8;
	letter-spacing: 0.04em;
}

.qj-paipu-turn__seat[hidden] {
	display: none !important;
}

.qj-paipu-turn__player {
	font-family: var(--qj-font-display);
	font-size: 1.05em;
	font-weight: 700;
	color: #e8c896;
	min-height: 1.2rem;
}

.qj-paipu-turn__player[hidden] {
	display: none !important;
}

.qj-paipu-turn__action {
	font-family: var(--qj-font-display);
	font-size: 1.2em;
	font-weight: 700;
	letter-spacing: 0.03em;
	color: #fff8ea;
}

.qj-paipu-turn__tile {
	display: flex;
	justify-content: center;
	margin-top: 0.35rem;
	min-height: 3rem;
}

.qj-paipu-seat--right {
	grid-column: 3;
	grid-row: 2;
	align-items: center;
}

.qj-paipu-seat--bottom {
	grid-column: 1 / -1;
	grid-row: 3;
	align-items: center;
}

.qj-paipu-seat--bottom .qj-paipu-seat__head,
.qj-paipu-seat--bottom .qj-paipu-melds,
.qj-paipu-seat--bottom .qj-paipu-tiles {
	width: 100%;
	justify-content: center;
	text-align: center;
}

.qj-paipu-seat--bottom .qj-paipu-seat__action {
	width: auto;
	max-width: min(100%, 20rem);
	min-width: 0;
	margin-left: auto;
	margin-right: auto;
	justify-content: center;
	text-align: center;
}

.qj-paipu-seat--bottom .qj-paipu-seat__action.is-visible {
	padding: 0.34rem 0.52rem;
	gap: 0.28rem;
	min-width: 0;
}

.qj-paipu-seat--bottom .qj-paipu-seat__action [data-seat-action-text] {
	flex: 0 1 auto;
}

.qj-paipu-seat--bottom .qj-paipu-seat__head {
	justify-content: center;
}

.qj-paipu-seat--bottom .qj-paipu-tiles,
.qj-paipu-seat--bottom .qj-paipu-melds {
	margin-left: auto;
	margin-right: auto;
}

.qj-paipu-tiles {
	display: grid;
	grid-template-columns: repeat(14, var(--qj-tile-w, 1.32rem));
	grid-template-rows: var(--qj-tile-h, 1.72rem);
	gap: var(--qj-tile-gap, 0.07rem);
	margin-top: 0.2rem;
	width: calc(var(--qj-tile-w, 1.32rem) * 14 + var(--qj-tile-gap, 0.07rem) * 13);
	height: var(--qj-tile-h, 1.72rem);
	min-height: var(--qj-tile-h, 1.72rem);
	max-height: var(--qj-tile-h, 1.72rem);
	flex-shrink: 0;
}

.qj-paipu-tiles--side {
	grid-template-columns: repeat(7, var(--qj-tile-w, 1.32rem));
	grid-template-rows: repeat(2, var(--qj-tile-h, 1.72rem));
	width: calc(var(--qj-tile-w, 1.32rem) * 7 + var(--qj-tile-gap, 0.07rem) * 6);
	height: calc(var(--qj-tile-h, 1.72rem) * 2 + var(--qj-tile-gap, 0.07rem));
	min-height: calc(var(--qj-tile-h, 1.72rem) * 2 + var(--qj-tile-gap, 0.07rem));
	max-height: calc(var(--qj-tile-h, 1.72rem) * 2 + var(--qj-tile-gap, 0.07rem));
}

.qj-paipu-melds {
	display: flex;
	flex-wrap: wrap;
	align-content: flex-start;
	justify-content: center;
	gap: var(--qj-tile-gap, 0.07rem);
	margin-top: 0.2rem;
	min-height: var(--qj-tile-h, 1.72rem);
	max-height: var(--qj-tile-h, 1.72rem);
	overflow: hidden;
	flex-shrink: 0;
}

.qj-paipu-discards {
	--qj-discard-w: 1.22rem;
	--qj-discard-h: 1.58rem;
	display: grid;
	grid-template-columns: repeat(8, var(--qj-discard-w));
	grid-auto-rows: var(--qj-discard-h);
	align-content: flex-start;
	justify-content: center;
	gap: 0.1rem;
	margin-top: 0;
	min-height: calc(var(--qj-discard-h) * 1 + 0.1rem);
	max-height: calc(var(--qj-discard-h) * 3 + 0.1rem * 2);
	overflow-x: hidden;
	overflow-y: auto;
	flex-shrink: 1;
	padding: 0.24rem 0.32rem;
	border-radius: 5px;
	background: rgba(0, 0, 0, 0.28);
	border: 1px dashed rgba(232, 200, 150, 0.22);
}

.qj-paipu-discards--river-side {
	grid-template-columns: repeat(3, var(--qj-discard-w));
	min-height: 0;
	justify-content: center;
	align-content: start;
}

.qj-paipu-discards--river-top,
.qj-paipu-discards--river-bottom {
	grid-template-columns: repeat(9, var(--qj-discard-w));
}

.qj-paipu-discards--river {
	background: none;
	border: none;
	padding: 0;
	max-height: none;
	min-height: 0;
	overflow: visible;
	flex-shrink: 0;
}

.qj-paipu-tile {
	position: relative;
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: var(--qj-tile-w, 1.32rem);
	height: var(--qj-tile-h, 1.72rem);
	border-radius: 4px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
	background:
		url('/theme/paipu/tiles/tile-bg.png') center / cover no-repeat,
		linear-gradient(165deg, #faf8f2 0%, #ece6d8 50%, #ddd4c4 100%);
}

.qj-paipu-tile__face {
	display: block;
	width: 88%;
	height: 86%;
	object-fit: contain;
	pointer-events: none;
	user-select: none;
}

.qj-paipu-tile--lg {
	width: 2.2rem;
	height: 2.95rem;
}

.qj-paipu-tile--sm {
	width: 1.05rem;
	height: 1.38rem;
}

.qj-paipu-tile--discard {
	width: var(--qj-discard-w, 1.18rem);
	height: var(--qj-discard-h, 1.55rem);
	filter: saturate(0.88) brightness(0.94);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.28),
		0 1px 2px rgba(0, 0, 0, 0.42);
}

.qj-paipu-tiles .qj-paipu-tile:not(.qj-paipu-tile--slot-empty) {
	box-shadow:
		inset 0 0 0 1px rgba(255, 255, 255, 0.22),
		0 2px 5px rgba(0, 0, 0, 0.48);
}

.qj-paipu-tile.is-dora {
	box-shadow:
		inset 0 0 0 2px #ffb74d,
		0 0 7px rgba(255, 183, 77, 0.5);
}

.qj-paipu-tile.is-red5.is-dora {
	box-shadow:
		inset 0 0 0 2px #ff8a65,
		0 0 7px rgba(255, 138, 101, 0.55);
}

.qj-paipu-tile--dora {
	width: 2.1rem;
	height: 2.76rem;
}

.qj-paipu-tile--slot-empty {
	opacity: 0.28;
	box-shadow: none;
}

.qj-paipu-discards .qj-paipu-tile {
	opacity: 0.96;
	transform: none;
}

.qj-paipu-meld {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	margin-right: 0.35rem;
}

.qj-paipu-meld__tag {
	font-size: 0.65em;
	opacity: 0.7;
}

.qj-paipu-controls {
	display: grid;
	grid-template-columns: auto auto auto minmax(0, 1fr) auto;
	gap: 0.65rem;
	align-items: center;
	margin-top: 0.65rem;
	position: relative;
	z-index: 8;
	flex-shrink: 0;
}

.qj-paipu-controls select {
	padding: 0.45rem 0.5rem;
	border-radius: 8px;
	border: 1px solid rgba(232, 200, 150, 0.35);
	background: rgba(13, 10, 20, 0.8);
	color: inherit;
	font-size: 0.82rem;
	cursor: pointer;
}

.qj-paipu-controls [data-paipu-autoplay][aria-pressed='true'] {
	background: rgba(201, 164, 92, 0.28);
	border-color: rgba(232, 200, 150, 0.55);
}

.qj-paipu-progress {
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 0.5rem 0.65rem;
	align-items: center;
	min-width: 0;
}

.qj-paipu-progress__label {
	font-size: 0.82rem;
	font-weight: 600;
	color: #e8c896;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.qj-paipu-progress__jump {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.78rem;
	white-space: nowrap;
}

.qj-paipu-progress__jump input[type='number'] {
	width: 3.5rem;
	padding: 0.3rem 0.35rem;
	border-radius: 6px;
	border: 1px solid rgba(232, 200, 150, 0.35);
	background: rgba(13, 10, 20, 0.8);
	color: inherit;
	font-size: 0.82rem;
	font-variant-numeric: tabular-nums;
}

.qj-paipu-progress__total {
	opacity: 0.75;
	font-variant-numeric: tabular-nums;
}

.qj-paipu-controls button {
	padding: 0.5rem 1rem;
	border-radius: 8px;
	border: 1px solid rgba(232, 200, 150, 0.4);
	background: rgba(232, 200, 150, 0.12);
	color: inherit;
	cursor: pointer;
	font-weight: 600;
}

.qj-paipu-controls input[type='range'] {
	width: 100%;
	accent-color: #e8c896;
}

.qj-paipu-hint {
	margin-top: 0.75rem;
	font-size: 0.8rem;
	opacity: 0.65;
}

@media (max-width: 900px) {
	.qj-paipu-page {
		padding: 1.25rem 0.85rem 5.5rem;
	}

	.qj-paipu-layout {
		grid-template-columns: 1fr;
		gap: 0.65rem;
	}

	.qj-paipu-meta,
	.qj-paipu-steps-wrap,
	.qj-paipu-table-wrap,
	.qj-paipu-controls,
	.qj-paipu-hint {
		grid-column: auto;
		grid-row: auto;
	}

	.qj-paipu-steps {
		position: static;
		max-height: none;
	}

	.qj-paipu-steps__list {
		max-height: 180px;
	}

	.qj-paipu-replay {
		padding: 0.65rem;
	}

	.qj-paipu-meta {
		font-size: 0.82rem;
		gap: 0.35rem 0.75rem;
	}

	.qj-paipu-meta__action {
		flex: 1 1 100%;
	}
}

@media (max-width: 720px) {
	.qj-paipu-table-wrap {
		--qj-tile-w: 1.02rem;
		--qj-tile-h: 1.34rem;
		padding: 0.35rem;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.qj-paipu-table {
		display: flex;
		flex-direction: column;
		gap: 0.4rem;
		min-width: min(100%, 20rem);
		padding: 0.4rem;
	}

	.qj-paipu-seat--top,
	.qj-paipu-seat--left,
	.qj-paipu-seat--center,
	.qj-paipu-seat--right,
	.qj-paipu-seat--bottom {
		grid-column: auto;
		grid-row: auto;
	}

	.qj-paipu-seat--center {
		order: 0;
		padding: 0.5rem;
	}

	.qj-paipu-seat--bottom {
		order: 1;
	}

	.qj-paipu-seat--top {
		order: 2;
	}

	.qj-paipu-seat--left {
		order: 3;
	}

	.qj-paipu-seat--right {
		order: 4;
	}

	.qj-paipu-turn__action {
		font-size: 1rem;
	}

	.qj-paipu-seat__uid {
		display: none;
	}

	/* ponytail: 窄屏统一 7×2 手牌，避免 14 列撑出横向滚动 */
	.qj-paipu-tiles {
		grid-template-columns: repeat(7, var(--qj-tile-w));
		grid-template-rows: repeat(2, var(--qj-tile-h));
		width: calc(var(--qj-tile-w) * 7 + var(--qj-tile-gap) * 6);
		height: calc(var(--qj-tile-h) * 2 + var(--qj-tile-gap));
		min-height: calc(var(--qj-tile-h) * 2 + var(--qj-tile-gap));
		max-height: calc(var(--qj-tile-h) * 2 + var(--qj-tile-gap));
		overflow: visible;
	}

	.qj-paipu-controls {
		position: sticky;
		bottom: 0;
		z-index: 8;
		margin-top: 0.75rem;
		margin-left: -0.65rem;
		margin-right: -0.65rem;
		margin-bottom: -0.65rem;
		padding: 0.65rem 0.5rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
		background: rgba(8, 6, 14, 0.96);
		border-top: 1px solid rgba(232, 200, 150, 0.22);
		backdrop-filter: blur(8px);
		grid-template-columns: auto 1fr;
	}

	.qj-paipu-progress {
		grid-column: 1 / -1;
		grid-template-columns: 1fr;
		gap: 0.35rem;
	}

	.qj-paipu-progress__label {
		justify-self: center;
	}

	.qj-paipu-controls button {
		min-height: 44px;
		min-width: 44px;
		padding: 0.55rem 0.75rem;
		font-size: 0.9rem;
		touch-action: manipulation;
	}

	.qj-paipu-controls input[type='range'] {
		min-height: 44px;
	}

	.qj-paipu-step-item {
		padding: 0.55rem 0.5rem;
		min-height: 44px;
	}

	.qj-paipu-hint {
		font-size: 0.75rem;
		padding-bottom: 0.25rem;
	}
}

@media (min-width: 901px) {
	body.qj-paipu-body {
		overflow: hidden;
		height: 100dvh;
	}

	body.qj-paipu-body .qj-footer,
	body.qj-paipu-body .qj-totop {
		display: none !important;
	}

	body.qj-paipu-body .qj-news-page {
		min-height: 0;
		height: 100dvh;
		display: flex;
		flex-direction: column;
		overflow: hidden;
	}

	.qj-paipu-page {
		flex: 1;
		min-height: 0;
		max-width: none;
		width: 100%;
		padding: 0;
		margin: 0;
		display: flex;
		flex-direction: column;
	}

	body.qj-paipu-body--landing .qj-paipu-page {
		justify-content: center;
		align-items: center;
	}

	.qj-paipu-landing {
		width: min(100%, 40rem);
		padding: 1rem 1.5rem;
	}

	.qj-paipu-landing__box {
		text-align: center;
	}

	.qj-paipu-landing .qj-paipu-page__lead {
		margin-bottom: 1.25rem;
	}

	.qj-paipu-search--landing {
		justify-content: center;
		max-width: 32rem;
		margin-left: auto;
		margin-right: auto;
	}

	.qj-paipu-search--landing input[type='text'] {
		font-size: 1.05rem;
		padding: 0.75rem 1rem;
	}

	.qj-paipu-search--landing button {
		padding: 0.75rem 1.35rem;
	}

	body.qj-paipu-body--replay .qj-paipu-session {
		flex: 1;
		min-height: 0;
		display: flex;
		flex-direction: column;
		padding: 0.25rem 0.65rem 0.4rem;
	}

	.qj-paipu-session__bar {
		flex-shrink: 0;
		margin-bottom: 0.25rem;
	}

	.qj-paipu-session .qj-paipu-loading {
		padding: 1rem;
		flex-shrink: 0;
	}

	.qj-paipu-replay {
		flex: 1;
		min-height: 0;
		display: flex;
		flex-direction: column;
		padding: 0.4rem;
		overflow: hidden;
	}

	.qj-paipu-layout {
		flex: 1;
		min-height: 0;
		height: 100%;
		grid-template-columns: minmax(288px, 346px) minmax(0, 1fr);
		grid-template-rows: minmax(0, 1fr);
		gap: 0.5rem;
		overflow: hidden;
		align-items: stretch;
	}

	.qj-paipu-meta {
		flex-shrink: 0;
		margin-bottom: 0.25rem;
	}

	.qj-paipu-hint {
		display: none;
	}

	.qj-paipu-steps-wrap {
		grid-column: 1;
		grid-row: 1;
		display: flex;
		flex-direction: column;
		min-height: 0;
		max-height: 100%;
		align-self: stretch;
		overflow: hidden;
	}

	.qj-paipu-table-col {
		grid-column: 2;
		grid-row: 1;
		flex: 1;
		min-height: 0;
		overflow: hidden;
	}

	.qj-paipu-table-wrap {
		flex: 1;
		box-sizing: border-box;
		align-self: stretch;
		padding: 0.75rem 0 0;
		min-height: 0;
		overflow: hidden;
		display: flex;
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
	}

	.qj-paipu-table {
		grid-template-rows: auto minmax(5rem, 1fr) auto;
		flex-shrink: 0;
		will-change: transform;
	}

	.qj-paipu-controls {
		flex-shrink: 0;
		margin-top: 0.35rem;
		justify-content: center;
		position: relative;
		z-index: 8;
	}

	.qj-paipu-seat--bottom {
		padding-top: 0.15rem;
		padding-bottom: 0.25rem;
		overflow: visible;
	}

	.qj-paipu-seat--center {
		min-height: 7.5rem;
	}

	.qj-paipu-seat--bottom .qj-paipu-tiles:not(.qj-paipu-tiles--side) {
		grid-template-columns: repeat(14, var(--qj-tile-w, 1.65rem));
		grid-template-rows: var(--qj-tile-h, 2.15rem);
		width: calc(var(--qj-tile-w, 1.65rem) * 14 + var(--qj-tile-gap, 0.08rem) * 13);
		height: var(--qj-tile-h, 2.15rem);
		min-height: var(--qj-tile-h, 2.15rem);
		max-height: var(--qj-tile-h, 2.15rem);
	}

	.qj-paipu-seat--bottom .qj-paipu-seat__head {
		margin-bottom: 0.15rem;
	}

	.qj-paipu-seat--left,
	.qj-paipu-seat--right {
		min-height: 8.5rem;
	}

	.qj-paipu-discards--river {
		--qj-discard-w: 1.34rem;
		--qj-discard-h: 1.74rem;
	}

	.qj-paipu-discards--river-top,
	.qj-paipu-discards--river-bottom {
		grid-template-columns: repeat(10, var(--qj-discard-w));
	}

	.qj-paipu-discards--river-side {
		grid-template-columns: repeat(3, var(--qj-discard-w));
	}

	.qj-paipu-steps {
		position: static;
		top: auto;
		flex: 1;
		height: 100%;
		max-height: 100%;
		min-height: 0;
		overflow: hidden;
	}

	.qj-paipu-steps__title {
		pointer-events: none;
		cursor: default;
		flex-shrink: 0;
	}

	.qj-paipu-steps__list {
		flex: 1 1 0;
		min-height: 0;
		overflow-y: auto;
		overscroll-behavior: contain;
		scroll-behavior: smooth;
	}

	.qj-paipu-turn__player {
		min-height: 1.25rem;
	}

	.qj-paipu-turn__player.is-empty {
		visibility: hidden;
	}

	.qj-paipu-melds {
		height: var(--qj-tile-h, 1.72rem);
	}
}

.qj-paipu-player-card[hidden] {
	display: none !important;
}

.qj-paipu-player-card {
	position: fixed;
	inset: 0;
	z-index: 1200;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.qj-paipu-player-card__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.qj-paipu-player-card__box {
	position: relative;
	z-index: 1;
	width: min(100%, 22rem);
	padding: 1.1rem 1.25rem 1.25rem;
	border-radius: 12px;
	background: #1a1428;
	border: 1px solid rgba(232, 200, 150, 0.25);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
	color: #f5efe6;
}

.qj-paipu-player-card__close {
	position: absolute;
	top: 0.45rem;
	right: 0.55rem;
	border: none;
	background: none;
	color: #e8c896;
	font-size: 1.35rem;
	line-height: 1;
	cursor: pointer;
}

.qj-paipu-player-card__heading {
	margin: 0 0 0.35rem;
	font-size: 1rem;
	font-weight: 700;
	color: #e8c896;
	letter-spacing: 0.04em;
}

.qj-paipu-player-card__nick {
	margin: 0 0 0.75rem;
	font-size: 1.15rem;
	font-weight: 600;
	color: #ffe8b8;
}

.qj-paipu-player-card__meta {
	margin: 0 0 1rem;
	display: grid;
	gap: 0.45rem;
	font-size: 0.88rem;
}

.qj-paipu-player-card__meta dt {
	opacity: 0.72;
	font-weight: 600;
}

.qj-paipu-player-card__meta dd {
	margin: 0.1rem 0 0;
}

.qj-paipu-player-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}

.qj-paipu-player-card__actions button {
	padding: 0.45rem 0.75rem;
	border-radius: 8px;
	border: 1px solid rgba(232, 200, 150, 0.35);
	background: rgba(255, 220, 150, 0.12);
	color: #ffe8b8;
	font-weight: 600;
	cursor: pointer;
}

.qj-paipu-player-card__report {
	border-color: rgba(255, 130, 130, 0.45) !important;
	background: rgba(160, 45, 45, 0.22) !important;
	color: #ffd0d0 !important;
}

.qj-paipu-player-card__list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 0.35rem;
	max-height: 12rem;
	overflow-y: auto;
}

.qj-paipu-player-card__list a {
	color: #e8c896;
	text-decoration: none;
}

.qj-paipu-player-card__list a:hover {
	text-decoration: underline;
}

.qj-paipu-player-card__hint {
	margin: 0.35rem 0 0;
	font-size: 0.82rem;
	opacity: 0.85;
}
