/* =====================================================
   mf-toast.css - 弹窗组件样式
   通知 toast -> 右上角
   确认弹窗   -> 居中 + 遮罩
   ===================================================== */
/* 右上角 toast 容器 */
.mf-toast-container{
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 360px;
}
/* 右上角 toast 通知 */
.mf-toast{
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 34px -8px rgba(15,23,42,.28);
  border: 1px solid #eef2f7;
  padding: 12px 16px;
  transform: translateX(120%);
  opacity: 0;
  transition: transform .5s cubic-bezier(.16,1,.3,1), opacity .5s ease, filter .5s ease;
}
.mf-toast-in{ transform: translateX(0); opacity: 1; }
.mf-toast-out{
  transform: translateX(80%) scale(.92);
  opacity: 0;
  filter: blur(2px);
}
.mf-toast-icon{
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.mf-toast-icon svg{ width: 18px; height: 18px; }
.mf-toast-text{
  font-size: 14px;
  color: #1e293b;
  line-height: 1.45;
  font-weight: 500;
}
.mf-toast-success .mf-toast-icon{ background: linear-gradient(135deg,#10b981,#059669); }
.mf-toast-error{ background: linear-gradient(135deg,#ef4444,#dc2626); border-color: #ef4444; }
.mf-toast-error .mf-toast-icon{ background: rgba(255,255,255,.22); }
.mf-toast-error .mf-toast-text{ color: #fff; }
.mf-toast-info .mf-toast-icon{ background: linear-gradient(135deg,#3b82f6,#2563eb); }
.mf-toast-loading .mf-toast-icon{ background: linear-gradient(135deg,#3b82f6,#6366f1); }
.mf-toast-spin{ animation: mf-toast-rotate 1s linear infinite; }
@keyframes mf-toast-rotate{ to{ transform: rotate(360deg); } }

/* ============ 居中确认弹窗（带遮罩） ============ */
.mf-toast-mask{
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 999998;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  opacity: 0;
  transition: opacity .25s ease;
}
.mf-toast-mask.mf-mask-in{ opacity: 1; }
.mf-toast-confirm{
  pointer-events: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 60px -16px rgba(15,23,42,.5);
  border: 1px solid #eef2f7;
  width: 400px;
  max-width: 92vw;
  overflow: hidden;
  transform: translateY(24px) scale(.97);
  opacity: 0;
  transition: transform .28s cubic-bezier(.16,1,.3,1), opacity .28s ease;
}
.mf-toast-confirm.mf-toast-in{ transform: translateY(0) scale(1); opacity: 1; }
.mf-tc-title{
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  padding: 18px 20px 0;
}
.mf-tc-title::before{
  content: '';
  width: 4px;
  height: 18px;
  border-radius: 3px;
  background: linear-gradient(135deg,#165DFF,#00B4FF);
  margin-right: 10px;
}
.mf-tc-title span{ flex: 1; }
.mf-tc-close{
  cursor: pointer;
  color: #94a3b8;
  font-size: 20px;
  line-height: 1;
  font-weight: 400;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all .2s ease;
  flex: 0 0 auto;
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
}
.mf-tc-close:hover{ background:#f1f5f9; color:#475569; }
.mf-tc-body{ padding: 12px 20px 0; }
.mf-tc-text{
  font-size: 14px;
  color: #475569;
  line-height: 1.65;
  margin: 0;
}
.mf-tc-btns{
  display: flex;
  gap: 12px;
  padding: 20px;
}
.mf-tc-btn{
  flex: 1;
  padding: 10px 0;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .22s ease;
  background: #f1f5f9;
  color: #64748b;
}
.mf-tc-btn:hover{ background:#e2e8f0; }
.mf-tc-btn-primary{
  background: linear-gradient(135deg,#165DFF,#0F4CD0);
  color: #fff;
  box-shadow: 0 6px 18px -6px rgba(22,93,255,.5);
}
.mf-tc-btn-primary:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -6px rgba(22,93,255,.6);
  background: linear-gradient(135deg,#165DFF,#0F4CD0);
}
/* 移动端适配 */
@media (max-width: 520px){
  .mf-toast-container{ top: 12px; right: 12px; left: 12px; max-width: none; }
  .mf-toast-confirm{ width: 100%; }
}

.mf-tc-input{
  width: 100%;
  padding: 11px 14px;
  margin-top: 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  color: #1e293b;
  background: #f8fafc;
  transition: all .2s ease;
  outline: none;
  box-sizing: border-box;
}
.mf-tc-input:focus{
  border-color: #165DFF;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(22,93,255,.12);
}
.mf-tc-tip{
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.6;
  margin: 8px 0 0;
  min-height: 16px;
}
.mf-tc-tip.ok{ color: #10b981; }
.mf-tc-tip.err{ color: #dc2626; }
[data-theme="dark"] .mf-tc-input{
  background: #1a1d24 !important;
  border-color: #2a2f3a !important;
  color: #e5e7eb !important;
}
[data-theme="dark"] .mf-tc-input:focus{
  background: #1a1d24 !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 4px rgba(59,130,246,0.2) !important;
}

/* ===== 美化版 prompt 弹窗（设置密码） ===== */
.mf-prompt-card{ background:#fff; }
.mf-prompt-head{
  position: relative;
  text-align: center;
  padding: 26px 22px 18px;
  background: linear-gradient(135deg,#eef2ff 0%,#fdf4ff 55%,#ecfeff 100%);
  border-bottom: 1px solid #eef2f7;
}
.mf-prompt-ico{
  width: 62px; height: 62px;
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg,#165DFF,#6366f1);
  color: #fff;
  box-shadow: 0 10px 24px -8px rgba(99,102,241,.6);
}
.mf-prompt-ico svg{ width: 28px; height: 28px; }
.mf-prompt-title{
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}
.mf-prompt-sub{
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
  margin-top: 6px;
}
.mf-prompt-body{ padding: 20px 22px 0; }
.mf-prompt-input{
  width: 100%;
  padding: 13px 15px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 15px;
  color: #1e293b;
  background: #f8fafc;
  transition: all .22s ease;
  outline: none;
  box-sizing: border-box;
  letter-spacing: 2px;
  text-align: center;
}
.mf-prompt-input::placeholder{ letter-spacing: 0; color:#94a3b8; }
.mf-prompt-input:focus{
  border-color: #165DFF;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(22,93,255,.12);
}
.mf-prompt-tip{
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.6;
  margin: 10px 0 0;
  min-height: 16px;
  text-align: center;
}
.mf-prompt-tip.ok{ color: #10b981; }
.mf-prompt-tip.err{ color: #dc2626; }
.mf-prompt-btns{
  display: flex;
  gap: 12px;
  padding: 20px 22px 22px;
}
.mf-prompt-btn{
  flex: 1;
  padding: 12px 0;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .22s ease;
  background: #f1f5f9;
  color: #64748b;
}
.mf-prompt-btn:hover{ background:#e2e8f0; }
.mf-prompt-btn-primary{
  background: linear-gradient(135deg,#165DFF,#0F4CD0);
  color: #fff;
  box-shadow: 0 8px 22px -8px rgba(22,93,255,.55);
}
.mf-prompt-btn-primary:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -8px rgba(22,93,255,.65);
  background: linear-gradient(135deg,#165DFF,#0F4CD0);
}
/* 深色模式 */
[data-theme="dark"] .mf-prompt-card{ background:#161a23 !important; }
[data-theme="dark"] .mf-prompt-head{
  background: linear-gradient(135deg,#1e2a45 0%,#2a2440 55%,#16303a 100%) !important;
  border-bottom-color:#2a2f3a !important;
}
[data-theme="dark"] .mf-prompt-title{ color:#f1f5f9 !important; }
[data-theme="dark"] .mf-prompt-sub{ color:#94a3b8 !important; }
[data-theme="dark"] .mf-prompt-input{
  background:#1a1d24 !important;
  border-color:#2a2f3a !important;
  color:#e5e7eb !important;
}
[data-theme="dark"] .mf-prompt-input:focus{
  background:#1a1d24 !important;
  border-color:#3b82f6 !important;
  box-shadow:0 0 0 4px rgba(59,130,246,.22) !important;
}
[data-theme="dark"] .mf-prompt-btn{ background:#2a2f3a !important; color:#a1a1aa !important; }
[data-theme="dark"] .mf-prompt-btn:hover{ background:#333a47 !important; }


/* ---- 文件分享弹窗行样式（与 mf-prompt 风格统一） ---- */
.mf-share-row{
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}
.mf-share-row:first-child{ padding-top: 0; }
.mf-share-label{
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 3px;
}
.mf-share-value{
  font-size: 14px;
  color: #0f172a;
  font-weight: 500;
  word-break: break-all;
  line-height: 1.5;
}
[data-theme="dark"] .mf-share-row{ border-bottom-color: #2a2f3a; }
[data-theme="dark"] .mf-share-label{ color: #64748b; }
[data-theme="dark"] .mf-share-value{ color: #e2e8f0; }


/* ---- 通用表单弹窗（mfToast.form，复刻 prompt 渐变头样式） ---- */
.mf-form-card{ background:#fff; }
.mf-form-body{ padding: 18px 22px 4px; max-height: 60vh; overflow-y:auto; }
.mf-form-grid{display:flex;flex-wrap:wrap;gap:0 16px;margin-bottom:0;}
.mf-form-grid .mf-form-field{flex:1 1 calc(50% - 8px);min-width:0;}
.mf-form-field{ margin-bottom: 15px; }
.mf-form-label{
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}
.mf-form-input{
  width: 100%;
  padding: 11px 13px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px;
  color: #1e293b;
  background: #f8fafc;
  transition: all .22s ease;
  outline: none;
  box-sizing: border-box;
}
.mf-form-input::placeholder{ color:#94a3b8; }
.mf-form-input:focus{
  border-color: #165DFF;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(22,93,255,.12);
}
.mf-form-select{ background:#fff; cursor:pointer; }
.mf-form-textarea{ min-height: 80px; resize: vertical; font-family:inherit; }
/* 开关 */
.mf-form-switch{
  width: auto;
  max-width: 100px;
  padding: 4px 6px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.mf-form-switch:focus{ border:none; box-shadow:none; }
.mf-switch-track{
  display: inline-flex;
  align-items: center;
  width: 46px;
  height: 24px;
  border-radius: 12px;
  background: #d1d5db;
  position: relative;
  transition: background .25s ease;
  flex: 0 0 auto;
}
.mf-switch-knob{
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
  position: absolute;
  top: 3px;
  left: 3px;
  transition: left .25s ease;
}
.mf-form-switch.on .mf-switch-track{ background: #165DFF; }
.mf-form-switch.on .mf-switch-knob{ left: 25px; }
[data-theme="dark"] .mf-form-switch{ background: transparent !important; }
[data-theme="dark"] .mf-switch-track{ background: #3a4250; }
[data-theme="dark"] .mf-switch-knob{ background: #e5e7eb; }
[data-theme="dark"] .mf-form-switch.on .mf-switch-track{ background: #2563eb; }
.mf-form-hint{
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.5;
  margin: 5px 0 0;
}
[data-theme="dark"] .mf-form-card{ background:#161a23 !important; }
[data-theme="dark"] .mf-form-label{ color:#cbd5e1 !important; }
[data-theme="dark"] .mf-form-input{
  background:#1a1d24 !important;
  border-color:#2a2f3a !important;
  color:#e5e7eb !important;
}
[data-theme="dark"] .mf-form-input:focus{
  background:#1a1d24 !important;
  border-color:#3b82f6 !important;
  box-shadow:0 0 0 4px rgba(59,130,246,.22) !important;
}
[data-theme="dark"] .mf-form-hint{ color:#64748b !important; }
