:root {
  --bg: #0f1419;
  --panel: #171d24;
  --panel-2: #1c2430;
  --line: #2a3542;
  --line-soft: #243040;
  --ink: #e7eef5;
  --muted: #8b9bab;
  --accent: #3d9cf0;
  --accent-soft: rgba(61, 156, 240, 0.16);
  --pass: #2fbf87;
  --pass-soft: rgba(47, 191, 135, 0.16);
  --warn: #e8a23c;
  --warn-soft: rgba(232, 162, 60, 0.16);
  --danger: #e2554d;
  --danger-soft: rgba(226, 85, 77, 0.16);
  --radius: 10px;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.45;
  font-size: 13px;
}

button, input, select { font: inherit; color: inherit; }
a { color: inherit; }

/* ── topbar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(15, 20, 25, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  width: min(1180px, calc(100% - 20px));
  margin: 0 auto;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.brand-text {
  font-size: 14px;
  font-weight: 650;
}

.nav { display: flex; gap: 4px; }

.nav-link {
  text-decoration: none;
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.nav-link.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav-link:hover { color: var(--ink); }

.top-meta { margin-left: auto; }

.count-pill {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
}

/* ── filter ── */
.filter-wrap {
  position: sticky;
  top: 48px;
  z-index: 20;
  background: rgba(23, 29, 36, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.filter-bar {
  width: min(1180px, calc(100% - 20px));
  margin: 0 auto;
  padding: 8px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-toggle {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.filter-toggle:hover {
  border-color: var(--muted);
}

.filter-toggle-text {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.filter-toggle-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
  flex-shrink: 0;
}

.filter-toggle-summary {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-toggle-icon {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.15s ease;
  font-size: 12px;
}

.filter-wrap.is-open .filter-toggle {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.filter-wrap.is-open .filter-toggle-icon {
  transform: rotate(180deg);
  color: var(--accent);
}

.filter-wrap.is-open .filter-toggle-title {
  color: var(--accent);
}

.filter-body {
  display: none;
  flex-direction: column;
  gap: 8px;
}

.filter-wrap.is-open .filter-body {
  display: flex;
}

.filter-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-label {
  width: 36px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.seg-btn {
  height: 28px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.seg-btn:hover {
  color: var(--ink);
  border-color: var(--muted);
}

.seg-btn.is-on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.dist-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.dist-switch input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.filter-search {
  flex: 1 1 160px;
  min-width: 120px;
  max-width: 240px;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  outline: none;
}

.filter-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.filter-line-actions {
  gap: 10px;
}

.btn-primary,
.btn-ghost,
.btn-danger,
.btn-detail {
  height: 28px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border: none;
}

.btn-ghost {
  background: var(--panel-2);
  border-color: var(--line);
  color: var(--muted);
}

.btn-ghost:hover { color: var(--ink); }

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(226, 85, 77, 0.35);
}

.btn-danger:hover { background: rgba(226, 85, 77, 0.28); }

.btn-detail {
  height: 26px;
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
  font-size: 12px;
}

.btn-detail:hover {
  background: var(--accent-soft);
}

/* ── job list (3-line rows) ── */
.main {
  width: min(1180px, calc(100% - 20px));
  margin: 0 auto;
  padding: 10px 0 40px;
}

.job-list {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.job-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background 0.12s ease;
}

.job-row:last-child { border-bottom: none; }
.job-row:hover { background: rgba(61, 156, 240, 0.07); }

.line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 20px;
  line-height: 1.35;
}

.line + .line { margin-top: 3px; }

.line-1 {
  gap: 10px;
}

.job-row {
  padding: 8px 12px;
}

.line-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  text-decoration: none;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.line-title:hover {
  color: var(--accent);
}

.line-item {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
}

.line-loc {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font);
}

.line-end {
  min-width: 110px;
  text-align: right;
}

.line-dist {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  min-width: 56px;
  text-align: right;
}

.line-end.is-past { color: var(--danger); }

.line-company {
  color: var(--ink);
  font-size: 12px;
  opacity: 0.92;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-muted {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}

.line-3 .btn-detail { margin-left: auto; }

.src-link {
  color: var(--accent);
  font-size: 11px;
  text-decoration: none;
  flex-shrink: 0;
  opacity: 0.85;
}

.src-tel {
  color: var(--pass);
}

.src-apply {
  color: var(--warn);
  font-weight: 600;
}

.btn-tel {
  white-space: nowrap;
}

.line-remark {
  margin-top: 4px;
  gap: 8px;
}

.remark-chip {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--warn);
  background: var(--warn-soft);
  border-radius: 5px;
  padding: 1px 6px;
}

.remark-text {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.callout {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--warn-soft);
  border: 1px solid rgba(232, 162, 60, 0.35);
}

.callout-line {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.6;
}

.callout-line + .callout-line {
  margin-top: 6px;
}

.callout-hint {
  color: var(--muted);
  font-size: 12px;
}

.src-tel {
  color: var(--pass);
  font-weight: 600;
}

.src-link:hover {
  text-decoration: underline;
  opacity: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 11px;
  border: 1px solid transparent;
  flex-shrink: 0;
}

.badge-公务员 { background: rgba(232, 162, 60, 0.16); color: #f0c070; border-color: rgba(232, 162, 60, 0.32); }
.badge-事业单位 { background: rgba(168, 120, 255, 0.16); color: #c0a0ff; border-color: rgba(168, 120, 255, 0.32); }
.badge-国企 { background: rgba(61, 120, 240, 0.18); color: #7eb0ff; border-color: rgba(61, 120, 240, 0.35); }
.badge-民企 { background: rgba(47, 191, 135, 0.14); color: #5ddea8; border-color: rgba(47, 191, 135, 0.3); }
.badge-外企 { background: rgba(61, 200, 220, 0.14); color: #6dd4e4; border-color: rgba(61, 200, 220, 0.3); }
.badge-其他 { background: rgba(139, 155, 171, 0.14); color: #a8b6c4; border-color: rgba(139, 155, 171, 0.28); }

.tag-pass,
.tag-exam {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.tag-pass { background: var(--pass-soft); color: var(--pass); }
.tag-exam { background: var(--warn-soft); color: var(--warn); }

.empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
}

/* ── detail page ── */
.detail-page { padding-top: 14px; }

.detail-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.detail-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
}

.detail-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.detail-title {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1.3;
}

.detail-company {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.fact {
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fact-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.fact-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

.detail-section { padding: 14px 0 0; }

.detail-section h2 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.detail-section p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink);
  opacity: 0.94;
}

.pre-wrap {
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-foot {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 11px;
  font-family: var(--mono);
}

/* ── admin ── */
.admin-body {
  background: var(--bg);
}

.admin-main {
  padding-top: 14px;
  padding-bottom: 48px;
  width: min(1280px, calc(100% - 20px));
}

.flash {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(61, 156, 240, 0.35);
}

.admin-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.panel-title {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--ink);
}

.job-form {
  display: grid;
  gap: 10px;
}

.job-form label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.job-form input,
.job-form select,
.job-form textarea {
  font: inherit;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
}

.job-form textarea {
  resize: vertical;
  min-height: 72px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.check-line {
  display: flex !important;
  align-items: center;
  gap: 8px;
  grid-template-columns: none !important;
}

.check-line input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.coord-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px dashed var(--line);
  background: rgba(15, 20, 25, 0.35);
  font-size: 12px;
}

.coord-label {
  color: var(--muted);
  flex-shrink: 0;
}

.coord-value {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  word-break: break-all;
}

.coord-value.is-ok {
  color: var(--pass);
}

.field-hint {
  margin: -2px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.list-head .panel-title {
  margin: 0;
}

.admin-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-filter input,
.admin-filter select {
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
}

.admin-table {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.admin-thead,
.admin-tr {
  display: grid;
  grid-template-columns: 52px 1.6fr 88px 100px 64px 130px;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
}

.admin-thead {
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
  border-bottom: 1px solid var(--line);
}

.admin-tr {
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
}

.admin-tr:last-child {
  border-bottom: none;
}

.admin-tr.is-history {
  opacity: 0.62;
}

.admin-tr .cell-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.admin-tr .cell-main a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-tr .cell-main a:hover {
  color: var(--accent);
}

.admin-tr .cell-main small {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mono {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.ops {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-sm {
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
}

.inline-form {
  display: inline;
}

@media (max-width: 960px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-thead {
    display: none;
  }

  .admin-tr {
    grid-template-columns: 48px 1fr;
    grid-template-areas:
      "id main"
      "id meta"
      "id ops";
  }

  .admin-tr > :nth-child(1) { grid-area: id; align-self: start; padding-top: 4px; }
  .admin-tr > :nth-child(2) { grid-area: main; }
  .admin-tr > :nth-child(3),
  .admin-tr > :nth-child(4),
  .admin-tr > :nth-child(5) {
    display: inline-flex;
  }

  .admin-tr > :nth-child(6) {
    grid-area: ops;
  }
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  width: min(380px, calc(100% - 28px));
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

dialog::backdrop { background: rgba(0, 0, 0, 0.55); }

#delete-form { padding: 18px; }
#delete-form h3 { margin: 0 0 8px; font-size: 15px; }

.dialog-text {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.dialog-label {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--muted);
}

.dialog-label input {
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  padding: 0 10px;
  color: var(--ink);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── responsive ── */
@media (max-width: 720px) {
  .filter-label {
    width: 100%;
    text-align: left;
  }

  .filter-search {
    max-width: none;
    width: 100%;
    flex: 1 1 100%;
  }

  .filter-line-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "search search"
      "dist apply"
      "reset reset";
  }

  .filter-line-actions .dist-switch {
    grid-area: dist;
    margin-left: 0;
  }

  .filter-line-actions .filter-search {
    grid-area: search;
  }

  .filter-line-actions .btn-primary {
    grid-area: apply;
    width: 100%;
  }

  .filter-line-actions .btn-ghost {
    grid-area: reset;
    width: 100%;
    height: 32px;
  }

  .seg {
    width: 100%;
  }

  .seg-btn {
    flex: 1 1 calc(50% - 6px);
    min-width: calc(50% - 6px);
  }

  .line-1 { flex-wrap: wrap; }
  .line-title { flex: 1 1 100%; }
  .line-end { text-align: left; min-width: 0; }
  .line-company { max-width: 70vw; }
  .detail-hero { flex-direction: column; }
  .detail-badges { justify-content: flex-start; }
}

/* 桌面端也保留折叠，默认收起以节省纵向空间 */
@media (min-width: 721px) {
  .filter-body {
    display: none;
  }

  .filter-wrap.is-open .filter-body {
    display: flex;
  }
}
