.pfp-tier-table-wrap {
	margin: 12px 0 16px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.pfp-tier-table-wrap:empty {
	display: none;
}

.pfp-tier-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	line-height: 1.4;
}

.pfp-tier-table th,
.pfp-tier-table td {
	border: 1px solid #e3e3e3;
	padding: 8px 10px;
	text-align: center;
	white-space: nowrap;
}

/* 最左/最右单元格两侧内边距一致，均为 10px */
.pfp-tier-table th:first-child,
.pfp-tier-table td:first-child,
.pfp-tier-table th:last-child,
.pfp-tier-table td:last-child {
	padding-left: 10px;
	padding-right: 10px;
}

.pfp-tier-table th[scope="row"] {
	text-align: center;
	font-weight: 600;
	background: #fafafa;
	width: 1%;
	white-space: nowrap;
}

/* 选中档位仅改背景与边框颜色，不改变字体粗细，也不额外描边（避免相邻单元格出现两条线） */
.pfp-tier-table td.pfp-active {
	background: #fff3e0;
	border-color: #f0b36a;
}

/* 折叠表格中左右相邻的竖线取「左侧单元格」的边框色，
   因此选中时还需把左邻单元格的右边框一起改色，左侧竖线才会高亮 */
.pfp-tier-table td[data-qty]:has(+ td[data-qty].pfp-active),
.pfp-tier-table th[scope="row"]:has(+ td.pfp-active) {
	border-right-color: #f0b36a;
}

/* 阶梯表可点选：同步数量输入框 */
.pfp-tier-table td[data-qty] {
	cursor: pointer;
	user-select: none;
	-webkit-user-select: none;
	transition: background-color 0.15s ease;
}

.pfp-tier-table td[data-qty]:hover {
	background: #eef5ff;
}

.pfp-tier-table td[data-qty].pfp-active:hover {
	background: #ffe7c7;
}

/* 鼠标悬停时，同一档位的数量与价格单元格一起高亮 */
.pfp-tier-table td[data-qty].pfp-hover {
	background: #eef5ff;
}

.pfp-tier-table td[data-qty].pfp-active.pfp-hover {
	background: #ffe7c7;
}

/* 数量输入框：避免多位数被裁切（宽度由 JS 按数值长度自适应） */
form.cart .ux-quantity {
	max-width: 100%;
}

/* 购物车页数量框：最小宽度按 99999 显示，宽度随数值长度自适应 */
.woocommerce-cart .quantity input.qty,
.woocommerce-cart-form .quantity input.qty {
	box-sizing: border-box;
	min-width: 72px;
	text-align: center;
}

form.cart .ux-quantity input.qty.pfp-qty {
	box-sizing: border-box;
	text-align: center;
}

/* 长按 +/- 时禁用文本选中与长按菜单 */
form.cart .ux-quantity .ux-quantity__button {
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
	touch-action: manipulation;
}

/* 列表价格前缀 From：字号比价格小 */
.pfp-from {
	font-size: 0.75em;
	font-weight: 400;
	opacity: 0.8;
	margin-right: 2px;
}

@media (max-width: 480px) {
	.pfp-tier-table {
		font-size: 13px;
	}

	.pfp-tier-table th,
	.pfp-tier-table td {
		padding: 6px 8px;
	}
}
