/* AI 工具库归档页 */
.yw-tools-page {
	background: linear-gradient(180deg, #f8faff 0%, var(--yw-bg) 220px);
	padding-bottom: 48px;
}

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

/* 主内容区 */
.yw-tools-page__main {
	min-width: 0;
}

.yw-tools-page__head {
	margin-bottom: 18px;
}

.yw-tools-page__titles {
	min-width: 0;
}

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

.yw-tools-page__view {
	display: inline-flex;
	padding: 4px;
	background: #fff;
	border: 1px solid var(--yw-border);
	border-radius: 999px;
	gap: 4px;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.yw-tools-view-btn {
	border: 0;
	background: transparent;
	padding: 8px 14px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	color: #64748b;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.15s ease, color 0.15s ease;
}

.yw-tools-view-btn:hover {
	color: var(--yw-primary);
}

.yw-tools-view-btn.is-active {
	background: var(--yw-primary);
	color: #fff;
	box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.yw-tools-page__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	flex-wrap: wrap;
	margin-bottom: 20px;
}

.yw-tools-page__filters {
	margin: 0;
}

.yw-tools-pill {
	padding: 7px 16px;
	border: 1px solid var(--yw-border);
	background: #fff;
	color: #64748b;
	font-size: 13px;
	box-shadow: 0 1px 4px rgba(15, 23, 42, 0.03);
}

.yw-tools-pill:hover {
	border-color: #c7d2fe;
	color: var(--yw-primary);
	text-decoration: none;
}

.yw-tools-pill.is-active {
	border-color: transparent;
	background: var(--yw-primary);
	color: #fff;
	box-shadow: 0 4px 14px rgba(79, 70, 229, 0.22);
}

.yw-tools-page__toolbar-end {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
}

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

/* 工具网格 */
.yw-grid--tools-archive {
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
}

.yw-tool-archive-card {
	background: #fff;
	border: 1px solid #e8edf5;
	border-radius: 16px;
	box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.yw-tool-archive-card:hover {
	transform: translateY(-3px);
	border-color: #c7d2fe;
	box-shadow: 0 12px 32px rgba(79, 70, 229, 0.1);
}

.yw-tool-archive-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 16px;
	color: inherit;
	text-decoration: none;
}

.yw-tool-archive-card__link:hover {
	text-decoration: none;
}

.yw-tool-archive-card__top {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 12px;
}

.yw-tool-archive-card__logo {
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	border-radius: 12px;
	overflow: hidden;
	background: #f8fafc;
	border: 1px solid #eef2f8;
	display: grid;
	place-items: center;
}

.yw-tool-archive-card__logo-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.yw-tool-archive-card__logo-ph {
	font-size: 13px;
	font-weight: 800;
	color: var(--yw-primary);
}

.yw-tool-archive-card__head {
	flex: 1;
	min-width: 0;
}

.yw-tool-archive-card__title {
	margin: 0 0 6px;
	font-size: 15px;
	font-weight: 800;
	line-height: 1.35;
	color: #0f172a;
}

.yw-tool-archive-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.yw-tool-archive-card__tag {
	padding: 2px 8px;
	border-radius: 6px;
	background: #f1f5f9;
	color: #64748b;
	font-size: 11px;
	font-weight: 600;
}

.yw-tool-archive-card__bookmark {
	flex-shrink: 0;
	color: #cbd5e1;
	margin-top: 2px;
}

.yw-tool-archive-card:hover .yw-tool-archive-card__bookmark {
	color: #94a3b8;
}

.yw-tool-archive-card__desc {
	margin: 0 0 12px;
	font-size: 13px;
	line-height: 1.55;
	color: #64748b;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	flex: 1;
	min-height: calc(2 * 1.55 * 13px);
	word-break: break-word;
}

.yw-tool-archive-card__stats {
	display: flex;
	align-items: center;
	gap: 14px;
	padding-top: 12px;
	border-top: 1px solid #f1f5f9;
	font-size: 12px;
	font-weight: 600;
	color: #64748b;
}

.yw-tool-archive-card__stat {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.yw-tool-archive-card__stat svg {
	color: #94a3b8;
}

/* 列表视图 */
.yw-tools-grid--list {
	grid-template-columns: 1fr;
	gap: 12px;
}

.yw-tools-grid--list .yw-tool-archive-card__link {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	padding: 14px 18px;
}

.yw-tools-grid--list .yw-tool-archive-card__top {
	flex: 1;
	min-width: 240px;
	margin-bottom: 0;
}

.yw-tools-grid--list .yw-tool-archive-card__desc {
	flex: 1 1 100%;
	margin: 0 0 8px;
	-webkit-line-clamp: 2;
	line-clamp: 2;
}

.yw-tools-grid--list .yw-tool-archive-card__stats {
	border-top: 0;
	padding-top: 0;
	margin-left: auto;
}

.yw-tools-empty {
	padding: 48px 24px;
	text-align: center;
	background: #fff;
	border: 1px dashed var(--yw-border);
	border-radius: 16px;
}

.yw-tools-empty p {
	margin: 0 0 16px;
	color: var(--yw-muted);
}

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

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

	.yw-tools-sidebar {
		position: static;
	}
}

@media (max-width: 768px) {
	.yw-grid--tools-archive {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.yw-tools-page__toolbar-end {
		width: 100%;
		justify-content: space-between;
	}
}

@media (max-width: 480px) {
	.yw-grid--tools-archive:not(.yw-tools-grid--list) {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}
}
