/**
 * YZ3C 积分 · 前台样式
 */

.yz3c-pts-store,
.yz3c-pts-wrap,
.yz3c-pts-card,
.yz3c-pts-detail,
.yz3c-pts-single,
.yz3c-pts-single-desc {
	--yz3c-pts-main: #FF5303;
	--yz3c-pts-main-soft: #FFF3ED;
	--yz3c-pts-line: #ececec;
	--yz3c-pts-text: #333333;
	--yz3c-pts-sub: #8a8a8a;
	--yz3c-pts-bg: #ffffff;
	font-size: 13px;
	line-height: 1.6;
	color: var(--yz3c-pts-text);
}

.darking .yz3c-pts-store,
.darking .yz3c-pts-wrap,
.darking .yz3c-pts-card,
.darking .yz3c-pts-detail {
	--yz3c-pts-main-soft: rgba(255, 83, 3, .14);
	--yz3c-pts-line: rgba(255, 255, 255, .1);
	--yz3c-pts-text: #dddddd;
	--yz3c-pts-sub: #8f9aa8;
	--yz3c-pts-bg: #252e3a;
}

/* ---------------- 按钮 ---------------- */

.yz3c-pts-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 34px;
	padding: 0 16px;
	border: 1px solid transparent;
	border-radius: 10px;
	background: transparent;
	color: var(--yz3c-pts-text);
	font-size: 13px;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: .2s ease;
	box-sizing: border-box;
}

.yz3c-pts-btn:hover {
	text-decoration: none;
	opacity: .9;
}

.yz3c-pts-btn-main {
	background: var(--yz3c-pts-main);
	border-color: var(--yz3c-pts-main);
	color: #ffffff !important;
}

.yz3c-pts-btn-ghost {
	background: transparent;
	border-color: var(--yz3c-pts-line);
	color: var(--yz3c-pts-text) !important;
}

.yz3c-pts-btn-disabled,
.yz3c-pts-btn[disabled] {
	background: #f0f0f0;
	border-color: #f0f0f0;
	color: #a8a8a8 !important;
	cursor: not-allowed;
	opacity: 1;
}

/* 已签到：浅色底 + 主色字（与账户页地址标签同色系） */
.yz3c-pts-btn.yz3c-pts-checkin-btn.is-checked,
.yz3c-pts-btn.yz3c-pts-checkin-btn.is-checked[disabled] {
	background: var(--yz3c-pts-main-soft);
	border-color: #FFD9CE;
	color: #B23A20 !important;
	cursor: default;
	opacity: 1;
}

.darking .yz3c-pts-btn-disabled,
.darking .yz3c-pts-btn[disabled] {
	background: rgba(255, 255, 255, .07);
	border-color: rgba(255, 255, 255, .07);
	color: #75808d !important;
}

.yz3c-pts-btn-block {
	display: flex;
	width: 100%;
}

.yz3c-pts-btn-sm {
	min-height: 30px;
	padding: 0 12px;
	font-size: 12px;
	border-radius: 8px;
}

/* ---------------- 顶部余额 ---------------- */

