/**
 * LW Captcha 组件样式
 * 设计规范：小圆角(4px)、紧凑布局、中性色调、磨砂玻璃
 */
.lwcap-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 17, 22, 0.35);
    animation: lwcap-fade .18s ease-out;
}

.lwcap-panel {
    width: 352px;
    max-width: calc(100vw - 24px);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(20, 24, 33, 0.1);
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(15, 17, 22, 0.18);
    overflow: hidden;
    animation: lwcap-pop .2s cubic-bezier(.2, .8, .3, 1);
}

.lwcap-shake { animation: lwcap-shake .35s ease; }

.lwcap-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(20, 24, 33, 0.08);
}

.lwcap-title { font: 500 13px/18px -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; color: #1f2430; }

.lwcap-tools { display: flex; gap: 4px; }

.lwcap-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 3px;
    background: transparent;
    color: #5a6272;
    cursor: pointer;
    transition: background .12s, color .12s;
}
.lwcap-btn-icon:hover { background: rgba(20, 24, 33, 0.07); color: #1f2430; }

.lwcap-body { padding: 12px; min-height: 210px; }

/* 加载态 */
.lwcap-loading {
    min-height: 210px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #5a6272;
    font: 400 13px/18px -apple-system, "PingFang SC", sans-serif;
}
.lwcap-spinner {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(31, 36, 48, 0.15);
    border-top-color: #4753ff;
    border-radius: 50%;
    animation: lwcap-spin .7s linear infinite;
}

/* 滑块 */
.lwcap-slider .lwcap-img-wrap,
.lwcap-click .lwcap-img-wrap {
    position: relative;
    width: 100%;
    border-radius: 3px;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}
.lwcap-img-wrap .lwcap-bg { display: block; width: 100%; -webkit-user-drag: none; -webkit-touch-callout: none; }
.lwcap-piece { position: absolute; left: 0; filter: drop-shadow(1px 2px 3px rgba(0, 0, 0, 0.3)); pointer-events: none; }

.lwcap-track {
    position: relative;
    height: 36px;
    margin-top: 10px;
    background: rgba(20, 24, 33, 0.06);
    border: 1px solid rgba(20, 24, 33, 0.08);
    border-radius: 3px;
}
.lwcap-track-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 20px; background: rgba(71, 83, 255, 0.14); transition: width .05s linear; }
.lwcap-thumb {
    position: absolute;
    top: -1px;
    left: 0;
    width: 38px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid rgba(20, 24, 33, 0.14);
    border-radius: 3px;
    color: #4753ff;
    cursor: grab;
    touch-action: none;
}
.lwcap-thumb:active { cursor: grabbing; border-color: #4753ff; }

/* 点选 */
.lwcap-prompt { margin: 0 0 10px; font: 500 13px/18px -apple-system, "PingFang SC", sans-serif; color: #1f2430; }
.lwcap-click-wrap { cursor: crosshair; }
.lwcap-mark {
    position: absolute;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #4753ff;
    color: #fff;
    border: 1.5px solid #fff;
    border-radius: 50%;
    font: 600 11px/1 -apple-system, "PingFang SC", sans-serif;
    pointer-events: none;
    animation: lwcap-pop .15s ease-out;
}
.lwcap-click-ops { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.lwcap-mini {
    padding: 3px 10px;
    background: transparent;
    border: 1px solid rgba(20, 24, 33, 0.14);
    border-radius: 3px;
    color: #5a6272;
    font: 400 12px/18px -apple-system, "PingFang SC", sans-serif;
    cursor: pointer;
}
.lwcap-mini:hover { border-color: #4753ff; color: #4753ff; }
.lwcap-click-count { font: 400 12px/18px -apple-system, "PingFang SC", sans-serif; color: #8b93a3; }

/* 结果态 */
.lwcap-result {
    min-height: 210px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font: 500 14px/20px -apple-system, "PingFang SC", sans-serif;
}
.lwcap-ok { color: #0ea86d; }
.lwcap-ok .ok-ring { stroke-dasharray: 101; stroke-dashoffset: 101; animation: lwcap-draw .45s .1s ease-out forwards; }
.lwcap-ok .ok-check { stroke-dasharray: 22; stroke-dashoffset: 22; animation: lwcap-draw .3s .5s ease-out forwards; }
.lwcap-err { color: #d2483d; cursor: pointer; }

/* 底栏 */
.lwcap-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-top: 1px solid rgba(20, 24, 33, 0.08);
}
.lwcap-brand { font: 600 11px/14px -apple-system, sans-serif; color: #b6bcc8; letter-spacing: .3px; }
.lwcap-tip { font: 400 11px/14px -apple-system, "PingFang SC", sans-serif; color: #8b93a3; }
.lwcap-tip-err { color: #d2483d; }

/* 动画 */
@keyframes lwcap-fade { from { opacity: 0; } }
@keyframes lwcap-pop { from { opacity: 0; transform: scale(.96) translateY(6px); } }
@keyframes lwcap-spin { to { transform: rotate(360deg); } }
@keyframes lwcap-draw { to { stroke-dashoffset: 0; } }
@keyframes lwcap-shake {
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

/* 小屏适配 */
@media (max-width: 400px) {
    .lwcap-panel { max-width: calc(100vw - 16px); }
    .lwcap-body { padding: 10px; }
}
