/* ===== 在线签名设计页 ===== */
/* body 是 column flex 布局（style.css）：flex 项上 margin: 0 auto + 宽度 auto
   会阻止交叉轴 stretch、改按 max-content 定宽（手机上被撑到 ~940px 出现横向滚动），
   因此显式钉 width: 100%，桌面居中仍由 max-width + margin auto 完成。 */
.signature-page {
	max-width: 1200px;
	width: 100%;
	margin: 0 auto;
	padding: 20px 18px 64px;
}

/* --- Hero：品牌渐变横幅 --- */
.sig-hero {
	position: relative;
	overflow: hidden;
	border-radius: 24px;
	padding: 64px 24px 56px;
	text-align: center;
	background: linear-gradient(135deg, #fff0f3 0%, #ffe9ee 45%, #fff7f3 100%);
	border: 1px solid #ffdfe6;
}
.sig-hero::before,
.sig-hero::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	filter: blur(50px);
	pointer-events: none;
}
.sig-hero::before {
	width: 300px;
	height: 300px;
	background: rgba(246, 96, 125, 0.18);
	top: -110px;
	right: -70px;
}
.sig-hero::after {
	width: 240px;
	height: 240px;
	background: rgba(255, 171, 96, 0.16);
	bottom: -110px;
	left: -60px;
}
.sig-hero-inner {
	position: relative;
	z-index: 1;
	max-width: 680px;
	margin: 0 auto;
}
.sig-hero-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 16px;
	border-radius: 999px;
	background: #fff;
	border: 1px solid #ffd3dc;
	color: var(--fc-accent);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 1px;
	box-shadow: 0 4px 14px rgba(246, 96, 125, 0.14);
}
.sig-hero-title {
	margin: 20px 0 12px;
	font-size: 40px;
	line-height: 1.25;
	font-weight: 800;
	letter-spacing: 1px;
	background: linear-gradient(92deg, #e04468, #f6607d 55%, #ff9a62);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.sig-hero-sub {
	margin: 0 auto;
	max-width: 520px;
	font-size: 15.5px;
	line-height: 1.8;
	color: var(--fc-muted);
}

/* --- 姓名输入胶囊 --- */
.sig-search {
	margin-top: 30px;
}
.sig-search-box {
	display: flex;
	align-items: center;
	gap: 6px;
	max-width: 560px;
	margin: 0 auto;
	padding: 6px 6px 6px 18px;
	background: #fff;
	border: 1px solid #ffe1e7;
	border-radius: 999px;
	box-shadow: 0 14px 34px rgba(246, 96, 125, 0.16);
	transition:
		box-shadow 0.2s,
		border-color 0.2s;
}
.sig-search-box:focus-within {
	border-color: var(--fc-accent);
	box-shadow: 0 14px 34px rgba(246, 96, 125, 0.24);
}
.sig-search-icon {
	flex: none;
	color: var(--fc-accent);
	font-size: 15px;
}
.sig-search-input {
	flex: 1;
	min-width: 0;
	height: 46px;
	border: 0;
	outline: 0;
	background: transparent;
	font-size: 17px;
	color: var(--fc-ink);
}
.sig-search-input::placeholder {
	color: #c9a6ae;
}
.sig-search-btn {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 46px;
	padding: 0 26px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--fc-accent), var(--fc-accent-dark));
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	letter-spacing: 2px;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(224, 75, 105, 0.35);
	transition:
		transform 0.15s,
		box-shadow 0.2s;
}
.sig-search-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 22px rgba(224, 75, 105, 0.45);
}
.sig-search-btn:disabled {
	opacity: 0.65;
	cursor: wait;
	transform: none;
}
/* --- 三步导引 --- */
.sig-steps {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 14px;
	margin: 30px 0 0;
	padding: 0;
	list-style: none;
	font-size: 13.5px;
	color: var(--fc-muted);
}
.sig-steps-item {
	display: flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
}
.sig-steps-no {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #fff;
	border: 1px solid #ffd3dc;
	color: var(--fc-accent);
	font-size: 12px;
	font-weight: 700;
}
.sig-steps-sep {
	width: 34px;
	height: 1px;
	background: linear-gradient(90deg, #ffd0da, #ffe6eb);
}

/* --- 签名效果区 --- */
.sig-studio {
	margin-top: 46px;
}
.sig-studio-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 20px;
	flex-wrap: wrap;
	margin-bottom: 20px;
}
.sig-studio-title {
	margin: 0;
	font-size: 22px;
	color: var(--fc-ink);
	display: flex;
	align-items: center;
	gap: 10px;
}
.sig-studio-title::before {
	content: "";
	width: 5px;
	height: 20px;
	border-radius: 3px;
	background: linear-gradient(180deg, var(--fc-accent), #ff9a62);
}
.sig-studio-hint {
	margin: 6px 0 0;
	font-size: 13px;
	color: var(--fc-muted);
}

/* 背景画布选择面板 */
.sig-bg-panel {
	display: flex;
	align-items: center;
	gap: 12px;
	background: #fff;
	border: 1px solid var(--fc-line);
	border-radius: 14px;
	padding: 10px 14px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}
.sig-bg-current {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: var(--fc-muted);
	white-space: nowrap;
}
.sig-bg-current i {
	color: var(--fc-accent);
}
.sig-bg-name {
	max-width: 9em;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 600;
	color: var(--fc-ink);
}
.sig-bg-rail {
	display: flex;
	gap: 8px;
	max-width: 300px;
	overflow-x: auto;
	padding: 2px;
	scrollbar-width: thin;
}
.sig-bg-item {
	flex: none;
	width: 64px;
	height: 48px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 9px;
	overflow: hidden;
	background: #eee;
	cursor: pointer;
	transition:
		transform 0.15s,
		border-color 0.15s;
}
.sig-bg-item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.sig-bg-item:hover {
	transform: scale(1.05);
}
.sig-bg-item.is-active {
	border-color: var(--fc-accent);
	box-shadow: 0 0 0 3px rgba(246, 96, 125, 0.2);
}
.sig-bg-shuffle {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 34px;
	padding: 0 14px;
	border-radius: 999px;
	border: 1px solid var(--fc-accent);
	background: var(--fc-accent-tint);
	color: var(--fc-accent);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	transition:
		background 0.15s,
		color 0.15s;
}
.sig-bg-shuffle:hover {
	background: var(--fc-accent);
	color: #fff;
}
.sig-bg-shuffle:disabled {
	opacity: 0.65;
	cursor: wait;
}
.sig-bg-shuffle:disabled:hover {
	background: var(--fc-accent-tint);
	color: var(--fc-accent);
}
.sig-bg-item:disabled {
	cursor: wait;
	opacity: 0.75;
}
.sig-bg-item:disabled:hover {
	transform: none;
}
.sig-grid.is-applying .signature-card-frame img {
	opacity: 0.55;
}
/* --- 字体卡片网格 --- */
.sig-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 22px;
}
.signature-card {
	position: relative;
	background: #fff;
	border: 1px solid var(--fc-line);
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
	transition:
		transform 0.18s ease,
		box-shadow 0.18s ease;
}
.signature-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 14px 30px rgba(30, 41, 59, 0.12);
}
.signature-card.is-locked {
	cursor: pointer;
}
/* 图区 + 底部信息条 */
.signature-card-frame {
	position: relative;
	aspect-ratio: 4 / 3;
	background: #fafafa;
	overflow: hidden;
}
.signature-card-frame img.signature-sample {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.signature-card-cap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 11px 14px;
	border-top: 1px solid #f2f0f1;
}
.signature-card-name {
	font-size: 14px;
	font-weight: 600;
	color: var(--fc-ink);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
/* 生成后追加的姓名副标题（如「连笔签--刘德华」），弱色 + 收缩，不抢风格名 */
.signature-card-name-for {
	color: var(--fc-muted);
	font-weight: 500;
	margin-left: 1px;
}
.signature-card-tag {
	flex: none;
	font-size: 11.5px;
	padding: 3px 9px;
	border-radius: 999px;
	background: #f1f3f5;
	color: #8a8f98;
	font-weight: 600;
}
.signature-card-tag.is-paid {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: linear-gradient(135deg, #fff4df, #ffe9bf);
	color: #a06a00;
	border: 1px solid #ffd98c;
}
/* 生成中：流光 + 旋转圈；失败：遮罩文案；锁定：渐变遮罩 + 解锁按钮 */
.signature-card.is-busy .signature-card-frame::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(
		100deg,
		rgba(255, 255, 255, 0) 30%,
		rgba(255, 255, 255, 0.75) 50%,
		rgba(255, 255, 255, 0) 70%
	);
	background-size: 220% 100%;
	animation: sig-shimmer 1.2s linear infinite;
}
@keyframes sig-shimmer {
	from {
		background-position: 180% 0;
	}
	to {
		background-position: -80% 0;
	}
}
.signature-card.is-busy .signature-card-frame::after {
	content: "";
	position: absolute;
	z-index: 2;
	top: 50%;
	left: 50%;
	width: 34px;
	height: 34px;
	margin: -17px 0 0 -17px;
	border-radius: 50%;
	border: 3px solid rgba(246, 96, 125, 0.25);
	border-top-color: var(--fc-accent);
	animation: sig-spin 0.8s linear infinite;
}
@keyframes sig-spin {
	to {
		transform: rotate(360deg);
	}
}
.signature-card.is-failed .signature-card-frame::after {
	content: "生成失败，请重试";
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.72);
	color: #d64545;
	font-size: 14px;
	font-weight: 600;
}
.signature-locked {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 65%;
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	padding-bottom: 16px;
	gap: 4px;
	border: 0;
	background: linear-gradient(180deg, rgba(20, 16, 20, 0), rgba(20, 16, 20, 0.62));
	color: #fff;
	cursor: pointer;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}
