/* ===== AI 字体页（手写画板） ===== */
/* body 是 column flex 布局（style.css）：flex 项需显式钉 width: 100%，
   否则会按 max-content 撑宽页面，桌面上再靠 max-width + margin auto 居中。 */
.aif-page {
	max-width: 1200px;
	width: 100%;
	margin: 0 auto;
	padding: 22px 18px 64px;
}

/* --- 生成器卡片 --- */
.aif-studio {
	padding: 22px;
	background: #fff;
	border: 1px solid var(--fc-line, #e4e4e6);
	border-radius: 20px;
	box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

.aif-studio-head {
	margin-bottom: 16px;
}

.aif-studio-title {
	margin: 0;
	font-size: 24px;
	font-weight: 700;
	letter-spacing: 0.5px;
	color: var(--fc-ink, #1e293b);
}

.aif-studio-desc {
	max-width: 780px;
	margin: 8px 0 0;
	font-size: 14px;
	line-height: 1.8;
	color: var(--fc-muted, #757575);
}

/* --- 画板 --- */
.aif-board-wrap {
	position: relative;
	overflow: hidden;
	background-color: #fff;
	background-image: radial-gradient(#e6e9ef 1px, transparent 1px);
	background-size: 26px 26px;
	border: 1px solid #e8ebf0;
	border-radius: 16px;
	box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.05);
}

.aif-board {
	display: block;
	width: 100%;
	height: clamp(420px, 70vh, 780px);
	touch-action: none;
	cursor: crosshair;
}

.aif-board-placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0;
	color: #c6cbd6;
	font-size: 18px;
	line-height: 1.6;
	pointer-events: none;
	transition: opacity 0.25s;
}

.aif-board-placeholder i {
	color: #d9dde6;
	font-size: 22px;
}

.aif-board-hint {
	letter-spacing: 1px;
}

/* 样例引导：墨色示范字，引导用户写什么 */
.aif-board-sample {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-top: 14px;
}

.aif-board-sample-label {
	color: #bcc4d1;
	font-size: 12px;
	letter-spacing: 6px;
	line-height: 1.8;
	text-indent: 6px;
}

.aif-board-sample-ink {
	position: relative;
	margin-top: 4px;
	font-family: "Kaiti SC", STKaiti, KaiTi, serif;
	font-size: clamp(24px, 2.6vw, 32px);
	line-height: 1.3;
	letter-spacing: 0.14em;
	text-indent: 0.14em;
	background-image: linear-gradient(
		100deg,
		#a2aec0 0%,
		#b9c2d1 50%,
		#a2aec0 100%
	);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	-webkit-text-fill-color: transparent;
	text-shadow: 0 0 12px rgba(141, 153, 177, 0.28);
}

.aif-board-sample-stroke {
	width: 100%;
	max-width: 150px;
	height: auto;
	margin-top: 2px;
	color: #e7ebf2;
}

.aif-board-placeholder.is-hidden {
	opacity: 0;
	visibility: hidden;
	transition:
		opacity 0.25s,
		visibility 0.25s;
}

.aif-board-noscript {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	color: var(--fc-muted, #757575);
	font-size: 14px;
}

/* --- 画板工具条（浮在画板底部） --- */
.aif-toolbar {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 16px;
	width: fit-content;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 2px;
	max-width: calc(100% - 20px);
	margin: 0 auto;
	padding: 6px;
	background: rgba(255, 255, 255, 0.94);
	border: 1px solid #e9ecf2;
	border-radius: 999px;
	box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.aif-brushes,
.aif-sizes {
	display: flex;
	align-items: center;
	gap: 2px;
}

.aif-brush,
.aif-tool,
.aif-size {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 999px;
	color: #5b6172;
	font-size: 15px;
	cursor: pointer;
	transition:
		background 0.18s,
		color 0.18s,
		opacity 0.18s;
}

.aif-brush:hover,
.aif-tool:hover:not(:disabled),
.aif-size:hover {
	background: #f4f5f8;
	color: var(--fc-ink, #1e293b);
}

.aif-brush[aria-pressed="true"],
.aif-tool[aria-pressed="true"],
.aif-size[aria-pressed="true"] {
	background: var(--fc-accent-tint, #fef0f3);
	color: var(--fc-accent, #f6607d);
	box-shadow: inset 0 0 0 1px #ffd3dc;
}

.aif-tool:disabled {
	opacity: 0.32;
	cursor: default;
}

.aif-tool-sep {
	width: 1px;
	height: 20px;
	margin: 0 4px;
	background: #eceef2;
}

/* 笔刷样张：由画板同一套笔刷渲染，与落笔效果一致 */
.aif-swatch {
	display: block;
	width: 30px;
	height: 26px;
}

/* 笔触粗细：圆点由小到大 */
.aif-size {
	width: 30px;
}

.aif-size-dot {
	display: block;
	background: currentColor;
	border-radius: 50%;
}

.aif-size[data-size="s"] .aif-size-dot {
	width: 5px;
	height: 5px;
}

.aif-size[data-size="m"] .aif-size-dot {
	width: 9px;
	height: 9px;
}

.aif-size[data-size="l"] .aif-size-dot {
	width: 13px;
	height: 13px;
}

/* --- 生成入口 --- */
.aif-actions {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	margin-top: 18px;
}

.aif-generate {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: 52px;
	padding: 0 42px;
	background: linear-gradient(
		135deg,
		var(--fc-accent, #f6607d),
		var(--fc-accent-dark, #e04b69)
	);
	border: 0;
	border-radius: 999px;
	color: #fff;
	font-size: 17px;
	font-weight: 600;
	letter-spacing: 2px;
	cursor: pointer;
	box-shadow: 0 12px 26px rgba(246, 96, 125, 0.32);
	transition:
		transform 0.18s,
		box-shadow 0.18s;
}

.aif-generate:hover {
	transform: translateY(-1px);
	box-shadow: 0 16px 30px rgba(246, 96, 125, 0.4);
}

.aif-generate:active {
	transform: translateY(0);
}

.aif-generate:focus-visible {
	outline: 2px solid #ffb3c2;
	outline-offset: 3px;
}

.aif-generate:disabled {
	cursor: default;
	opacity: 0.72;
	transform: none;
	box-shadow: 0 8px 18px rgba(246, 96, 125, 0.2);
}

.aif-actions-note {
	margin: 0;
	font-size: 13px;
	line-height: 1.7;
	color: var(--fc-muted, #757575);
}

.aif-actions-msg {
	min-height: 18px;
	margin: 0;
	font-size: 13px;
	line-height: 1.7;
	color: var(--fc-accent, #f6607d);
}

/* --- 历史字体模型卡片（画板页，位于 AI 字体生成器卡片下方） --- */
.aif-history-card {
	margin-top: 22px;
	padding: 18px 20px;
	background: #fff;
	border: 1px solid var(--fc-line, #e4e4e6);
	border-radius: 16px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.aif-history-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.aif-history-title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: var(--fc-ink, #1e293b);
}

.aif-history-title i {
	font-size: 14px;
	color: var(--fc-accent, #f6607d);
}

.aif-history-all {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 13px;
	color: var(--fc-muted, #757575);
	text-decoration: none;
	transition: color 0.18s;
}

.aif-history-all i {
	font-size: 10px;
}

.aif-history-all:hover {
	color: var(--fc-accent, #f6607d);
}

.aif-history-list {
	display: flex;
	flex-wrap: nowrap;
	gap: 12px;
	/* 只排一行，超出的横向滚动：卡片数少时不留空白，多了也不会把区间拉高。 */
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-x: contain;
	scroll-snap-type: x proximity;
	padding-bottom: 4px;
}

.aif-history-list::-webkit-scrollbar {
	height: 6px;
}

.aif-history-list::-webkit-scrollbar-track {
	background: transparent;
}

.aif-history-list::-webkit-scrollbar-thumb {
	background: #e5e7eb;
	border-radius: 3px;
}

.aif-history-item {
	display: flex;
	flex: 0 0 200px;
	flex-direction: column;
	gap: 6px;
	color: inherit;
	text-decoration: none;
	scroll-snap-align: start;
}

.aif-history-thumb {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #f3f4f6;
	border: 1px solid #eef0f3;
	border-radius: 10px;
	font-size: 12px;
	color: #9ca3af;
}

.aif-history-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.aif-history-item:hover .aif-history-thumb {
	border-color: #f3c1cc;
}

.aif-history-meta {
	font-size: 12px;
	color: var(--fc-muted, #757575);
}

.aif-history-empty {
	flex: 0 0 100%;
	margin: 0;
	font-size: 13px;
	line-height: 1.7;
	color: var(--fc-muted, #757575);
}

/* --- 我的字体模型：列表与详情 --- */
/* 状态筛选标签：与角标同一套颜色，选中项实心。 */
.aim-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 16px;
}

.aim-filter {
	display: inline-flex;
	align-items: center;
	padding: 5px 12px;
	font-size: 13px;
	line-height: 20px;
	color: #4b5563;
	background: #fff;
	border: 1px solid var(--fc-line, #e4e4e6);
	border-radius: 999px;
	text-decoration: none;
	transition:
		border-color 0.15s,
		color 0.15s,
		background 0.15s;
}

.aim-filter:hover {
	border-color: #f3c1cc;
	color: var(--fc-accent, #f6607d);
}

.aim-filter.aim-filter-on {
	color: var(--fc-accent, #f6607d);
	background: var(--fc-accent-tint, #fef0f3);
	border-color: #ffd3dc;
	font-weight: 600;
}

.aim-list {
	display: grid;
	gap: 12px;
}

.aim-card {
	display: grid;
	grid-template-columns: 76px minmax(0, 1fr) 16px;
	align-items: center;
	gap: 14px;
	padding: 12px 16px;
	background: #fff;
	border: 1px solid var(--fc-line, #e4e4e6);
	border-radius: 14px;
	text-decoration: none;
	transition:
		border-color 0.18s,
		box-shadow 0.18s,
		transform 0.18s;
}

.aim-card:hover {
	border-color: #f3c1cc;
	box-shadow: 0 8px 20px rgba(246, 96, 125, 0.1);
	transform: translateY(-1px);
}

.aim-thumb {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 76px;
	height: 56px;
	overflow: hidden;
	background: #f3f4f6;
	border-radius: 8px;
	font-size: 12px;
	color: #9ca3af;
}

.aim-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.aim-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.aim-title {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 15px;
	font-weight: 600;
	color: var(--fc-ink, #1e293b);
}

/* 模型列表的状态角标：已生成TTF / 字体生成中 / 已付款（未付款不展示）。 */
.aim-badge {
	padding: 1px 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	line-height: 18px;
	white-space: nowrap;
}

.aim-badge.is-done {
	color: #0f9d76;
	background: rgba(16, 185, 129, 0.12);
}

.aim-badge.is-running {
	color: #b45309;
	background: rgba(245, 158, 11, 0.14);
}

.aim-badge.is-paid {
	color: #2563eb;
	background: rgba(59, 130, 246, 0.12);
}

.aim-badge.is-failed {
	color: #dc2626;
	background: rgba(239, 68, 68, 0.12);
}

.aim-sub {
	font-size: 12px;
	color: var(--fc-muted, #757575);
}

.aim-arrow {
	font-size: 12px;
	color: #d1d5db;
}

.aim-card:hover .aim-arrow {
	color: var(--fc-accent, #f6607d);
}

@media only screen and (max-width: 767px) {
	.aim-card {
		grid-template-columns: 56px minmax(0, 1fr) 12px;
		gap: 10px;
		padding: 10px 12px;
	}

	.aim-thumb {
		width: 56px;
		height: 48px;
	}
}

.aif-intro {
	margin-top: 22px;
}

/* --- 响应式 --- */
@media only screen and (max-width: 767px) {
	.aif-page {
		padding: 14px 12px 48px;
	}

	.aif-studio {
		padding: 14px;
		border-radius: 16px;
	}

	.aif-studio-title {
		font-size: 20px;
	}

	.aif-studio-desc {
		font-size: 13px;
	}

	.aif-board {
		height: clamp(320px, 60vh, 560px);
	}

	.aif-board-sample {
		margin-top: 10px;
	}

	.aif-board-sample-label {
		font-size: 11px;
		letter-spacing: 5px;
	}

	.aif-board-sample-ink {
		font-size: clamp(22px, 6vw, 26px);
	}

	.aif-board-sample-stroke {
		max-width: 120px;
	}

	.aif-toolbar {
		bottom: 10px;
		padding: 4px;
		border-radius: 18px;
	}

	.aif-brush,
	.aif-tool {
		width: 32px;
		height: 32px;
		font-size: 13px;
	}

	.aif-size {
		width: 26px;
		height: 32px;
	}

	.aif-tool-sep {
		display: none;
	}

	.aif-generate {
		width: 100%;
		height: 48px;
		padding: 0 20px;
		font-size: 16px;
		letter-spacing: 1px;
	}
}

/* ===== AI 字体模型：创建页（/ai_font/model）与结果页（/ai_font/model/:task_id） ===== */
/* --- 页头 --- */
.aifm-head {
	margin: 2px 0 18px;
}

.aifm-title-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

.aifm-title-row .aifm-title {
	margin: 0;
}

.aifm-title {
	margin: 12px 0 0;
	font-size: 26px;
	font-weight: 700;
	letter-spacing: 0.5px;
	color: var(--fc-ink, #1e293b);
}

.aifm-title[hidden] {
	display: none;
}

/* 模型改名：铅笔按钮 + 与标题同字号的行内输入框 */
.aifm-rename-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 8px;
	font-size: 13px;
	color: #9ca3af;
	cursor: pointer;
	transition:
		color 0.18s,
		border-color 0.18s,
		background 0.18s;
}

.aifm-rename-btn:hover {
	color: var(--fc-accent, #f6607d);
	border-color: #ffd0da;
	background: #fff9fb;
}

.aifm-rename-btn:focus-visible {
	outline: 2px solid #ffb3c2;
	outline-offset: 2px;
}

.aifm-rename-btn[hidden] {
	display: none;
}

.aifm-rename-form {
	display: flex;
	align-items: center;
	flex: 1 1 320px;
	gap: 8px;
	max-width: 560px;
	min-width: 0;
}

.aifm-rename-form[hidden] {
	display: none;
}

.aifm-rename-input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 2px 2px 6px;
	background: transparent;
	border: 0;
	border-bottom: 2px solid #e5e7eb;
	border-radius: 0;
	font-family: inherit;
	font-size: 26px;
	font-weight: 700;
	letter-spacing: 0.5px;
	color: var(--fc-ink, #1e293b);
	transition: border-color 0.18s;
}

.aifm-rename-input:focus {
	outline: none;
	border-bottom-color: var(--fc-accent, #f6607d);
}

.aifm-rename-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	border: 1px solid #e6e9ef;
	border-radius: 50%;
	background: #fff;
	font-size: 13px;
	color: #6b7280;
	cursor: pointer;
	transition:
		color 0.18s,
		border-color 0.18s,
		background 0.18s;
}

.aifm-rename-action:hover {
	border-color: #ffd0da;
	background: #fff9fb;
	color: var(--fc-accent, #f6607d);
}

.aifm-rename-action:disabled {
	opacity: 0.6;
	cursor: default;
}

.aifm-rename-action:focus-visible {
	outline: 2px solid #ffb3c2;
	outline-offset: 2px;
}

.aifm-rename-save {
	border-color: transparent;
	background: var(--fc-accent, #f6607d);
	color: #fff;
}

.aifm-rename-save:hover {
	border-color: transparent;
	background: var(--fc-accent-dark, #e04b69);
	color: #fff;
}

.aifm-rename-msg {
	margin: 6px 0 0;
	font-size: 13px;
	line-height: 1.7;
	color: var(--fc-accent, #f6607d);
}

.aifm-rename-msg:empty {
	display: none;
}

.aifm-desc {
	margin: 8px 0 0;
	font-size: 14px;
	line-height: 1.8;
	color: var(--fc-muted, #757575);
}

.aifm-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 14px 0 0;
}

.aifm-meta-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 12px;
	background: #f4f5f8;
	border-radius: 999px;
	font-size: 12px;
	color: #6b7280;
	text-decoration: none;
}

.aifm-meta-chip i {
	color: #a2a8b3;
	font-size: 11px;
}

.aifm-meta-link {
	background: var(--fc-accent-tint, #fef0f3);
	color: var(--fc-accent, #f6607d);
	transition:
		background 0.18s,
		transform 0.18s;
}

.aifm-meta-link i {
	color: inherit;
}

.aifm-meta-link:hover {
	background: #ffe3e9;
	transform: translateY(-1px);
}

/* --- 卡片与 tab --- */
.aifm-card {
	background: #fff;
	border: 1px solid var(--fc-line, #e4e4e6);
	border-radius: 18px;
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
	overflow: hidden;
}

.aifm-tabs {
	display: flex;
	gap: 4px;
	padding: 10px 14px 0;
	background: linear-gradient(180deg, #fafbfd, #fff);
	border-bottom: 1px solid #f1f2f5;
}

.aifm-tab {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 10px 22px;
	background: transparent;
	border: 0;
	border-radius: 12px 12px 0 0;
	font-size: 14px;
	color: #6b7280;
	cursor: pointer;
	transition:
		background 0.18s,
		color 0.18s;
}

.aifm-tab:hover {
	background: #f4f5f8;
	color: var(--fc-ink, #1e293b);
}

.aifm-tab.is-on {
	background: #fff;
	color: var(--fc-accent, #f6607d);
	font-weight: 600;
}

.aifm-tab.is-on::after {
	content: "";
	position: absolute;
	left: 22px;
	right: 22px;
	bottom: -1px;
	height: 2px;
	border-radius: 2px;
	background: var(--fc-accent, #f6607d);
}

.aifm-tab:focus-visible {
	outline: 2px solid #ffb3c2;
	outline-offset: -2px;
}

.aifm-tab-locked i {
	font-size: 11px;
	color: #c6cbd6;
	transition: color 0.18s;
}

.aifm-tab-locked:hover i,
.aifm-tab-locked.is-on i {
	color: #f6a7b8;
}

.aifm-pane {
	padding: 20px 22px 24px;
}

.aifm-pane[hidden] {
	display: none;
}


/* 骨架字格：米字格底纹 + 扫光，表示预览图待生成 */
.aifm-skel {
	position: relative;
	aspect-ratio: 1 / 1;
	background-color: #fff;
	background-image:
		linear-gradient(
			90deg,
			transparent calc(50% - 0.5px),
			#f1f3f7 calc(50% - 0.5px),
			#f1f3f7 calc(50% + 0.5px),
			transparent calc(50% + 0.5px)
		),
		linear-gradient(
			0deg,
			transparent calc(50% - 0.5px),
			#f1f3f7 calc(50% - 0.5px),
			#f1f3f7 calc(50% + 0.5px),
			transparent calc(50% + 0.5px)
		);
	border: 1px solid #eceef3;
	border-radius: 12px;
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
	overflow: hidden;
}

.aifm-skel.is-pending::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		100deg,
		transparent 25%,
		rgba(246, 96, 125, 0.12) 50%,
		transparent 75%
	);
	transform: translateX(-100%);
	animation: aifm-shimmer 1.9s ease-in-out infinite;
}

/* --- 预览历史：按天分组，新记录在底部，与输入框形成聊天式结构 --- */
.aifm-history {
	max-height: 400px;
	padding: 18px 18px 28px;
	background: linear-gradient(180deg, #fcfcfe, #f8f9fc);
	border: 1px solid #eef0f4;
	border-radius: 14px;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: #e2e5eb transparent;
}

/* 只在内容超出可滚动时给上下边缘加淡出，避免把静态列表的首尾日也压暗 */
.aifm-history.is-scrollable {
	mask-image: linear-gradient(
		180deg,
		transparent 0,
		#000 16px,
		#000 calc(100% - 16px),
		transparent 100%
	);
	-webkit-mask-image: linear-gradient(
		180deg,
		transparent 0,
		#000 16px,
		#000 calc(100% - 16px),
		transparent 100%
	);
}

.aifm-history::-webkit-scrollbar {
	width: 6px;
}

.aifm-history::-webkit-scrollbar-thumb {
	background: #e2e5eb;
	border-radius: 999px;
}

.aifm-entry {
	padding: 16px 0;
	border-top: 1px dashed #eceef4;
}

.aifm-entry:first-child {
	padding-top: 2px;
	border-top: 0;
}

.aifm-entry-time {
	margin: 0 0 12px;
	font-size: 13px;
	color: #98a0ac;
	font-variant-numeric: tabular-nums;
}

.aifm-chars {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.aifm-chars .aifm-skel {
	flex: 0 0 auto;
	width: 100px;
	height: 100px;
	border-radius: 14px;
}

/* 推理结果字格：田字格底纹（.aifm-skel）+ 居中的字形轮廓 */
.aifm-char {
	display: flex;
	align-items: center;
	justify-content: center;
}

.aifm-char svg {
	display: block;
	width: 88%;
	height: 88%;
}

.aifm-char path {
	fill: var(--fc-ink, #1e293b);
}

/* 详情页预览：模型样张大图（用户画板导出、提交给模型的最终图片） */
.aifm-image {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	gap: 12px;
	margin-bottom: 14px;
	padding: 14px;
	background: linear-gradient(180deg, #fcfcfe, #f8f9fc);
	border: 1px solid #eef0f4;
	border-radius: 14px;
}

.aifm-image img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 220px;
	object-fit: contain;
	background: #fff;
	border: 1px solid #eef0f3;
	border-radius: 12px;
}

.aifm-history-empty {
	margin: 0;
	font-size: 13px;
	line-height: 1.7;
	color: var(--fc-muted, #757575);
}

.aifm-history-note {
	margin: 8px 2px 0;
	font-size: 12px;
	color: #b0b6c0;
	text-align: right;
}

/* 提交按钮里的算力徽标：⚡ 数字 */
.aifm-submit .aifm-submit-cost {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-left: 6px;
	padding: 2px 10px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.24);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.6;
}

.aifm-submit .aifm-submit-cost i {
	font-size: 11px;
}

.aifm-price-note.is-over {
	color: var(--fc-accent, #f6607d);
}

.aifm-price-note {
	margin: 10px 0 0;
	font-size: 12px;
	line-height: 1.7;
	color: #98a0ac;
	text-align: center;
}

.aifm-preview-msg {
	min-height: 18px;
	margin: 10px 0 0;
	font-size: 13px;
	line-height: 1.7;
	color: var(--fc-accent, #f6607d);
}

/* --- 提交预览 --- */
.aifm-submit {
	display: flex;
	gap: 10px;
	margin-top: 16px;
}

.aifm-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 46px;
	padding: 0 16px;
	background: #f7f8fa;
	border: 1px solid #e7e9ee;
	border-radius: 12px;
	font-size: 15px;
	color: var(--fc-ink, #1e293b);
	transition:
		background 0.18s,
		border-color 0.18s,
		box-shadow 0.18s;
}

.aifm-input::placeholder {
	color: #a9b0bb;
}

.aifm-input:focus {
	outline: none;
	background: #fff;
	border-color: #ffc7d3;
	box-shadow: 0 0 0 4px rgba(246, 96, 125, 0.1);
}

/* --- 按钮 --- */
.aifm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 46px;
	padding: 0 26px;
	border: 0;
	border-radius: 12px;
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
	transition:
		transform 0.16s,
		box-shadow 0.16s,
		background 0.16s,
		border-color 0.16s,
		color 0.16s;
}

.aifm-btn i {
	font-size: 14px;
}

.aifm-btn-primary {
	background: linear-gradient(
		135deg,
		var(--fc-accent, #f6607d),
		var(--fc-accent-dark, #e04b69)
	);
	color: #fff;
	box-shadow: 0 10px 22px rgba(246, 96, 125, 0.28);
}

.aifm-btn-primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 14px 26px rgba(246, 96, 125, 0.34);
}

/* 主按钮可以是 <a>（如「下载 ttf 字库」）：全站 a:hover / a:focus 会把文字
   染成 --aHoverColor，与渐变背景同色几乎看不见，这里用更高优先级恢复白色。 */
.aifm-btn-primary,
.aifm-btn-primary:hover,
.aifm-btn-primary:focus,
.aifm-btn-primary:active,
.aifm-btn-primary:visited {
	color: #fff;
}

.aifm-btn-primary:active {
	transform: translateY(0);
}

.aifm-btn-ghost {
	background: #fff;
	border: 1px solid #e6e9ef;
	color: #4b5563;
}

.aifm-btn-ghost:hover {
	border-color: #ffd0da;
	color: var(--fc-accent, #f6607d);
	background: #fff9fb;
}

.aifm-btn-lg {
	height: 52px;
	padding: 0 46px;
	font-size: 16px;
	letter-spacing: 0.5px;
}

.aifm-btn:focus-visible {
	outline: 2px solid #ffb3c2;
	outline-offset: 3px;
}

/* --- ttf字体：付费解锁 --- */
.aifm-paywall {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 26px 18px 10px;
	background: radial-gradient(120% 80% at 50% 0%, #fff6f8 0%, #fff 62%);
	border-radius: 16px;
	text-align: center;
}

.aifm-paywall-icon {
	display: grid;
	place-items: center;
	width: 54px;
	height: 54px;
	background: var(--fc-accent-tint, #fef0f3);
	border: 1px solid #ffdbe3;
	border-radius: 50%;
	color: var(--fc-accent, #f6607d);
	font-size: 19px;
}

.aifm-paywall-title {
	margin: 16px 0 0;
	font-size: 20px;
	font-weight: 700;
	color: var(--fc-ink, #1e293b);
}

.aifm-paywall-desc {
	margin: 8px 0 0;
	font-size: 13px;
	color: var(--fc-muted, #757575);
}

.aifm-plans {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
	width: 100%;
	max-width: 660px;
	margin: 26px 0 0;
}

.aifm-plan {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: 18px 20px 20px;
	background: #fff;
	border: 2px solid #eef0f4;
	border-radius: 16px;
	text-align: left;
	cursor: pointer;
	transition:
		border-color 0.18s,
		background 0.18s,
		box-shadow 0.18s;
}

.aifm-plan:hover {
	border-color: #ffd7e0;
}

.aifm-plan.is-on {
	border-color: var(--fc-accent, #f6607d);
	background: linear-gradient(180deg, #fff8fa, #fff);
	box-shadow: 0 12px 26px rgba(246, 96, 125, 0.14);
}

.aifm-plan:focus-visible {
	outline: 2px solid #ffb3c2;
	outline-offset: 2px;
}

.aifm-plan-head {
	display: flex;
	align-items: center;
	gap: 8px;
}

.aifm-plan-name {
	font-size: 15px;
	font-weight: 600;
	color: var(--fc-ink, #1e293b);
}

.aifm-plan-badge {
	padding: 2px 8px;
	background: linear-gradient(
		135deg,
		var(--fc-accent, #f6607d),
		var(--fc-accent-dark, #e04b69)
	);
	border-radius: 999px;
	font-size: 11px;
	line-height: 1.6;
	color: #fff;
}

.aifm-plan-check {
	display: grid;
	place-items: center;
	width: 18px;
	height: 18px;
	margin-left: auto;
	border: 1.5px solid #e2e6ee;
	border-radius: 50%;
	color: transparent;
	font-size: 9px;
	transition:
		background 0.18s,
		border-color 0.18s,
		color 0.18s;
}

.aifm-plan.is-on .aifm-plan-check {
	background: var(--fc-accent, #f6607d);
	border-color: var(--fc-accent, #f6607d);
	color: #fff;
}

.aifm-plan-features {
	display: grid;
	gap: 8px;
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
}

.aifm-plan-features li {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #4b5563;
}

.aifm-plan-features i {
	color: var(--fc-accent, #f6607d);
	font-size: 10px;
}

.aifm-plan-price {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 4px 8px;
	margin: 16px 0 0;
	font-size: 30px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.5px;
	color: var(--fc-ink, #1e293b);
	transition: color 0.18s;
}

.aifm-plan.is-on .aifm-plan-price {
	color: var(--fc-accent, #f6607d);
}

.aifm-plan-price small {
	margin-right: 2px;
	font-size: 16px;
	font-weight: 600;
}

/* 限时特价：现价 + 划线原价 + 标签同一行对齐基线 */
.aifm-plan-price-now {
	display: inline-flex;
	align-items: baseline;
}
.aifm-plan-price-origin {
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0;
	color: #a2a8b3;
	text-decoration: line-through;
	text-decoration-thickness: 1px;
}
.aifm-plan-price-origin small {
	margin-right: 1px;
	font-size: 11px;
	font-weight: 500;
}
.aifm-sale-note {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0;
	white-space: nowrap;
	color: var(--fc-accent-dark, #e04b69);
}

.aifm-paywall .aifm-btn {
	margin-top: 20px;
}

.aifm-paywall-foot {
	margin: 14px 0 0;
	font-size: 12px;
	color: #a2a8b3;
}

/* --- ttf字体：生成进度（字形推理按页折算，打包阶段为流动条纹） --- */
.aifm-progress {
	width: 100%;
	max-width: 440px;
	margin: 22px auto 0;
}

.aifm-progress-track {
	height: 14px;
	overflow: hidden;
	background: #f3f4f6;
	border-radius: 999px;
	box-shadow: inset 0 1px 2px rgba(30, 41, 59, 0.08);
}

.aifm-progress-bar {
	width: 2%;
	height: 100%;
	background: linear-gradient(
		90deg,
		var(--fc-accent, #f6607d) 0%,
		var(--fc-accent-dark, #e04b69) 100%
	);
	border-radius: inherit;
	transition: width 0.4s ease;
}

/* 打包阶段没有页数可报：整条改成流动条纹，表示仍在进行 */
.aifm-progress-bar.is-packing {
	background-image: repeating-linear-gradient(
		-45deg,
		var(--fc-accent, #f6607d) 0 10px,
		#ffb3c2 10px 20px
	);
	background-size: 28px 28px;
	animation: aifm-progress-flow 0.9s linear infinite;
}

@keyframes aifm-progress-flow {
	from {
		background-position: 0 0;
	}
	to {
		background-position: 28px 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.aifm-progress-bar.is-packing {
		animation: none;
	}
}

.aifm-progress-meta {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin: 10px 0 0;
}

.aifm-progress-text {
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
	color: #6b7280;
	text-align: left;
}

.aifm-progress-percent {
	flex: none;
	font-size: 14px;
	font-weight: 700;
	color: var(--fc-accent, #f6607d);
	font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
	.aifm-progress-text {
		font-size: 12px;
	}
}

/* --- ttf字体：付款后填写字体信息 --- */
.aifm-fontinfo {
	padding: 24px 20px 14px;
	background: radial-gradient(120% 80% at 50% 0%, #fff6f8 0%, #fff 62%);
	border-radius: 16px;
}

.aifm-fontinfo-head {
	display: flex;
	align-items: flex-start;
	gap: 14px;
}

.aifm-fontinfo-icon {
	display: grid;
	place-items: center;
	flex: none;
	width: 48px;
	height: 48px;
	background: var(--fc-accent-tint, #fef0f3);
	border: 1px solid #ffdbe3;
	border-radius: 50%;
	color: var(--fc-accent, #f6607d);
	font-size: 17px;
}

.aifm-fontinfo-title {
	margin: 2px 0 0;
	font-size: 18px;
	font-weight: 700;
	color: var(--fc-ink, #1e293b);
}

.aifm-fontinfo-desc {
	margin: 6px 0 0;
	font-size: 13px;
	color: var(--fc-muted, #757575);
}

/* 已生成/生成中状态的字体信息摘要 */
.aifm-fontinfo-summary {
	margin: 16px 0 0;
	font-size: 13px;
	line-height: 1.9;
	color: #4b5563;
	word-break: break-word;
}

.aifm-fontinfo-form {
	display: grid;
	gap: 16px;
	max-width: 520px;
	margin: 20px auto 0;
}

.aifm-field {
	display: grid;
	gap: 8px;
}

.aifm-field-label {
	font-size: 13px;
	font-weight: 600;
	color: #4b5563;
}

.aifm-field-hint {
	font-size: 12px;
	color: #a2a8b3;
}

/* 校验未通过：红框 + 提示文字就地换成错误文案 */
.aifm-field.is-invalid .aifm-input {
	background: #fff8f9;
	border-color: #f3a8b8;
}

.aifm-field.is-invalid .aifm-input:focus {
	border-color: #e85f7d;
	box-shadow: 0 0 0 4px rgba(224, 75, 105, 0.12);
}

/* 版权归属说明：字库版权归用户，平台只提供算力服务 */
.aifm-fontinfo-note {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0;
	padding: 10px 12px;
	background: #fff7f9;
	border: 1px solid #ffe1e8;
	border-radius: 10px;
	font-size: 12px;
	line-height: 1.7;
	color: #6b7280;
	text-align: left;
}

.aifm-fontinfo-note i {
	margin-top: 3px;
	color: var(--fc-accent, #f6607d);
}

.aifm-field-hint.is-error {
	font-weight: 600;
	color: var(--fc-accent-dark, #e04b69);
}

.aifm-fontinfo-form .aifm-btn {
	justify-self: center;
	min-width: 220px;
	margin-top: 4px;
}

.aifm-fontinfo-msg {
	min-height: 18px;
	margin: 0;
	text-align: center;
	font-size: 13px;
	color: var(--fc-accent-dark, #e04b69);
}

/* 状态面板卖点行内居中排列（覆盖套餐卡的竖排网格） */
.aifm-plan-features-inline {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 18px;
	margin-top: 18px;
}

/* --- 页脚说明 --- */
.aifm-footnote {
	margin: 16px 0 0;
	text-align: center;
	font-size: 12px;
	color: #a8aeb9;
}

/* --- 「开发中」弹窗 --- */
.aifm-mask {
	position: fixed;
	inset: 0;
	z-index: 1200;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(15, 23, 42, 0.42);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	animation: aifm-fade 0.18s ease;
}

.aifm-dialog {
	width: min(100%, 384px);
	padding: 26px 24px 22px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
	text-align: center;
	animation: aifm-pop 0.2s ease;
}

.aifm-dialog-icon {
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	margin: 0 auto 14px;
	background: var(--fc-accent-tint, #fef0f3);
	border-radius: 50%;
	color: var(--fc-accent, #f6607d);
	font-size: 17px;
}

.aifm-dialog h2 {
	margin: 0 0 8px;
	font-size: 17px;
	font-weight: 700;
	color: var(--fc-ink, #1e293b);
}

.aifm-dialog-text {
	margin: 0 0 20px;
	font-size: 13px;
	line-height: 1.8;
	color: var(--fc-muted, #757575);
}

.aifm-dialog .aifm-btn {
	width: 100%;
}

.aifm-dialog-actions {
	display: flex;
	gap: 10px;
}

.aifm-dialog-actions .aifm-btn {
	flex: 1 1 0;
	width: auto;
}

/* --- 字表：ttf 面板里的主体内容，整宽展示，一屏尽量多放字形 --- */
.aifm-words-block {
	margin: 24px 0 0;
	padding: 22px 0 4px;
	border-top: 1px solid #eef0f4;
}

.aifm-words-head {
	margin: 0 0 18px;
}

.aifm-words-title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: var(--fc-ink, #1e293b);
}

.aifm-words-title i {
	color: var(--fc-accent, #f6607d);
	font-size: 13px;
}

.aifm-words-desc {
	margin: 6px 0 0;
	font-size: 13px;
	color: var(--fc-muted, #757575);
}

.aifm-wordlist-summary {
	margin: 0 0 14px;
	font-size: 13px;
	color: #6b7280;
	font-variant-numeric: tabular-nums;
}

.aifm-wordlist-body {
	position: relative;
}

/* 翻页请求中：压暗当前页并盖一层加载提示，不跳空白 */
.aifm-wordlist-body.is-loading .aifm-words,
.aifm-wordlist-body.is-loading .aifm-wordlist-empty {
	opacity: 0.3;
	transition: opacity 0.18s;
}

.aifm-wordlist-loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding-top: 28px;
	pointer-events: none;
}

.aifm-wordlist-loading span {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 18px;
	background: rgba(255, 255, 255, 0.94);
	border: 1px solid #ffdbe3;
	border-radius: 999px;
	box-shadow: 0 8px 24px rgba(224, 75, 105, 0.16);
	font-size: 13px;
	font-weight: 600;
	color: var(--fc-accent-dark, #e04b69);
}

.aifm-wordlist-loading i {
	font-size: 15px;
	animation: aifm-spin 0.9s linear infinite;
}

.aifm-words {
	display: grid;
	grid-template-columns: repeat(10, minmax(0, 1fr));
	gap: 12px;
}

.aifm-word {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
}

.aifm-word .aifm-char {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	border-radius: 12px;
}

.aifm-word-char {
	font-size: 13px;
	line-height: 1.2;
	color: #98a0ac;
}

.aifm-wordlist-empty {
	margin: 0;
	padding: 48px 16px;
	background: #fafbfd;
	border: 1px dashed #eceef4;
	border-radius: 12px;
	text-align: center;
	font-size: 13px;
	color: #98a0ac;
}

.aifm-wordlist-pager {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 10px 14px;
	margin-top: 22px;
}

.aifm-wordlist-pager .aifm-btn {
	width: auto;
	margin-top: 0;
}

.aifm-wordlist-page {
	font-size: 13px;
	color: #6b7280;
	font-variant-numeric: tabular-nums;
}

/* 直跳指定页：页码输入 + 跳转按钮，与上一页/下一页同一行。 */
.aifm-wordlist-jump {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.aifm-wordlist-jump-input {
	width: 64px;
	height: 40px;
	padding: 0 6px;
	text-align: center;
	background: #fff;
	border: 1px solid #e6e9ef;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--fc-ink, #1e293b);
	appearance: textfield;
	-moz-appearance: textfield;
	transition:
		border-color 0.18s,
		box-shadow 0.18s;
}

.aifm-wordlist-jump-input::-webkit-outer-spin-button,
.aifm-wordlist-jump-input::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.aifm-wordlist-jump-input:focus {
	outline: none;
	border-color: #ffc7d3;
	box-shadow: 0 0 0 3px rgba(246, 96, 125, 0.1);
}

.aifm-wordlist-jump-input:disabled {
	background: #f7f8fa;
	color: #a9b0bb;
}

/* 跳转按钮比上一页/下一页小一号，不抢翻页按钮的视觉重量。 */
.aifm-wordlist-jump .aifm-btn {
	height: 40px;
	margin-left: 6px;
	padding: 0 16px;
	font-size: 14px;
}

/* --- React 加载占位 --- */
.aifm-loading-placeholder {
	padding: 60px 20px;
	text-align: center;
	font-size: 14px;
	color: var(--fc-muted, #757575);
}

/* --- 动效 --- */
@keyframes aifm-shimmer {
	0% {
		transform: translateX(-100%);
	}
	60%,
	100% {
		transform: translateX(100%);
	}
}

@keyframes aifm-spin {
	to {
		transform: rotate(360deg);
	}
}

@keyframes aifm-fade {
	from {
		opacity: 0;
	}
}

@keyframes aifm-pop {
	from {
		opacity: 0;
		transform: translateY(8px) scale(0.98);
	}
}

/* --- 响应式 --- */
@media only screen and (max-width: 767px) {
	.aifm-title {
		font-size: 21px;
	}

	.aifm-desc {
		font-size: 13px;
	}

	.aifm-tabs {
		padding: 8px 10px 0;
	}

	.aifm-tab {
		padding: 10px 16px;
	}

	.aifm-tab.is-on::after {
		left: 16px;
		right: 16px;
	}

	.aifm-pane {
		padding: 16px 14px 20px;
	}

	.aifm-rename-form {
		flex: 1 1 100%;
	}

	.aifm-rename-input {
		font-size: 20px;
	}

	.aifm-history {
		max-height: 340px;
		padding: 14px 12px 24px;
	}

	.aifm-entry {
		padding: 12px 0;
	}

	.aifm-entry-time {
		margin-bottom: 10px;
		font-size: 12px;
	}

	.aifm-chars {
		gap: 8px;
	}

	.aifm-submit {
		flex-direction: column;
	}

	.aifm-submit .aifm-btn {
		width: 100%;
	}

	.aifm-plans {
		grid-template-columns: 1fr;
		gap: 12px;
		margin-top: 20px;
	}

	.aifm-plan {
		padding: 16px 16px 18px;
	}

	.aifm-plan-price {
		margin-top: 14px;
		font-size: 26px;
	}

	.aifm-btn-lg {
		width: 100%;
		padding: 0 20px;
	}

	.aifm-words {
		grid-template-columns: repeat(5, minmax(0, 1fr));
		gap: 10px;
	}

	.aifm-word-char {
		font-size: 12px;
	}

	.aifm-wordlist-pager .aifm-btn {
		padding: 0 16px;
	}

	/* 窄屏：上一页/下一页占一行，跳页输入另起一行居中。 */
	.aifm-wordlist-jump {
		flex: 1 0 100%;
		justify-content: center;
		order: 3;
	}
}

@media (prefers-reduced-motion: reduce) {
	.aifm-skel.is-pending::after,
	.aifm-wordlist-loading i,
	.aifm-mask,
	.aifm-dialog {
		animation: none;
	}
}
