/* =========================================================================
   版权承诺书 / 授权书   —   前端样式
   ========================================================================= */

:root {
	--cf-primary: #4f46e5;
	--cf-primary-dark: #4338ca;
	--cf-primary-light: #eef2ff;
	--cf-grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #a855f7 100%);
	--cf-text: #1f2937;
	--cf-sub: #6b7280;
	--cf-border: #e3e6ec;
	--cf-soft: #f8f9fc;
	--cf-danger: #b91c1c;
	--cf-radius: 16px;
	--cf-shadow: 0 24px 60px -30px rgba(15, 23, 42, .35);
	--cf-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
		"Hiragino Sans GB", "Microsoft YaHei", sans-serif;
	--cf-font-serif: "Songti SC", "SimSun", "Noto Serif SC", serif;
	--cf-font-kai: "Kaiti SC", "STKaiti", "KaiTi", serif;
	--cf-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- 外层容器 ---------- */
.cf-wrap,
.cf-wrap *,
.cf-wrap *::before,
.cf-wrap *::after { box-sizing: border-box; }

.cf-wrap {
	max-width: 940px;
	margin: 48px auto;
	padding: 0 4px;
	font-family: var(--cf-font);
	font-size: 15px;
	line-height: 1.7;
	color: var(--cf-text);
	-webkit-font-smoothing: antialiased;
}

/* ---------- 页头 ---------- */
.cf-head { text-align: center; margin-bottom: 26px; }

.cf-head-title {
	margin: 0 0 8px;
	font-size: 26px;
	font-weight: 700;
	letter-spacing: 2px;
	color: #111827;
	font-family: var(--cf-font-serif);
}

.cf-head-title::after {
	content: "";
	display: block;
	width: 56px;
	height: 3px;
	margin: 14px auto 0;
	border-radius: 2px;
	background: var(--cf-grad);
}

.cf-head-sub {
	margin: 12px 0 0;
	font-size: 13.5px;
	color: var(--cf-sub);
	letter-spacing: .5px;
}

/* ---------- 标签页 ---------- */
.cf-tabs {
	display: flex;
	gap: 6px;
	width: max-content;
	max-width: 100%;
	margin: 0 auto 22px;
	padding: 6px;
	background: #eceef4;
	border-radius: 14px;
	box-shadow: inset 0 1px 3px rgba(15, 23, 42, .07);
}

.cf-tab {
	position: relative;
	border: 0;
	outline: 0;
	padding: 11px 30px;
	border-radius: 10px;
	background: transparent;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .5px;
	color: var(--cf-sub);
	cursor: pointer;
	transition: color .22s ease, background .28s ease, box-shadow .28s ease,
		transform .18s ease;
}

.cf-tab:hover { color: var(--cf-primary); }

.cf-tab.is-active {
	color: #fff;
	background: var(--cf-grad);
	box-shadow: 0 10px 22px -12px rgba(99, 102, 241, .95);
}

.cf-tab:active { transform: scale(.985); }

/* ---------- 表单卡片 ---------- */
.cf-form {
	position: relative;
	padding: 36px 38px 32px;
	background: #fff;
	border: 1px solid rgba(226, 232, 240, .95);
	border-radius: var(--cf-radius);
	box-shadow: var(--cf-shadow);
	overflow: hidden;
}

.cf-form::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: var(--cf-grad);
}

/* ---------- 分区标题 ---------- */
.cf-section-title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 30px 0 16px;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 1px;
	color: #111827;
}

.cf-section-title:first-of-type { margin-top: 6px; }

.cf-section-title::before {
	content: "";
	width: 4px;
	height: 15px;
	border-radius: 2px;
	background: var(--cf-grad);
	flex: none;
}

.cf-section-title::after {
	content: "";
	flex: 1;
	height: 1px;
	background: linear-gradient(90deg, var(--cf-border), transparent);
}

.cf-section-title small {
	font-size: 12.5px;
	font-weight: 400;
	letter-spacing: 0;
	color: var(--cf-sub);
}

/* ---------- 签署主体切换 ---------- */
.cf-signer-type {
	display: flex;
	gap: 14px;
	margin-bottom: 6px;
}

.cf-radio-card {
	position: relative;
	flex: 1;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 20px;
	border: 1.5px solid var(--cf-border);
	border-radius: 12px;
	background: #fff;
	font-size: 14px;
	cursor: pointer;
	user-select: none;
	transition: border-color .22s ease, background .22s ease, box-shadow .22s ease,
		transform .18s ease;
}

