/* ==========================================================================
   dm-ui.css — dm-ui.js 配套样式（2026-10-24 补齐，此前该文件缺失导致全站 404）
   覆盖：toast / 进度条 / 按钮忙碌态 / 小屏抽屉导航开关
   深色主题优先，颜色取自课程站 :root 变量（缺省时回退内置深色值）
   ========================================================================== */

/* ---- toast 通知层 ---- */
#dm-toast-layer {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  max-width: min(92vw, 560px);
}
.dm-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--panel, #101a33);
  color: var(--text, #e8eefc);
  border: 1px solid var(--line, rgba(120, 160, 255, .25));
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
  font-size: 14px;
  line-height: 1.55;
  cursor: pointer;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .25s ease, transform .25s ease;
}
.dm-toast.ok   { border-color: rgba(80, 220, 140, .55); }
.dm-toast.warn { border-color: rgba(255, 200, 80, .55); }
.dm-toast.err  { border-color: rgba(255, 90, 110, .6); }
.dm-toast.info { border-color: var(--cyan, rgba(255, 198, 92, .5)); }
.dm-t-icon { flex: 0 0 auto; }
.dm-t-body { min-width: 0; overflow-wrap: anywhere; }
.dm-toast.is-out {
  opacity: 0;
  transform: translateY(10px);
}

/* ---- 数字 + 进度条 ---- */
.dm-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
}
.dm-progress-track {
  flex: 1 1 auto;
  height: 8px;
  border-radius: 99px;
  background: var(--bg2, rgba(120, 160, 255, .15));
  overflow: hidden;
}
.dm-progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: var(--grad, linear-gradient(90deg, #ffc65c, #ff9db0));
  transition: width .5s ease;
}
.dm-progress-text {
  flex: 0 0 auto;
  font-size: 12.5px;
  color: var(--muted, #9fb0d8);
  white-space: nowrap;
}

/* ---- 按钮忙碌态 ---- */
.btn.is-busy,
button.is-busy {
  opacity: .7;
  cursor: progress;
  position: relative;
}
.btn.is-busy::after,
button.is-busy::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  vertical-align: -2px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: dm-spin .8s linear infinite;
}
@keyframes dm-spin { to { transform: rotate(360deg); } }

/* ---- 小屏抽屉导航（dm-ui.js initNavDrawer 注入） ---- */
#dm-nav-toggle { display: none; }
#dm-nav-mask { display: none; }

@media (max-width: 920px) {
  #dm-nav-toggle {
    display: block;
    position: fixed;
    left: 12px;
    bottom: 14px;
    z-index: 9998;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--line, rgba(120, 160, 255, .25));
    background: var(--panel, #101a33);
    color: var(--text, #e8eefc);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
  }
  #dm-nav-mask {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 9997;
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  body.dm-nav-open #dm-nav-mask {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ---- 动效尊重 ---- */
@media (prefers-reduced-motion: reduce) {
  .dm-toast, .dm-toast.is-out, .dm-progress-fill { transition: none; }
  .btn.is-busy::after, button.is-busy::after { animation: none; }
}
