/* ===== 深色模式 ===== */
html.dark body { background-color: #0f172a !important; color: #e2e8f0 !important; }
html.dark .sidebar { background: #1e293b !important; border-color: #334155 !important; }
html.dark .card,
html.dark header,
html.dark aside { background: #1e293b !important; border-color: #334155 !important; }
html.dark .bg-white { background: #1e293b !important; }
html.dark .bg-slate-50 { background: #0f172a !important; }
html.dark .border-slate-100 { border-color: #334155 !important; }
html.dark .text-slate-800 { color: #f1f5f9 !important; }
html.dark .text-slate-700 { color: #e2e8f0 !important; }
html.dark .text-slate-600 { color: #cbd5e1 !important; }
html.dark .text-slate-400 { color: #94a3b8 !important; }
html.dark .text-slate-300 { color: #64748b !important; }
html.dark .border-slate-50 { border-color: #1e293b !important; }
html.dark .bg-\[\#F3F7FF\] { background: #0f172a !important; }
html.dark .bg-\[\#EEF2FF\] { background: #312e81 !important; }
html.dark select,
html.dark textarea { background: #0f172a !important; color: #e2e8f0 !important; border-color: #334155 !important; }
html.dark .sidebar-item-active { background: linear-gradient(90deg,#1e1b4b 0%,#1e293b 100%) !important; }
html.dark .confirm-dialog .box,
html.dark .modal-card { background: #1e293b !important; }
html.dark .confirm-dialog .box p { color: #e2e8f0 !important; }
html.dark .btn-cancel { background: #334155 !important; color: #cbd5e1 !important; }

/* ===== 全站统一主题样式 ===== */

/* 自定义滚动条 */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c7d2fe; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #818cf8; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* Toast 通知 */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 500;
  color: white;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  animation: toast-in 0.25s ease;
  max-width: 320px;
}
.toast.success { background: #4f46e5; }
.toast.error   { background: #ef4444; }
.toast.warn    { background: #f59e0b; }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* 统一弹窗遮罩 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fade-in 0.2s ease;
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 弹窗卡片 */
.modal-card {
  background: white;
  border-radius: 24px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.12);
  width: 100%;
  max-width: 480px;
  animation: modal-up 0.25s ease;
}
@keyframes modal-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 弹窗头部 */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}
.modal-header h3 { font-size: 15px; font-weight: 700; color: #1e293b; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.modal-close:hover { background: #e2e8f0; }
.modal-body { padding: 20px 24px 24px; }

/* 统一输入框 focus */
.input-focus:focus-within {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

/* 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}


/* 响应式侧边栏 */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.08);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.4);
    z-index: 199;
  }
  .sidebar-overlay.open { display: block; }
  .menu-btn { display: flex !important; }
}
.menu-btn { display: none; }

/* 确认对话框 */
.confirm-dialog {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(15,23,42,0.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  animation: fade-in 0.15s ease;
}
.confirm-dialog .box {
  background: white; border-radius: 20px; padding: 28px 24px 20px;
  max-width: 320px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: modal-up 0.2s ease;
}
.confirm-dialog .box p { font-size: 14px; color: #334155; margin-bottom: 20px; font-weight: 500; }
.confirm-dialog .box .btns { display: flex; gap: 8px; }
.confirm-dialog .box .btns button { flex: 1; padding: 10px; border-radius: 12px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; transition: opacity .2s; }
.confirm-dialog .box .btns .btn-cancel { background: #f1f5f9; color: #64748b; }
.confirm-dialog .box .btns .btn-ok { background: #6366f1; color: white; }
.confirm-dialog .box .btns .btn-ok.danger { background: #ef4444; }
.confirm-dialog .box .btns button:hover { opacity: 0.85; }
