/* =============================================================
 * AI 工具榜单单页（page-rankings.php）
 * 1:1 还原参考设计；圆角统一跟随主题「内容圆角」(--io-radius)。
 * 外层宽度由父主题 .container（--main-max-width）控制。
 * ============================================================= */

.io9200-rank-page {
	margin-top: 0;
}

.io9200-rank-panel {
	width: 100%;
	background: #ffffff;
	border-radius: var(--io-radius);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.06), 0 8px 20px rgba(0, 0, 0, 0.03);
	padding: 32px 36px 48px;
	transition: box-shadow 0.3s ease;
}

/* ===== 头部 ===== */
.rank-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px 24px;
	margin-bottom: 28px;
	padding-bottom: 20px;
	border-bottom: 1px solid #eef2f7;
}

.rank-header-left {
	display: flex;
	align-items: center;
	gap: 14px;
}

.rank-header-icon {
	font-size: 32px;
	line-height: 1;
}

.rank-header-left h1 {
	font-size: 26px;
	font-weight: 700;
	background: linear-gradient(135deg, #4f46e5, #7c3aed);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	letter-spacing: -0.5px;
	margin: 0;
}

.rank-header-right {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 14px;
	color: #6b7280;
}

.rank-update-time {
	background: #f3f4f6;
	padding: 6px 14px;
	border-radius: 30px;
	font-size: 13px;
	color: #4b5563;
	display: flex;
	align-items: center;
	gap: 6px;
}

.rank-dot {
	display: inline-block;
	width: 7px;
	height: 7px;
	background: #22c55e;
	border-radius: 50%;
	animation: rank-pulse-dot 2s infinite;
}

@keyframes rank-pulse-dot {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.4; transform: scale(0.8); }
}

/* ===== 榜单切换 Tabs ===== */
.rank-tabs-wrapper {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px 20px;
	margin-bottom: 22px;
}

.rank-tabs {
	display: flex;
	gap: 4px;
	background: #f1f4f9;
	padding: 4px;
	border-radius: calc(var(--io-radius) * 0.5);
}

.rank-tab-btn {
	padding: 10px 24px;
	border: none;
	border-radius: calc(var(--io-radius) * 0.4);
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	background: transparent;
	color: #6b7280;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: inherit;
}

.rank-tab-btn:hover {
	color: #374151;
	background: rgba(255, 255, 255, 0.5);
}

.rank-tab-btn.active {
	background: #ffffff;
	color: #4f46e5;
	box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.rank-tab-emoji {
	font-size: 17px;
}

/* ===== 时间维度切换 ===== */
.rank-time-filter {
	display: flex;
	gap: 4px;
	background: #f1f4f9;
	padding: 4px;
	border-radius: calc(var(--io-radius) * 0.43);
	flex-wrap: wrap;
}

.rank-time-btn {
	padding: 8px 16px;
	border: none;
	border-radius: calc(var(--io-radius) * 0.32);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	background: transparent;
	color: #6b7280;
	transition: all 0.3s ease;
	font-family: inherit;
	white-space: nowrap;
}

.rank-time-btn:hover {
	color: #374151;
}

.rank-time-btn.active {
	background: #ffffff;
	color: #4f46e5;
	box-shadow: 0 2px 8px rgba(79, 70, 229, 0.12);
}

/* ===== 统计栏 ===== */
.rank-stats-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px 16px;
	padding: 12px 18px;
	background: #f8faff;
	border-radius: calc(var(--io-radius) * 0.5);
	margin-bottom: 24px;
	border: 1px solid #eef2f7;
	font-size: 14px;
	color: #4b5563;
}

.rank-stats-left {
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
}

.rank-stat-item {
	display: flex;
	align-items: center;
	gap: 6px;
}

.rank-stat-num {
	font-weight: 700;
	color: #1a1a2e;
	font-size: 16px;
}

.rank-stat-divider {
	width: 1px;
	height: 20px;
	background: #d1d9e6;
}

.rank-stats-right {
	display: flex;
	align-items: center;
	gap: 6px;
	color: #9ca3af;
	font-size: 13px;
}

.rank-badge-rank {
	display: inline-block;
	background: #eef2ff;
	color: #4f46e5;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 10px;
	border-radius: calc(var(--io-radius) * 0.7);
	letter-spacing: 0.3px;
}

/* ===== 榜单列表 ===== */
.rank-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.rank-item {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px 18px;
	border-radius: calc(var(--io-radius) * 0.57);
	background: #ffffff;
	border: 1px solid #f0f2f6;
	transition: all 0.25s ease;
	cursor: default;
	position: relative;
}

