/* 全局样式重置，实现全屏效果 */
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* 防止出现滚动条 */
    background-color: #000;
    /* 黑色背景，类似相机应用 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: white;
}

/* 画布样式，使其全屏显示 */
#canvasOutput {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 关键：保持宽高比的同时铺满整个容器 */
}

/* UI浮层容器 */
.ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* 顶部和底部分布 */
    pointer-events: none;
    /* 允许点击穿透到下面的canvas */
    z-index: 10;
}

/* 焦点样式 */
#focusReticle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px; /* 稍微增大以便看清 */
    height: 60px;
    transform: translate(-50%, -50%);
    /* 精确居中 */
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    opacity: 0.9;
    transition: all 0.3s ease; /* 让所有变化都平滑过渡 */
}

/* 当焦点对准时的样式 */
#focusReticle.in-focus {
    border-color: #FFD700; /* 变为醒目的黄色 */
    box-shadow: 0 0 15px #FFD700; /* 添加光晕效果 */
    transform: translate(-50%, -50%) scale(1.1); /* 轻微放大，增加反馈 */
}


/* 信息面板（顶部状态） */
.info-panel {
    background-color: rgba(0, 0, 0, 0.4);
    padding: 10px 15px;
    text-align: center;
    width: 100%;
}

.info-panel p {
    margin: 0;
    font-size: 14px;
    text-shadow: 1px 1px 2px black;
}

/* 控制按钮区域（底部） */
.controls {
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px; /* 给按钮之间增加一些间距 */
}

/* 通用按钮样式 */
.controls button {
    pointer-events: auto;
    /* 让按钮可以被点击 */
    background-color: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: white;
    font-size: 16px;
    width: 80px; /* 调整尺寸以容纳文字 */
    height: 80px;
    border-radius: 50%;
    /* 圆形按钮 */
    cursor: pointer;
    transition: background-color 0.2s;
    -webkit-tap-highlight-color: transparent;
    /* 移除移动端点击高亮 */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.controls button:active {
    background-color: rgba(255, 255, 255, 0.4);
}


/* --- 新增：拍照按钮的特定样式 --- */
.shutter-btn {
    /* 把它放在中间，更像快门 */
    order: -1; /* 更改flexbox布局顺序，让它排在分析按钮前面，但我们用绝对定位 */
    position: relative; /* 相对定位 */
    width: 90px;
    height: 90px;
    font-size: 36px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 4px solid #fff;
    color: #333;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    
    /* 默认隐藏，通过缩放和透明度实现 */
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.3s ease, transform 0.3s ease;
    
    /* 确保即使隐藏也不占用空间，防止其他按钮跳动 */
    visibility: hidden;
}

/* 当拍照按钮可见时的样式 */
.shutter-btn.visible {
    opacity: 1;
    transform: scale(1);
    visibility: visible;
}