.yz3c-pts-hero {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	padding: 18px 18px;
	border-radius: 16px;
	background: linear-gradient(135deg, #FFF6F2 0%, #FFF0EA 100%);
	border: 1px solid #FFE1D6;
	margin-bottom: 14px;
}

.darking .yz3c-pts-hero {
	background: linear-gradient(135deg, rgba(255, 83, 3, .18) 0%, rgba(255, 83, 3, .06) 100%);
	border-color: rgba(255, 83, 3, .22);
}

.yz3c-pts-hero-left {
	display: flex;
	align-items: baseline;
	gap: 8px;
}

.yz3c-pts-hero-label {
	font-size: 13px;
	color: var(--yz3c-pts-sub);
}

.yz3c-pts-hero-num {
	font-size: 30px;
	line-height: 1;
	font-weight: 700;
	color: var(--yz3c-pts-main);
}

.yz3c-pts-guest-text {
	font-size: 13px;
	line-height: 1.5;
	color: var(--yz3c-pts-sub);
}

.yz3c-pts-hero-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.yz3c-pts-tip {
	margin-bottom: 16px;
	padding: 10px 12px;
	border-radius: 10px;
	background: var(--yz3c-pts-main-soft);
	color: var(--yz3c-pts-sub);
	font-size: 12px;
	line-height: 1.7;
}

.yz3c-pts-tip p {
	margin: 0;
}

/* ---------------- 分区标题 ---------------- */

.yz3c-pts-section-title {
	margin: 18px 0 10px;
	font-size: 15px;
	font-weight: 700;
	color: var(--yz3c-pts-text);
	line-height: 1.4;
}

.yz3c-pts-empty {
	color: var(--yz3c-pts-sub);
	font-size: 13px;
	padding: 12px 0;
}

.yz3c-pts-gate {
	padding: 40px 20px;
	text-align: center;
	border: 1px dashed var(--yz3c-pts-line);
	border-radius: 16px;
	background: var(--yz3c-pts-bg);
}

.yz3c-pts-gate h3 {
	margin: 0 0 8px;
	font-size: 17px;
}

.yz3c-pts-gate p {
	margin: 0 0 16px;
	color: var(--yz3c-pts-sub);
}

/* ---------------- 商品网格（沿用商店商品卡片） ---------------- */

.yz3c-pts-loop ul.products {
	margin: 0;
	padding: 0;
	clear: both;
}

.yz3c-pts-loop-meta {
	margin: 2px 0 8px;
	color: var(--yz3c-pts-sub);
	font-size: 11px;
	line-height: 1.5;
}

.yz3c-pts-loop-meta.is-warn {
	color: #d9534f;
}

.yz3c-pts-loop ul.products li.product .button {
	margin-top: 6px;
}

/* 与商店卡片字号保持一致 */
.yz3c-pts-loop ul.products li.product,
.yz3c-pts-loop ul.products li.product .woocommerce-loop-product__title,
.yz3c-pts-loop ul.products li.product .price {
	font-size: 14px;
}

.yz3c-pts-loop ul.products li.product .button.yz3c-pts-redeem-disabled {
	opacity: .55;
	cursor: default;
	pointer-events: none;
}

/* 立即兑换按钮统一用主题主色 */
.button.yz3c-pts-redeem-btn,
.yz3c-pts-loop ul.products li.product .button.yz3c-pts-redeem-btn,
.yz3c-pts-single-actions .button.yz3c-pts-redeem-btn {
	background: var(--yz3c-pts-main) !important;
	border-color: var(--yz3c-pts-main) !important;
	color: #fff !important;
}

.button.yz3c-pts-redeem-btn:hover,
.yz3c-pts-loop ul.products li.product .button.yz3c-pts-redeem-btn:hover,
.yz3c-pts-single-actions .button.yz3c-pts-redeem-btn:hover {
	background: #e64a00 !important;
	border-color: #e64a00 !important;
	color: #fff !important;
}

/* ---------------- 兑换记录 ---------------- */

.yz3c-pts-redeem-list {
	list-style: none;
	margin: 0 0 6px;
	padding: 0;
	border: 1px solid var(--yz3c-pts-line);
	border-radius: 12px;
	overflow: hidden;
	background: var(--yz3c-pts-bg);
}

.yz3c-pts-redeem-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 12px;
	border-bottom: 1px solid var(--yz3c-pts-line);
}

.yz3c-pts-redeem-row:last-child {
	border-bottom: 0;
}

