/* ============================================================
   首页「技术随想」介绍区（仅首页加载）
   左侧文案 + 右侧 3D 图标球（自动绕竖轴慢转，左键可拖拽旋转）
   + 下方四栏竖线分隔的功能项
   配色取自首页：蓝 #3b82f6 / 靛紫 #5b63d3 / 墨 #1e293b / 灰 #64748b
   ============================================================ */

.hi-section {
	width: 100%;
	/* 首页 #page 是 flex 列容器，这里必须禁止收缩，否则会被 hero 挤扁 */
	flex: 0 0 auto;
	padding: 68px 0 84px;
	position: relative;
	z-index: 1;
}

.hi-container {
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 30px;
}

.hi-top {
	display: grid;
	grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
	gap: 54px;
	align-items: center;
}

/* ---------- 左：文案 ---------- */
.hi-copy {
	max-width: 460px;
}

.hi-tag {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 16px 6px 12px;
	border-radius: 999px;
	background: rgba(59, 130, 246, 0.1);
	color: #3b82f6;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	margin-bottom: 22px;
}

.hi-tag::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.hi-title {
	margin: 0 0 18px;
	font-size: 3.9rem;
	font-weight: 700;
	line-height: 1.28;
	letter-spacing: -0.5px;
	color: #1e293b;
}

.hi-sub {
	margin: 0 0 30px;
	font-size: 1.0625rem;
	line-height: 1.8;
	color: #64748b;
}

.hi-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
}

.hi-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 13px 26px;
	border-radius: 10px;
	font-size: 0.9375rem;
	font-weight: 600;
	text-decoration: none;
	line-height: 1.2;
	transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.hi-btn svg {
	width: 16px;
	height: 16px;
}

.hi-btn-primary {
	background: #3b82f6;
	color: #fff;
	box-shadow: 0 6px 18px rgba(59, 130, 246, 0.28);
}

.hi-btn-primary:hover {
	background: #2563eb;
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 10px 24px rgba(59, 130, 246, 0.36);
}

/* ---------- 右：3D 图标球 ---------- */
/* 无底板，球直接浮在页面背景上；perspective 提供近大远小 */
.hi-visual {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 460px;
}

.hi-stage {
	/* --rs 是整球缩放系数，窄屏整体缩小（球面坐标都乘它） */
	--rs: 1;
	position: relative;
	width: 440px;
	height: 440px;
	perspective: 1100px;
	cursor: grab;
	/* 横向拖拽转球、纵向仍允许页面滚动 */
	touch-action: pan-y;
	user-select: none;
	-webkit-user-select: none;
}

.hi-stage.hi-grabbing {
	cursor: grabbing;
}

/* 旋转容器：只有这一层的 transform 被 JS 每帧更新（一次写入），图标全部静态 */
.hi-orbits {
	position: absolute;
	inset: 0;
	transform-style: preserve-3d;
	transform: rotateX(-14deg) rotateY(-30deg);
	will-change: transform;
}

/*
 * 图标：不参与旋转，只按球面坐标平移（billboard，永远正对屏幕）。
 * translate3d 乘 --rs 适配窄屏；preserve-3d 下浏览器自动按深度排序、
 * perspective 自动做近大远小，深度淡出的透明度由 JS 更新。
 */
.hi-orb {
	--sz: 54px;
	--c: #3b82f6;
	--bg: #e6efff;
	position: absolute;
	top: 50%;
	left: 50%;
	width: calc(var(--sz) * var(--rs));
	height: calc(var(--sz) * var(--rs));
	border-radius: 50%;
	background: var(--bg);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--c);
	box-shadow: 0 8px 20px rgba(30, 41, 59, 0.12);
	transform: translate(-50%, -50%)
		translate3d(
			calc(var(--tx, 0px) * var(--rs)),
			calc(var(--ty, 0px) * var(--rs)),
			calc(var(--tz, 0px) * var(--rs))
		);
}

.hi-orb svg {
	width: 50%;
	height: 50%;
}

/* 两极的固定图标：加投影强调，位置不动（球面 y=±R，绕竖轴旋转不改变） */
.hi-orb-pole {
	box-shadow: 0 10px 26px rgba(30, 41, 59, 0.16);
}

/* ---------- 下：四栏功能项（竖线分隔，无卡片框） ---------- */
.hi-cards {
	margin-top: 56px;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	/* 行尾补一根右边界竖线：卡片只有 border-left，最后一列右侧缺一根（用户标注） */
	border-right: 1px solid rgba(203, 213, 225, 0.75);
}

.hi-card {
	padding: 4px 26px;
	border-left: 1px solid rgba(203, 213, 225, 0.75);
}

.hi-card-icon {
	margin-bottom: 14px;
	color: #5b63d3;
	line-height: 0;
}

.hi-card-icon svg {
	width: 24px;
	height: 24px;
}

.hi-card h3 {
	margin: 0 0 6px;
	font-size: 1rem;
	font-weight: 700;
	color: #1e293b;
}

.hi-card p {
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.7;
	color: #94a3b8;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
	.hi-top {
		grid-template-columns: minmax(0, 1fr);
		gap: 36px;
	}

	.hi-copy {
		max-width: none;
	}

	.hi-visual {
		min-height: 420px;
	}

	.hi-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		row-gap: 34px;
		border-right: 0;
	}

	/* 两列时左列不再要竖线，只保留列间分隔 */
	.hi-card:nth-child(odd) {
		border-left: 0;
		padding-left: 0;
	}
}

@media (max-width: 640px) {
	.hi-section {
		padding: 48px 0 64px;
	}

	.hi-container {
		padding: 0 20px;
	}

	.hi-title {
		font-size: 2rem;
	}

	.hi-visual {
		min-height: 320px;
	}

	.hi-stage {
		width: 300px;
		height: 300px;
		--rs: 0.62;
	}

	.hi-cards {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 24px;
		margin-top: 40px;
	}

	.hi-card {
		padding: 2px 0 2px 20px;
	}
}

/* 「减弱动态效果」：不自动转（由 JS 判断），但保留拖拽手动旋转 */
@media (prefers-reduced-motion: reduce) {
	.hi-orbits {
		will-change: auto;
	}
}
