/* 电路实验室 */
.cs-circuit-page {
	background: var(--bg);
}

.cs-circuit-page .cs-container {
	max-width: 1280px;
}

.cs-circuit-hero {
	padding: 52px 0 58px;
	color: #fff;
	background:
		radial-gradient(circle at 85% 12%, rgba(255, 255, 255, 0.14), transparent 32%),
		linear-gradient(135deg, var(--hero-a), var(--hero-b));
}

.cs-circuit-hero h1 {
	margin: 0;
	color: #fff;
	font-size: clamp(34px, 5vw, 54px);
	font-weight: 900;
	letter-spacing: -0.04em;
}

.cs-circuit-hero p {
	max-width: 780px;
	margin: 12px 0 0;
	color: #dbeafe;
	font-size: 15px;
	line-height: 1.8;
}

.cs-circuit-section {
	padding: 0 0 56px;
	margin-top: -20px;
}

/* 游戏切换标签 */
.cs-game-tabs {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 22px;
	padding: 5px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
}

.cs-game-tabs a {
	padding: 8px 18px;
	border-radius: 999px;
	color: #dbeafe;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
	transition: background 0.18s ease, color 0.18s ease;
}

.cs-game-tabs a:hover {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
}

.cs-game-tabs a.is-active {
	background: #fff;
	color: #0b1f4b;
}

/* 构建器布局 */
.cs-builder {
	display: grid;
	grid-template-columns: 198px minmax(0, 1fr) 224px;
	gap: 14px;
	align-items: start;
	padding: 16px;
	border: 1px solid var(--line);
	border-radius: 24px;
	background: #fff;
	box-shadow: 0 24px 60px -42px rgba(15, 23, 42, 0.4);
}

.cs-palette,
.cs-inspector {
	padding: 14px;
	border: 1px solid #eef2f7;
	border-radius: 16px;
	background: #f8fafc;
}

.cs-palette h2,
.cs-inspector h2 {
	margin: 0 0 6px;
	color: var(--ink);
	font-size: 16px;
	font-weight: 900;
}

.cs-palette-note {
	margin: 0 0 12px;
	color: #94a3b8;
	font-size: 10.5px;
	line-height: 1.6;
}

.cs-part-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
}

.cs-part {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1px;
	min-height: 46px;
	padding: 7px 8px;
	border: 1px solid #e2e8f0;
	border-radius: 9px;
	background: #fff;
	color: #334155;
	font: inherit;
	text-align: left;
	cursor: grab;
	touch-action: none;
	transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.cs-part:hover {
	border-color: #bfdbfe;
	background: #eff6ff;
	transform: translateY(-1px);
}

.cs-part:active {
	cursor: grabbing;
}

.cs-part b {
	font-size: 11.5px;
	font-weight: 800;
	line-height: 1.3;
}

.cs-part small {
	color: #94a3b8;
	font-size: 9px;
	line-height: 1.3;
}

.cs-part-wire {
	grid-column: 1 / -1;
	border-color: #bfdbfe;
	background: #eff6ff;
}

.cs-lab-note {
	margin-top: 12px;
	padding: 10px 11px;
	border: 1px solid #fde68a;
	border-radius: 10px;
	background: #fffbeb;
	color: #92400e;
	font-size: 10.5px;
	line-height: 1.65;
}

.cs-lab-note strong {
	display: block;
	margin-bottom: 3px;
	color: #78350f;
}

.cs-lab-note p {
	margin: 0;
}

/* 画布 */
.cs-canvas-col {
	min-width: 0;
}

.cs-canvas-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

.cs-canvas-bar strong {
	color: var(--ink);
	font-size: 14px;
	font-weight: 900;
}

.cs-canvas-bar > span {
	color: #94a3b8;
	font-size: 10.5px;
}

.cs-canvas-actions {
	display: flex;
	gap: 6px;
	margin-left: auto;
}

.cs-canvas-actions button {
	padding: 5px 10px;
	border: 1px solid #e2e8f0;
	border-radius: 7px;
	background: #fff;
	color: #475569;
	font: inherit;
	font-size: 10.5px;
	font-weight: 700;
	cursor: pointer;
}

.cs-canvas-actions button:hover {
	border-color: #bfdbfe;
	color: var(--primary);
}

.cs-canvas-actions .cs-pan {
	min-width: 38px;
	min-height: 32px;
	padding: 3px 7px;
	font-size: 12px;
	line-height: 1;
}

.cs-canvas-shell {
	position: relative;
	border: 1px solid rgba(147, 197, 253, 0.18);
	border-radius: 16px;
	background: #071a25;
	overflow: hidden;
}

.cs-canvas-shell.is-short {
	box-shadow: inset 0 0 0 2px #ef4444, 0 0 28px rgba(239, 68, 68, 0.28);
	animation: cs-short-pulse 1.1s ease-in-out infinite;
}

@keyframes cs-short-pulse {
	50% {
		box-shadow: inset 0 0 0 2px #f87171, 0 0 42px rgba(239, 68, 68, 0.45);
	}
}

.cs-canvas-scroll {
	overflow-x: auto;
	overflow-y: hidden;
}

#circuit-canvas {
	display: block;
	width: 100%;
	min-width: 700px;
	height: auto;
	touch-action: pan-y;
	user-select: none;
	-webkit-user-select: none;
	cursor: default;
}

