/* ===== 人才简历录入助手 样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --danger: #dc2626;
  --bg: #f0f4fa;
  --card: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* 头部 */
.header {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff;
  padding: 0 20px;
  box-shadow: 0 2px 12px rgba(30, 58, 138, .25);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo { font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.nav { display: flex; gap: 8px; }
.nav-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  padding: 7px 18px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: all .2s;
}
.nav-btn:hover { background: rgba(255,255,255,.12); }
.nav-btn.active { background: #fff; color: var(--primary-dark); font-weight: 600; }

/* 容器 */
.container {
  max-width: 1080px;
  margin: 24px auto;
  padding: 0 16px;
}
.page.hidden, .hidden { display: none !important; }

/* 步骤条 */
.steps-bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-light);
  font-size: 14px;
  flex: 1;
  position: relative;
}
.step:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -2px;
  top: 50%;
  width: calc(100% - 40px);
  height: 2px;
  background: var(--border);
  transform: translateY(-50%);
  z-index: 0;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  z-index: 1;
  transition: all .3s;
}
.step.active { color: var(--primary); font-weight: 600; }
.step.active .step-num { background: var(--primary); color: #fff; }
.step.done { color: var(--success); }
.step.done .step-num { background: var(--success); color: #fff; }
.step.done:not(:last-child)::after { background: var(--success); }

/* 卡片 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: 0 1px 6px rgba(0,0,0,.07);
}
.card h2 { font-size: 20px; margin-bottom: 6px; }
.tip { color: var(--text-light); font-size: 13px; margin-bottom: 20px; }

/* 步骤面板 */
.step-panel { display: none; }
.step-panel.active { display: block; animation: fadeIn .3s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 表单 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.form-item { display: flex; flex-direction: column; gap: 6px; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { font-size: 14px; font-weight: 500; color: var(--text); }
.form-item label em { color: var(--danger); font-style: normal; }
.form-item input, .form-item select, .form-item textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border .2s, box-shadow .2s;
  font-family: inherit;
  background: #fff;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.form-item textarea { resize: vertical; }

/* 上传 */
.upload-box {
  border: 2px dashed var(--border);
  border-radius: 10px;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border .2s;
  background: #f8fafc;
}
.upload-box:hover { border-color: var(--primary); }
.upload-placeholder { text-align: center; color: var(--text-light); padding: 20px; }
.upload-icon { font-size: 32px; margin-bottom: 8px; }
.photo-preview { width: 100%; max-height: 220px; object-fit: cover; display: block; }
.photo-preview.hidden { display: none; }

/* 按钮 */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}
.form-actions.center { justify-content: center; }
.btn {
  border: none;
  border-radius: 8px;
  padding: 11px 26px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-ghost { background: #f1f5f9; color: var(--text); }
.btn-ghost:hover { background: #e2e8f0; }
.btn-danger { background: #fee2e2; color: var(--danger); }
.btn-danger:hover { background: #fecaca; }

/* 确认框 */
.confirm-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 20px;
}
.confirm-text {
  font-size: 14px;
  line-height: 1.8;
  color: #166534;
  margin-bottom: 16px;
}

/* ===== 人才库 ===== */
.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.library-toolbar h2 { font-size: 20px; }
.search-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.search-bar input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  width: 260px;
  font-size: 14px;
  outline: none;
}
.search-bar select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 14px;
  outline: none;
  background: #fff;
}
.library-stats {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 14px;
}
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.resume-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.resume-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,.1); }
.resume-card-top { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.resume-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: #dbeafe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--primary);
}
.resume-name { font-size: 17px; font-weight: 700; }
.resume-badges { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  background: #eff6ff;
  color: var(--primary-dark);
}
.badge.green { background: #f0fdf4; color: #15803d; }
.resume-info { font-size: 13px; color: var(--text-light); line-height: 1.9; }
.resume-info b { color: var(--text); }
.library-empty { text-align: center; padding: 60px 0; color: var(--text-light); }
.empty-icon { font-size: 48px; margin-bottom: 12px; }

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}
.pagination button {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  padding: 6px 13px;
  cursor: pointer;
  font-size: 14px;
}
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: popIn .25s;
}
.modal-small { max-width: 380px; text-align: center; padding: 32px; }
@keyframes popIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: none; } }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-close {
  border: none;
  background: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-light);
}
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

/* 简历详情 */
.detail-resume { font-size: 14px; }
.detail-head {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.detail-avatar {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: #dbeafe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}
.detail-name { font-size: 20px; font-weight: 700; }
.detail-row { display: flex; margin-bottom: 8px; line-height: 1.7; }
.detail-label { width: 90px; color: var(--text-light); flex-shrink: 0; }
.detail-value { flex: 1; }
.detail-section { margin-top: 14px; }
.detail-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
  border-left: 3px solid var(--primary);
  padding-left: 8px;
  margin-bottom: 8px;
}
.detail-section-content { font-size: 13px; color: var(--text); line-height: 1.8; white-space: pre-wrap; }
.signature-line {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: flex;
  justify-content: space-between;
  color: var(--text-light);
  font-size: 13px;
}

/* 成功弹窗 */
.success-icon { font-size: 52px; margin-bottom: 10px; }
.modal-small h3 { margin-bottom: 8px; }
.modal-small p { color: var(--text-light); margin-bottom: 20px; }

/* Toast */
.toast {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 300;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  animation: slideDown .3s;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }
@keyframes slideDown { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 响应式 */
@media (max-width: 640px) {
  .steps-bar { padding: 12px 14px; }
  .step { font-size: 12px; }
  .step:not(:last-child)::after { width: calc(100% - 34px); }
  .card { padding: 20px 16px; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
  .search-bar input { width: 100%; }
  .search-bar { width: 100%; }
}

/* ===== 身份证 OCR 一键录入 ===== */
.ocr-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1px dashed #93c5fd;
  border-radius: var(--radius);
}
.btn-ocr {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
}
.btn-ocr:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.4); }
.btn-ocr:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-ocr.loading { background: linear-gradient(135deg, #64748b, #475569); }
.ocr-tip {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
}
.ocr-preview {
  margin-top: 12px;
  text-align: center;
}
.ocr-preview img {
  max-width: 280px;
  max-height: 180px;
  border-radius: 8px;
  border: 2px solid var(--border);
}
@media (max-width: 600px) {
  .ocr-section { flex-direction: column; align-items: stretch; text-align: center; }
  .btn-ocr { width: 100%; }
}
