/**
 * 会员端 / 后台代录 — 入会申请向导
 */
:root {
  --wiz-accent: #1668dc;
  --wiz-accent-soft: #eff6ff;
  --wiz-accent-deep: #0958d9;
  --wiz-ink: #0f172a;
  --wiz-muted: #64748b;
  --wiz-line: #e2e8f0;
  --wiz-surface: #ffffff;
  --wiz-radius: 16px;
  --wiz-font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

/* 会员端：长页顶对齐 */
body.portal-page.portal-auth.portal-wizard {
  align-items: flex-start;
  padding: 28px 16px 40px;
}

body.portal-page.portal-auth .portal-auth-outer--wizard {
  max-width: 1060px;
}

.wizard-shell {
  width: 100%;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.04),
    0 28px 64px -20px rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.wizard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--wiz-line);
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.wizard-back {
  font-size: 13px;
  color: var(--wiz-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.wizard-back:hover {
  color: var(--wiz-accent);
}

.wizard-topbar-tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--wiz-accent-deep);
  background: var(--wiz-accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
}

.portal-apply-wizard {
  font-family: var(--wiz-font);
  padding: 0 0 8px;
}

/* Hero */
.wizard-hero {
  display: flex;
  gap: 24px;
  align-items: stretch;
  padding: 24px 26px 20px;
  background:
    radial-gradient(ellipse 80% 120% at 0% 0%, rgba(22, 104, 220, 0.08), transparent 55%),
    linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border-bottom: 1px solid var(--wiz-line);
}

.wizard-eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
}

.wizard-title {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--wiz-ink);
  letter-spacing: -0.02em;
}

.wizard-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 13px;
  color: var(--wiz-muted);
}

.wizard-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wizard-meta-item::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #cbd5e1;
}

.wizard-meta-item:first-child::before {
  display: none;
}

.wizard-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.wizard-status-pill--draft {
  color: #b45309;
  background: #fef3c7;
}

.wizard-status-pill--pending {
  color: #1d4ed8;
  background: #dbeafe;
}

.wizard-status-pill--rejected {
  color: #b91c1c;
  background: #fee2e2;
}

.wizard-hero-main {
  flex: 1;
  min-width: 0;
}

.wizard-progress-card {
  flex: 0 0 220px;
  background: var(--wiz-surface);
  border: 1px solid var(--wiz-line);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.wizard-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--wiz-muted);
  margin-bottom: 10px;
}

.wizard-progress-head strong {
  font-size: 14px;
  color: var(--wiz-accent-deep);
}

.wizard-progress-track {
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.wizard-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--wiz-accent) 0%, #38bdf8 100%);
  transition: width 0.35s ease;
}

/* Banners */
.wizard-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 16px 22px 0;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
  border: 1px solid transparent;
}

.wizard-banner-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
}

.wizard-banner--info {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.wizard-banner--info .wizard-banner-icon {
  background: #fef3c7;
  color: #b45309;
}

.wizard-banner--warn {
  background: #fff7ed;
  border-color: #fdba74;
  color: #9a3412;
}

.wizard-banner--warn .wizard-banner-icon {
  background: #ffedd5;
  color: #c2410c;
}

.wizard-banner--danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.wizard-banner--danger .wizard-banner-icon {
  background: #fee2e2;
  color: #b91c1c;
}

/* Layout */
.wizard-layout {
  display: flex;
  gap: 0;
  align-items: stretch;
  min-height: 420px;
}

.wizard-sidebar {
  flex: 0 0 248px;
  border-right: 1px solid var(--wiz-line);
  background: #fafbfc;
  padding: 18px 14px 22px;
}

.wizard-sidebar-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 0 10px 12px;
}

.wizard-steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.wizard-steps .wizard-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 10px;
  margin-bottom: 4px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  position: relative;
}

.wizard-steps .wizard-step-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 21px;
  top: 38px;
  bottom: -8px;
  width: 2px;
  background: #e2e8f0;
  border-radius: 1px;
}

.wizard-steps .wizard-step-item.done:not(:last-child)::after {
  background: #86efac;
}

.wizard-steps .wizard-step-item:hover:not(.locked) {
  background: rgba(255, 255, 255, 0.85);
}

.wizard-steps .wizard-step-item.active {
  background: #fff;
  box-shadow: 0 2px 12px rgba(22, 104, 220, 0.1);
}

.wizard-steps .wizard-step-item.locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.step-marker {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  background: #fff;
  border: 2px solid #e2e8f0;
  position: relative;
  z-index: 1;
  transition: all 0.2s;
}

.wizard-step-item.active .step-marker {
  color: #fff;
  background: var(--wiz-accent);
  border-color: var(--wiz-accent);
  box-shadow: 0 0 0 4px rgba(22, 104, 220, 0.15);
}

.wizard-step-item.done .step-marker {
  color: #fff;
  background: #16a34a;
  border-color: #16a34a;
}

.wizard-step-item.done .step-num {
  display: none;
}

.wizard-step-item.done .step-check {
  display: block;
}

.step-check {
  display: none;
  font-size: 13px;
  line-height: 1;
}

.step-label {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.step-label-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  line-height: 1.35;
}

.wizard-step-item.active .step-label-title {
  color: var(--wiz-accent-deep);
}

.wizard-step-item.done .step-label-title {
  color: #15803d;
}

.step-label-kind {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #94a3b8;
}

/* Main panel */
.wizard-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 26px 24px;
  background: #fff;
}

.wizard-panel {
  flex: 1;
}

.wizard-panel .step-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--wiz-ink);
  letter-spacing: -0.02em;
}

.wizard-panel .step-subtitle {
  color: var(--wiz-muted);
  font-size: 14px;
  margin-bottom: 18px;
  line-height: 1.5;
}

