/* 鹤鸣 · 投递追踪看板
 * 依赖 base.css 的变量与 .btn / .nav / .menu
 */

.tk-body { background: var(--bg); }
.tk-wrap { padding: 26px 20px 60px; }

/* 导航当前页高亮已统一到 base.css 的 .nav__links a.is-active */

/* 下拉菜单（base.css 里没有，本页独立补一份） */
.menu {
  position: absolute; z-index: 70; min-width: 190px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 36px rgba(15,23,42,.16);
}
.menu[hidden] { display: none; }
.menu button {
  display: block; width: 100%; text-align: left; padding: 8px 10px;
  border: none; background: transparent; border-radius: 8px;
  font-family: inherit; font-size: 13px; color: var(--ink); cursor: pointer;
}
.menu button:hover { background: #f1f5f9; }
.menu button.danger { color: #dc2626; }
.menu button.danger:hover { background: #fef2f2; }

/* ===== 顶部 ===== */
.tk-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.tk-head h1 { margin: 0 0 4px; font-size: 22px; color: var(--ink); }
.tk-sub { margin: 0; font-size: 13px; color: var(--muted); }
.tk-head__ops { display: flex; gap: 10px; position: relative; align-items: flex-start; }
.tk-head__ops .menu { top: calc(100% + 8px); right: 0; }
.tk-head__ops .menu hr {
  border: none; border-top: 1px solid var(--line); margin: 5px 4px;
}

/* ===== 统计 ===== */
.tk-stats {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px; margin-bottom: 16px;
}
.tk-stat {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 2px;
}
.tk-stat b {
  font-size: 22px; line-height: 1.2; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.tk-stat span { font-size: 12px; color: var(--muted); }
.tk-stat.is-good { background: #f0fdf4; border-color: #bbf7d0; }
.tk-stat.is-good b { color: #059669; }
.tk-stat.is-warn { background: #fffbeb; border-color: #fde68a; }
.tk-stat.is-warn b { color: #b45309; }

/* ===== 工具栏 ===== */
.tk-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.tk-search {
  flex: 1 1 220px; max-width: 320px;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px;
  font-family: inherit; font-size: 13px; color: var(--ink); background: #fff;
  outline: none; transition: .15s;
}
.tk-search:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(16,185,129,.1); }
.tk-select {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px;
  font-family: inherit; font-size: 13px; color: var(--ink); background: #fff;
  cursor: pointer; max-width: 180px;
}
.tk-check {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted); cursor: pointer; user-select: none;
}
.tk-check input { accent-color: var(--brand); }
.tk-hint { font-size: 12.5px; color: var(--brand); font-weight: 600; }

/* ===== 看板 ===== */
.tk-board {
  display: grid; grid-template-columns: repeat(6, minmax(170px, 1fr));
  gap: 10px; align-items: start;
  overflow-x: auto; padding-bottom: 8px;
}
.tk-col {
  background: #f1f5f9; border-radius: 14px; padding: 10px;
  min-height: 120px; transition: background .15s, box-shadow .15s;
  display: flex; flex-direction: column; min-width: 0;
}
.tk-col.is-over { background: #e0f2fe; box-shadow: inset 0 0 0 2px #38bdf8; }
.tk-col__head {
  display: flex; align-items: center; gap: 7px;
  padding: 2px 4px 10px; font-size: 13px; font-weight: 600; color: var(--ink);
}
.tk-col__dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.tk-col__dot--todo { background: #94a3b8; }
.tk-col__dot--applied { background: #3b82f6; }
.tk-col__dot--viewed { background: #8b5cf6; }
.tk-col__dot--interview { background: #f59e0b; }
.tk-col__dot--offer { background: #10b981; }
.tk-col__dot--closed { background: #cbd5e1; }
.tk-col__name { flex: 1 1 auto; }
.tk-col__count {
  flex: 0 0 auto; font-size: 11.5px; font-weight: 600; color: var(--muted);
  background: #fff; border-radius: 999px; padding: 1px 8px;
  font-variant-numeric: tabular-nums;
}
.tk-col__body { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.tk-col__empty {
  font-size: 12px; color: #94a3b8; text-align: center;
  padding: 18px 6px; border: 1px dashed #cbd5e1; border-radius: 10px;
}

/* ===== 卡片 ===== */
.tk-card {
  background: #fff; border: 1px solid var(--line); border-radius: 11px;
  padding: 10px 11px; cursor: pointer;
  transition: .14s; box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.tk-card:hover { border-color: #cbd5e1; box-shadow: 0 4px 12px rgba(15,23,42,.08); transform: translateY(-1px); }
.tk-card.is-dragging { opacity: .45; transform: none; }
.tk-card__top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-bottom: 3px;
}
.tk-card__company {
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tk-score {
  flex: 0 0 auto; font-size: 10.5px; font-weight: 600; color: #2563eb;
  background: #eff6ff; border-radius: 999px; padding: 1px 6px;
  font-variant-numeric: tabular-nums;
}
.tk-card__role {
  font-size: 12.5px; color: var(--muted); line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tk-card__meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.tk-tag {
  font-size: 10.5px; color: #2563eb; background: #eff6ff;
  border-radius: 999px; padding: 1px 7px; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tk-tag--gray { color: var(--muted); background: #f1f5f9; }
.tk-card__date { font-size: 11px; color: #94a3b8; margin-top: 6px; }
.tk-due {
  font-size: 11px; margin-top: 5px; padding: 3px 7px; border-radius: 6px;
  display: inline-block;
}
.tk-due--over { color: #b91c1c; background: #fef2f2; font-weight: 600; }
.tk-due--today { color: #b45309; background: #fffbeb; font-weight: 600; }
.tk-due--soon { color: #a16207; background: #fefce8; }
.tk-due--normal { color: var(--muted); background: #f8fafc; }

/* ===== 空态 ===== */
.tk-blank {
  background: #fff; border: 1px dashed #cbd5e1; border-radius: 16px;
  padding: 40px 24px; text-align: center; margin-bottom: 14px;
}
.tk-blank h3 { margin: 0 0 8px; font-size: 16px; color: var(--ink); }
.tk-blank p { margin: 0 0 16px; font-size: 13px; color: var(--muted); line-height: 1.7; }

.tk-foot {
  margin: 16px 0 0; font-size: 12px; color: #94a3b8; line-height: 1.7;
}

/* ===== 弹窗 ===== */
.tk-mask {
  position: fixed; inset: 0; z-index: 100; padding: 20px;
  background: rgba(15,23,42,.45);
  display: flex; align-items: center; justify-content: center;
}
.tk-mask[hidden] { display: none; }
.tk-panel {
  width: 100%; max-width: 580px; max-height: 88vh; overflow-y: auto;
  background: #fff; border-radius: 16px; padding: 20px 22px 16px;
  box-shadow: 0 20px 60px rgba(15,23,42,.28);
}
.tk-panel__head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.tk-panel__head h2 { margin: 0; font-size: 16px; color: var(--ink); }
.tk-x {
  border: none; background: transparent; font-size: 24px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 0 2px;
}
.tk-x:hover { color: var(--ink); }

.tk-form { display: flex; flex-direction: column; gap: 10px; }
.tk-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tk-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.tk-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tk-field > span { font-size: 12px; color: var(--muted); }
.tk-field input, .tk-field select, .tk-field textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 13px; color: var(--ink); background: #fff;
  outline: none; transition: .14s; resize: vertical;
}
.tk-field input:focus, .tk-field select:focus, .tk-field textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(16,185,129,.1);
}
.tk-jd { font-size: 12px; line-height: 1.6; margin: -2px 0 2px; }
.tk-jd:empty { display: none; }
.tk-jd__ok { color: var(--muted); }
.tk-jd__ok b { color: #2563eb; font-size: 13px; }
.tk-jd__saved { color: var(--muted); }
.tk-jd__warn { color: #b45309; }

.tk-panel__foot {
  display: flex; align-items: center; gap: 10px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
}
.tk-panel__spacer { flex: 1 1 auto; }
#tkDelete { color: #dc2626; border-color: #fecaca; }
#tkDelete:hover { border-color: #dc2626; background: #fef2f2; }

/* ===== 响应式 ===== */
@media (max-width: 1080px) {
  .tk-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .tk-wrap { padding: 18px 14px 48px; }
  .tk-head h1 { font-size: 19px; }
  .tk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tk-stat b { font-size: 19px; }
  .tk-board {
    grid-template-columns: none; grid-auto-flow: column;
    grid-auto-columns: 72vw; overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  .tk-col { scroll-snap-align: start; }
  .tk-search { max-width: none; flex-basis: 100%; }
  .tk-row2, .tk-row3 { grid-template-columns: 1fr; }
  .tk-panel { padding: 16px 16px 12px; max-height: 92vh; }
}

/* ===== 打印（基本没用，但别打出一堆深色块） ===== */
@media print {
  .tk-body { background: #fff; }
  .nav, .tk-head__ops, .tk-toolbar, .tk-foot, .tk-mask { display: none !important; }
  .tk-board { grid-template-columns: repeat(3, 1fr); overflow: visible; }
  .tk-col { background: #fff; border: 1px solid #ddd; }
}
