/* ================= 滑动拼图验证页样式（三端适配） ================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
    background: linear-gradient(160deg, #e8f0fe 0%, #f6f8fb 60%, #eef3fa 100%);
    min-height: 100vh;
    color: #1d2129;
    -webkit-tap-highlight-color: transparent;
}

a, button { outline: none; }
button:focus, a:focus, input:focus { outline: none; }

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 12px;
}

.card {
    width: 100%;
    max-width: 620px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(30, 60, 120, 0.12);
    padding: 22px;
}

.card-head { text-align: center; margin-bottom: 16px; }
.card-head h1 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.card-head p { font-size: 13px; color: #86909c; }

/* ---------- 拼图区域：逻辑尺寸 600x360，等比缩放 ---------- */
.puzzle-area {
    position: relative;
    width: 100%;
    aspect-ratio: 600 / 360;
    border-radius: 10px;
    overflow: hidden;
    background: #f2f3f5;
    user-select: none;
    -webkit-user-select: none;
}
/* 老浏览器兜底 */
@supports not (aspect-ratio: 1 / 1) {
    .puzzle-area { height: 0; padding-bottom: 60%; }
}

.puzzle-area img#bgImg {
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}

.piece {
    position: absolute;
    left: 0;
    top: 0;
    width: 10%;           /* 60 / 600 */
    display: none;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
    will-change: left;
    pointer-events: none;
}

.loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #86909c;
    background: rgba(255, 255, 255, 0.6);
}

/* ---------- 滑动条 ---------- */
.slider-bar {
    position: relative;
    height: 44px;
    margin-top: 14px;
    background: #f2f3f5;
    border: 1px solid #e5e6eb;
    border-radius: 8px;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.slider-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 0;
    background: rgba(22, 93, 255, 0.12);
    border-right: 1px solid rgba(22, 93, 255, 0.35);
}

.slider-track-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #86909c;
    pointer-events: none;
}

.slider-handle {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 46px;
    background: #fff;
    border: 1px solid #c9cdd4;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    touch-action: none;
}
.slider-handle:active { cursor: grabbing; }
.slider-handle .arrow { font-size: 20px; color: #4e5969; line-height: 1; }

.slider-bar.ok .slider-fill { background: rgba(0, 180, 42, 0.15); border-right-color: rgba(0, 180, 42, 0.4); }
.slider-bar.ok .slider-handle { border-color: #00b42a; }
.slider-bar.ok .slider-handle .arrow { color: #00b42a; }

/* ---------- 状态提示 ---------- */
.status {
    min-height: 22px;
    margin-top: 10px;
    font-size: 13px;
    text-align: center;
}
.status .ok  { color: #00b42a; }
.status .no  { color: #d92b1c; }
.status .tip { color: #86909c; }

.foot { text-align: center; margin-top: 6px; }
.refresh {
    border: 0;
    background: none;
    color: #165dff;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}
.refresh:active { background: #f2f3f5; }

/* 失败抖动 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}
.shake { animation: shake 0.4s; }

.copyright { margin-top: 16px; font-size: 12px; color: #a9aeb8; }

/* ---------- 移动端微调 ---------- */
@media (max-width: 480px) {
    .card { padding: 14px; border-radius: 12px; }
    .card-head h1 { font-size: 16px; }
    .slider-handle { width: 42px; }
}
