/* public/assets/css/hardware/webrtc-camera.css */
.rtc-wrapper { 
    --primary: #6366f1; --secondary: #a855f7; --success: #10b981; --warning: #f59e0b; --danger: #f43f5e;
    --bg: #ffffff; --card: #f8fafc; --text-main: #0f172a; --text-sub: #64748b;
    --border: #e2e8f0; --shadow: 0 10px 25px -5px rgba(0,0,0,0.05);
    width: 100%; max-width: 1100px; margin: 0 auto;
    background: var(--bg); border-radius: 20px; overflow: hidden; 
    border: 1px solid var(--border); box-shadow: var(--shadow);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--text-main);
    display: flex; flex-direction: column;
}
.rtc-wrapper *, .rtc-wrapper *::before, .rtc-wrapper *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

.rtc-header { padding: 24px; text-align: center; border-bottom: 1px solid var(--border); }
.rtc-title { margin: 0 0 10px 0; font-size: 1.7rem; font-weight: 800; color: var(--text-main); }
.rtc-subtitle { margin: 0 auto; max-width: 800px; font-size: 0.95rem; color: var(--text-sub); line-height: 1.6; }
.rtc-workspace { padding: 24px; }
.rtc-layout { display: flex; gap: 24px; align-items: stretch; }
@media (max-width: 850px) { .rtc-layout { flex-direction: column; } }

