/**
 * click-captcha.css    汉字顺序点选验证码 前端组件样式
 * 自包含（.lrycc- 前缀），不依赖主题样式，适配桌面与移动端
 */

/* ===== 触发按钮（表单内嵌，变量驱动，深浅背景通用；深色页面加 .cc-theme-dark） ===== */
.cc-wrap { display: flex; align-items: center; }

.cc-btn {
    --cc-accent: #0d9488;                          /* 主题色 */
    --cc-accent-soft: rgba(13, 148, 136, .07);     /* 底色渐变·起 */
    --cc-accent-soft2: rgba(45, 212, 191, .13);    /* 底色渐变·止 */
    --cc-border: rgba(13, 148, 136, .42);          /* 描边 */
    --cc-border-hover: #14b8a6;                    /* 描边·悬停 */
    --cc-text: #0f766e;                            /* 文字 */
    --cc-icon: #0d9488;                            /* 图标 */
    --cc-glow: rgba(13, 148, 136, .16);            /* 悬停光晕 */

    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 208px;
    height: 44px;
    padding: 0 22px;
    border: 1.5px solid var(--cc-border);
    border-radius: 10px;
    background: linear-gradient(135deg, var(--cc-accent-soft) 0%, var(--cc-accent-soft2) 100%);
    color: var(--cc-text);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .4px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: border-color .22s ease, box-shadow .22s ease, transform .18s ease, background-color .22s ease;
    box-sizing: border-box;
    overflow: hidden;
}
/* 盾牌图标（mask 方案，颜色随 --cc-icon 变量） */
.cc-btn::before {
    content: '';
    flex: none;
    width: 17px;
    height: 17px;
    background-color: var(--cc-icon);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2L4 6v6c0 5.5 3.8 10.7 8 12 4.2-1.3 8-6.5 8-12V6l-8-4z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2L4 6v6c0 5.5 3.8 10.7 8 12 4.2-1.3 8-6.5 8-12V6l-8-4z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E") no-repeat center / contain;
    transition: transform .3s ease;
}
.cc-btn:hover {
    border-color: var(--cc-border-hover);
    box-shadow: 0 0 0 3px var(--cc-glow), 0 6px 18px var(--cc-glow);
    transform: translateY(-1px);
}
.cc-btn:hover::before { transform: rotate(-8deg) scale(1.08); }
.cc-btn:active { transform: translateY(0); transition-duration: .08s; }
.cc-btn:focus-visible {
    outline: none;
    border-color: var(--cc-border-hover);
    box-shadow: 0 0 0 3px var(--cc-glow);
}