.wizard-panel .step-hint {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid var(--wiz-line);
  border-left: 3px solid var(--wiz-accent);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: #475569;
  line-height: 1.55;
  margin-bottom: 20px;
}

.wizard-panel .step-hint--warn {
  border-left-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #92400e;
}

.wizard-panel .section-title {
  font-size: 13px;
  font-weight: 700;
  margin: 22px 0 12px;
  padding: 0 0 8px;
  color: #475569;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wizard-panel .section-title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--wiz-accent);
}

.wizard-panel .section-title:first-child {
  margin-top: 0;
}

/* Form polish */
.portal-apply-wizard .layui-form-item {
  margin-bottom: 16px;
}

.portal-apply-wizard .layui-form-label {
  width: 120px;
  padding: 9px 12px 9px 0;
  color: #475569;
  font-size: 13px;
}

.portal-apply-wizard .layui-input-block {
  margin-left: 132px;
  min-height: 38px;
}

.portal-apply-wizard .layui-input,
.portal-apply-wizard .layui-textarea,
.portal-apply-wizard select.layui-input {
  border-radius: 10px;
  border-color: #e2e8f0;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.portal-apply-wizard .layui-input:focus,
.portal-apply-wizard .layui-textarea:focus {
  border-color: var(--wiz-accent) !important;
  box-shadow: 0 0 0 3px rgba(22, 104, 220, 0.12);
}

.portal-apply-wizard .field-req {
  color: #ef4444;
  margin-left: 2px;
}

.portal-apply-wizard .field-hint {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 6px;
  line-height: 1.45;
}

.portal-apply-wizard .file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: #475569;
  margin-top: 8px;
}

.portal-apply-wizard .dynamic-block {
  margin-top: 8px;
  padding: 14px;
  background: #fafbfc;
  border: 1px solid var(--wiz-line);
  border-radius: 12px;
}

.portal-apply-wizard .block-add-form {
  background: #fff !important;
  border-color: #cbd5e1 !important;
  border-radius: 10px !important;
}

/* Tables */
.portal-apply-wizard .person-table,
.portal-apply-wizard .block-table {
  border-radius: 10px;
  overflow: hidden;
}

.portal-apply-wizard .layui-table {
  margin: 0;
}

.portal-apply-wizard .layui-table thead th {
  background: #f8fafc;
  font-weight: 600;
  font-size: 12px;
  color: #64748b;
}

/* Actions */
.wizard-actions {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.wizard-actions .layui-btn {
  border-radius: 10px;
  height: 40px;
  line-height: 40px;
  padding: 0 20px;
  font-size: 14px;
}

.wizard-actions .layui-btn:not(.layui-btn-primary) {
  background: var(--wiz-accent);
  box-shadow: 0 4px 14px rgba(22, 104, 220, 0.28);
}

.wizard-actions .layui-btn-primary {
  border-color: #e2e8f0;
  color: #475569;
}

.wizard-footer-tip {
  padding: 16px 22px 20px !important;
  border-top: 1px solid var(--wiz-line);
  background: #f8fafc;
  border-radius: 0 0 22px 22px;
  margin: 0 !important;
  color: #64748b !important;
  text-shadow: none !important;
}

/* Admin embed (side panel) */
.admin-wizard-wrap .wizard-shell,
.admin-wizard-wrap .wizard-topbar,
.admin-wizard-wrap .wizard-footer-tip {
  display: none;
}

.admin-wizard-wrap .portal-apply-wizard {
  padding: 0;
}

.admin-wizard-wrap .wizard-hero {
  padding: 16px 18px;
}

.admin-wizard-wrap .wizard-layout {
  min-height: 460px;
}

.admin-wizard-wrap .wizard-sidebar {
  flex: 0 0 210px;
}

/* Legacy class aliases */
.portal-apply-wizard .pending-banner {
  /* kept for admin template compatibility */
}

.wizard-upload-progress__track {
  height: 4px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 4px;
}
.wizard-upload-progress__fill {
  display: block;
  height: 100%;
  width: 0;
  background: #2563eb;
  transition: width 0.2s ease;
}
.wizard-upload-progress__pct {
  font-size: 12px;
  color: #64748b;
}
.draft-resume-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.portal-apply-wizard .author-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 8px;
}
.portal-apply-wizard .author-in-orcid {
  min-width: 120px;
  font-size: 12px;
}

@media (max-width: 860px) {
  body.portal-page.portal-auth.portal-wizard {
    padding: 12px 10px 24px;
  }

  .wizard-shell {
    border-radius: 16px;
  }

  .wizard-hero {
    flex-direction: column;
    padding: 18px 16px 16px;
  }

  .wizard-progress-card {
    flex: none;
    width: 100%;
  }

  .wizard-title {
    font-size: 20px;
  }

  .wizard-layout {
    flex-direction: column;
    min-height: 0;
  }

  .wizard-sidebar {
    flex: none;
    border-right: none;
    border-bottom: 1px solid var(--wiz-line);
    padding: 12px 10px;
  }

  .wizard-sidebar-title {
    display: none;
  }

  .wizard-steps {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .wizard-steps .wizard-step-item {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 88px;
    max-width: 120px;
    padding: 8px 6px;
    margin-bottom: 0;
  }

  .wizard-steps .wizard-step-item::after {
    display: none;
  }

  .step-label-kind {
    display: none;
  }

  .step-label-title {
    font-size: 11px;
    font-weight: 600;
  }

  .wizard-main {
    padding: 16px;
  }

  .portal-apply-wizard .layui-form-label {
    width: 100%;
    text-align: left;
    padding-bottom: 4px;
  }

  .portal-apply-wizard .layui-input-block {
    margin-left: 0;
  }

  .wizard-banner {
    margin-left: 14px;
    margin-right: 14px;
  }
}
