:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --green: #16a34a;
  --red: #dc2626;
  --orange: #ea580c;
  --blue: #2563eb;
  --gray: #6b7280;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
.hidden { display: none !important; }

/* topbar */
#topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 24px; height: 52px; background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
#topbar .brand { font-size: 16px; font-weight: 700; color: var(--primary); }
#topbar nav a { margin-right: 16px; text-decoration: none; color: var(--muted); font-weight: 500; padding: 6px 10px; border-radius: 6px; }
#topbar nav a.active, #topbar nav a:hover { color: var(--primary); background: #eff6ff; }
.user-box { display: flex; align-items: center; gap: 8px; }

main { padding: 24px; max-width: 1280px; margin: 0 auto; }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; gap: 4px; padding: 7px 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--card); color: var(--text); cursor: pointer; font-size: 13px; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: #fef2f2; border-color: var(--red); }
.btn-ghost { border: none; background: transparent; color: var(--muted); }
.btn-sm { padding: 4px 8px; font-size: 12px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: #fff; color: var(--text);
}
textarea { width: 100%; min-height: 90px; resize: vertical; font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }

/* cards & tables */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 20px; }
.table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 10px; overflow: hidden; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.table th { background: #f8fafc; color: var(--muted); font-weight: 600; white-space: nowrap; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--primary); }
.table tbody tr:hover { background: #f8fafc; }
.table .actions { white-space: nowrap; }
.table .actions button { margin-right: 6px; }

/* badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.b-pending { background: #f1f5f9; color: var(--gray); }
.b-processing { background: #dbeafe; color: var(--blue); animation: pulse 1.2s infinite; }
.b-done { background: #dcfce7; color: var(--green); }
.b-failed { background: #fee2e2; color: var(--red); }
.b-unreadable { background: #ffedd5; color: var(--orange); }
.b-admin { background: #ede9fe; color: #7c3aed; }
.b-hr { background: #e0f2fe; color: #0284c7; }
.b-recommend { background: #dcfce7; color: var(--green); }
.b-maybe { background: #fef9c3; color: #a16207; }
.b-no { background: #fee2e2; color: var(--red); }
@keyframes pulse { 50% { opacity: 0.55; } }

/* toolbar */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.toolbar label { color: var(--muted); font-size: 13px; }

/* progress */
.progress-box { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.progress-track { height: 8px; background: #dbeafe; border-radius: 4px; overflow: hidden; margin-top: 6px; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width .4s; }

/* login */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { width: 360px; padding: 36px; background: var(--card); border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,.08); }
.login-card h1 { font-size: 20px; text-align: center; margin-bottom: 24px; color: var(--primary); }
.login-card input { width: 100%; margin-bottom: 14px; padding: 10px; }
.login-card button { width: 100%; padding: 10px; justify-content: center; }

/* resume detail */
body.detail-mode main { max-width: none; padding: 12px 16px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; height: calc(100vh - 100px); }
.detail-layout.full-pdf { grid-template-columns: minmax(0, 1fr); }
.detail-layout.full-pdf .side-panel { display: none; }
.pdf-frame { width: 100%; height: 100%; border: 1px solid var(--border); border-radius: 10px; background: #525659; }
.side-panel { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.score-card { text-align: center; padding: 18px; }
.score-num { font-size: 44px; font-weight: 700; color: var(--primary); }
.text-pre { white-space: pre-wrap; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 12px; font-size: 12px; line-height: 1.6; max-height: 40vh; overflow-y: auto; }
body.detail-mode.side-hidden .detail-layout { grid-template-columns: minmax(0, 1fr); }
body.detail-mode.side-hidden .side-panel { display: none; }

/* modal */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { width: 520px; max-width: 92vw; background: var(--card); border-radius: 12px; padding: 24px; max-height: 88vh; overflow-y: auto; }
.modal h3 { margin-bottom: 16px; }
.modal .form-row { margin-bottom: 12px; }
.modal .form-row label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 13px; }
.modal .form-row input, .modal .form-row select, .modal .form-row textarea { width: 100%; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* toast */
#toast-box { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 10px 16px; border-radius: 8px; color: #fff; font-size: 13px; box-shadow: 0 2px 10px rgba(0,0,0,.15); animation: slide-in .25s; }
.toast-ok { background: var(--green); }
.toast-err { background: var(--red); }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 18px; }
.tabs button { border: none; background: none; padding: 10px 18px; font-size: 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ---------- AI 问答 ---------- */
.chat-mask { position: fixed; inset: 0; background: rgba(15,23,42,.25); z-index: 90; }
.chat-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 94vw; background: var(--card); box-shadow: -6px 0 30px rgba(0,0,0,.15); display: flex; flex-direction: column; z-index: 95; animation: slide-left .25s; }
@keyframes slide-left { from { transform: translateX(60px); opacity: 0; } }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.chat-head h3 { font-size: 15px; color: var(--primary); }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { max-width: 88%; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.chat-msg.user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.assistant { align-self: flex-start; background: #f1f5f9; color: var(--text); border-bottom-left-radius: 4px; }
/* markdown 排版（assistant 消息） */
.chat-msg.assistant p { margin: 4px 0; }
.chat-msg.assistant h1, .chat-msg.assistant h2, .chat-msg.assistant h3, .chat-msg.assistant h4 { margin: 8px 0 4px; font-size: 14px; }
.chat-msg.assistant ul, .chat-msg.assistant ol { margin: 4px 0; padding-left: 20px; }
.chat-msg.assistant li { margin: 2px 0; }
.chat-msg.assistant table { border-collapse: collapse; margin: 6px 0; font-size: 12px; }
.chat-msg.assistant th, .chat-msg.assistant td { border: 1px solid var(--border); padding: 4px 8px; }
.chat-msg.assistant th { background: #e2e8f0; }
.chat-msg.assistant code { background: #e2e8f0; padding: 1px 4px; border-radius: 3px; font-size: 12px; }
.chat-msg.assistant pre { background: #0f172a; color: #e2e8f0; padding: 8px; border-radius: 6px; overflow-x: auto; margin: 6px 0; }
.chat-msg.assistant pre code { background: none; color: inherit; }
.chat-msg.assistant blockquote { border-left: 3px solid var(--border); margin: 4px 0; padding-left: 8px; color: var(--muted); }
.chat-msg.assistant a { color: var(--primary); }
.chat-msg.assistant hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
.chat-refs { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 6px; }
.chat-ref { font-size: 12px; color: var(--primary); background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 6px; padding: 3px 8px; cursor: pointer; }
.chat-ref:hover { background: #dbeafe; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 8px; }
.chat-chip { font-size: 12px; color: var(--muted); border: 1px solid var(--border); border-radius: 12px; padding: 4px 10px; cursor: pointer; background: #fff; }
.chat-chip:hover { color: var(--primary); border-color: var(--primary); }
.chat-input-box { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.chat-input-box input { flex: 1; }
.chat-input-box button:disabled { opacity: .5; cursor: not-allowed; }
.chat-session-list { width: 220px; border-right: 1px solid var(--border); overflow-y: auto; }
.chat-session-item { padding: 10px 12px; font-size: 13px; border-bottom: 1px solid var(--border); cursor: pointer; color: var(--muted); }
.chat-session-item:hover, .chat-session-item.active { background: #eff6ff; color: var(--primary); }

/* 全屏问答页 */
.qa-layout { display: grid; grid-template-columns: 220px 1fr; gap: 0; height: calc(100vh - 130px); background: var(--card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.qa-main { display: flex; flex-direction: column; }

/* 知识库设置 */
.kb-stat { display: flex; gap: 12px; margin-top: 12px; }
.kb-stat .card { flex: 1; text-align: center; padding: 14px; }
.kb-stat .num { font-size: 24px; font-weight: 700; color: var(--primary); }

/* 面试记录 */
.iv-item { border-left: 3px solid var(--primary); padding: 6px 10px; background: #f8fafc; border-radius: 0 6px 6px 0; font-size: 12px; margin-bottom: 8px; }
.iv-score { font-size: 18px; font-weight: 700; color: var(--primary); }

/* ============================================================
   07 · BRUTALIST 主题覆盖
   粗黑边框 / 硬阴影 / 荧光黄 / 无圆角 / 强对比
   ============================================================ */
:root {
  --primary: #111111;
  --primary-dark: #000000;
  --bg: #f2f2ea;
  --card: #ffffff;
  --text: #0a0a0a;
  --muted: #3f3f46;
  --border: #111111;
  --green: #166534;
  --red: #991b1b;
  --orange: #9a3412;
  --blue: #111111;
  --gray: #3f3f46;
  --acid: #d9ff00;
  --peach: #ffb4a2;
  --sky: #a0c4ff;
  --sand: #ffd6a5;
}
body {
  background-color: #f2f2ea;
  font-family: "Arial", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
}
::selection { background: var(--acid); color: #111; }
:focus-visible { outline: 3px solid #111; outline-offset: 2px; }
h1, h2, h3, h4 { font-weight: 900; letter-spacing: -.02em; }
.hidden { display: none !important; }

/* topbar */
#topbar {
  height: 60px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 3px solid #111;
  box-shadow: 0 3px 0 #111;
}
#topbar .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 900;
  color: #111;
  letter-spacing: -.03em;
  white-space: nowrap;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: #111;
  color: var(--acid);
  border: 2px solid #111;
  box-shadow: 2px 2px 0 #111;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .02em;
  flex: none;
}
.brand-text { font-weight: 900; }
.style-tag {
  display: inline-block;
  padding: 3px 7px;
  background: var(--acid);
  color: #111;
  border: 2px solid #111;
  box-shadow: 2px 2px 0 #111;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .1em;
  transform: rotate(-1.5deg);
  white-space: nowrap;
}
#topbar nav { display: flex; align-items: center; gap: 4px; }
#topbar nav a {
  margin-right: 0;
  padding: 6px 10px;
  border: 2px solid transparent;
  border-radius: 0;
  color: #111;
  font-weight: 900;
  font-size: 13px;
  text-decoration: none;
}
#topbar nav a:hover { background: var(--acid); border-color: #111; }
#topbar nav a.active { background: #111; border-color: #111; color: var(--acid); }
.user-box { gap: 8px; font-weight: 800; }
#user-name { font-weight: 900; }
#topbar .btn-ghost {
  border: 2px solid #111;
  background: #fff;
  color: #111;
  box-shadow: 2px 2px 0 #111;
  font-weight: 900;
}
#topbar .btn-ghost:hover { background: var(--acid); color: #111; }
#user-role { border: 2px solid #111; border-radius: 0; font-weight: 900; }

main { max-width: 1360px; padding: 28px; }
.toolbar { gap: 9px; align-items: center; }
.toolbar h2 { font-weight: 900; letter-spacing: -.035em; }
.toolbar label { font-weight: 800; color: #111; }

/* buttons */
.btn {
  border: 2px solid #111;
  border-radius: 0;
  background: #fff;
  color: #111;
  box-shadow: 3px 3px 0 #111;
  font-weight: 900;
  padding: 7px 13px;
  transition: transform .1s, box-shadow .1s, background .1s;
}
.btn:hover {
  border-color: #111;
  color: #111;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #111;
}
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #111; }
.btn-primary { background: var(--acid); border-color: #111; color: #111; }
.btn-primary:hover { background: #c9ef00; border-color: #111; color: #111; }
.btn-danger { background: var(--peach); border-color: #111; color: #111; }
.btn-danger:hover { background: #ff9e8a; border-color: #111; color: #111; }
.btn-ghost { background: transparent; border: 2px solid transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--acid); border-color: #111; box-shadow: none; }
.btn-sm { padding: 4px 8px; font-size: 11px; box-shadow: 2px 2px 0 #111; }
.btn-sm:hover { box-shadow: 3px 3px 0 #111; }

/* inputs */
input[type=text], input[type=password], input[type=number], select, textarea {
  border: 2px solid #111;
  border-radius: 0;
  background: #fff;
  color: #111;
  padding: 7px 10px;
  font-weight: 600;
}
input:focus, select:focus, textarea:focus {
  border-color: #111;
  outline: none;
  box-shadow: 3px 3px 0 var(--acid);
}

/* cards & tables */
.card {
  background: #fff;
  border: 3px solid #111;
  border-radius: 0;
  box-shadow: 6px 6px 0 #111;
  padding: 18px;
}
.card h4 { font-weight: 900; }
.table {
  border: 3px solid #111;
  border-radius: 0;
  background: #fff;
}
.table th, .table td {
  border-bottom: 2px solid #111;
  padding: 10px 12px;
  font-size: 12.5px;
}
.table th {
  background: #111;
  color: #fff;
  font-weight: 900;
  letter-spacing: .04em;
}
.table th.sortable:hover { color: var(--acid); }
.table tbody tr:hover { background: var(--acid); }
.table tbody tr:last-child td { border-bottom: 0; }
.table a {
  color: #111 !important;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.table .actions button { margin-right: 6px; }

/* badges */
.badge {
  border: 2px solid #111;
  border-radius: 0;
  font-weight: 900;
  font-size: 11px;
  padding: 2px 7px;
  line-height: 1.5;
}
.b-pending { background: #f2f2ea; color: #111; }
.b-processing { background: var(--sky); color: #111; animation: pulse 1.2s infinite; }
.b-done { background: var(--acid); color: #111; }
.b-failed { background: var(--peach); color: #111; }
.b-unreadable { background: var(--sand); color: #111; }
.b-admin { background: #111; color: var(--acid); }
.b-hr { background: var(--acid); color: #111; }
.b-recommend { background: var(--acid); color: #111; }
.b-maybe { background: var(--sand); color: #111; }
.b-no { background: var(--peach); color: #111; }

/* progress */
.progress-box {
  background: var(--acid);
  border: 3px solid #111;
  border-radius: 0;
  box-shadow: 4px 4px 0 #111;
  padding: 11px 14px;
  font-weight: 700;
}
.progress-track { height: 9px; background: #fff; border: 2px solid #111; border-radius: 0; }
.progress-fill { background: #111; border-radius: 0; }

/* login */
.login-wrap {
  min-height: 100vh;
  background-color: #f2f2ea;
  background-image: linear-gradient(rgba(0,0,0,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,.045) 1px, transparent 1px);
  background-size: 32px 32px;
}
.login-card {
  width: min(390px, 92vw);
  padding: 34px;
  background: #fff;
  border: 3px solid #111;
  border-radius: 0;
  box-shadow: 10px 10px 0 #111;
  position: relative;
}
.login-card::before {
  content: "HR";
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  background: #111;
  color: var(--acid);
  border: 2px solid #111;
  box-shadow: 3px 3px 0 var(--acid);
  font-size: 15px;
  font-weight: 900;
}
.login-card h1 {
  font-size: 23px;
  text-align: center;
  color: #111;
  margin-bottom: 22px;
  text-decoration: underline;
  text-decoration-color: var(--acid);
  text-decoration-thickness: 6px;
  text-underline-offset: 5px;
}
.login-card input { border: 2px solid #111; border-radius: 0; padding: 10px; font-weight: 600; }
.login-card button { background: var(--acid); border: 2px solid #111; color: #111; border-radius: 0; box-shadow: 4px 4px 0 #111; font-weight: 900; }
.login-card button:hover { background: #c9ef00; color: #111; }

/* resume detail */
body.detail-mode main { padding: 14px 18px; }
.pdf-frame { border: 3px solid #111; border-radius: 0; background: #111; }
.side-panel { gap: 14px; }
.score-card { border-top: 9px solid var(--acid); text-align: center; }
.score-num { font-size: 56px; font-weight: 900; color: #111; text-shadow: 3px 3px 0 var(--acid); letter-spacing: -.05em; }
.text-pre {
  background: #f2f2ea;
  border: 2px solid #111;
  border-radius: 0;
  font-family: "Courier New", "Microsoft YaHei", monospace;
  font-size: 12px;
  line-height: 1.7;
}
.iv-item {
  border: 2px solid #111;
  border-left: 6px solid #111;
  border-radius: 0;
  background: #f2f2ea;
  padding: 8px 10px;
  font-size: 12px;
}
.iv-score {
  display: inline-block;
  background: var(--acid);
  border: 2px solid #111;
  padding: 0 5px;
  font-size: 16px;
  font-weight: 900;
  color: #111;
}

/* modal */
.modal-mask { background: rgba(17,17,17,.55); backdrop-filter: blur(2px); }
.modal {
  border: 3px solid #111;
  border-radius: 0;
  box-shadow: 9px 9px 0 #111;
  background: #fff;
  padding: 22px;
}
.modal h3 {
  display: inline-block;
  background: var(--acid);
  border: 2px solid #111;
  box-shadow: 3px 3px 0 #111;
  padding: 3px 8px;
  margin-bottom: 18px;
  font-weight: 900;
}
.modal .form-row label { font-weight: 900; color: #111; letter-spacing: .03em; }
.modal .form-row input, .modal .form-row select, .modal .form-row textarea { border: 2px solid #111; border-radius: 0; }
.modal .modal-actions .btn { border: 2px solid #111; }

/* toast */
.toast {
  border: 2px solid #111;
  border-radius: 0;
  box-shadow: 3px 3px 0 #111;
  font-weight: 900;
  color: #111;
}
.toast-ok { background: var(--acid); }
.toast-err { background: var(--peach); }

/* tabs */
.tabs {
  display: flex;
  gap: 6px;
  border-bottom: 3px solid #111;
  margin-bottom: 18px;
}
.tabs button {
  border: 2px solid transparent;
  border-bottom: 0;
  border-radius: 0;
  background: transparent;
  padding: 8px 14px;
  margin-bottom: 0;
  font-size: 13px;
  font-weight: 900;
  color: #3f3f46;
}
.tabs button:hover { border-color: #111; background: #f2f2ea; }
.tabs button.active {
  background: var(--acid);
  border-color: #111;
  color: #111;
  box-shadow: 3px 3px 0 #111;
  font-weight: 900;
}

/* knowledge base stats */
.kb-stat .card { border: 3px solid #111; border-radius: 0; box-shadow: 4px 4px 0 #111; }
.kb-stat .num { font-size: 30px; font-weight: 900; color: #111; text-shadow: 2px 2px 0 var(--acid); }

/* ---------- AI 问答 ---------- */
.chat-mask { background: rgba(17,17,17,.4); }
.chat-panel {
  border-left: 3px solid #111;
  box-shadow: -8px 0 0 #111;
  background: #fff;
  border-radius: 0;
}
.chat-head { background: var(--acid); border-bottom: 3px solid #111; }
.chat-head h3 { color: #111; font-weight: 900; }
.chat-body { background: #fff; }
.chat-msg {
  border: 2px solid #111;
  border-radius: 0;
  font-size: 13px;
  box-shadow: 3px 3px 0 #111;
}
.chat-msg.user { background: #111; color: var(--acid); }
.chat-msg.assistant { background: #fff; color: #111; }
.chat-msg.assistant table { border: 2px solid #111; }
.chat-msg.assistant th, .chat-msg.assistant td { border: 1px solid #111; }
.chat-msg.assistant th { background: #111; color: var(--acid); }
.chat-msg.assistant code { background: var(--acid); border: 1px solid #111; border-radius: 0; color: #111; }
.chat-msg.assistant pre { background: #111; color: var(--acid); border: 2px solid #111; border-radius: 0; }
.chat-msg.assistant pre code { background: none; border: 0; color: inherit; }
.chat-msg.assistant blockquote { border-left: 4px solid #111; background: #f2f2ea; padding: 4px 10px; }
.chat-msg.assistant a { color: #111; text-decoration: underline; text-decoration-thickness: 2px; }
.chat-ref {
  border: 2px solid #111;
  border-radius: 0;
  background: var(--acid);
  color: #111;
  font-weight: 900;
  box-shadow: 2px 2px 0 #111;
}
.chat-ref:hover { background: #c9ef00; }
.chat-chip {
  border: 2px solid #111;
  border-radius: 0;
  background: #fff;
  color: #111;
  font-weight: 800;
}
.chat-chip:hover { background: var(--acid); color: #111; }
.chat-input-box { border-top: 3px solid #111; background: #fff; }
.chat-input-box input { border: 2px solid #111; border-radius: 0; }
.chat-session-list { background: #f2f2ea; border-right: 3px solid #111; }
.chat-session-item { border-bottom: 2px solid #111; font-weight: 800; color: #111; }
.chat-session-item:hover, .chat-session-item.active { background: var(--acid); color: #111; }
.qa-layout {
  border: 3px solid #111;
  border-radius: 0;
  box-shadow: 6px 6px 0 #111;
  background: #fff;
}

/* 响应式 */
@media (max-width: 860px) {
  #topbar { height: auto; min-height: 60px; padding: 8px 14px; flex-wrap: wrap; gap: 7px; }
  #topbar nav { order: 3; width: 100%; display: flex; gap: 2px; overflow-x: auto; padding-bottom: 2px; }
  #topbar nav a { white-space: nowrap; font-size: 12px; }
  .style-tag { display: none; }
  main { padding: 16px 14px 34px; }
  .detail-layout { grid-template-columns: 1fr; height: auto; }
  .pdf-frame { height: 62vh; }
  .side-panel { overflow: visible; }
  #pos-list, #resume-list, #admin-body { overflow-x: auto; }
  #pos-list .table, #resume-list .table { min-width: 720px; }
  .chat-panel { width: 100%; max-width: 100%; }
  .qa-layout { grid-template-columns: 1fr; height: auto; }
  .chat-session-list { width: 100%; max-height: 150px; border-right: 0; border-bottom: 3px solid #111; }
}
@media (max-width: 560px) {
  .brand-text { font-size: 13px; }
  .login-card { padding: 24px; }
  .login-card h1 { font-size: 20px; }
  .toolbar h2 { font-size: 18px; }
  .score-num { font-size: 46px; }
  .modal { padding: 17px; box-shadow: 6px 6px 0 #111; }
}

/* ============================================================
   布局修复：AI 问答 / 聊天抽屉的输入栏必须始终可见
   - chat-body 允许收缩滚动，不能把输入栏顶出视口
   - chat-input-box / chips / head 固定，不参与挤压
   - qa-layout 高度按当前 60px 顶栏重算；#/qa 使用 flex 撑满剩余高度
   ============================================================ */
.chat-panel {
  height: 100dvh;
  min-height: 0;
}
.chat-panel > .chat-head,
.chat-panel > .chat-chips,
.chat-panel > .chat-input-box {
  flex: 0 0 auto;
}
.chat-panel .chat-body {
  min-height: 0;
  flex: 1 1 auto;
}
.chat-input-box {
  flex: 0 0 auto;
  align-items: center;
  background: #fff;
  z-index: 2;
}
.chat-input-box input {
  min-width: 0;
}
.chat-input-box button {
  flex: 0 0 auto;
  min-width: 72px;
  white-space: nowrap;
}
.chat-chips {
  flex: 0 0 auto;
  max-height: 92px;
  overflow-y: auto;
}

.qa-layout {
  height: calc(100dvh - 170px);
  min-height: 480px;
}
.qa-main {
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.qa-main .chat-body {
  min-height: 0;
  flex: 1 1 auto;
}
.qa-main .chat-chips,
.qa-main .chat-input-box {
  flex: 0 0 auto;
}

/* #/qa 顶部导航问答页：让 view / mount / qa-layout 撑满顶栏以下高度 */
body.qa-mode main {
  min-height: calc(100dvh - 60px);
  display: flex;
  flex-direction: column;
}
body.qa-mode #view {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
body.qa-mode #view > .toolbar {
  flex: 0 0 auto;
}
body.qa-mode #qa-mount {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
body.qa-mode #qa-mount > .qa-layout {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}

@media (max-width: 860px) {
  .qa-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: calc(100dvh - 200px);
    min-height: 420px;
  }
  body.qa-mode main {
    min-height: 0;
  }
  body.qa-mode #view {
    min-height: calc(100dvh - 200px);
  }
  body.qa-mode #qa-mount {
    min-height: 420px;
  }
  .chat-input-box {
    padding: 10px 12px;
  }
  .chat-input-box button {
    min-width: 64px;
  }
}

/* 管理页 tabs 在窄屏横向滚动，避免按钮被截断 */
.tabs { overflow-x: auto; flex-wrap: nowrap; }
.tabs button { white-space: nowrap; flex: 0 0 auto; }

/* 问答输入区在任意高度下保持可见 */
.qa-main, .chat-panel { isolation: isolate; }
.qa-main .chat-input-box, .chat-panel .chat-input-box {
  position: relative;
  bottom: auto;
  background: #fff;
}

/* 岗位筛选提示词：AI 生成 / AI 模板 */
.pm-ai-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}
.pm-ai-row .btn-sm { box-shadow: 2px 2px 0 #111; }
.pm-ai-hint { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 58vh;
  overflow: auto;
  margin: 12px 0;
}
.tpl-card {
  display: block;
  text-align: left;
  background: #fff;
  border: 2px solid #111;
  border-radius: 0;
  box-shadow: 3px 3px 0 #111;
  padding: 10px;
  color: #111;
  font: inherit;
  cursor: pointer;
  transition: transform .1s, box-shadow .1s, background .1s;
}
.tpl-card:hover {
  background: var(--acid);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #111;
}
.tpl-card strong { display: block; font-size: 13px; font-weight: 900; }
.tpl-card span {
  display: inline-block;
  margin: 4px 0;
  border: 1px solid #111;
  background: var(--acid);
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 900;
}
.tpl-card p {
  margin: 4px 0 0;
  font-size: 10.5px;
  line-height: 1.5;
  color: #3f3f46;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 680px) {
  .tpl-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   体验优化：问答内部滚动 / 字号 / PDF 比例 / 登录
   ============================================================ */

/* 1) AI 问答：锁住页面，只让对话区自己滚动 */
body.chat-open { overflow: hidden; }
body.qa-mode {
  height: 100dvh;
  overflow: hidden;
}
body.qa-mode #app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
body.qa-mode #topbar { flex: 0 0 auto; }
body.qa-mode main {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.qa-mode #view {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.qa-mode #view > .toolbar { flex: 0 0 auto; }
body.qa-mode #qa-mount {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.qa-mode #qa-mount > .qa-layout {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}
body.qa-mode .qa-main,
body.qa-mode .chat-body { min-height: 0; }
body.qa-mode .chat-body { overflow-y: auto; overscroll-behavior: contain; }
.chat-body { scrollbar-width: thin; scrollbar-color: #111 #fff; }
.chat-body::-webkit-scrollbar { width: 10px; }
.chat-body::-webkit-scrollbar-track { background: #fff; border-left: 2px solid #111; }
.chat-body::-webkit-scrollbar-thumb { background: #111; border: 2px solid #fff; }
.chat-session-list { scrollbar-width: thin; scrollbar-color: #111 #f2f2ea; }
.chat-session-list::-webkit-scrollbar { width: 8px; }
.chat-session-list::-webkit-scrollbar-thumb { background: #111; }

/* 2) 字号整体上调 */
body { font-size: 15px; }
#topbar .brand { font-size: 16px; }
#topbar nav a { font-size: 14px; }
#user-name { font-size: 14px; }
#user-role { font-size: 11.5px; }
main { font-size: 15px; }
.toolbar h2 { font-size: 21px; }
.toolbar label { font-size: 13.5px; }
.btn { font-size: 13.5px; }
.btn-sm { font-size: 12.5px; }
input[type=text], input[type=password], input[type=number], select, textarea { font-size: 14.5px; }
.table th { font-size: 11px; }
.table td { font-size: 13.5px; }
#view td[style*="font-size"] { font-size: 12.5px !important; }
#view small[style*="font-size"] { font-size: 13px !important; }
.cand strong { font-size: 14px !important; }
.cand small { font-size: 11.5px !important; }
.badge { font-size: 11.5px; }
.login-card h1 { font-size: 25px; }
.login-card input { font-size: 15px; }
.login-card button { font-size: 15px; }
.modal h3 { font-size: 21px; }
.modal .form-row label { font-size: 13.5px; }
.modal .form-row input, .modal .form-row select, .modal .form-row textarea { font-size: 14.5px; }
.tabs button { font-size: 14.5px; }
.toast { font-size: 14px; }
.pm-ai-hint { font-size: 11.5px; }
.tpl-card strong { font-size: 14px; }
.tpl-card p { font-size: 11.5px; }

/* AI 对话字号与输入区 */
.chat-head h3 { font-size: 16.5px; }
.chat-msg { font-size: 14.5px; line-height: 1.75; }
.chat-msg.assistant h1, .chat-msg.assistant h2,
.chat-msg.assistant h3, .chat-msg.assistant h4 { font-size: 15.5px; }
.chat-msg.assistant table { font-size: 13px; }
.chat-msg.assistant code { font-size: 12.5px; }
.chat-input-box input { font-size: 14.5px; }
.chat-input-box button { font-size: 13.5px; }
.chat-chip { font-size: 12.5px; }
.chat-ref { font-size: 12.5px; }
.chat-session-item { font-size: 14px; }

/* 简历详情侧栏 */
#score-panel p { font-size: 14px !important; }
#score-panel p[style*="font-size:11px"] { font-size: 12.5px !important; }
.text-pre { font-size: 13.5px; }
.iv-item { font-size: 13px; }
.iv-score { font-size: 18px; }

/* 表格容器横向滚动，避免放大字号后撑破页面 */
#pos-list, #resume-list, #admin-body { overflow-x: auto; }
#resume-list .table { min-width: 1040px; }
#pos-list .table { min-width: 780px; }

/* 3) 简历 PDF 预览：限制到合适比例，不再铺满整屏 */
body.detail-mode main { max-width: 1560px; }
.detail-layout {
  grid-template-columns: minmax(0, 820px) 380px;
  justify-content: center;
  align-items: start;
  height: auto;
}
.pdf-frame {
  width: 100%;
  max-width: 680px;
  height: min(82vh, 920px);
  margin: 0 auto;
  display: block;
}
.detail-layout.full-pdf,
body.detail-mode.side-hidden .detail-layout {
  grid-template-columns: minmax(0, 1000px);
  justify-content: center;
}
.detail-layout.full-pdf .pdf-frame,
body.detail-mode.side-hidden .pdf-frame { max-width: 760px; }

@media (max-width: 860px) {
  body.qa-mode main { min-height: 0; }
  body.qa-mode #view { min-height: 0; }
  body.qa-mode #qa-mount { min-height: 0; }
  body.qa-mode #qa-mount > .qa-layout { min-height: 0; height: auto; }
  .detail-layout { grid-template-columns: 1fr; }
  .pdf-frame { height: 62vh; max-width: 100%; margin: 0; }
  #resume-list .table { min-width: 840px; }
  #pos-list .table { min-width: 680px; }
}

/* ============================================================
   AI 对话尺寸固定：回答时不改变面板/输入区尺寸
   ============================================================ */
.chat-panel {
  width: 480px;
  max-width: 94vw;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
.chat-panel > .chat-head,
.chat-panel > .chat-chips,
.chat-panel > .chat-input-box {
  flex: 0 0 auto;
}
.chat-panel .chat-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.qa-layout {
  height: calc(100dvh - 170px);
  min-height: 480px;
  max-height: calc(100dvh - 170px);
  overflow: hidden;
}
.qa-main {
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.qa-main .chat-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}
body.qa-mode #qa-mount > .qa-layout {
  height: 100%;
  max-height: 100%;
  min-height: 0;
}

/* 输入栏：按钮固定宽度，发送/思考中切换不改变布局 */
.chat-input-box {
  flex: 0 0 auto;
  min-height: 62px;
}
.chat-input-box input { flex: 1 1 auto; min-width: 0; }
.chat-input-box button {
  flex: 0 0 96px;
  width: 96px;
  min-width: 96px;
  padding-left: 6px;
  padding-right: 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 长回答不能撑宽面板：表格/代码块自己内部横向滚动 */
.chat-msg { overflow-wrap: anywhere; word-break: break-word; }
.chat-msg.assistant table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}
.chat-msg.assistant pre { max-width: 100%; overflow-x: auto; }
.chat-body { overflow-x: hidden; }

@media (max-width: 860px) {
  .chat-panel { width: 100%; max-width: 100%; }
  .qa-layout { height: calc(100dvh - 200px); max-height: calc(100dvh - 200px); }
  .chat-input-box { min-height: 58px; }
  .chat-input-box button { flex-basis: 88px; width: 88px; min-width: 88px; }
}

/* 固定网格行 + dvh 兼容回退，确保问答区高度完全由容器决定 */
.chat-panel { height: 100vh; height: 100dvh; }
body.qa-mode { height: 100vh; height: 100dvh; }
body.qa-mode #app { height: 100vh; height: 100dvh; }
.qa-layout {
  grid-template-rows: minmax(0, 1fr);
  height: calc(100vh - 170px);
  height: calc(100dvh - 170px);
  max-height: calc(100vh - 170px);
  max-height: calc(100dvh - 170px);
}
.qa-layout > .chat-session-list,
.qa-layout > .qa-main { min-height: 0; }
@media (max-width: 860px) {
  .qa-layout {
    grid-template-rows: auto minmax(0, 1fr);
    height: calc(100vh - 200px);
    height: calc(100dvh - 200px);
    max-height: calc(100vh - 200px);
    max-height: calc(100dvh - 200px);
  }
}

/* ============================================================
   简历 PDF 预览尺寸：按可用空间放大，保留 A4 阅读比例
   ============================================================ */
body.detail-mode main { max-width: 1640px; }
.detail-layout {
  grid-template-columns: minmax(0, 1fr) 380px;
  justify-content: stretch;
  align-items: start;
  height: auto;
}
.pdf-frame {
  width: 100%;
  max-width: 880px;
  height: calc(100vh - 140px);
  height: calc(100dvh - 140px);
  max-height: 980px;
  margin: 0 auto;
  display: block;
}
.detail-layout.full-pdf,
body.detail-mode.side-hidden .detail-layout {
  grid-template-columns: minmax(0, 1fr);
  justify-content: center;
}
.detail-layout.full-pdf .pdf-frame,
body.detail-mode.side-hidden .pdf-frame {
  max-width: 1100px;
}
@media (max-width: 1080px) {
  .detail-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .pdf-frame { max-width: 100%; }
}
@media (max-width: 860px) {
  .detail-layout { grid-template-columns: 1fr; }
  .pdf-frame {
    height: 68vh;
    height: 68dvh;
    max-width: 100%;
    margin: 0;
  }
}

/* ============================================================
   AI 回答不得撑宽页面/对话框：列轨道、消息、表格全部限宽
   ============================================================ */
.qa-layout {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
}
.qa-layout > .chat-session-list,
.qa-layout > .qa-main { min-width: 0; width: 100%; max-width: 100%; }
.qa-main .chat-body,
.chat-panel .chat-body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}
.chat-body > * { max-width: 100%; }
.chat-head { min-width: 0; }
.chat-head h3 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-msg {
  min-width: 0;
  max-width: 88%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.chat-msg.user, .chat-msg.assistant { width: fit-content; }
.chat-msg.assistant img { max-width: 100%; height: auto; }
.chat-msg.assistant a,
.chat-msg.assistant code {
  overflow-wrap: anywhere;
  word-break: break-word;
}
/* 表格改为 fixed 布局，单元格内容换行，不再撑宽气泡 */
.chat-msg.assistant table {
  display: table;
  table-layout: fixed;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}
.chat-msg.assistant th,
.chat-msg.assistant td {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.chat-msg.assistant pre {
  max-width: 100%;
  overflow-x: auto;
}
.chat-refs { max-width: 100%; min-width: 0; }
.chat-ref {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.chat-chips { max-width: 100%; min-width: 0; }
.chat-chip {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.chat-session-item { overflow-wrap: anywhere; word-break: break-word; }
.chat-input-box { width: 100%; max-width: 100%; min-width: 0; }
.chat-panel .chat-input-box, .chat-panel .chat-chips { width: 100%; max-width: 100%; }

@media (max-width: 860px) {
  .qa-layout {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
  }
}

/* ============================================================
   全局 AI 问答页：回答气泡固定宽度，流式输出不再横向扩张
   ============================================================ */
.chat-msg.assistant {
  width: 88%;
  max-width: 760px;
  min-width: 0;
  flex: 0 0 auto;
}
.chat-msg.user {
  width: fit-content;
  max-width: 88%;
}
@media (max-width: 860px) {
  .chat-msg.assistant {
    width: 92%;
    max-width: 100%;
  }
}

/* ============================================================
   全局 AI 问答页：硬固定 16:10 外框（桌面最大 1200×750）
   外框尺寸与比例不随回答内容变化；只有消息区内部滚动
   ============================================================ */
body.qa-mode #app {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.qa-mode #topbar { flex: 0 0 auto; width: 100%; }
body.qa-mode #view {
  --qa-w: min(1200px, calc(100vw - 56px), calc((100dvh - 150px) * 1.6));
  flex: 0 0 auto;
  width: min(1200px, 92vw);
  width: var(--qa-w);
  height: calc(min(1200px, 92vw) * 0.625);
  height: calc(var(--qa-w) * 0.625);
  max-width: none;
  max-height: none;
  min-height: 0;
  margin: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 3px solid #111;
  box-shadow: 6px 6px 0 #111;
}
body.qa-mode #view > .toolbar {
  flex: 0 0 auto;
  margin: 0;
  padding: 16px 20px 10px;
  border-bottom: 2px solid #111;
  background: #fff;
  min-width: 0;
}
body.qa-mode #view > .toolbar h2 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
}
body.qa-mode #qa-mount {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.qa-mode #qa-mount > .qa-layout {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  max-height: none;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  overflow: hidden;
}
body.qa-mode .qa-main,
body.qa-mode .qa-main .chat-body {
  min-height: 0;
  overflow: hidden;
}
body.qa-mode .qa-main .chat-body {
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

@media (max-width: 860px) {
  body.qa-mode #view {
    --qa-w: 100%;
    width: 100%;
    height: 70vh;
    height: 70dvh;
    max-height: 70dvh;
    min-height: 0;
    margin: auto;
    border: 3px solid #111;
    box-shadow: 4px 4px 0 #111;
  }
  body.qa-mode #view > .toolbar {
    padding: 10px 12px 8px;
  }
  body.qa-mode #qa-mount {
    padding: 0 8px 8px;
  }
  body.qa-mode #qa-mount > .qa-layout {
    height: 100%;
    max-height: none;
    min-height: 0;
  }
}

/* ============================================================
   情绪价值：R 妹等待文案
   ============================================================ */
.comfort-strip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--acid);
  border: 2px solid #111;
  box-shadow: 3px 3px 0 #111;
  color: #111;
  font-size: 13.5px;
  font-weight: 800;
}
.comfort-strip.hidden { display: none; }
.comfort-strip #comfort-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.comfort-r {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  background: #111;
  color: var(--acid);
  border: 2px solid #111;
  font-size: 11px;
  font-weight: 900;
}
.chat-comfort {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 88%;
  padding: 8px 10px;
  background: #f2f2ea;
  border: 2px dashed #111;
  box-shadow: 2px 2px 0 #111;
  color: #111;
  font-size: 12.5px;
  line-height: 1.5;
  flex: 0 0 auto;
  min-width: 0;
}
.chat-comfort .comfort-t {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.comfort-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.comfort-actions .spacer { flex: 1; }
.comfort-preview {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--acid);
  border: 2px solid #111;
  box-shadow: 3px 3px 0 #111;
  color: #111;
  font-size: 13.5px;
  font-weight: 800;
}
.comfort-preview.hidden { display: none; }

/* 岗位编辑：筛选提示词输入区放大，方便阅读和编辑长文本 */
.modal.modal-wide {
  width: min(820px, 94vw);
}
#pm-prompt {
  min-height: 360px;
  max-height: 58vh;
  line-height: 1.75;
  resize: vertical;
  font-size: 14.5px;
}
@media (max-width: 680px) {
  .modal.modal-wide { width: 94vw; }
  #pm-prompt { min-height: 260px; }
}

/* ============================================================
   面试排期
   ============================================================ */
.sched-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  margin-left: 4px;
  background: #111;
  color: var(--acid);
  border: 1px solid #111;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}
.sched-badge.hidden { display: none; }
.sched-badge.urgent { background: var(--peach); color: #111; }

.sched-modal { width: min(1000px, 94vw); }
.sched-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.sched-head h3 { margin-bottom: 0; }
.sched-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0 8px; }
.sched-toolbar .spacer { flex: 1; }
.sched-summary { color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.sched-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 4px;
}
.sched-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 2px solid #111;
  background: #fff;
  box-shadow: 3px 3px 0 #111;
  padding: 10px 12px;
  min-width: 0;
}
.sched-item.today { background: #f7ffd6; }
.sched-item.soon { background: var(--acid); box-shadow: 4px 4px 0 #111; }
.sched-item.past { opacity: .55; }
.sched-when {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-right: 2px solid #111;
  padding-right: 10px;
  min-width: 0;
}
.sched-when b { font-size: 14px; font-weight: 900; letter-spacing: -.02em; }
.sched-when span { font-size: 12px; color: #3f3f46; font-weight: 800; }
.sched-tag {
  display: inline-block;
  align-self: flex-start;
  margin-top: 2px;
  padding: 1px 5px;
  border: 1px solid #111;
  background: #f2f2ea;
  color: #111;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
}
.sched-tag.soon { background: #111; color: var(--acid); }
.sched-tag.today { background: var(--acid); color: #111; }
.sched-main { min-width: 0; }
.sched-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.sched-title strong { font-size: 14px; font-weight: 900; }
.sched-main small { display: block; color: #3f3f46; font-size: 11.5px; margin-top: 3px; }
.sched-main p { margin: 4px 0 0; color: #3f3f46; font-size: 11.5px; overflow-wrap: anywhere; }
.sched-creator { opacity: .75; }
.sched-actions { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.sched-empty {
  border: 2px dashed #111;
  background: #f2f2ea;
  padding: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}
.sched-form-modal { width: min(680px, 94vw); }
.sched-form-modal input[type="datetime-local"] {
  width: 100%;
  border: 2px solid #111;
  border-radius: 0;
  background: #fff;
  color: #111;
  padding: 7px 10px;
  font-size: 14px;
  font-weight: 600;
}
.sched-form-modal #sched-stage-other { width: 100%; margin-top: 7px; }
.sched-fixed {
  border: 2px solid #111;
  background: #f2f2ea;
  padding: 8px 10px;
  font-weight: 800;
  font-size: 13px;
}
.sched-fixed small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.sched-hint { color: var(--muted); font-size: 11.5px; margin: -4px 0 10px; }

@media (max-width: 760px) {
  .sched-item { grid-template-columns: 1fr; gap: 8px; }
  .sched-when { border-right: 0; border-bottom: 2px solid #111; padding: 0 0 7px; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
  .sched-actions { justify-content: flex-start; }
  .sched-modal, .sched-form-modal { width: 94vw; }
}

/* 面试排期：候选人搜索与点击选择 */
.cand-picker { display: flex; flex-direction: column; gap: 6px; }
.cand-picker #sched-cand-search { width: 100%; }
.cand-selected {
  border: 2px dashed #111;
  background: #f2f2ea;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 800;
  color: #111;
  overflow-wrap: anywhere;
}
.cand-selected.empty { color: var(--muted); font-weight: 700; }
.cand-selected small { display: block; color: var(--muted); font-weight: 600; font-size: 10.5px; margin-top: 2px; }
.cand-options {
  max-height: 210px;
  overflow-y: auto;
  border: 2px solid #111;
  background: #fff;
  box-shadow: 3px 3px 0 #111;
}
.cand-option {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #111;
  background: #fff;
  color: #111;
  font: inherit;
  padding: 8px 10px;
  cursor: pointer;
}
.cand-option:last-child { border-bottom: 0; }
.cand-option:hover { background: #f2f2ea; }
.cand-option.active { background: var(--acid); }
.cand-option strong { display: block; font-size: 13px; font-weight: 900; }
.cand-option small { display: block; color: #3f3f46; font-size: 10.5px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cand-option.active strong::after { content: " ✓"; }
.cand-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 12px; font-weight: 700; }

/* 面试排期：按岗位浏览候选人 */
.cand-count {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 800;
}

/* 管理员：登录信息 */
.ip-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.ua-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 10.5px;
}

/* 上传跳过原因等多行提示 */
.toast { white-space: pre-line; line-height: 1.5; max-width: min(680px, 92vw); }

/* ============================================================
   简历 PDF 预览页：右侧评语/评分栏独立滚动，避免看不全
   ============================================================ */
.detail-layout {
  grid-template-columns: minmax(0, 1fr) 420px;
  align-items: stretch;
}
.side-panel {
  height: calc(100dvh - 140px);
  max-height: calc(100dvh - 140px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #111 #fff;
}
.side-panel::-webkit-scrollbar { width: 10px; }
.side-panel::-webkit-scrollbar-track { background: #fff; border-left: 2px solid #111; }
.side-panel::-webkit-scrollbar-thumb { background: #111; border: 2px solid #fff; }
/* 固定高度下卡片不能参与 flex 收缩，否则评语会被压扁/截断 */
.side-panel > .card { flex: 0 0 auto; }
#score-panel { overflow: visible; }
#score-panel p {
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 1080px) {
  .detail-layout { grid-template-columns: minmax(0, 1fr) 380px; }
  .side-panel {
    height: calc(100dvh - 140px);
    max-height: calc(100dvh - 140px);
  }
}
@media (max-width: 860px) {
  .detail-layout { grid-template-columns: 1fr; }
  .side-panel {
    height: auto;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

/* ============================================================
   简历详情：锁定视口高度，PDF 与右侧评语各自滚动；
   右侧评语不再被页面截断或遮挡。
   ============================================================ */
body.detail-mode { overflow: hidden; }
body.detail-mode main {
  height: calc(100dvh - 60px);
  max-width: 1640px;
  padding: 12px 18px 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.detail-mode main > .toolbar {
  flex: 0 0 auto;
  margin-bottom: 10px;
}
body.detail-mode .detail-layout {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  align-items: stretch;
}
body.detail-mode .pdf-frame {
  width: 100%;
  height: 100%;
  max-height: none;
  max-width: 880px;
  margin: 0 auto;
}
body.detail-mode .side-panel {
  height: 100%;
  max-height: none;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}
body.detail-mode .side-panel > .card { flex: 0 0 auto; }
body.detail-mode #score-panel { overflow: visible; }
body.detail-mode #score-panel p {
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 860px) {
  body.detail-mode { overflow: auto; }
  body.detail-mode main {
    height: auto;
    overflow: visible;
    display: block;
  }
  body.detail-mode .detail-layout {
    display: flex;
    flex-direction: column;
    height: auto;
  }
  /* 手机端把评分/评语放在 PDF 上方，先看到评语 */
  body.detail-mode .side-panel {
    order: -1;
    height: auto;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  body.detail-mode .pdf-frame {
    height: 68dvh;
    max-width: 100%;
    margin: 0;
  }
}

/* 详情页右侧滚动条常显，明确可滚动；行轨道填满视口 */
body.detail-mode .detail-layout { grid-template-rows: minmax(0, 1fr); }
body.detail-mode .side-panel { overflow-y: scroll; scrollbar-gutter: stable; }

/* 列表评语完整悬浮预览（覆盖窗口，不撑开表格） */
.comment-cell { cursor: help; }
.comment-popover {
  position: fixed;
  z-index: 500;
  max-width: min(560px, calc(100vw - 24px));
  max-height: 68vh;
  overflow: hidden;
  padding: 12px 15px;
  background: var(--card);
  color: var(--text);
  border: 3px solid #111;
  box-shadow: 8px 8px 0 #111;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  pointer-events: none;
}
.comment-popover.hidden { display: none; }


/* 岗位列表：最近在新标签页打开的简历行，回到原标签页时保持高亮 */
.table tbody tr.resume-opened td { background: #f5ffb8; }
.table tbody tr.resume-opened td:first-child { border-left: 6px solid #111; }
.table tbody tr.resume-opened:hover td { background: var(--acid); }


/* 简历列表勾选框列 */
.table th.select-cell, .table td.select-cell { width: 36px; text-align: center; padding-left: 8px; padding-right: 4px; }
.table input[type="checkbox"] { width: 16px; height: 16px; accent-color: #111; cursor: pointer; }


/* 岗位问答抽屉：顶部会话列表，用户自行选择历史会话 */
.chat-panel > .drawer-sessions {
  flex: 0 0 auto;
  display: flex;
  overflow-x: auto;
  background: #f2f2ea;
  border-bottom: 3px solid #111;
}
.chat-panel .drawer-sessions .chat-session-item {
  flex: 0 0 auto;
  max-width: 190px;
  padding: 8px 10px;
  border: 0;
  border-right: 2px solid #111;
  border-bottom: 0;
  background: transparent;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #111;
  cursor: pointer;
}
.chat-panel .drawer-sessions .chat-session-item span {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
}
.chat-panel .drawer-sessions .chat-session-item:hover,
.chat-panel .drawer-sessions .chat-session-item.active { background: var(--acid); color: #111; }
.chat-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  padding: 16px;
  border: 2px dashed #111;
  background: #fff;
}


/* 岗位问答抽屉：左侧固定历史会话列表 + 右侧聊天 */
.chat-panel.drawer-panel { width: min(760px, 96vw); }
.chat-panel .drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  overflow: hidden;
}
.chat-panel .drawer-session-list {
  width: 210px;
  flex: 0 0 210px;
  min-height: 0;
  overflow-y: auto;
  border-right: 3px solid #111;
  background: #f2f2ea;
}
.chat-panel .drawer-session-list .chat-session-item {
  display: block;
  width: 100%;
  max-width: none;
  padding: 10px 12px;
  border: 0;
  border-bottom: 2px solid #111;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  color: #111;
  cursor: pointer;
}
.chat-panel .drawer-session-list .chat-session-item span {
  display: block;
  margin-top: 3px;
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
}
.chat-panel .drawer-session-list .chat-session-item:hover,
.chat-panel .drawer-session-list .chat-session-item.active {
  background: var(--acid);
  color: #111;
}
.chat-panel .drawer-chat {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-panel .drawer-chat .chat-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.chat-panel .drawer-chat .chat-chips,
.chat-panel .drawer-chat .chat-input-box { flex: 0 0 auto; }

@media (max-width: 700px) {
  .chat-panel.drawer-panel { width: 100%; max-width: 100%; }
  .chat-panel .drawer-body { flex-direction: column; }
  .chat-panel .drawer-session-list {
    width: 100%;
    flex: 0 0 auto;
    max-height: 140px;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 3px solid #111;
  }
  .chat-panel .drawer-session-list .chat-session-item {
    width: auto;
    max-width: 190px;
    flex: 0 0 auto;
    border-right: 2px solid #111;
    border-bottom: 0;
  }
}


/* 分享列表里可点击的“面试官（账号）” */
.link-btn {
  border: 0;
  background: transparent;
  padding: 0;
  color: #111;
  font: inherit;
  font-weight: 900;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:hover { background: var(--acid); }


/* 面试状态：独立列 + 行左侧标记 + 筛选 */
.iv-filter { display:flex; align-items:center; gap:5px; flex-wrap:wrap; }
.iv-chip {
  border:2px solid #111; background:#fff; color:#111;
  font:inherit; font-size:11px; font-weight:800; padding:4px 8px; cursor:pointer;
}
.iv-chip:hover,.iv-chip.active { background:var(--acid); }
#iv-stats { font-size:11px; font-weight:800; color:var(--muted); white-space:nowrap; }
.b-interviewed { background:var(--acid); color:#111; border:2px solid #111; font-weight:900; }
.b-not-interviewed { background:#e5e7eb; color:#555; border:1px solid #cbd5e1; }
.table tbody tr.interviewed-row td:first-child { border-left:6px solid #16a34a; }
.interview-check { display:inline-block; margin-right:4px; color:#16a34a; font-weight:900; }


/* 面试官结果：通过/待定/不通过，通过整行高亮 */
.b-interview-passed { background:#c6efce; color:#006100; border:2px solid #006100; font-weight:900; }
.b-interview-pending { background:#fef3c7; color:#92400e; border:1px solid #d97706; font-weight:900; }
.b-interview-failed { background:#fee2e2; color:#991b1b; border:1px solid #b91c1c; font-weight:900; }
.table tbody tr.interview-passed-row td { background:#e9ffd8; }
.table tbody tr.interview-passed-row:hover td { background:var(--acid); }
