/* ZhipinAdmin · 仿 BOSS直聘左右布局 + PostAdmin 深色风格 */
:root {
  --red: #ff2442;
  --red-dark: #ff5c74;
  --muted: #9aa0a8;
  --bg: #141518;
  --card-bg: #1d1f23;
  --ink: #eceef1;
  --rule: #2c2f35;
  --placeholder: #6d737c;
  --radius: 8px;
  --salary: #ff9d5c;
  --salary-bright: #ffb37a;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 720px) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 16px 32px 12px;
  background: rgba(20, 21, 24, 0.88);
  border-bottom: 1px solid var(--rule);
  backdrop-filter: saturate(180%) blur(18px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--red);
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.logo-dot {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: radial-gradient(circle at 35% 30%, #fff 0 14%, transparent 15%),
    linear-gradient(135deg, #ff6b81, var(--red));
  box-shadow: 0 10px 24px rgba(255, 36, 66, 0.20);
}
.search-area { display: grid; width: 100%; min-width: 0; }
.search-shell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
  height: 40px;
  padding: 2px 2px 2px 4px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: #24272b;
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.25);
}
.search-shell:focus-within {
  border-color: rgba(255, 36, 66, 0.55);
  background: #1d1f23;
  box-shadow: 0 6px 20px rgba(255, 36, 66, 0.12);
}
.search-shell input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 0 10px;
  min-width: 0;
  font-size: 16px;
}
.search-shell input::placeholder { color: var(--placeholder); }
.search-shell .search-btn {
  flex: 0 0 auto;
  border: 0;
  color: #fff;
  background: var(--red);
  border-radius: 999px;
  padding: 7px 18px;
  margin-left: 4px;
  font-weight: 700;
  transition: transform 0.18s ease, background 0.18s ease;
}
.search-shell .search-btn:hover { background: var(--red-dark); transform: translateY(-1px); }