.signature-locked i {
	font-size: 17px;
}
.signature-locked span {
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 1px;
}
.signature-locked small {
	font-size: 12px;
	opacity: 0.85;
}
.signature-locked:hover i {
	color: #ffd98c;
}
.sig-empty {
	grid-column: 1 / -1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 70px 0;
	color: #b6bcc4;
	font-size: 14px;
	background: #fff;
	border: 1px dashed #dfe2e6;
	border-radius: 16px;
}
.sig-empty i {
	font-size: 30px;
	color: #d7dbe0;
}
/* --- 一键解锁 --- */
.sig-unlock-all {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 34px auto 0;
	padding: 14px 40px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, #ff9a4d, #f6607d);
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 1px;
	cursor: pointer;
	box-shadow: 0 10px 24px rgba(246, 116, 90, 0.35);
	transition:
		transform 0.15s,
		box-shadow 0.2s;
}
.sig-unlock-all:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 30px rgba(246, 116, 90, 0.45);
}
.sig-unlock-all[hidden] {
	display: none;
}

/* --- 解锁后批量下载栏（Nx1 拼接 PNG / ZIP 打包） --- */
.sig-download-bar {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	flex-wrap: wrap;
	margin: 26px auto 0;
	padding: 18px 20px;
	border: 1px solid #f3e3d9;
	border-radius: 18px;
	background: linear-gradient(135deg, #fffaf5, #fff3f0);
}
.sig-download-bar[hidden] {
	display: none;
}
.sig-download-info {
	font-size: 14px;
	font-weight: 600;
	color: var(--fc-ink);
}
.sig-download-info small {
	display: block;
	margin-top: 3px;
	font-size: 12px;
	font-weight: 400;
	color: var(--fc-muted);
}
.sig-download-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 44px;
	padding: 0 22px;
	border: 1px solid #ffd9c2;
	border-radius: 999px;
	background: #fff;
	color: #d96a2b;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition:
		transform 0.15s,
		box-shadow 0.2s,
		background 0.15s;
}
.sig-download-btn:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 8px 18px rgba(224, 106, 43, 0.22);
}
.sig-download-btn:disabled {
	opacity: 0.65;
	cursor: wait;
}
.sig-download-btn.is-zip {
	border: 0;
	background: linear-gradient(135deg, #ff9a4d, #f6607d);
	color: #fff;
	box-shadow: 0 6px 16px rgba(246, 116, 90, 0.35);
}
.sig-download-btn.is-zip:hover:not(:disabled) {
	box-shadow: 0 10px 22px rgba(246, 116, 90, 0.45);
}

/* --- 签名查看/下载弹窗 --- */
.sig-view-overlay {
	position: fixed;
	inset: 0;
	z-index: 10001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(20, 12, 14, 0.62);
	opacity: 0;
	transition: opacity 0.2s ease;
}
.sig-view-overlay.is-open {
	opacity: 1;
}
.sig-view-dialog {
	position: relative;
	width: 100%;
	max-width: 620px;
	background: #fff;
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
	transform: translateY(14px) scale(0.98);
	transition: transform 0.2s ease;
}
.sig-view-overlay.is-open .sig-view-dialog {
	transform: translateY(0) scale(1);
}
.sig-view-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: rgba(20, 16, 18, 0.55);
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s;
}
.sig-view-close:hover {
	background: rgba(20, 16, 18, 0.78);
}
.sig-view-media {
	position: relative;
	aspect-ratio: 4 / 3;
	background: #fafafa;
}
.sig-view-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.sig-view-lock {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: end;
	gap: 8px;
	background: linear-gradient(180deg, rgba(20, 16, 20, 0) 30%, rgba(20, 16, 20, 0.68));
	color: #fff;
	text-align: center;
	padding-bottom: 20px;
}
.sig-view-lock i {
	font-size: 26px;
}
.sig-view-lock span {
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 1px;
}
.sig-view-lock small {
	font-size: 13px;
	opacity: 0.9;
}
.sig-view-lock[hidden] {
	display: none;
}
.sig-view-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 14px 16px;
}
.sig-view-name {
	font-size: 15px;
	font-weight: 600;
	color: var(--fc-ink);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.sig-view-download {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 44px;
	padding: 0 24px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--fc-accent), var(--fc-accent-dark));
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 1px;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(224, 75, 105, 0.35);
	transition:
		transform 0.15s,
		box-shadow 0.2s;
}
.sig-view-download:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 22px rgba(224, 75, 105, 0.45);
}
.sig-view-download:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}
.sig-view-unlock {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 44px;
	padding: 0 24px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, #ff9a4d, #f6607d);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 1px;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(246, 116, 90, 0.35);
	transition:
		transform 0.15s,
		box-shadow 0.2s;
}
.sig-view-unlock:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 22px rgba(246, 116, 90, 0.45);
}

