:root {
  --ink: #202544;
  --muted: #68708d;
  --surface: #ffffff;
  --page: #f6f7ff;
  --line: #dfe3f3;
  --primary: #6757dc;
  --primary-dark: #5040c3;
  --primary-soft: #eeecff;
  --amber: #9a5b07;
  --amber-soft: #fff2d9;
  --red: #a83e3e;
  --red-soft: #fceaea;
  --blue: #3974d9;
  --blue-soft: #eaf2ff;
  --shadow: 0 18px 44px rgba(71, 64, 151, 0.1);
  color-scheme: light;
  font-family:
    "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 0%, rgba(105, 88, 226, 0.14), transparent 30rem),
    radial-gradient(circle at 4% 28%, rgba(73, 145, 230, 0.08), transparent 24rem),
    var(--page);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
label[for] {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  padding: 48px max(24px, calc((100vw - 1080px) / 2));
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 72px;
  align-items: center;
}

.auth-intro {
  max-width: 680px;
}

.auth-intro .brand-logo-wide {
  margin-bottom: 34px;
}

.brand-logo-wide {
  display: block;
  width: min(520px, 100%);
  aspect-ratio: 1952 / 806;
  flex: 0 0 auto;
}

.brand-logo-wide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-intro h1 {
  margin-top: 12px;
}

.auth-intro p {
  max-width: 580px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.auth-card {
  display: flex;
  padding: 34px;
  gap: 16px;
  flex-direction: column;
}

.auth-card > div {
  margin-bottom: 8px;
}

.auth-access-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.auth-help-link {
  width: fit-content;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.auth-help-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-field,
.converter-field {
  display: flex;
  gap: 7px;
  flex-direction: column;
}

.auth-field span,
.converter-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.auth-field input,
.converter-field select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: white;
}

.password-input-wrap {
  position: relative;
  width: 100%;
}

.auth-field .password-input-wrap input {
  padding-right: 46px;
}

.password-visibility-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: inline-flex;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: transparent;
  transform: translateY(-50%);
}

.password-visibility-toggle:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.password-visibility-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.password-visibility-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-field input:focus,
.converter-field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(103, 87, 220, 0.14);
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(223, 227, 243, 0.9);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
}

.header-inner,
.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-logo-symbol {
  display: flex;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  align-items: center;
  justify-content: center;
}

.brand-logo-symbol img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.14em;
}

.main-nav {
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: 12px;
  background: #eff0fa;
}

.header-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}

.current-user {
  color: var(--muted);
  font-size: 12px;
}

.nav-button {
  padding: 9px 16px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
}

.nav-button:hover,
.nav-button.active {
  color: var(--ink);
  background: white;
  box-shadow: 0 2px 10px rgba(67, 62, 131, 0.11);
}

.help-nav-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.page-shell {
  padding: 64px 0 80px;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
  animation: panel-in 220ms ease-out;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

.hero-copy {
  max-width: 760px;
  margin-bottom: 36px;
}

.eyebrow,
.step-label {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-family: "STSong", "SimSun", serif;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.18;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.hero-copy p,
.section-title-row p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.upload-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.85fr);
  gap: 22px;
}

.card {
  border: 1px solid rgba(223, 227, 243, 0.94);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.upload-card,
.process-note,
.progress-card,
.filter-card,
.detail-summary,
.raw-text-card {
  padding: 28px;
}

.card-heading,
.progress-header,
.section-title-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
}

.raw-text-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.step-label {
  display: block;
  margin-bottom: 7px;
}

.quiet-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: #f0f1f8;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.file-picker {
  display: flex;
  min-height: 220px;
  margin: 26px 0 18px;
  padding: 30px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 1.5px dashed #b9c0df;
  border-radius: 16px;
  background: #fafaff;
  text-align: center;
  transition: 160ms ease;
}

.converter-field {
  margin-bottom: 18px;
}

.converter-field small {
  color: var(--muted);
  line-height: 1.5;
}