/* 验证成功态 */
.cc-btn.cc-ok {
    --cc-accent: #10b981;
    --cc-border: rgba(16, 185, 129, .55);
    --cc-text: #059669;
    --cc-icon: #10b981;
    --cc-glow: rgba(16, 185, 129, .18);
    background: linear-gradient(135deg, rgba(16,185,129,.08), rgba(52,211,153,.15));
    cursor: default;
    animation: cc-pop .38s cubic-bezier(.34, 1.56, .64, 1);
}
.cc-btn.cc-ok::before { display: none; }   /* 由 JS 注入 ✓ 图标替代盾牌 */
.cc-btn .cc-btn-check { font-style: normal; font-size: 15px; }
@keyframes cc-pop {
    0% { transform: scale(.94); }
    55% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

/* 外层表单组已自带图标时（如 auth.css 的 has-icon::before）隐藏按钮内盾牌，避免重复 */
.form-group.has-icon .cc-btn::before { display: none; }
/* auth.css 对 .form-input 的左内边距规约会波及按钮，统一还原 */
.form-group.has-icon .cc-btn { padding: 0 22px; }

/* ===== 深色页面变体：后台登录等深底场景加 .cc-theme-dark ===== */
.cc-btn.cc-theme-dark {
    --cc-accent: #2dd4bf;
    --cc-accent-soft: rgba(45, 212, 191, .08);
    --cc-accent-soft2: rgba(45, 212, 191, .16);
    --cc-border: rgba(45, 212, 191, .5);
    --cc-border-hover: #5eead4;
    --cc-text: #99f6e4;
    --cc-icon: #2dd4bf;
    --cc-glow: rgba(45, 212, 191, .22);
}
.cc-btn.cc-theme-dark.cc-ok {
    --cc-accent: #34d399;
    --cc-border: rgba(52, 211, 153, .6);
    --cc-text: #a7f3d0;
    --cc-icon: #34d399;
    --cc-glow: rgba(52, 211, 153, .25);
    background: linear-gradient(135deg, rgba(52,211,153,.12), rgba(52,211,153,.2));
}

/* ===== 遮罩弹窗 ===== */
.lrycc-mask {
    position: fixed;
    left: 0; top: 0; right: 0; bottom: 0;
    z-index: 9999999;
    background: rgba(15, 23, 42, .55);
    display: none;
    align-items: center;
    justify-content: center;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.lrycc-mask.lrycc-show { display: flex; }

.lrycc-box {
    width: 400px;
    max-width: 92vw;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
    overflow: hidden;
    animation: lrycc-in .18s ease-out;
}
@keyframes lrycc-in {
    from { transform: translateY(14px) scale(.97); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.lrycc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 10px;
}
.lrycc-title {
    font-size: 15px;
    font-weight: 600;
    color: #1f2d3d;
}
.lrycc-close {
    width: 26px; height: 26px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    color: #8492a6;
    font-size: 18px;
    cursor: pointer;
    user-select: none;
}
.lrycc-close:hover { background: #f0f2f5; color: #4a5b70; }

.lrycc-prompt {
    padding: 0 16px 10px;
    font-size: 13px;
    color: #5a6a7e;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.lrycc-prompt b {
    display: inline-block;
    min-width: 26px;
    height: 26px;
    line-height: 26px;
    text-align: center;
    padding: 0 4px;
    background: #eef3fb;
    border: 1px solid #d4e0f2;
    border-radius: 6px;
    color: #2b5fb8;
    font-size: 15px;
    font-weight: 600;
}

.lrycc-imgwrap {
    position: relative;
    margin: 0 16px;
    border-radius: 8px;
    overflow: hidden;
    background: #22303f;
    cursor: crosshair;
    -webkit-tap-highlight-color: transparent;
}
.lrycc-imgwrap img.lrycc-img {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;   /* 点击统一由容器接管，坐标系换算更稳 */
}
.lrycc-mark {
    position: absolute;
    width: 24px; height: 24px;
    margin: -12px 0 0 -12px;
    border-radius: 50%;
    background: #0d9488;
    border: 2px solid #fff;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
    pointer-events: none;
}
.lrycc-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cfd9e6;
    font-size: 13px;
    background: #22303f;
}

.lrycc-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 14px;
    min-height: 42px;
    box-sizing: border-box;
}
.lrycc-refresh {
    color: #0d9488;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}
.lrycc-refresh:hover { text-decoration: underline; }
.lrycc-msg {
    font-size: 12px;
    color: #e05252;
    text-align: right;
    flex: 1;
    margin-left: 10px;
    word-break: break-all;
}
.lrycc-msg.lrycc-ok { color: #1ab394; }

/* 锁定倒计时 */
.lrycc-lock {
    display: none;
    margin: 0 16px 14px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fdf3f2;
    border: 1px solid #f5c6c2;
    color: #c0392b;
    font-size: 13px;
    text-align: center;
}
.lrycc-lock b { font-size: 16px; padding: 0 2px; }
.lrycc-box.lrycc-locked .lrycc-imgwrap,
.lrycc-box.lrycc-locked .lrycc-prompt,
.lrycc-box.lrycc-locked .lrycc-bar { display: none; }
.lrycc-box.lrycc-locked .lrycc-lock { display: block; }

@media (max-width: 480px) {
    .lrycc-box { border-radius: 10px; }
    .lrycc-mark { width: 20px; height: 20px; line-height: 16px; margin: -10px 0 0 -10px; font-size: 12px; }
}
