/* public/assets/css/hardware/gamepad-test.css */
.gp-wrapper { --p-bg: #ffffff; --p-border: #e2e8f0; --p-primary: #8b5cf6; --p-success: #10b981; --p-text: #0f172a; --p-text-muted: #64748b; width: 100%; max-width: 1100px; margin: 0 auto; background: var(--p-bg); border-radius: 20px; padding: 24px; border: 1px solid var(--p-border); box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.gp-wrapper *, .gp-wrapper *::before, .gp-wrapper *::after { box-sizing: border-box; }

.gp-header { text-align: center; margin-bottom: 24px; border-bottom: 1px solid var(--p-border); padding-bottom: 24px; }
.gp-title { font-size: 1.7rem; font-weight: 800; color: var(--p-text); margin: 0 0 10px 0; }
.gp-subtitle { font-size: 0.95rem; color: var(--p-text-muted); max-width: 800px; margin: 0 auto; line-height: 1.6; }

.gp-workspace { position: relative; min-height: 500px; background: #f8fafc; border-radius: 16px; border: 1px solid var(--p-border); padding: 30px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* 等待连接层 */
.gp-connection-layer { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; z-index: 10; position: relative; }
.gp-connect-icon { font-size: 5rem; margin-bottom: 20px; position: relative; z-index: 2; }
.gp-pulse-ring { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); width: 100px; height: 100px; background: rgba(139, 92, 246, 0.2); border-radius: 50%; animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite; z-index: 1; }
@keyframes ping { 75%, 100% { transform: translateX(-50%) scale(2); opacity: 0; } }
.gp-connect-title { font-size: 1.5rem; font-weight: 800; color: var(--p-text); margin-bottom: 10px; }
.gp-connect-hint { font-size: 1rem; color: var(--p-text-muted); line-height: 1.5; }
.gp-connect-hint strong { color: var(--p-primary); }

/* 数据仪表盘 */
.gp-dashboard { width: 100%; margin-bottom: 30px; animation: fadeIn 0.4s; }
.gp-device-info { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 20px; font-size: 1.1rem; color: #334155; }
.gp-badge { background: #d1fae5; color: #059669; font-size: 0.75rem; font-weight: 800; padding: 4px 10px; border-radius: 20px; border: 1px solid #34d399; }
.gp-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 768px) { .gp-stat-grid { grid-template-columns: 1fr; } }
.gp-stat-box { background: #ffffff; border: 1px solid var(--p-border); padding: 16px; border-radius: 12px; text-align: center; box-shadow: 0 4px 10px rgba(0,0,0,0.02); }
.gp-stat-label { font-size: 0.85rem; font-weight: 700; color: #64748b; margin-bottom: 8px; text-transform: uppercase; }
.gp-axis-val { font-size: 1.2rem; font-weight: 800; font-family: monospace; color: #1e293b; }
.gp-axis-val span { color: var(--p-primary); }

/* 可视化面板布局 */
.gp-visual-board { width: 100%; max-width: 800px; display: flex; flex-direction: column; gap: 20px; animation: fadeIn 0.4s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* 扳机区 */
.gp-triggers-row { display: flex; justify-content: space-between; width: 100%; padding: 0 40px; }
.gp-trigger-group { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 120px; }
.gp-trigger-bar-bg { width: 100%; height: 20px; background: #e2e8f0; border-radius: 10px; overflow: hidden; border: 1px solid #cbd5e1; display: flex; flex-direction: column; justify-content: flex-end; }
.gp-trigger-bar-fill { width: 100%; height: 0%; background: var(--p-primary); transition: background 0.1s; }
/* RB/LB 按钮 */
.gp-btn-bumper { width: 100px; height: 36px; background: #ffffff; border: 2px solid #cbd5e1; border-radius: 8px; border-bottom-width: 6px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.9rem; color: #475569; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }

/* 手柄主体 */
.gp-controller-body { display: flex; justify-content: space-between; align-items: center; background: #ffffff; border: 2px solid #e2e8f0; border-radius: 80px; padding: 40px; box-shadow: inset 0 0 40px rgba(0,0,0,0.02), 0 20px 40px rgba(0,0,0,0.05); position: relative; }
.gp-section-left, .gp-section-right { display: flex; flex-direction: column; align-items: center; gap: 30px; }
.gp-section-center { display: flex; gap: 16px; align-items: center; align-self: flex-start; margin-top: 20px; }

/* 摇杆 */
.gp-stick-container { width: 120px; height: 120px; border-radius: 50%; background: #f1f5f9; border: 2px solid #cbd5e1; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 5px 15px rgba(0,0,0,0.1); position: relative; }
.gp-stick-area { width: 100%; height: 100%; position: relative; border-radius: 50%; }
.gp-stick-knob { width: 60px; height: 60px; background: #334155; border-radius: 50%; position: absolute; top: calc(50% - 30px); left: calc(50% - 30px); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 0.8rem; box-shadow: 0 10px 15px rgba(0,0,0,0.3), inset 0 2px 5px rgba(255,255,255,0.2); border-bottom: 4px solid #0f172a; /* 物理坐标不使用动画，保证零延迟视觉反馈 */ }

/* 十字键 (D-Pad) */
.gp-dpad { display: flex; flex-direction: column; align-items: center; }
.gp-dpad-row { display: flex; }
.gp-btn-dpad { width: 36px; height: 36px; background: #475569; color: #cbd5e1; display: flex; align-items: center; justify-content: center; font-weight: 800; }
#btnUp { border-radius: 6px 6px 0 0; } #btnDown { border-radius: 0 0 6px 6px; }
#btnLeft { border-radius: 6px 0 0 6px; } #btnRight { border-radius: 0 6px 6px 0; }
.gp-dpad-center { width: 36px; height: 36px; background: #334155; }

/* 动作键 (ABXY) */
.gp-action-buttons { display: flex; flex-direction: column; align-items: center; }
.gp-action-row { display: flex; gap: 8px; }
.gp-action-center { width: 40px; height: 40px; }
.gp-btn-action { width: 40px; height: 40px; border-radius: 50%; background: #ffffff; border: 2px solid #cbd5e1; border-bottom-width: 4px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.1rem; color: #334155; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }

/* 功能键 */
.gp-btn-small { width: 36px; height: 16px; background: #64748b; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 0; border-bottom: 3px solid #334155; }
.gp-btn-home { width: 40px; height: 40px; border-radius: 50%; background: #ffffff; border: 2px solid #cbd5e1; border-bottom-width: 4px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }

/* 统一按下状态 (Pressed State) */
.gp-pressed { background-color: var(--p-success) !important; color: #fff !important; border-color: #059669 !important; transform: translateY(3px) scale(0.95); border-bottom-width: 1px !important; box-shadow: none !important; }
.gp-trigger-pressed { background: var(--p-success); }
.gp-stick-pressed { background-color: var(--p-success) !important; border-bottom-width: 0 !important; transform: translateY(4px); }

/* 黑夜模式 */
[data-theme="dark"] .gp-wrapper { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .gp-title, [data-theme="dark"] .gp-connect-title { color: #f8fafc; }
[data-theme="dark"] .gp-subtitle, [data-theme="dark"] .gp-connect-hint, [data-theme="dark"] .gp-stat-label { color: #94a3b8; }
[data-theme="dark"] .gp-workspace { background: #0f172a; border-color: #475569; }
[data-theme="dark"] .gp-stat-box, [data-theme="dark"] .gp-controller-body { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .gp-axis-val { color: #f8fafc; }
[data-theme="dark"] .gp-badge { background: rgba(16, 185, 129, 0.2); }
[data-theme="dark"] .gp-trigger-bar-bg { background: #0f172a; border-color: #475569; }
[data-theme="dark"] .gp-btn-bumper, [data-theme="dark"] .gp-btn-action, [data-theme="dark"] .gp-btn-home { background: #0f172a; border-color: #475569; color: #cbd5e1; }
[data-theme="dark"] .gp-stick-container { background: #0f172a; border-color: #475569; }