.file-picker:hover,
.file-picker:focus-within,
.file-picker:focus-visible,
.file-picker.drag-active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.file-picker.drag-active {
  border-style: solid;
  box-shadow: inset 0 0 0 2px rgba(103, 87, 220, 0.13);
  transform: translateY(-2px);
}

.file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.file-picker strong {
  margin-bottom: 7px;
}

.file-picker > span:last-of-type {
  color: var(--muted);
  font-size: 13px;
}

.file-icon {
  display: grid;
  width: 62px;
  height: 72px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 8px 18px 8px 8px;
  color: white;
  background: var(--red);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 24px rgba(168, 62, 62, 0.18);
}

.selected-files {
  display: flex;
  margin: -4px 0 18px;
  gap: 10px;
  flex-direction: column;
}

.metadata-step-banner {
  display: flex;
  min-width: 0;
  padding: 12px 14px;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(103, 87, 220, 0.2);
  border-radius: 12px;
  color: var(--primary);
  background: linear-gradient(135deg, rgba(111, 95, 229, 0.11), rgba(85, 123, 220, 0.08));
}

.metadata-step-banner > div:first-child {
  display: flex;
  min-width: 0;
  gap: 4px;
  flex-direction: column;
}

.metadata-step-banner strong {
  font-size: 14px;
}

.metadata-step-banner span {
  color: var(--muted);
  font-size: 11px;
}

.metadata-step-dots {
  display: flex;
  max-width: 42%;
  gap: 5px;
  overflow: hidden;
}

.metadata-step-dots span {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #d7d9e8;
}

.metadata-step-dots span.confirmed {
  background: #8e83e5;
}

.metadata-step-dots span.active {
  width: 20px;
  flex-basis: 20px;
  border-radius: 999px;
  background: linear-gradient(90deg, #755fe8, #557bdc);
}

.selected-file {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfbff;
}

.selected-file-summary {
  display: grid;
  min-width: 0;
  gap: 10px;
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.selected-file-index {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 11px;
  font-weight: 800;
}

.selected-file-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file-summary small {
  color: var(--muted);
  white-space: nowrap;
}

.selected-file-summary button {
  padding: 4px;
  border: 0;
  color: var(--red);
  background: transparent;
  font-size: 12px;
}

.selected-file-metadata {
  display: grid;
  margin-top: 12px;
  padding-top: 12px;
  gap: 10px 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid #e8eaf5;
}

.candidate-metadata-field {
  display: flex;
  min-width: 0;
  gap: 6px;
  flex-direction: column;
}

.candidate-metadata-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.candidate-metadata-field input,
.candidate-metadata-field select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  color: var(--ink);
  background: white;
}

.candidate-metadata-field input:focus,
.candidate-metadata-field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(103, 87, 220, 0.14);
}

.candidate-metadata-help {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.metadata-step-actions {
  display: grid;
  margin-top: 14px;
  padding-top: 14px;
  gap: 10px;
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr) auto;
  border-top: 1px solid #e8eaf5;
}

.metadata-step-actions .metadata-skip {
  justify-self: center;
  color: var(--muted);
}

.metadata-step-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.candidate-supplement-card {
  margin-top: 20px;
  padding: 28px;
}

.candidate-supplement-card .card-heading > div {
  min-width: 0;
}

.candidate-supplement-card h2,
.candidate-supplement-card .section-help {
  overflow-wrap: anywhere;
}

