:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-subtle: #faf9f6;
  --ink: #14161a;
  --ink-secondary: #4a4f59;
  --ink-muted: #767c87;
  --border: #e2dfd7;
  --border-strong: #c8c4b8;
  --accent: #1d3c8a;
  --accent-soft: #eef2fa;
  --accent-border: #9cb0e2;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --ok: #166534;
  --ok-bg: #f0fdf4;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 20, 28, 0.04);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
}

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

.page-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 16px 64px;
}

.admin-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

/* Top Brand Header */
.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}

.brand-meta {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.hero-title {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero-desc {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 14.5px;
}

.flow-strip {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 13px;
  color: var(--ink-secondary);
}

.flow-step {
  font-weight: 500;
  color: var(--ink);
}

.flow-arrow {
  color: var(--ink-muted);
}

/* Expandable Reference Details */
.guide-details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.guide-summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.guide-summary::-webkit-details-marker {
  display: none;
}

.guide-summary::after {
  content: "展开详情 +";
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-muted);
}

.guide-details[open] .guide-summary {
  border-bottom: 1px solid var(--border);
}

.guide-details[open] .guide-summary::after {
  content: "收起 −";
}

.guide-body {
  padding: 16px 20px 20px;
  font-size: 13.5px;
  color: var(--ink-secondary);
}

.guide-domain-list {
  margin: 8px 0 16px;
  padding-left: 18px;
}

.guide-domain-list li {
  margin-bottom: 6px;
}

.guide-benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.benefit-pill {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  font-size: 12.5px;
}

/* Form Sections */
.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.section-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.section-title {
  margin: 0;
  font-size: 16.5px;
  font-weight: 650;
}

.section-hint {
  margin: -8px 0 14px;
  font-size: 13px;
  color: var(--ink-muted);
}

/* Grid & Inputs */
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 600px) {
  .field-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .page-shell {
    padding: 18px 12px 48px;
  }
  .hero-card, .form-section {
    padding: 18px 15px;
  }
  .hero-title {
    font-size: 21px;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

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

.field-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.req-star {
  color: var(--danger);
  margin-left: 2px;
}

.opt-tag {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-muted);
  margin-left: 4px;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="password"],
input[type="url"],
select,
textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  font-size: 15px; /* >=16px/15px prevents mobile zoom issues */
  line-height: 1.45;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
}

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%),
    linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 60, 138, 0.12);
}

textarea {
  resize: vertical;
  min-height: 108px;
}

/* Choice Cards (Groups & Roles) */
.group-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

@media (max-width: 560px) {
  .group-tabs {
    grid-template-columns: minmax(0, 1fr);
  }
}

.group-card {
  text-align: left;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.group-card:hover {
  border-color: var(--border-strong);
}

.group-card.active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.group-card-title {
  font-size: 15px;
  font-weight: 650;
  color: var(--ink);
  margin-bottom: 3px;
}

.group-card.active .group-card-title {
  color: var(--accent);
}

.group-card-sub {
  font-size: 12px;
  color: var(--ink-secondary);
  line-height: 1.4;
}

.role-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.role-card {
  display: block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.role-card:hover {
  border-color: var(--border-strong);
}

.role-card.selected {
  border-color: var(--accent);
  background: #f8faff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.role-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.role-name {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--ink);
}

.role-quota {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.role-duty {
  font-size: 13px;
  color: var(--ink-secondary);
  margin-bottom: 4px;
}

.role-req {
  font-size: 12.5px;
  color: var(--ink-muted);
}

/* Radio Pills */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 13.5px;
  cursor: pointer;
  min-height: 40px;
}

.radio-pill input {
  margin: 0;
  accent-color: var(--accent);
}

.radio-pill:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* Weekly Schedule Matrix (Zero Horizontal Overflow on 320px+) */
.schedule-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}

.schedule-grid {
  display: grid;
  grid-template-columns: 52px repeat(7, minmax(0, 1fr));
  width: 100%;
}

.sched-head, .sched-row-label {
  background: var(--surface-subtle);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7px 2px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: center;
}

.sched-head:last-child {
  border-right: none;
}

.sched-row-label span {
  font-size: 10px;
  font-weight: 400;
  color: var(--ink-muted);
}

.sched-cell {
  min-height: 42px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: transparent;
  padding: 0;
  user-select: none;
  transition: background-color 0.1s ease;
}

.sched-cell:nth-child(8n) {
  border-right: none;
}

.sched-cell.last-row, .sched-row-label.last-row {
  border-bottom: none;
}

.sched-cell.active {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.sched-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface-subtle);
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--ink-secondary);
}

/* Skills Checklist */
.check-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 13.5px;
  cursor: pointer;
}

.check-item input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.check-item:has(input:checked) {
  border-color: var(--accent-border);
  background: #fafcff;
}

/* Prompt Box */
.prompt-card {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  margin-bottom: 12px;
  font-size: 13.5px;
  color: var(--ink-secondary);
}

.prompt-quote {
  margin: 8px 0;
  padding: 8px 12px;
  background: #fff;
  border-left: 3px solid var(--accent);
  color: var(--ink);
  font-size: 13px;
}

.char-counter {
  text-align: right;
  font-size: 12px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

/* Upload Area */
.upload-box {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  background: var(--surface-subtle);
  cursor: pointer;
}

.upload-box:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.file-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.file-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 13px;
}

.file-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Buttons & Alerts */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #162f6e;
}

.btn-ghost {
  background: #fff;
  color: var(--ink-secondary);
  border-color: var(--border-strong);
}

.btn-sm {
  min-height: 32px;
  padding: 5px 11px;
  font-size: 12.5px;
}

.error-banner {
  background: var(--danger-bg);
  border: 1px solid #fecdca;
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13.5px;
  margin-bottom: 14px;
}

.submit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.draft-status {
  font-size: 12.5px;
  color: var(--ink-muted);
}

/* Receipt View */
.receipt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}

.receipt-badge {
  display: inline-block;
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid #bbf7d0;
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.receipt-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.03em;
}

.kv-table {
  margin: 16px 0;
  border-top: 1px solid var(--border);
}

.kv-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.kv-row span:first-child {
  color: var(--ink-muted);
  flex-shrink: 0;
}

/* Admin Layout */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.stat-num {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.stat-label {
  font-size: 12.5px;
  color: var(--ink-muted);
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.admin-toolbar > * {
  width: auto;
  min-width: 150px;
}

.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th, .data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: var(--surface-subtle);
  font-weight: 600;
  color: var(--ink-secondary);
  white-space: nowrap;
}

.data-table tr:hover td {
  background: #fafbfe;
}

.status-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.status-accepted { background: var(--ok-bg); color: var(--ok); border-color: #bbf7d0; }
.status-interview_1, .status-interview_2, .status-trial { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }
.status-rejected { background: #f4f4f5; color: #71717a; }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 24, 0.42);
  display: flex;
  justify-content: flex-end;
  z-index: 50;
}

.drawer-panel {
  width: min(620px, 100vw);
  height: 100%;
  background: var(--surface);
  overflow-y: auto;
  padding: 24px 20px 48px;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

.hidden {
  display: none !important;
}
