/**
 * 统计页双图：卡片层次 + 绘图区内凹质感（filemtime 作版本号）
 */

/* 统计页整体加宽 + 居中（#id 提高优先级，压过子比 .page-content-full 的 all:unset） */
#zfb-tongji-root.container.zfb-tongji-stats,
body.zfb-stats-page #zfb-tongji-root.container {
	max-width: min(1460px, calc(100vw - 24px)) !important;
	width: 100% !important;
	margin-left: auto !important;
	margin-right: auto !important;
	float: none !important;
	clear: both !important;
	display: block !important;
	box-sizing: border-box !important;
	padding-left: 12px !important;
	padding-right: 12px !important;
}

@media (min-width: 1240px) {
	#zfb-tongji-root.container.zfb-tongji-stats,
	body.zfb-stats-page #zfb-tongji-root.container {
		max-width: min(1460px, calc(100vw - 36px)) !important;
	}
}

main.zfb-tongji-stats .zfb-chart-grid--ref {
	margin-top: 22px;
	gap: 18px;
	align-items: stretch;
}

main.zfb-tongji-stats .zfb-chart-card--ref {
	position: relative;
	overflow: hidden;
	border-radius: 12px;
	border: 1px solid rgba(15, 23, 42, 0.06);
	background: linear-gradient(165deg, #ffffff 0%, #fafbfc 48%, #f4f6f9 100%) !important;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.95) inset,
		0 2px 6px rgba(15, 23, 42, 0.04),
		0 12px 32px -8px rgba(30, 64, 175, 0.1),
		0 24px 48px -20px rgba(15, 23, 42, 0.08) !important;
	padding: 22px 20px 18px;
	transition: box-shadow 0.25s ease, transform 0.2s ease;
}

main.zfb-tongji-stats .zfb-chart-grid--ref .zfb-chart-card--ref:nth-child(1)::before {
	content: "";
	position: absolute;
	top: 0;
	left: 18px;
	right: 18px;
	height: 3px;
	border-radius: 0 0 5px 5px;
	background: linear-gradient(90deg, #1565c0, #42a5f5, #64b5f6);
	opacity: 0.95;
	pointer-events: none;
	box-shadow: 0 2px 8px rgba(30, 136, 229, 0.25);
}

main.zfb-tongji-stats .zfb-chart-grid--ref .zfb-chart-card--ref:nth-child(2)::before {
	content: "";
	position: absolute;
	top: 0;
	left: 18px;
	right: 18px;
	height: 3px;
	border-radius: 0 0 5px 5px;
	background: linear-gradient(90deg, #1b5e20, #43a047, #81c784);
	opacity: 0.95;
	pointer-events: none;
	box-shadow: 0 2px 8px rgba(46, 125, 50, 0.22);
}

main.zfb-tongji-stats .zfb-chart-card--ref:hover {
	transform: translateY(-5px);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.95) inset,
		0 8px 20px rgba(15, 23, 42, 0.08),
		0 20px 48px -4px rgba(30, 64, 175, 0.18),
		0 32px 64px -16px rgba(15, 23, 42, 0.12) !important;
}

.dark-theme main.zfb-tongji-stats .zfb-chart-card--ref:hover {
	transform: translateY(-4px);
}

.dark-theme main.zfb-tongji-stats .zfb-chart-card--ref {
	background: var(--main-bg-color) !important;
	border-color: rgba(255, 255, 255, 0.09);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.04) inset,
		0 8px 28px rgba(0, 0, 0, 0.45) !important;
}

main.zfb-tongji-stats .zfb-chart-card-top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 14px;
	margin-bottom: 14px;
}

main.zfb-tongji-stats .zfb-chart-card-top--refbar {
	margin-bottom: 12px;
}

main.zfb-tongji-stats .zfb-chart-card-titles {
	min-width: 0;
}

main.zfb-tongji-stats .zfb-chart-title-plain {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	color: #0f172a !important;
	line-height: 1.35;
	letter-spacing: -0.01em;
}

