:root {
  --bg: #f5f1e8;
  --card: #fffdf8;
  --ink: #24332c;
  --muted: #647169;
  --line: #e3ded2;
  --primary: #1f6b55;
  --primary-strong: #175443;
  --primary-soft: #e7f1ec;
  --amber: #96600f;
  --amber-soft: #fbf0dd;
  --danger: #a9483f;
  --danger-soft: #fbeceb;
  --shadow: 0 12px 30px rgba(35, 51, 44, 0.08);
  --radius: 20px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  background:
    radial-gradient(circle at 8% 0%, rgba(185, 119, 25, 0.1), transparent 28rem),
    radial-gradient(circle at 100% 20%, rgba(31, 107, 85, 0.08), transparent 30rem),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(227, 222, 210, 0.8);
  background: rgba(245, 241, 232, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1080px;
  padding: 13px 22px;
  margin: 0 auto;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 13px;
  color: #fffdf8;
  font-family: "Songti SC", "STSong", serif;
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(145deg, var(--primary), #2e8a6c);
  box-shadow: 0 6px 14px rgba(31, 107, 85, 0.25);
}

.brand-text strong {
  display: block;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: 0.04em;
}

.brand-text span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid #d8e5dd;
  border-radius: 999px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3b9a77;
  box-shadow: 0 0 0 3px rgba(59, 154, 119, 0.13);
}

.container {
  max-width: 1080px;
  padding: 28px 22px 84px;
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--amber);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.hero {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  align-items: end;
  gap: 28px;
  margin: 12px 0 28px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 4.2vw, 44px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.035em;
}

.hero-copy > p:last-child {
  max-width: 34em;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.stat {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 253, 248, 0.7);
}

.stat strong {
  display: block;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.stat span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.tabs {
  display: flex;
  width: fit-content;
  gap: 5px;
  padding: 5px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ece7dc;
}

.tab {
  padding: 10px 17px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

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

.tab.is-active {
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 2px 8px rgba(35, 51, 44, 0.08);
}

.tab-count {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 999px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  vertical-align: 1px;
}

.card {
  padding: 24px;
  border: 1px solid rgba(227, 222, 210, 0.92);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.card + .card {
  margin-top: 18px;
}

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

.card-head h2 {
  margin: 0 0 4px;
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.step-badge {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

textarea,
input {
  color: var(--ink);
}

textarea {
  display: block;
  width: 100%;
  min-height: 116px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: #fffefb;
  font-size: 16px;
  line-height: 1.65;
  resize: vertical;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  background: #fffefb;
  font-size: 16px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

textarea::placeholder,
input::placeholder {
  color: #a3aca6;
}

textarea:focus,
input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(31, 107, 85, 0.12);
}

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

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

.btn {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.62;
  cursor: wait;
  transform: none;
}

.btn-primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 6px 16px rgba(31, 107, 85, 0.18);
}

.btn-primary:hover {
  background: var(--primary-strong);
}

.btn-secondary {
  border-color: #cfe2d9;
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.btn-secondary:hover {
  border-color: #b9d5c8;
  background: #dcece5;
}

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

.btn-ghost:hover {
  border-color: #cfc8ba;
  color: var(--ink);
  background: #f7f3ea;
}

.btn-ghost.is-danger {
  color: var(--danger);
}

.btn-ghost.is-danger:hover {
  border-color: #e5c2be;
  background: var(--danger-soft);
}

.btn-small {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.notice {
  padding: 12px 14px;
  margin-top: 14px;
  border: 1px solid #d8e5dd;
  border-radius: 12px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-size: 13px;
  line-height: 1.6;
}

.notice.info {
  border-color: #d8e5dd;
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.notice.success {
  border-color: #cfe2d9;
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.notice.warning {
  border-color: #efd9b6;
  color: #7a5218;
  background: var(--amber-soft);
}

.notice.error {
  border-color: #e8c8c4;
  color: var(--danger);
  background: var(--danger-soft);
}

.form-section {
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.form-section:first-of-type {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}

.form-section h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.kind-fieldset {
  padding: 0;
  margin: 0 0 16px;
  border: 0;
}

.kind-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.kind-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffefb;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.kind-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.kind-option:focus-within {
  box-shadow: 0 0 0 4px rgba(31, 107, 85, 0.12);
}

.kind-option.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.kind-dot {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2px solid #c4cec8;
  border-radius: 50%;
  background: #fff;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.kind-option.is-active .kind-dot {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: inset 0 0 0 4px #fff;
}

.kind-copy strong {
  display: block;
  font-size: 14px;
  line-height: 1.3;
}

.kind-copy small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  color: #3d4b43;
  font-size: 13px;
  font-weight: 600;
}

.field > span {
  line-height: 1.35;
}

.field em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
}

.field b {
  color: var(--danger);
  font-weight: 700;
}

.field small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

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

.field textarea {
  min-height: 86px;
  font-size: 15px;
}

.form-mode {
  margin-left: auto;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 600;
}

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 18px;
  margin-top: 20px;
  border-top: 1px dashed var(--line);
}

.list-card {
  padding: 0;
  overflow: hidden;
}

.list-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.search-box {
  flex: 1 1 220px;
  min-width: 180px;
}

.search-box input {
  height: 42px;
  border-radius: 11px;
  background: #fffefb;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chip {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.chip:hover {
  border-color: #cfc8ba;
  color: var(--ink);
}

.chip.is-active {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}

.list-status {
  padding: 14px 18px;
  color: var(--muted);
  font-size: 13px;
}

.list-status.is-error {
  color: var(--danger);
}

.record-list {
  display: grid;
  gap: 11px;
  padding: 12px 18px 18px;
}

.record-card {
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffefb;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.record-card:hover {
  border-color: #c9d8d0;
  box-shadow: 0 6px 18px rgba(35, 51, 44, 0.05);
}

.record-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}

.badge-worker {
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.badge-demand {
  color: #7a5218;
  background: var(--amber-soft);
}

.record-date {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.record-card h3 {
  margin: 9px 0 7px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.record-meta span {
  padding: 3px 7px;
  border-radius: 6px;
  color: #4c5b52;
  background: #f4f1e9;
  font-size: 12px;
}

.record-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.tag {
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-size: 11px;
}

.record-note {
  display: -webkit-box;
  margin: 9px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.record-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 11px;
  margin-top: 12px;
  border-top: 1px dashed var(--line);
}

.phone {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

.record-actions {
  display: flex;
  gap: 6px;
}

.empty-state {
  padding: 54px 20px 62px;
  text-align: center;
}

.empty-mark {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  place-items: center;
  border: 1px dashed #c9d8d0;
  border-radius: 18px;
  color: var(--primary);
  background: var(--primary-soft);
  font-family: "Songti SC", "STSong", serif;
  font-size: 25px;
  font-weight: 700;
}

.empty-state h3 {
  margin: 0 0 5px;
  font-size: 17px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  z-index: 50;
  max-width: min(86vw, 440px);
  padding: 12px 18px;
  border-radius: 12px;
  color: #fff;
  background: #24332c;
  box-shadow: 0 12px 28px rgba(35, 51, 44, 0.24);
  font-size: 14px;
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.is-error {
  background: var(--danger);
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(420px, 100%);
}

.login-card {
  padding: 30px;
  border: 1px solid rgba(227, 222, 210, 0.92);
  border-radius: 26px;
  background: var(--card);
  box-shadow: 0 22px 55px rgba(35, 51, 44, 0.12);
}

.login-brand {
  margin-bottom: 30px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.login-intro {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form .btn {
  margin-top: 2px;
}

.form-error {
  padding: 10px 12px;
  margin: 0;
  border: 1px solid #e8c8c4;
  border-radius: 10px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 13px;
  line-height: 1.5;
}

.login-foot {
  margin: 24px 0 0;
  color: #98a29b;
  font-size: 12px;
  text-align: center;
}

@media (max-width: 760px) {
  .topbar-inner {
    padding: 11px 16px;
  }

  .brand-text span {
    display: none;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 12px;
    font-size: 20px;
  }

  .status-pill {
    display: none;
  }

  .container {
    padding: 20px 14px 72px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero-copy > p:last-child {
    font-size: 13px;
  }

  .stat {
    padding: 10px 11px;
  }

  .stat strong {
    font-size: 22px;
  }

  .stat span {
    font-size: 11px;
  }

  .tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
    padding: 9px 10px;
  }

  .card {
    padding: 17px;
    border-radius: 18px;
  }

  .card-head {
    gap: 10px;
  }

  .card-head h2 {
    font-size: 18px;
  }

  .card-head p {
    font-size: 12px;
  }

  .step-badge {
    padding: 4px 8px;
    font-size: 11px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }

  .kind-switch {
    grid-template-columns: 1fr;
  }

  .hint {
    display: none;
  }

  .paste-actions .btn {
    flex: 1;
  }

  .form-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding: 13px 0 2px;
    margin-right: 0;
    margin-left: 0;
    background: linear-gradient(to bottom, rgba(255, 253, 248, 0), var(--card) 18%);
  }

  .form-actions .btn {
    flex: 1 1 45%;
    min-height: 44px;
    padding: 0 12px;
    font-size: 14px;
  }

  .form-mode {
    width: 100%;
    margin-left: 0;
    text-align: center;
  }

  .list-toolbar {
    align-items: stretch;
    padding: 13px;
  }

  .search-box {
    flex-basis: 100%;
  }

  .filter-chips {
    flex: 1;
  }

  .chip {
    flex: 1;
    text-align: center;
  }

  .list-toolbar > .btn {
    flex: 0 0 auto;
  }

  .record-list {
    padding: 10px 12px 14px;
  }

  .record-card {
    padding: 14px;
  }

  .record-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .record-actions .btn {
    flex: 1;
  }

  .login-page {
    padding: 16px;
  }

  .login-card {
    padding: 24px;
    border-radius: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---- 智能匹配 ---- */

.match-card textarea {
  min-height: 130px;
}

.match-result-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 100%;
}

.match-result-head h2 {
  margin: 0;
  font-size: 16px;
}

.match-meta {
  color: var(--muted);
  font-size: 12px;
}

.match-score {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.match-score.is-high {
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.match-score.is-mid {
  color: #7a5218;
  background: var(--amber-soft);
}

.match-score.is-low {
  color: var(--muted);
  background: #efece4;
}

.match-source {
  color: var(--muted);
  font-size: 12px;
}

.match-result-card {
  border-left: 4px solid var(--primary);
}

.match-reasons {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.match-reasons li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.match-reasons li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}
