.clear {
    clear: both;
}

/* 触发按钮样式 - 与输入框风格统一 */
.tncode {
    border: 2px solid #e8e8e8;
    cursor: pointer;
    opacity: 1;
    line-height: 46px;
    height: 50px;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
    padding: 0 20px;
}

.tncode:hover {
    border-color: #00d4ff;
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.1);
}

.tncodeok {
    border: 2px solid #52c41a;
    border-radius: 25px;
    height: 50px;
    cursor: pointer;
    opacity: 1;
    line-height: 46px;
    background-color: #f6ffed;
    transition: all 0.3s ease;
}

/* 背景遮罩 - 隐藏 */
.tncode_div_bg {
    display: none !important;
}

/* 验证码弹窗 - 定位到 tncode 元素下方 */
.tncode_div {
    display: none;
    background-color: white;
    z-index: 9999;
    width: 280px;
    height: 280px;
    position: absolute;
    left: 50%;
    top: 100%;
    margin-top: 10px;
    margin-left: -140px;
    border: 1px solid #e8e8e8;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
}

.tncode_div .tncode_canvas_bg {
    z-index: 0;
    border-radius: 8px;
    /* 启用硬件加速 */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.tncode_div .tncode_canvas_mark {
    z-index: 10000;
    /* 启用硬件加速 */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: contents;
}

.tncode_div canvas {
    position: absolute;
    left: 20px;
    top: 20px;
    border-radius: 8px;
    /* 优化渲染 */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.tncode_div .loading {
    position: absolute;
    left: 20px;
    top: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    width: 240px;
    height: 150px;
    text-align: center;
    box-sizing: border-box;
    border-radius: 8px;
    color: #666;
    font-size: 14px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

/* 加载动画 */
.tncode_div .loading::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #e8e8e8;
    border-top-color: #00d4ff;
    border-radius: 50%;
    animation: tncode-spin 0.8s linear infinite;
    margin-bottom: 15px;
}

@keyframes tncode-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 加载文字 */
.tncode_div .loading::after {
    content: '加载中...';
    color: #95a5a6;
    font-size: 13px;
}

/* 加载失败状态 */
.tncode_div .loading.error {
    color: #ff4d4f;
}

.tncode_div .loading.error::before {
    content: '✕';
    width: auto;
    height: auto;
    border: none;
    animation: none;
    font-size: 40px;
    color: #ff4d4f;
    margin-bottom: 10px;
}

.tncode_div .loading.error::after {
    content: '加载失败，请刷新重试';
    color: #ff4d4f;
}

.dd {
    -webkit-transform: rotate(-45deg);
    -moz-transform: rotate(-45deg);
    -ms-transform: rotate(-45deg);
    -o-transform: rotate(-45deg);
    transform: rotate(-45deg);
    -webkit-animation: ddf 0.1s ease-in 0s infinite;
    -o-animation: ddf 0.1s ease-in 0s infinite;
    animation: ddf 0.1s ease-in 0s infinite;
}

@-webkit-keyframes ddf {
    0% {
        -webkit-transform: translate(-8px,3px);
    }

    20% {
        -webkit-transform: translate(-3px,1.5px);
    }

    50% {
        -webkit-transform: translate(0px,0px);
    }

    70% {
        -webkit-transform: translate(5px,-1.5px);
    }

    100% {
        -webkit-transform: translate(0px,0px);
    }
}

@-o-keyframes ddf {
    0% {
        -o-transform: translate(-8px,3px);
    }

    20% {
        -o-transform: translate(-3px,1.5px);
    }

    50% {
        -o-transform: translate(0px,0px);
    }

    70% {
        -o-transform: translate(5px,-1.5px);
    }

    100% {
        -o-transform: translate(0px,0px);
    }
}

@-moz-keyframes ddf {
    0% {
        -moz-transform: translate(-8px,3px);
    }

    20% {
        -moz-transform: translate(-3px,1.5px);
    }

    50% {
        -moz-transform: translate(0px,0px);
    }

    70% {
        -moz-transform: translate(5px,-1.5px);
    }

    100% {
        -moz-transform: translate(0px,0px);
    }
}

@keyframes ddf {
    0% {
        transform: translate(-8px,3px);
    }

    20% {
        transform: translate(-3px,1.5px);
    }

    50% {
        transform: translate(0px,0px);
    }

    70% {
        transform: translate(5px,-1.5px);
    }

    100% {
        transform: translate(0px,0px);
    }
}

.hgroup {
    z-index: 20000;
    content: "";
    position: absolute;
    left: -800px;
    top: 70px;
    width: 250px;
    height: 15px;
    background-color: rgba(255,255,255,.5);
    -webkit-transform: rotate(-45deg);
    -moz-transform: rotate(-45deg);
    -ms-transform: rotate(-45deg);
    -o-transform: rotate(-45deg);
    transform: rotate(-45deg);
    -webkit-animation: searchLights 3s ease-in 0s infinite;
    -o-animation: searchLights 3s ease-in 0s infinite;
    animation: searchLights 3s ease-in 0s infinite;
}

@-webkit-keyframes searchLights {
    0% {
        left: -800px;
        top: 70px;
    }

    to {
        left: 350px;
        top: 70px;
    }
}

@-o-keyframes searchLights {
    0% {
        left: -800px;
        top: 70px;
    }

    to {
        left: 350px;
        top: 70px;
    }
}

@-moz-keyframes searchLights {
    0% {
        left: -800px;
        top: 70px;
    }

    to {
        left: 350px;
        top: 70px;
    }
}

@keyframes searchLights {
    0% {
        left: -800px;
        top: 70px;
    }

    to {
        left: 350px;
        top: 70px;
    }
}

/* 提示消息样式优化 */
.tncode_msg_ok {
    background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%);
    border-radius: 8px;
}

.tncode_msg_error {
    background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%);
    border-radius: 8px;
}