/* --- 付费签名卡片价格徽章 --- */
.signature-card-price {
	display: inline-block;
	margin-left: 8px;
	padding: 2px 9px;
	border-radius: 999px;
	background: rgba(224, 75, 105, 0.12);
	color: var(--fc-accent);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.5px;
	white-space: nowrap;
	vertical-align: 1px;
}
.signature-card-price.is-unlocked {
	background: rgba(46, 160, 102, 0.14);
	color: #2ea066;
}

/* --- 签名解锁结算弹窗 --- */
.sig-checkout-overlay {
	position: fixed;
	inset: 0;
	z-index: 10002;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(20, 12, 14, 0.62);
	opacity: 0;
	transition: opacity 0.2s ease;
}
.sig-checkout-overlay.is-open {
	opacity: 1;
}
.sig-checkout {
	position: relative;
	width: 100%;
	max-width: 430px;
	background: #fff;
	border-radius: 18px;
	max-height: calc(100dvh - 32px);
	overflow-y: auto;
	overscroll-behavior: contain;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
	transform: translateY(14px) scale(0.98);
	transition: transform 0.2s ease;
}
.sig-checkout-overlay.is-open .sig-checkout {
	transform: translateY(0) scale(1);
}
.sig-checkout-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: rgba(20, 16, 18, 0.08);
	color: var(--fc-ink);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s;
}
.sig-checkout-close:hover {
	background: rgba(20, 16, 18, 0.16);
}
.sig-checkout-head {
	padding: 18px 20px 0;
}
.sig-checkout-title {
	margin: 0 34px 0 0;
	font-size: 18px;
	font-weight: 700;
	color: var(--fc-ink);
}
.sig-checkout-sub {
	margin: 4px 0 0;
	font-size: 12px;
	color: var(--fc-muted);
}
/* 「共X款」强调：姓名权益范围内的付费签名数，大于正文、加粗、主题色区分 */
.sig-checkout-count {
	font-size: 17px;
	font-weight: 800;
	color: var(--fc-accent);
	letter-spacing: 0.5px;
}
.sig-checkout-body {
	padding: 12px 20px 0;
}
.sig-checkout-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 12px;
	background: #faf7f4;
}
.sig-checkout-item i {
	color: var(--fc-accent);
	font-size: 18px;
}
.sig-checkout-item-name {
	flex: 1;
	font-size: 14px;
	font-weight: 600;
	color: var(--fc-ink);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.sig-checkout-item-price {
	flex: none;
	font-size: 13px;
	font-weight: 700;
	color: var(--fc-accent);
}
.sig-checkout-rows {
	margin-top: 12px;
	padding: 4px 12px;
	border-top: 1px dashed #e8ded4;
}
.sig-checkout-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 0;
	font-size: 14px;
	color: var(--fc-ink);
}
.sig-checkout-row .sig-checkout-value {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}
.sig-checkout-row.sig-checkout-pay {
	border-top: 1px dashed #e8ded4;
	margin-top: 2px;
	padding-top: 10px;
	font-size: 15px;
	font-weight: 700;
}
.sig-checkout-row.sig-checkout-pay .sig-checkout-value {
	color: var(--fc-accent);
	font-size: 17px;
}
.sig-checkout-row.sig-checkout-pay.is-free .sig-checkout-value {
	color: #2ea066;
}
.sig-checkout-qr {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 18px 16px 6px;
}
.sig-checkout-qr img {
	width: 216px;
	height: 216px;
	border-radius: 12px;
	border: 1px solid #eee2d8;
}
.sig-checkout-qr-tip {
	display: flex;
	align-items: center;
	margin: 0;
	font-size: 14px;
	color: var(--fc-ink);
}
.sig-checkout-wx-icon {
	width: 18px;
	height: 18px;
	flex: none;
	color: #07c160; /* 微信品牌绿 */
	margin-right: 3px;
}
.sig-checkout-wx {
	color: #07c160;
	font-weight: 700;
	margin-right: 5px;
}
.sig-checkout-qr[hidden] {
	display: none;
}
.sig-checkout-msg {
	min-height: 18px;
	margin: 8px 0 0;
	text-align: center;
	font-size: 13px;
	color: var(--fc-muted);
}
.sig-checkout-msg.is-err {
	color: #d43a3a;
}
.sig-checkout-foot {
	padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
}
.sig-checkout-confirm {
	width: 100%;
	height: 48px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, #ff9a4d, #f6607d);
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 1px;
	cursor: pointer;
	box-shadow: 0 8px 18px rgba(246, 116, 90, 0.35);
	transition:
		transform 0.15s,
		box-shadow 0.2s;
}
.sig-checkout-confirm:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 12px 24px rgba(246, 116, 90, 0.45);
}
.sig-checkout-confirm:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}
.sig-checkout-tip {
	margin: 10px 0 0;
	text-align: center;
	font-size: 12px;
	color: var(--fc-muted);
}
.sig-checkout-cancel {
	display: block;
	width: 100%;
	margin-top: 10px;
	padding: 10px 6px;
	border: 0;
	background: transparent;
	color: var(--fc-muted);
	font-size: 13px;
	cursor: pointer;
}
.sig-checkout-cancel[hidden] {
	display: none;
}
.sig-checkout button:focus-visible {
	outline: 3px solid var(--fc-accent);
	outline-offset: 3px;
}
@media (max-width: 480px) {
	.sig-checkout-overlay {
		padding: 16px;
	}
	.sig-checkout-head,
	.sig-checkout-body {
		padding-left: 16px;
		padding-right: 16px;
	}
	.sig-checkout-row {
		gap: 6px;
		font-size: 13px;
	}
	.sig-checkout-row.sig-checkout-pay .sig-checkout-value {
		font-size: 16px;
	}
}

