/* 公共样式（纯 CSS，不依赖 Tailwind 编译） */

:root {
  --brand-50: #eef2ff;
  --brand-100: #e0e7ff;
  --brand-200: #c7d2fe;
  --brand-400: #818cf8;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ============ 输入控件 ============ */
.field-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 14px;
  color: #1f2937;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.field-input::placeholder { color: #b0b6c0; }
.field-input:hover { border-color: #d5d9e0; }
.field-input:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .14);
  background: #fff;
}
textarea.field-input { resize: vertical; line-height: 1.7; }

/* 下拉框自定义箭头 */
select.field-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
  cursor: pointer;
}

/* 带图标的输入框 */
.field-with-icon { position: relative; }
.field-with-icon .field-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #b0b6c0;
  pointer-events: none;
  transition: color .18s ease;
  display: flex;
}
.field-with-icon .field-input { padding-left: 40px; }
.field-with-icon .field-input:focus ~ .field-icon,
.field-with-icon:focus-within .field-icon { color: var(--brand-500); }

.field-label {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 13.5px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 7px;
  letter-spacing: .01em;
}
.field-label .char-count { margin-left: auto; }
.field-label .required { color: #ef4444; margin-left: 2px; }

.field-help {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 6px;
}

/* 字数统计 */
.char-count {
  font-size: 11.5px;
  font-weight: 400;
  color: #c0c4cc;
  font-variant-numeric: tabular-nums;
}
.char-count.warn { color: #f59e0b; }

/* ============ 分步表单分组 ============ */
.form-step {
  padding: 26px 0;
}
.form-step + .form-step { border-top: 1px dashed #eceef2; }
.form-step:first-child { padding-top: 6px; }
.form-step-header {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 18px;
}
.step-badge {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(79, 70, 229, .32);
  flex-shrink: 0;
}
.step-title { font-size: 15.5px; font-weight: 700; color: #111827; }
.step-sub { font-size: 12px; color: #9ca3af; margin-top: 1px; }

/* ============ 附件上传 ============ */
.upload-zone {
  display: block;
  border: 2px dashed #dfe3ea;
  border-radius: 16px;
  background: #fafbfd;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .15s ease;
}
.upload-zone:hover {
  border-color: var(--brand-400);
  background: var(--brand-50);
}
.upload-zone.dragover {
  border-color: var(--brand-500);
  background: var(--brand-50);
  transform: scale(1.01);
}
.upload-zone .upload-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 10px;
  border-radius: 14px;
  background: var(--brand-50);
  color: var(--brand-600);
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-zone:hover .upload-icon,
.upload-zone.dragover .upload-icon {
  background: #fff;
  box-shadow: 0 4px 10px rgba(79, 70, 229, .18);
}

/* 已选文件卡片 */
.file-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--brand-200);
  background: var(--brand-50);
  border-radius: 14px;
  animation: fileIn .25s ease;
}
.file-chip .file-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff;
  color: var(--brand-600);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0,0,0,.06);
}
.file-chip .file-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #1f2937;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-chip .file-size { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.file-remove {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.file-remove:hover { background: #fee2e2; color: #ef4444; }

@keyframes fileIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  transition: all .18s ease;
  border: none;
  cursor: pointer;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, .32);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 18px rgba(79, 70, 229, .42);
  transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-secondary {
  background: #fff;
  color: #374151;
  border: 1px solid #e5e7eb;
}
.btn-secondary:hover { background: #f9fafb; border-color: #d1d5db; }
.btn-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fee2e2;
}
.btn-danger:hover { background: #fee2e2; }
.btn-ghost {
  background: transparent;
  color: #4b5563;
}
.btn-ghost:hover { background: #f3f4f6; }

/* 大提交按钮 */
.btn-submit {
  padding: 13px 34px;
  font-size: 15px;
  border-radius: 14px;
}

/* ============ 卡片 ============ */
.card {
  background: #fff;
  border-radius: 20px;
  border: 1px solid #f0f1f4;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -12px rgba(16, 24, 40, .08);
}

/* 卡片顶部渐变饰条 */
.card-accent {
  height: 4px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-400), var(--brand-100));
}

/* ============ tag ============ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 9999px;
  background: var(--brand-50);
  color: var(--brand-600);
  font-size: 12px;
  font-weight: 500;
}
.tag-gray { background: #f3f4f6; color: #4b5563; }

/* ============ 成功页动效 ============ */
.success-ring {
  width: 84px;
  height: 84px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: popIn .45s cubic-bezier(.34, 1.56, .64, 1);
}
.success-ring::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid #a7f3d0;
  animation: ripple 1.6s ease-out infinite;
}
@keyframes popIn {
  0% { transform: scale(.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes ripple {
  0% { transform: scale(.9); opacity: .8; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* ============ 滚动条 ============ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
::-webkit-scrollbar-track { background: transparent; }

/* 移动端微调 */
@media (max-width: 640px) {
  .form-step { padding: 20px 0; }
  .btn-submit { width: 100%; }
}