.candidate-supplement-form {
  display: grid;
  gap: 14px 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.candidate-supplement-actions {
  display: flex;
  grid-column: 1 / -1;
  gap: 14px;
  align-items: center;
}

.candidate-supplement-actions .form-error {
  margin: 0;
}

.structured-editor-card,
.resume-history-card {
  margin-bottom: 20px;
  padding: 28px;
}

.structured-editor-card {
  margin-top: 20px;
}

.structured-editor-loading {
  margin: 22px 0 0;
  color: var(--muted);
}

.structured-editor-form {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.structured-section {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.structured-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.structured-section-heading,
.structured-entry-heading,
.version-item-heading {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.structured-section-heading h3,
.resume-version-grid h3 {
  margin: 0;
  font-size: 15px;
}

.structured-section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.structured-entry-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.structured-entry {
  padding: 18px;
  border: 1px solid #e0e3f1;
  border-radius: 14px;
  background: #f8f8ff;
}

.structured-entry-heading {
  margin-bottom: 14px;
}

.structured-entry-heading strong {
  font-size: 13px;
}

.structured-remove-button {
  color: var(--red);
  font-size: 12px;
}

.structured-field-grid {
  display: grid;
  gap: 12px 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.structured-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.structured-field-wide {
  grid-column: 1 / -1;
}

.structured-field input,
.structured-field textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid #cfd4e9;
  border-radius: 9px;
  outline: none;
  color: var(--ink);
  background: white;
  font: inherit;
  font-size: 15px;
  line-height: 1.6;
}

.structured-field input {
  height: 40px;
}

.structured-field textarea {
  min-height: 104px;
  resize: vertical;
}

.structured-entry[data-structured-item="work"]
  textarea[data-structured-field="details"] {
  min-height: 208px;
}

.structured-field input:focus,
.structured-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(103, 87, 220, 0.14);
}

.structured-editor-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.structured-editor-actions .form-error {
  margin: 0;
  flex: 1 1 240px;
}

.structured-empty,
.version-empty {
  margin: 0;
  padding: 14px;
  border-radius: 10px;
  color: var(--muted);
  background: #f6f7fc;
  font-size: 12px;
}

.primary-button,
.secondary-button,
.text-button {
  border-radius: 10px;
  font-weight: 700;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, #6f5fe5, #557bdc);
  box-shadow: 0 8px 18px rgba(91, 77, 200, 0.18);
}

.primary-button:hover {
  background: linear-gradient(135deg, #5949cf, #4168c3);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.upload-card > .primary-button {
  width: 100%;
}

.secondary-button {
  color: var(--ink);
  border-color: var(--line);
  background: white;
}

.secondary-button:hover {
  border-color: #aeb6da;
  background: #fafaff;
}

.compact {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 13px;
}

.process-note {
  color: #dfe3fa;
  background: linear-gradient(150deg, #343361, #252846);
}

.process-note h2 {
  color: white;
}

.compact-flow {
  margin: 30px 0;
  padding: 0;
  list-style: none;
}

.compact-flow li {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #eef0ff;
  font-size: 14px;
}

.compact-flow li span {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  border-radius: 50%;
  color: #e8e4ff;
  background: rgba(139, 123, 242, 0.24);
  font-size: 11px;
}

.process-note > p {
  margin-bottom: 0;
  font-size: 13px;
  line-height: 1.7;
}

.privacy-note {
  display: flex;
  margin-top: 18px;
  padding: 14px;
  gap: 5px;
  flex-direction: column;
  border-radius: 10px;
  color: #e1e4fa;
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  line-height: 1.6;
}

.privacy-note strong {
  color: white;
}

.progress-card {
  margin-top: 22px;
}

.upload-queue {
  display: grid;
  margin-top: 22px;
  gap: 12px;
}

.upload-queue-item {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfbff;
}

.upload-queue-item.has-error {
  border-color: #f2caca;
  background: #fffafa;
}

.upload-queue-heading {
  display: grid;
  min-width: 0;
  gap: 12px;
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.upload-queue-heading > div {
  min-width: 0;
}

.upload-queue-heading strong,
.upload-queue-heading small {
  display: block;
}

.upload-queue-heading strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-queue-heading small {
  margin-top: 4px;
  color: var(--muted);
}

.upload-queue-item .progress-steps {
  margin: 20px 0 4px;
}

.queue-actions {
  display: flex;
  margin-top: 12px;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.progress-header {
  align-items: center;
}

.progress-header .eyebrow {
  display: block;
  margin-bottom: 6px;
}

.progress-steps {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 28px 0 18px;
}

.progress-step {
  position: relative;
  min-width: 0;
  padding: 25px 4px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-align: center;
}

.progress-step::before {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 50%;
  width: 13px;
  height: 13px;
  border: 4px solid white;
  border-radius: 50%;
  background: #cdd1e2;
  box-shadow: 0 0 0 1px #cdd1e2;
  content: "";
  transform: translateX(-50%);
}

.progress-step:not(:first-child)::after {
  position: absolute;
  top: 8px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: #e0e3ef;
  content: "";
}

.progress-step.done,
.progress-step.current {
  color: var(--primary);
  font-weight: 700;
}

.progress-step.done::before,
.progress-step.current::before,
.progress-step.done::after,
.progress-step.current::after {
  background: var(--primary);
}

.progress-step.current::before {
  box-shadow: 0 0 0 4px rgba(103, 87, 220, 0.18);
}

.progress-message {
  margin-bottom: 0;
  color: var(--muted);
}

.progress-message.error {
  color: var(--red);
}

.status-badge.completed {
  color: var(--primary);
  background: var(--primary-soft);
}

.status-badge.processing {
  color: var(--blue);
  background: var(--blue-soft);
}

.status-badge.error {
  color: var(--red);
  background: var(--red-soft);
}

.status-badge.ocr {
  color: var(--amber);
  background: var(--amber-soft);
}

.download-button {
  display: inline-flex;
  min-height: 42px;
  margin-top: 18px;
  padding: 9px 16px;
  align-items: center;
  border-radius: 10px;
  color: white;
  background: linear-gradient(135deg, #6f5fe5, #557bdc);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.download-button.original {
  margin-left: 8px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: white;
}

.section-title-row {
  margin-bottom: 28px;
  align-items: flex-end;
}

.section-title-row h1 {
  margin: 6px 0 4px;
}

.section-title-row p {
  margin-bottom: 0;
  font-size: 14px;
}

.filter-card {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(120px, 0.65fr)) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 20px;
}

.search-field {
  display: flex;
  min-width: 0;
  gap: 7px;
  flex-direction: column;
}

.search-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.search-field input,
.search-field select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  color: var(--ink);
  background: white;
}

.search-field input:focus,
.search-field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(103, 87, 220, 0.14);
}

.checkbox-filter-control {
  display: flex;
  height: 42px;
  padding: 0 12px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink) !important;
  background: white;
  font-size: 13px !important;
  font-weight: 600 !important;
  white-space: nowrap;
}

.checkbox-filter-control input {
  width: 16px;
  height: 16px;
  padding: 0;
}

.filter-actions {
  display: flex;
  gap: 8px;
}

.table-card {
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
}

.library-pagination {
  display: flex;
  padding: 16px 14px;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #eef0f8;
  background: #fbfbff;
}

.page-size-control,
.pagination-navigation {
  display: flex;
  gap: 9px;
  align-items: center;
}

.page-size-control {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.page-size-control select {
  height: 38px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  color: var(--ink);
  background: white;
}

.page-size-control select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(103, 87, 220, 0.14);
}

.page-status {
  min-width: 92px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.pagination-button:disabled,
.pagination-button:disabled:hover {
  cursor: not-allowed;
  opacity: 0.5;
  border-color: var(--line);
  background: white;
}

.resume-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.resume-table th,
.resume-table td {
  padding: 16px 14px;
  border-bottom: 1px solid #eef0f8;
  text-align: left;
  white-space: nowrap;
}

.resume-table th {
  color: var(--muted);
  background: #f8f8fe;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.resume-table tbody tr:hover {
  background: #fafaff;
}

.resume-table tbody tr.deleted-resume-row {
  background: #fff8f8;
  opacity: 0.82;
}

.deleted-badge {
  display: inline-flex;
  margin-left: 7px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #9b3f53;
  background: #fde9ed;
  font-size: 10px;
  font-weight: 800;
  vertical-align: middle;
}

.resume-table th.position-column,
.resume-table td.position-cell {
  width: 8.5rem;
  padding-right: 7px;
}

.resume-table th.experience-column,
.resume-table td.experience-cell {
  width: 6.25rem;
  padding-left: 7px;
}

.position-toggle {
  max-width: 100%;
  padding: 3px 5px;
  border: 0;
  border-radius: 6px;
  color: var(--primary);
  background: transparent;
  font: inherit;
  line-height: 1.45;
  text-align: left;
  white-space: nowrap;
}

.position-toggle:hover,
.position-toggle:focus-visible {
  background: rgba(103, 87, 220, 0.1);
}

.position-toggle:focus-visible {
  outline: 2px solid rgba(103, 87, 220, 0.38);
  outline-offset: 1px;
}

.filename-cell {
  max-width: 220px;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
}

.view-button,
.text-button {
  padding: 6px 0;
  border: 0;
  color: var(--primary);
  background: transparent;
}

.view-button {
  font-weight: 700;
}

.row-actions {
  white-space: nowrap;
}

.row-actions .view-button + .view-button {
  margin-left: 12px;
}

.edit-button {
  color: var(--blue);
}

.delete-button,
.permanent-delete-button {
  color: #b23a52;
}

.restore-button {
  color: #24765c;
}

.cancel-button {
  color: var(--muted);
}

.editing-row {
  background: #f7f6ff;
}

.inline-edit-label {
  display: block;
  min-width: 112px;
}

.inline-edit-label input {
  width: 100%;
  min-width: 112px;
  height: 36px;
  padding: 0 9px;
  border: 1px solid #aeb6da;
  border-radius: 8px;
  outline: none;
  background: white;
}

.inline-edit-label input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(103, 87, 220, 0.14);
}

.row-edit-error {
  display: block;
  max-width: 160px;
  margin-top: 4px;
  color: var(--red);
  white-space: normal;
}

.loading-state,
.empty-state {
  padding: 60px 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-direction: column;
}

.empty-state strong {
  color: var(--ink);
}

.detail-title-row {
  margin-top: 22px;
}

.detail-title-row #detail-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.detail-title-row #detail-actions > * {
  display: inline-flex;
  min-height: 44px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.detail-title-row #detail-actions .download-button {
  margin-top: 0;
}

.detail-title-row #detail-actions .download-button.original {
  margin-left: 0;
}

.compact-heading {
  align-items: center;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.progress-steps.small {
  margin-bottom: 4px;
}

.field-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 20px 0 0;
}

.field-pair {
  padding: 12px 0;
  border-bottom: 1px solid #eef0f8;
}

.field-pair:nth-child(odd) {
  padding-right: 18px;
}

.field-pair dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
}

.field-pair dd {
  margin: 0;
  word-break: break-word;
}

.raw-text-card pre {
  max-height: 560px;
  margin: 22px 0 0;
  padding: 22px;
  overflow: auto;
  border-radius: 12px;
  color: #2b3155;
  background: #f6f7fc;
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 13px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
}

.contact-card {
  margin-bottom: 20px;
  padding: 28px;
}

.resume-feedback-card {
  margin-bottom: 20px;
  padding: 28px;
}

.resume-feedback-form {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.resume-feedback-form label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.resume-feedback-form textarea {
  width: 100%;
  min-height: 112px;
  padding: 13px 14px;
  resize: vertical;
  border: 1px solid #cfd4e9;
  border-radius: 10px;
  color: var(--ink);
  background: #fbfbff;
  line-height: 1.65;
}

.resume-feedback-form textarea:focus {
  border-color: var(--primary);
  outline: 3px solid var(--primary-soft);
}

.feedback-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}

.feedback-actions .form-error {
  margin: 0;
}

.feedback-history,
.feedback-admin-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.feedback-item {
  padding: 13px 14px;
  border: 1px solid #e2e4f2;
  border-radius: 10px;
  background: #f8f8ff;
}

.feedback-item p {
  margin: 7px 0 0;
  line-height: 1.65;
  white-space: pre-wrap;
}

.feedback-item-meta {
  color: var(--muted);
  font-size: 11px;
}

.feedback-admin-card {
  grid-column: 1 / -1;
}

.feedback-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.resume-version-grid {
  display: grid;
  gap: 20px;
  margin-top: 22px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.version-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.version-item {
  padding: 15px;
  border: 1px solid #e2e4f2;
  border-radius: 12px;
  background: #f8f8ff;
}

.version-item-heading strong {
  font-size: 13px;
}

.version-item-heading time {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.version-metadata {
  display: grid;
  gap: 7px;
  margin: 13px 0 0;
}

.version-metadata > div {
  display: grid;
  gap: 8px;
  grid-template-columns: 64px minmax(0, 1fr);
}

.version-metadata dt {
  color: var(--muted);
  font-size: 11px;
}

.version-metadata dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.version-download {
  display: inline-flex;
  min-height: 34px;
  margin-top: 13px;
  padding: 7px 11px;
  align-items: center;
  font-size: 12px;
}

.contact-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.contact-item {
  padding: 13px;
  border-radius: 10px;
  background: #f6f7fc;
}

.contact-item small,
.contact-item strong {
  display: block;
}

.contact-item small {
  margin-bottom: 4px;
  color: var(--muted);
}

.contact-item strong {
  overflow-wrap: anywhere;
}

.contact-value {
  display: block;
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

a.contact-value:hover {
  color: var(--primary);
}

.section-help {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.contact-private-message {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.settings-card {
  padding: 28px;
}

.settings-card > p {
  margin: 18px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.admin-user-form {
  display: grid;
  gap: 14px;
}

.admin-user-form .primary-button {
  justify-self: start;
}

.admin-user-form .form-error {
  margin: -4px 0 0;
}

.simple-file-field {
  display: flex;
  margin: 18px 0;
  padding: 16px;
  gap: 8px;
  flex-direction: column;
  border: 1px dashed #b9c0df;
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
}

.settings-actions {
  display: flex;
  gap: 9px;
}

.placeholder-help {
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.placeholder-help code {
  display: block;
  margin-top: 10px;
  padding: 14px;
  border-radius: 8px;
  color: var(--ink);
  background: #f6f7fc;
  line-height: 1.8;
  white-space: normal;
}

.provider-list {
  display: flex;
  margin-top: 20px;
  gap: 10px;
  flex-direction: column;
}

.provider-row {
  display: flex;
  padding: 13px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.provider-row span {
  font-size: 13px;
  font-weight: 700;
}

.provider-row small {
  color: var(--muted);
}

.form-error {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--red);
  font-size: 13px;
}

.modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 30, 61, 0.7);
  backdrop-filter: blur(5px);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(1040px, 100%);
  height: min(88vh, 900px);
  overflow: hidden;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 18px;
  background: white;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.3);
}

.modal-header,
.modal-actions {
  display: flex;
  padding: 18px 22px;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  max-width: 780px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-close {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: #f0f1f8;
  font-size: 25px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--ink);
  background: #e5e7f3;
}

.preview-frame {
  width: 100%;
  min-height: 0;
  flex: 1;
  border: 0;
  background: #e9ebf5;
}

.preview-loading {
  display: grid;
  flex: 1;
  place-items: center;
  color: var(--muted);
}

.preview-error {
  margin: auto;
  padding: 28px;
  text-align: center;
}

.modal-actions {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.modal-actions > div {
  display: flex;
  gap: 8px;
  align-items: center;
}

.modal-actions .download-button {
  min-height: 38px;
  margin-top: 0;
  padding: 8px 14px;
  font-size: 13px;
}

.preview-note {
  color: var(--muted);
  font-size: 12px;
}

body.modal-open {
  overflow: hidden;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  max-width: min(380px, calc(100% - 48px));
  padding: 13px 18px;
  border-radius: 12px;
  color: white;
  background: #292b50;
  box-shadow: 0 16px 36px rgba(41, 43, 80, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .filter-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-field.wide {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .auth-shell {
    padding: 36px 18px;
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .auth-intro h1 {
    font-size: 34px;
  }

  .brand-logo-wide {
    width: min(440px, 100%);
  }

  .header-inner,
  .page-shell {
    width: min(100% - 24px, 1180px);
  }

  .header-inner {
    min-height: 64px;
    align-items: flex-start;
    padding: 10px 0;
  }

  .brand small {
    display: none;
  }

  .brand-logo-symbol {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
  }

  .main-nav {
    padding: 3px;
  }

  .header-actions {
    gap: 6px;
    align-items: flex-end;
    flex-direction: column-reverse;
  }

  .current-user {
    display: none;
  }

  .nav-button {
    padding: 8px 10px;
    font-size: 13px;
  }

  .page-shell {
    padding-top: 36px;
  }

  .upload-layout,
  .detail-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .section-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-card {
    grid-template-columns: 1fr;
  }

  .search-field.wide {
    grid-column: auto;
  }

  .filter-actions .primary-button,
  .filter-actions .secondary-button {
    flex: 1;
  }

  .library-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .page-size-control,
  .pagination-navigation {
    justify-content: center;
  }

  .pagination-navigation .pagination-button {
    flex: 1;
  }

  .upload-card,
  .process-note,
  .progress-card,
  .filter-card,
  .detail-summary,
  .candidate-supplement-card,
  .structured-editor-card,
  .resume-history-card,
  .raw-text-card {
    padding: 20px;
  }

  .progress-step {
    font-size: 10px;
  }

  .field-list {
    grid-template-columns: 1fr;
  }

  .field-pair:nth-child(odd) {
    padding-right: 0;
  }

  .contact-list {
    grid-template-columns: 1fr;
  }

  .selected-file-summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .selected-file-summary > small {
    display: none;
  }

  .selected-file-metadata {
    grid-template-columns: 1fr;
  }

  .metadata-step-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .metadata-step-dots {
    max-width: 100%;
  }

  .metadata-step-actions {
    grid-template-columns: 1fr 1fr;
  }

  .metadata-step-actions .metadata-skip {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .candidate-supplement-form {
    grid-template-columns: 1fr;
  }

  .candidate-supplement-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .raw-text-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .raw-text-card .card-heading {
    flex-direction: column;
  }

  .structured-section-heading,
  .structured-editor-actions,
  .version-item-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .structured-field-grid,
  .resume-version-grid {
    grid-template-columns: 1fr;
  }

  .structured-editor-actions .primary-button,
  .structured-editor-actions .secondary-button {
    width: 100%;
  }

  .version-item-heading time {
    text-align: left;
  }

  .upload-queue-heading {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .upload-queue-heading .status-badge {
    grid-column: 2;
    justify-self: start;
  }

  .modal {
    padding: 0;
  }

  .modal-dialog {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .modal-header,
  .modal-actions {
    padding: 14px;
  }

  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-actions > div {
    justify-content: flex-end;
  }
}

@media (max-width: 520px) {
  .detail-title-row #detail-actions {
    width: 100%;
  }

  .detail-title-row #detail-actions > * {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
    min-height: 44px;
    text-align: center;
  }

  .progress-steps {
    grid-template-columns: minmax(0, 1fr);
    margin: 24px 0 12px;
  }

  .progress-step {
    min-height: 38px;
    padding: 0 0 18px 34px;
    font-size: 12px;
    line-height: 1.45;
    text-align: left;
  }

  .progress-step:last-child {
    min-height: 0;
    padding-bottom: 0;
  }

  .progress-step::before {
    top: 0;
    left: 8px;
    transform: none;
  }

  .progress-step:not(:first-child)::after {
    display: none;
  }

  .progress-step:not(:last-child)::after {
    display: block;
    top: 8px;
    right: auto;
    left: 14px;
    width: 2px;
    height: calc(100% - 2px);
    content: "";
  }

  .progress-step.current:not(:last-child)::after {
    background: #e0e3ef;
  }
}