.yz3c-pts-redeem-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.yz3c-pts-redeem-name {
	font-size: 13px;
	color: var(--yz3c-pts-text);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.yz3c-pts-redeem-meta {
	font-size: 11px;
	color: var(--yz3c-pts-sub);
}

.yz3c-pts-redeem-actions {
	display: flex;
	gap: 6px;
	flex-shrink: 0;
}

.yz3c-pts-redeem-status {
	flex-shrink: 0;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 11px;
	background: #f4f4f4;
	color: #777;
}

.darking .yz3c-pts-redeem-status {
	background: rgba(255, 255, 255, .08);
	color: #a9b3bf;
}

.yz3c-pts-redeem-status.is-pending,
.yz3c-pts-redeem-status.is-attached {
	background: var(--yz3c-pts-main-soft);
	color: var(--yz3c-pts-main);
}

.yz3c-pts-redeem-status.is-fulfilled {
	background: #eef7ee;
	color: #3f9c46;
}

.darking .yz3c-pts-redeem-status.is-fulfilled {
	background: rgba(63, 156, 70, .16);
	color: #7bd083;
}

/* ---------------- 表格（积分明细） ---------------- */

.yz3c-pts-table-wrap {
	overflow-x: auto;
	border: 1px solid var(--yz3c-pts-line);
	border-radius: 12px;
	background: var(--yz3c-pts-bg);
}

.yz3c-pts-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 12px;
}

.yz3c-pts-table th,
.yz3c-pts-table td {
	padding: 9px 12px;
	text-align: left;
	border-bottom: 1px solid var(--yz3c-pts-line);
	color: var(--yz3c-pts-text);
	white-space: nowrap;
}

.yz3c-pts-table th {
	color: var(--yz3c-pts-sub);
	font-weight: 500;
	background: rgba(0, 0, 0, .015);
}

.darking .yz3c-pts-table th {
	background: rgba(255, 255, 255, .03);
}

.yz3c-pts-table tr:last-child td {
	border-bottom: 0;
}

.yz3c-pts-table .is-num {
	text-align: right;
}

.yz3c-pts-table .is-plus {
	color: #2e9e4f;
}

.yz3c-pts-table .is-minus {
	color: var(--yz3c-pts-main);
}

/* 明细表：时间 / 类型 / 变动 / 余额 都在各自格内居中，备注保持左对齐 */
.yz3c-pts-table tr > th:nth-child(-n+4),
.yz3c-pts-table tr > td:nth-child(-n+4) {
	text-align: center;
}

.yz3c-pts-pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-top: 12px;
	color: var(--yz3c-pts-sub);
	font-size: 12px;
}

/* ---------------- 概览内「积分明细」区块 ---------------- */

.yz3c-pts-detail {
	margin: 26px 0 0;
	scroll-margin-top: 130px;
}

.yz3c-pts-detail .yz3c-pts-section-title:first-child {
	margin-top: 0;
}

.yz3c-pts-more {
	display: flex;
	justify-content: center;
	margin: 12px 0 0;
}

/* ---------------- 账户概览卡片 ---------------- */

.yz3c-pts-card {
	margin: 0 0 18px;
	padding: 14px 16px;
	border: 1px solid var(--yz3c-pts-line);
	border-radius: 14px;
	background: var(--yz3c-pts-bg);
	box-shadow: 0 2px 10px rgba(0, 0, 0, .03);
}

.darking .yz3c-pts-card {
	box-shadow: none;
}

.yz3c-pts-card-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 10px;
}

.yz3c-pts-card-title {
	font-size: 14px;
	font-weight: 700;
	color: var(--yz3c-pts-text);
}

.yz3c-pts-card-balance {
	display: flex;
	align-items: baseline;
	gap: 3px;
	color: var(--yz3c-pts-main);
}

.yz3c-pts-card-balance strong {
	font-size: 26px;
	line-height: 1;
	font-weight: 700;
}

.yz3c-pts-card-balance span {
	font-size: 12px;
}

.yz3c-pts-card-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 10px;
}

/* 积分规则说明（数值随后台规则同步） */
.yz3c-pts-card .yz3c-pts-rules {
	margin: 0 0 10px;
	color: var(--yz3c-pts-sub);
	font-size: 12px;
	line-height: 1.7;
}

