:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --line: #d7dde7;
  --text: #20242c;
  --muted: #697386;
  --accent: #176f5a;
  --accent-weak: #e5f3ee;
  --warn: #9a5c13;
  --danger: #b42318;
  --gold: #ffd700;
  --gold-deep: #8a5a00;
  --gold-soft: #fff7bf;
  --silver: #e3e7ed;
  --silver-deep: #4b5563;
  --silver-border: #aab2bf;
  --shadow: 0 10px 28px rgba(31, 43, 59, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

[hidden] {
  display: none !important;
}

.app-shell {
  width: min(1500px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 330px);
  gap: 16px;
  align-items: stretch;
}

.brand-block {
  min-width: 0;
}

.title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1.2;
  font-weight: 750;
}

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

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

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  box-shadow: 0 4px 14px rgba(31, 43, 59, 0.05);
}

.nav-link:hover,
.nav-link.active {
  border-color: var(--accent);
  background: var(--accent-weak);
  color: #105544;
}

.summary-strip {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.summary-strip > div {
  min-width: 104px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.summary-strip .summary-gold {
  border-color: #d7b300;
  background: linear-gradient(135deg, #fffbe0, #fff2a4);
}

.summary-strip .summary-time {
  min-width: 182px;
}

.summary-strip span {
  display: block;
  font-size: 22px;
  font-weight: 750;
  line-height: 1.1;
}

.summary-strip .summary-time span {
  font-size: 15px;
  line-height: 1.45;
}

.summary-strip small {
  color: var(--muted);
  font-size: 12px;
}

.auth-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
}

.auth-form strong {
  grid-column: 1 / -1;
  font-size: 14px;
}

.auth-form input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
}

.auth-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}

.primary-button,
.auth-user button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 650;
}

.auth-user {
  display: grid;
  gap: 6px;
}

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

