:root {
  --ma-primary: var(--primary-color, #ff4500);
  --ma-primary-hover: var(--primary-hover, #e63e00);
  --ma-text-1: #1a202c;
  --ma-text-2: #4a5568;
  --ma-text-3: #a0aec0;
  --ma-border: #edf2f7;
  --ma-danger: #dc2626;
  --ma-shadow: 0 10px 25px rgba(0, 0, 0, 0.04);
  /* 与 modern_login 表单一致：占位/下拉未选浅灰，已选/已输入加深 */
  --ma-form-value: var(--form-value-color, #1e293b);
  --ma-form-placeholder: var(--form-placeholder-color, #94a3af);
}

.ma-auth-page {
  min-height: 100vh;
  background: #f7fafc;
}

.ma-auth-wrap {
  width: 100%;
  max-width: 1120px;
  margin: 30px auto 0;
  padding: 0 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ma-split {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
}

.ma-auth-card { background: #fff !important; border: 1px solid #edf2f7; border-radius: 12px; box-shadow: var(--ma-shadow); overflow: hidden; width: 100%; }
.ma-auth-card--narrow { max-width: 560px; margin: 0 auto; }
.ma-auth-head { display: none; }

.ma-step {
  display: flex;
  gap: 2px;
  padding: 0 20px;
  min-height: 56px;
  align-items: center;
  border-bottom: 1px solid #edf2f7;
  background: #fff !important;
}

.ma-step__item {
  flex: 1;
  position: relative;
  text-align: center;
  text-decoration: none;
  color: var(--ma-text-3);
  font-size: 16px;
  font-weight: 500;
  line-height: 56px;
  padding: 0 8px;
  letter-spacing: 0.2px;
}

.ma-step__item::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 3px;
  border-radius: 2px;
  background: var(--ma-primary);
  transform: translateX(-50%);
  transition: width 0.2s;
}

.ma-step__item::after { display: none; }

.ma-step__item.is-active {
  color: var(--ma-primary);
  font-weight: 600;
}

.ma-step__item.is-active::before {
  width: 46px;
}

.ma-auth-body { padding: 18px 20px 22px; background: #fff !important; }
.ma-section { border: 1px solid #f1f5f9; border-radius: 10px; padding: 14px; margin-bottom: 12px; background: #fff; }
.ma-section__title { margin: 0 0 12px; font-size: 14px; color: #2d3748; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.ma-section__title::before { content: ''; width: 3px; height: 14px; border-radius: 2px; background: var(--ma-primary); }

.ma-auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.ma-auth-grid--single {
  grid-template-columns: 1fr;
  max-width: 420px;
  margin: 0 auto;
}

/* Register form in login-like card：行距在 reg-field 上，避免 input 的 mb 把同组 ma-tip 撑离输入框 */
.reg-form { width: 100%; }
.login-content .reg-form .reg-field { margin-bottom: 18px; }
.login-content .reg-form .input-wrap,
.login-content .reg-form .sms-group { margin-bottom: 0; }
.login-content .reg-form .reg-field .ma-tip {
  margin-top: 2px;
  margin-bottom: 0;
  min-height: 0;
  line-height: 1.35;
}
.login-content .reg-form .reg-field .ma-tip:empty { display: none; }
.login-content .reg-form .reg-field > .reg-panel { margin-bottom: 18px; }
/* 双列行：格子内 reg-field 不再各自 18px mb，避免两行之间叠成双倍间距 */
.login-content .reg-form .reg-row-2 { margin-bottom: 12px; }
.login-content .reg-form .reg-row-2:last-child { margin-bottom: 0; }
.login-content .reg-form .reg-row-2 .reg-field { margin-bottom: 0; }
.login-content .reg-form .reg-row-2 .reg-field .input-wrap { margin-bottom: 0; }
.reg-field { margin-bottom: 14px; }
.reg-field:last-child { margin-bottom: 0; }
.reg-label {
  display: block;
  margin: 0 0 6px;
  color: var(--ma-form-placeholder);
  font-size: 12px;
}
.reg-label em { color: #dc2626; font-style: normal; margin-right: 4px; }
.reg-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.reg-code-row {
  display: grid;
  grid-template-columns: 1fr 126px;
  gap: 10px;
}
.reg-panel {
  border: 1px solid #edf2f7;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}
.reg-panel .catid,
.reg-panel select { width: 100%; }
.reg-submit {
  margin-top: 4px;
}

/* 机构注册：分区标题（轻量，不抢 placeholder 风头） */
.reg-section {
  margin-bottom: 22px;
}
.reg-section:last-child {
  margin-bottom: 0;
}
.reg-section__title {
  margin: 0 0 12px;
  padding-left: 10px;
  border-left: 3px solid var(--primary-color, #07c160);
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.04em;
  line-height: 1.3;
}
.reg-panel--select select,
.reg-panel select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font-size: 13.5px;
  color: var(--ma-form-placeholder);
  border: 1.5px solid #edf2f7;
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
  cursor: pointer;
  appearance: auto;
}
.reg-panel--select select option,
.reg-panel select option {
  color: var(--ma-form-value);
}
.reg-panel--select select:focus,
.reg-panel select:focus {
  border-color: var(--primary-color, #07c160);
  outline: none;
}
.reg-panel--tight {
  padding: 8px 10px;
}
/* 机构注册页 UEditor：无外层包裹时按表单作用域限定样式 */
.reg-form--store .edui-default .edui-editor {
  border: 1.5px solid #edf2f7 !important;
  border-radius: 8px !important;
  overflow: hidden;
  box-shadow: none !important;
}
.reg-form--store .edui-default .edui-editor-toolbarboxouter {
  border-bottom: 1px solid #edf2f7 !important;
  background: #fafbfc !important;
}
.reg-form--store .edui-default .edui-editor-toolbarbox {
  padding: 4px 6px !important;
}
.reg-form--store .edui-default .edui-editor-iframeholder {
  height: 200px !important;
  min-height: 160px !important;
}
.reg-form--store .edui-default .edui-editor-bottombar {
  display: none !important;
}
.reg-panel--captcha {
  margin-top: 10px;
  padding: 10px;
  text-align: center;
  border: 1px dashed #e2e8f0;
  background: #fafbfc;
  border-radius: 8px;
}
.reg-panel--captcha img.authcode {
  vertical-align: middle;
  max-width: 100%;
  height: auto;
}
.reg-panel--question {
  font-size: 13px;
  color: #475569;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #edf2f7;
  line-height: 1.5;
}
/* 机构表单：区块间距（不画底部分隔线） */
.login-content--store .reg-section:not(:last-child) {
  margin-bottom: 18px;
}

@media (max-width: 760px) {
  .reg-row-2 { grid-template-columns: 1fr; gap: 0; }
  .reg-code-row { grid-template-columns: 1fr 110px; }
}

.ma-type-card { border: 1px solid var(--ma-border); border-radius: 12px; padding: 16px 14px; text-decoration: none; color: inherit; background: #fff; transition: all 0.2s; }

.ma-type-card svg {
  width: 26px;
  height: 26px;
  color: #0ea371;
}

.ma-type-card:hover { border-color: rgba(16, 185, 129, 0.45); box-shadow: 0 8px 20px rgba(16, 185, 129, 0.12); transform: translateY(-2px); }

.ma-type-card__title { margin: 10px 0 6px; font-size: 17px; color: var(--ma-text-1); }

.ma-type-card__desc { margin: 0; font-size: 13px; color: var(--ma-form-placeholder); line-height: 1.65; }

.ma-form { display: grid; gap: 14px; }

.ma-field label {
  display: block;
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--ma-form-placeholder);
  font-weight: 500;
}
.ma-field label em { display: inline; font-style: normal; color: var(--ma-danger); margin-right: 3px; }

.ma-input-wrap { display: flex; align-items: center; min-height: 46px; border: 1px solid var(--ma-border); border-radius: 10px; background: #fff; transition: border-color 0.2s, box-shadow 0.2s; }

.ma-input-wrap:focus-within { border-color: var(--ma-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ma-primary) 12%, transparent); }

.ma-input-wrap input, .ma-input-wrap select, .ma-input-wrap textarea {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  min-height: 44px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--ma-form-value);
  box-sizing: border-box;
}
.ma-input-wrap textarea { min-height: 120px; padding-top: 10px; padding-bottom: 10px; resize: vertical; }

.ma-input-wrap input::placeholder,
.ma-input-wrap textarea::placeholder {
  color: var(--ma-form-placeholder);
  opacity: 1;
}
.ma-input-wrap input::-webkit-input-placeholder,
.ma-input-wrap textarea::-webkit-input-placeholder {
  color: var(--ma-form-placeholder);
}
.ma-input-wrap input::-moz-placeholder,
.ma-input-wrap textarea::-moz-placeholder {
  color: var(--ma-form-placeholder);
  opacity: 1;
}
.ma-input-wrap input:-ms-input-placeholder,
.ma-input-wrap textarea:-ms-input-placeholder {
  color: var(--ma-form-placeholder);
}
.ma-input-wrap select {
  color: var(--ma-form-placeholder);
}
.ma-input-wrap select option {
  color: var(--ma-form-value);
}

.ma-input-wrap svg {
  margin-left: 13px;
  color: #b6c2d1;
  flex-shrink: 0;
}

.ma-panel { border: 1px solid #ebedf0; border-radius: 10px; background: #fff !important; padding: 10px; }

.ma-panel strong {
  color: var(--ma-text-1);
}

.ma-panel select {
  width: 100%;
  height: 42px;
  border: 1px solid #dce3ea;
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--ma-form-placeholder);
}
.ma-panel select option {
  color: var(--ma-form-value);
}

.ma-code-row {
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 10px;
}

.ma-btn {
  box-sizing: border-box;
  border: 0;
  border-radius: 8px;
  width: 100%;
  min-height: 40px;
  height: auto;
  padding: 10px 16px;
  line-height: 1.35;
  background: var(--primary-color);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.ma-btn:hover { background: var(--primary-hover); }

.ma-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.ma-btn--ghost { height: 46px; border: 1px solid var(--ma-border); border-radius: 10px; background: #fff; color: var(--ma-primary); font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; }

.ma-btn--ghost:hover { border-color: var(--ma-primary); color: var(--ma-primary); }

.ma-tip { margin-top: 5px; min-height: 16px; font-size: 12px; color: #a0aec0; }

.ma-tip.is-error {
  color: var(--ma-danger);
}

.ma-tip.is-ok {
  color: #0f9a6e;
}

.ma-agree { border: 1px solid #eceff3; border-radius: 10px; background: #fff !important; max-height: 132px; overflow: auto; color: #6b7280; line-height: 1.65; padding: 10px; font-size: 12px; }

/* 注册页：协议勾选 + 弹窗阅读全文 */
.reg-agree-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--ma-form-placeholder);
  line-height: 1.5;
}
.reg-agree-row input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--primary-color, #07c160);
}
.reg-xieyi-open {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 500;
  color: var(--primary-color, #07c160);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.reg-xieyi-open:hover { color: var(--primary-hover, #06ad56); }

.ma-xieyi-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s, visibility 0.2s;
  pointer-events: none;
}
.ma-xieyi-modal.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.ma-xieyi-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}
.ma-xieyi-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: min(78vh, 640px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ma-xieyi-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid #edf2f7;
  flex-shrink: 0;
}
.ma-xieyi-modal__head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #1a202c;
}
.ma-xieyi-modal__close {
  border: none;
  background: #f1f5f9;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.ma-xieyi-modal__close:hover {
  background: #e2e8f0;
  color: #334155;
}
.ma-xieyi-modal__body {
  padding: 18px 20px 22px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.7;
  color: #4b5563;
  -webkit-overflow-scrolling: touch;
}
.ma-xieyi-modal__body img { max-width: 100%; height: auto; }

.ma-submit-row { margin-top: 0; }

.ma-inline-note { margin-top: 8px; color: #9ca3af; font-size: 12px; }

.ma-footer-auth { padding: 24px 0 32px; text-align: center; color: #94a3b8; font-size: 12px; }

.ma-footer-auth a {
  color: #94a3b8;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.ma-footer-auth a:hover {
  color: #64748b;
  border-bottom-color: #cbd5e1;
}

@media (max-width: 980px) {
  .ma-split { width: 100%; }
}
@media (max-width: 760px) {
  .ma-auth-wrap { margin-top: 16px; padding: 0 12px; }
  .ma-step { padding: 0 12px; min-height: 52px; }
  .ma-step__item { font-size: 14px; line-height: 52px; }
  .ma-auth-body { padding: 14px; }
  .ma-auth-grid { grid-template-columns: 1fr; }
  .ma-code-row { grid-template-columns: 1fr 110px; }
}
