/* ══════════════════════════════════════════════════════════════
   访客准入验证浮层（2026-09-30）

   盖在聊天窗口上，验证通过才撤掉。三种题型共用一套外壳，
   只有中间那块「答题区」按题型换。

   为什么整块盖住而不是插在消息流里：访客一眼要知道「现在不能聊，
   先过这一步」。插在消息里会被当成一条普通消息划过去。
   ══════════════════════════════════════════════════════════════ */
.vgate-mask{
    position:absolute;inset:0;z-index:40;
    display:grid;place-items:center;padding:18px;
    background:rgba(238,241,247,.82);
    -webkit-backdrop-filter:blur(14px) saturate(140%);backdrop-filter:blur(14px) saturate(140%);
    animation:vgate-in .18s ease-out
}
@keyframes vgate-in{from{opacity:0}to{opacity:1}}
.vgate-card{
    width:min(340px,100%);padding:22px 20px 20px;
    border:1px solid rgba(255,255,255,.8);border-radius:20px;
    background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(255,255,255,.9));
    box-shadow:0 22px 54px rgba(24,36,64,.18);
    text-align:center
}
.vgate-mark{
    width:44px;height:44px;margin:0 auto 12px;border-radius:14px;
    display:grid;place-items:center;
    background:color-mix(in srgb,var(--support-color,#635bff) 13%,#fff);
    color:var(--support-color,#635bff)
}
.vgate-mark svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.vgate-card h2{margin:0 0 6px;color:#17203a;font-size:16.5px;font-weight:800;letter-spacing:-.01em}
.vgate-card p.vgate-hint{margin:0 0 16px;color:#6b7690;font-size:12.5px;line-height:1.65}

/* ── 滑块 ── */
.vgate-slider{
    position:relative;height:46px;border-radius:13px;overflow:hidden;
    border:1px solid rgba(120,136,168,.28);background:#f1f3f8;
    touch-action:none;user-select:none;-webkit-user-select:none
}
.vgate-slider-fill{
    position:absolute;inset:0 auto 0 0;width:0;
    background:color-mix(in srgb,var(--support-color,#635bff) 20%,#fff);
    transition:background .16s
}
.vgate-slider-text{
    position:absolute;inset:0;display:grid;place-items:center;
    color:#7a8499;font-size:12.5px;font-weight:650;pointer-events:none
}
.vgate-slider-handle{
    position:absolute;top:2px;left:2px;width:44px;height:40px;
    display:grid;place-items:center;border-radius:11px;
    background:#fff;box-shadow:0 3px 10px rgba(26,40,72,.2);
    color:var(--support-color,#635bff);cursor:grab
}
.vgate-slider-handle svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.vgate-slider.is-dragging .vgate-slider-handle{cursor:grabbing}
.vgate-slider.is-done .vgate-slider-fill{background:color-mix(in srgb,#17a97a 22%,#fff)}
.vgate-slider.is-done .vgate-slider-handle{color:#17a97a}
.vgate-slider.is-done .vgate-slider-text{color:#17a97a}

/* ── 拼图 ── */
.vgate-puzzle{
    position:relative;width:100%;margin-bottom:10px;border-radius:12px;overflow:hidden;
    border:1px solid rgba(120,136,168,.28);background:#e9ecf3;
    user-select:none;-webkit-user-select:none
}
.vgate-puzzle-bg{display:block;width:100%;height:auto;pointer-events:none}
.vgate-puzzle-piece{
    position:absolute;left:0;top:0;height:auto;
    filter:drop-shadow(0 2px 5px rgba(16,26,48,.45));
    pointer-events:none;will-change:left
}
.vgate-puzzle-reload{
    position:absolute;right:7px;top:7px;width:30px;height:30px;
    display:grid;place-items:center;border:0;border-radius:9px;
    background:rgba(255,255,255,.82);color:#41506b;cursor:pointer
}
.vgate-puzzle-reload svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* ── 图形码 / 加减法 ── */
.vgate-quiz{display:grid;gap:10px}
.vgate-quiz-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:9px;align-items:center}
.vgate-quiz-image{
    height:46px;border:1px solid rgba(120,136,168,.28);border-radius:11px;
    background:#f1f3f8 center/contain no-repeat;cursor:pointer;
    display:block;width:100%
}
.vgate-quiz-question{
    height:46px;display:grid;place-items:center;
    border:1px solid rgba(120,136,168,.28);border-radius:11px;background:#f1f3f8;
    color:#17203a;font-size:19px;font-weight:750;letter-spacing:.06em
}
.vgate-quiz-reload{
    width:46px;height:46px;display:grid;place-items:center;
    border:1px solid rgba(120,136,168,.28);border-radius:11px;background:#fff;
    color:#6b7690;cursor:pointer
}
.vgate-quiz-reload svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.vgate-input{
    width:100%;height:46px;padding:0 14px;
    border:1px solid rgba(120,136,168,.3);border-radius:12px;background:#fff;
    color:#17203a;font:700 16px/1 system-ui;text-align:center;letter-spacing:.18em;
    outline:none;-webkit-appearance:none;appearance:none
}
.vgate-input::placeholder{color:#a8b1c4;font-weight:500;letter-spacing:normal}
.vgate-input:focus{border-color:var(--support-color,#635bff);box-shadow:0 0 0 3px color-mix(in srgb,var(--support-color,#635bff) 14%,transparent)}
.vgate-submit{
    width:100%;min-height:44px;margin-top:2px;
    border:0;border-radius:12px;background:var(--support-color,#635bff);
    color:#fff;font:750 13.5px/1 system-ui;cursor:pointer
}
.vgate-submit:disabled{cursor:not-allowed;opacity:.55}

.vgate-note{margin:12px 0 0;min-height:17px;color:#b3261e;font-size:12px;line-height:1.5}
.vgate-note.is-ok{color:#17a97a}
.vgate-foot{margin:13px 0 0;color:#9aa3b6;font-size:11px;line-height:1.55}

/* 一次性校验失败太多进冷却时，把答题区收起来，只留说明 */
.vgate-card.is-locked .vgate-body{display:none}

@supports not (background:color-mix(in srgb,#000 10%,#fff)){
    .vgate-mark{background:#eef0ff}
    .vgate-slider-fill{background:#e3e4ff}
    .vgate-input:focus{box-shadow:0 0 0 3px rgba(99,91,255,.14)}
}

/* 嵌入式悬浮窗比直达页矮，卡片要更紧凑 */
body.is-embed .vgate-mask{padding:12px}
body.is-embed .vgate-card{padding:18px 16px 16px;border-radius:17px}
body.is-embed .vgate-card h2{font-size:15.5px}
body.is-embed .vgate-card p.vgate-hint{margin-bottom:13px;font-size:12px}

@media (max-height:520px){
    .vgate-mask{place-items:start center;padding-top:14px;overflow:auto}
    .vgate-mark{width:36px;height:36px;margin-bottom:9px;border-radius:12px}
    .vgate-card{padding:16px 15px 15px}
    .vgate-card p.vgate-hint{margin-bottom:12px}
}
@media (max-width:360px){
    .vgate-mask{padding:12px}
    .vgate-card{padding:18px 15px 15px}
}
