/* Prompt 库归档页 */
.yw-prompt-page {
	--yw-prompt-card-title-h: 52px;
	background: linear-gradient(180deg, #f8f9fb 0%, var(--yw-bg) 220px);
	padding-bottom: 48px;
}

.yw-prompt-page__grid {
	grid-template-columns: 268px minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

.yw-prompt-page__main {
	min-width: 0;
}

.yw-prompt-tag-cloud {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.yw-prompt-tag-cloud__item {
	display: inline-flex;
	padding: 5px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	color: #64748b;
	background: #f1f5f9;
	border: 1px solid #e2e8f0;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.yw-prompt-tag-cloud__item:hover {
	color: var(--yw-primary);
	border-color: #c7d2fe;
	background: #eef2ff;
	text-decoration: none;
}

/* 页头 */
.yw-prompt-page__hero {
	margin-bottom: 18px;
}

.yw-prompt-page .yw-archive__title {
	font-size: clamp(26px, 3.2vw, 34px);
	letter-spacing: -0.03em;
}

.yw-prompt-page__search {
	display: flex;
	align-items: stretch;
	max-width: 100%;
	margin-top: 14px;
	border: 1px solid var(--yw-border);
	border-radius: 999px;
	background: #fff;
	overflow: hidden;
	box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.yw-prompt-page__search-input {
	flex: 1;
	border: 0;
	padding: 12px 18px;
	font: inherit;
	font-size: 14px;
	min-width: 0;
	outline: none;
}

.yw-prompt-page__search-btn {
	border-radius: 0 999px 999px 0;
	padding-left: 22px;
	padding-right: 22px;
	flex-shrink: 0;
}

.yw-prompt-page__hot-search {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	align-items: center;
	margin-top: 10px;
	font-size: 13px;
}

.yw-prompt-page__hot-label {
	color: var(--yw-muted);
}

.yw-prompt-page__hot-search a {
	color: #64748b;
	text-decoration: none;
	font-weight: 600;
}

.yw-prompt-page__hot-search a:hover {
	color: var(--yw-primary);
}

/* 统计 */
.yw-prompt-stats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	margin-bottom: 20px;
}

.yw-prompt-stat {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 14px 16px;
	border-radius: 16px;
	border: 1px solid var(--yw-border);
	background: #fff;
	box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.yw-prompt-stat__icon {
	width: 40px;
	height: 40px;
	border-radius: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	flex-shrink: 0;
}

.yw-prompt-stat__icon--a { background: #eef2ff; }
.yw-prompt-stat__icon--b { background: #fff7ed; }
.yw-prompt-stat__icon--c { background: #fefce8; }
.yw-prompt-stat__icon--d { background: #f5f3ff; }

.yw-prompt-stat strong {
	display: block;
	font-size: 20px;
	line-height: 1.1;
	letter-spacing: -0.02em;
}

.yw-prompt-stat span {
	font-size: 12px;
	color: var(--yw-muted);
}

/* 工具栏 */
.yw-prompt-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 18px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--yw-border);
}

.yw-prompt-tabs {
	display: flex;
	gap: 4px;
	flex-wrap: wrap;
}

.yw-prompt-tabs__item {
	padding: 8px 14px;
	font-size: 14px;
	font-weight: 600;
	color: #64748b;
	text-decoration: none;
	border-bottom: 2px solid transparent;
	margin-bottom: -13px;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.yw-prompt-tabs__item:hover {
	color: var(--yw-primary);
	text-decoration: none;
}

.yw-prompt-tabs__item.is-active {
	color: var(--yw-primary);
	border-bottom-color: var(--yw-primary);
}

.yw-prompt-toolbar__actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 14px;
	flex-wrap: wrap;
	margin-left: auto;
}

.yw-prompt-toolbar__meta {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: #94a3b8;
	white-space: nowrap;
}

.yw-prompt-filters {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.yw-prompt-filters__select {
	border: 1px solid var(--yw-border);
	border-radius: 12px;
	padding: 8px 32px 8px 12px;
	font: inherit;
	font-size: 13px;
	background: #fff;
	color: inherit;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m6 9 6 6 6-6' stroke='%2364748b' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
}

/* 网格列表（封面 3:4，标题区固定高度，非瀑布流） */
.yw-prompt-masonry {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	align-items: stretch;
}

.yw-prompt-masonry-card {
	display: flex;
	flex-direction: column;
	border-radius: 14px;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--yw-border);
	box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
	transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.yw-prompt-masonry-card:hover {
	box-shadow: 0 10px 28px rgba(79, 70, 229, 0.12);
	transform: translateY(-2px);
}

.yw-prompt-masonry-card__link {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
	color: inherit;
	text-decoration: none;
}

.yw-prompt-masonry-card__link:hover {
	text-decoration: none;
}

.yw-prompt-masonry-card__media {
	position: relative;
	width: 100%;
	aspect-ratio: 3 / 4;
	flex: 0 0 auto;
	overflow: hidden;
	background: #e2e8f0;
}

.yw-prompt-masonry-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.yw-prompt-masonry-card__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.yw-prompt-masonry-card__placeholder--indigo { background: linear-gradient(145deg, #eef2ff, #c7d2fe); }
.yw-prompt-masonry-card__placeholder--violet { background: linear-gradient(145deg, #f5f3ff, #ddd6fe); }
.yw-prompt-masonry-card__placeholder--blue { background: linear-gradient(145deg, #eff6ff, #bfdbfe); }
.yw-prompt-masonry-card__placeholder--cyan { background: linear-gradient(145deg, #ecfeff, #a5f3fc); }
.yw-prompt-masonry-card__placeholder--rose { background: linear-gradient(145deg, #fff1f2, #fecdd3); }
.yw-prompt-masonry-card__placeholder--amber { background: linear-gradient(145deg, #fffbeb, #fde68a); }
.yw-prompt-masonry-card__placeholder--emerald { background: linear-gradient(145deg, #ecfdf5, #a7f3d0); }

.yw-prompt-masonry-card__icon {
	font-size: 42px;
	line-height: 1;
	filter: drop-shadow(0 4px 8px rgba(15, 23, 42, 0.08));
}

.yw-prompt-masonry-card__badge {
	position: absolute;
	left: 10px;
	bottom: 10px;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	color: #fff;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(4px);
}

.yw-prompt-masonry-card__title {
	flex: 0 0 var(--yw-prompt-card-title-h);
	box-sizing: border-box;
	height: var(--yw-prompt-card-title-h);
	min-height: var(--yw-prompt-card-title-h);
	margin: 0;
	padding: 12px 14px;
	font-size: 14px;
	font-weight: 800;
	line-height: 1.4;
	color: #0f172a;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

.yw-prompt-masonry-card__link:hover .yw-prompt-masonry-card__title {
	color: var(--yw-primary-dark);
}

/* 归档卡片（非瀑布流场景保留） */
.yw-prompt-card--archive {
	display: flex;
	flex-direction: column;
	padding: 14px;
	border-radius: 16px;
	border: 1px solid #ededed;
	background: #fff;
	box-shadow: 0 2px 14px rgba(15, 23, 42, 0.05);
	min-height: 100%;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.yw-prompt-card--archive:hover {
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
	transform: translateY(-2px);
}

.yw-prompt-card--archive .yw-prompt-card__top {
	display: grid;
	grid-template-columns: 36px 1fr 28px;
	gap: 8px;
	align-items: start;
	margin-bottom: 8px;
}

.yw-prompt-card--archive .yw-prompt-card__brand {
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
}

.yw-prompt-card--archive .yw-prompt-card__title {
	margin: 0;
	font-size: 14px;
	font-weight: 800;
	line-height: 1.35;
}

.yw-prompt-card--archive .yw-prompt-card__title a {
	color: inherit;
	text-decoration: none;
}

.yw-prompt-card--archive .yw-prompt-card__title a:hover {
	color: var(--yw-primary);
}

.yw-prompt-card--archive .yw-prompt-card__save {
	border: 0;
	background: transparent;
	color: #94a3b8;
	padding: 2px;
	cursor: pointer;
	justify-self: end;
}

.yw-prompt-card--archive .yw-prompt-card__save:hover {
	color: var(--yw-primary);
}

.yw-prompt-card--archive .yw-prompt-card__desc {
	margin: 0 0 8px;
	font-size: 12px;
	line-height: 1.5;
	color: var(--yw-muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.yw-prompt-card--archive .yw-prompt-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 8px;
}

.yw-prompt-card--archive .yw-prompt-card__tag {
	padding: 2px 8px;
	border-radius: 6px;
	font-size: 10px;
	font-weight: 700;
}

.yw-prompt-card--archive .yw-prompt-card__tag--red { color: #e11d48; background: #fff1f2; }
.yw-prompt-card--archive .yw-prompt-card__tag--green { color: #15803d; background: #ecfdf5; }
.yw-prompt-card--archive .yw-prompt-card__tag--purple { color: #7c3aed; background: #f5f3ff; }
.yw-prompt-card--archive .yw-prompt-card__tag--blue { color: #1d4ed8; background: #eff6ff; }
.yw-prompt-card--archive .yw-prompt-card__tag--indigo { color: #4338ca; background: #eef2ff; }
.yw-prompt-card--archive .yw-prompt-card__tag--dark { color: #111827; background: #f3f4f6; }
.yw-prompt-card--archive .yw-prompt-card__tag--gray { color: #64748b; background: #f1f5f9; }

.yw-prompt-card--archive .yw-prompt-card__preview {
	margin: 0 0 10px;
	padding: 10px;
	border-radius: 10px;
	background: #f8fafc;
	border: 1px solid #eef2f7;
	max-height: 72px;
	overflow: hidden;
}

.yw-prompt-card--archive .yw-prompt-card__preview code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 11px;
	line-height: 1.45;
	color: #475569;
	white-space: pre-wrap;
	word-break: break-word;
}

.yw-prompt-card--archive .yw-prompt-card__foot {
	margin-top: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	flex-wrap: wrap;
	padding-top: 8px;
	border-top: 1px solid #f1f5f9;
}

.yw-prompt-card--archive .yw-prompt-card__author {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
	font-size: 11px;
	color: var(--yw-muted);
}

.yw-prompt-card--archive .yw-prompt-card__avatar {
	border-radius: 999px;
	width: 22px;
	height: 22px;
}

.yw-prompt-card--archive .yw-prompt-card__author-name {
	font-weight: 700;
	color: #334155;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 72px;
}

.yw-prompt-card--archive .yw-prompt-card__date::before {
	content: "·";
	margin: 0 4px;
}

.yw-prompt-card--archive .yw-prompt-card__metrics {
	display: flex;
	gap: 10px;
	align-items: center;
	font-size: 11px;
	font-weight: 600;
	color: #64748b;
}

.yw-prompt-card--archive .yw-prompt-card__metric {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.yw-prompt-card--archive .yw-prompt-card__metric--rate {
	color: #d97706;
}

/* 分页：样式见 main.css .yw-pagination */
.yw-prompt-masonry {
	margin-bottom: 0;
}

.yw-prompt-page .yw-pagination-wrap {
	margin-top: 28px;
}

@media (max-width: 1200px) {
	.yw-prompt-masonry {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.yw-prompt-stats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.yw-prompt-page__grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 768px) {
	.yw-prompt-page {
		--yw-prompt-card-title-h: 48px;
	}

	.yw-prompt-masonry {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	.yw-prompt-masonry-card {
		border-radius: 12px;
	}

	.yw-prompt-masonry-card__title {
		padding: 10px 12px;
		font-size: 13px;
	}

}

@media (max-width: 640px) {

	.yw-prompt-stats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
		margin-bottom: 16px;
	}

	.yw-prompt-stat {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
		padding: 12px;
		border-radius: 14px;
	}

	.yw-prompt-stat__icon {
		width: 36px;
		height: 36px;
		font-size: 16px;
	}

	.yw-prompt-stat strong {
		font-size: 18px;
	}

	.yw-prompt-stat span {
		font-size: 11px;
		line-height: 1.35;
	}

	.yw-prompt-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.yw-prompt-toolbar__actions {
		width: 100%;
		margin-left: 0;
		justify-content: space-between;
	}

	.yw-prompt-toolbar__meta {
		white-space: normal;
	}

	.yw-prompt-filters {
		width: 100%;
	}
	.yw-prompt-filters__select {
		flex: 1;
		min-width: 0;
	}
}