.yz3c-pts-card .yz3c-pts-rules p {
	margin: 0 0 2px;
}

.yz3c-pts-pending {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 10px;
	margin-bottom: 10px;
	border-radius: 8px;
	background: var(--yz3c-pts-main-soft);
	color: var(--yz3c-pts-main);
	font-size: 12px;
}

.yz3c-pts-pending a {
	color: var(--yz3c-pts-main);
	font-weight: 700;
}

.yz3c-pts-log {
	list-style: none;
	margin: 0;
	padding: 0;
}

.yz3c-pts-log li {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 0;
	border-top: 1px dashed var(--yz3c-pts-line);
	font-size: 12px;
}

.yz3c-pts-log li:first-child {
	border-top: 0;
}

.yz3c-pts-log-type {
	flex: 1;
	color: var(--yz3c-pts-text);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.yz3c-pts-log-points {
	font-weight: 700;
	font-size: 13px;
}

.yz3c-pts-log-points.is-plus {
	color: #2e9e4f;
}

.yz3c-pts-log-points.is-minus {
	color: var(--yz3c-pts-main);
}

.yz3c-pts-log-time {
	color: var(--yz3c-pts-sub);
	font-size: 11px;
}

.yz3c-pts-note {
	padding: 10px 12px;
	margin-bottom: 16px;
	border-radius: 10px;
	background: rgba(0, 0, 0, .035);
	color: var(--yz3c-pts-sub);
	font-size: 12px;
}

.darking .yz3c-pts-note {
	background: rgba(255, 255, 255, .06);
}

/* ---------------- Toast ---------------- */

.yz3c-pts-toast {
	position: fixed;
	left: 50%;
	bottom: calc(80px + env(safe-area-inset-bottom));
	transform: translate(-50%, 12px);
	z-index: 100000;
	max-width: 86vw;
	padding: 10px 16px;
	border-radius: 10px;
	background: rgba(30, 30, 30, .92);
	color: #ffffff;
	font-size: 13px;
	line-height: 1.5;
	text-align: center;
	opacity: 0;
	pointer-events: none;
	transition: .25s ease;
}

.yz3c-pts-toast.is-show {
	opacity: 1;
	transform: translate(-50%, 0);
}

.yz3c-pts-toast.is-error {
	background: rgba(196, 62, 44, .95);
}

/* ---------------- 移动端 ---------------- */

@media (max-width: 600px) {
	.yz3c-pts-store,
	.yz3c-pts-wrap {
		font-size: 13px;
	}

	.yz3c-pts-hero {
		padding: 14px;
		border-radius: 14px;
	}

	.yz3c-pts-hero-num {
		font-size: 26px;
	}

	.yz3c-pts-loop ul.products li.product {
		padding: 8px;
	}

	.yz3c-pts-redeem-row {
		flex-wrap: wrap;
	}

	.yz3c-pts-table thead {
		display: none;
	}

	.yz3c-pts-table,
	.yz3c-pts-table tbody,
	.yz3c-pts-table tr,
	.yz3c-pts-table td {
		display: block;
		width: 100%;
	}

	.yz3c-pts-table tr {
		padding: 8px 0;
		border-bottom: 1px solid var(--yz3c-pts-line);
	}

	.yz3c-pts-table td {
		display: flex;
		justify-content: space-between;
		gap: 12px;
		padding: 4px 12px;
		border-bottom: 0;
		white-space: normal;
		text-align: right;
	}

	.yz3c-pts-table td::before {
		content: attr(data-label);
		color: var(--yz3c-pts-sub);
		flex-shrink: 0;
	}

	.yz3c-pts-table .is-num {
		text-align: right;
	}

	/* 概览内明细：移动端两行式，时间/变动在上，类型/余额在下，备注最后 */
	.yz3c-pts-detail .yz3c-pts-table tr {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 2px 10px;
		padding: 8px 0;
		align-items: baseline;
	}

	.yz3c-pts-detail .yz3c-pts-table td {
		display: block;
		width: auto;
		padding: 0;
		text-align: left;
		font-size: 12px;
	}

	.yz3c-pts-detail .yz3c-pts-table td::before {
		content: none;
	}

	.yz3c-pts-detail .yz3c-pts-table td[data-label="时间"] {
		grid-column: 1;
		grid-row: 1;
		font-weight: 600;
		white-space: nowrap;
	}

	.yz3c-pts-detail .yz3c-pts-table td[data-label="变动"] {
		grid-column: 2;
		grid-row: 1;
		text-align: right;
		font-size: 13px;
		font-weight: 600;
		white-space: nowrap;
	}

	.yz3c-pts-detail .yz3c-pts-table td[data-label="类型"] {
		grid-column: 1;
		grid-row: 2;
		font-size: 11px;
		color: var(--yz3c-pts-sub);
	}

	.yz3c-pts-detail .yz3c-pts-table td[data-label="类型"]::before {
		content: "类型：";
	}

	.yz3c-pts-detail .yz3c-pts-table td[data-label="余额"] {
		grid-column: 2;
		grid-row: 2;
		text-align: right;
		font-size: 11px;
		color: var(--yz3c-pts-sub);
		white-space: nowrap;
	}

	.yz3c-pts-detail .yz3c-pts-table td[data-label="余额"]::before {
		content: "余额：";
	}

	.yz3c-pts-detail .yz3c-pts-table td[data-label="备注"] {
		grid-column: 1 / -1;
		grid-row: 3;
		font-size: 11px;
		line-height: 1.5;
		color: var(--yz3c-pts-sub);
	}
}

/* 积分商品详情页 */
.yz3c-pts-single-back {
	margin: 0 0 16px;
}

.yz3c-pts-single-back a {
	color: var(--yz3c-pts-sub);
	text-decoration: none;
}

.yz3c-pts-single {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 32px;
	align-items: start;
}

.yz3c-pts-single-media img {
	width: 100%;
	height: auto;
	border-radius: 8px;
	display: block;
}

.yz3c-pts-single-title {
	margin: 0 0 12px;
	font-size: 22px;
	line-height: 1.35;
}

.yz3c-pts-single-price {
	font-size: 15px;
	color: var(--yz3c-pts-main);
	margin-bottom: 10px;
}

.yz3c-pts-single-price strong {
	font-size: 28px;
	font-weight: 700;
}

.yz3c-pts-single-meta {
	font-size: 13px;
	color: var(--yz3c-pts-sub);
	margin-bottom: 20px;
}

.yz3c-pts-single-actions {
	margin-bottom: 16px;
}

.yz3c-pts-single-actions .button {
	display: inline-block;
	padding: 10px 28px;
	border-radius: 6px;
	background: var(--yz3c-pts-main);
	border: 0;
	color: #fff;
	font-size: 15px;
	text-decoration: none;
}

.yz3c-pts-single-actions .button.disabled {
	background: #eee;
	color: #999 !important;
	cursor: default;
}

.yz3c-pts-single-tip {
	font-size: 12px;
	line-height: 1.7;
	color: var(--yz3c-pts-sub);
	background: #FAFAFA;
	border-radius: 6px;
	padding: 10px 12px;
}

.yz3c-pts-single-desc {
	margin-top: 40px;
	padding-top: 24px;
	border-top: 1px solid #EEE;
}

.yz3c-pts-single-desc h3 {
	margin: 0 0 12px;
	font-size: 16px;
}

.yz3c-pts-single-desc img {
	max-width: 100%;
	height: auto;
}

@media (max-width: 768px) {
	.yz3c-pts-single {
		grid-template-columns: 1fr;
		gap: 18px;
	}

	.yz3c-pts-single-title {
		font-size: 18px;
	}

	.yz3c-pts-single-price strong {
		font-size: 24px;
	}
}
