/* 浮动「扫一扫」按钮 + 扫码弹层 */
/* 说明：独立 CSS 文件，避免 .cshtml 中 @keyframes 被 Razor 解析 */

/* ========== 浮动按钮 ========== */
.scan-fab {
    position: fixed;
    right: 16px;
    bottom: 96px;
    width: 132px;
    height: 74px;
    border-radius: 14px;
    padding: 0 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff8a00 0%, #e52d27 100%);
    box-shadow: 0 8px 20px rgba(229, 45, 39, .45);
    color: #fff;
    cursor: pointer;
    z-index: 9999;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    animation: scanFloat 2.6s ease-in-out infinite;
}

/* 外圈脉冲光环 */
.scan-fab::before {
    content: "";
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 18px;
    border: 2px solid rgba(255, 138, 0, .6);
    animation: scanPulse 1.8s ease-out infinite;
    pointer-events: none;
}

/* 高光扫过 */
.scan-fab::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 14px;
    background: linear-gradient(120deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,0) 60%);
    animation: scanShine 3.2s ease-in-out infinite;
    pointer-events: none;
}

.scan-fab-icon {
    width: 26px;
    height: 26px;
    fill: #fff;
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
}

.scan-fab-text {
    font-size: 12px;
    line-height: 15px;
    margin-top: 0;
    margin-left: 5px;
    position: relative;
    z-index: 2;
    text-align: left;
    letter-spacing: 0;
    white-space: nowrap;
}

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

/* 拖动中：停掉悬浮动画和光环，避免和手指位移打架 */
.scan-fab.dragging {
    animation: none;
    box-shadow: 0 14px 30px rgba(229, 45, 39, .55);
}
.scan-fab.dragging::before,
.scan-fab.dragging::after {
    animation: none;
}

@keyframes scanPulse {
    0% { transform: scale(.9); opacity: .9; }
    70% { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.35); opacity: 0; }
}

@keyframes scanShine {
    0%, 100% { opacity: .35; }
    50% { opacity: .85; }
}

/* ========== 扫码弹层 ========== */
.scan-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .62);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity .22s ease;
}

.scan-mask.scan-show {
    opacity: 1;
}

.scan-card {
    width: 86%;
    max-width: 330px;
    margin: 0 auto;
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    padding: 18px 16px 14px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .28);
    text-align: center;
    transform: translateY(-50%) scale(.92);
    opacity: .6;
    transition: transform .24s cubic-bezier(.2, .8, .3, 1.2), opacity .24s ease;
}

.scan-mask.scan-show .scan-card {
    transform: translateY(-50%) scale(1);
    opacity: 1;
}

.scan-card-title {
    font-size: 17px;
    font-weight: bold;
    color: #e52d27;
    letter-spacing: 1px;
}

.scan-card-sub {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.scan-qr-wrap {
    margin: 14px auto 10px;
    width: 208px;
    height: 208px;
    padding: 4px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.scan-qr-img {
    width: 200px;
    height: 200px;
    display: none;
    margin: 0 auto;
}

.scan-qr-canvas {
    display: none;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.scan-url {
    font-size: 11px;
    color: #999;
    word-break: break-all;
    line-height: 16px;
    max-height: 32px;
    overflow: hidden;
    margin: 0 2px;
}

.scan-tip {
    font-size: 12px;
    color: #e52d27;
    margin-top: 8px;
}

.scan-actions {
    display: flex;
    margin-top: 14px;
}

.scan-btn {
    flex: 1;
    height: 38px;
    border: none;
    outline: none;
    border-radius: 19px;
    font-size: 15px;
    color: #fff;
    background: linear-gradient(135deg, #ff8a00 0%, #e52d27 100%);
    margin-left: 8px;
    -webkit-tap-highlight-color: transparent;
}

.scan-btn:first-child {
    margin-left: 0;
}

.scan-btn-ghost {
    background: #f2f2f2;
    color: #666;
}

.scan-toast {
    position: fixed;
    left: 50%;
    bottom: 120px;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: rgba(0, 0, 0, .75);
    color: #fff;
    font-size: 13px;
    border-radius: 16px;
    z-index: 10001;
    display: none;
    opacity: 0;
    transition: opacity .2s ease;
    white-space: nowrap;
}

.scan-toast.scan-show {
    opacity: 1;
}

/* ========== 摄像头扫码层 ========== */
.scan-cam {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    z-index: 10002;
    display: none;
}

.scan-cam.scan-show {
    display: block;
}

.scan-cam-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

.scan-cam-head {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 18px 50px 0 16px;
    color: #fff;
    font-size: 15px;
    line-height: 20px;
    text-align: center;
    z-index: 3;
    text-shadow: 0 1px 4px rgba(0,0,0,.6);
    pointer-events: none;
}

.scan-cam-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    line-height: 34px;
    text-align: center;
    font-size: 20px;
    color: #fff;
    background: rgba(0,0,0,.45);
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 50%;
    z-index: 4;
    cursor: pointer;
}

.scan-cam-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 240px;
    height: 240px;
    margin: -120px 0 0 -120px;
    z-index: 3;
}

.scan-cam-corner {
    position: absolute;
    width: 26px;
    height: 26px;
    border: 0 solid #ff8a00;
}

.scan-cam-corner.tl { top: 0; left: 0; border-top-width: 3px; border-left-width: 3px; }
.scan-cam-corner.tr { top: 0; right: 0; border-top-width: 3px; border-right-width: 3px; }
.scan-cam-corner.bl { bottom: 0; left: 0; border-bottom-width: 3px; border-left-width: 3px; }
.scan-cam-corner.br { bottom: 0; right: 0; border-bottom-width: 3px; border-right-width: 3px; }

.scan-cam-laser {
    position: absolute;
    left: 4px;
    right: 4px;
    height: 2px;
    background: linear-gradient(90deg, rgba(255,138,0,0), #ffb64d 30%, #ff8a00 50%, #ffb64d 70%, rgba(255,138,0,0));
    box-shadow: 0 0 8px rgba(255,138,0,.9);
    animation: scanLaser 2.2s ease-in-out infinite;
}

@keyframes scanLaser {
    0%, 100% { top: 6px; opacity: .35; }
    50% { top: 232px; opacity: 1; }
}

.scan-cam-foot {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 26px;
    text-align: center;
    color: #fff;
    font-size: 13px;
    line-height: 20px;
    z-index: 3;
    text-shadow: 0 1px 4px rgba(0,0,0,.7);
    padding: 0 24px;
}

.scan-cam-err {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 86%;
    max-width: 320px;
    margin: 0 auto;
    padding: 20px 16px 14px;
    background: #fff;
    border-radius: 14px;
    text-align: center;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: none;
}

.scan-cam-err.scan-show {
    display: block;
}

.scan-cam-err-title {
    font-size: 16px;
    font-weight: bold;
    color: #e52d27;
}

.scan-cam-err-msg {
    font-size: 13px;
    color: #666;
    line-height: 21px;
    margin-top: 10px;
    text-align: left;
    word-break: break-all;
}
