/* ========== Grounded Toast 扁平化通知组件 ========== */

/* 半透明背景遮罩 */
.gt-toast-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 99998;
    animation: gtFadeIn 0.25s ease;
    pointer-events: auto;
}

.gt-toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    width: auto;
    max-width: 90vw;
}

.gt-toast {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    color: #333;
    line-height: 1.5;
    pointer-events: auto;
    animation: gtSlideDown 0.3s cubic-bezier(0.21, 1.02, 0.73, 1);
    transition: opacity 0.25s ease, transform 0.25s ease;
    border: 1px solid #eeeeee;
}

.gt-toast.gt-hiding {
    opacity: 0;
    transform: scale(0.9);
}

.gt-toast-icon {
    display: none;
}

.gt-toast-success,
.gt-toast-error,
.gt-toast-warning,
.gt-toast-info {
    border: 1px solid #e0e0e0;
}

.gt-toast-msg {
    flex: 1;
    word-break: break-word;
}

.gt-toast-close {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    color: #999;
    transition: background 0.2s;
    margin-left: 6px;
    line-height: 1;
}
.gt-toast-close:hover { background: #f0f0f0; color: #333; }

/* 加载遮罩 */
.gt-loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.75);
}

.gt-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e8e8e8;
    border-top-color: #1890ff;
    border-radius: 50%;
    animation: gtSpin 0.8s linear infinite;
}

/* tooltip */
.gt-tooltip {
    position: absolute;
    z-index: 100000;
    padding: 6px 12px;
    background: #fff;
    color: #ff4d4f;
    font-size: 13px;
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    white-space: nowrap;
    pointer-events: none;
    animation: gtSlideDown 0.2s ease;
}
.gt-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #fff;
}

/* 确认对话框 */
.gt-confirm-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    animation: gtFadeIn 0.2s ease;
}

.gt-confirm-box {
    background: #fff;
    border-radius: 12px;
    padding: 28px 24px 20px;
    width: 90vw;
    max-width: 380px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
    animation: gtScaleIn 0.2s cubic-bezier(0.21, 1.02, 0.73, 1);
}

.gt-confirm-title {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin-bottom: 10px;
}

.gt-confirm-body {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 24px;
}

.gt-confirm-btns {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.gt-btn {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    outline: none;
    transition: opacity 0.2s;
}
.gt-btn:hover { opacity: 0.85; }
.gt-btn-cancel {
    background: #f5f5f5;
    color: #666;
}
.gt-btn-confirm {
    background: #1890ff;
    color: #fff;
}

/* 模态窗口 */
.gt-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.45);
    animation: gtFadeIn 0.2s ease;
}

.gt-modal-box {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    width: 90vw;
    max-width: 500px;
    max-height: 80vh;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
    animation: gtScaleIn 0.2s cubic-bezier(0.21, 1.02, 0.73, 1);
    display: flex;
    flex-direction: column;
}

.gt-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}
.gt-modal-title { font-size: 16px; font-weight: 600; color: #222; }
.gt-modal-close {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border-radius: 50%;
    font-size: 18px; color: #999;
}
.gt-modal-close:hover { background: #f5f5f5; color: #333; }

.gt-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}
.gt-modal-body p { margin: 0 0 10px; }
.gt-modal-body p:last-child { margin-bottom: 0; }

/* prompt 输入框 */
.gt-modal-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}
.gt-modal-input:focus { border-color: #1890ff; }

/* 动画 */
@keyframes gtSlideDown {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes gtFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes gtScaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes gtSpin {
    to { transform: rotate(360deg); }
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
    .gt-toast-container {
        max-width: 85vw;
    }
    .gt-toast {
        min-width: 0;
        font-size: 13px;
        padding: 12px 16px;
    }
    .gt-toast-icon {
        width: 20px;
        height: 20px;
        font-size: 11px;
    }
    .gt-confirm-box {
        width: 85vw;
        padding: 24px 18px 18px;
    }
    .gt-confirm-btns { gap: 10px; }
    .gt-btn { padding: 8px 16px; font-size: 13px; }
    .gt-modal-box { width: 92vw; max-height: 85vh; }
    .gt-modal-header { padding: 14px 16px; }
    .gt-modal-body { padding: 16px; }
}
