/* ============================================================
   Luminesca · Hollow Knight 显示层（2026-09-15）
   在所有旧样式之后加载；命名空间 body.hk-refresh，避免跨主题误伤。
   深色氛围与站点原有 token 保留，只补阅读宽度、目录、局部滚动与对比度。
   ============================================================ */
body.hk-refresh{--hk-measure:760px;--hk-toc:235px;--hk-gap:70px}

/* ---------- 阅读页：235px 目录 + 760px 正文 ---------- */
.hk-refresh .reading-layout{display:grid;grid-template-columns:var(--hk-toc) minmax(0,1fr);gap:var(--hk-gap);align-items:start;margin-top:6px}
.hk-refresh .reading-body{max-width:var(--hk-measure);min-width:0}
.hk-refresh .reading-body>section>h2:first-child,
.hk-refresh .reading-body>h2:first-child{margin-top:0}
@media(max-width:960px){
  .hk-refresh .reading-layout{display:block}
  .hk-refresh .reading-toc{position:static;margin:0 0 22px}
}

/* ---------- 本页目录 ---------- */
.hk-refresh .reading-toc{position:sticky;top:84px}
.hk-refresh .reading-toc details{border:1px solid var(--border-soft);background:var(--bg-card);border-radius:var(--radius);padding:12px 14px}
.hk-refresh .reading-toc summary{cursor:pointer;font-size:.92rem;font-weight:600;color:var(--text-main);list-style:none;display:flex;justify-content:space-between;align-items:center;gap:8px}
.hk-refresh .reading-toc summary::-webkit-details-marker{display:none}
.hk-refresh .reading-toc summary::after{content:"▾";color:var(--text-faint);font-size:.8rem;transition:transform .2s}
.hk-refresh .reading-toc details:not([open]) summary::after{transform:rotate(-90deg)}
.hk-refresh .reading-toc nav{display:grid;gap:2px;margin-top:10px}
.hk-refresh .reading-toc a{display:block;padding:7px 10px;border-radius:var(--radius-sm);font-size:.88rem;line-height:1.5;color:var(--text-dim);text-decoration:none}
.hk-refresh .reading-toc a:hover{background:var(--bg-card-hover);color:var(--text-main)}
.hk-refresh .reading-toc a.is-current{background:var(--gold-dim);color:var(--gold)}
@media(max-width:960px){.hk-refresh .reading-toc nav{grid-template-columns:repeat(auto-fill,minmax(0,1fr))}}

/* ---------- 锚点偏移与焦点 ---------- */
.hk-refresh :is(h2,h3)[id]{scroll-margin-top:104px}
.hk-refresh .reading-body :is(h2,h3)[id]:focus-visible{outline:2px solid var(--soul-blue);outline-offset:4px;border-radius:4px}

/* ---------- 对比度：旧模板残留的浅色站 token 在深色底上不可读 ---------- */
.hk-refresh .last-updated{color:var(--text-dim)!important}
.hk-refresh .editorial-sources p{color:var(--text-main)}
.hk-refresh .editorial-sources p:last-child{color:var(--text-dim)!important}
.hk-refresh .editorial-sources a{color:var(--soul-blue)}

/* ---------- 表格 / 代码局部滚动，页面不横向滚动 ---------- */
.hk-refresh .table-scroll{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;margin:14px 0;border:1px solid var(--border-soft);border-radius:var(--radius);background:var(--bg-card)}
.hk-refresh .table-scroll>table{margin:0;min-width:520px;border:0}
.hk-refresh .table-scroll:focus-visible{outline:2px solid var(--soul-blue);outline-offset:3px}
.hk-refresh pre,.hk-refresh .code{max-width:100%;overflow-x:auto}

/* ---------- 目录页：卡片网格安全列宽 + 工具条 ---------- */
.hk-refresh .card-grid{grid-template-columns:repeat(auto-fill,minmax(min(240px,100%),1fr))}
.hk-refresh .card-grid>*{min-width:0}
.hk-refresh .card .c-title,.hk-refresh .card .c-desc{overflow-wrap:anywhere}
.hk-refresh .dir-tools{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:18px 0 10px}
.hk-refresh .dir-search{position:relative;flex:1 1 260px;min-width:0}
.hk-refresh .dir-search input{width:100%;padding:10px 14px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--bg-main);color:var(--text-main);font-size:16px;font-family:var(--font-body)}
.hk-refresh .dir-search input:focus-visible{border-color:var(--soul-blue);outline:2px solid var(--soul-blue);outline-offset:1px}
.hk-refresh .dir-reset{padding:9px 16px;border:1px solid var(--border);border-radius:var(--radius-sm);background:transparent;color:var(--text-dim);font-size:.86rem;cursor:pointer}
.hk-refresh .dir-reset:hover{color:var(--text-main);border-color:var(--text-dim)}
.hk-refresh .dir-count{font-size:.86rem;color:var(--text-dim)}
.hk-refresh .dir-empty{margin:16px 0;padding:16px 18px;border:1px dashed var(--border);border-radius:var(--radius);color:var(--text-dim);font-size:.92rem}
.hk-refresh .card.is-filtered-out{display:none}
.hk-refresh .boss-filter button[aria-pressed="true"]{color:#0d1117;background:var(--soul-blue);border-color:var(--soul-blue);font-weight:600}

/* ---------- 阅读页正文节奏（旧模板段落与标题贴得太紧） ---------- */
.hk-refresh .reading-body>section{margin:0 0 26px}
.hk-refresh .reading-body>section:last-of-type{margin-bottom:18px}
.hk-refresh .reading-body h2{font-size:1.32rem;font-weight:600;line-height:1.45;margin:0 0 12px;padding-bottom:8px;border-bottom:1px solid var(--border-soft);color:var(--text-main)}
.hk-refresh .reading-body h3{font-size:1.06rem;font-weight:600;margin:20px 0 8px;color:var(--text-main)}
.hk-refresh .reading-body p{margin:0 0 14px;line-height:1.85}
.hk-refresh .reading-body ul,.hk-refresh .reading-body ol{margin:0 0 14px;padding-left:22px;line-height:1.85}
.hk-refresh .reading-body li{margin-bottom:6px}
.hk-refresh .reading-body .faq-item{margin:0 0 14px;padding:0 0 0 14px;border-left:2px solid var(--border);background:none}
.hk-refresh .reading-body .faq-item h3{margin:0 0 6px}
.hk-refresh .reading-body .faq-item p{margin:0}
.hk-refresh .reading-body a{color:var(--soul-blue)}
.hk-refresh .reading-body img{max-width:100%;height:auto;border-radius:var(--radius-sm)}
.hk-refresh .reading-body>.editorial-sources{margin-top:6px}

/* ---------- 目录页工具条：输入框对比度与触控尺寸 ---------- */
.hk-refresh .dir-search input{min-height:44px;border-color:#3a3a58;background:#15152a}
.hk-refresh .dir-search input::placeholder{color:var(--text-faint)}
.hk-refresh .dir-reset{min-height:44px}
.hk-refresh .card .c-desc{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}

/* ---------- 无脚本提示（交互工具页） ---------- */
.hk-refresh .no-js-note{border:1px solid var(--border);border-radius:var(--radius);padding:14px 16px;color:var(--text-dim);font-size:.9rem;margin:14px 0}
