/* Search (名称 # 编号), palette, follows, page transitions */

/* ---- Two-field search ---- */
.sf { position: relative; width: 100%; }
.sf-box {
  display: flex; align-items: center; gap: 0;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px;
  box-shadow: var(--shadow); padding: 6px;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.sf-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft), var(--shadow); }
.sf-field { display: flex; align-items: center; gap: 10px; min-width: 0; height: 100%; cursor: text; }
.sf-field-name { flex: 1; padding-left: 14px; }
.sf-field-name svg { width: 19px; height: 19px; color: var(--muted); flex: none; transition: color .18s ease; }
.sf-box:focus-within .sf-field-name svg { color: var(--accent); }
.sf-field input {
  width: 100%; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 17px; font-weight: 600; letter-spacing: .01em; color: var(--text);
}
.sf-field input::placeholder { color: var(--muted); font-weight: 500; }
.sf-hash {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; margin: 0 4px;
  border-radius: 10px; background: var(--surface-2); color: var(--accent);
  font: 800 17px/1 var(--mono);
}
.sf-field-tag { flex: none; width: 118px; padding-right: 8px; }
.sf-field-tag input { font-family: var(--mono); letter-spacing: .06em; }
.sf-go {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 52px; padding: 0 22px; border: 0; border-radius: 13px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 15.5px;
  transition: filter .15s ease, transform .1s ease, width .2s ease;
}
.sf-go:hover { filter: brightness(1.08); }
.sf-go:active { transform: scale(.97); }
.sf-go svg { width: 17px; height: 17px; transition: transform .2s ease; }
.sf-go:hover svg { transform: translateX(3px); }
.sf.busy .sf-go { pointer-events: none; }
.sf.busy .sf-go svg { animation: spin .8s linear infinite; }
.sf.busy .sf-go svg path { d: path('M12 3a9 9 0 1 0 9 9'); }
@keyframes spin { to { transform: rotate(360deg); } }
.sf-msg { min-height: 20px; margin: 9px 6px 0; font-size: 13px; color: var(--muted); transition: color .15s ease; }
.sf-msg.error { color: var(--loss); }
.sf-msg.busy { color: var(--accent); }
.sf.shake .sf-box { animation: shake .36s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

.sf-md .sf-box { border-radius: 15px; padding: 5px; box-shadow: none; }
.sf-md .sf-field input { font-size: 16px; }
.sf-md .sf-go { height: 46px; padding: 0 18px; border-radius: 11px; }
.sf-md .sf-hash { width: 30px; height: 30px; }

.hh-copy .sf { margin-top: 28px; max-width: 620px; }
.hh-copy .sf-box { height: 66px; }

/* Quick picks (follows + recent) */
.hero-picks, .picks { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-picks { margin-top: 4px; max-width: 620px; }
.pick {
  display: inline-flex; align-items: center; gap: 8px; max-width: 220px;
  padding: 4px 12px 4px 4px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2); font-size: 13px;
  transition: border-color .15s ease, color .15s ease, transform .15s ease;
}
.pick:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.pick .avatar { width: 26px; height: 26px; border-radius: 50%; font-size: 11px; }
.pick-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-star { display: inline-grid; color: var(--amber); }
.pick-star svg { width: 13px; height: 13px; }

/* ---- Header search trigger ---- */
.search-trigger {
  display: inline-flex; align-items: center; gap: 9px; height: 36px; padding: 0 8px 0 12px; min-width: 210px;
  border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted);
  cursor: pointer; font-size: 13.5px; transition: border-color .15s ease, color .15s ease;
}
.search-trigger:hover { border-color: var(--accent); color: var(--text); }
.search-trigger svg { width: 16px; height: 16px; }
.search-trigger span { flex: 1; text-align: left; }
.nav-count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  border-radius: 9px; background: var(--accent); color: var(--accent-ink); font: 700 11px/1 var(--mono); vertical-align: 1px;
}

