/* =============================================
   Custom Alert Modal — 成功(紫) / 失败(红)
   替换 layui layer.alert 样式
   ============================================= */

/* 遮罩 */
.ca-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ca-fade-in 0.2s ease;
}

@keyframes ca-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* 弹框主体 */
.ca-box {
    position: relative;
    width: 320px;
    border-radius: 20px;
    overflow: hidden;
    background: #f7f6ff;
    box-shadow: 0 12px 40px rgba(100, 80, 200, 0.18);
    animation: ca-slide-up 0.25s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.ca-box.ca-fail {
    background: #fff6f6;
    box-shadow: 0 12px 40px rgba(255, 80, 80, 0.15);
}

.ca-box.ca-warn {
    background: #fffdf0;
    box-shadow: 0 12px 40px rgba(255, 180, 0, 0.15);
}

@keyframes ca-slide-up {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);   opacity: 1; }
}

/* 头部装饰区（带波浪背景） */
.ca-header {
    position: relative;
    padding: 20px 20px 10px;
    background: linear-gradient(135deg, #ede9ff 0%, #f3f0ff 60%, #f7f6ff 100%);
    overflow: hidden;
    min-height: 60px;
}

.ca-box.ca-fail .ca-header {
    background: linear-gradient(135deg, #ffe4e4 0%, #fff0f0 60%, #fff6f6 100%);
}

.ca-box.ca-warn .ca-header {
    background: linear-gradient(135deg, #fff8d6 0%, #fffbe8 60%, #fffdf0 100%);
}

/* 右上角装饰圆 */
.ca-header::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(147, 112, 219, 0.12);
}

.ca-box.ca-fail .ca-header::before {
    background: rgba(255, 100, 100, 0.1);
}

.ca-box.ca-warn .ca-header::before {
    background: rgba(255, 200, 0, 0.12);
}

/* 标题行 */
.ca-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.ca-title {
    font-size: 17px;
    font-weight: 700;
    color: #2d2060;
}

.ca-box.ca-fail .ca-title {
    color: #5a1a1a;
}

.ca-box.ca-warn .ca-title {
    color: #5a4200;
}

/* 关闭按钮 */
.ca-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.8);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}

.ca-close:hover { background: #fff; color: #444; }

/* 图标区 */
.ca-body {
    padding: 12px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    background: #f7f6ff;
}

.ca-box.ca-fail .ca-body {
    background: #fff6f6;
}

/* 图标容器（带发光阴影+装饰星星） */
.ca-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
}

/* 装饰小点/星 */
.ca-icon-wrap::before,
.ca-icon-wrap::after {
    content: '+';
    position: absolute;
    font-size: 14px;
    font-weight: 700;
    color: #b39ddb;
    line-height: 1;
}

.ca-box.ca-fail .ca-icon-wrap::before,
.ca-box.ca-fail .ca-icon-wrap::after {
    color: #f48fb1;
}

.ca-box.ca-warn .ca-icon-wrap::before,
.ca-box.ca-warn .ca-icon-wrap::after {
    color: #ffd54f;
}

.ca-icon-wrap::before { top: -8px;  left: -28px; }
.ca-icon-wrap::after  { bottom: -4px; right: -28px; font-size: 10px; }

/* 额外装饰点 */
.ca-icon-wrap .ca-dot1,
.ca-icon-wrap .ca-dot2 {
    position: absolute;
    font-size: 12px;
    font-weight: 700;
    color: #ce93d8;
    line-height: 1;
}

.ca-box.ca-fail .ca-icon-wrap .ca-dot1,
.ca-box.ca-fail .ca-icon-wrap .ca-dot2 {
    color: #ef9a9a;
}

.ca-dot1 { top: 4px;  right: -26px; }
.ca-dot2 { bottom: 0; left: -22px; font-size: 9px; }

/* 光晕圆 */
.ca-icon-glow {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.9) 40%, rgba(179,157,219,0.25) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 8px rgba(179,157,219,0.15), 0 4px 20px rgba(149,117,205,0.3);
}

.ca-box.ca-fail .ca-icon-glow {
    background: radial-gradient(circle, rgba(255,255,255,0.9) 40%, rgba(255,138,128,0.25) 100%);
    box-shadow: 0 0 0 8px rgba(255,138,128,0.15), 0 4px 20px rgba(244,67,54,0.25);
}

.ca-box.ca-warn .ca-icon-glow {
    background: radial-gradient(circle, rgba(255,255,255,0.9) 40%, rgba(255,220,50,0.25) 100%);
    box-shadow: 0 0 0 8px rgba(255,220,50,0.15), 0 4px 20px rgba(255,180,0,0.3);
}

/* 图标圆背景 */
.ca-icon-circle {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #9c6fdb, #7c4dce);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(124,77,206,0.4);
}

.ca-box.ca-fail .ca-icon-circle {
    background: linear-gradient(135deg, #ff6b6b, #f44336);
    box-shadow: 0 4px 16px rgba(244,67,54,0.4);
}

.ca-box.ca-warn .ca-icon-circle {
    background: linear-gradient(135deg, #ffd740, #ffab00);
    box-shadow: 0 4px 16px rgba(255,171,0,0.45);
}

/* SVG 图标 */
.ca-icon-circle svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: #fff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 消息文字 */
.ca-msg {
    font-size: 15px;
    font-weight: 600;
    color: #3d2b6b;
    text-align: center;
    line-height: 1.5;
    word-break: break-all;
    padding: 0 4px;
}

.ca-box.ca-fail .ca-msg {
    color: #7b1a1a;
}

.ca-box.ca-warn .ca-msg {
    color: #5a4200;
}

/* 底部按钮区 */
.ca-footer {
    padding: 0 20px 20px;
    background: #f7f6ff;
}

.ca-box.ca-fail .ca-footer {
    background: #fff6f6;
}

.ca-box.ca-warn .ca-footer {
    background: #fffdf0;
}

/* 分隔线 */
.ca-footer::before {
    content: '';
    display: block;
    height: 1px;
    background: rgba(149,117,205,0.12);
    margin-bottom: 16px;
}

.ca-box.ca-fail .ca-footer::before {
    background: rgba(244,67,54,0.1);
}

.ca-box.ca-warn .ca-footer::before {
    background: rgba(255,180,0,0.12);
}

/* OK 按钮 */
.ca-btn {
    display: block;
    width: 100%;
    padding: 13px 0;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #9c6fdb, #7c4dce);
    box-shadow: 0 4px 16px rgba(124,77,206,0.35);
    transition: opacity 0.15s, transform 0.12s;
    letter-spacing: 0.5px;
}

.ca-box.ca-fail .ca-btn {
    background: linear-gradient(135deg, #ff6b6b, #f44336);
    box-shadow: 0 4px 16px rgba(244,67,54,0.3);
}

.ca-box.ca-warn .ca-btn {
    background: linear-gradient(135deg, #9c6fdb, #7c4dce);
    box-shadow: 0 4px 16px rgba(124,77,206,0.35);
    color: #fff;
}

.ca-btn:active {
    opacity: 0.85;
    transform: scale(0.98);
}

/* 富文本消息区（签到成功详情） */
.ca-rich-msg {
    font-size: 13px;
    color: #3d2b6b;
    line-height: 1.8;
    word-break: break-word;
    padding: 0 4px;
    text-align: center;
    width: 100%;
}

.ca-rich-msg .cr-line1 {
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
}

.ca-rich-msg .cr-line2 {
    font-size: 13px;
    color: #555;
    margin-bottom: 10px;
}

.ca-rich-msg .cr-line3 {
    font-size: 13px;
    color: #555;
    margin-bottom: 0;
}