.cf-radio-card:hover {
	border-color: #c7d2fe;
	background: #fafbff;
}

.cf-radio-card:active { transform: scale(.99); }

.cf-radio-card:has(input:checked) {
	border-color: var(--cf-primary);
	background: var(--cf-primary-light);
	box-shadow: 0 0 0 4px rgba(79, 70, 229, .08);
}

.cf-radio-card input[type="radio"] {
	width: 18px;
	height: 18px;
	margin: 0;
	flex: none;
	accent-color: var(--cf-primary);
	cursor: pointer;
}

.cf-radio-label {
	font-weight: 600;
	color: #374151;
	transition: color .2s;
}

.cf-radio-card:has(input:checked) .cf-radio-label {
	color: var(--cf-primary-dark);
}

/* ---------- 栅格 ---------- */
.cf-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px 22px;
}

.cf-full { grid-column: 1 / -1; }

/* ---------- 字段 ---------- */
.cf-field { display: block; }

.cf-label {
	display: block;
	margin-bottom: 8px;
	font-size: 13.5px;
	font-weight: 600;
	letter-spacing: .3px;
	color: #374151;
}

.cf-label i {
	margin-left: 2px;
	font-style: normal;
	color: #ef4444;
}

.cf-label small {
	margin-left: 6px;
	font-size: 12.5px;
	font-weight: 400;
	color: var(--cf-sub);
}

.cf-field input[type="text"],
.cf-field input[type="tel"],
.cf-field input[type="email"],
.cf-field input[type="url"],
.cf-field select,
.cf-field textarea {
	display: block;
	width: 100%;
	padding: 12px 15px;
	border: 1.5px solid var(--cf-border);
	border-radius: 11px;
	background: #fbfcfe;
	font-family: inherit;
	font-size: 14.5px;
	color: var(--cf-text);
	line-height: 1.5;
	transition: border-color .2s, background .2s, box-shadow .2s;
	-webkit-appearance: none;
	appearance: none;
}

.cf-field textarea {
	resize: vertical;
	min-height: 84px;
}

.cf-field input::placeholder,
.cf-field textarea::placeholder { color: #b3bac7; }

.cf-field input:hover,
.cf-field select:hover,
.cf-field textarea:hover { border-color: #d3d9e6; }

.cf-field input:focus,
.cf-field select:focus,
.cf-field textarea:focus {
	outline: none;
	border-color: var(--cf-primary);
	background: #fff;
	box-shadow: 0 0 0 4px rgba(79, 70, 229, .1);
}

.cf-field input:-webkit-autofill,
.cf-field input:-webkit-autofill:hover,
.cf-field input:-webkit-autofill:focus {
	-webkit-box-shadow: 0 0 0 1000px #fbfcfe inset;
	-webkit-text-fill-color: var(--cf-text);
	transition: background-color 9999s ease-out;
}

/* ---------- 签名区 ---------- */
.cf-sign-area { margin-top: 28px; }

.cf-sign-box {
	position: relative;
	border: 2px dashed #ccd4e3;
	border-radius: 14px;
	background: #fcfdff;
	overflow: hidden;
	transition: border-color .25s, background .25s, box-shadow .25s;
}

.cf-sign-box:hover {
	border-color: #a5b4fc;
	background: #fff;
}

.cf-sign-box.is-signed {
	border-style: solid;
	border-color: #c7d2fe;
	background: #fff;
	box-shadow: 0 0 0 4px rgba(99, 102, 241, .08);
}

.cf-sign-box::after {
	content: "请在此处签名";
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--cf-font-kai);
	font-size: 24px;
	letter-spacing: 8px;
	color: #d3dae6;
	pointer-events: none;
	transition: opacity .25s;
}

.cf-sign-box.is-signed::after { opacity: 0; }

#cf-signature {
	display: block;
	width: 100%;
	height: 220px;
	touch-action: none;
	cursor: crosshair;
}

.cf-clear-sign {
	position: absolute;
	right: 12px;
	bottom: 12px;
	z-index: 3;
	padding: 7px 15px;
	border: 1px solid var(--cf-border);
	border-radius: 999px;
	background: rgba(255, 255, 255, .92);
	font-family: inherit;
	font-size: 12.5px;
	color: #64748b;
	cursor: pointer;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	transition: all .2s;
}