/* ---- Palette ---- */
.no-scroll { overflow: hidden; }
.palette {
  position: fixed; inset: 0; z-index: 60; display: flex; justify-content: center; align-items: flex-start;
  padding: min(16vh, 140px) 16px 16px;
  background: color-mix(in srgb, var(--bg) 62%, transparent); backdrop-filter: blur(10px) saturate(120%);
  animation: pal-fade .16s ease both;
}
.palette.closing { animation: pal-fade .16s ease reverse both; }
.palette-panel {
  width: min(640px, 100%); padding: 18px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--line-strong);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .75);
  animation: pal-rise .22s cubic-bezier(.2, .8, .2, 1) both;
}
.palette.closing .palette-panel { animation: pal-rise .16s ease reverse both; }
@keyframes pal-fade { from { opacity: 0; } }
@keyframes pal-rise { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
.palette-head { display: flex; align-items: baseline; gap: 10px; margin: 2px 2px 14px; }
.palette-head b { font-size: 16px; }
.palette-head .muted { font-size: 12.5px; flex: 1; }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.sm svg { width: 15px; height: 15px; }
.palette-picks { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.palette-label { font: 600 11px/1 var(--mono); letter-spacing: .14em; color: var(--muted); margin: 0 2px 10px; }
.palette-foot { display: flex; gap: 16px; margin-top: 16px; color: var(--muted); font-size: 12px; }

/* ---- Follow button ---- */
.btn.follow { height: 38px; padding: 0 16px; border-radius: 11px; font-size: 14px; background: var(--accent); color: var(--accent-ink); }
.btn.follow svg { width: 16px; height: 16px; }
.btn.follow.on { background: var(--surface-2); color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent); }
.btn.follow.pop svg { animation: pop .4s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { 40% { transform: scale(1.45) rotate(-12deg); } }
.btn.icon-only { width: 38px; height: 38px; padding: 0; border-radius: 11px; }
.pf-actions { align-items: center; }

/* ---- Follow cards ---- */
.follow-strip .section-head { margin-bottom: 12px; }
.link-more { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 13.5px; font-weight: 600; }
.link-more svg { width: 15px; height: 15px; }
.fc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.fc-grid.wide { margin-top: 18px; }
.fc {
  position: relative; display: block; padding: 14px; overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, opacity .18s ease;
}
.fc:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.fc::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line-strong); }
.fc.win::before { background: var(--win); }
.fc.loss::before { background: var(--loss); }
.fc.fresh { border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fc.removing { opacity: 0; transform: scale(.96); }
.fc-top { display: flex; align-items: center; gap: 10px; }
.fc-top .avatar { width: 36px; height: 36px; border-radius: 10px; font-size: 14px; }
.fc-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-name b { font-size: 15px; }
.fc-new { padding: 3px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 800; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px var(--accent-soft); } }
.fc-body { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; min-height: 36px; }
.fc-match { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fc-info { min-width: 0; }
.fc-line { display: flex; gap: 8px; align-items: baseline; font-size: 14px; white-space: nowrap; }
.fc-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.fc-empty { font-size: 13px; }
.fc-remove {
  position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 8px; border: 0; background: var(--surface-3); color: var(--muted); cursor: pointer;
  opacity: 0; transition: opacity .15s ease, color .15s ease;
}
.fc:hover .fc-remove, .fc-remove:focus-visible { opacity: 1; }
.fc-remove:hover { color: var(--loss); }
.fc-remove svg { width: 14px; height: 14px; }
.fc-grid.wide .fc-new { margin-right: 30px; }

.page-head { padding: 44px 0 8px; }
.page-head h1 { margin: 12px 0 8px; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.02em; }
.page-head .lead { margin: 0; color: var(--text-2); }
.page-head .eyebrow::before { display: none; }
.empty-follow { margin-top: 18px; }
.notify-card { display: flex; align-items: center; gap: 16px; margin-top: 14px; padding: 18px 20px; }
.notify-card .ico { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.notify-card .ico svg { width: 20px; height: 20px; }
.notify-card > div:nth-child(2) { flex: 1; }
.notify-card h3 { margin: 0 0 3px; font-size: 15px; }
.notify-card p { margin: 0; color: var(--text-2); font-size: 13.5px; }
.state .btn svg { width: 16px; height: 16px; }

/* ---- Route transition ---- */
.route-in { animation: route-in .22s ease both; }
@keyframes route-in { from { opacity: 0; transform: translateY(6px); } }

@media (max-width: 1020px) {
  .fc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .search-trigger { min-width: 0; padding: 0 10px; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .fc-grid { grid-template-columns: 1fr; }
  .fc-remove { opacity: 1; }
  .sf-field-tag { width: 76px; }
  .sf-go-label { display: none; }
  .sf-go { padding: 0 16px; }
  .hh-copy .sf-box { height: 60px; }
  .sf-field input { font-size: 16px; }
  .pf-actions { width: 100%; }
  .pf-actions .btn.follow { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .palette, .palette-panel, .route-in, .fc-new { animation: none !important; }
}
.nav-count[hidden] { display: none; }
