:root {
  color-scheme: light;
  --bg: #eef3f7;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --surface-tint: #f2f7f5;
  --line: #d8e2ea;
  --line-strong: #c5d3de;
  --text: #172033;
  --muted: #637083;
  --subtle: #8592a3;
  --accent: #0f766e;
  --accent-dark: #0a5f59;
  --accent-soft: #dff4ee;
  --blue: #245a8d;
  --blue-soft: #e6eff8;
  --gold: #a15c07;
  --gold-soft: #fff3d6;
  --bad: #b42318;
  --bad-soft: #fee4df;
  --good: #067647;
  --good-soft: #dcfae6;
  --shadow: 0 14px 40px rgba(23, 32, 51, 0.08);
  --shadow-soft: 0 8px 24px rgba(23, 32, 51, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(238, 243, 247, 0) 220px),
    var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  line-height: 1.45;
}

a {
  color: inherit;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 25px;
  font-weight: 750;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: 0;
}

p {
  color: var(--muted);
  margin-top: 6px;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  height: 40px;
  min-width: 0;
  outline: none;
  padding: 0 12px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input:focus,
select:focus {
  border-color: rgba(15, 118, 110, 0.72);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

button,
.button-link {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-weight: 650;
  height: 40px;
  justify-content: center;
  padding: 0 14px;
  text-decoration: none;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease, color 0.14s ease;
  white-space: nowrap;
}

button:hover,
.button-link:hover {
  border-color: rgba(15, 118, 110, 0.5);
  box-shadow: 0 8px 18px rgba(23, 32, 51, 0.08);
  color: var(--accent-dark);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

button.primary:hover {
  background: var(--accent-dark);
  color: #ffffff;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 94px;
  padding: 20px 30px;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
}

.topbar p {
  max-width: 720px;
}

.top-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 2fr) minmax(340px, 1fr);
  margin: 0 auto;
  max-width: 1440px;
  padding: 24px;
}

.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  min-width: 0;
  padding: 18px;
}

.wide {
  grid-column: 1 / -1;
}

.panel-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-head.compact {
  align-items: center;
}

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

.site-form {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(160px, 0.65fr) minmax(300px, 1fr) 78px;
  min-width: 640px;
}

.jobs-head {
  align-items: flex-end;
}

.filter-form {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.filter-form label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 5px;
}

.bulk-toolbar {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 16px;
  padding-top: 12px;
}

.toolbar-divider {
  background: var(--line);
  display: inline-block;
  height: 24px;
  margin: 0 2px;
  width: 1px;
}

.checkline,
.job-select-line {
  align-items: flex-start;
  display: flex;
  gap: 8px;
}

.checkline {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.job-select-line input,
.checkline input {
  flex: 0 0 auto;
  margin-top: 3px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 780px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

tbody tr:hover {
  background: rgba(242, 247, 245, 0.7);
}

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

.badge {
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 5px 9px;
}

.badge.good {
  background: var(--good-soft);
  border-color: #abefc6;
  color: var(--good);
}

.badge.bad {
  background: var(--bad-soft);
  border-color: #fecdca;
  color: var(--bad);
}

.badge.warn {
  background: var(--gold-soft);
  border-color: #fedf89;
  color: var(--gold);
}

.metric {
  align-items: center;
  background: var(--blue-soft);
  border: 1px solid #c8dcf0;
  border-radius: 999px;
  color: var(--blue);
  display: inline-flex;
  font-weight: 750;
  justify-content: center;
  min-width: 34px;
  padding: 5px 11px;
  text-align: center;
  white-space: nowrap;
}

.stats-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.stat-card {
  background: linear-gradient(180deg, #ffffff, var(--surface-soft));
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 8px;
  min-height: 88px;
  padding: 14px;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.list {
  display: grid;
  gap: 10px;
}

.review-panel {
  align-self: start;
}

.review-tools {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding-top: 12px;
}

.review-kind-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-kind-chip {
  background: var(--surface-soft);
  color: var(--muted);
  height: 34px;
  padding: 0 10px;
}

.review-kind-chip.active {
  background: var(--accent-soft);
  border-color: #9bddcf;
  color: var(--accent-dark);
}

.review-kind-chip strong {
  color: inherit;
  margin-left: 4px;
}

.review-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) repeat(3, auto);
}

.llm-panel p {
  color: var(--muted);
  margin: 4px 0 0;
  max-width: 760px;
}

.llm-status-row {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 1fr) minmax(360px, 1.2fr);
  margin-bottom: 14px;
}

.model-status {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  padding: 12px;
}

.model-status.good {
  background: var(--good-soft);
  border-color: #abefc6;
  color: var(--good);
}

.model-status.bad {
  background: var(--bad-soft);
  border-color: #fecdca;
  color: var(--bad);
}

.noise-stats {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
}

.noise-stats span {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: 4px;
  grid-template-columns: 1fr;
  min-height: 58px;
  padding: 9px 10px;
}

.noise-stats strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1;
}

.llm-controls {
  align-items: end;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 1fr) 118px repeat(4, auto) auto;
  padding-top: 14px;
}

.llm-controls > label:not(.checkline) {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 5px;
}

.noise-note {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  padding: 8px 9px;
}

.review-item {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 8px;
  padding: 13px;
}