.cf-clear-sign:hover {
	color: #dc2626;
	border-color: #fecaca;
	background: #fff5f5;
}

/* ---------- 操作区 ---------- */
.cf-actions {
	display: flex;
	align-items: center;
	gap: 18px;
	flex-wrap: wrap;
	margin-top: 26px;
}

.cf-submit {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 15px 46px;
	border: 0;
	border-radius: 12px;
	background: var(--cf-grad);
	background-size: 160% 160%;
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	letter-spacing: 1.5px;
	color: #fff;
	cursor: pointer;
	box-shadow: 0 14px 28px -12px rgba(99, 102, 241, .95);
	transition: transform .22s ease, box-shadow .22s ease, background-position .5s ease,
		opacity .2s ease;
}

.cf-submit:hover:not(:disabled) {
	transform: translateY(-2px);
	background-position: 100% 50%;
	box-shadow: 0 20px 36px -14px rgba(99, 102, 241, 1);
}

.cf-submit:active:not(:disabled) { transform: translateY(0); }

.cf-submit:disabled {
	opacity: .65;
	cursor: not-allowed;
	box-shadow: none;
}

.cf-spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, .45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: cfSpin .7s linear infinite;
}

.cf-submit.is-loading .cf-spinner { display: inline-block; }

@keyframes cfSpin { to { transform: rotate(360deg); } }

.cf-tip {
	font-size: 13px;
	color: var(--cf-sub);
}

/* ---------- 提示信息 ---------- */
.cf-msg {
	display: none;
	margin-top: 20px;
	padding: 13px 17px;
	border-radius: 11px;
	font-size: 14px;
	line-height: 1.6;
}

.cf-msg.is-show {
	display: block;
	animation: cfFade .32s ease both;
}

.cf-msg.is-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
}

.cf-msg.is-success {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	color: #15803d;
}

@keyframes cfFade {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: none; }
}

/* ---------- 结果区 ---------- */
.cf-result { margin-top: 30px; }

.cf-result-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-top: 18px;
	padding: 15px 20px;
	background: #fff;
	border: 1px solid var(--cf-border);
	border-radius: 13px;
	box-shadow: 0 10px 26px -20px rgba(15, 23, 42, .5);
	font-size: 13.5px;
	color: #4b5563;
}

.cf-result-bar .cf-result-no {
	margin-right: auto;
	font-family: var(--cf-font-mono);
	font-size: 13px;
	letter-spacing: .5px;
	color: #6b7280;
}

.cf-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 20px;
	border: 1px solid transparent;
	border-radius: 10px;
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: all .2s ease;
}

.cf-btn-primary {
	background: var(--cf-grad);
	color: #fff;
	box-shadow: 0 10px 22px -12px rgba(99, 102, 241, .95);
}

.cf-btn-primary:hover {
	transform: translateY(-1px);
	color: #fff;
}

/* =========================================================================
   文书本体
   ========================================================================= */
.cf-doc {
	position: relative;
	padding: 54px 62px;
	background: #fff;
	border: 1px solid rgba(226, 232, 240, .95);
	border-radius: var(--cf-radius);
	box-shadow: var(--cf-shadow);
	font-family: var(--cf-font);
	font-size: 15px;
	line-height: 1.95;
	color: var(--cf-text);
	overflow: hidden;
}

.cf-doc::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 5px;
	background: var(--cf-grad);
}

.cf-doc h2 {
	margin: 0 0 8px;
	text-align: center;
	font-family: var(--cf-font-serif);
	font-size: 25px;
	font-weight: 700;
	letter-spacing: 8px;
	color: #111827;
}

.cf-doc h2::after {
	content: "";
	display: block;
	width: 62px;
	height: 3px;
	margin: 16px auto 0;
	border-radius: 2px;
	background: var(--cf-grad);
}

.cf-doc-no {
	margin: 0 0 28px !important;
	text-align: right;
	font-family: var(--cf-font-mono);
	font-size: 12.5px;
	letter-spacing: .5px;
	color: #9ca3af;
}

.cf-doc p {
	margin: 10px 0;
	text-align: justify;
}

.cf-doc-party { margin: 6px 0 !important; }

.cf-doc h4 {
	margin: 26px 0 8px;
	padding-left: 11px;
	border-left: 3px solid var(--cf-primary);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.45;
	color: #111827;
}

