/* ============================================================
 * 天成记 · 全局主题化确认 / 提示弹窗
 * 贴合系统主色（gold）的自建弹窗，替代散落的 window.confirm / alert。
 * 全局提示性弹窗统一采用该样式；实际操作类弹窗（如报价选量弹窗）不调整。
 * 提供：window.TCJ.confirm() / window.TCJ.alert()，均返回 Promise。
 * ============================================================ */

.tcj-confirm {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.tcj-confirm.on {
    display: flex;
    animation: tcj-cm-fade .18s ease both;
}
.tcj-confirm-mask {
    position: absolute;
    inset: 0;
    background: rgba(20, 18, 14, .46);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.tcj-confirm-box {
    position: relative;
    width: min(420px, 100%);
    background: #fff;
    border-radius: 16px;
    padding: 30px 28px 24px;
    box-shadow: 0 30px 80px rgba(40, 30, 10, .28), 0 0 0 1px rgba(194, 160, 106, .18);
    text-align: center;
    transform: translateY(8px) scale(.98);
    animation: tcj-cm-pop .22s cubic-bezier(.2, .8, .25, 1) both;
    overflow: hidden;
}
/* 顶部金色装饰条 */
.tcj-confirm-box::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gold-d, #9c7f4c), var(--gold-l, #e0c795), var(--gold-d, #9c7f4c));
}
.tcj-confirm-ic {
    width: 52px; height: 52px;
    margin: 2px auto 14px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(194, 160, 106, .12);
    color: var(--gold-d, #9c7f4c);
}
.tcj-confirm-ic svg { width: 26px; height: 26px; fill: currentColor; }
.tcj-confirm-tt {
    margin: 0 0 8px;
    font-size: 19px;
    font-weight: 700;
    color: #2a2620;
}
.tcj-confirm-msg {
    margin: 0 0 22px;
    font-size: 15px;
    line-height: 1.7;
    color: #6a645a;
    white-space: pre-line;
    word-break: break-word;
}
.tcj-confirm-ft {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.tcj-btn {
    flex: 1;
    min-width: 110px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}
.tcj-btn:active { transform: translateY(1px); }
.tcj-btn-ok {
    color: #fff;
    background: linear-gradient(120deg, var(--gold-l, #e0c795), var(--gold, #c2a06a));
    box-shadow: 0 10px 24px rgba(194, 160, 106, .32), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.tcj-btn-ok:hover {
    box-shadow: 0 14px 32px rgba(194, 160, 106, .45), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.tcj-btn-cancel {
    color: var(--gold-d, #9c7f4c);
    background: rgba(194, 160, 106, .1);
}
.tcj-btn-cancel:hover { background: rgba(194, 160, 106, .18); }

/* ---------- 按 type 切换图标与强调色（框体风格保持一致） ---------- */
.tcj-confirm-box[data-type="info"] .tcj-confirm-ic,
.tcj-confirm-box[data-type="warning"] .tcj-confirm-ic {
    color: var(--gold-d, #9c7f4c);
    background: rgba(194, 160, 106, .12);
}
.tcj-confirm-box[data-type="success"] .tcj-confirm-ic {
    color: #2f9e63;
    background: rgba(47, 158, 99, .12);
}
.tcj-confirm-box[data-type="error"] .tcj-confirm-ic {
    color: #e0564f;
    background: rgba(224, 86, 79, .12);
}

/* ---------- 自动关闭：倒计时文案 + 底部进度条 ---------- */
.tcj-confirm-auto {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.tcj-confirm-auto-t {
    font-size: 12px;
    color: #9a9388;
    letter-spacing: .3px;
}
.tcj-confirm-bar {
    width: 100%;
    height: 3px;
    border-radius: 3px;
    background: rgba(0, 0, 0, .06);
    overflow: hidden;
}
.tcj-confirm-bar i {
    display: block;
    height: 100%;
    width: 100%;
    background: var(--gold, #c2a06a);
}
.tcj-confirm-box[data-type="success"] .tcj-confirm-bar i { background: #2f9e63; }
.tcj-confirm-box[data-type="error"] .tcj-confirm-bar i { background: #e0564f; }

@keyframes tcj-cm-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes tcj-cm-pop {
    from { opacity: 0; transform: translateY(14px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

body.tcj-confirm-open { overflow: hidden; }

@media (max-width: 480px) {
    .tcj-confirm-box { padding: 26px 20px 20px; }
    .tcj-confirm-ft { flex-direction: column-reverse; }
    .tcj-btn { width: 100%; }
}