.cs-comp,
.cs-term-wrap {
	touch-action: none;
}

.cs-canvas-hint {
	margin: 8px 2px 0;
	color: #94a3b8;
	font-size: 10.5px;
	line-height: 1.6;
}

/* 画布 SVG */
.cs-canvas-bg {
	fill: #071a25;
}

.cs-canvas-grid {
	pointer-events: none;
}

.cs-board-caption {
	fill: rgba(191, 219, 254, 0.5);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	pointer-events: none;
}

.cs-comp {
	cursor: grab;
}

.cs-comp:active {
	cursor: grabbing;
}

.cs-sel {
	fill: none;
	stroke: #38bdf8;
	stroke-width: 1.5;
	stroke-dasharray: 6 4;
	opacity: 0;
	pointer-events: none;
}

.cs-comp.is-selected .cs-sel {
	opacity: 1;
}

.cs-term-hit {
	fill: transparent;
	cursor: crosshair;
}

.cs-term {
	fill: #fbbf24;
	stroke: #78350f;
	stroke-width: 2;
	transition: fill 0.12s ease;
}

.cs-term-wrap:hover .cs-term {
	fill: #fde68a;
}

.cs-term.is-target {
	fill: #34d399;
	stroke: #065f46;
	filter: drop-shadow(0 0 7px #34d399);
}

.cs-term-label {
	fill: #fbbf24;
	font-size: 12px;
	font-weight: 900;
	pointer-events: none;
}

.cs-body {
	fill: #0d2b3a;
	stroke: #7dd3fc;
	stroke-width: 2;
}

.cs-lead {
	stroke: #94a3b8;
	stroke-width: 4;
	stroke-linecap: round;
}

.cs-comp-label {
	fill: #dbeafe;
	font-size: 15px;
	font-weight: 800;
}

.cs-label {
	fill: #e2e8f0;
	font-size: 12px;
	font-weight: 700;
}

.cs-tiny {
	fill: #93c5fd;
	font-size: 10px;
}

.cs-comp.rot-180 text {
	transform: rotate(180deg);
	transform-box: fill-box;
	transform-origin: center;
}

.is-hidden {
	display: none !important;
}

.cs-comp-value {
	fill: #7dd3fc;
	font-size: 13px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.cs-polarity {
	fill: #fbbf24;
	font-size: 15px;
	font-weight: 900;
}

.cs-batt-long {
	stroke: #f8fafc;
	stroke-width: 4;
	stroke-linecap: round;
}

.cs-batt-short {
	stroke: #94a3b8;
	stroke-width: 3;
	stroke-linecap: round;
}

.cs-pivot {
	fill: #cbd5e1;
}

.cs-lever {
	stroke: #f8fafc;
	stroke-width: 4;
	stroke-linecap: round;
	transition: all 0.16s ease;
}

.cs-bulb {
	fill: url(#cs-bulb-glass);
	stroke: #f6d365;
	stroke-width: 2;
}

.cs-bulb.is-burned {
	fill: #334155;
	stroke: #64748b;
}

.cs-bulb-glow {
	fill: #fbbf24;
	opacity: 0;
	filter: url(#cs-bulb-glow);
	pointer-events: none;
}

.cs-filament {
	fill: none;
	stroke: #92400e;
	stroke-width: 3;
	stroke-linecap: round;
}

.cs-resistor-body {
	fill: #123445;
	stroke: #fbbf24;
	stroke-width: 2;
}

.cs-zigzag {
	fill: none;
	stroke: #fbbf24;
	stroke-width: 2.4;
	stroke-linejoin: round;
}

.cs-rheo-body {
	fill: #123445;
	stroke: #fbbf24;
	stroke-width: 2;
}

.cs-wiper-bus {
	stroke: #94a3b8;
	stroke-width: 2.5;
}

.cs-wiper {
	stroke: #fbbf24;
	stroke-width: 2.5;
}

.cs-wiper-arrow {
	fill: #fbbf24;
}

.cs-meter {
	fill: #f8fafc;
	stroke: #94a3b8;
	stroke-width: 2;
}

.cs-scale {
	fill: none;
	stroke: #cbd5e1;
	stroke-width: 2;
}

.cs-needle {
	stroke: #dc2626;
	stroke-width: 2;
	stroke-linecap: round;
}

.cs-meter-letter {
	fill: #1e293b;
	font-size: 13px;
	font-weight: 900;
}

.cs-motor {
	fill: #123445;
	stroke: #8bd9d1;
	stroke-width: 2;
}

.cs-rotor {
	transform-box: fill-box;
	transform-origin: center;
}

.cs-rotor-blade {
	fill: #fbbf24;
	stroke: #92400e;
	stroke-width: 1;
}

.cs-rotor.is-spin {
	animation: cs-rotor-spin 1s linear infinite;
}

@keyframes cs-rotor-spin {
	to {
		transform: rotate(360deg);
	}
}

.cs-hub {
	fill: #f8fafc;
	stroke: #334155;
	stroke-width: 1;
}

.cs-fuse {
	fill: #334155;
	stroke: #cbd5e1;
	stroke-width: 2;
}

.cs-fuse-wire {
	stroke: #fbbf24;
	stroke-width: 2;
}

.cs-fuse.is-blown {
	fill: #7f1d1d;
	stroke: #fca5a5;
}

.cs-energy {
	fill: #0d2b3a;
	stroke: #8bd9d1;
	stroke-width: 2;
}

.cs-energy-screen {
	fill: #052e16;
	stroke: #34d399;
	stroke-width: 1.5;
}

.cs-energy-text {
	fill: #6ee7b7;
	font-size: 13px;
	font-weight: 800;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.cs-energy-unit {
	fill: #94a3b8;
	font-size: 9px;
	letter-spacing: 0.12em;
}

.cs-coil {
	fill: #123445;
	stroke: #94a3b8;
	stroke-width: 1.5;
}

.cs-coil-line {
	fill: none;
	stroke: #fbbf24;
	stroke-width: 1.8;
}

.cs-contact {
	fill: #f8fafc;
	stroke: #334155;
	stroke-width: 1.5;
}

.cs-relay-arm {
	stroke: #fbbf24;
	stroke-width: 3;
	stroke-linecap: round;
}

.cs-led {
	fill: #64748b;
	transition: fill 0.16s ease;
}

.cs-led.is-on {
	fill: #34d399;
	filter: drop-shadow(0 0 5px #34d399);
}

/* 导线 */
.cs-wire {
	fill: none;
	stroke: #7f97ab;
	stroke-width: 4.5;
	stroke-linecap: round;
	stroke-linejoin: round;
	pointer-events: none;
}

.cs-wire-flow {
	fill: none;
	stroke: #fbbf24;
	stroke-width: 4.5;
	stroke-linecap: round;
	stroke-dasharray: 2 14;
	opacity: 0;
	pointer-events: none;
	animation: cs-wire-run 1s linear infinite;
}

@keyframes cs-wire-run {
	to {
		stroke-dashoffset: -160;
	}
}

.cs-wire-hit {
	fill: none;
	stroke: transparent;
	stroke-width: 18;
	pointer-events: stroke;
	cursor: pointer;
}

.cs-wire-g.is-selected .cs-wire {
	stroke: #38bdf8;
	stroke-width: 6;
}

.cs-wire-temp {
	fill: none;
	stroke: #38bdf8;
	stroke-width: 3;
	stroke-dasharray: 7 6;
	pointer-events: none;
}

/* 画布特效 */
.cs-fx-spark {
	fill: #fbbf24;
	filter: drop-shadow(0 0 6px #fbbf24);
	animation: cs-fx-spark 0.5s ease-out forwards;
	transform-box: fill-box;
	transform-origin: center;
	pointer-events: none;
}

@keyframes cs-fx-spark {
	to {
		transform: translateY(-16px) scale(0.2);
		opacity: 0;
	}
}

.cs-fx-smoke {
	fill: #94a3b8;
	opacity: 0.55;
	filter: blur(3px);
	animation: cs-fx-smoke 1.3s ease-out forwards;
	transform-box: fill-box;
	transform-origin: center;
	pointer-events: none;
}

@keyframes cs-fx-smoke {
	to {
		transform: translateY(-38px) scale(2.2);
		opacity: 0;
	}
}

/* 属性面板 */
#inspector-body {
	color: #64748b;
	font-size: 11px;
}

.cs-insp-empty {
	margin: 0 0 8px;
	color: #94a3b8;
	font-size: 11px;
	line-height: 1.7;
}

.cs-insp-tips {
	margin: 0;
	padding-left: 16px;
	color: #64748b;
	font-size: 10.5px;
	line-height: 1.9;
}

.cs-insp-title {
	margin-bottom: 8px;
}

.cs-insp-title strong {
	display: block;
	color: var(--ink);
	font-size: 15px;
	font-weight: 900;
}

.cs-insp-title span {
	display: block;
	margin-top: 2px;
	color: #94a3b8;
	font-size: 10px;
}

.cs-insp-live {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 5px;
	margin-bottom: 10px;
}

.cs-insp-live div {
	padding: 6px 4px;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	background: #fff;
	text-align: center;
}

.cs-insp-live span {
	display: block;
	color: #94a3b8;
	font-size: 9px;
}

.cs-insp-live b {
	display: block;
	color: var(--ink);
	font-size: 11.5px;
	font-weight: 800;
	white-space: nowrap;
}

.cs-insp-field {
	display: block;
	margin-bottom: 10px;
	color: #64748b;
	font-size: 10.5px;
	font-weight: 700;
}

.cs-insp-field > span {
	display: flex;
	justify-content: space-between;
	gap: 6px;
	margin-bottom: 5px;
}

.cs-insp-field b {
	color: var(--ink);
}

.cs-insp-field input[type="range"] {
	width: 100%;
	accent-color: var(--primary);
}

.cs-insp-field select {
	width: 100%;
	min-height: 32px;
	padding: 4px 6px;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	background: #fff;
	color: #334155;
	font: inherit;
	font-size: 12px;
}

.cs-insp-note {
	margin: 0 0 10px;
	color: #94a3b8;
	font-size: 10.5px;
	line-height: 1.65;
}

.cs-insp-toggle {
	width: 100%;
	padding: 7px;
	border: 1px solid #fca5a5;
	border-radius: 8px;
	background: #fef2f2;
	color: #b91c1c;
	font: inherit;
	font-size: 11px;
	font-weight: 800;
	cursor: pointer;
}

.cs-insp-toggle.is-on {
	border-color: #86efac;
	background: #ecfdf5;
	color: #047857;
}

.cs-insp-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin-top: 10px;
}

.cs-insp-actions button {
	flex: 1 1 auto;
	padding: 6px 7px;
	border: 1px solid #e2e8f0;
	border-radius: 7px;
	background: #fff;
	color: #475569;
	font: inherit;
	font-size: 10.5px;
	font-weight: 700;
	cursor: pointer;
}

.cs-insp-actions button:hover {
	border-color: #bfdbfe;
	color: var(--primary);
}

.cs-insp-actions button.is-danger {
	border-color: #fecaca;
	color: #b91c1c;
}

.cs-insp-actions button.is-danger:hover {
	background: #fef2f2;
}

/* 读数与预设 */
.cs-readouts {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 8px;
	margin-top: 14px;
}

.cs-readout {
	padding: 11px 12px;
	border: 1px solid #eef2f7;
	border-radius: 12px;
	background: #fff;
}

.cs-readout span {
	display: block;
	color: #94a3b8;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.04em;
}

.cs-readout strong {
	display: block;
	margin-top: 3px;
	color: var(--ink);
	font-size: 16px;
	font-weight: 900;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.cs-presets {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
}

.cs-presets-label {
	color: #94a3b8;
	font-size: 10.5px;
	font-weight: 700;
}

.cs-presets button,
.cs-presets a {
	padding: 7px 12px;
	border: 1px solid #dbeafe;
	border-radius: 999px;
	background: #eff6ff;
	color: #1d4ed8;
	font: inherit;
	font-size: 11px;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}

.cs-presets button:hover,
.cs-presets a:hover {
	border-color: #93c5fd;
	background: #dbeafe;
}

.cs-lab-bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 12px;
}

@media (min-width: 721px) {
	.cs-lab-bottom {
		padding-right: 104px;
	}
}

.cs-lab-status {
	color: #64748b;
	font-size: 12px;
	line-height: 1.6;
}

.cs-lab-status.is-danger {
	color: #b91c1c;
	font-weight: 700;
}

.cs-lab-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
}

.cs-lab-actions button {
	padding: 7px 12px;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	background: #fff;
	color: #475569;
	font: inherit;
	font-size: 11px;
	font-weight: 700;
	cursor: pointer;
}

.cs-lab-actions button:hover {
	border-color: #bfdbfe;
	color: var(--primary);
}

.cs-log-wrap {
	margin-top: 12px;
	overflow-x: auto;
	border: 1px solid #eef2f7;
	border-radius: 12px;
}

.cs-log {
	width: 100%;
	border-collapse: collapse;
	font-size: 11px;
}

.cs-log th,
.cs-log td {
	padding: 8px 10px;
	border-bottom: 1px solid #f1f5f9;
	text-align: left;
	white-space: nowrap;
}

.cs-log th {
	background: #f8fafc;
	color: #94a3b8;
	font-size: 10px;
}

.cs-log td {
	color: #475569;
}

.cs-log tr:last-child td {
	border-bottom: 0;
}

/* 拖动元件库时的浮标 */
.cs-ghost {
	position: fixed;
	z-index: 9999;
	padding: 6px 10px;
	border: 1px solid #93c5fd;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.96);
	color: #1d4ed8;
	font-size: 11px;
	font-weight: 800;
	pointer-events: none;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

/* 拆弹实验 */
.cs-bomb-section {
	padding: 0 0 64px;
}

.cs-bomb-card {
	padding: 20px;
	border: 1px solid var(--line);
	border-radius: 24px;
	background: #fff;
	box-shadow: 0 24px 60px -42px rgba(15, 23, 42, 0.4);
}

.cs-bomb-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 14px;
}

.cs-bomb-head h2 {
	margin: 0;
	color: var(--ink);
	font-size: clamp(24px, 3vw, 34px);
	font-weight: 900;
	letter-spacing: -0.03em;
}

.cs-bomb-head p {
	max-width: 720px;
	margin: 8px 0 0;
	color: #64748b;
	font-size: 13px;
	line-height: 1.8;
}

.cs-bomb-timer-panel {
	flex: 0 0 auto;
	min-width: 122px;
	padding: 12px 16px;
	border: 1px solid #fecaca;
	border-radius: 14px;
	background: #fff1f2;
	text-align: center;
}

.cs-bomb-timer-panel span {
	display: block;
	color: #b91c1c;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.1em;
}

.cs-bomb-timer-panel strong {
	display: block;
	color: #991b1b;
	font-size: 30px;
	font-weight: 900;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
}

.cs-bomb-timer-panel small {
	color: #b91c1c;
	font-size: 11px;
}

.cs-bomb-stage {
	position: relative;
	border-radius: 18px;
	background: #071a25;
	overflow: hidden;
}

.cs-bomb-stage svg {
	display: block;
	width: 100%;
	height: auto;
}

.cs-bomb-board {
	fill: #071a25;
	stroke: rgba(147, 197, 253, 0.18);
}

.bomb-wire {
	fill: none;
	stroke-width: 10;
	stroke-linecap: round;
	filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.4));
	transition: opacity 0.2s ease;
}

.bomb-wire-red {
	stroke: #ef4444;
}

.bomb-wire-blue {
	stroke: #3b82f6;
}

.bomb-wire.is-cut {
	stroke-dasharray: 28 22;
	opacity: 0.45;
}

.bomb-terminal {
	fill: #f8fafc;
	stroke: #334155;
	stroke-width: 2;
}

.bomb-timer-badge rect {
	fill: #1f2937;
	stroke: #fbbf24;
	stroke-width: 2;
}

.bomb-timer-stem {
	stroke: #fbbf24;
	stroke-width: 2;
}

.bomb-timer-label {
	fill: #fbbf24;
	font-size: 9px;
	font-weight: 700;
}

.bomb-timer-text {
	fill: #f8fafc;
	font-size: 14px;
	font-weight: 900;
	font-variant-numeric: tabular-nums;
}

.bomb-title {
	fill: #f8fafc;
	font-size: 22px;
	font-weight: 900;
}

.bomb-sub {
	fill: #94a3b8;
	font-size: 9px;
	letter-spacing: 0.1em;
}

.bomb-led {
	fill: #ef4444;
	filter: drop-shadow(0 0 6px #ef4444);
	animation: bomb-blink 1s steps(2, end) infinite;
}

@keyframes bomb-blink {
	50% {
		opacity: 0.25;
	}
}

.cs-bomb-battery-box {
	fill: #102f3d;
	stroke: #fbbf24;
	stroke-width: 2;
}

.cs-bomb-legend {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
	padding: 9px 11px;
	border: 1px solid #eef2f7;
	border-radius: 10px;
	background: #f8fafc;
	color: #64748b;
	font-size: 11px;
	font-weight: 700;
}

.cs-bomb-legend span {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.cs-bomb-legend strong {
	width: 100%;
	color: #b91c1c;
	font-size: 11px;
}

.cs-wire-dot {
	display: inline-block;
	width: 9px;
	height: 9px;
	border-radius: 50%;
}

.cs-wire-dot-red {
	background: #ef4444;
	box-shadow: 0 0 5px #ef4444;
}

.cs-wire-dot-blue {
	background: #3b82f6;
	box-shadow: 0 0 5px #3b82f6;
}

.cs-bomb-ui {
	display: grid;
	grid-template-columns: 1.2fr 0.8fr 1.4fr;
	gap: 14px;
	align-items: center;
	margin-top: 14px;
}

.cs-bomb-status span {
	display: block;
	color: #94a3b8;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.08em;
}

.cs-bomb-status strong {
	display: block;
	margin: 2px 0 3px;
	color: var(--ink);
	font-size: 19px;
	font-weight: 900;
}

.cs-bomb-status p {
	margin: 0;
	color: #64748b;
	font-size: 11px;
	line-height: 1.6;
}

.cs-bomb-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 7px;
}

.cs-bomb-actions button {
	padding: 8px 12px;
	border: 1px solid #e2e8f0;
	border-radius: 9px;
	background: #fff;
	color: #475569;
	font: inherit;
	font-size: 11px;
	font-weight: 800;
	cursor: pointer;
}

.cs-bomb-actions button:hover {
	border-color: #bfdbfe;
	color: var(--primary);
}

.cs-bomb-start {
	border-color: var(--primary) !important;
	background: var(--primary) !important;
	color: #fff !important;
}

.cs-cut-red {
	border-color: #fca5a5 !important;
	background: #fef2f2 !important;
	color: #b91c1c !important;
}

.cs-cut-blue {
	border-color: #bfdbfe !important;
	background: #eff6ff !important;
	color: #1d4ed8 !important;
}

.cs-bomb-actions button:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.cs-bomb-effect {
	position: absolute;
	inset: 0;
	z-index: 4;
	pointer-events: none;
	overflow: hidden;
}

.cs-bomb-flash {
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at 50% 60%, rgba(255, 231, 146, 0.95), rgba(239, 68, 68, 0.55) 35%, transparent 70%);
	opacity: 0;
}

.cs-bomb-stage.is-exploded .cs-bomb-flash {
	animation: bomb-flash 0.7s ease-out forwards;
}

@keyframes bomb-flash {
	0% {
		opacity: 1;
	}

	100% {
		opacity: 0;
	}
}

.cs-bomb-stage.is-exploded {
	animation: bomb-shake 0.55s ease-in-out;
}

@keyframes bomb-shake {
	0%,
	100% {
		transform: translate(0, 0);
	}

	20% {
		transform: translate(-8px, 3px) rotate(-0.4deg);
	}

	40% {
		transform: translate(7px, -4px) rotate(0.4deg);
	}

	60% {
		transform: translate(-5px, 2px);
	}

	80% {
		transform: translate(4px, -2px);
	}
}

.cs-bomb-particles {
	position: absolute;
	inset: 0;
}

.cs-bomb-particle {
	position: absolute;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #fbbf24;
	animation: bomb-particle 0.9s ease-out forwards;
}

@keyframes bomb-particle {
	from {
		transform: translate(0, 0) scale(1);
		opacity: 1;
	}

	to {
		transform: translate(var(--dx), var(--dy)) scale(0.2);
		opacity: 0;
	}
}

.cs-bomb-result {
	position: absolute;
	top: 50%;
	left: 50%;
	display: none;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	width: min(320px, 84%);
	padding: 20px;
	border: 1px solid rgba(255, 255, 255, 0.26);
	border-radius: 16px;
	background: rgba(7, 26, 37, 0.92);
	color: #fff;
	text-align: center;
	transform: translate(-50%, -50%);
	pointer-events: auto;
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

.cs-bomb-stage.is-exploded .cs-bomb-result,
.cs-bomb-stage.is-defused .cs-bomb-result {
	display: flex;
}

.cs-bomb-result strong {
	font-size: 24px;
	font-weight: 900;
}

.cs-bomb-stage.is-defused .cs-bomb-result strong {
	color: #6ee7b7;
}

.cs-bomb-result span {
	color: #cbd5e1;
	font-size: 12px;
	line-height: 1.6;
}

.cs-bomb-result button {
	margin-top: 6px;
	padding: 8px 16px;
	border: 0;
	border-radius: 9px;
	background: #fff;
	color: #0f172a;
	font: inherit;
	font-size: 12px;
	font-weight: 800;
	cursor: pointer;
}

.cs-bomb-stage.is-defused {
	box-shadow: 0 0 0 2px #34d399 inset;
}

/* 响应式 */
@media (max-width: 1220px) {
	.cs-builder {
		grid-template-columns: 180px minmax(0, 1fr) 200px;
		gap: 10px;
		padding: 12px;
	}

	.cs-part {
		padding: 6px;
	}
}

@media (max-width: 1100px) {
	.cs-builder {
		grid-template-columns: 1fr;
	}

	.cs-palette {
		padding: 12px;
	}

	.cs-palette h2,
	.cs-palette-note {
		margin-bottom: 8px;
	}

	.cs-part-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.cs-part-wire {
		grid-column: auto;
	}

	.cs-lab-note {
		display: none;
	}

	.cs-inspector {
		min-height: 0;
	}

	.cs-readouts {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.cs-bomb-ui {
		grid-template-columns: 1fr 1fr;
	}

	.cs-bomb-actions {
		grid-column: 1 / -1;
		justify-content: flex-start;
	}
}

@media (max-width: 720px) {
	.cs-circuit-hero {
		padding: 38px 0 54px;
	}

	.cs-builder,
	.cs-bomb-card {
		padding: 12px;
		border-radius: 18px;
	}

	.cs-part-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.cs-canvas-bar {
		flex-wrap: wrap;
		gap: 6px;
	}

	.cs-canvas-bar > span {
		width: 100%;
	}

	.cs-canvas-actions {
		margin-left: 0;
	}

	#circuit-canvas {
		min-width: 660px;
	}

	.cs-readouts {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.cs-lab-bottom {
		align-items: flex-start;
		flex-direction: column;
	}

	.cs-bomb-head {
		flex-direction: column;
	}

	.cs-bomb-timer-panel {
		display: flex;
		align-items: baseline;
		gap: 6px;
		width: 100%;
	}

	.cs-bomb-timer-panel span {
		margin-right: auto;
	}

	.cs-bomb-ui {
		grid-template-columns: 1fr;
	}

	.cs-bomb-actions {
		justify-content: flex-start;
	}

	.cs-bomb-actions button {
		flex: 1 1 calc(50% - 7px);
	}

	.cs-game-tabs {
		width: 100%;
	}

	.cs-game-tabs a {
		flex: 1 1 auto;
		text-align: center;
	}

	.cs-circuit .cs-mascot {
		display: none;
	}
}

@media (max-width: 440px) {
	.cs-part-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.cs-readouts {
		grid-template-columns: 1fr;
	}
}
