/* ==========================================================================
   GoSMS 反馈组件：提示框（toastr）+ 弹窗（SweetAlert2）
   纯 CSS 独立文件，最后加载（见 panels/styles.blade.php）；色值引用 --gs-* token

   设计
   - 提示框：白色卡片 + 左侧语义色竖条 + 浅色圆形图标 + 底部细进度条
     标题用语义深色（对比度 ≥ 4.5:1），正文中性灰；成功色用品牌深翠绿
   - 弹窗：20px 圆角、48px 语义色图标圈（替代默认大线框图标）、
     标题深青黑、按钮沿用全站 .btn 规格，取消按钮为中性描边
   ========================================================================== */

:root {
    --gs-fb-success: var(--gs-brand-800, #044B39);
    --gs-fb-success-bar: var(--gs-brand-500, #1EA97B);
    --gs-fb-success-soft: var(--gs-brand-50, #EAF8E7);
    --gs-fb-info: var(--gs-info-text, #1A62B0);
    --gs-fb-info-bar: var(--gs-info, #2180E6);
    --gs-fb-info-soft: var(--gs-info-soft, #E3EFFC);
    --gs-fb-warning: var(--gs-warning-text, #8A4B00);
    --gs-fb-warning-bar: var(--gs-warning, #F29A2E);
    --gs-fb-warning-soft: var(--gs-warning-soft, #FDEFD9);
    --gs-fb-error: var(--gs-danger-text, #B42328);
    --gs-fb-error-bar: var(--gs-danger, #E5484D);
    --gs-fb-error-soft: var(--gs-danger-soft, #FDE8E8);
    --gs-fb-shadow: 0 12px 32px rgba(5, 52, 56, 0.12), 0 2px 6px rgba(5, 52, 56, 0.06);
}

/* ========== 提示框（toastr） ========== */
#toast-container {
    z-index: 99999;
}

#toast-container.toast-top-right {
    top: 24px;
    right: 24px;
}

#toast-container > div,
#toast-container > .toast {
    position: relative;
    width: 360px;
    max-width: calc(100vw - 32px);
    margin: 0 0 12px;
    padding: 16px 40px 18px 64px;
    border: 1px solid var(--gs-border, #E4E4E0);
    border-radius: 14px !important;
    background-color: #FFFFFF !important;
    background-image: none !important;
    box-shadow: var(--gs-fb-shadow) !important;
    color: var(--gs-text, #3A3A37) !important;
    opacity: 1;
    overflow: hidden;
    animation: gs-toast-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

#toast-container > div:hover {
    box-shadow: 0 16px 40px rgba(5, 52, 56, 0.16), 0 2px 6px rgba(5, 52, 56, 0.06) !important;
}

@keyframes gs-toast-in {
    from { opacity: 0; transform: translateX(24px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

/* 左侧语义色竖条 */
#toast-container > .toast::after {
    content: none;        /* 去掉左侧竖条：图标已表达语义色，竖条在圆角卡片上显得断开 */
}

/* 图标：浅色圆底 + 语义色线条图标 */
#toast-container > .toast::before {
    top: 16px;
    left: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-size: 18px;
    background-position: center;
    background-repeat: no-repeat;
}

.toast .gs-toast-head { display: inline-flex; align-items: center; gap: 6px; }
.toast .gs-toast-mark { display: inline-flex; align-items: center; color: inherit; opacity: .85; }
.toast .gs-toast-mark svg { display: block; }
.toast .toast-title {
    margin-bottom: 2px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
}

.toast .toast-message {
    color: var(--gs-text-secondary, #6B6B66);
    font-size: 14px;
    line-height: 1.55;
    word-break: break-word;
}

.toast .toast-message a {
    color: var(--gs-brand-800, #044B39);
    font-weight: 600;
    text-decoration: underline;
}

.toast .toast-close-button {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    color: var(--gs-text-muted, #9A9A94) !important;
    font-size: 20px;
    line-height: 22px;
    opacity: 1;
    text-align: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.toast .toast-close-button:hover {
    background: var(--gs-surface-hover, #F3F3F1);
    color: var(--gs-ink, #1C1C1C) !important;
    opacity: 1;
}

.toast .toast-progress {
    left: 20px;                    /* 与图标左边对齐，左右各留 20px，不进入圆角 */
    bottom: 8px;                   /* 离开底边，悬浮在卡片内 */
    max-width: calc(100% - 40px);
    height: 3px;
    border-radius: 3px;
    opacity: 0.9;
}

/* 语义色 */
.toast-success .toast-title { color: var(--gs-fb-success); }
#toast-container > .toast-success::after,
.toast-success .toast-progress { background-color: var(--gs-fb-success-bar); }
#toast-container > .toast-success::before {
    background-color: var(--gs-fb-success-soft);
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23044B39' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

.toast-info .toast-title { color: var(--gs-fb-info); }
#toast-container > .toast-info::after,
.toast-info .toast-progress { background-color: var(--gs-fb-info-bar); }
#toast-container > .toast-info::before {
    background-color: var(--gs-fb-info-soft);
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231A62B0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
}

.toast-warning .toast-title { color: var(--gs-fb-warning); }
#toast-container > .toast-warning::after,
.toast-warning .toast-progress { background-color: var(--gs-fb-warning-bar); }
#toast-container > .toast-warning::before {
    background-color: var(--gs-fb-warning-soft);
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A4B00' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
}

.toast-error .toast-title { color: var(--gs-fb-error); }
#toast-container > .toast-error::after,
.toast-error .toast-progress { background-color: var(--gs-fb-error-bar); }
#toast-container > .toast-error::before {
    background-color: var(--gs-fb-error-soft);
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B42328' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E");
}

/* ========== 弹窗（SweetAlert2） ========== */
div.swal2-container.swal2-backdrop-show,
div.swal2-container.swal2-noanimation {
    background: rgba(5, 52, 56, 0.32) !important;
    backdrop-filter: blur(3px);
}

div.swal2-popup {
    width: 440px;
    max-width: calc(100vw - 32px);
    padding: 32px 32px 28px;
    border-radius: 20px !important;
    background: #FFFFFF;
    box-shadow: 0 24px 64px rgba(5, 52, 56, 0.22);
}

.swal2-show {
    animation: gs-swal-in 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gs-swal-in {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: none; }
}

/* 图标：64px 浅色圆底 + 语义色细线图标，替代默认大线框 */
div.swal2-popup .swal2-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border: 0 !important;
    border-radius: 50%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 30px;
}

.swal2-icon .swal2-icon-content,
.swal2-icon [class^=swal2-success-],
.swal2-icon [class^=swal2-x-mark],
.swal2-icon .swal2-success-ring,
.swal2-icon .swal2-success-fix {
    display: none !important;
}

.swal2-icon.swal2-success {
    background-color: var(--gs-fb-success-soft);
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23044B39' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
    box-shadow: 0 0 0 8px rgba(234, 248, 231, 0.55);
}

.swal2-icon.swal2-error {
    background-color: var(--gs-fb-error-soft);
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B42328' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E");
    box-shadow: 0 0 0 8px rgba(253, 232, 232, 0.55);
}

.swal2-icon.swal2-warning {
    background-color: var(--gs-fb-warning-soft);
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A4B00' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
    box-shadow: 0 0 0 8px rgba(253, 239, 217, 0.55);
}

.swal2-icon.swal2-info {
    background-color: var(--gs-fb-info-soft);
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231A62B0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
    box-shadow: 0 0 0 8px rgba(227, 239, 252, 0.55);
}

.swal2-icon.swal2-question {
    background-color: var(--gs-fb-success-soft);
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23044B39' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
    box-shadow: 0 0 0 8px rgba(234, 248, 231, 0.55);
}

div.swal2-popup .swal2-title {
    margin: 0 0 8px;
    padding: 0;
    color: var(--gs-brand-950, #053438);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
}

div.swal2-popup .swal2-html-container {
    margin: 0;
    padding: 0;
    color: var(--gs-text-secondary, #6B6B66);
    font-size: 14px;
    line-height: 1.65;
}

/* 输入框：沿用全站表单规格 */
div.swal2-popup .swal2-input,
div.swal2-popup .swal2-textarea,
div.swal2-popup .swal2-select {
    width: 100%;
    max-width: none;
    height: var(--gs-field-height, 40px);
    margin: 20px 0 0;
    padding: 0 14px;
    border: 1px solid var(--gs-border, #E4E4E0);
    border-radius: 10px;
    box-shadow: none;
    color: var(--gs-ink, #1C1C1C);
    font-size: 14px;
}

div.swal2-popup .swal2-textarea {
    height: auto;
    min-height: 96px;
    padding: 10px 14px;
}

div.swal2-popup .swal2-input:focus,
div.swal2-popup .swal2-textarea:focus,
div.swal2-popup .swal2-select:focus {
    border-color: var(--gs-brand-500, #1EA97B);
    box-shadow: 0 0 0 3px rgba(30, 169, 123, 0.18);
}

.swal2-validation-message {
    margin: 12px 0 0;
    border-radius: 8px;
    background: var(--gs-fb-error-soft);
    color: var(--gs-fb-error);
    font-size: 13px;
}

/* 按钮：等宽并排，主按钮在右 */
div.swal2-popup .swal2-actions {
    flex-direction: row-reverse;
    gap: 12px;
    width: 100%;
    margin: 28px 0 0;
}

.swal2-actions .btn,
.swal2-styled {
    flex: 1 1 0;
    min-width: 0 !important;
    margin: 0 !important;
}

.swal2-actions .btn-outline-danger,
.swal2-styled.swal2-cancel {
    border: 1px solid var(--gs-border, #E4E4E0) !important;
    background: #FFFFFF !important;
    color: var(--gs-ink, #1C1C1C) !important;
}

.swal2-actions .btn-outline-danger:hover:not(:disabled),
.swal2-styled.swal2-cancel:hover {
    background: var(--gs-surface-hover, #F3F3F1) !important;
    color: var(--gs-ink, #1C1C1C) !important;
}

/* 删除类确认：主按钮用危险色 */
.swal2-popup:has(.swal2-icon.swal2-warning) .swal2-confirm {
    border-color: var(--gs-danger-solid, #D63A3F) !important;
    background: var(--gs-danger-solid, #D63A3F) !important;
}

.swal2-popup:has(.swal2-icon.swal2-warning) .swal2-confirm:hover:not(:disabled) {
    border-color: var(--gs-danger-text, #B42328) !important;
    background: var(--gs-danger-text, #B42328) !important;
}

.swal2-timer-progress-bar {
    background: var(--gs-brand-500, #1EA97B);
}

.swal2-close {
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: var(--gs-text-muted, #9A9A94);
    font-size: 26px;
}

.swal2-close:hover {
    background: var(--gs-surface-hover, #F3F3F1);
    color: var(--gs-ink, #1C1C1C);
}

@media (max-width: 575.98px) {
    #toast-container.toast-top-right {
        top: 12px;
        right: 12px;
        left: 12px;
    }

    #toast-container > div {
        width: auto;
    }

    .swal2-popup {
        padding: 24px 20px 20px;
    }
}

/* ==========================================================================
   统一关闭按钮：提示框 / 弹窗 / 模态框
   32px 圆角方块，内部为居中的 SVG ✕（不依赖字体字形，永远居中）；
   模态框关闭按钮收回到卡片内部（主题默认把它移出右上角）
   ========================================================================== */
:root {
    --gs-close-icon: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E");
}

#toast-container .toast .toast-close-button,
div.swal2-popup .swal2-close,
.modal .modal-header .btn-close,
.modal .btn-close {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    background-image: none;
    box-shadow: none;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0;
    opacity: 1;
    text-shadow: none;
    transform: none;
    transition: background-color 0.15s ease !important;
    cursor: pointer;
}

#toast-container .toast .toast-close-button::before,
div.swal2-popup .swal2-close::before,
.modal .modal-header .btn-close::before,
.modal .btn-close::before {
    content: "";
    width: 16px;
    height: 16px;
    background-color: var(--gs-text-muted, #9A9A94);
    -webkit-mask: var(--gs-close-icon) center / contain no-repeat;
    mask: var(--gs-close-icon) center / contain no-repeat;
    transition: background-color 0.15s ease;
}

#toast-container .toast .toast-close-button:hover,
div.swal2-popup .swal2-close:hover,
.modal .modal-header .btn-close:hover,
.modal .btn-close:hover {
    background: var(--gs-surface-hover, #F3F3F1);
}

#toast-container .toast .toast-close-button:hover::before,
div.swal2-popup .swal2-close:hover::before,
.modal .modal-header .btn-close:hover::before,
.modal .btn-close:hover::before {
    background-color: var(--gs-ink, #1C1C1C);
}

#toast-container .toast .toast-close-button:focus-visible,
div.swal2-popup .swal2-close:focus-visible,
.modal .btn-close:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(30, 169, 123, 0.18);
}

/* 位置 */
#toast-container .toast .toast-close-button { top: 10px; right: 10px; }
div.swal2-popup .swal2-close { top: 14px; right: 14px; }
.modal .modal-header { position: relative; }
.modal .modal-header .btn-close,
.modal .modal-header .btn-close:hover,
.modal .modal-header .btn-close:focus,
.modal .modal-header .btn-close:active,
.modal .btn-close { top: calc(50% - 16px); right: 16px; transform: none; box-shadow: none; }
.modal .modal-body > .btn-close,
.modal .modal-content > .btn-close { top: 16px; }
.modal .modal-header .modal-title { padding-right: 40px; }
