/* 微遇 · 移动端全局样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  color: #333;
  background: #f5f5f5;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

.container { max-width: 540px; margin: 0 auto; padding: 12px; }

.header {
  text-align: center;
  padding: 20px 0 12px;
}
.header h1 {
  font-size: 24px;
  font-weight: 600;
  color: #1a1a1a;
}
.header .subtitle {
  font-size: 13px;
  color: #888;
  margin-top: 4px;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  border: 0.5px solid #e8e8e8;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 0.5px solid #f0f0f0;
  text-decoration: none;
  color: #333;
  font-size: 16px;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { opacity: 0.7; }

.menu-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f0f4ff;
  color: #534AB7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  flex-shrink: 0;
}

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 6px;
}
.form-label .required { color: #e24b4b; margin-left: 2px; }

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  color: #333;
  background: #fff;
  -webkit-appearance: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: #534AB7;
}
.form-textarea { min-height: 80px; resize: vertical; }
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23888' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* 单选/多选 */
.radio-group, .checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.radio-option, .checkbox-option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.radio-option.active, .checkbox-option.active {
  border-color: #534AB7;
  background: #EEEDFE;
  color: #534AB7;
}
.radio-option input, .checkbox-option input { display: none; }

/* 按钮 */
.btn {
  display: block;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn:active { opacity: 0.8; }
.btn-primary { background: #534AB7; color: #fff; }
.btn-success { background: #1D9E75; color: #fff; }
.btn-danger { background: #e24b4b; color: #fff; }
.btn-outline { background: #fff; color: #534AB7; border: 1px solid #534AB7; }
.btn-sm { padding: 8px 16px; font-size: 14px; width: auto; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 列表 */
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 0.5px solid #f0f0f0;
  text-decoration: none;
  color: inherit;
}
.list-item:last-child { border-bottom: none; }
.list-item-main { flex: 1; min-width: 0; }
.list-item-title { font-size: 15px; font-weight: 500; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item-meta { font-size: 12px; color: #999; margin-top: 4px; }

/* 标签 */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.tag-pending { background: #FAEEDA; color: #BA7517; }
.tag-processing { background: #E6F1FB; color: #185FA5; }
.tag-done { background: #E1F5EE; color: #0F6E56; }
.tag-rejected { background: #FCEBEB; color: #A32D2D; }

/* 导航 */
.nav-bar {
  display: flex;
  align-items: center;
  padding: 12px 0;
}
.nav-back {
  font-size: 20px;
  color: #534AB7;
  text-decoration: none;
  margin-right: 12px;
}
.nav-title { font-size: 17px; font-weight: 600; }

/* 弹窗 */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.4); display: flex;
  align-items: flex-end; justify-content: center; z-index: 1000;
}
.modal-content {
  background: #fff; border-radius: 16px 16px 0 0;
  width: 100%; max-width: 540px; max-height: 80vh; overflow-y: auto;
  padding: 20px 16px; padding-bottom: 36px;
}
.modal-title { font-size: 17px; font-weight: 600; margin-bottom: 16px; text-align: center; }

/* Toast */
.toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: rgba(0,0,0,0.75); color: #fff; padding: 12px 24px;
  border-radius: 8px; font-size: 14px; z-index: 2000;
  animation: fadeIn 0.3s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* 分类grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  border: 1px solid #ddd;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.category-item:active { opacity: 0.7; }
.category-item.active {
  border-color: #534AB7;
  background: #EEEDFE;
}
.category-icon {
  width: 40px; height: 40px;
  background: #f5f5f5; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.category-name { font-size: 13px; font-weight: 500; }

/* 发布表单内嵌 */
.inline-fields { margin-top: 12px; }
.field-row {
  display: flex;
  gap: 8px;
}
.field-row > * { flex: 1; }

/* 底部安全区 */
.safe-bottom { padding-bottom: env(safe-area-inset-bottom); }