.review-item-head {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.review-item strong {
  display: block;
  font-size: 14px;
}

.review-item span {
  color: var(--muted);
  display: block;
  font-size: 13px;
}

.review-reason {
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.cards {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.job-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 12px;
  padding: 15px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.job-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.job-card.gate-publish {
  border-left: 4px solid #16a34a;
}

.job-card.gate-review {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
}

.job-card.gate-reject {
  background: #fff7f7;
  border-left: 4px solid #dc2626;
}

.job-card.gate-expired {
  background: #f8fafc;
  border-left: 4px solid #94a3b8;
  opacity: 0.86;
}

.job-card a {
  color: var(--accent-dark);
  font-weight: 750;
  text-decoration: none;
}

.job-select-line a {
  line-height: 1.45;
}

.job-card-head {
  display: grid;
  gap: 9px;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.job-meta {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.job-text {
  color: #344054;
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
  max-height: 96px;
  overflow: hidden;
}

.job-kv {
  align-items: start;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 46px minmax(0, 1fr);
  padding: 9px 10px;
}

.job-kv span {
  color: var(--muted);
  font-size: 12px;
}

.job-kv strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.job-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.preview-cell {
  color: #344054;
  font-size: 13px;
  line-height: 1.55;
  max-width: 540px;
  white-space: normal;
}

.tag {
  background: var(--accent-soft);
  border: 1px solid #b7e7dc;
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 6px 9px;
}

.tag.muted {
  background: #edf2f7;
  border-color: #d9e0ea;
  color: var(--muted);
}

.toast {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  bottom: 22px;
  box-shadow: 0 14px 30px rgba(17, 24, 39, 0.24);
  color: #ffffff;
  left: 50%;
  max-width: min(720px, calc(100vw - 32px));
  padding: 12px 16px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 20;
}

.public-page {
  background:
    radial-gradient(circle at 12% 0%, rgba(15, 118, 110, 0.12), transparent 240px),
    radial-gradient(circle at 92% 8%, rgba(36, 90, 141, 0.12), transparent 260px),
    var(--bg);
}

.public-header {
  background: transparent;
}

.nav {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1180px;
  padding: 20px 24px 10px;
}

.brand {
  align-items: center;
  color: var(--text);
  display: inline-flex;
  font-size: 18px;
  font-weight: 800;
  gap: 10px;
  text-decoration: none;
}

.brand::before {
  background: var(--accent);
  border-radius: 8px;
  box-shadow: inset 0 -10px 20px rgba(255, 255, 255, 0.14);
  content: "";
  display: inline-block;
  height: 28px;
  width: 28px;
}

.admin-link {
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  padding: 8px 12px;
  text-decoration: none;
}

.admin-link:hover {
  color: var(--accent-dark);
}

.search-band {
  margin: 0 auto;
  max-width: 1180px;
  padding: 34px 24px 30px;
}

.search-band h1 {
  color: #111827;
  font-size: 38px;
  line-height: 1.18;
  margin-bottom: 20px;
  max-width: 720px;
}

.public-search {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1.3fr) minmax(160px, 0.85fr) minmax(140px, 0.7fr) minmax(150px, 0.85fr) 150px 96px 88px;
  padding: 12px;
}

.public-search input {
  background: var(--surface-soft);
}

.public-search button {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.public-search button:hover {
  background: var(--accent-dark);
  color: #ffffff;
}

.inline-check {
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  gap: 6px;
  height: 40px;
  justify-content: center;
  padding: 0 8px;
  white-space: nowrap;
}

.inline-check input {
  height: auto;
  padding: 0;
}

.public-main {
  margin: 0 auto;
  max-width: 1180px;
  padding: 6px 24px 36px;
}

.result-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.public-results {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.load-more-row {
  display: flex;
  justify-content: center;
  padding: 20px 0 4px;
}

.public-job {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  min-width: 0;
  padding: 16px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.public-job:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.job-main {
  display: grid;
  gap: 12px;
}

.job-title {
  color: var(--accent-dark);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.45;
  text-decoration: none;
}

.job-title:hover {
  text-decoration: underline;
}

.public-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.public-grid div {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  display: grid;
  gap: 5px;
  min-height: 62px;
  padding: 9px 10px;
}

.public-grid span {
  color: var(--muted);
  font-size: 12px;
}

.public-grid strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.job-summary {
  color: #344054;
  font-size: 13px;
  line-height: 1.65;
  margin: 0;
}

.empty {
  background: #ffffff;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  grid-column: 1 / -1;
  padding: 34px;
  text-align: center;
}

@media (max-width: 1180px) {
  .public-search {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .topbar,
  .panel-head,
  .jobs-head {
    align-items: stretch;
    flex-direction: column;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .site-form {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .filter-form {
    justify-content: stretch;
  }

  .filter-form label,
  .filter-form button,
  .filter-form select,
  .filter-form input {
    width: 100%;
  }

  .review-actions {
    grid-template-columns: 1fr;
  }

  .review-actions button,
  .review-actions select {
    width: 100%;
  }

  .llm-status-row,
  .llm-controls {
    grid-template-columns: 1fr;
  }

  .llm-controls button,
  .llm-controls input,
  .llm-controls select {
    width: 100%;
  }

  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .public-search,
  .public-grid {
    grid-template-columns: 1fr;
  }

  .search-band h1 {
    font-size: 29px;
  }

  .public-results,
  .cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 16px;
    position: static;
  }

  .nav {
    padding: 16px 16px 8px;
  }

  .search-band {
    padding: 22px 16px 24px;
  }

  .public-main {
    padding: 4px 16px 28px;
  }

  .search-band h1 {
    font-size: 25px;
  }

  .brand {
    font-size: 16px;
  }

  .admin-link {
    font-size: 13px;
  }

  .public-search {
    border-radius: 10px;
    padding: 10px;
  }

  .result-head {
    align-items: flex-start;
    gap: 10px;
  }
}
