/*
 * 昌润超硬材料 个性化可视化组件 — Vertical Tabs
 * Author: 漫步白月光
 * Website: https://www.at8.fun/
 */

.crgems-solutions-widget {
	--crgems-primary: #2563eb;
	--crgems-primary-hover: #1d4ed8;
	--crgems-text: #1f2937;
	--crgems-text-muted: #9ca3af;
	--crgems-bg-active: transparent;
	--crgems-bg-hover: transparent;
	--crgems-border: #e5e7eb;
	--crgems-radius: 16px;

	box-sizing: border-box;
	width: 100%;
}

.crgems-solutions-widget *,
.crgems-solutions-widget *::before,
.crgems-solutions-widget *::after {
	box-sizing: inherit;
}

.crgems-section-title-wrap {
	margin-bottom: 2.5rem;
	text-align: center;
}

.crgems-section-title {
	position: relative;
	display: inline-block;
	margin: 0;
	padding-bottom: 0;
	font-size: 1.875rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--crgems-text);
}

.crgems-section-underline {
	display: block;
	width: 48px;
	height: 3px;
	border-radius: 2px;
	margin: 12px auto 0;
	background-color: var(--crgems-primary);
}

.crgems-solutions-body {
	display: flex;
	align-items: flex-start;
	gap: 3rem;
}

/* ─── Tabs ─── */
.crgems-solutions-tabs {
	flex: 0 0 200px;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.crgems-tab-button {
	display: flex;
	align-items: center;
	gap: 1rem;
	width: 100%;
	padding: 0;
	margin: 0;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	background-color: #fcfcfc;
	color: inherit;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.4;
	text-align: left;
	cursor: pointer;
	box-shadow: none;
	transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.crgems-tab-button:hover,
.crgems-tab-button:focus,
.crgems-tab-button:active {
	box-shadow: none;
	outline: none;
}

.crgems-tab-button + .crgems-tab-button {
	margin-top: 1.25rem;
}

.crgems-tab-button .crgems-tab-icon {
	color: var(--crgems-text-muted);
}

.crgems-tab-button .crgems-tab-label {
	color: var(--crgems-text);
}

.crgems-tab-button:hover {
	background-color: #f3f4f6;
}

.crgems-tab-button:hover .crgems-tab-icon {
	color: var(--crgems-primary);
}

.crgems-tab-button:hover .crgems-tab-label {
	color: var(--crgems-text);
}

.crgems-tab-button.is-active {
	background-color: #f6f6f6;
}

.crgems-tab-button.is-active .crgems-tab-icon {
	color: var(--crgems-primary);
}

.crgems-tab-button.is-active .crgems-tab-label {
	color: var(--crgems-text);
	font-weight: 600;
}

/* 右侧指示条 */
.crgems-tab-button {
	position: relative;
}

.crgems-tab-button::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 0;
	transform: translateY(-50%);
	width: 3px;
	height: 60%;
	border-radius: 2px;
	background-color: transparent;
	transition: background-color 0.25s ease, width 0.25s ease;
}

.crgems-tab-button.is-active::after {
	background-color: #2563eb;
}

.crgems-tab-button:not(.is-active):hover::after {
	background-color: #2563eb;
}

.crgems-indicator-off .crgems-tab-button::after {
	display: none;
}

.crgems-tab-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 2.5rem;
	height: 2.5rem;
	border: 1px solid currentColor;
	border-radius: 50%;
	font-size: 1rem;
	line-height: 1;
	transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.crgems-tab-icon:empty {
	display: none;
}

.crgems-tab-icon svg,
.crgems-tab-icon i {
	width: 55%;
	height: 55%;
}

.crgems-tab-icon svg {
	fill: currentColor;
}

.crgems-tab-label {
	flex: 1 1 auto;
}

/* ─── Panels ─── */
.crgems-solutions-panels {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
}

.crgems-panel {
	display: none;
	animation: crgems-fade-in 0.35s ease;
}

.crgems-panel.is-active {
	display: block;
}

@keyframes crgems-fade-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.crgems-panel-image {
	position: relative;
	overflow: hidden;
	margin-bottom: 1.5rem;
	border-radius: var(--crgems-radius);
	background-color: #f9fafb;
}

.crgems-panel-image img {
	display: block;
	width: 100%;
	height: 380px;
	object-fit: cover;
	border-radius: var(--crgems-radius);
}

.crgems-panel-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
}

