/* ===== 签署页基础 ===== */
.wpes-sign-wrap {
	max-width: 860px;
	margin: 30px auto;
	padding: 0 16px;
	font-size: 15px;
	line-height: 1.75;
	color: #1e1e1e;
	box-sizing: border-box;
}
.wpes-sign-wrap *,
.wpes-sign-wrap *::before,
.wpes-sign-wrap *::after { box-sizing: border-box; }

/* 头部 */
.wpes-sign-header h2 { margin: 0 0 6px; font-size: 22px; font-weight: 600; }
.wpes-sign-meta { color: #787c82; font-size: 13px; margin: 0 0 20px; }

/* 合同正文 */
.wpes-contract {
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	padding: 20px 24px;
	background: #fcfcfc;
	max-height: 520px;
	overflow: auto;
	margin-bottom: 24px;
}

/* 签名面板 */
.wpes-sign-panel {
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	padding: 20px;
	background: #fff;
}
.wpes-sign-panel h3 { margin: 0 0 14px; font-size: 16px; font-weight: 600; }

/* 签名画布 */
.wpes-canvas-holder {
	position: relative;
	border: 2px dashed #c3c4c7;
	border-radius: 6px;
	background: #fff;
	overflow: hidden;
	touch-action: none;
	min-height: 220px;
}
.wpes-canvas-holder canvas {
	display: block;
	width: 100%;
	cursor: crosshair;
	touch-action: none;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}
.wpes-canvas-hint {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #a7aaad;
	font-size: 18px;
	pointer-events: none;
	user-select: none;
	z-index: 1;
}

/* 工具条 */
.wpes-sign-tools { margin: 10px 0 6px; text-align: right; }

/* 同意条款 */
.wpes-agree {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 16px 0;
	font-size: 14px;
	line-height: 1.6;
	cursor: pointer;
}
.wpes-agree input { margin-top: 4px; flex-shrink: 0; }

/* 按钮 */
.wpes-sign-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	margin-top: 8px;
}
.wpes-btn {
	display: inline-block;
	padding: 10px 22px;
	border-radius: 5px;
	border: 1px solid transparent;
	font-size: 15px;
	line-height: 1.4;
	cursor: pointer;
	text-decoration: none;
	transition: background .15s, opacity .15s;
	font-family: inherit;
}
.wpes-btn:disabled { opacity: .55; cursor: not-allowed; }
.wpes-btn-primary { background: #2271b1; color: #fff; }
.wpes-btn-primary:hover:not(:disabled) { background: #135e96; color: #fff; }
.wpes-btn-ghost { background: #f6f7f7; border-color: #dcdcde; color: #2c3338; }
.wpes-btn-ghost:hover { background: #f0f0f1; }
.wpes-btn-link { background: transparent; color: #d63638; padding: 10px 6px; }
.wpes-btn-link:hover { text-decoration: underline; }

/* 消息 */
.wpes-message { margin-top: 14px; font-size: 14px; min-height: 20px; }
.wpes-message-error   { color: #d63638; }
.wpes-message-success { color: #00a32a; }
.wpes-message-info    { color: #2271b1; }

/* ===== 成功页 ===== */
.wpes-sign-success { text-align: left; }
.wpes-success-icon,
.wpes-error-icon {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 30px;
	color: #fff;
	margin: 0 auto 16px;
}
.wpes-success-icon { background: #00a32a; }
.wpes-error-icon   { background: #d63638; }
.wpes-sign-success h2,
.wpes-sign-error h2 { text-align: center; margin: 0 0 10px; }
.wpes-sign-error p { text-align: center; color: #787c82; }

/* 存档 */
.wpes-archive {
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	padding: 22px;
	margin: 22px 0;
	background: #fff;
}
.wpes-archive-meta {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	margin-bottom: 18px;
}
.wpes-archive-meta th,
.wpes-archive-meta td {
	border: 1px solid #e5e5e5;
	padding: 8px 12px;
	text-align: left;
}
.wpes-archive-meta th { background: #f6f7f7; width: 180px; }

.wpes-archive-sign {
	margin-top: 22px;
	border-top: 1px dashed #c3c4c7;
	padding-top: 16px;
}
.wpes-archive-sign img {
	max-width: 320px;
	border-bottom: 1px solid #1e1e1e;
	display: block;
	margin: 8px 0;
}
.wpes-hash {
	font-family: Menlo, Consolas, monospace;
	font-size: 11px;
	color: #50575e;
	word-break: break-all;
	margin-top: 10px;
}

@media print {
	/* 隐藏所有不需要打印的 UI 元素 */
	#wpadminbar,
	.wpes-sign-header,
	.wpes-sign-panel,
	.wpes-sign-tools,
	.wpes-agree,
	.wpes-sign-actions,
	.wpes-sign-meta,
	.wpes-success-icon,
	.wpes-error-icon,
	.wpes-track-banner,
	.wpes-track-flow,
	.wpes-track-actions,
	.wpes-track-contract-head,
	.wpes-track-contract-locked,
	.wpes-track-contract-actions,
	.wpes-my-list,
	.wpes-my-footer,
	.wpes-empty,
	.wpes-copy-wrap,
	.wpes-sign-success > h2,
	.wpes-sign-success > p { display: none !important; }

	body { background: #fff !important; }
	.wpes-sign-wrap { margin: 0 !important; padding: 0 !important; max-width: 100% !important; }
	.wpes-contract {
		max-height: none !important;
		overflow: visible !important;
		border: none !important;
		background: transparent !important;
		padding: 0 !important;
	}
	.wpes-track-contract {
		border: none !important;
		padding: 0 !important;
		margin: 0 !important;
	}
}

/* 移动端 */
@media (max-width: 600px) {
	.wpes-sign-wrap { margin: 16px auto; }
	.wpes-contract { padding: 14px; max-height: 360px; }
	.wpes-sign-panel { padding: 14px; }
	.wpes-canvas-holder { min-height: 180px; }
	.wpes-btn { width: 100%; text-align: center; }
}