/* 全局加载 / 空 / 错态规范（states.css）
   配合 /static/states.js 使用，统一全站反馈语言与样式。
   覆盖：骨架屏(skeleton)、空状态(empty)、错误态(error)、表单错误聚合、网络重试。
   设计：兼容管理端（深色侧栏+浅色内容）与考生端（浅色），以中性灰蓝为主。 */

/* ===== 骨架屏 ===== */
.wb-skeleton {
  position: relative;
  overflow: hidden;
  background: #e9eef5;
  border-radius: 8px;
}
.wb-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: wb-shimmer 1.2s infinite;
}
@keyframes wb-shimmer { 100% { transform: translateX(100%); } }
.wb-skel-line { height: 12px; margin: 10px 0; border-radius: 6px; background: #e2e8f0; }
.wb-skel-circle { width: 52px; height: 52px; border-radius: 50%; background: #e2e8f0; flex: none; }
.wb-skel-card {
  background: #fff; border: 1px solid #eef2f7; border-radius: 14px;
  padding: 16px; margin-bottom: 12px;
}

/* ===== 空状态 ===== */
.wb-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 48px 20px; color: #64748b;
}
.wb-empty .wb-empty-ic {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #f1f5f9; color: #cbd5e1; font-size: 30px; margin-bottom: 16px;
}
.wb-empty .wb-empty-title { font-size: 15px; font-weight: 600; color: #334155; margin-bottom: 6px; }
.wb-empty .wb-empty-desc { font-size: 13px; color: #94a3b8; margin-bottom: 18px; max-width: 380px; line-height: 1.6; }
.wb-empty .wb-empty-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ===== 错误态 ===== */
.wb-error-panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 20px; color: #b91c1c;
}
.wb-error-panel .wb-err-ic {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #fef2f2; color: #dc2626; font-size: 30px; margin-bottom: 16px;
}
.wb-error-panel .wb-err-title { font-size: 15px; font-weight: 600; color: #991b1b; margin-bottom: 6px; }
.wb-error-panel .wb-err-desc { font-size: 13px; color: #b91c1c; margin-bottom: 18px; max-width: 380px; line-height: 1.6; }

/* ===== 重试按钮 ===== */
.wb-retry-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 10px;
  background: #1a56db; color: #fff; font-size: 13px; border: none; cursor: pointer;
  transition: background 0.2s ease;
}
.wb-retry-btn:hover { background: #1648b8; }
.wb-retry-btn i { font-size: 13px; }

/* ===== 表单级错误聚合 ===== */
.wb-form-errors {
  display: none;
  background: #fef2f2; border: 1px solid #fecaca; border-left: 4px solid #dc2626;
  border-radius: 10px; padding: 12px 14px; margin-bottom: 18px;
}
.wb-form-errors.show { display: block; }
.wb-form-errors .wb-fe-title {
  font-size: 13px; font-weight: 600; color: #b91c1c; display: flex; align-items: center; gap: 6px;
}
.wb-form-errors ul { margin: 8px 0 0; padding-left: 18px; }
.wb-form-errors li { font-size: 13px; color: #b91c1c; margin: 3px 0; cursor: pointer; }
.wb-form-errors li:hover { text-decoration: underline; }
.wb-field-error { color: #dc2626; font-size: 12px; margin-top: 4px; display: block; }
.wb-input-error { border-color: #dc2626 !important; box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.12); }

/* ===== 友好错误页（404/500，自包含样式兜底） ===== */
.wb-error-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 50%, #eef2ff 100%);
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif; padding: 20px;
}
.wb-error-page .wb-ep-box {
  text-align: center; background: #fff; border-radius: 20px; padding: 48px 40px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12); max-width: 460px; width: 100%;
}
.wb-error-page .wb-ep-code {
  font-size: 64px; font-weight: 800; color: #1a56db; line-height: 1; margin-bottom: 8px;
}
.wb-error-page .wb-ep-title { font-size: 18px; font-weight: 700; color: #1e293b; margin-bottom: 10px; }
.wb-error-page .wb-ep-desc { font-size: 13px; color: #64748b; line-height: 1.7; margin-bottom: 24px; }
.wb-error-page .wb-ep-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.wb-error-page .wb-ep-btn {
  padding: 10px 20px; border-radius: 10px; font-size: 13px; text-decoration: none; cursor: pointer; border: none;
}
.wb-error-page .wb-ep-btn.primary { background: #1a56db; color: #fff; }
.wb-error-page .wb-ep-btn.primary:hover { background: #1648b8; }
.wb-error-page .wb-ep-btn.outline { background: #fff; color: #475569; border: 1px solid #cbd5e1; }
.wb-error-page .wb-ep-btn.outline:hover { background: #f8fafc; }

/* ===== 分步向导 (F8.1) ===== */
/* 步骤指示器：对齐 admin.css 设计系统令牌（政务蓝 #2563eb、圆角 8px、灰阶） */
.wb-steps { display: flex; align-items: flex-start; gap: 0; margin: 0 0 22px; }
.wb-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; text-align: center; }
.wb-step .dot { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: #e2e8f0; color: #64748b; transition: all .2s; z-index: 1; }
.wb-step.active .dot { background: #2563eb; color: #fff; box-shadow: 0 0 0 4px rgba(37, 99, 235, .15); }
.wb-step.done .dot { background: #16a34a; color: #fff; }
.wb-step .lab { font-size: 12px; color: #94a3b8; }
.wb-step.active .lab { color: #2563eb; font-weight: 600; }
.wb-step:not(:last-child)::after { content: ""; position: absolute; top: 14px; left: 50%; width: 100%; height: 2px; background: #e2e8f0; z-index: 0; }
.wb-step.done:not(:last-child)::after { background: #16a34a; }
.wstep { display: none; }
.wstep.active { display: block; }
.wb-wizard-nav { flex-wrap: wrap; }

/* 报名表单移动端：上传材料 3 列栅格由模板响应式断点控制（grid-cols-1 sm:2 md:3），此处保留旧类兜底 */
#enrollForm .grid.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) {
    #enrollForm .grid.grid-cols-3 { grid-template-columns: 1fr; }

    /* 12 列栅格（家庭成员 / 学习经历 / 工作经历）在窄屏折叠为单列，避免横向溢出 */
    #enrollForm .grid.grid-cols-12 { grid-template-columns: 1fr; }
    #enrollForm .grid.grid-cols-12 > [class*="col-span-"] { grid-column: 1 / -1 !important; }
    /* 学习 / 工作经历列标题在窄屏下无意义且占空间，隐藏 */
    #eduFields > .grid:first-child,
    #workFields > .grid:first-child { display: none; }

    /* 向导导航按钮窄屏全宽堆叠，主操作（下一步 / 提交）自然落在底部拇指区 */
    .wb-wizard-nav { flex-direction: column; }
    .wb-wizard-nav > a,
    .wb-wizard-nav > button { width: 100%; text-align: center; }

    /* 报名卡片窄屏减小内边距，给内容更多横向空间 */
    #enrollCard { padding: 16px !important; }
    .max-w-4xl.mx-auto { padding-left: 12px !important; padding-right: 12px !important; }

    .wb-steps { flex-direction: column; gap: 0; }
    .wb-step { flex-direction: row; justify-content: flex-start; gap: 10px; margin-bottom: 10px; }
    .wb-step:not(:last-child)::after { display: none; }
    .wb-step .lab { font-size: 13px; }
}