.auth-user strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-user button {
  justify-self: start;
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

.auth-message {
  min-height: 18px;
  margin: 8px 0 0 !important;
  font-size: 12px !important;
}

.auth-message.error {
  color: var(--danger);
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) repeat(5, minmax(125px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.field > span,
.field-label {
  color: var(--muted);
  font-size: 12px;
}

.field input,
.field select,
.list-head select,
.applied-toolbar input,
.applied-toolbar select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.field input,
.applied-toolbar input {
  padding: 0 12px;
}

.field select,
.list-head select,
.applied-toolbar select {
  padding: 0 9px;
}

.field input:focus,
.field select:focus,
.list-head select:focus,
.applied-toolbar input:focus,
.applied-toolbar select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}

.actions {
  display: flex;
  align-items: end;
}

.actions button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 82px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fdfdfd;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}

.actions button:hover,
.secondary-button:hover {
  border-color: var(--accent);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(520px, 1.35fr);
  gap: 14px;
  height: calc(100vh - 245px);
  min-height: 520px;
}

.list-panel,
.detail-panel,
.applied-panel {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.list-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.list-head select {
  max-width: 190px;
}

.result-list {
  min-height: 0;
  overflow: auto;
}

.result-item {
  width: 100%;
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid #edf0f4;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.result-item:hover,
.result-item.active {
  background: var(--accent-weak);
}

.result-title,
.detail-title-row,
.application-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.result-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill,
.status-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-labels {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.result-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.result-has_result {
  border-color: #5bb59f;
  background: #ddf5ed;
  color: #075e4b;
}

.result-no_result {
  border-color: #b7c4d4;
  background: #edf2f7;
  color: #4a6078;
}

.pill {
  background: #eef1f5;
  color: #3d4653;
  font-weight: 500;
}

.status-label {
  border: 1px solid transparent;
  letter-spacing: 0.02em;
}

.status-applied {
  border-color: #c9a600;
  background: linear-gradient(135deg, #fff8b8 0%, var(--gold) 55%, #ffeb75 100%);
  color: #5d3c00;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 2px 7px rgba(160, 118, 0, 0.22);
}

.status-unapplied {
  border-color: var(--silver-border);
  background: linear-gradient(135deg, #f9fafb 0%, var(--silver) 52%, #cfd5de 100%);
  color: var(--silver-deep);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 2px 6px rgba(75, 85, 99, 0.14);
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.positions-preview {
  display: -webkit-box;
  overflow: hidden;
  color: #303743;
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.detail-panel {
  overflow: auto;
  padding: 18px;
}

.empty-state {
  display: grid;
  min-height: 100%;
  padding: 28px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.empty-state.compact {
  min-height: 180px;
}

.detail-header {
  display: grid;
  gap: 9px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.detail-header h2 {
  margin: 0;
  font-size: 25px;
}

.application-box {
  margin: 14px 0;
  padding: 13px;
  border: 1px solid #d6c56b;
  border-radius: 9px;
  background: linear-gradient(135deg, #fffdf0, #fff9cf);
}

.application-heading > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.application-heading small {
  color: var(--muted);
}

.application-box p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.status-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px));
  gap: 9px;
  margin-top: 12px;
}

.status-choice {
  min-height: 40px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 750;
}

.status-choice-applied {
  border: 1px solid #c8a500;
  background: var(--gold-soft);
  color: var(--gold-deep);
}

.status-choice-applied.selected,
.status-choice-applied:hover:not(:disabled) {
  background: var(--gold);
  box-shadow: 0 4px 12px rgba(158, 118, 0, 0.23);
}

.status-choice-unapplied {
  border: 1px solid var(--silver-border);
  background: #f7f8fa;
  color: var(--silver-deep);
}

.status-choice-unapplied.selected,
.status-choice-unapplied:hover:not(:disabled) {
  background: var(--silver);
  box-shadow: 0 4px 12px rgba(75, 85, 99, 0.16);
}

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

.info-box {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.info-box span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.info-box strong,
.info-box div {
  overflow-wrap: anywhere;
}

.section-title {
  margin: 18px 0 8px;
  font-size: 16px;
}

.position-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.position-list li {
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: #f8fafb;
  line-height: 1.55;
}

.link-list {
  display: grid;
  gap: 7px;
}

.link-list a {
  overflow-wrap: anywhere;
  color: #1769aa;
}

.notes {
  white-space: pre-wrap;
  line-height: 1.6;
}

.warning {
  color: var(--warn);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1000;
  max-width: min(420px, calc(100vw - 30px));
  padding: 11px 15px;
  border: 1px solid #9dc8ba;
  border-radius: 8px;
  background: #e8f7f1;
  color: #125946;
  box-shadow: 0 12px 30px rgba(31, 43, 59, 0.18);
}

.toast-error {
  border-color: #f0aaa4;
  background: #fff0ef;
  color: var(--danger);
}

/* 已投递岗位页面 */
.applied-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

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

.applied-user {
  max-width: 260px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.applied-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 180px auto;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.applied-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(520px, 1.35fr);
  gap: 14px;
  height: calc(100vh - 190px);
  min-height: 560px;
}

.applied-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.applied-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.result-status-box {
  display: flex;
  align-items: end;
  gap: 10px;
  margin: 14px 0;
  padding: 13px;
  border: 1px solid #b7d5cd;
  border-radius: 9px;
  background: #f4fbf8;
}

.result-status-box .field {
  width: min(260px, 100%);
}

.result-status-saving {
  min-height: 38px;
  padding-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .auth-card {
    max-width: none;
  }

  .content-grid {
    height: calc(100vh - 330px);
  }
}

@media (max-width: 1040px) {
  .controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .actions {
    align-items: stretch;
  }

  .actions button {
    width: 100%;
  }

  .content-grid,
  .applied-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .list-panel,
  .applied-panel {
    height: 48vh;
    min-height: 360px;
  }

  .detail-panel {
    min-height: 480px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 18px, 1500px);
    padding-top: 11px;
  }

  .title-row,
  .applied-page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .page-nav,
  .applied-header-actions {
    justify-content: flex-start;
  }

  .summary-strip > div {
    flex: 1 1 calc(50% - 8px);
  }

  .summary-strip .summary-time {
    min-width: 0;
  }

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

  .auth-form strong {
    grid-column: auto;
  }

  .controls,
  .detail-grid,
  .applied-toolbar {
    grid-template-columns: 1fr;
  }

  .status-toggle {
    grid-template-columns: 1fr 1fr;
  }

  .detail-title-row,
  .application-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-status-box {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 430px) {
  h1 {
    font-size: 23px;
  }

  .summary-strip > div {
    flex-basis: 100%;
  }

  .status-toggle {
    grid-template-columns: 1fr;
  }
}
