:root {
  --bg: #f5f9f7;
  --bg-soft: #eef7f2;
  --card: #ffffff;
  --card-hover: #f0faf4;
  --text: #1a2e24;
  --muted: #5f7368;
  --line: #dce8e0;
  --primary: #2db88a;
  --primary-dark: #239a74;
  --primary-light: #e8f7ef;
  --accent: #2db88a;
  --danger: #e85d5d;
  --warning: #e6a23c;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(45, 184, 138, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background:
    linear-gradient(180deg, #f8fcfa 0%, var(--bg) 40%, #f2f8f5 100%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--primary); }

.container { max-width: 1400px; margin: 0 auto; padding: 20px 24px 40px; }

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--card);
  margin-left: -24px;
  margin-right: -24px;
  padding-left: 24px;
  padding-right: 24px;
  box-shadow: var(--shadow);
}

.logo { font-size: 22px; font-weight: 700; color: var(--text); }
.logo span { color: var(--primary); }

.nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nav a {
  color: var(--muted);
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}
.nav a:hover, .nav a.active {
  color: var(--primary-dark);
  background: var(--primary-light);
  text-decoration: none;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
}
.user-info img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--line);
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.stats-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.stat-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 22px;
  min-width: 150px;
  flex: 1;
  box-shadow: var(--shadow);
}
.stat-item .label { font-size: 13px; color: var(--muted); }
.stat-item .value { font-size: 26px; font-weight: 700; margin-top: 6px; color: var(--primary-dark); }

/* Filters */
.filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

@media (min-width: 1100px) {
  .filters { grid-template-columns: repeat(4, 1fr); }
}

.filters input, .filters select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  width: 100%;
  min-height: 42px;
}
.filters input::placeholder { color: #9aab9f; }
.filters input:focus, .filters select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 184, 138, 0.15);
}

.filter-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 4px;
}

.filter-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  min-height: 42px;
}
.filter-checkbox input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}
.filter-checkbox:hover {
  border-color: var(--primary);
  color: var(--text);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  min-height: 42px;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
}
.btn-ghost {
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--line);
}
.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-light);
}
.btn-accent {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}
.btn-accent:hover { background: var(--primary-dark); }
.btn-sm { padding: 6px 14px; font-size: 13px; min-height: 32px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Table */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.job-table {
  table-layout: fixed;
  min-width: 1200px;
}
table.job-table th,
table.job-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  max-height: 48px;
}
.cell-ellipsis {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.cell-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  white-space: normal;
  line-height: 1.35;
  max-height: 2.7em;
  word-break: break-all;
}
.col-update { width: 96px; }
.col-company { width: 120px; }
.col-type { width: 72px; }
.col-industry { width: 130px; }
.col-recruit { width: 80px; }
.col-position { width: 130px; }
.col-location { width: 80px; }
.col-deadline { width: 100px; }
.col-link { width: 96px; }
.col-fav { width: 48px; text-align: center; }
.col-status { width: 108px; }
th, td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  background: var(--bg-soft);
  white-space: nowrap;
}
tr:hover td { background: var(--card-hover); }

.company-cell { font-weight: 600; min-width: 120px; color: var(--text); }
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  background: var(--primary-light);
  color: var(--primary-dark);
  margin: 2px;
  white-space: nowrap;
}
.deadline-soon { color: var(--warning); font-weight: 600; }

.status-select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  padding: 6px 8px;
  font-size: 13px;
  cursor: pointer;
  max-width: 120px;
}
.status-not_applied { border-color: var(--line); color: var(--muted); }
.status-applied { border-color: #5b9bd5; color: #3a7fb8; }
.status-written_test { border-color: #9b7fd4; color: #7a5fb8; }
.status-interview { border-color: var(--warning); color: #c4841a; }
.status-offer { border-color: var(--primary); color: var(--primary-dark); }
.status-rejected { border-color: var(--danger); color: var(--danger); }
.status-give_up { border-color: var(--muted); color: var(--muted); }

.link-cell {
  color: var(--primary-dark);
  text-decoration: none;
  word-break: break-all;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.link-cell:hover { text-decoration: underline; color: var(--primary); }

.fav-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #c5d0c8;
  padding: 2px 6px;
  line-height: 1;
  transition: color 0.2s, transform 0.15s;
}
.fav-btn:hover { color: var(--warning); transform: scale(1.1); }
.fav-btn.active { color: #f5a623; }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  font-size: 14px;
  color: var(--muted);
}

/* Login */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: linear-gradient(180deg, #f8fcfa, var(--bg));
}
.login-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
}
.login-card h1 { font-size: 28px; margin-bottom: 8px; color: var(--text); }
.login-card p { color: var(--muted); margin-bottom: 24px; }
.login-card .btn { width: 100%; justify-content: center; margin-bottom: 12px; }
.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 12px;
  margin-bottom: 10px;
  font-size: 14px;
}
.login-card input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 184, 138, 0.15);
}
.dev-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  text-align: left;
}
.dev-section h3 { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.dev-section input {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 14px;
}

/* Profile */
.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}
.profile-header img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid var(--primary);
}
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}
.status-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}
.status-card:hover, .status-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
}
.status-card .count { font-size: 28px; font-weight: 700; color: var(--primary-dark); }
.status-card .name { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* Admin */
.upload-zone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 24px;
  background: var(--bg-soft);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.upload-zone input { display: none; }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 14px;
  z-index: 999;
  animation: slideIn 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  color: var(--text);
}
.toast.success { border-color: var(--primary); }
.toast.error { border-color: var(--danger); }

@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-state h3 { margin-bottom: 8px; color: var(--text); }

.update-recent {
  color: var(--primary-dark);
  font-weight: 600;
}
.update-time-cell {
  white-space: nowrap;
  font-size: 13px;
  min-width: 96px;
}

.position-cell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h2 { color: var(--text); }

@media (max-width: 768px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .header { flex-direction: column; align-items: flex-start; }
  th, td { padding: 8px; font-size: 13px; }
  .filter-actions { flex-direction: column; align-items: stretch; }
  .filter-checkbox { justify-content: center; }
}
