/* 表单容器 */
.form-container {
  max-width: 1366px;
  margin: 40px auto;
  /* 底部预留固定操作栏高度，避免内容被遮挡 */
  padding: 0 20px 120px;
}

.page-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
  text-align: center;
}

.page-subtitle {
  text-align: center;
  color: #666;
  font-size: 14px;
  margin-bottom: 32px;
}

/* 表单卡片 */
.form-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #eee;
  padding: 32px;
  margin-bottom: 24px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: #444;
}

.required::after {
  content: "*";
  color: #ef4444;
  margin-left: 4px;
}

input[type="text"],
textarea,
select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border 0.2s;
  background: #fafafa;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
  border-color: #000;
  background: #fff;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* 上传区域 */
.upload-area {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* 上传区域下方的提示文案 */
.upload-area + .upload-tip {
  margin-top: 12px;
}

.upload-placeholder {
  width: 88px;
  height: 88px;
  border-radius: 16px;
  border: 1px dashed #d1d5db;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  cursor: pointer;
}

.upload-placeholder:disabled {
  cursor: wait;
  opacity: 0.65;
}

.upload-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
}

.upload-tip {
  font-size: 13px;
  color: #888;
}

.upload-qr-placeholder {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  border: 1px dashed #d1d5db;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  cursor: pointer;
  font-size: 12px;
  gap: 4px;
  flex-shrink: 0;
  overflow: hidden;
}

.upload-qr-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 表单校验提示 */
.field-error {
  display: none;
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: #ef4444;
}

.field-error.show {
  display: block;
}

input[type="text"].invalid,
.upload-qr-placeholder.invalid {
  border-color: #ef4444;
  background: #fff5f5;
}

/* 多端配置 */
.platform-config {
  margin-top: 20px;
}

.platform-row {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  transition: all 0.2s;
}

.platform-info h4 {
  font-size: 15px;
  font-weight: 500;
  color: #111;
  margin-bottom: 2px;
}

.platform-info p {
  font-size: 13px;
  color: #888;
}

.platform-input-area {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed #e5e7eb;
}

/* 微信小程序的二维码上传区：二维码与提示文案上下排列 */
.platform-input-area.qr-area {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

/* 底部操作栏固定在页面底部 */
.form-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 800;
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 16px 20px;
  background: #fff;
  border-top: 1px solid #eee;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);
}

/* 表单操作按钮（仅作用于底部操作区，不覆盖导航栏按钮样式） */
.form-actions .btn {
  padding: 12px 32px;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  /* 透明边框占位，保证描边按钮与实心按钮等高 */
  border: 1px solid transparent;
  font-weight: 500;
}

/* 取消按钮描边 */
.form-actions .btn-cancel {
  background: #fff;
  border: 1px solid #d0d0d0;
  color: #555;
}

.form-actions .btn-cancel:hover {
  border-color: #999;
  color: #000;
}

.btn-submit {
  background: #000;
  color: #fff;
}

/* ================= 响应式适配 ================= */
@media (max-width: 768px) {
  /* 移动端底部有固定 tabbar（62px + 安全区），操作栏需叠在其上方 */
  .form-actions {
    bottom: calc(62px + env(safe-area-inset-bottom, 0px));
    padding: 12px 16px;
  }

  .form-container {
    padding-bottom: 180px;
  }
}

@media (max-width: 600px) {
  .navbar {
    padding: 12px 20px;
  }

  .form-card {
    padding: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
    /* 手机端两列变一列 */
    gap: 0;
  }

  .form-group[style*="width: 50%"] {
    width: 100% !important;
  }

  .form-actions {
    flex-direction: column-reverse;
    /* 按钮上下排列 */
  }

  .form-actions .btn {
    width: 100%;
  }

  .form-container {
    padding-bottom: 210px;
  }
}