.crgems-panel-text {
	flex: 1 1 auto;
	min-width: 0;
}

.crgems-panel-title {
	margin: 0 0 0.5rem;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.35;
	color: var(--crgems-text);
}

.crgems-panel-description {
	font-size: 0.9375rem;
	line-height: 1.7;
	color: var(--crgems-text-muted);
}

.crgems-panel-description > *:first-child {
	margin-top: 0;
}

.crgems-panel-description > *:last-child {
	margin-bottom: 0;
}

.crgems-panel-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	padding: 0.625rem 1.75rem;
	border: 1px solid transparent;
	border-radius: 4px;
	background-color: var(--crgems-primary);
	color: #ffffff;
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1.5;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.crgems-panel-button:hover {
	background-color: var(--crgems-primary-hover);
	color: #ffffff;
}

/* ─── Responsive ─── */
@media (max-width: 767px) {
	.crgems-solutions-widget .crgems-section-title-wrap {
		margin-bottom: 1.75rem;
	}

	.crgems-solutions-widget .crgems-section-title {
		font-size: 1.5rem;
	}

	.crgems-solutions-widget .crgems-solutions-body {
		flex-direction: column;
		align-items: stretch;
		gap: 1.25rem;
	}

	/* 顶部垂直选项卡，图文内容在其下方 */
	.crgems-solutions-widget .crgems-solutions-tabs {
		flex: 1 1 auto;
		width: 100%;
		flex-direction: column;
		flex-wrap: nowrap;
		justify-content: flex-start;
		gap: 0.5rem;
		overflow: visible;
		padding-bottom: 0;
	}

	.crgems-solutions-widget .crgems-tab-button {
		flex-direction: row;
		flex: 0 0 auto;
		align-items: center;
		justify-content: flex-start;
		width: 100%;
		padding: 0.625rem 0.75rem;
		gap: 0.5rem;
	}

	.crgems-solutions-widget .crgems-tab-label {
		flex: 1 1 auto;
		font-size: 0.8125rem;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		writing-mode: horizontal-tb;
		word-break: keep-all;
		overflow-wrap: normal;
		text-orientation: mixed;
	}

	/* 右侧竖线激活指示器 */
	.crgems-solutions-widget .crgems-tab-button::after {
		top: 50%;
		right: 0;
		left: auto;
		bottom: auto;
		width: 3px;
		height: 60%;
		border-radius: 2px;
		transform: translateY(-50%);
	}

	.crgems-solutions-widget .crgems-tab-button + .crgems-tab-button {
		margin-top: 0;
	}

	.crgems-solutions-widget .crgems-tab-icon {
		width: 2rem;
		height: 2rem;
		font-size: 0.875rem;
	}

	.crgems-solutions-widget .crgems-solutions-panels {
		flex: 1 1 auto;
		width: 100%;
		min-width: 0;
	}

	.crgems-solutions-widget .crgems-panel-image img {
		height: 220px;
	}

	.crgems-solutions-widget .crgems-panel-title {
		font-size: 1.125rem;
	}

	.crgems-solutions-widget .crgems-panel-description {
		font-size: 0.875rem;
	}

	.crgems-solutions-widget .crgems-panel-footer {
		flex-direction: column;
		align-items: flex-start;
		gap: 1rem;
	}

	.crgems-solutions-widget .crgems-panel-button {
		width: 100%;
		text-align: center;
	}
}

@media (max-width: 479px) {
	.crgems-solutions-widget .crgems-section-title {
		font-size: 1.25rem;
	}

	.crgems-solutions-widget .crgems-solutions-body {
		gap: 0.75rem;
	}

	.crgems-solutions-widget .crgems-solutions-tabs {
		flex: 1 1 auto;
		width: 100%;
		gap: 0.375rem;
	}

	.crgems-solutions-widget .crgems-tab-button {
		padding: 0.5rem 0.5rem;
		gap: 0.375rem;
	}

	.crgems-solutions-widget .crgems-tab-icon {
		width: 1.75rem;
		height: 1.75rem;
		font-size: 0.8rem;
	}

	.crgems-solutions-widget .crgems-tab-label {
		font-size: 0.75rem;
	}

	.crgems-solutions-widget .crgems-panel-image img {
		height: 180px;
	}

	.crgems-solutions-widget .crgems-panel-title {
		font-size: 1rem;
	}
}