/* --- 明星签名 --- */
.sig-famous {
	margin-top: 72px;
}
.sig-famous-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 16px;
	margin-bottom: 20px;
}
.sig-famous-title {
	margin: 0;
	font-size: 22px;
	color: var(--fc-ink);
	display: flex;
	align-items: center;
	gap: 10px;
}
.sig-famous-title i {
	color: #f2b234;
}
.sig-famous-sub {
	margin: 6px 0 0;
	font-size: 13px;
	color: var(--fc-muted);
}
.sig-famous-more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13.5px;
	color: var(--fc-accent);
	text-decoration: none;
	white-space: nowrap;
}
.sig-famous-more:hover {
	text-decoration: underline;
}
.sig-famous-list {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 16px;
}
.sig-famous-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 1px solid var(--fc-line);
	border-radius: 16px;
	overflow: hidden;
	transition:
		transform 0.18s,
		box-shadow 0.18s,
		border-color 0.18s;
}
.sig-famous-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, var(--fc-accent), #ff9a62);
	opacity: 0;
	transition: opacity 0.18s;
}
.sig-famous-card:hover {
	transform: translateY(-4px);
	border-color: #ffd3dc;
	box-shadow: 0 12px 26px rgba(246, 96, 125, 0.14);
}
.sig-famous-card:hover::before {
	opacity: 1;
}
.sig-famous-name {
	font-weight: 700;
	letter-spacing: 2px;
	color: var(--fc-ink);
	margin: 5px 0;
}
.sig-famous-tag {
	font-size: 12px;
	color: var(--fc-muted);
}
/* --- 响应式 --- */
@media (max-width: 900px) {
	.signature-page {
		padding: 14px 12px 48px;
	}
	.sig-hero {
		padding: 44px 16px 40px;
		border-radius: 18px;
	}
	.sig-hero-title {
		font-size: 29px;
	}
	.sig-steps {
		gap: 8px;
		flex-wrap: wrap;
	}
	.sig-steps-sep {
		display: none;
	}
	.sig-studio {
		margin-top: 36px;
	}
	.sig-studio-head {
		flex-direction: column;
		align-items: stretch;
		gap: 14px;
	}
	/* head 竖排后，flex 项的 auto 交叉宽不按容器拉伸、会被背景轨 max-content
	   撑到 ~900px 溢出视口，统一钉 100%（桌面横排仍是收缩拟合，不受影响） */
	.sig-studio-head > * {
		width: 100%;
	}
	.sig-bg-panel {
		flex-wrap: wrap;
	}
	.sig-bg-rail {
		flex: 1;
		min-width: 0;
		max-width: none;
	}
	.sig-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 14px;
	}
	.sig-famous {
		margin-top: 52px;
	}
	.sig-famous-list {
		grid-template-columns: repeat(2, 1fr);
	}
}
/* --- 手机端：压缩 hero 让「签名效果」进入首屏，背景面板改两行布局，
   网格保持双列（点卡片可放大查看），弹窗/触控目标加大 --- */
