/* TrackPicker — Mobbin-style command palette */

.tp-root{
  position: fixed; inset: 0;
  z-index: 200;
  background: rgba(15, 15, 17, 0.46);
  backdrop-filter: blur(6px) saturate(140%);
  -webkit-backdrop-filter: blur(6px) saturate(140%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 24px 24px;
  animation: tpFadeIn .22s cubic-bezier(.22,1,.36,1) both;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", system-ui, sans-serif;
  letter-spacing: -0.005em;
}
@keyframes tpFadeIn { 0%{opacity:0} 100%{opacity:1} }

.tp-modal{
  width: 100%;
  max-width: 800px;
  background: #ffffff;
  border-radius: 22px;
  box-shadow:
    0 1px 3px rgba(0,0,0,0.06),
    0 24px 60px -8px rgba(0,0,0,0.30);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: tpRise .28s cubic-bezier(.22,1,.36,1) both;
  corner-shape: squircle;
  -webkit-corner-shape: squircle;
}
@keyframes tpRise {
  0%   { opacity: 0; transform: translateY(14px) scale(.985); }
  100% { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ── search ── */
.tp-search{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid #f0f0f2;
}
.tp-search-ic{ color: #86868b; flex-shrink: 0; }
.tp-input{
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  color: #1d1d1f;
  padding: 4px 0;
  min-width: 0;
}
.tp-input::placeholder{ color: #86868b; }
.tp-view-toggles{ display: flex; gap: 4px; flex-shrink: 0; }
.tp-vt{
  appearance: none; -webkit-appearance: none; cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #86868b;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.tp-vt:hover{ background: #f5f5f7; color: #1d1d1f; }
.tp-vt.is-on{ background: #f0f0f2; color: #1d1d1f; }

/* ── recents ── */
.tp-recents{
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 14px 20px 16px;
  border-bottom: 1px solid #f0f0f2;
}
.tp-chip{
  appearance: none; -webkit-appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #e6e6e8;
  background: #fff;
  font: inherit; font-size: 13px; color: #1d1d1f;
  transition: background .15s ease, border-color .15s ease;
}
.tp-chip:hover{ background: #f5f5f7; border-color: #d2d2d7; }
.tp-chip-ic{
  color: #86868b;
  flex-shrink: 0;
}

/* 历史 chip：里面是 [主按钮 | ×]，整体看起来还是一个胶囊 */
.tp-chip--recent{
  padding: 0;
  overflow: hidden;
}
.tp-chip-main{
  appearance: none; -webkit-appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  height: 100%; padding: 0 4px 0 12px;
  border: 0; background: transparent;
  font: inherit; font-size: 13px; color: inherit;
}
.tp-chip-x{
  appearance: none; -webkit-appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  margin-right: 4px;
  border: 0; background: transparent;
  border-radius: 999px;
  color: #86868b;
  transition: background .15s ease, color .15s ease;
}
.tp-chip-x:hover{ background: #ebebef; color: #1d1d1f; }

/* 空状态：单行灰字 */
.tp-recents-empty{
  font-size: 12px;
  color: #a0a0a8;
  padding: 4px 2px;
}

/* ── body ── */
.tp-body{
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: 0;
  height: 380px;
  max-height: 56vh;
}

.tp-nav{
  border-right: 1px solid #f0f0f2;
  padding: 14px 12px;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}
.tp-nav-row{
  appearance: none; -webkit-appearance: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font: inherit; font-size: 14px; color: #1d1d1f;
  text-align: left;
  transition: background .15s ease;
}
.tp-nav-row:hover{ background: #f5f5f7; }
.tp-nav-row.on{ background: #f0f0f2; font-weight: 500; }
.tp-nav-ic{
  width: 18px; display: inline-flex; justify-content: center;
  font-size: 14px; line-height: 1;
}

.tp-list{
  padding: 14px 8px 14px 16px;
  overflow-y: auto;
  min-height: 0;
}
.tp-list-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #86868b;
  font-weight: 500;
  padding: 0 10px 8px;
}
.tp-clear{
  appearance: none; -webkit-appearance: none; cursor: pointer;
  border: 0; background: transparent;
  font: inherit; font-size: 12px; color: #1d1d1f;
  text-decoration: none;
  padding: 4px 6px;
}
.tp-clear:hover{ color: #86868b; }
.tp-list-ul{
  list-style: none;
  margin: 0; padding: 0;
}
.tp-list-row{
  appearance: none; -webkit-appearance: none; cursor: pointer;
  width: 100%;
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font: inherit; font-size: 14.5px;
  color: #1d1d1f;
  text-align: left;
  transition: background .15s ease, color .15s ease;
}
.tp-list-row:hover{ background: #f5f5f7; }
.tp-list-row.is-active{ background: #f0f0f2; color: #1d1d1f; }
.tp-list-check{
  width: 18px; height: 18px;
  border-radius: 6px;
  border: 1.5px solid #d2d2d7;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  background: #fff;
  flex-shrink: 0;
  transition: background .15s ease, border-color .15s ease;
}
.tp-list-row.is-active .tp-list-check{
  background: #1d1d1f;
  border-color: #1d1d1f;
}
.tp-list-count{
  font-size: 13px;
  color: #86868b;
  font-variant-numeric: tabular-nums;
}
.tp-empty{
  padding: 14px;
  font-size: 13px;
  color: #86868b;
}

/* ── 底栏 ── */
.tp-foot{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 12px 20px;
  border-top: 1px solid #f0f0f2;
  background: #ffffff;
}
.tp-foot-hint{
  font-size: 13px;
  color: #86868b;
}
.tp-done{
  appearance: none; -webkit-appearance: none; cursor: pointer;
  border: 0;
  height: 38px;
  padding: 0 22px;
  border-radius: 999px;
  background: #1d1d1f;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: background .15s ease, transform .1s ease;
}
.tp-done:hover{ background: #000; }
.tp-done:active{ transform: scale(.98); }

@media (max-width: 720px){
  .tp-root{ padding: 6vh 12px 12px; }
  .tp-body{ grid-template-columns: 1fr; height: auto; max-height: none; }
  .tp-nav{ border-right: 0; border-bottom: 1px solid #f0f0f2; flex-direction: row; overflow-x: auto; }
  .tp-nav-row{ flex-shrink: 0; }
}
