/* =============================================
   牵手婚恋 - 注册/登录页面样式（移动端优先）
   断点：默认 < 768px | 平板 ≥ 768px | PC ≥ 1024px
   ============================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ========== 设备显示控制 ========== */
.desktop-only { display: none; }
.mobile-only { display: block; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  background-color: #f0f2f5;
  color: var(--color-text-primary);
  -webkit-font-smoothing: antialiased;
}

/* =============================================
   品牌区（移动端 + 平板：隐藏）
   ============================================= */
.brand-panel {
  display: none;
}

/* =============================================
   表单卡片
   ============================================= */
.form-card {
  width: 100%;
  padding: 32px 20px;
  background-color: var(--color-white);
  min-height: 100vh;
}

.form-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 32px;
  letter-spacing: 1px;
}

/* =============================================
   表单字段组
   ============================================= */
.field-group {
  margin-bottom: 18px;
}

/* 登录表单账号字段顶部留白，让表单内容整体下移 */
form[action*="a=login"] .field-group:first-of-type {
  margin-top: 40px;
}

.field-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.field-group input,
.field-group select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--color-border-light);
  border-radius: 12px;
  font-size: 16px;
  color: var(--color-text-primary);
  background-color: var(--color-off-white);
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.field-group input:focus,
.field-group select:focus {
  border-color: var(--color-primary);
  background-color: var(--color-white);
  box-shadow: 0 0 0 3px var(--color-primary-shadow);
}

.field-group input::placeholder {
  color: #b0b0b0;
}

/* 下拉框箭头 */
.field-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238e8e93' d='M1.41.59L6 5.17 10.59.59 12 2l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

/* 单选框组（性别） */
.radio-group {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 48px;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 400;
  color: var(--color-text-primary);
  cursor: pointer;
  margin-bottom: 0;
}

/* =============================================
   单选按钮：自定义圆形样式（全端一致，含移动端）
   隐藏原生 radio，用主题色圆圈 + 内点代替
   ============================================= */
.custom-radio {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 15px;
  color: var(--color-text-primary);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* 隐藏原生 radio */
.custom-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  pointer-events: none;
}

.radio-circle {
  width: 18px;
  height: 18px;
  border: 2px solid #cfd4da;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  box-sizing: border-box;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.custom-radio:hover .radio-circle {
  border-color: var(--color-primary-light);
}

.custom-radio input:checked + .radio-circle {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-shadow);
}

.custom-radio input:checked + .radio-circle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-primary);
}

.custom-radio:active .radio-circle {
  transform: scale(0.9);
}

/* =============================================
   角色字段区域切换
   ============================================= */
.role-fields {
  display: none;
}

.role-fields.active {
  display: block;
}

/* 分隔线 */
.field-divider {
  border: none;
  border-top: 1px dashed var(--color-border-light);
  margin: 8px 0 16px;
}

.divider-label {
  font-size: 12px;
  color: var(--color-text-hint);
  margin-bottom: 12px;
  font-weight: 600;
}

/* =============================================
   自定义复选框（参考全国单身库风格）
   ============================================= */
.terms-wrapper {
  margin: 24px 0 20px;
}

.custom-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.check-box {
  width: 18px;
  height: 18px;
  border: 1px solid #ccc;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  background: #fff;
}

.custom-checkbox:hover .check-box {
  border-color: var(--color-primary);
}

.custom-checkbox input[type="checkbox"]:checked + .check-box {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.check-icon {
  width: 10px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0);
  margin-top: -2px;
  transition: transform 0.2s;
}

.custom-checkbox input[type="checkbox"]:checked + .check-box .check-icon {
  transform: rotate(-45deg) scale(1);
}