@media (max-width: 560px) {
	.signature-page {
		padding: 10px 10px 40px;
	}
	.sig-hero {
		padding: 26px 14px 28px;
		border-radius: 16px;
	}
	.sig-hero::before {
		width: 200px;
		height: 180px;
		top: -90px;
		right: -40px;
	}
	.sig-hero::after {
		width: 200px;
		height: 180px;
		bottom: -90px;
		left: -40px;
	}
	.sig-hero-badge {
		padding: 5px 12px;
		font-size: 12px;
		letter-spacing: 0.5px;
	}
	.sig-hero-title {
		margin: 12px 0 8px;
		font-size: 24px;
		letter-spacing: 0.5px;
	}
	.sig-hero-sub {
		font-size: 13.5px;
		line-height: 1.6;
	}
	.sig-search {
		margin-top: 18px;
	}
	.sig-search-box {
		gap: 5px;
		padding: 5px 5px 5px 12px;
	}
	.sig-search-input {
		height: 44px;
		font-size: 16px;
	}
	.sig-search-btn {
		height: 44px;
		padding: 0 15px;
		font-size: 14px;
		letter-spacing: 0.5px;
	}
	.sig-search-btn i {
		display: none;
	}
	.sig-steps {
		gap: 10px;
		margin-top: 18px;
		font-size: 12.5px;
	}
	.sig-steps-no {
		width: 20px;
		height: 20px;
		font-size: 11px;
	}
	/* 签名效果区：标题更紧凑 */
	.sig-studio {
		margin-top: 26px;
	}
	.sig-studio-head {
		gap: 10px;
		margin-bottom: 12px;
	}
	.sig-studio-title {
		font-size: 19px;
	}
	.sig-studio-hint {
		font-size: 12.5px;
	}
	/* 背景面板：第一行 = 当前背景名 + 换背景按钮，第二行 = 缩略图横滑条整行 */
	.sig-bg-panel {
		row-gap: 7px;
		padding: 8px 10px;
		border-radius: 12px;
	}
	.sig-bg-current {
		flex: 1 1 auto;
		min-width: 0;
		gap: 5px;
		font-size: 12px;
	}
	.sig-bg-current i {
		font-size: 12px;
	}
	.sig-bg-name {
		max-width: 7em;
	}
	.sig-bg-shuffle {
		margin-left: auto;
		height: 30px;
		padding: 0 11px;
		gap: 5px;
		font-size: 12px;
	}
	.sig-bg-rail {
		order: 3;
		flex: 1 1 100%;
		max-width: none;
		gap: 6px;
	}
	.sig-bg-item {
		width: 48px;
		height: 36px;
		border-radius: 7px;
		border-width: 1.5px;
	}
	/* 网格保持双列：单列在手机上滚动过长，点卡片可放大查看 */
	.sig-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}
	.signature-card {
		border-radius: 12px;
	}
	.signature-card-cap {
		gap: 6px;
		padding: 8px 10px;
	}
	.signature-card-name {
		font-size: 13px;
	}
	.signature-card-tag {
		font-size: 10.5px;
		padding: 2px 7px;
	}
	.sig-empty {
		padding: 44px 12px;
		font-size: 13px;
	}
	.sig-unlock-all {
		width: 100%;
		justify-content: center;
		margin-top: 26px;
		padding: 13px 20px;
		font-size: 15px;
	}
	/* 手机端批量下载栏：纵向堆叠、按钮全宽，仅保留 PNG 拼接下载 */
	.sig-download-bar {
		flex-direction: column;
		gap: 10px;
		margin-top: 20px;
		padding: 14px 16px;
		border-radius: 14px;
	}
	.sig-download-info {
		font-size: 13.5px;
	}
	.sig-download-info small {
		font-size: 11.5px;
	}
	.sig-download-btn {
		width: 100%;
		justify-content: center;
		height: 42px;
		font-size: 14px;
	}
	/* 查看/下载弹窗：留白收窄、加大触控目标、适配刘海屏安全区 */
	.sig-view-overlay {
		padding: 16px;
		padding-bottom: calc(16px + env(safe-area-inset-bottom));
	}
	.sig-view-dialog {
		border-radius: 16px;
		max-height: calc(100vh - 32px);
		max-height: calc(100dvh - 32px);
	}
	.sig-view-close {
		top: 10px;
		right: 10px;
		width: 40px;
		height: 40px;
		font-size: 22px;
	}
	.sig-view-foot {
		gap: 10px;
		padding: 12px 14px;
	}
	.sig-view-download {
		height: 42px;
		padding: 0 18px;
		font-size: 14px;
	}
	/* 明星签名：收紧间距与字号，双列布局 */
	.sig-famous {
		margin-top: 40px;
	}
	.sig-famous-head {
		gap: 10px;
		margin-bottom: 12px;
	}
	.sig-famous-title {
		font-size: 19px;
	}
	.sig-famous-sub {
		display: none;
	}
	.sig-famous-more {
		font-size: 13px;
	}
	.sig-famous-list {
		gap: 10px;
	}
	.sig-famous-card {
		padding: 20px 8px 18px;
		border-radius: 12px;
	}
	.sig-famous-name {
		font-size: 20px;
		letter-spacing: 1px;
	}
	.sig-famous-tag {
		font-size: 11px;
	}
}

