* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #000;
    color: white;
    overflow: hidden;
    height: 100vh;
    touch-action: manipulation;
}
/* 浏览器不兼容提示 */
.browser-warning {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background-color: #ff9800;
    color: #fff;
    text-align: center;
    font-size: 14px;
    z-index: 1000;
    display: none;
}
/* 摄像头权限申请弹窗 */
.permission-prompt {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
    transition: opacity 0.3s;
}
.permission-prompt.hidden {
    opacity: 0;
    pointer-events: none;
}
.permission-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    fill: #ff7f00;
}
.permission-text {
    font-size: 18px;
    text-align: center;
    margin-bottom: 30px;
    line-height: 1.5;
}
.permission-btn {
    padding: 12px 30px;
    background-color: #ff7f00;
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}
/* 检测模式选择 */
.mode-selector {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 50;
}
.mode-btn {
    padding: 6px 14px;
    background-color: rgba(0,0,0,0.6);
    color: white;
    border: 1px solid #ff7f00;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
}
.mode-btn.active {
    background-color: #ff7f00;
    color: white;
}
/* 摄像头容器 */
.camera-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}
/* 视频预览容器 */
.video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-origin: center;
}
/* 视频和画布 */
video, canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* 截图画布和缩放画布 */
#captureCanvas, #zoomCanvas {
    display: none;
}
/* 扫码框：去掉遮罩颜色 */
.scan-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 256px;
    height: 256px;
    margin-top: -128px;
    margin-left: -128px;
    border: 2px solid #ff7f00;
    border-radius: 4px;
    border-style: solid dashed solid dashed;
    box-shadow: 0 0 0 1000px transparent;
    z-index: 20;
}
/* 扫码提示文本 */
.scan-tip {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    text-align: center;
    color: #ff7f00;
    font-size: 16px;
    z-index: 20;
}
/* 缩放控制容器 */
.zoom-container {
    position: absolute;
    bottom: 22%;
    left: 10%;
    right: 10%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 20;
}
/* 缩放滑块轨道 */
.zoom-slider {
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    position: relative;
}
/* 缩放滑块拇指 */
.zoom-slider .thumb {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #ff7f00;
    box-shadow: 0 2px 6px rgba(255, 127, 0, 0.5);
    cursor: pointer;
    touch-action: none;
}
/* 缩放提示文本 */
.zoom-tip {
    color: #ff7f00;
    font-size: 14px;
}
/* 闪光灯按钮 */
.flash-btn {
    position: absolute;
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}
.flash-btn svg {
    width: 22px;
    height: 22px;
    fill: white;
}
/* 截图按钮 */
.capture-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid white;
    z-index: 30;
    pointer-events: auto;
    cursor: pointer;
    background-color: rgba(255,255,255,0.1);
}
.capture-indicator:active {
    background-color: rgba(255,255,255,0.3);
}
/* 截图历史容器 */
.frames-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 0;
    overflow-y: auto;
    background-color: rgba(0,0,0,0.9);
    transition: max-height 0.3s ease;
    z-index: 40;
    -webkit-overflow-scrolling: touch;
}
.frames-container.show {
    max-height: 60vh;
    padding: 16px 16px 80px;
}
/* 截图列表 */
.frame-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}
/* 单个截图项 */
.frame-item {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    will-change: transform;
}
.frame-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* 提示弹窗 */
.toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    padding: 12px 20px;
    border-radius: 8px;
    background-color: rgba(0,0,0,0.8);
    color: white;
    font-size: 16px;
    z-index: 100;
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
}
.toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
/* 错误页面 */
.error-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 200;
    display: none;
}
.error-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
    fill: #f44336;
}
.error-text {
    font-size: 16px;
    text-align: center;
    margin-bottom: 30px;
    line-height: 1.5;
}