.rank-item:hover {
	border-color: #dce1ec;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
	transform: translateY(-1px);
	background: #fbfdff;
}

.rank-item.top-1 {
	background: linear-gradient(135deg, #fffbea 0%, #fff8e0 100%);
	border-color: #fcd34d;
}

.rank-item.top-2 {
	background: linear-gradient(135deg, #f5f7ff 0%, #f0f3ff 100%);
	border-color: #c7d2fe;
}

.rank-item.top-3 {
	background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
	border-color: #fdba74;
}

.rank-number {
	flex: 0 0 48px;
	font-size: 22px;
	font-weight: 700;
	text-align: center;
	color: #9ca3af;
	font-feature-settings: "tnum";
	letter-spacing: -0.5px;
}

.rank-number.top {
	font-size: 28px;
	line-height: 1;
}

.rank-number .medal {
	font-size: 30px;
	display: block;
	line-height: 1.2;
}

.tool-icon {
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	border-radius: calc(var(--io-radius) * 0.43);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	background: #f3f6fc;
	border: 1px solid #e9edf4;
	overflow: hidden;
	transition: transform 0.2s ease;
}

.rank-item:hover .tool-icon {
	transform: scale(1.04);
}

.tool-icon img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
}

.tool-icon-text {
	font-size: 20px;
	font-weight: 700;
	color: #4f46e5;
}

.tool-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.tool-name {
	font-size: 16px;
	font-weight: 700;
	color: #1a1a2e;
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

/* 名称与分类标签同一行（标签在名称右侧、字号更小） */
.tool-name-row {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.tool-name-row .category-tag {
	font-size: 11px;
	font-weight: 500;
	color: #6b7280;
	background: #f0f2f6;
	padding: 1px 10px;
	border-radius: calc(var(--io-radius) * 0.7);
	letter-spacing: 0.2px;
}

.tool-name-row .category-tag:hover {
	color: #4f46e5;
	background: #eef0ff;
}

.tool-desc {
	font-size: 13px;
	color: #6b7280;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

.tool-tags {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	margin-top: 2px;
}

.tool-tags .tag {
	font-size: 11px;
	color: #6b7280;
	background: #f0f2f6;
	padding: 1px 10px;
	border-radius: calc(var(--io-radius) * 0.43);
	font-weight: 500;
	letter-spacing: 0.2px;
}

.tool-metric {
	flex: 0 0 140px;
	text-align: right;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
}

.tool-metric .metric-value {
	font-size: 22px;
	font-weight: 700;
	color: #1a1a2e;
	line-height: 1.2;
	font-feature-settings: "tnum";
}

.tool-metric .metric-bar {
	width: 100%;
	max-width: 120px;
	height: 5px;
	background: #eef2f7;
	border-radius: calc(var(--io-radius) * 0.36);
	overflow: hidden;
}

.tool-metric .metric-bar .fill {
	height: 100%;
	border-radius: calc(var(--io-radius) * 0.36);
	background: linear-gradient(90deg, #818cf8, #4f46e5);
	transition: width 0.6s ease;
}

.tool-metric .metric-bar .fill.gold {
	background: linear-gradient(90deg, #fbbf24, #f59e0b);
}
.tool-metric .metric-bar .fill.silver {
	background: linear-gradient(90deg, #a5b4fc, #818cf8);
}
.tool-metric .metric-bar .fill.bronze {
	background: linear-gradient(90deg, #fb923c, #f97316);
}

.rank-empty {
	padding: 40px 0;
	text-align: center;
	color: #9ca3af;
	font-size: 14px;
}

/* ===== 响应式 ===== */
@media (max-width: 820px) {
	.io9200-rank-panel {
		padding: 20px 16px 30px;
	}
	.rank-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}
	.rank-header-left h1 {
		font-size: 22px;
	}
	.rank-tabs-wrapper {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
	}
	.rank-tabs {
		overflow-x: auto;
		flex-wrap: nowrap;
		justify-content: stretch;
		border-radius: calc(var(--io-radius) * 0.43);
		padding: 3px;
	}
	.rank-tab-btn {
		flex: 1;
		justify-content: center;
		padding: 8px 12px;
		font-size: 14px;
		white-space: nowrap;
	}
	.rank-time-filter {
		align-self: flex-start;
		overflow-x: auto;
		flex-wrap: nowrap;
		width: 100%;
		border-radius: calc(var(--io-radius) * 0.43);
		padding: 3px;
	}
	.rank-time-btn {
		flex: 1;
		justify-content: center;
		padding: 6px 8px;
		font-size: 12px;
		white-space: nowrap;
	}
	.rank-stats-bar {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
		font-size: 13px;
		padding: 12px 14px;
	}
	.rank-stats-left {
		gap: 12px;
	}
	.rank-item {
		padding: 12px 14px;
		gap: 12px;
		flex-wrap: wrap;
		align-items: center;
	}
	.rank-number {
		flex: 0 0 36px;
		font-size: 18px;
	}
	.rank-number .medal {
		font-size: 24px;
	}
	.tool-icon {
		flex: 0 0 36px;
		width: 36px;
		height: 36px;
		font-size: 20px;
	}
	.tool-name {
		font-size: 15px;
	}
	.tool-desc {
		font-size: 12px;
		white-space: normal;
		display: -webkit-box;
		-webkit-line-clamp: 1;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}
	.tool-metric {
		flex: 0 0 100%;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		padding-left: 48px;
		gap: 6px;
	}
	.tool-metric .metric-value {
		font-size: 18px;
	}
	.tool-metric .metric-bar {
		max-width: 80px;
		height: 4px;
	}
	.tool-tags .tag {
		font-size: 10px;
		padding: 0 8px;
	}
	.rank-item.top-1,
	.rank-item.top-2,
	.rank-item.top-3 {
		background: #ffffff;
		border-color: #e9edf4;
	}
	.rank-item.top-1 .rank-number .medal,
	.rank-item.top-2 .rank-number .medal,
	.rank-item.top-3 .rank-number .medal {
		font-size: 28px;
	}
}

@media (max-width: 480px) {
	.io9200-rank-panel {
		padding: 14px 10px 24px;
	}
	.rank-header-left h1 {
		font-size: 19px;
	}
	.rank-header-icon {
		font-size: 26px;
	}
	.rank-update-time {
		font-size: 11px;
		padding: 4px 10px;
	}
	.rank-tab-btn {
		font-size: 12px;
		padding: 6px 10px;
	}
	.rank-tab-emoji {
		font-size: 14px;
	}
	.rank-time-btn {
		font-size: 11px;
		padding: 4px 8px;
	}
	.rank-item {
		padding: 10px 12px;
		gap: 10px;
	}
	.rank-number {
		flex: 0 0 30px;
		font-size: 16px;
	}
	.rank-number .medal {
		font-size: 20px;
	}
	.tool-icon {
		flex: 0 0 30px;
		width: 30px;
		height: 30px;
		font-size: 16px;
	}
	.tool-name {
		font-size: 14px;
	}
	.tool-name-row .category-tag {
		font-size: 10px;
		padding: 0 8px;
	}
	.tool-desc {
		font-size: 11px;
	}
	.tool-metric .metric-value {
		font-size: 16px;
	}
	.tool-metric .metric-bar {
		max-width: 60px;
		height: 3px;
	}
	.rank-stat-num {
		font-size: 14px;
	}
	.rank-stat-divider {
		height: 16px;
	}
}

/* ===== 切换淡入动画 ===== */
.rank-list .rank-item {
	animation: rank-fade-slide-in 0.35s ease forwards;
	opacity: 0;
	transform: translateY(8px);
}

.rank-list .rank-item:nth-child(1) { animation-delay: 0.02s; }
.rank-list .rank-item:nth-child(2) { animation-delay: 0.05s; }
.rank-list .rank-item:nth-child(3) { animation-delay: 0.08s; }
.rank-list .rank-item:nth-child(4) { animation-delay: 0.11s; }
.rank-list .rank-item:nth-child(5) { animation-delay: 0.14s; }
.rank-list .rank-item:nth-child(6) { animation-delay: 0.17s; }
.rank-list .rank-item:nth-child(7) { animation-delay: 0.20s; }
.rank-list .rank-item:nth-child(8) { animation-delay: 0.23s; }
.rank-list .rank-item:nth-child(9) { animation-delay: 0.26s; }
.rank-list .rank-item:nth-child(10) { animation-delay: 0.29s; }

@keyframes rank-fade-slide-in {
	0% { opacity: 0; transform: translateY(8px); }
	100% { opacity: 1; transform: translateY(0); }
}

/* ===== 榜单卡片 LOGO / 名称 → 工具详情页链接（新窗口打开，不加 nofollow） ===== */
.rank-link {
	color: inherit;
	text-decoration: none;
}
/* 图标外层 <a> 撑满 .tool-icon 圆角框，保证整块可点 */
.tool-icon .rank-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}
.rank-link:hover .tool-name {
	color: #4f46e5;
}
.tool-name .rank-link {
	display: inline-flex;
	align-items: center;
}