.rtc-sys-panel { flex: 0 0 340px; background: #0f172a; border-radius: 16px; border: 2px solid #1e293b; padding: 24px; display: flex; flex-direction: column; gap: 20px; box-shadow: inset 0 5px 20px rgba(0,0,0,0.5); }
.rtc-panel-title { font-size: 1.05rem; font-weight: 800; color: #cbd5e1; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid #334155; padding-bottom: 12px; font-family: monospace; }

.id-display-card { background: #1e293b; border-radius: 12px; padding: 20px; text-align: center; border: 1px solid #334155; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.id-label { font-size: 12px; color: #94a3b8; letter-spacing: 1px; margin-bottom: 16px; font-weight: bold; }
.id-value { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 20px; }
.id-prefix { font-size: 13px; font-weight: 800; color: var(--primary); letter-spacing: 2px; background: rgba(99, 102, 241, 0.15); padding: 4px 12px; border-radius: 20px; }
.id-number { font-size: 38px; font-weight: 900; color: #f8fafc; font-family: 'Consolas', monospace; letter-spacing: 6px; line-height: 1; text-shadow: 0 2px 10px rgba(99, 102, 241, 0.3); }

.qr-display-card { background: #1e293b; border-radius: 12px; padding: 20px; text-align: center; border: 1px solid #334155; }
.qr-label { font-size: 13px; color: #cbd5e1; margin-bottom: 15px; font-weight: 600; }
.qr-code-box { display: flex; justify-content: center; align-items: center; background: white; padding: 15px; border-radius: 10px; min-height: 160px; }

.rtc-video-panel { flex: 1; background: var(--card); border-radius: 16px; border: 1px solid var(--border); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.rtc-video-panel .rtc-panel-title { color: var(--text-main); border-bottom-color: var(--border); }

/* 全屏状态支持 */
.video-container { flex: 1; min-height: 400px; background: #000; border-radius: 12px; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.video-container:fullscreen { width: 100vw; height: 100vh; border-radius: 0; }
.video-container:-webkit-full-screen { width: 100vw; height: 100vh; border-radius: 0; }
.video-placeholder { text-align: center; color: var(--text-sub); font-size: 14px; }
.remote-video { width: 100%; height: 100%; object-fit: contain; position: absolute; inset: 0; }
.video-controls { position: absolute; bottom: 0; left: 0; width: 100%; padding: 20px; background: linear-gradient(transparent, rgba(0,0,0,0.8)); display: flex; justify-content: space-between; align-items: center; z-index: 10; opacity: 1; transition: opacity 0.3s; }
.video-container:fullscreen .video-controls:not(:hover) { opacity: 0; /* 全屏不悬浮时自动隐藏控制栏，方便OBS抓取 */ }

.live-badge { color: #fff; background: var(--danger); padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: bold; display: flex; align-items: center; gap: 6px; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.control-actions { display: flex; gap: 12px; }

#mobile-layout { display: flex; flex-direction: column; height: 75vh; background: #000; border-radius: 12px; overflow: hidden; }
.mo-header { height: 60px; background: var(--card); display: flex; align-items: center; justify-content: center; padding: 0 20px; border-bottom: 1px solid var(--border); font-weight: 900; color: var(--primary); font-size: 18px; }
.mo-video-wrapper { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; background: #111; overflow: hidden; }
.local-video { width: 100%; height: 100%; object-fit: cover; }
.mo-status { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.6); color: white; padding: 6px 16px; border-radius: 20px; font-size: 13px; z-index: 10; backdrop-filter: blur(4px); }

.mo-bento-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 20px; background: var(--card); border-top: 1px solid var(--border); }
.bento-item { background: var(--bg); border: 1px solid var(--border); border-radius: 16px; padding: 18px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 800; color: var(--text-main); cursor: pointer; transition: 0.2s; }
.bento-item:active { transform: scale(0.96); }
.bento-item.full-width { grid-column: span 2; flex-direction: row; padding: 16px; gap: 12px; font-size: 15px; }
.bento-danger { background: var(--danger); color: #fff; border-color: var(--danger); }

/* 通用弹窗组件 (修复全局遮罩问题) */
.overlay { 
    position: fixed; /* 关键修复：从 absolute 改为 fixed，使其相对于浏览器窗口定位 */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.75); 
    z-index: 99999; /* 提高层级，确保能盖住整站的 header 导航栏 */
    display: none; 
    align-items: center; 
    justify-content: center; 
    backdrop-filter: blur(8px); /* 稍微加强一点模糊效果，让视觉焦点更集中 */
}
.modal-box { background: var(--card); padding: 30px; border-radius: 24px; text-align: center; width: 85%; max-width: 360px; box-shadow: 0 15px 35px rgba(0,0,0,0.4); border: 1px solid var(--border); }
.mo-scan-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.7); z-index: 5; backdrop-filter: blur(4px); }
.mo-manual-connect-box { background: var(--card); padding: 30px; border-radius: 24px; text-align: center; width: 85%; max-width: 350px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); border: 1px solid var(--border); }
.mo-id-input { width: 100%; padding: 16px; border-radius: 12px; border: 2px solid var(--border); font-size: 20px; text-align: center; font-family: 'Consolas', monospace; font-weight: 900; color: var(--text-main); background: var(--bg); outline: none; transition: 0.2s; letter-spacing: 4px; }
.mo-id-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1); }
.btn { border: none; padding: 12px 16px; border-radius: 12px; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: 0.2s; font-size: 14px; }
.btn-primary { background: var(--primary); color: white; }
.btn-secondary { background: var(--bg); color: var(--text-main); border: 1px solid var(--border); }
.btn-danger { background: var(--danger); color: white; }
.btn-icon { background: rgba(255,255,255,0.2); color: white; border-radius: 50%; width: 44px; height: 44px; padding: 0; }
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
#toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 10000; pointer-events: none; }
.toast { background: rgba(0,0,0,0.85); color: white; padding: 10px 24px; border-radius: 25px; font-size: 13px; margin-bottom: 10px; box-shadow: var(--shadow); }

/* ==========================================
   独立 OBS 教程模块
   ========================================== */
.obs-guide-section { max-width: 1100px; margin: 32px auto 0; background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.obs-guide-section::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--primary), var(--secondary)); }
.obs-guide-header { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.obs-icon-wrapper { width: 56px; height: 56px; background: rgba(99, 102, 241, 0.1); color: var(--primary); border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.obs-guide-title { margin: 0 0 6px 0; color: var(--text-main); font-size: 20px; font-weight: 800; }
.obs-guide-desc { margin: 0; color: var(--text-sub); font-size: 14px; line-height: 1.6; }

/* 新增：内层独立展板样式 */
.obs-inner-board { background: rgba(99, 102, 241, 0.03); border: 1px solid rgba(99, 102, 241, 0.15); border-radius: 16px; padding: 30px; box-shadow: inset 0 2px 10px rgba(0,0,0,0.02); }

.obs-steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.obs-step-card { background: var(--card); padding: 24px; border-radius: 16px; border: 1px solid var(--border); position: relative; transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; display: flex; flex-direction: column; gap: 12px; }
.obs-step-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px -10px rgba(99, 102, 241, 0.15); border-color: rgba(99, 102, 241, 0.3); }
.step-num-badge { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 10px; font-weight: 900; font-size: 16px; box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3); }
.obs-step-card h4 { margin: 0; color: var(--text-main); font-size: 17px; font-weight: 700; }
.obs-step-card p { margin: 0; font-size: 13.5px; color: var(--text-sub); line-height: 1.6; }
.obs-step-card a { color: var(--primary); font-weight: 600; text-decoration: none; position: relative; }
.obs-step-card a::after { content: ''; position: absolute; left: 0; bottom: -2px; width: 100%; height: 2px; background: var(--primary); opacity: 0.2; transition: 0.2s; }
.obs-step-card a:hover::after { opacity: 1; }

/* Dark Mode 适配 */
[data-theme="dark"] .rtc-wrapper, [data-theme="dark"] .obs-guide-section { --bg: #1e293b; --card: #0f172a; --text-main: #f8fafc; --text-sub: #94a3b8; --border: #334155; }
[data-theme="dark"] .rtc-video-panel .rtc-panel-title { color: #f8fafc; }
[data-theme="dark"] .obs-icon-wrapper { background: rgba(99, 102, 241, 0.15); }
[data-theme="dark"] .obs-inner-board { background: rgba(0, 0, 0, 0.2); border-color: rgba(255, 255, 255, 0.05); }
[data-theme="dark"] .obs-step-card { background: #0f172a; }
[data-theme="dark"] .obs-step-card:hover { box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.6); border-color: var(--primary); }

@media (max-width: 768px) { .desktop-only { display: none !important; } }