:root {
  --bg: #f9f8f5;
  --surface: #ffffff;
  --surface-muted: #f6f4ef;
  --line: #e8e4dc;
  --line-strong: #ddd6ca;
  --text: #2e2a26;
  --text-muted: #7a7168;
  --accent: #c17f45;
  --accent-hover: #a86b38;
  --shadow-soft: 0 2px 10px rgba(32, 24, 15, 0.06);
  --shadow-panel: 0 8px 30px rgba(36, 29, 21, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% -10%, #ffffff 0%, rgba(255, 255, 255, 0.75) 30%, transparent 65%),
    var(--bg);
}

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

input::placeholder,
textarea::placeholder {
  color: #9a9187;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: 100%;
  height: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-soft);
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0.2px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  padding: 7px 12px;
  font-size: 13px;
  color: #5b5148;
}

.main-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 14px;
}

.jobs-panel,
.chat-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}

.jobs-panel {
  padding: 14px;
}

.chat-panel {
  padding: 14px 14px 12px;
}

.panel-head {
  padding: 4px 2px 8px;
}

.panel-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
}

.helper-text {
  margin: 5px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
}

.jobs-list {
  margin-top: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.job-card,
.empty-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, #fcfbf9 100%);
  padding: 11px 12px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.job-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(41, 32, 21, 0.08);
}

.job-title {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.4;
}

.job-meta,
.job-desc {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #62584f;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-top: 4px;
  padding: 12px 4px 8px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.chat-msg {
  max-width: min(82%, 760px);
  border-radius: 15px;
  padding: 11px 14px;
  line-height: 1.62;
  font-size: 14px;
  word-break: break-word;
  border: 1px solid transparent;
  box-shadow: 0 1px 2px rgba(28, 22, 16, 0.04);
}

.chat-msg.assistant {
  justify-self: start;
  background: #fcfaf6;
  border-color: #ece7dc;
  color: #3a332c;
}

.chat-msg.user {
  justify-self: end;
  background: #ede8df;
  border-color: #e1d8cc;
  color: #2f2821;
}

.chat-composer {
  margin-top: 10px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  box-shadow: var(--shadow-soft);
}

.chat-composer textarea {
  resize: none;
  min-height: 66px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  background: #faf9f6;
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.chat-composer textarea:focus {
  border-color: #d9cebf;
  background: #fff;
}

.chat-input-hint {
  margin: 6px 2px 0;
  font-size: 12px;
  color: #9a9288;
}

.primary-button,
.ghost-button {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 560;
  cursor: pointer;
  transition: all 0.16s ease;
}

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

.primary-button:hover:not(:disabled) {
  background: var(--accent-hover);
}

.ghost-button {
  background: #fff;
  color: #4a433b;
}

.ghost-button:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: #faf8f4;
}

.primary-button:disabled,
.ghost-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(35, 30, 24, 0.4);
  backdrop-filter: blur(3px);
}

.overlay-card {
  width: min(94vw, 620px);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 18px;
  border: 1px solid #e7e0d4;
  background: #fffdfa;
  padding: 18px;
  display: grid;
  gap: 10px;
  box-shadow: 0 24px 60px rgba(30, 24, 18, 0.22);
}

.overlay-card h2 {
  margin: 0;
  font-size: 21px;
}

.profile-card {
  width: min(94vw, 780px);
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  font-size: 13px;
  color: #64594f;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 11px;
  background: #fff;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #d6c6b0;
  box-shadow: 0 0 0 3px rgba(193, 127, 69, 0.12);
}

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

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

.form-actions {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.form-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qr-image {
  width: 220px;
  height: 220px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

@media (max-width: 1080px) {
  .main-layout {
    grid-template-columns: 300px minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  html,
  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100%;
    padding: 14px;
  }

  .main-layout {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .jobs-panel,
  .chat-panel {
    min-height: 360px;
  }

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

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