/* ---------- Filters (PostAdmin 条件区) ---------- */
.filters {
  background: var(--card-bg);
  border-bottom: 1px solid var(--rule);
}
.filter-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 18px 20px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 24px;
}
.filter-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.filter-label {
  padding-left: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.ctrl {
  position: relative;
  display: flex;
  align-items: center;
  width: 130px;
  height: 38px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: #24272b;
  transition: border-color 0.15s;
}
.ctrl:focus-within { border-color: rgba(255, 36, 66, 0.55); }
.ctrl input[type="text"] {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 0 10px;
  font-size: 14px;
}
.ctrl input::placeholder { color: var(--placeholder); }
.ctrl select {
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 0 30px 0 12px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.ctrl select option { color: var(--ink); background: #1d1f23; }
.select-ctrl::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #8a8d95;
  border-bottom: 1.5px solid #8a8d95;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.filter-item.text-filter .ctrl { width: 210px; }
.filter-item.text-filter .ctrl input { width: 0; }
.ctrl .ctrl-sep { color: var(--placeholder); font-size: 13px; }
.input-ctrl { width: 160px; }
.filter-row-end {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
}
.ghost-btn {
  height: 34px;
  padding: 0 16px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  transition: border-color 0.15s, color 0.15s;
}
.ghost-btn:hover { border-color: var(--red); color: var(--red); }

/* ---------- Layout: 左列表 + 右详情 ---------- */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 24px 40px;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 18px;
  align-items: start;
}
.left-pane { min-width: 0; }
.right-pane { min-width: 0; padding-top: 42px; }

/* ---------- 列表状态行 ---------- */
.status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  margin-bottom: 10px;
}
.result-text { color: var(--muted); font-size: 13px; }
.loading { color: var(--placeholder); font-size: 13px; }

/* ---------- 职位卡片（左列表） ---------- */
.job-list { display: flex; flex-direction: column; gap: 10px; }
.job-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--card-bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 14px 16px;
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
.job-card:hover { border-color: #3a3e46; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); }
.job-card.active {
  border-color: rgba(255, 36, 66, 0.65);
  background: #202329;
  box-shadow: 0 0 0 1px rgba(255, 36, 66, 0.35);
}
.job-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.job-name {
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.job-card.active .job-name { color: var(--red-dark); }
.job-salary { flex: none; color: var(--salary); font-weight: 700; font-size: 14px; }
.job-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.job-card-footer .u-sub { flex: 1; min-width: 0; }

/* ---- 胶囊标签系统（参考 PostAdmin .u-sub / .tag-*） ---- */
.u-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.u-sub > span {
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 11px;
  line-height: 18px;
}
.tag-city    { background: rgba(87, 166, 255, 0.12); border: 1px solid rgba(87, 166, 255, 0.40); color: #cfe4ff; }
.tag-source  { background: rgba(255, 107, 129, 0.12); border: 1px solid rgba(255, 107, 129, 0.40); color: #ffd3da; }
.tag-degree  { background: rgba(192, 140, 255, 0.12); border: 1px solid rgba(192, 140, 255, 0.40); color: #e6d7ff; }
.tag-exp     { background: rgba(120, 200, 140, 0.12); border: 1px solid rgba(120, 200, 140, 0.40); color: #c9f0d6; }
.tag-brand   { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.14); color: var(--ink); font-size: 12px; padding: 3px 10px; }
.tag-staff   { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.10); color: var(--muted); }
.tag-dist    { background: rgba(255, 157, 92, 0.12); border: 1px solid rgba(255, 157, 92, 0.40); color: #ffd9bd; }
.tag-publish { background: rgba(155, 160, 168, 0.12); border: 1px solid rgba(155, 160, 168, 0.40); color: #cfd3d8; }

.job-source-btn {
  flex: none;
  border: 1px solid rgba(255, 36, 66, 0.55);
  border-radius: 999px;
  padding: 5px 14px;
  color: #ff9caa;
  background: rgba(255, 36, 66, 0.08);
  font-size: 12px;
  font-weight: 600;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}
.job-source-btn:hover { background: var(--red); color: #fff; transform: translateY(-1px); }
.job-source-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.job-actions { display: flex; gap: 8px; flex-shrink: 0; }
.job-delete-btn {
  flex: none;
  border: 1px solid rgba(240, 100, 100, 0.5);
  border-radius: 999px;
  padding: 5px 12px;
  color: #e08888;
  background: rgba(240, 80, 80, 0.08);
  font-size: 12px;
  font-weight: 600;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}
.job-delete-btn:hover { background: #d23b3b; color: #fff; border-color: #d23b3b; transform: translateY(-1px); }

/* ---------- 详情面板（右） ---------- */
.detail-panel {
  background: var(--card-bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.detail-panel .detail-placeholder {
  padding: 60px 0;
  text-align: center;
  color: var(--placeholder);
  font-size: 13px;
}
.detail-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.detail-job-name { font-size: 20px; font-weight: 800; line-height: 1.3; }
.detail-salary { flex: none; color: var(--salary-bright); font-weight: 800; font-size: 18px; }
.detail-brand { margin-top: 10px; color: var(--muted); font-size: 13px; font-weight: 400; }
.detail-skills { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.6;
  font-weight: 600;
  background: rgba(255, 36, 66, 0.12);
  border: 1px solid rgba(255, 36, 66, 0.35);
  color: #ff8095;
}
.detail-section { margin-top: 18px; }
.detail-footer-tags {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px dashed var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-id { background: rgba(87, 166, 255, 0.12); border: 1px solid rgba(87, 166, 255, 0.40); color: #cfe4ff; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; }
.tag-source-wide { font-size: 12px; padding: 3px 11px; }
.detail-section h3 {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.detail-details {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  background: #24272b;
  border-radius: 6px;
  padding: 12px 14px;
}
.detail-details:empty::before { content: "暂无职位详情"; color: var(--placeholder); }
.detail-text { color: var(--muted); font-size: 13px; }

/* ---------- 空状态 / 分页 ---------- */
.empty {
  text-align: center;
  color: var(--muted);
  padding: 60px 0;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 0 12px;
  flex-wrap: wrap;
}
.pager button {
  padding: 6px 16px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--ink);
  cursor: pointer;
}
.pager button:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }
.page-info { color: var(--ink); }
.jump { display: flex; align-items: center; color: var(--muted); font-size: 13px; }
.jump input {
  width: 56px;
  height: 30px;
  margin: 0 6px;
  padding: 0 6px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--ink);
  text-align: center;
  outline: none;
}
.jump input:focus { border-color: rgba(255, 36, 66, 0.55); }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
  .right-pane { display: none !important; }
  .detail-modal[aria-hidden="false"] { display: block; }
}

/* ---------- 移动端详情弹窗 ---------- */
.detail-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.55);
}
.detail-modal[aria-hidden="false"] {
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.modal-dialog {
  position: relative;
  width: 100%;
  max-height: 90vh;
  margin-top: auto;
  background: var(--card-bg);
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slide-up 0.2s ease;
}
@keyframes slide-up {
  from { transform: translateY(30px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  border: none;
  background: #ff2442;
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(255, 36, 66, 0.5);
  transition: background 0.12s, transform 0.08s;
}
.modal-close:active { background: #d91f3a; transform: scale(0.92); }
.modal-close:hover { background: #e01f3a; }
.modal-body {
  flex: 1;
  padding: 22px 20px 28px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .topbar {
    grid-template-columns: 1fr;
    padding: 12px 16px 10px;
  }
  .brand { display: none; }
  .filter-row { padding: 10px 14px; gap: 12px; }
  .container { padding: 14px 12px 32px; }
}