.cf-doc h4.cf-doc-reserved {
	border-left-color: #dc2626;
	color: var(--cf-danger);
}

.cf-doc ol {
	margin: 12px 0;
	padding-left: 24px;
}

.cf-doc ol li {
	margin: 9px 0;
	text-align: justify;
}

.cf-doc ol li::marker {
	color: var(--cf-primary);
	font-weight: 700;
}

.cf-doc ol li strong { color: #111827; }

.cf-doc ol.cf-doc-reserved-list li::marker { color: #dc2626; }

.cf-doc ol.cf-doc-reserved-list li strong { color: var(--cf-danger); }

.cf-doc-sign {
	margin-top: 52px;
	padding-top: 26px;
	border-top: 1px dashed #d1d5db;
}

.cf-doc-sign p { margin: 9px 0; }

.cf-doc-sign-line {
	display: flex;
	align-items: flex-end;
	gap: 12px;
	flex-wrap: wrap;
	font-weight: 600;
}

.cf-doc-sign-img {
	max-width: 250px;
	max-height: 76px;
	padding-bottom: 2px;
	border-bottom: 1.5px solid #374151;
	vertical-align: middle;
}

.cf-doc-sign-text {
	padding: 0 26px 2px;
	border-bottom: 1.5px solid #374151;
	font-family: var(--cf-font-kai);
	font-size: 22px;
	color: #111827;
}

/* =========================================================================
   响应式
   ========================================================================= */
@media (max-width: 680px) {
	.cf-wrap { margin: 26px auto; }

	.cf-head-title { font-size: 21px; letter-spacing: 1px; }

	.cf-form { padding: 26px 20px 24px; }

	.cf-tabs {
		width: 100%;
		gap: 4px;
	}

	.cf-tab {
		flex: 1;
		padding: 10px 8px;
		font-size: 14px;
	}

	.cf-signer-type {
		flex-direction: column;
		gap: 10px;
	}

	.cf-radio-card { padding: 14px 16px; }

	.cf-grid { grid-template-columns: 1fr; }

	.cf-section-title { margin-top: 26px; }

	.cf-doc { padding: 32px 22px; font-size: 14px; }

	.cf-doc h2 { font-size: 20px; letter-spacing: 4px; }

	.cf-doc h2::after { margin-top: 12px; }

	.cf-doc h4 { margin-top: 22px; }

	.cf-doc-sign { margin-top: 38px; }

	.cf-doc-sign-img { max-width: 180px; }

	#cf-signature { height: 170px; }

	.cf-sign-box::after { font-size: 18px; letter-spacing: 5px; }

	.cf-actions {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
	}

	.cf-submit { width: 100%; padding: 15px 20px; }

	.cf-tip { text-align: center; }

	.cf-result-bar {
		flex-direction: column;
		align-items: stretch;
	}

	.cf-result-bar .cf-result-no {
		margin-right: 0;
		text-align: center;
	}

	.cf-btn { justify-content: center; }
}

/* =========================================================================
   打印
   —— 提交并点击"打印/另存为 PDF"后触发，只输出文书本体
   ========================================================================= */

@media print {
	@page {
		size: A4;
		margin: 0;
	}

	.cf-wrap .cf-head,
	.cf-wrap .cf-tabs,
	.cf-wrap .cf-form { display: none !important; }

	.cf-wrap {
		max-width: none;
		margin: 0;
		padding: 0;
	}

	.cf-wrap .cf-result { margin: 0; }

	.cf-wrap .cf-result-bar,
	.cf-wrap .cf-print-hint { display: none !important; }

	.cf-wrap .cf-doc {
		padding: 20mm 18mm;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		font-size: 13.5pt;
		line-height: 1.9;
	}

	.cf-wrap .cf-doc::before { display: none; }

	.cf-wrap .cf-doc h2 { font-size: 20pt; letter-spacing: 10px; }

	.cf-wrap .cf-doc h4 { break-after: avoid; }

	.cf-wrap .cf-doc ol li { break-inside: avoid; }

	.cf-wrap .cf-doc-sign { break-inside: avoid; }
}

/* ---------- 打印提示 ---------- */
.cf-print-hint {
	margin: 12px 0 0;
	padding: 10px 14px;
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-radius: 10px;
	font-size: 12.5px;
	line-height: 1.6;
	color: #92400e;
}