/* ===== 面试评价表系统 - 全局样式 ===== */
:root {
  --primary: #1677ff;
  --primary-light: #e6f4ff;
  --primary-dark: #0958d9;
  --success: #52c41a;
  --warning: #faad14;
  --danger: #ff4d4f;
  --text-main: #1f2329;
  --text-sub: #646a73;
  --text-light: #8f959e;
  --bg-page: #f5f6f8;
  --bg-card: #ffffff;
  --border: #e5e6eb;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(31, 35, 41, 0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.6;
}

/* ===== 顶部导航 ===== */
.topbar {
  background: var(--primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(22, 119, 255, 0.25);
}
.topbar-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar-title {
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-title .logo { font-size: 20px; }
.topbar-actions { display: flex; gap: 8px; }
.topbar-btn {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.topbar-btn:hover { background: rgba(255, 255, 255, 0.3); }
.topbar-btn.active { background: #fff; color: var(--primary); font-weight: 600; }

/* ===== 页面容器 ===== */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px;
}

/* ===== 卡片 ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}
.card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 15px;
}
.card-header .step-tag {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 500;
}
.card-body { padding: 16px; }

/* ===== 表单 ===== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: 13px;
  color: var(--text-sub);
  font-weight: 500;
}
.form-group label .req { color: var(--danger); margin-left: 2px; }
.form-control {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
  color: var(--text-main);
  font-family: inherit;
  width: 100%;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}
textarea.form-control { resize: vertical; min-height: 72px; }
select.form-control { appearance: auto; }

/* ===== 评分区 ===== */
.score-row {
  display: flex;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
}
.score-row:last-child { border-bottom: none; }
.score-info { flex: 1; padding-right: 12px; }
.score-info .name { font-size: 14px; font-weight: 600; }
.score-info .desc { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.score-input { flex-shrink: 0; }
.score-input select { min-width: 110px; }

/* ===== 星级评分 ===== */
.star-rating { display: flex; gap: 4px; align-items: center; }
.star-rating .star {
  font-size: 26px;
  cursor: pointer;
  color: #d9d9d9;
  transition: transform 0.15s, color 0.15s;
  user-select: none;
  line-height: 1;
}
.star-rating .star.active { color: #faad14; }
.star-rating .star:hover { transform: scale(1.2); }
.star-score { font-size: 13px; color: var(--text-sub); margin-left: 6px; min-width: 32px; }

/* ===== 按钮 ===== */
.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: #a0c8ff; cursor: not-allowed; }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-danger-outline { background: #fff; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger-outline:hover { background: #fff2f0; }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-sub); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ===== 录用建议 ===== */
.suggestion-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.suggestion-item {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  text-align: center;
  font-size: 14px;
  transition: all 0.2s;
  background: #fff;
  color: var(--text-main);
}
.suggestion-item:hover { border-color: var(--primary); }
.suggestion-item.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}
.suggestion-item.strong { border-color: #52c41a; }
.suggestion-item.strong.selected { background: #f6ffed; border-color: var(--success); color: #389e0d; }
.suggestion-item.reject { border-color: #ff4d4f; }
.suggestion-item.reject.selected { background: #fff2f0; border-color: var(--danger); color: #cf1322; }

/* ===== 提交提示 ===== */
.notice {
  background: var(--primary-light);
  border: 1px solid #91caff;
  color: var(--primary-dark);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== 提交成功弹层 ===== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 360px;
  padding: 28px 24px;
  text-align: center;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal .icon-success {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: #f6ffed;
  border: 2px solid var(--success);
  color: var(--success);
  font-size: 34px;
  line-height: 60px;
  margin: 0 auto 14px;
}
.modal h3 { font-size: 18px; margin-bottom: 6px; }
.modal p { color: var(--text-sub); font-size: 14px; margin-bottom: 18px; }
.modal .actions { display: flex; gap: 10px; justify-content: center; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 300;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
  max-width: 80%;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 历史记录列表 ===== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
  background: #fff;
}
.filter-bar .form-control { width: auto; min-width: 120px; flex: 1; }
.filter-bar .search-input { flex: 2; min-width: 160px; }
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-card .num { font-size: 24px; font-weight: 700; color: var(--primary); }
.stat-card .label { font-size: 12px; color: var(--text-sub); margin-top: 2px; }

.record-list { list-style: none; }
.record-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.record-item:hover { background: #f7f8fa; }
.record-item:last-child { border-bottom: none; }
.record-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 600;
  flex-shrink: 0;
}
.record-main { flex: 1; min-width: 0; }
.record-main .name { font-weight: 600; font-size: 15px; }
.record-main .meta { font-size: 12px; color: var(--text-light); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-tag {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 12px;
  flex-shrink: 0;
  font-weight: 500;
}
.tag-strong_hire { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.tag-hire { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.tag-consider { background: #fffbe6; color: #d48806; border: 1px solid #ffe58f; }
.tag-reject { background: #fff2f0; color: #cf1322; border: 1px solid #ffa39e; }
.tag-none { background: #f0f0f0; color: #8f959e; border: 1px solid #d9d9d9; }
.record-date { font-size: 12px; color: var(--text-light); flex-shrink: 0; }
.record-arrow { color: #c0c4cc; flex-shrink: 0; }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-light);
}
.empty-state .icon { font-size: 52px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ===== 详情弹层 ===== */
.detail-modal { max-width: 640px; text-align: left; padding: 0; overflow: hidden; }
.detail-modal .dm-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.detail-modal .dm-header h3 { font-size: 16px; }
.detail-modal .dm-close {
  background: none; border: none;
  font-size: 20px; color: var(--text-light);
  cursor: pointer; padding: 4px;
}
.detail-modal .dm-body { padding: 16px 20px; max-height: 62vh; overflow-y: auto; }
.detail-modal .dm-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

.dm-section { margin-bottom: 18px; }
.dm-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 10px;
  padding-left: 8px;
  border-left: 3px solid var(--primary);
}
.dm-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.dm-info-grid .item { font-size: 14px; }
.dm-info-grid .item .k { color: var(--text-light); font-size: 12px; display: block; }
.dm-info-grid .item .v { font-weight: 500; }

.dm-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; }
.dm-score-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 4px 0; border-bottom: 1px dashed #f0f0f0; }
.dm-score-row .s-label { color: var(--text-sub); }
.dm-score-row .s-val { display: flex; align-items: center; gap: 4px; }
.dm-score-row .s-val .dot { color: #faad14; letter-spacing: 1px; }

.dm-comment {
  background: #f7f8fa;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  white-space: pre-wrap;
  line-height: 1.7;
}
.dm-comment.muted { color: var(--text-light); font-size: 13px; }

.dm-suggestion-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
}
.dm-avg {
  text-align: center;
  padding: 14px;
  background: var(--primary-light);
  border-radius: 8px;
  margin-bottom: 16px;
}
.dm-avg .num { font-size: 32px; font-weight: 700; color: var(--primary); }
.dm-avg .txt { font-size: 13px; color: var(--text-sub); }

/* ===== 分页 ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px;
  font-size: 13px;
  color: var(--text-sub);
}
.pagination button {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 14px;
  cursor: pointer;
  font-size: 13px;
}
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== 页脚 ===== */
.footer {
  text-align: center;
  color: var(--text-light);
  font-size: 12px;
  padding: 20px 0 30px;
}

/* ===== 响应式 ===== */
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .suggestion-options { grid-template-columns: 1fr 1fr; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .filter-bar .form-control { min-width: 100%; flex: 1 1 100%; }
  .dm-info-grid { grid-template-columns: 1fr; }
  .dm-scores { grid-template-columns: 1fr; }
}

/* 评分总览（表单页顶部） */
.score-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f7f8fa;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 6px;
}
.score-summary .avg { font-size: 26px; font-weight: 700; color: var(--primary); }
.score-summary .avg small { font-size: 13px; color: var(--text-sub); font-weight: 400; }

/* ===== 登录用户栏 ===== */
.userbar {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 720px;
  margin: 10px auto 0;
  padding: 8px 14px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  font-size: 13px;
}
.userbar .user-name { font-weight: 600; color: var(--text); }
.userbar .user-role {
  color: var(--primary);
  background: #eaf2ff;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 12px;
}
.userbar .user-logout { margin-left: auto; color: var(--text-light); text-decoration: none; }
.userbar .user-logout:active { opacity: 0.6; }

/* ===== 登录门禁 ===== */
.login-mask {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(20, 28, 46, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  width: 86%;
  max-width: 320px;
  background: #fff;
  border-radius: 14px;
  padding: 28px 22px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}
.login-logo { font-size: 20px; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.login-sub { font-size: 14px; color: var(--text-sub); margin-bottom: 16px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form .form-control { text-align: center; }
.login-admin {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-sub);
  justify-content: center;
}
.login-hint { font-size: 11px; color: var(--text-light); margin-top: 2px; }

/* 管理员「查看全部」开关 */
.scope-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-sub);
  white-space: nowrap;
}
