/* =========================================================
   全局重置与沉浸式锁定
   ========================================================= */
body { 
    margin: 0; 
    padding: 0; 
    background-color: #000; 
    color: #c9d1d9; 
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, sans-serif; 
    overflow: hidden; 
}

/* =========================================================
   视频流 (全屏底层 z-index: 1)
   ========================================================= */
#video-container { 
    position: absolute; 
    top: 0;
    left: 0;
    width: 100vw; 
    height: 100vh; 
    background: #000; 
    z-index: 1; 
}
video, canvas { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

/* =========================================================
   椭圆准星与文字 (悬浮中层 z-index: 10)
   ========================================================= */
.alignment-guide { 
    position: absolute; 
    top: 40%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    
    /* 核心修改：改用相对单位(vw/vh)，根据屏幕大小自动缩放，最大不超过420px */
    width: 80vw; 
    max-width: 420px; 
    height: 60vh; 
    max-height: 560px; 
    
    /* 默认状态：未锁定时的黄色警告色 */
    border: 1.5px dashed rgba(241, 196, 15, 0.6); 
    border-radius: 50%; 
    box-shadow: inset 0 0 20px rgba(241, 196, 15, 0.1), 0 0 15px rgba(241, 196, 15, 0.15); 
    
    pointer-events: none; 
    z-index: 10; 
    display: flex; 
    align-items: flex-start; 
    justify-content: center; 
    padding-top: 25px; 
    transition: all 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

/* 新增：锁定状态 (由 JS 添加 .locked 类名触发青色科技感) */
.alignment-guide.locked {
    border: 2px solid rgba(0, 229, 255, 0.8);
    box-shadow: inset 0 0 30px rgba(0, 229, 255, 0.2), 0 0 20px rgba(0, 229, 255, 0.3);
}

.alignment-guide.shift-up {
    top: 20%; 
    transform: translate(-50%, -25%); 
}

.guide-text { 
    /* 默认黄色警示文案 */
    color: #f1c40f; 
    font-size: 13px; 
    letter-spacing: 1px; 
    font-weight: 600; 
    text-shadow: 0 0 8px rgba(241, 196, 15, 0.6); 
    background: rgba(0,0,0,0.7); 
    padding: 6px 16px; 
    border-radius: 20px; 
    border: 1px solid rgba(241, 196, 15, 0.3); 
    backdrop-filter: blur(4px); 
    text-align: center; 
    transition: all 0.3s;
}

/* 锁定状态的青色文案 */
.alignment-guide.locked .guide-text {
    color: #00e5ff;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
    border-color: rgba(0, 229, 255, 0.3);
}


/* =========================================================
   底部抽屉架构 (交互顶层 z-index: 100)
   ========================================================= */
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    
    background: linear-gradient(to bottom, rgba(13, 17, 23, 0.05) 0%, rgba(13, 17, 23, 0.7) 40%, rgba(13, 17, 23, 0.95) 100%);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border-top: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 24px 24px 0 0;
    box-shadow: none;
    z-index: 100;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;

    /* 核心修改：重新计算隐藏高度。露出常驻头部 (约130px) */
    transform: translateY(calc(100% - 130px));
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

.bottom-sheet.expanded {
    transform: translateY(0);
}

/* =========================================================
   重构：Header 常驻控制区
   ========================================================= */
.sheet-header {
    display: flex;
    flex-direction: column;
    padding: 0 20px 15px 20px;
    box-sizing: border-box;
}

.drawer-toggle-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding-top: 10px;
    padding-bottom: 10px;
}

.drag-handle {
    width: 36px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin-bottom: 8px;
}

/* 弹跳指示箭头与引导文案 */
.expand-hint {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

@keyframes bounceArrow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.bounce-arrow {
    color: #00e5ff;
    animation: bounceArrow 1.5s infinite ease-in-out;
}

/* 常驻状态指示器与按钮包裹层 */
.persistent-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.status-indicator {
    font-size: 13px;
    color: #c9d1d9;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

/* JS状态机控制的颜色类 */
.status-value.warning { color: #f1c40f; text-shadow: 0 0 5px rgba(241,196,15,0.4); }
.status-value.success { color: #00e5ff; text-shadow: 0 0 5px rgba(0,229,255,0.4); }


/* =========================================================
   内部数据行区
   ========================================================= */
.sheet-content {
    padding: 0 24px 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ui-panel-internal {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 8px;
}

.data-row { 
    display: flex; 
    justify-content: space-between; 
    font-size: 14px; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); 
    padding-bottom: 6px; 
    color: #8b949e; 
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
.value { 
    font-weight: bold; 
    color: #c9d1d9; 
    font-family: "Roboto Mono", monospace; 
    font-size: 16px; 
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
.highlight-cyan { color: #00e5ff; text-shadow: 0 0 10px rgba(0, 229, 255, 0.3); }

.sync-status { 
    text-align: left; 
    font-size: 12px; 
    color: #484f58; 
    font-family: monospace; 
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* =========================================================
   按钮样式
   ========================================================= */
.btn-start { 
    width: 100%; 
    box-sizing: border-box;
    background: linear-gradient(135deg, #0082c8, #00b8d4); 
    color: white; 
    border: none; 
    padding: 16px; 
    font-size: 17px; 
    border-radius: 10px; 
    cursor: pointer; 
    font-weight: 600; 
    letter-spacing: 1px; 
    box-shadow: 0 4px 15px rgba(0, 184, 212, 0.3); 
    transition: all 0.2s ease; 
}
.btn-start:disabled { 
    background: #161b22; 
    color: #484f58; 
    cursor: not-allowed; 
    box-shadow: none; 
    border: 1px solid #30363d; 
}

/* =========================================================
   HUD 科技面部置于框增强 (纯 CSS 多重背景矩阵实现)
   注意：我修改了 HUD 的颜色继承，使其跟随主边框状态变化 (黄/青)
   ========================================================= */
.alignment-guide::before,
.alignment-guide::after {
    content: '';
    position: absolute;
    top: 10%;           
    bottom: 10%;
    width: 80px;        
    pointer-events: none;
    z-index: 5;
    /* 默认黄色光晕 */
    filter: drop-shadow(0 0 4px rgba(241, 196, 15, 0.4));
    transition: all 0.3s;
}

.alignment-guide.locked::before,
.alignment-guide.locked::after {
    /* 锁定后切换为青色光晕 */
    filter: drop-shadow(0 0 4px rgba(0, 229, 255, 0.4));
}

/* 左侧 HUD */
.alignment-guide::before {
    left: -90px; 
    /* 默认使用 currentColor 继承黄色 (从外部的 border 色调获取或硬编码) */
    background:
        linear-gradient(135deg, transparent 10px, #f1c40f 10px, #f1c40f 12px, transparent 12px) top left / 20px 20px no-repeat,
        linear-gradient(-45deg, transparent 10px, #f1c40f 10px, #f1c40f 12px, transparent 12px) bottom left / 20px 20px no-repeat,
        linear-gradient(to right, #f1c40f, #f1c40f) top left / 100% 2px no-repeat,
        linear-gradient(to right, #f1c40f, #f1c40f) bottom left / 100% 2px no-repeat,
        linear-gradient(to right, #f1c40f, #f1c40f) 0 20px / 2px calc(100% - 40px) no-repeat,
        linear-gradient(to right, #f1c40f, #f1c40f) 0 12% / 45px 1px no-repeat,
        linear-gradient(to right, #f1c40f, #f1c40f) 0 18% / 25px 2px no-repeat,
        linear-gradient(to right, #f1c40f, #f1c40f) 0 28% / 65px 1px no-repeat,
        linear-gradient(to right, #f1c40f, #f1c40f) 0 35% / 15px 1px no-repeat,
        linear-gradient(to right, #f1c40f, #f1c40f) 0 45% / 35px 1px no-repeat,
        linear-gradient(to right, #f1c40f, #f1c40f) 0 55% / 75px 2px no-repeat,
        linear-gradient(to right, #f1c40f, #f1c40f) 0 62% / 20px 1px no-repeat,
        linear-gradient(to right, #f1c40f, #f1c40f) 0 72% / 50px 1px no-repeat,
        linear-gradient(to right, #f1c40f, #f1c40f) 0 85% / 30px 2px no-repeat,
        linear-gradient(to right, #f1c40f, #f1c40f) 0 92% / 55px 1px no-repeat;
}

/* 左侧 HUD 锁定态 */
.alignment-guide.locked::before {
    background:
        linear-gradient(135deg, transparent 10px, #00e5ff 10px, #00e5ff 12px, transparent 12px) top left / 20px 20px no-repeat,
        linear-gradient(-45deg, transparent 10px, #00e5ff 10px, #00e5ff 12px, transparent 12px) bottom left / 20px 20px no-repeat,
        linear-gradient(to right, #00e5ff, #00e5ff) top left / 100% 2px no-repeat,
        linear-gradient(to right, #00e5ff, #00e5ff) bottom left / 100% 2px no-repeat,
        linear-gradient(to right, #00e5ff, #00e5ff) 0 20px / 2px calc(100% - 40px) no-repeat,
        linear-gradient(to right, #00e5ff, #00e5ff) 0 12% / 45px 1px no-repeat,
        linear-gradient(to right, #00e5ff, #00e5ff) 0 18% / 25px 2px no-repeat,
        linear-gradient(to right, #00e5ff, #00e5ff) 0 28% / 65px 1px no-repeat,
        linear-gradient(to right, #00e5ff, #00e5ff) 0 35% / 15px 1px no-repeat,
        linear-gradient(to right, #00e5ff, #00e5ff) 0 45% / 35px 1px no-repeat,
        linear-gradient(to right, #00e5ff, #00e5ff) 0 55% / 75px 2px no-repeat,
        linear-gradient(to right, #00e5ff, #00e5ff) 0 62% / 20px 1px no-repeat,
        linear-gradient(to right, #00e5ff, #00e5ff) 0 72% / 50px 1px no-repeat,
        linear-gradient(to right, #00e5ff, #00e5ff) 0 85% / 30px 2px no-repeat,
        linear-gradient(to right, #00e5ff, #00e5ff) 0 92% / 55px 1px no-repeat;
}

/* 右侧 HUD */
.alignment-guide::after {
    right: -90px; 
    background:
        linear-gradient(-135deg, transparent 10px, #f1c40f 10px, #f1c40f 12px, transparent 12px) top right / 20px 20px no-repeat,
        linear-gradient(45deg, transparent 10px, #f1c40f 10px, #f1c40f 12px, transparent 12px) bottom right / 20px 20px no-repeat,
        linear-gradient(to left, #f1c40f, #f1c40f) top right / 100% 2px no-repeat,
        linear-gradient(to left, #f1c40f, #f1c40f) bottom right / 100% 2px no-repeat,
        linear-gradient(to left, #f1c40f, #f1c40f) 100% 20px / 2px calc(100% - 40px) no-repeat,
        linear-gradient(to left, #f1c40f, #f1c40f) 100% 15% / 55px 1px no-repeat,
        linear-gradient(to left, #f1c40f, #f1c40f) 100% 22% / 30px 1px no-repeat,
        linear-gradient(to left, #f1c40f, #f1c40f) 100% 32% / 70px 2px no-repeat,
        linear-gradient(to left, #f1c40f, #f1c40f) 100% 40% / 20px 1px no-repeat,
        linear-gradient(to left, #f1c40f, #f1c40f) 100% 50% / 45px 1px no-repeat,
        linear-gradient(to left, #f1c40f, #f1c40f) 100% 58% / 15px 1px no-repeat,
        linear-gradient(to left, #f1c40f, #f1c40f) 100% 68% / 60px 2px no-repeat,
        linear-gradient(to left, #f1c40f, #f1c40f) 100% 78% / 35px 1px no-repeat,
        linear-gradient(to left, #f1c40f, #f1c40f) 100% 88% / 25px 1px no-repeat,
        linear-gradient(to left, #f1c40f, #f1c40f) 100% 95% / 50px 1px no-repeat;
}

/* 右侧 HUD 锁定态 */
.alignment-guide.locked::after {
    background:
        linear-gradient(-135deg, transparent 10px, #00e5ff 10px, #00e5ff 12px, transparent 12px) top right / 20px 20px no-repeat,
        linear-gradient(45deg, transparent 10px, #00e5ff 10px, #00e5ff 12px, transparent 12px) bottom right / 20px 20px no-repeat,
        linear-gradient(to left, #00e5ff, #00e5ff) top right / 100% 2px no-repeat,
        linear-gradient(to left, #00e5ff, #00e5ff) bottom right / 100% 2px no-repeat,
        linear-gradient(to left, #00e5ff, #00e5ff) 100% 20px / 2px calc(100% - 40px) no-repeat,
        linear-gradient(to left, #00e5ff, #00e5ff) 100% 15% / 55px 1px no-repeat,
        linear-gradient(to left, #00e5ff, #00e5ff) 100% 22% / 30px 1px no-repeat,
        linear-gradient(to left, #00e5ff, #00e5ff) 100% 32% / 70px 2px no-repeat,
        linear-gradient(to left, #00e5ff, #00e5ff) 100% 40% / 20px 1px no-repeat,
        linear-gradient(to left, #00e5ff, #00e5ff) 100% 50% / 45px 1px no-repeat,
        linear-gradient(to left, #00e5ff, #00e5ff) 100% 58% / 15px 1px no-repeat,
        linear-gradient(to left, #00e5ff, #00e5ff) 100% 68% / 60px 2px no-repeat,
        linear-gradient(to left, #00e5ff, #00e5ff) 100% 78% / 35px 1px no-repeat,
        linear-gradient(to left, #00e5ff, #00e5ff) 100% 88% / 25px 1px no-repeat,
        linear-gradient(to left, #00e5ff, #00e5ff) 100% 95% / 50px 1px no-repeat;
}