/* ============ AI 求职工作台 全局样式 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #f0f4f8;
  color: #1f2937;
}

@media (max-width: 700px) {
  .auth-page { padding: 16px; }
  .auth-card { max-width: 100%; }
  .app { flex-direction: column; }
  .app .sidebar { width: 100%; padding: 12px; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .sidebar nav button { width: auto; padding: 8px; margin: 0; }
  .app .main { padding: 16px 12px; min-width: 0; }
  .main .chat-wrap { flex-direction: column; height: auto; }
  .chat-wrap .conv-side { width: 100%; max-height: 160px; }
  .chat-wrap .chat-box { flex: none; height: 65dvh; min-height: 340px; }
  .chat-box .chat-list { padding: 12px; }
  .chat-list .msg .bubble { max-width: 94%; }
  .chat-box .chat-input textarea { min-width: 0; font-size: 16px; }
  .chat-box .chat-input button { width: 64px; }
  .form-row input[type="file"] { max-width: 100%; }
}

/* ---------- 登录/注册页 ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #0ea5e9 100%);
}
.auth-card {
  width: 380px;
  background: #fff;
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.auth-card h1 { font-size: 22px; text-align: center; margin-bottom: 6px; }
.auth-card .sub { text-align: center; color: #6b7280; font-size: 13px; margin-bottom: 24px; }
.auth-card label { display: block; font-size: 13px; color: #374151; margin: 14px 0 6px; }
.auth-card input, .auth-card select {
  width: 100%; padding: 10px 12px; border: 1px solid #d1d5db;
  border-radius: 8px; font-size: 14px; outline: none;
}
.auth-card input:focus, .auth-card select:focus { border-color: #4f46e5; }
.btn {
  width: 100%; margin-top: 22px; padding: 11px; border: none; border-radius: 8px;
  background: #4f46e5; color: #fff; font-size: 15px; cursor: pointer;
}
.btn:hover { background: #4338ca; }
.auth-card .switch { text-align: center; font-size: 13px; margin-top: 16px; color: #6b7280; }
.auth-card .switch a { color: #4f46e5; text-decoration: none; }
.tip { color: #ef4444; font-size: 13px; margin-top: 8px; min-height: 18px; text-align: center; }

/* ---------- 工作台布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 200px; background: #111827; color: #d1d5db; padding: 20px 12px;
  display: flex; flex-direction: column;
}
.sidebar .logo { font-size: 17px; font-weight: bold; color: #fff; padding: 6px 12px 18px; }
.sidebar nav { flex: 1; }
.sidebar nav button {
  display: block; width: 100%; text-align: left; padding: 11px 14px; margin-bottom: 4px;
  background: transparent; border: none; border-radius: 8px; color: #d1d5db;
  font-size: 14px; cursor: pointer;
}
.sidebar nav button:hover { background: #1f2937; color: #fff; }
.sidebar nav button.active { background: #4f46e5; color: #fff; }
.sidebar .user { font-size: 13px; padding: 10px 12px; border-top: 1px solid #1f2937; }
.sidebar .user a { color: #f87171; text-decoration: none; cursor: pointer; }

.main { flex: 1; padding: 24px 28px; overflow: auto; }
.main h2 { font-size: 20px; margin-bottom: 16px; }
.panel { display: none; }
.panel.active { display: block; }

/* ---------- 聊天区 ---------- */
.chat-wrap {
  display: flex; gap: 14px; height: calc(100vh - 110px);
}
.conv-side {
  width: 220px; background: #fff; border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  display: flex; flex-direction: column; overflow: hidden;
}
.conv-side .btn-new {
  margin: 12px; padding: 9px; border: none; border-radius: 8px;
  background: #4f46e5; color: #fff; font-size: 14px; cursor: pointer;
}
.conv-side .btn-new:hover { background: #4338ca; }
.conv-list { flex: 1; overflow-y: auto; }
.conv-item {
  padding: 11px 14px; cursor: pointer; border-bottom: 1px solid #f3f4f6;
  display: flex; align-items: center; gap: 8px;
}
.conv-item .info { flex: 1; min-width: 0; }
.conv-item:hover { background: #f9fafb; }
.conv-item.active { background: #eef2ff; border-left: 3px solid #4f46e5; }
.conv-item .t {
  font-size: 13px; color: #1f2937; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.conv-item .time { font-size: 11px; color: #9ca3af; margin-top: 3px; }
.conv-del {
  flex-shrink: 0; width: 20px; height: 20px; line-height: 18px; text-align: center;
  border-radius: 50%; color: #9ca3af; font-size: 14px; cursor: pointer; user-select: none;
}
.conv-del:hover { background: #fee2e2; color: #dc2626; }
.load-earlier { text-align: center; margin: 0 0 14px; }
.load-earlier button {
  border: 1px solid #d1d5db; background: #fff; color: #4f46e5;
  font-size: 12px; padding: 5px 14px; border-radius: 999px; cursor: pointer;
}
.load-earlier button:hover { background: #eef2ff; }

.chat-box {
  flex: 1; min-width: 0; background: #fff; border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-list { flex: 1; overflow-y: auto; padding: 20px; }
.msg { margin-bottom: 16px; display: flex; flex-direction: column; }
.msg.user { align-items: flex-end; }
.msg.assistant { align-items: flex-start; }
.msg .bubble {
  max-width: 76%; padding: 10px 14px; border-radius: 12px; font-size: 14px;
  line-height: 1.7; word-break: break-word;
}
.msg.user .bubble { background: #4f46e5; color: #fff; border-top-right-radius: 2px; white-space: pre-wrap; }
.msg.assistant .bubble { background: #f3f4f6; color: #111827; border-top-left-radius: 2px; }
.msg.assistant .bubble .md-h {
  font-size: 15px; font-weight: 700; display: block; margin: 10px 0 4px;
}
.msg.assistant .bubble .md-p { margin: 4px 0; }
.msg.assistant .bubble ul, .msg.assistant .bubble ol { margin: 4px 0 4px 20px; padding: 0; }
.msg.assistant .bubble li { margin: 2px 0; }
.msg.assistant .bubble .md-quote {
  border-left: 3px solid #c7d2fe; background: #f9fafb; padding: 6px 10px;
  margin: 6px 0; border-radius: 0 8px 8px 0;
}
.msg.assistant .bubble .md-quote > div { margin: 2px 0; }
.msg.assistant .bubble hr { border: none; border-top: 1px solid #e5e7eb; margin: 10px 0; }
.msg.assistant .bubble code {
  background: #e5e7eb; border-radius: 4px; padding: 1px 5px; font-size: 13px;
}
.msg .meta { font-size: 11px; color: #9ca3af; margin-top: 4px; }
.chat-input { display: flex; padding: 12px; border-top: 1px solid #e5e7eb; }
.chat-input textarea {
  flex: 1; resize: none; height: 52px; padding: 10px 12px; border: 1px solid #d1d5db;
  border-radius: 8px; font-size: 14px; outline: none;
}
.chat-input button {
  width: 90px; margin-left: 10px; border: none; border-radius: 8px;
  background: #4f46e5; color: #fff; font-size: 15px; cursor: pointer;
}
.quick { padding: 8px 16px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.quick button {
  border: 1px solid #c7d2fe; background: #eef2ff; color: #4338ca;
  border-radius: 20px; padding: 5px 12px; font-size: 12px; cursor: pointer;
}

/* ---------- 通用卡片 / 表单 ---------- */
.card {
  background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,.06);
  padding: 20px; margin-bottom: 18px;
}
.card h3 { font-size: 16px; margin-bottom: 12px; }
.form-row { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.form-row input, .form-row select, .form-row textarea {
  padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; outline: none;
}
.form-row input { flex: 1; min-width: 140px; }
.form-row textarea { width: 100%; }
.btn-sm {
  padding: 8px 18px; border: none; border-radius: 8px; background: #4f46e5;
  color: #fff; font-size: 14px; cursor: pointer;
}
.btn-sm:hover { background: #4338ca; }
.empty { color: #9ca3af; font-size: 14px; padding: 10px 0; }

/* ---------- 看板 ---------- */
/* 看板面板占满主区可视高度：顶部内容自然撑开，看板区域占剩余空间内部滚动，页面不会无限拉长 */
#panel-progress.active { display: flex; flex-direction: column; height: calc(100vh - 48px); overflow: hidden; }
.kanban { display: flex; gap: 14px; overflow-x: auto; overflow-y: auto; flex: 1; min-height: 0; padding-bottom: 10px; }
.kanban-col {
  min-width: 210px; flex: 1; background: #f3f4f6; border-radius: 10px; padding: 12px;
}
.kanban-col h4 { font-size: 14px; margin-bottom: 10px; color: #374151; }
.kanban-card {
  position: relative; background: #fff; border-radius: 8px; padding: 10px 12px;
  margin-bottom: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.08); font-size: 13px;
}
.kanban-card .co { font-weight: bold; }
.kanban-card select { margin-top: 8px; width: 100%; padding: 5px; border: 1px solid #d1d5db; border-radius: 6px; }
.kanban-card .x {
  position: absolute; top: 4px; right: 8px; background: none; border: none;
  color: #9ca3af; cursor: pointer; font-size: 16px; line-height: 1;
}
.kanban-card .x:hover { color: #ef4444; }

/* ---------- 面试记录 ---------- */
#interviewList { max-height: calc(100vh - 330px); overflow-y: auto; padding-right: 4px; }
.iv-card .iv-head { display: flex; justify-content: space-between; align-items: center; }
.iv-card .iv-head h3 { margin-bottom: 8px; }
.del-btn {
  border: 1px solid #fecaca; background: #fef2f2; color: #ef4444;
  border-radius: 6px; padding: 3px 10px; font-size: 12px; cursor: pointer;
}
.del-btn:hover { background: #fee2e2; }

/* ---------- 消息 / 监控 ---------- */
/* 与面板自身匹配：推送面板上方只有标题+生成按钮卡片，占用约 160px */
#pushList { max-height: calc(100vh - 160px); overflow-y: auto; padding-right: 4px; }
/* 系统监控：知识库管理列表/Agent 运行记录内部滚动，不让页面无限变长 */
#kbList { max-height: calc(100vh - 330px); overflow-y: auto; padding-right: 4px; }
#runTraceView { max-height: 420px; overflow-y: auto; padding-right: 4px; }
.push-item { border-bottom: 1px solid #eef0f3; padding: 12px 4px; }
.push-item.unread { background: #eef2ff; border-radius: 8px; padding: 12px; }
.push-item .t { font-weight: bold; font-size: 14px; }
.push-item .c { font-size: 13px; color: #4b5563; margin-top: 6px; line-height: 1.7; }
.push-item .time { font-size: 11px; color: #9ca3af; margin-top: 6px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { background: #fff; border-radius: 12px; padding: 18px; text-align: center; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.stat-card .num { font-size: 28px; font-weight: bold; color: #4f46e5; }
.stat-card .name { font-size: 13px; color: #6b7280; margin-top: 4px; }
.log-view { background: #0f172a; color: #a5f3fc; border-radius: 10px; padding: 16px; font-size: 12px; font-family: Consolas, monospace; white-space: pre-wrap; max-height: 420px; overflow: auto; }