/* =============================================================
   明星签名（列表页 /signature/stars + 详情页 /signature/stars/:id）
   模板：web/templates/signature_stars.html / signature_star.html
   ============================================================= */

/* ---------- 签名页「明星签名鉴赏」teaser 卡片 ---------- */
a.sig-famous-card {
	text-decoration: none;
	color: inherit;
	display: flex;
}

.sig-famous-img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	height: auto;
	object-fit: contain;
	background: #fff;
	box-sizing: border-box;
}

/* ---------- 公共容器（列表页 + 详情页） ---------- */
.star-page {
	width: 1120px;
	margin: 0 auto;
}

.star-crumb {
	font-size: 13px;
	color: var(--fc-muted);
	margin-bottom: 18px;
}

.star-crumb a {
	color: var(--fc-ink);
	text-decoration: none;
}

.star-crumb a:hover {
	color: var(--fc-accent);
}

/* ---------- 列表页头部：标题 + 搜索 ---------- */
.star-head-title {
	position: relative;
	padding-left: 16px;
	font-size: 30px;
	margin: 0 0 8px;
	color: var(--fc-ink);
}

.star-head-title::before {
	content: "";
	position: absolute;
	left: 0;
	top: 4px;
	bottom: 4px;
	width: 6px;
	border-radius: 3px;
	background: linear-gradient(180deg, var(--fc-accent), #9b7bf7);
}

.star-head-sub {
	color: var(--fc-muted);
	font-size: 14px;
	margin: 0 0 18px;
}

.star-head-count {
	margin-left: 8px;
	padding: 2px 10px;
	border-radius: 999px;
	background: var(--fc-accent-tint);
	color: var(--fc-accent-dark);
	font-size: 12px;
	font-weight: 600;
}

.star-search {
	display: flex;
	align-items: center;
	gap: 6px;
	max-width: 520px;
	padding: 5px 5px 5px 18px;
	background: #fff;
	border: 1px solid var(--fc-line);
	border-radius: 999px;
	box-shadow: 0 4px 14px rgba(30, 41, 59, 0.05);
	transition:
		border-color 0.15s,
		box-shadow 0.15s;
}

.star-search:focus-within {
	border-color: var(--fc-accent);
	box-shadow: 0 0 0 3px rgba(246, 96, 125, 0.12);
}

.star-search input[type="search"] {
	flex: 1;
	min-width: 0;
	padding: 9px 0;
	border: none;
	outline: none;
	background: transparent;
	font-size: 15px;
}

.star-search button {
	padding: 10px 22px;
	border: none;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--fc-accent), var(--fc-accent-dark));
	color: #fff;
	cursor: pointer;
	font-size: 14px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	transition:
		transform 0.15s,
		box-shadow 0.15s;
	flex: 0 0 auto;
}

