/* 央国企岗位聚合 —— 视觉基调：政务/央企的稳重，加一点克制的红。 */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --brand: #0f2c59;
  --brand-soft: #eef2f8;
  --red: #b42318;
  --red-hover: #912018;
  --red-soft: #fef3f2;
  --green: #027a48;
  --green-soft: #ecfdf3;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 8px 24px -8px rgba(16, 24, 40, .18);
  --font: "Segoe UI", system-ui, -apple-system, "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }

/* ---------------------------------------------------------------- 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 14px max(24px, calc((100vw - 1240px) / 2 + 24px));
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; }

.logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(150deg, #c62f22, var(--red));
  color: #fff;
  font-weight: 700;
  font-size: 20px;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 14px -6px rgba(180, 35, 24, .55);
}

.brand-text h1 { margin: 0; font-size: 18px; letter-spacing: .2px; font-weight: 650; }
.brand-text p { margin: 1px 0 0; font-size: 12.5px; color: var(--muted); }

.stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.stat b { font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 提示条 */
.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1240px;
  margin: 18px auto 0;
  padding: 10px 16px;
  border: 1px solid #d8e2f1;
  border-radius: 12px;
  background: var(--brand-soft);
  color: #1d3557;
  font-size: 13px;
}
.notice svg { width: 18px; height: 18px; fill: #3b5b8c; flex: none; }
.notice b { font-weight: 650; }

/* ---------------------------------------------------------------- 主体 */
main { max-width: 1240px; margin: 0 auto; padding: 18px 24px 48px; }

.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.field { position: relative; display: flex; align-items: center; }
.search-field { flex: 1 1 320px; min-width: 240px; }
.search-field svg {
  position: absolute;
  left: 13px;
  width: 17px;
  height: 17px;
  fill: var(--faint);
  pointer-events: none;
}

.filters input[type="search"], .filters select {
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  padding: 0 12px;
  font-size: 14px;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.filters input[type="search"] { width: 100%; padding-left: 38px; }
.filters select { min-width: 128px; padding-right: 28px; cursor: pointer; }

.filters input[type="search"]:focus, .filters select:focus {
  outline: none;
  border-color: #b9c6dc;
  box-shadow: 0 0 0 3px rgba(15, 44, 89, .08);
}
.filters input[type="search"]::placeholder { color: var(--faint); }

.btn {
  height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 550;
  transition: background .15s, border-color .15s, color .15s, transform .06s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink-2); }
.btn.ghost:hover { background: #f9fafb; border-color: #b9c0cc; }
.btn.primary { background: var(--red); color: #fff; box-shadow: 0 6px 14px -8px rgba(180, 35, 24, .8); }
.btn.primary:hover { background: var(--red-hover); }
.btn.primary:disabled { background: #d0d5dd; color: #fff; box-shadow: none; cursor: not-allowed; }
.btn.primary svg { width: 15px; height: 15px; fill: currentColor; }

.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 2px 10px;
  font-size: 13px;
  color: var(--muted);
}
.result-bar p { margin: 0; }
.result-bar b { color: var(--ink); font-variant-numeric: tabular-nums; }
.sort { display: inline-flex; align-items: center; gap: 8px; }
.sort select {
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 8px;
  font-size: 13px;
  cursor: pointer;
}

/* ---------------------------------------------------------------- 表格 */
.table-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.table-scroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; min-width: 920px; }

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  padding: 11px 16px;
  background: #fafbfc;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3px;
  color: var(--muted);
  white-space: nowrap;
}

tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #f0f2f5;
  vertical-align: middle;
  font-size: 13.5px;
  color: var(--ink-2);
}
tbody tr { cursor: pointer; transition: background .12s; }
tbody tr:hover { background: #fcfcfd; }
tbody tr:last-child td { border-bottom: none; }

.col-main { width: 30%; }
.col-action { text-align: right; }

.job-title {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 2px;
}
.job-company { display: block; font-size: 12.5px; color: var(--muted); }
.job-tags { display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.tag {
  font-size: 11px;
  line-height: 18px;
  padding: 0 7px;
  border-radius: 5px;
  background: #f2f4f7;
  color: var(--muted);
  white-space: nowrap;
}
.tag.red { background: var(--red-soft); color: var(--red); }

.cell-muted { color: var(--muted); }
.cell-nowrap { white-space: nowrap; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.active { color: var(--green); background: var(--green-soft); }
.pill.offline { color: var(--muted); background: #f2f4f7; }
.pill.unknown { color: #b54708; background: #fffaeb; }

.jump-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: background .15s;
}
.jump-btn:hover { background: var(--red-hover); }
.jump-btn svg { width: 13px; height: 13px; fill: currentColor; }
.jump-btn[disabled] { background: #f2f4f7; color: var(--faint); cursor: not-allowed; }

/* ---------------------------------------------------------------- 状态与分页 */
.state { padding: 64px 24px; text-align: center; color: var(--muted); }
.state svg { width: 44px; height: 44px; fill: #d0d5dd; margin: 0 auto 10px; }
.state-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.state-hint { margin: 4px 0 16px; font-size: 13px; }

.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fdfdfe;
  flex-wrap: wrap;
}
.pager-info { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pager { display: flex; gap: 4px; }
.pager button {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  transition: background .12s, border-color .12s;
}
.pager button:hover:not(:disabled) { background: #f9fafb; }
.pager button[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager button:disabled { color: var(--faint); cursor: not-allowed; background: #fcfcfd; }
.pager .ellipsis { align-self: center; color: var(--faint); padding: 0 2px; }

/* ---------------------------------------------------------------- 页脚 */
footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px 32px;
  font-size: 12px;
  color: var(--faint);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------- 抽屉 */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(16, 24, 40, .38);
  opacity: 0;
  transition: opacity .2s;
}
.overlay.show { opacity: 1; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  width: min(480px, 100vw);
  background: var(--surface);
  box-shadow: -16px 0 40px -24px rgba(16, 24, 40, .4);
  transform: translateX(102%);
  transition: transform .24s cubic-bezier(.4, 0, .2, 1);
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.drawer-kicker { font-size: 12px; letter-spacing: .6px; color: var(--muted); text-transform: uppercase; }
.icon-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.icon-btn:hover { background: #f9fafb; }
.icon-btn svg { width: 14px; height: 14px; fill: var(--muted); }

.drawer-body { padding: 20px; overflow-y: auto; flex: 1; }
.drawer-title { margin: 0 0 4px; font-size: 19px; line-height: 1.35; }
.drawer-company { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; }
.meta-grid {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 8px 12px;
  margin: 0 0 18px;
  padding: 14px;
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
}
.meta-grid dt { color: var(--muted); }
.meta-grid dd { margin: 0; color: var(--ink-2); word-break: break-all; }
.section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .4px;
  color: var(--muted);
  margin: 0 0 8px;
}
.desc { margin: 0 0 18px; font-size: 13.5px; color: var(--ink-2); line-height: 1.75; }
.link-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--muted);
  word-break: break-all;
}
.link-box svg { width: 14px; height: 14px; fill: var(--faint); flex: none; }

.drawer-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #fdfdfe;
  display: flex;
  gap: 10px;
}
.drawer-foot .btn { flex: 1; justify-content: center; }
.drawer-note { margin: 8px 0 0; font-size: 11.5px; color: var(--faint); text-align: center; }

/* ---------------------------------------------------------------- Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 60;
  transform: translate(-50%, 20px);
  max-width: min(560px, calc(100vw - 32px));
  padding: 11px 16px;
  border-radius: 10px;
  background: #1d2939;
  color: #fff;
  font-size: 13.5px;
  line-height: 1.5;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #7a271a; }
.toast.ok { background: #054f31; }

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1024px) {
  .stats { display: none; }
}
@media (max-width: 760px) {
  .topbar { padding: 12px 16px; }
  main { padding: 14px 14px 40px; }
  .notice { margin: 12px 14px 0; }
  footer { padding: 0 14px 24px; }
  table { min-width: 720px; }
  thead th:nth-child(4), tbody td:nth-child(4),
  thead th:nth-child(5), tbody td:nth-child(5) { display: none; }
  .drawer { width: 100vw; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