.dark-theme main.zfb-tongji-stats .zfb-chart-title-plain {
	color: var(--main-color) !important;
	letter-spacing: 0;
}

main.zfb-tongji-stats .zfb-chart-subbrand {
	margin: 6px 0 0;
	font-size: 11px;
	font-weight: 600;
	color: var(--muted-color);
	letter-spacing: 0.08em;
	opacity: 0.88;
}

main.zfb-tongji-stats .zfb-legend-echarts {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	margin-top: 2px;
	padding: 5px 10px;
	font-size: 12px;
	font-weight: 600;
	color: #334155;
	background: rgba(227, 242, 253, 0.55);
	border: 1px solid rgba(100, 181, 246, 0.35);
	border-radius: 6px;
	box-shadow: 0 1px 2px rgba(30, 64, 175, 0.06);
}

.dark-theme main.zfb-tongji-stats .zfb-legend-echarts {
	color: var(--muted-2-color);
	background: rgba(30, 58, 138, 0.2);
	border-color: rgba(96, 165, 250, 0.25);
}

main.zfb-tongji-stats .zfb-legend-swatch {
	display: inline-block;
	width: 22px;
	height: 13px;
	border-radius: 3px;
	background: linear-gradient(180deg, #42a5f5, #0d47a1);
	border: 1px solid rgba(13, 71, 161, 0.4);
	box-shadow: 0 1px 3px rgba(13, 71, 161, 0.25);
	flex-shrink: 0;
}

main.zfb-tongji-stats .zfb-legend-text {
	white-space: nowrap;
}

/* 绘图区：微内凹 + 柔光底，衬托 Chart 层次 */
main.zfb-tongji-stats .zfb-chart-canvas-area {
	position: relative;
	height: 322px;
	margin: 0;
	padding: 10px 8px 8px;
	border-radius: 10px;
	cursor: crosshair;
	background:
		radial-gradient(ellipse 120% 80% at 50% 0%, rgba(227, 242, 253, 0.45) 0%, transparent 55%),
		linear-gradient(180deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.35) 100%);
	border: 1px solid rgba(148, 163, 184, 0.12);
	box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.85), inset 0 -1px 0 rgba(148, 163, 184, 0.06);
	transition: box-shadow 0.22s ease, border-color 0.22s ease, filter 0.22s ease;
}

main.zfb-tongji-stats .zfb-chart-canvas-area:hover {
	border-color: rgba(59, 130, 246, 0.28);
	box-shadow:
		inset 0 1px 3px rgba(255, 255, 255, 0.9),
		inset 0 -1px 0 rgba(148, 163, 184, 0.05),
		0 0 0 1px rgba(59, 130, 246, 0.08);
	filter: drop-shadow(0 10px 24px rgba(30, 64, 175, 0.12));
}

main.zfb-tongji-stats .zfb-chart-grid--ref .zfb-chart-card--ref:nth-child(2) .zfb-chart-canvas-area:hover {
	border-color: rgba(46, 125, 50, 0.3);
	box-shadow:
		inset 0 1px 3px rgba(255, 255, 255, 0.9),
		0 0 0 1px rgba(46, 125, 50, 0.1);
	filter: drop-shadow(0 10px 24px rgba(46, 125, 50, 0.14));
}

.dark-theme main.zfb-tongji-stats .zfb-chart-canvas-area {
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, transparent 100%);
	border-color: rgba(255, 255, 255, 0.06);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

@media (max-width: 767px) {
	main.zfb-tongji-stats .zfb-chart-grid--ref {
		gap: 14px;
	}

	main.zfb-tongji-stats .zfb-chart-card-top {
		flex-direction: column;
		align-items: flex-start;
	}

	main.zfb-tongji-stats .zfb-legend-echarts {
		align-self: flex-end;
	}

	main.zfb-tongji-stats .zfb-chart-canvas-area {
		height: 272px;
		padding: 8px 6px 6px;
	}
}