.star-search button:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 16px rgba(246, 96, 125, 0.25);
}

.star-search-clear {
	font-size: 13px;
	color: var(--fc-muted);
	text-decoration: underline;
	flex: 0 0 auto;
	margin-right: 4px;
}

/* ---------- 列表页卡片：签名图 + 姓名 ---------- */
.star-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 18px;
	margin-top: 20px;
}

.star-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--fc-line);
	border-radius: 18px;
	overflow: hidden;
	background: #fff;
	text-decoration: none;
	color: var(--fc-ink);
	transition:
		transform 0.18s,
		box-shadow 0.18s,
		border-color 0.18s;
}

.star-card:hover {
	transform: translateY(-4px);
	border-color: var(--fc-accent);
	box-shadow: 0 14px 30px rgba(246, 96, 125, 0.16);
}

.star-card-media {
	display: block;
	flex: 0 0 auto;
	background:
		radial-gradient(120% 140% at 80% 0%, #fdeef3 0%, rgba(253, 238, 243, 0) 60%),
		var(--fc-bg);
	border-bottom: 1px solid var(--fc-line);
}

.star-card-img {
	display: block;
	width: 100%;
	/* 卡片图区一律 4:3 固定比例 + 完整显示（object-fit: contain）：
	   上传图任意比例（包括几屏高的竖图）都不会撑高网格行，
	   同排卡片等高，不会留下一大块空白；签名内容也不被裁切，
	   留白底色用 .star-card-media 的淡粉渐变。 */
	aspect-ratio: 4 / 3;
	height: auto;
	object-fit: contain;
	box-sizing: border-box;
}

.star-card-body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 10px 12px 10px;
}

.star-name {
	font-size: 16px;
	font-weight: 700;
}

