*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #FAFAF9;
  color: #292524;
  line-height: 1.6;
}

/* Navigation */
.top-nav {
  display: flex;
  align-items: center;
  padding: 0 40px;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #e7e5e4;
  position: sticky; top: 0; z-index: 100;
}
.nav-brand {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px; font-weight: 700; color: #292524;
}
.nav-tabs { display: flex; gap: 0; }
.nav-tab {
  display: inline-block; padding: 0 24px; line-height: 56px;
  text-decoration: none; color: #78716c; font-size: 14px;
  border-bottom: 2px solid transparent; transition: color 0.2s, border-color 0.2s;
}
.nav-tab:hover { color: #292524; }
.nav-tab.active { color: #0D9488; border-bottom-color: #0D9488; font-weight: 600; }

/* Layout */
.main-layout {
  display: flex; gap: 24px; padding: 24px 32px; max-width: 1600px; margin: 0 auto;
}
.content-area {
  flex: 1; min-width: 0;
  display: flex; justify-content: center;
}
.content-panel {
  width: 100%; max-width: 1100px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.03);
  padding: 28px;
  min-height: calc(100vh - 128px);
}
.sidebar, .right-sidebar {
  width: 180px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 16px;
}
.right-sidebar .sidebar-card {
  border-left-color: #0D9488;
}
.right-sidebar .history-item {
  padding: 10px 0;
}
.right-sidebar .history-link {
  font-size: 13px;
}
.right-sidebar .history-time {
  font-size: 11px;
}
.main-nav {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px; background: #fff; border-radius: 6px;
  border: 1px solid #e7e5e4;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 6px;
  text-decoration: none; color: #44403c;
  font-size: 14px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: #f0fdfa; color: #0D9488; }
.nav-item.active { background: #f0fdfa; color: #0D9488; font-weight: 600; }
.nav-icon { font-size: 16px; line-height: 1; }
.nav-label { line-height: 1; }
.sidebar-content { display: flex; flex-direction: column; gap: 16px; }
.sidebar-content .card { margin-bottom: 0; }

/* Page header */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.page-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px; font-weight: 700; color: #292524;
}

/* Cards */
.card {
  background: #fff; border-radius: 6px;
  border-left: 3px solid #0D9488; padding: 20px; margin-bottom: 16px;
}
.form-card { border-left-color: #e7e5e4; }
.error-card {
  background: #fef2f2; border-left-color: #dc2626; color: #991b1b; font-size: 14px;
}
.success-card {
  background: #f0fdf4; border-left-color: #16a34a; color: #166534; font-size: 14px;
}
.empty-card {
  text-align: center; padding: 40px 20px; border-left-color: #e7e5e4;
}
.empty-icon { font-size: 36px; margin-bottom: 10px; }
.empty-card h3 { font-size: 17px; margin-bottom: 6px; color: #44403c; }
.empty-card p { color: #a8a29e; font-size: 13px; margin-bottom: 16px; }

/* Form elements */
.form-group { margin-bottom: 16px; }
.form-row { display: flex; gap: 16px; }
.form-group-flex { flex: 1; }
.form-group-shrink { width: 200px; }
.form-label {
  display: block; font-size: 14px; font-weight: 600;
  margin-bottom: 6px; color: #44403c;
}
.label-hint { font-weight: 400; color: #a8a29e; font-size: 13px; }
.required { color: #dc2626; }
.form-input, .form-textarea, select.form-input {
  width: 100%; padding: 10px 12px; border: 1px solid #d6d3d1;
  border-radius: 4px; font-size: 14px; font-family: inherit;
  color: #292524; background: #fff; transition: border-color 0.2s;
}
.form-input:focus, .form-textarea:focus {
  outline: none; border-color: #0D9488;
}
.form-textarea { resize: vertical; }
.form-error { color: #dc2626; font-size: 13px; margin-top: 4px; display: block; }

/* Buttons */
.btn {
  display: inline-block; padding: 8px 20px; border: none;
  border-radius: 4px; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: background 0.2s;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: #0D9488; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #0f766e; }
.btn-danger {
  background: #fff; color: #dc2626; border: 1px solid #fca5a5;
}
.btn-danger:hover { background: #fef2f2; }
.btn-secondary {
  background: #fff; color: #44403c; border: 1px solid #d6d3d1;
}
.btn-secondary:hover { background: #f5f5f4; }
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn .form-input { flex: 1; }
.btn-ai {
  flex-shrink: 0; padding: 10px 18px;
  background: linear-gradient(135deg, #0D9488, #14b8a6);
  color: #fff; border-radius: 4px; font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; transition: opacity 0.2s; white-space: nowrap;
}
.btn-ai:hover:not(:disabled) { opacity: 0.9; }

/* Status filters */
.status-filters {
  display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap;
}
.filter-chip {
  padding: 5px 14px; border-radius: 20px; border: 1px solid #d6d3d1;
  background: #fff; color: #44403c; font-size: 13px; cursor: pointer;
  transition: all 0.2s;
}
.filter-chip:hover { border-color: #0D9488; }
.filter-chip.active {
  background: #0D9488; color: #fff; border-color: #0D9488;
}
.chip-count {
  display: inline-block; margin-left: 4px; font-size: 12px;
  padding: 0 6px; border-radius: 10px; background: rgba(0,0,0,0.08);
}
.filter-chip.active .chip-count { background: rgba(255,255,255,0.2); }

/* Job Table */
.job-table-wrap { overflow-x: auto; }
.job-table {
  width: 100%; border-collapse: collapse; font-size: 14px;
}
.job-table th {
  text-align: left; padding: 10px 12px; font-weight: 600;
  color: #78716c; font-size: 12px; border-bottom: 1px solid #e7e5e4;
  white-space: nowrap;
}
.job-table td {
  padding: 12px; border-bottom: 1px solid #f5f5f4;
  vertical-align: middle;
}
.job-row {
  cursor: pointer; transition: background 0.15s;
}
.job-row:hover { background: #f0fdfa; }
.col-name { width: auto; min-width: 160px; }
.col-city { width: 90px; }
.col-status { width: 90px; }
.col-time { width: 140px; white-space: nowrap; color: #a8a29e; font-size: 12px; }
.job-name { color: #292524; font-weight: 500; }
.job-name:hover { color: #0D9488; }

/* Status tags */
.status-tag {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 12px; font-weight: 600;
}
.status-active { background: #dcfce7; color: #166534; }
.status-closed { background: #f1f5f9; color: #64748b; }
.status-draft { background: #fef9c3; color: #854d0e; }

/* Sidebar */
.sidebar-card { border-left-color: #e7e5e4; padding: 16px; }
.sidebar-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px; font-weight: 700; margin-bottom: 10px;
}
.history-list { list-style: none; }
.history-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid #e7e5e4;
}
.history-link {
  text-decoration: none; color: #0D9488; font-size: 14px;
}
.history-link:hover { text-decoration: underline; }
.history-time { color: #a8a29e; font-size: 12px; }
.history-empty { color: #a8a29e; font-size: 14px; }
.quick-actions { display: flex; flex-direction: column; gap: 2px; }
.quick-action-item {
  display: block; padding: 8px 12px; text-decoration: none;
  color: #0D9488; font-size: 14px; border-radius: 4px;
  transition: background 0.15s;
}
.quick-action-item:hover { background: #f0fdfa; }

/* Detail page */
.detail-toolbar { margin-bottom: 12px; }
.detail-card { border-left-color: #e7e5e4; }
.detail-fields { display: flex; flex-direction: column; gap: 12px; }
.detail-field { display: flex; gap: 16px; }
.detail-label {
  flex: 0 0 80px; font-size: 14px; color: #78716c; font-weight: 500;
}
.detail-value { font-size: 14px; color: #292524; }

/* JD content rendering */
.result-card h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px; font-weight: 700; margin: 18px 0 8px; color: #292524;
}
.result-card h2:first-child { margin-top: 0; }
.result-card p, .result-card li {
  font-size: 14px; margin-bottom: 5px; color: #44403c;
}
.result-card ol, .result-card ul { padding-left: 18px; margin-bottom: 10px; }
.result-actions { margin-top: 18px; padding-top: 14px; border-top: 1px solid #e7e5e4; }

/* Match scoring in sidebar */
.match-mini { padding: 8px 0; }
.match-score-big { text-align: center; margin-bottom: 12px; }
.big-score { font-size: 36px; font-weight: 700; color: #0D9488; }
.score-unit { font-size: 16px; color: #78716c; margin-left: 4px; }
.score-bars { display: flex; flex-direction: column; gap: 8px; }
.score-bar-row {
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: #78716c;
}
.score-bar-row span:first-child { width: 28px; text-align: right; }
.score-bar-row span:last-child { width: 36px; text-align: right; font-weight: 600; color: #44403c; }
.score-bar-track {
  flex: 1; height: 6px; background: #e7e5e4; border-radius: 3px; overflow: hidden;
}
.score-bar-fill { height: 100%; background: #0D9488; border-radius: 3px; transition: width 0.4s; }

/* Upload zone */
.upload-zone {
  border: 2px dashed #d6d3d1; border-radius: 6px;
  padding: 18px; text-align: center; cursor: pointer;
  color: #78716c; font-size: 14px; transition: border-color 0.2s, background 0.2s;
}
.upload-zone:hover, .upload-zone-drag {
  border-color: #0D9488; background: #f0fdfa;
}
.upload-filename { color: #0D9488; font-weight: 600; }
.file-input-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .main-layout { flex-direction: column; padding: 20px 16px; }
  .content-area { flex: 1; }
  .sidebar { min-width: 0; }
  .form-row { flex-direction: column; }
  .form-group-shrink { width: 100%; }
}

/* Search bar */
.search-bar-wrap { margin-bottom: 16px; }
.search-input {
  max-width: 320px; padding: 10px 12px; border: 1px solid #d6d3d1;
  border-radius: 4px; font-size: 14px; font-family: inherit;
  color: #292524; background: #fff; transition: border-color 0.2s;
}
.search-input:focus { outline: none; border-color: #0D9488; }

/* Hint text */
.hint { color: #a8a29e; font-size: 13px; margin-top: 4px; }
.hint a { color: #0D9488; text-decoration: none; }
.hint a:hover { text-decoration: underline; }

/* Pagination */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; margin-top: 16px; flex-wrap: wrap;
}
.pagination-btn {
  padding: 5px 12px; border: 1px solid #d6d3d1; border-radius: 4px;
  background: #fff; color: #44403c; font-size: 13px; cursor: pointer;
  transition: all 0.15s;
}
.pagination-btn:hover:not(:disabled) { background: #f0fdfa; border-color: #0D9488; }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination-active {
  background: #0D9488; color: #fff; border-color: #0D9488;
}
.pagination-dots { padding: 5px 4px; color: #a8a29e; font-size: 13px; }

/* Confirm dialog */
.confirm-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.confirm-dialog {
  background: #fff; border-radius: 8px; padding: 24px;
  max-width: 400px; width: 90%; box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  text-align: center;
}
.confirm-dialog p { font-size: 15px; color: #292524; margin-bottom: 20px; line-height: 1.6; }
.confirm-actions { display: flex; gap: 12px; justify-content: center; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #292524; color: #fff; padding: 10px 24px;
  border-radius: 6px; font-size: 14px; z-index: 2000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  white-space: nowrap;
}

/* Tabs */
.tab-nav {
  display: flex; gap: 0; border-bottom: 2px solid #e7e5e4; margin-bottom: 20px;
}
.tab-btn {
  padding: 10px 20px; border: none; background: none;
  font-size: 14px; font-weight: 500; color: #78716c;
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: color 0.2s, border-color 0.2s;
}
.tab-btn:hover { color: #292524; }
.tab-btn.active { color: #0D9488; border-bottom-color: #0D9488; font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
