/* ===== 全局重置 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #1a6cfb;
  --primary-dark: #1557d4;
  --primary-light: #e8f0fe;
  --success: #34c759;
  --warning: #ff9500;
  --danger: #ff3b30;
  --gray-1: #f5f6fa;
  --gray-2: #e8eaed;
  --gray-3: #dadce0;
  --gray-4: #9aa0a6;
  --gray-5: #5f6368;
  --gray-6: #202124;
  --white: #ffffff;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--gray-1);
  color: var(--gray-6);
  min-height: 100vh;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--white);
  position: relative;
}

/* ===== 步骤条 ===== */
.step-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 16px 16px;
  gap: 8px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-2);
}

.step {
  font-size: 12px;
  color: var(--gray-4);
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--gray-1);
  transition: all 0.3s;
  white-space: nowrap;
}

.step.active {
  color: var(--white);
  background: var(--primary);
  font-weight: 500;
}

.step::before {
  margin-right: 4px;
  font-weight: bold;
}

/* ===== 头部 ===== */
.header {
  text-align: center;
  padding: 24px 20px 20px;
  background: linear-gradient(135deg, var(--primary) 0%, #0d47a1 100%);
  color: white;
}

.header-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.header h1 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.header h2 {
  font-size: 18px;
  font-weight: 500;
}

.subtitle {
  font-size: 14px;
  opacity: 0.85;
}

/* ===== 表单 ===== */
.form {
  padding: 20px 16px 16px;
}

.form-item {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-5);
  margin-bottom: 6px;
}

.required {
  color: var(--danger);
}

.form-input, .form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-2);
  border-radius: 10px;
  font-size: 15px;
  color: var(--gray-6);
  background: var(--white);
  transition: all 0.2s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input.error, .form-textarea.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.1);
}

.form-input.valid, .form-textarea.valid {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-item.half {
  flex: 1;
}

/* 下拉选择框 */
.select-wrapper {
  position: relative;
}

.form-select {
  padding-right: 36px;
  cursor: pointer;
  background: var(--white);
}

.select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--gray-4);
  pointer-events: none;
}

/* ===== 照片上传 ===== */
.photo-upload {
  width: 100%;
  min-height: 140px;
  border: 2px dashed var(--gray-3);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--gray-1);
  position: relative;
  overflow: hidden;
}

.photo-upload:active {
  background: var(--gray-2);
}

.photo-placeholder {
  text-align: center;
  padding: 20px;
}

.photo-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

.photo-text {
  font-size: 13px;
  color: var(--gray-4);
}

.photo-preview {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 10px;
}

.photo-retake {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 6px 14px;
  font-size: 12px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

/* ===== 按钮 ===== */
.btn {
  display: block;
  width: calc(100% - 32px);
  margin: 0 16px 12px;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(26, 108, 251, 0.3);
}

.btn-primary:active {
  background: var(--primary-dark);
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--white);
  color: var(--primary);
  border: 1.5px solid var(--primary);
  box-shadow: none;
}

.btn-secondary:active {
  background: var(--primary-light);
}

.btn-group {
  padding: 12px 0 24px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-group .btn {
  flex: 1;
  margin: 0;
}

/* ===== 确认卡片 ===== */
.confirm-card {
  margin: 16px;
  padding: 4px 16px;
  background: var(--gray-1);
  border-radius: var(--radius);
  overflow: hidden;
}

.confirm-row {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-2);
  font-size: 14px;
}

.confirm-row:last-child {
  border-bottom: none;
}

.confirm-label {
  width: 70px;
  color: var(--gray-4);
  flex-shrink: 0;
}

.confirm-value {
  color: var(--gray-6);
  font-weight: 500;
  word-break: break-all;
}

/* ===== 成功页 ===== */
.success-container {
  padding: 60px 24px 40px;
  text-align: center;
}

.success-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: successBounce 0.6s ease-out;
}

@keyframes successBounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.success-container h2 {
  font-size: 24px;
  color: var(--success);
  margin-bottom: 8px;
}

.success-msg {
  font-size: 14px;
  color: var(--gray-5);
  margin-bottom: 24px;
}

.status-tips {
  text-align: left;
  margin: 0 auto 32px;
  max-width: 280px;
}

.tip-item {
  padding: 8px 0;
  font-size: 14px;
  color: var(--gray-5);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 12px 24px;
  background: rgba(0,0,0,0.78);
  color: white;
  border-radius: 8px;
  font-size: 14px;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  max-width: 80%;
  text-align: center;
}

.toast.show {
  opacity: 1;
}

/* ===== 加载动画 ===== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--gray-3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  margin-top: 12px;
  font-size: 14px;
  color: var(--gray-5);
}

/* ===== 页脚 ===== */
.footer-text {
  text-align: center;
  font-size: 12px;
  color: var(--gray-4);
  padding: 8px 0 24px;
}

/* ===== 响应式 ===== */
@media (max-width: 360px) {
  .header h1 { font-size: 18px; }
  .form-input, .form-textarea { font-size: 14px; padding: 11px 12px; }
}

/* ===== 对接人搜索匹配 ===== */
.search-contact-wrapper {
  position: relative;
}

.search-contact-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: white;
  border: 1.5px solid var(--gray-2);
  border-top: none;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  max-height: 220px;
  overflow-y: auto;
}

.search-contact-list {
  padding: 4px 0;
}

.search-contact-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.1s;
}

.search-contact-item:active,
.search-contact-item:hover {
  background: var(--primary-light);
}

.search-contact-item .item-dept {
  font-size: 11px;
  color: var(--gray-4);
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-contact-noresult {
  padding: 20px;
  text-align: center;
  color: var(--gray-4);
  font-size: 13px;
}

.contact-selected-tag {
  display: inline-flex;
  align-items: center;
  background: var(--primary-light);
  color: var(--primary);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  margin-top: 8px;
}

.contact-selected-tag .remove-btn {
  margin-left: 8px;
  cursor: pointer;
  font-size: 16px;
  color: var(--gray-4);
  line-height: 1;
}

.contact-selected-tag .remove-btn:hover {
  color: var(--danger);
}

/* ===== Checkbox 多选 ===== */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--gray-6);
  cursor: pointer;
  padding: 8px 0;
}

.checkbox-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
}