.star-brief {
	font-size: 12px;
	color: var(--fc-muted);
	line-height: 1.6;
	display: -webkit-box;
	line-clamp: 1;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ---------- 详情页 Hero 渐变卡片 ---------- */
.star-hero {
	display: flex;
	align-items: center;
	gap: 22px;
	padding: 28px 32px;
	border-radius: 20px;
	background:
		radial-gradient(120% 160% at 85% 10%, #fde7ee 0%, rgba(253, 231, 238, 0) 55%),
		linear-gradient(135deg, #fef6f8 0%, #f6f4ff 100%);
	border: 1px solid #f6d7e0;
	box-shadow: 0 10px 30px rgba(246, 96, 125, 0.08);
	margin-bottom: 32px;
}

.star-hero-body {
	flex: 1;
	min-width: 0;
}

.star-hero-body h1 {
	margin: 0 0 6px;
	font-size: 30px;
	letter-spacing: 1px;
	color: var(--fc-ink);
}

.star-hero-sub {
	margin: 0;
	font-size: 14px;
	color: var(--fc-muted);
}

.star-hero-brief {
	margin: 12px 0 0;
	padding-top: 12px;
	border-top: 1px dashed #e9c9d4;
	font-size: 14px;
	line-height: 1.8;
	color: #4b5563;
}

.star-hero-cta {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 22px;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--fc-accent), var(--fc-accent-dark));
	color: #fff;
	font-size: 14px;
	text-decoration: none;
	box-shadow: 0 8px 18px rgba(246, 96, 125, 0.28);
	transition:
		transform 0.15s,
		box-shadow 0.15s;
}

.star-hero-cta:hover {
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 12px 24px rgba(246, 96, 125, 0.34);
}

/* ---------- 详情页签名图画廊 ---------- */
.star-gallery-title,
.star-related-title {
	font-size: 20px;
	margin: 0 0 16px;
	color: var(--fc-ink);
	padding-left: 12px;
	border-left: 4px solid var(--fc-accent);
	line-height: 1.2;
}
.star-notice {
	display: block;
	width: fit-content;
	max-width: 100%;
	margin: 16px auto;
	padding: 8px 14px;
	border: 1px solid var(--fc-accent);
	border-radius: 10px;
	color: var(--fc-accent);
	font-weight: 600;
	font-size: 15px;
	line-height: 1.7;
	text-align: center;
}

/* 详情页签名图：一行一张、整页居中。不能用 auto-fill 网格——那样一张签名图
   只会落到第一列（约 260px 宽）并靠左站，管理员上传的图被挤得很小。 */
.star-imgs {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
}

.star-img {
	margin: 0 auto;
	max-width: 100%;
	position: relative;
	border-radius: 16px;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--fc-line);
	box-shadow: 0 6px 18px rgba(30, 41, 59, 0.06);
}

.star-img img {
	display: block;
	margin: 0 auto;
	/* 详情页不限图片尺寸（只不能宽过内容区）：按原图尺寸居中展示。
	   之前给单张图限高时，一张 800×1800 的上传图会被等比缩到 250px 宽，
	   签名看不清；撑坏页面的问题已经由列表页/teaser 的 4:3 展示框解决，
	   这里不再拿高度换宽度。 */
	width: auto;
	height: auto;
	max-width: 100%;
}

.star-img figcaption {
	position: absolute;
	left: 14px;
	bottom: 14px;
	padding: 4px 12px;
	border-radius: 999px;
	background: rgba(30, 41, 59, 0.72);
	color: #fff;
	font-size: 12px;
	backdrop-filter: blur(4px);
}

/* 自动生成签名图（字体 × 背景）：同样是单列居中按原图展示，
   只额外给画框一个宽度上限。 */
.star-imgs-auto .star-img {
	max-width: 820px;
	margin: 0 auto;
}

.star-no-imgs {
	padding: 40px;
	text-align: center;
	border: 1px dashed var(--fc-line);
	border-radius: 16px;
	background: var(--fc-bg);
	color: var(--fc-muted);
	font-size: 14px;
}

/* ---------- 更多明星签名：小卡片网格 ---------- */
.star-related {
	margin-top: 36px;
}

.star-related-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 14px;
}

.star-related-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	border-radius: 14px;
	background: #fff;
	border: 1px solid var(--fc-line);
	text-decoration: none;
	transition:
		transform 0.15s,
		box-shadow 0.15s,
		border-color 0.15s;
}

.star-related-card:hover {
	transform: translateY(-3px);
	border-color: var(--fc-accent);
	box-shadow: 0 10px 22px rgba(246, 96, 125, 0.12);
}

.star-related-card img {
	width: 100%;
	/* 与列表卡片同一套 4:3 展示框，竖图不撑坏相关明星网格 */
	aspect-ratio: 4 / 3;
	height: auto;
	object-fit: contain;
	border-radius: 8px;
	background: var(--fc-bg);
}

.star-related-name {
	font-size: 15px;
	font-weight: 600;
	color: var(--fc-ink);
	text-align: center;
}

/* ---------- 底部 CTA ---------- */
.star-page-foot {
	margin-top: 44px;
	text-align: center;
}

.star-page-foot a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 28px;
	border-radius: 999px;
	background: var(--fc-ink);
	color: #fff;
	text-decoration: none;
	font-size: 14px;
	transition: background 0.15s;
}

.star-page-foot a:hover {
	background: var(--fc-accent-dark);
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
	.star-page {
		width: 100%;
		padding: 18px 14px 40px;
	}

	.star-head h1 {
		font-size: 23px;
	}

	.star-hero {
		flex-wrap: wrap;
		padding: 20px;
		gap: 16px;
	}

	.star-hero-body h1 {
		font-size: 24px;
	}

	.star-hero-cta {
		width: 100%;
		justify-content: center;
	}

	.star-list {
		grid-template-columns: 1fr;
	}
}
