/**
 * 标签索引页 + 标签归档内胶囊标签样式
 * 颜色随 html[data-leafs-theme] 使用 leafs-tokens.css 变量
 */

.leafs-ti__sections {
	display: flex;
	flex-direction: column;
	gap: 2.25rem;
}

.leafs-ti__block {
	padding-top: 1.5rem;
	border-top: 1px solid var(--leafs-border);
}

.leafs-ti__block:first-of-type {
	padding-top: 0;
	border-top: none;
}

.leafs-ti__block-title {
	font-size: clamp(1.15rem, 3vw, 1.35rem);
	margin: 0 0 1rem;
	font-weight: 700;
	color: var(--leafs-text);
}

.leafs-ti__block-empty {
	margin: 0 0 0.5rem;
}

.leafs-ti__header {
	margin-bottom: 1.75rem;
}

.leafs-ti__title {
	font-size: clamp(1.5rem, 4vw, 2rem);
	margin: 0 0 0.35rem;
	color: var(--leafs-text);
}

.leafs-ti__intro {
	margin: 0 0 1rem;
	color: var(--leafs-muted);
	font-size: 0.95rem;
}

.leafs-ti__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1rem;
	margin-bottom: 0.75rem;
}

.leafs-ti__search {
	flex: 1 1 220px;
	min-width: 0;
	max-width: 420px;
	padding: 0.55rem 0.85rem;
	border: 1px solid var(--leafs-border);
	border-radius: 10px;
	font-size: 1rem;
	background: var(--leafs-search-bg);
	color: var(--leafs-text);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.leafs-ti__search::placeholder {
	color: var(--leafs-muted2);
	opacity: 1;
}

.leafs-ti__search:focus {
	outline: none;
	border-color: var(--leafs-brand);
	box-shadow: 0 0 0 3px var(--leafs-focus-ring);
}

.leafs-ti__view-switch {
	display: inline-flex;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid var(--leafs-border);
	background: var(--leafs-surface2);
}

.leafs-ti__view-btn {
	margin: 0;
	padding: 0.45rem 0.9rem;
	font-size: 0.875rem;
	border: none;
	background: transparent;
	color: var(--leafs-text);
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

.leafs-ti__view-btn:hover:not(:disabled):not(.is-active) {
	background: var(--leafs-icon-btn-bg-hover);
}

.leafs-ti__view-btn.is-active {
	background: var(--leafs-brand);
	color: var(--leafs-on-primary);
}

.leafs-ti__view-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.leafs-ti__hint {
	font-size: 0.875rem;
	margin: 0 0 0.75rem;
	color: var(--leafs-muted);
}

.leafs-ti__alpha-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
	margin-top: 0.5rem;
}

.leafs-ti__alpha-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	font-size: 0.8125rem;
	font-weight: 600;
	text-decoration: none;
	background: var(--leafs-surface2);
	color: var(--leafs-text);
	border: 1px solid transparent;
	transition: background 0.15s, color 0.15s, transform 0.12s, border-color 0.15s, box-shadow 0.15s;
}

.leafs-ti__alpha-link:hover {
	background: var(--leafs-brand);
	color: var(--leafs-on-primary);
	border-color: transparent;
}

.leafs-ti__alpha-link.is-current {
	background: var(--leafs-brand);
	color: var(--leafs-on-primary);
	box-shadow: 0 0 0 2px var(--leafs-focus-ring);
}

.leafs-ti__empty-msg {
	margin: 1rem 0;
	color: var(--leafs-muted);
}

.leafs-ti__no-data {
	margin: 0.5rem 0 1.5rem;
	color: var(--leafs-muted);
}

.leafs-ti__group {
	margin-bottom: 2rem;
	scroll-margin-top: 6rem;
}

.leafs-ti__group-title {
	font-size: 1.25rem;
	margin: 0 0 0.75rem;
	padding-bottom: 0.35rem;
	border-bottom: 1px solid var(--leafs-border);
	color: var(--leafs-text);
}

.leafs-ti__pills,
.leafs-ti__cloud {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
}

.leafs-ti__cloud {
	justify-content: center;
	line-height: 1.3;
}

.leafs-ti__pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border-radius: 40px;
	background: var(--ti-pill-bg);
	color: var(--leafs-text);
	text-decoration: none;
	font-size: 16px;
	font-weight: 600;
	border: 1px solid var(--leafs-border);
	transition: background 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.leafs-ti__pill-name {
	line-height: 1.2;
}

.leafs-ti__pill-count {
	font-size: 12px;
	font-weight: 500;
	color: var(--leafs-muted);
}

.leafs-ti__pill:hover {
	background: var(--leafs-brand);
	color: var(--leafs-on-primary);
	border-color: transparent;
	transform: translateY(-2px);
	box-shadow: var(--leafs-shadow-card-hover);
}

.leafs-ti__pill:hover .leafs-ti__pill-count {
	color: rgba(255, 255, 255, 0.88);
}

.leafs-ti__cloud-item {
	display: inline-block;
	margin: 4px 6px;
	padding: 4px 8px;
	text-decoration: none;
	color: var(--leafs-text);
	font-weight: 600;
	opacity: 0.92;
	transition: transform 0.2s, color 0.2s, opacity 0.2s;
}

.leafs-ti__cloud-item:hover {
	color: var(--leafs-link);
	opacity: 1;
	transform: scale(1.08);
}

.leafs-ti__pager {
	margin-top: 2rem;
	text-align: center;
}

.leafs-ti__pager-msg {
	margin-top: 0.5rem;
	font-size: 0.875rem;
	color: var(--leafs-muted);
}

/* 标签归档页头部操作区 */
.leafs-tag-arch__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1rem;
	margin: 0.5rem 0 0;
}

.leafs-tag-arch__actions .leafs-pca__rss-btn {
	margin: 0;
}

.leafs-tag-arch__back {
	font-size: 0.875rem;
	color: var(--leafs-link);
	text-decoration: none;
}

.leafs-tag-arch__back:hover {
	color: var(--leafs-brand-hover);
}

.leafs-tag-arch__empty {
	padding: 1rem 0;
	color: var(--leafs-text);
}

.leafs-tag-arch__empty-hint {
	margin-top: 1rem;
	font-size: 0.9rem;
	color: var(--leafs-muted);
}

.leafs-tag-arch__sidebar-pills {
	justify-content: flex-start;
}

@media (max-width: 768px) {
	.leafs-ti__alpha-nav {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding-bottom: 6px;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: thin;
	}

	.leafs-ti__pill {
		padding: 6px 12px;
		font-size: 14px;
	}

	.leafs-ti__search {
		flex-basis: 100%;
		max-width: none;
	}
}
