/* ===== 模板库页面样式 ===== */

.lib-hero { padding: 44px 20px 8px; }
.lib-hero h1 { font-size: 30px; margin: 0 0 8px; letter-spacing: -.4px; }
.lib-hero h1 small { font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 10px; letter-spacing: 0; }
.lib-hero p { color: var(--muted); font-size: 14px; margin: 0 0 18px; }

.lib-search { position: relative; max-width: 520px; }
.lib-search input {
  width: 100%; padding: 12px 44px 12px 40px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  font-size: 14px; font-family: inherit; color: var(--ink); outline: none;
  box-shadow: var(--shadow-sm); transition: .15s;
}
.lib-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(16, 185, 129, .12); }
.lib-search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }
.lib-search .kbd {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: var(--muted); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px; background: #f8fafc;
}

/* 筛选区 */
.lib-filters { margin: 20px 0 6px; border-top: 1px solid var(--line); padding-top: 16px; }
.fr { display: flex; align-items: flex-start; gap: 14px; padding: 5px 0; }
.fr > .fl { flex: 0 0 52px; font-size: 12.5px; color: var(--muted); padding-top: 6px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.chip {
  padding: 5px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; font-size: 12.5px; color: var(--ink); cursor: pointer;
  font-family: inherit; transition: .14s; line-height: 1.5;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip .n { opacity: .55; margin-left: 4px; font-size: 11px; }
.chip.is-on .n { opacity: .8; }

/* 结果条 */
.lib-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 0 16px; border-bottom: 1px solid var(--line); margin-bottom: 22px;
}
.lib-bar .cnt { font-size: 13px; color: var(--muted); }
.lib-bar .cnt b { color: var(--ink); font-size: 15px; }
.lib-bar .sp { flex: 1; }
.lib-bar select {
  padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; font-size: 13px; font-family: inherit; color: var(--ink); cursor: pointer;
}
.lib-bar .ghost-btn {
  padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; font-size: 13px; color: var(--muted); cursor: pointer; font-family: inherit;
}
.lib-bar .ghost-btn:hover { border-color: var(--brand); color: var(--brand); }
.lib-bar .ghost-btn.is-on { background: #fffbeb; border-color: #fbbf24; color: #b45309; }

/* 网格 */
.tgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.tcard {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; box-shadow: var(--shadow-sm); transition: .18s;
  display: flex; flex-direction: column;
}
.tcard:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #d7e3ec; }

.tcard__thumb { position: relative; height: 330px; overflow: hidden; background: #eef2f6; }
.tcard__mini { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; }
.tcard__mini .resume-show-new, .tcard__mini .resume { transform-origin: top left; box-shadow: none !important; }

/* 占位骨架：样式加载完之前先给个「像简历」的形状，避免白块 */
.tcard__ph {
  position: absolute; inset: 0; padding: 16px 14px 0 16px; background: #fff;
  display: flex; flex-direction: column; gap: 9px;
}
.tcard__ph::before {
  content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 5px;
  background: var(--ph, #4672f2); opacity: .85;
}
.tcard__ph b {
  display: block; height: 12px; width: 42%; border-radius: 4px;
  background: var(--ph, #4672f2); opacity: .85; margin: 4px 0 6px 4px;
}
.tcard__ph i { display: block; height: 6px; border-radius: 3px; background: #e9eef3; margin-left: 4px; }
.tcard__ph i:nth-child(2) { width: 88%; }
.tcard__ph i:nth-child(3) { width: 70%; }
.tcard__ph i:nth-child(4) { width: 92%; }
.tcard__ph i:nth-child(5) { width: 58%; }
.tcard__ph i:nth-child(6) { width: 78%; }
.tcard__mini > .resume-show-new, .tcard__mini > .resume { animation: tFade .22s ease both; }
@keyframes tFade { from { opacity: 0 } to { opacity: 1 } }
.tcard__err {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #94a3b8; font-size: 12px; background: #f8fafc;
}
.tcard__fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 56px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #fff);
  pointer-events: none;
}
.tcard__fav {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.92); color: #cbd5e1; font-size: 15px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.tcard__fav:hover { color: #f59e0b; transform: scale(1.06); }
.tcard__fav.is-on { color: #f59e0b; border-color: #fcd34d; background: #fffbeb; }
.tcard__badge {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  font-size: 11px; padding: 2px 8px; border-radius: 6px;
  background: rgba(15,23,42,.55); color: #fff; backdrop-filter: blur(4px);
}

.tcard__body { padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.tcard__name { font-size: 13.5px; font-weight: 700; line-height: 1.45; }
.tcard__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; min-height: 20px; }
.tcard__tags span {
  font-size: 11px; color: var(--muted); background: #f4f7fa;
  border-radius: 5px; padding: 1px 7px;
}
.tcard__acts { display: flex; gap: 8px; margin-top: 11px; }
.tcard__acts .btn { flex: 1; justify-content: center; padding: 7px 10px; font-size: 12.5px; }

/* 空态 */
.lib-empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.lib-empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }
.lib-empty button {
  margin-top: 14px; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--brand); cursor: pointer; font-family: inherit; font-size: 13px;
}

@media (max-width: 1080px) { .tgrid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px) {
  .tgrid { grid-template-columns: repeat(2, 1fr); }
  .tcard__thumb { height: 260px; }
}
@media (max-width: 560px) {
  .tgrid { grid-template-columns: 1fr; }
  .tcard__thumb { height: 300px; }
  .lib-hero { padding: 28px 12px 6px; }
  .lib-hero h1 { font-size: 24px; }
  .fr { gap: 8px; }
  .fr > .fl { flex: 0 0 38px; font-size: 12px; }
  .chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .chips::-webkit-scrollbar { height: 0; }
}
