/* StuLink · 统一对话框（2026-11-01）
   用户口径：所有通知 / 弹窗都不许用浏览器自带的 alert/confirm/prompt，
   要自定义并全站统一。样式语言对齐项目现有卡片（浅灰底 + 白卡 + 大圆角 +
   --sl-* 主题变量），深色自动跟随，不写死颜色。
   JS 侧见 static/js/sl_dialog.js（window.slAlert / slConfirm / slPrompt）。 */

.sl-dlg-mask {
    position: fixed; inset: 0; z-index: 9990;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .38);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    opacity: 0; transition: opacity .18s ease;
}
.sl-dlg-mask.on { opacity: 1; }

.sl-dlg {
    width: min(440px, 100%);
    max-height: calc(100vh - 40px); overflow: auto;
    background: var(--sl-surface, #fff);
    color: var(--sl-text, #0f172a);
    border: 1px solid var(--sl-border, #e2e8f0);
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, .26);
    padding: 22px 22px 16px;
    opacity: 0; transform: scale(.96) translateY(8px);
    transition: transform .2s cubic-bezier(.32, .72, 0, 1), opacity .18s ease;
}
.sl-dlg-mask.on .sl-dlg { opacity: 1; transform: none; }

.sl-dlg-title {
    font-size: 15.5px; font-weight: 600; line-height: 1.4;
    margin: 0 0 8px;
}
.sl-dlg-msg {
    font-size: 14px; line-height: 1.65;
    color: var(--sl-text-muted, #475569);
    white-space: pre-wrap; word-break: break-word;
}
.sl-dlg-msg:only-child { margin: 2px 0 0; }

.sl-dlg-input {
    display: block; width: 100%; margin-top: 12px;
    padding: 9px 12px; font-size: 14px; line-height: 1.5;
    color: inherit; background: var(--sl-surface-2, #f8fafc);
    border: 1px solid var(--sl-border, #e2e8f0); border-radius: 10px;
    outline: none; resize: vertical;
}
.sl-dlg-input:focus {
    border-color: var(--bs-primary, #0d6efd);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .16);
}

.sl-dlg-actions {
    display: flex; justify-content: flex-end; gap: 10px;
    margin-top: 20px;
}
.sl-dlg-btn {
    border: 0; border-radius: 10px; padding: 8px 18px;
    font-size: 14px; font-weight: 500; line-height: 1.5;
    cursor: pointer; transition: filter .12s ease, transform .06s ease;
}
.sl-dlg-btn:active { transform: scale(.98); }
/* 聚焦环用柔和 box-shadow 且跟随按钮语义色（原来 outline 蓝环套在红按钮上很跳） */
.sl-dlg-btn:focus-visible {
    outline: none; box-shadow: 0 0 0 3px rgba(13, 110, 253, .26);
}
.sl-dlg-btn.danger:focus-visible { box-shadow: 0 0 0 3px rgba(220, 53, 69, .30); }
.sl-dlg-btn.ghost:focus-visible { box-shadow: 0 0 0 3px rgba(100, 116, 139, .26); }
.sl-dlg-btn.ghost {
    background: var(--sl-surface-2, #f1f5f9); color: var(--sl-text, #0f172a);
}
.sl-dlg-btn.ghost:hover { filter: brightness(.96); }
.sl-dlg-btn.primary { background: var(--bs-primary, #0d6efd); color: #fff; }
.sl-dlg-btn.primary:hover { filter: brightness(1.07); }
.sl-dlg-btn.danger { background: #dc3545; color: #fff; }
.sl-dlg-btn.danger:hover { filter: brightness(1.07); }

/* 减少动态效果：只保留淡入 */
@media (prefers-reduced-motion: reduce) {
    .sl-dlg { transform: none; }
}
/* 窄屏：贴底更顺手（iOS 风格） */
@media (max-width: 480px) {
    .sl-dlg-mask { align-items: flex-end; padding: 0; }
    .sl-dlg {
        width: 100%; border-radius: 18px 18px 0 0;
        padding: 20px 18px calc(16px + env(safe-area-inset-bottom));
    }
}
@media print { .sl-dlg-mask { display: none !important; } }
