/* ============================================================
   卡种介绍 · 左侧总目录  (v11 / 2026-11-15)
   作用域：.hly-tg-dir-* 与 .hly-tg-grid3，不污染其它页面。
   外置原因：模板引擎会编译 .htm 内的裸花括号与变量。
   ============================================================ */

/* ---- 左栏容器（作为 grid 第一个子元素，位于文章左侧） ---- */
.hly-tg-dir-side{min-width:0;align-self:start}
.hly-tg-dir-card{
  background:#fff;border:1px solid var(--line,#e3ecfb);border-radius:12px;
  box-shadow:0 6px 18px rgba(27,53,99,.06);
  padding:14px 13px 12px;overflow:hidden
}
@media(min-width:1081px){
  .hly-tg-dir-side{position:sticky;top:14px}
  .hly-tg-dir-card{max-height:calc(100vh - 28px);display:flex;flex-direction:column}
  /* 仅在有左栏的推广页启用三列；不影响任何其它页面 */
  .hly-ep-grid.hly-tg-grid3{grid-template-columns:212px minmax(0,1fr) 286px!important;gap:16px}
}
@media(max-width:1080px){
  .hly-tg-dir-card{margin-bottom:4px}
  .hly-tg-dir-scroll{max-height:260px}
}

/* ---- 卡头 ---- */
.hly-tg-dir-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}
.hly-tg-dir-head h4{
  margin:0;font-size:14px;font-weight:700;color:var(--navy,#17315c);
  padding-left:10px;border-left:3px solid var(--blue,#1a8bfc);line-height:1.2
}
.hly-tg-dir-count{
  flex:none;min-width:26px;text-align:center;font-size:11px;font-weight:700;
  color:var(--blue-dark,#0d63c9);background:var(--blue-soft,#eaf3ff);
  border-radius:20px;padding:2px 7px
}
.hly-tg-dir-all{
  display:block;text-decoration:none;font-size:12px;font-weight:700;color:#fff;
  background:linear-gradient(100deg,#00aaff,#0096ff);border-radius:8px;
  padding:8px 11px;margin-bottom:10px;transition:filter .18s
}
.hly-tg-dir-all:hover{filter:brightness(.93)}

/* ---- 搜索 ---- */
.hly-tg-dir-searchbox{position:relative;margin-bottom:9px}
.hly-tg-dir-searchbox input{
  width:100%;box-sizing:border-box;height:32px;line-height:30px;
  border:1px solid var(--line,#e3ecfb);border-radius:8px;
  padding:0 10px 0 28px;font-size:12px;color:var(--ink,#22314d);
  background:#f7faff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237b8db0' stroke-width='2'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21'/%3E%3C/svg%3E") no-repeat 9px center;
  outline:none;transition:border-color .18s,box-shadow .18s
}
.hly-tg-dir-searchbox input:focus{border-color:#8dc2ff;box-shadow:0 0 0 3px rgba(26,139,252,.12);background-color:#fff}
.hly-tg-dir-searchbox input::-webkit-search-cancel-button{cursor:pointer}

/* ---- 分组与列表 ---- */
.hly-tg-dir-scroll{overflow-y:auto;overscroll-behavior:contain;min-height:0;padding-right:2px}
.hly-tg-dir-scroll::-webkit-scrollbar{width:5px}
.hly-tg-dir-scroll::-webkit-scrollbar-thumb{background:#c9dcf5;border-radius:6px}
.hly-tg-dir-grp{margin-bottom:6px}
.hly-tg-dir-h{
  display:flex;align-items:center;gap:6px;width:100%;box-sizing:border-box;
  border:0;background:#f2f7ff;color:var(--navy,#17315c);
  font-size:11.5px;font-weight:700;letter-spacing:.2px;
  padding:6px 9px;border-radius:7px;cursor:pointer;text-align:left
}
.hly-tg-dir-h:hover{background:#e6f1ff}
.hly-tg-dir-h i{font-style:normal;font-size:10px;color:#7b8db0;margin-left:auto}
.hly-tg-dir-h b{font-style:normal;font-size:13px;line-height:1;color:var(--blue,#1a8bfc);width:10px;text-align:center}
.hly-tg-dir-grp.collapsed .hly-tg-dir-h b{transform:rotate(-90deg)}
.hly-tg-dir-grp.collapsed .hly-tg-dir-list{display:none}
.hly-tg-dir-grp.searching .hly-tg-dir-list{display:block!important}
.hly-tg-dir-grp[hidden]{display:none!important}
.hly-tg-dir-list{list-style:none;margin:4px 0 0;padding:0}
.hly-tg-dir-list li{margin:0}
.hly-tg-dir-list li[hidden]{display:none!important}
.hly-tg-dir-list a{
  display:block;text-decoration:none;font-size:12px;line-height:1.5;
  color:#53678a;padding:4px 8px 4px 10px;border-radius:6px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  border-left:2px solid transparent;transition:background .15s,color .15s
}
.hly-tg-dir-list a:hover{background:#f2f7ff;color:var(--blue-dark,#0d63c9)}
.hly-tg-dir-list a.on{
  background:linear-gradient(100deg,#00aaff,#0096ff);color:#fff;font-weight:700;
  border-left-color:#0069c9;box-shadow:0 3px 10px rgba(0,150,255,.22)
}
.hly-tg-dir-empty{
  display:none;font-size:12px;color:#8b9ab4;text-align:center;
  padding:16px 6px;background:#fafbfe;border-radius:8px;margin-top:6px
}
.hly-tg-dir-empty.show{display:block}

/* ---- 窄屏：单列布局下目录收在正文之前，内滚动限高 ---- */
@media(max-width:820px){
  .hly-tg-dir-card{padding:12px}
  .hly-tg-dir-scroll{max-height:220px}
}