.check-text {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.protocol-link {
  color: var(--color-primary);
  cursor: pointer;
}

.protocol-link:hover {
  color: var(--color-primary-dark);
}

/* =============================================
   提交按钮
   ============================================= */
.btn-submit {
  width: 100%;
  height: 50px;
  background-color: var(--color-primary);
  color: var(--color-white);
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 4px;
  transition: background-color 0.2s, transform 0.1s;
}

.btn-submit:hover {
  background-color: var(--color-primary-hover);
}

.btn-submit:active {
  transform: scale(0.98);
}

/* =============================================
   底部切换链接
   ============================================= */
.switch-link {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.switch-link a {
  color: var(--color-link);
  text-decoration: none;
  font-weight: 500;
}

.switch-link a:hover {
  text-decoration: underline;
}

/* =============================================
   错误/成功消息
   ============================================= */
.message {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 14px;
  text-align: center;
}

.message.error {
  background-color: #ffeef0;
  color: #c23b56;
  border: 1px solid var(--color-primary-light);
}

.message.success {
  background-color: var(--color-success-bg);
  color: #2c7a4a;
  border: 1px solid #a5d6a7;
}

/* =============================================
   平板断点：≥ 768px
   ============================================= */
@media (min-width: 768px) {

  .form-card {
    max-width: 480px;
    min-height: auto;
    margin: 60px auto;
    padding: 48px 40px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  }

  .form-title {
    font-size: 28px;
    margin-bottom: 36px;
  }

  .field-group input,
  .field-group select {
    height: 52px;
    font-size: 16px;
  }

  .btn-submit {
    height: 54px;
    font-size: 20px;
  }
}

/* =============================================
   PC 断点：≥ 1024px
   ============================================= */
@media (min-width: 1024px) {

  .page-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px;
    background: linear-gradient(135deg, #f0f2f5 0%, #e8ebf0 100%);
  }

  .brand-panel {
    display: none;
  }

  .form-card {
    max-width: 560px;
    margin: 0;
    padding: 56px 44px 48px;
    min-height: 440px;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(255, 88, 155, 0.15);
  }

  .form-header {
    text-align: center;
    margin-bottom: 32px;
  }

  .form-subtitle {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 2px;
  }

  .form-title {
    display: none;
  }

  .desktop-only {
    display: block;
  }

  .mobile-only {
    display: none;
  }

  .field-group {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 0;
  }

  .field-group > label {
    /* width: 90px; */
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin-bottom: 0;
    margin-left: 20px;
    margin-right: 10px;
    text-align: left;
    padding-right: 12px;
    line-height: 1;
  }

  .field-group > input,
  .field-group > select {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0 14px;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    font-size: 15px;
    background-color: #fafafa;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  }

  .field-group > input:focus,
  .field-group > select:focus {
    border-color: var(--color-primary);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 88, 155, 0.12);
  }

  .field-group > input::placeholder {
    color: #b0b0b0;
    font-size: 14px;
  }

  .field-group > select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23bbb' d='M1.41.59L6 5.17 10.59.59 12 2l-6 6-6-6z'/%3E%3C/svg%3E");
    background-position: right 14px center;
    padding-right: 40px;
  }

  .field-group > .radio-group,
  .field-group > .birthday-picker,
  .field-group > .terms-wrapper,
  .field-group > .custom-select {
    flex: 1;
    min-width: 0;
  }

  .radio-group {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 0;
  }

  .btn-submit {
    height: 44px;
    width: 100%;
    display: block;
    margin-top: 8px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    box-shadow: 0 4px 12px rgba(255, 88, 155, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
  }

  .btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255, 88, 155, 0.4);
  }

  .btn-submit:active {
    transform: translateY(0);
  }

  .field-divider {
    margin: 24px 0 20px;
    border-top: 1px solid #f0f0f0;
  }

  .divider-label {
    font-size: 13px;
    color: #bbb;
    margin-bottom: 14px;
    font-weight: 600;
    letter-spacing: 1px;
  }

  .terms-wrapper {
    margin: 20px 0;
  }

  .switch-link {
    margin-top: 28px;
    font-size: 14px;
    color: #999;
  }

  .switch-link a {
    color: var(--color-primary);
    font-weight: 500;
    text-decoration: none;
  }

  .switch-link a:hover {
    text-decoration: underline;
  }
}
/* ===== 必填星号标记 ===== */
.required-star {
  color: var(--color-danger);
}

/* ========== 生日选择器 ========== */
.birthday-picker {
  position: relative;
  flex: 1;
  min-width: 0;
}

.bp-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid #e8e8e8;
  border-radius: 10px;
  font-size: 15px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.25s;
  user-select: none;
}

.bp-trigger:hover {
  border-color: #ccc;
}

.birthday-picker.open .bp-trigger {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(255, 88, 155, 0.12);
  background: #fff;
}

.bp-value {
  color: #c0c0c0;
  flex: 1;
}

.bp-value.selected {
  color: #333;
}

.bp-arrow {
  font-size: 12px;
  color: #999;
  margin-left: 8px;
  transition: transform 0.25s;
}

.birthday-picker.open .bp-arrow {
  transform: rotate(180deg);
}

.bp-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  z-index: 100;
  overflow: hidden;
  display: none;
}

.birthday-picker.open .bp-panel {
  display: block;
}

.bp-tabs {
  display: flex;
  border-bottom: 1px solid #eee;
}

.bp-tab {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  font-size: 13px;
  color: #999;
  cursor: pointer;
  transition: color 0.2s;
  position: relative;
}