.tncode_msg_ok,.tncode_msg_error {
    position: absolute;
    top: 146px;
    left: 20px;
    width: 240px;
    height: 24px;
    color: #fff;
    margin: 0;
    padding: 4px 12px;
    overflow: visible;
    font-size: 13px;
    opacity: 0;
    filter: alpha(opacity=0);
    z-index: 10000;
    line-height: 24px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 滑块区域样式优化 */
.slide {
    position: absolute;
    top: 180px;
    width: 85.71%;
    height: 47px;
    background: #f8f9fa;
    margin: 0 7.14%;
    padding: 0;
    overflow: visible;
    border-radius: 25px;
    border: 1px solid #e8e8e8;
    /* 启用硬件加速 */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* 滑动轨道进度效果 */
.slide::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, rgba(0, 212, 255, 0.1) 0%, rgba(0, 212, 255, 0.05) 100%);
    border-radius: 25px;
    transition: width 0.1s linear;
    pointer-events: none;
}

/* 工具栏样式优化 */
.tools {
    position: absolute;
    top: 240px;
    width: 85.71%;
    height: 30px;
    background-color: transparent;
    margin: 0 7.14%;
    padding: 0;
    overflow: visible;
    border-top: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 滑块样式 - 与登录按钮风格统一 */
.slide_block {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    width: 45px;
    height: 45px;
    position: absolute;
    left: 0px;
    top: 0px;
    margin: 0;
    cursor: grab;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
    transition: box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 启用硬件加速 */
    will-change: transform;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* 优化渲染性能 */
    contain: layout style paint;
}

.slide_block::after {
    content: '→';
    color: white;
    font-size: 24px;
    font-weight: bold;
    pointer-events: none;
}

.slide_block:hover {
    box-shadow: 0 6px 16px rgba(0, 212, 255, 0.4);
}

.slide_block:active {
    cursor: grabbing;
    box-shadow: 0 8px 20px rgba(0, 212, 255, 0.5);
}

.slide_block_text {
    height: 50px;
    position: absolute;
    left: 60px;
    top: 0;
    right: 10px;
    margin: 0;
    cursor: pointer;
    font-size: 13px;
    color: #95a5a6;
    line-height: 50px;
    text-align: center;
    user-select: none;
}

.tncode_canvas_bg,.tncode_canvas_mark {
}

/* 工具按钮样式优化 */
.tools .tncode_close {
    height: 20px;
    width: 20px;
    cursor: pointer;
    border-radius: 50%;
    background: #d4d4d4;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.tools .tncode_close::before,
.tools .tncode_close::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 2px;
    background: white;
}

.tools .tncode_close::before {
    transform: rotate(45deg);
}

.tools .tncode_close::after {
    transform: rotate(-45deg);
}

.tools .tncode_close:hover {
    background: #ff7875;
    transform: scale(1.1);
}

.tools .tncode_refresh {
    height: 28px;
    width: 28px;
    cursor: pointer;
    border-radius: 50%;
    background: #1890ff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.tools .tncode_refresh::before {
    content: '↻';
    color: white;
    font-size: 18px;
    font-weight: bold;
}

.tools .tncode_refresh:hover {
    background: #40a9ff;
    transform: rotate(180deg);
}

.tools .tncode_tips {
    font-size: 12px;
    color: #95a5a6;
    flex: 1;
    text-align: center;
    margin: 0 10px;
}

.tools .tncode_tips a {
    text-decoration: none;
    font-size: 12px;
    color: #95a5a6;
}

/* 响应式优化 */
@media screen and (max-width: 768px) {
    .tncode_div {
        width: 90%;
        max-width: 280px;
        left: 50%;
        margin-left: 0;
        transform: translateX(-50%);
    }

    .slide_block_text {
        font-size: 12px;
    }

    .tools .tncode_tips {
        font-size: 11px;
    }
}

/* 添加三角箭头指向触发元素 */
.tncode_div::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #e8e8e8;
}

.tncode_div::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 9px solid white;
}

/* 验证成功后的样式 */
.tncode.success {
    border-color: #52c41a;
    background: #f6ffed;
}

/* 验证失败后的样式 */
.tncode.error {
    border-color: #ff4d4f;
    background: #fff2f0;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}