/* 教程与案例聚合页 */
.yw-tutorials-page {
	background: linear-gradient(180deg, #f8faff 0%, var(--yw-bg) 200px);
	padding-bottom: 48px;
}

.yw-tutorials-page__grid {
	align-items: start;
}

.yw-tutorials-page__grid > .yw-aside,
.yw-tutorials-page__grid > .yw-tutorials-aside {
	max-height: calc(100vh - 100px);
	overflow: auto;
}

.yw-tutorials-page__center {
	min-width: 0;
}

.yw-tutorials-sidebar__hash {
	font-weight: 800;
	color: var(--yw-primary);
}

.yw-tutorials-paths {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 8px;
}

.yw-tutorials-paths__item {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 10px;
	border-radius: 12px;
	text-decoration: none;
	color: inherit;
	border: 1px solid var(--yw-border);
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.yw-tutorials-paths__item:hover {
	border-color: #c7d2fe;
	box-shadow: 0 4px 12px rgba(79, 70, 229, 0.08);
	text-decoration: none;
}

.yw-tutorials-paths__icon {
	width: 32px;
	height: 32px;
	border-radius: 10px;
	background: #eef2ff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	flex-shrink: 0;
}

.yw-tutorials-paths__text strong {
	display: block;
	font-size: 13px;
	margin-bottom: 2px;
}

.yw-tutorials-paths__text span {
	font-size: 11px;
	color: var(--yw-muted);
}

.yw-tutorials-paths__more {
	display: inline-block;
	margin-top: 10px;
	font-size: 13px;
	font-weight: 600;
	color: var(--yw-primary);
	text-decoration: none;
}

/* Hero */
.yw-tutorials-hero {
	display: grid;
	grid-template-columns: 1fr 220px;
	gap: 20px;
	align-items: center;
	margin-bottom: 24px;
	padding: 28px 28px 24px;
	border-radius: 20px;
	background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 48%, #fdf2f8 100%);
	border: 1px solid rgba(99, 102, 241, 0.12);
	overflow: hidden;
}

.yw-tutorials-hero__title {
	margin: 0 0 8px;
	font-size: clamp(24px, 3vw, 32px);
	letter-spacing: -0.03em;
	line-height: 1.2;
}

.yw-tutorials-hero__sub {
	margin: 0 0 16px;
	color: #64748b;
	font-size: 15px;
	max-width: 520px;
}

.yw-tutorials-hero__search {
	display: flex;
	max-width: 520px;
	border-radius: 999px;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--yw-border);
	box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

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

.yw-tutorials-hero__search .yw-btn {
	border-radius: 0 999px 999px 0;
	flex-shrink: 0;
}

.yw-tutorials-hero__hot {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	margin-top: 10px;
	font-size: 13px;
	color: var(--yw-muted);
}

.yw-tutorials-hero__hot a {
	color: #64748b;
	font-weight: 600;
	text-decoration: none;
}

.yw-tutorials-hero__hot a:hover {
	color: var(--yw-primary);
}

.yw-tutorials-hero__illus {
	position: relative;
	width: 180px;
	height: 140px;
	margin: 0 auto;
}

.yw-tutorials-hero__cap,
.yw-tutorials-hero__book,
.yw-tutorials-hero__tablet {
	position: absolute;
	font-size: 42px;
	filter: drop-shadow(0 8px 16px rgba(15, 23, 42, 0.12));
}

.yw-tutorials-hero__cap { top: 0; left: 20px; transform: rotate(-8deg); }
.yw-tutorials-hero__book { bottom: 10px; left: 0; font-size: 36px; }
.yw-tutorials-hero__tablet { top: 24px; right: 0; font-size: 38px; }

/* 区块 */
.yw-tutorials-section {
	margin-bottom: 28px;
}

.yw-tutorials-section__head {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px 14px;
	margin-bottom: 14px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--yw-border);
}

.yw-tutorials-section__title {
	margin: 0;
	font-size: 20px;
	font-weight: 800;
	letter-spacing: -0.02em;
	margin-right: auto;
}

.yw-tutorials-section__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.yw-tutorials-section__tab {
	padding: 6px 12px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	color: #64748b;
	text-decoration: none;
}

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

.yw-tutorials-section__tab.is-active {
	background: #eef2ff;
	color: var(--yw-primary);
}

.yw-tutorials-section__more {
	font-size: 13px;
	font-weight: 600;
	color: var(--yw-primary);
	text-decoration: none;
	white-space: nowrap;
}

.yw-tutorials-section__more:hover {
	text-decoration: underline;
}

/* 网格 5 列 */
.yw-tutorials-grid {
	display: grid;
	gap: 14px;
}

.yw-tutorials-grid--tutorials,
.yw-tutorials-grid--cases {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* 教程卡片 */
.yw-tutorial-card {
	border-radius: 16px;
	overflow: hidden;
	background: #fff;
	border: 1px solid #ededed;
	box-shadow: 0 2px 14px rgba(15, 23, 42, 0.05);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.yw-tutorial-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.yw-tutorial-card__media {
	position: relative;
	aspect-ratio: 16 / 10;
	background: linear-gradient(135deg, #e0e7ff, #fae8ff);
}

.yw-tutorial-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.yw-tutorial-card__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #dbeafe, #ede9fe);
}

.yw-tutorial-card__badge {
	position: absolute;
	top: 8px;
	left: 8px;
	padding: 3px 8px;
	border-radius: 6px;
	font-size: 10px;
	font-weight: 800;
	color: #fff;
	background: linear-gradient(135deg, #f97316, #ef4444);
}

.yw-tutorial-card__body {
	padding: 12px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.yw-tutorial-card__title {
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 800;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.yw-tutorial-card__desc {
	margin: 0 0 10px;
	font-size: 11px;
	line-height: 1.45;
	color: var(--yw-muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	flex: 1;
}

.yw-tutorial-card__foot {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.yw-tutorial-card__author {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 11px;
	color: #64748b;
}

.yw-tutorial-card__avatar {
	border-radius: 999px;
	width: 22px;
	height: 22px;
}

.yw-tutorial-card__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	flex-wrap: wrap;
}

.yw-tutorial-card__tag {
	padding: 2px 7px;
	border-radius: 6px;
	font-size: 10px;
	font-weight: 700;
	color: var(--yw-primary);
	background: #eef2ff;
}

.yw-tutorial-card__lessons {
	font-size: 10px;
	color: #94a3b8;
	font-weight: 600;
}

/* 案例卡片 */
.yw-case-card {
	border-radius: 16px;
	overflow: hidden;
	background: #fff;
	border: 1px solid #ededed;
	box-shadow: 0 2px 14px rgba(15, 23, 42, 0.05);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.yw-case-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.yw-case-card__media {
	aspect-ratio: 16 / 10;
	background: linear-gradient(135deg, #fce7f3, #e0f2fe);
}

.yw-case-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.yw-case-card__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #ffedd5, #dbeafe);
}

.yw-case-card__body {
	padding: 12px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.yw-case-card__title {
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 800;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.yw-case-card__desc {
	margin: 0 0 6px;
	font-size: 11px;
	color: var(--yw-muted);
	line-height: 1.45;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.yw-case-card__tag {
	display: inline-block;
	margin-bottom: 6px;
	padding: 2px 7px;
	border-radius: 6px;
	font-size: 10px;
	font-weight: 700;
	color: #64748b;
	background: #f1f5f9;
}

.yw-case-card__metric {
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 800;
	color: #ea580c;
}

.yw-case-card__foot {
	margin-top: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding-top: 8px;
	border-top: 1px solid #f1f5f9;
	font-size: 11px;
	color: #64748b;
}

.yw-case-card__author {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
}

.yw-case-card__avatar {
	border-radius: 999px;
	width: 22px;
	height: 22px;
}

.yw-case-card__views {
	font-weight: 700;
	flex-shrink: 0;
}

/* 右侧栏 */
.yw-tutorials-aside.yw-aside {
	padding: 0;
	overflow: hidden;
	display: block;
}

.yw-tutorials-aside__section {
	padding: 16px 18px;
	border-bottom: 1px solid var(--yw-border);
}

.yw-tutorials-aside__section:last-child {
	border-bottom: 0;
}

.yw-tutorials-aside__title {
	margin: 0 0 12px;
	font-size: 15px;
	font-weight: 800;
}

/* 归档列表 */
.yw-tutorials-archive__head {
	margin-bottom: 16px;
}

.yw-tutorials-archive__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 20px;
}

.yw-tutorials-archive__tabs {
	margin: 0;
}

.yw-tutorials-archive__pagination {
	margin-top: 24px;
	display: grid;
	gap: 10px;
}

.yw-tutorials-archive__meta {
	margin: 0;
	font-size: 13px;
	color: var(--yw-muted);
	text-align: center;
}

.yw-tutorials-rank {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 8px;
}

.yw-tutorials-rank__item {
	display: grid;
	grid-template-columns: 24px 1fr auto;
	gap: 8px;
	align-items: center;
	font-size: 13px;
}

.yw-tutorials-rank__num {
	width: 22px;
	height: 22px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 800;
	background: #f1f5f9;
	color: #64748b;
}

.yw-tutorials-rank__num--gold { background: #fef2f2; color: #dc2626; }
.yw-tutorials-rank__num--silver { background: #fff7ed; color: #ea580c; }
.yw-tutorials-rank__num--bronze { background: #fefce8; color: #ca8a04; }

.yw-tutorials-rank__link {
	color: inherit;
	text-decoration: none;
	font-weight: 600;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.yw-tutorials-rank__link:hover {
	color: var(--yw-primary);
}

.yw-tutorials-rank__views {
	font-size: 11px;
	color: #94a3b8;
	font-weight: 600;
}

.yw-tutorials-picks {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 10px;
}

.yw-tutorials-picks__item {
	display: flex;
	gap: 10px;
	align-items: center;
	text-decoration: none;
	color: inherit;
}

.yw-tutorials-picks__item:hover strong {
	color: var(--yw-primary);
}

.yw-tutorials-picks__thumb {
	width: 48px;
	height: 48px;
	border-radius: 10px;
	overflow: hidden;
	flex-shrink: 0;
	background: #f1f5f9;
}

.yw-tutorials-picks__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.yw-tutorials-picks__ph {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	font-size: 20px;
}

.yw-tutorials-picks__body strong {
	display: block;
	font-size: 13px;
	line-height: 1.35;
	margin-bottom: 2px;
}

.yw-tutorials-picks__body span {
	font-size: 11px;
	color: var(--yw-muted);
}

.yw-tutorials-aside__community {
	background: linear-gradient(180deg, #eff6ff, #eef2ff);
	text-align: center;
}

.yw-tutorials-aside__community-art img {
	margin: 0 auto 8px;
	display: block;
}

.yw-tutorials-aside__community-title {
	margin: 0 0 10px;
	font-size: 16px;
	font-weight: 800;
}

.yw-tutorials-aside__community-list {
	list-style: none;
	margin: 0 0 14px;
	padding: 0;
	text-align: left;
	font-size: 12px;
	color: #475569;
	display: grid;
	gap: 6px;
}

.yw-tutorials-aside__community-list li::before {
	content: "✓";
	color: var(--yw-primary);
	margin-right: 6px;
	font-weight: 800;
}

@media (max-width: 1080px) {
	.yw-tutorials-page__grid > .yw-aside,
	.yw-tutorials-page__grid > .yw-tutorials-aside {
		max-height: none;
		overflow: visible;
	}
}

@media (max-width: 900px) {
	.yw-tutorials-hero {
		grid-template-columns: 1fr;
	}
	.yw-tutorials-hero__art {
		display: none;
	}
}

@media (max-width: 640px) {
	.yw-tutorials-grid--tutorials,
	.yw-tutorials-grid--cases {
		grid-template-columns: 1fr 1fr;
	}
}

/* 移动端：与全站分类胶囊统一 */
@media (max-width: 768px) {
	.yw-tutorials-section__head {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
		padding-bottom: 12px;
	}

	.yw-tutorials-section__title {
		margin-right: 0;
		font-size: 18px;
	}

	.yw-tutorials-section__tabs {
		display: inline-flex;
		align-items: center;
		flex-wrap: nowrap;
		gap: 4px;
		width: 100%;
		max-width: 100%;
		margin: 0;
		padding: 3px;
		border: 1px solid var(--yw-cat-pill-border, #e2e8f0);
		border-radius: 999px;
		background: var(--yw-cat-pill-bg, #fff);
		box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.yw-tutorials-section__tabs::-webkit-scrollbar {
		display: none;
	}

	.yw-tutorials-section__tab {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		flex-shrink: 0;
		min-height: 34px;
		padding: 6px 12px !important;
		border: 0 !important;
		border-radius: 999px !important;
		background: transparent !important;
		font-size: 12px !important;
		font-weight: 600 !important;
		color: var(--yw-cat-pill-text, #64748b) !important;
		white-space: nowrap;
	}

	.yw-tutorials-section__tab.is-active {
		background: var(--yw-cat-pill-active-bg, linear-gradient(135deg, #eef2ff, #f5f3ff)) !important;
		color: var(--yw-cat-pill-active-text, var(--yw-primary)) !important;
		font-weight: 700 !important;
		box-shadow: inset 0 0 0 1px var(--yw-cat-pill-active-ring, rgba(79, 70, 229, 0.14)) !important;
	}

	.yw-tutorials-section__more {
		align-self: flex-start;
		font-size: 12px;
	}

	.yw-tutorials-page__center > .yw-archive__mobile-filter-bar {
		display: flex;
		justify-content: flex-end;
		margin: 0 0 10px;
	}
}