.bp-tab.active {
  color: var(--color-primary);
  font-weight: 600;
}

.bp-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
}

.bp-content {
  max-height: 300px;
  overflow-y: auto;
  padding: 6px 0;
}

.bp-list {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  padding: 0 8px;
}

.bp-group-label {
  grid-column: 1 / -1;
  font-size: 12px;
  color: #bbb;
  padding: 10px 8px 4px;
  font-weight: 600;
}

.bp-item {
  padding: 8px 4px;
  text-align: center;
  font-size: 14px;
  color: #444;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}

.bp-item:hover {
  background: var(--color-primary-bg);
}

.bp-item.selected {
  color: var(--color-primary);
  font-weight: 600;
  background: var(--color-primary-pale);
}

/* ========== 用户协议弹窗 ========== */
.protocol-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.protocol-overlay.active {
  opacity: 1;
  visibility: visible;
}

.protocol-modal {
  background: #fff;
  border-radius: 12px;
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.protocol-overlay.active .protocol-modal {
  transform: translateY(0);
}

.protocol-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.protocol-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0;
}

.protocol-close {
  font-size: 28px;
  color: #999;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.protocol-close:hover {
  color: #333;
}

.protocol-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  line-height: 1.8;
  font-size: 14px;
  color: #444;
}

.protocol-body h4 {
  font-size: 15px;
  font-weight: 700;
  color: #222;
  margin: 18px 0 8px;
}

.protocol-body h4:first-child {
  margin-top: 0;
}

.protocol-body p {
  margin-bottom: 10px;
  text-align: justify;
}

.protocol-footer {
  padding: 14px 24px;
  border-top: 1px solid #eee;
  text-align: center;
  flex-shrink: 0;
}

.protocol-footer .btn-submit {
  max-width: 200px;
  margin: 0 auto;
  height: 44px;
  font-size: 15px;
  border-radius: 22px;
  letter-spacing: 2px;
  font-weight: 500;
}

/* ========== 自定义下拉选择器 ========== */
.custom-select {
  position: relative;
  flex: 1;
  min-width: 0;
}

.cs-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid #e8e8e8;
  border-radius: 10px;
  font-size: 15px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.25s, box-shadow 0.25s;
  user-select: none;
}

.cs-trigger:hover {
  border-color: #ccc;
}

.custom-select.open .cs-trigger {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(255, 88, 155, 0.12);
  background: #fff;
}

.cs-value {
  color: #c0c0c0;
  flex: 1;
}

.cs-value.selected {
  color: #333;
}

.cs-arrow {
  font-size: 12px;
  color: #999;
  margin-left: 8px;
  transition: transform 0.25s;
}

.custom-select.open .cs-arrow {
  transform: rotate(180deg);
}

.cs-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
  display: none;
}

.custom-select.open .cs-dropdown {
  display: block;
}

.cs-option {
  padding: 10px 14px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: background 0.15s;
}

.cs-option:hover {
  background: var(--color-primary-bg);
}

.cs-option.selected {
  color: var(--color-primary);
  font-weight: 600;
  background: var(--color-primary-pale);
}

/* 多列选项（如学历） */
.cs-dropdown.grid-4 {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 8px;
}

.custom-select.open .cs-dropdown.grid-4 {
  display: grid;
}

.cs-dropdown.grid-4 .cs-option {
  text-align: center;
  padding: 8px 4px;
  border-radius: 6px;
}

/* 3列选项（如与征婚人关系） */
.cs-dropdown.grid-3 {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 8px;
}

.custom-select.open .cs-dropdown.grid-3 {
  display: grid;
}

.cs-dropdown.grid-3 .cs-option {
  text-align: center;
  padding: 8px 4px;
  border-radius: 6px;
}

/* =============================================
   密码显隐切换
   ============================================= */
.password-field-wrapper {
  position: relative;
  flex: 1;
  min-width: 0;
}

.password-field-wrapper > input {
  width: 100%;
  padding-right: 40px !important;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  cursor: pointer;
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  opacity: 0.45;
  transition: opacity 0.2s;
  z-index: 2;
}

.password-toggle:hover {
  opacity: 1;
}

.password-toggle::before {
  display: block;
  width: 18px;
  height: 18px;
  content: '';
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") no-repeat center / contain;
}

.password-toggle.visible::before {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94'/%3E%3Cpath d='M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E") no-repeat center / contain;
}




/* 会员推荐提示（推荐码注册） */
.referral-hint .referral-hint-text {
  background: #fff4f7;
  border: 1px dashed var(--color-primary, #FF589B);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: #d6336c;
  font-weight: 600;
}
