/* ================= pakchuii 侧栏增强 v1 (2026-10-04) ================= */
/* ---------- 1. 右栏跟随滚动 → 已按需求撤下（2026-10-04），CSS 保留备用 ---------- */

/* ---------- 2. 文章目录（右栏导览窗） ---------- */
#pk-toc{display:none;}
#pk-toc.pk-on{display:block;}
#pk-toc .pk-toc-head{font-weight:bold;margin-bottom:8px;font-size:15px;}
#pk-toc .pk-toc-head i{color:var(--themecolor);margin-right:5px;}
#pk-toc .pk-toc-list{list-style:none;margin:0;padding:0;max-height:56vh;overflow-y:auto;}
#pk-toc .pk-toc-list::-webkit-scrollbar{width:5px;}
#pk-toc .pk-toc-list::-webkit-scrollbar-thumb{background:rgba(0,0,0,.15);border-radius:3px;}
#pk-toc .pk-toc-list li{margin:1px 0;}
#pk-toc a{display:block;padding:3px 8px;border-radius:6px;color:inherit;opacity:.78;
  font-size:13.5px;line-height:1.45;text-decoration:none;transition:all .2s;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#pk-toc a:hover{opacity:1;background:rgba(var(--themecolor-rgbstr),.1);text-decoration:none;}
#pk-toc li.pk-lv3 a{padding-left:20px;font-size:12.8px;}
#pk-toc li.pk-lv4 a{padding-left:32px;font-size:12.2px;opacity:.65;}
#pk-toc li.pk-active > a{opacity:1;font-weight:bold;color:var(--themecolor);
  background:rgba(var(--themecolor-rgbstr),.12);}
#pk-toc .pk-toc-bar{height:3px;border-radius:2px;background:rgba(125,125,125,.18);margin-top:10px;overflow:hidden;}
#pk-toc .pk-toc-bar i{display:block;height:100%;width:0;background:var(--themecolor);transition:width .25s;}
/* ---------- 3. 倒计时 ---------- */
.pk-cd{text-align:center;}
.pk-cd .pk-cd-t{font-weight:bold;font-size:14.5px;margin-bottom:6px;}
.pk-cd .pk-cd-t i{color:var(--themecolor);margin-right:4px;}
.pk-cd .pk-cd-big{font-size:32px;font-weight:bold;color:var(--themecolor);line-height:1.05;}
.pk-cd .pk-cd-big small{font-size:13px;font-weight:normal;margin-left:2px;}
.pk-cd .pk-cd-sub{font-family:SFMono-Regular,Consolas,Menlo,monospace;font-size:14px;
  opacity:.72;letter-spacing:.5px;margin-top:3px;}
.pk-cd .pk-cd-note{font-size:12px;opacity:.5;margin-top:6px;}
.pk-cd.pk-done .pk-cd-big,.pk-cd.pk-done .pk-cd-sub{color:#e83e8c;}
/* ---------- 4. GitHub 热力图 ---------- */
#pk-gh{text-align:center;}
#pk-gh .pk-gh-t{font-weight:bold;font-size:14.5px;margin-bottom:6px;}
#pk-gh .pk-gh-t i{color:var(--themecolor);margin-right:4px;}
#pk-gh .pk-gh-wrap{overflow-x:auto;padding-bottom:4px;}
#pk-gh .pk-gh-wrap::-webkit-scrollbar{height:5px;}
#pk-gh .pk-gh-wrap::-webkit-scrollbar-thumb{background:rgba(0,0,0,.15);border-radius:3px;}
#pk-gh .pk-gh-grid{display:grid;grid-auto-flow:column;grid-template-rows:repeat(7,6px);
  gap:2px;justify-content:start;width:max-content;}
#pk-gh .pk-gh-cell{width:6px;height:6px;border-radius:1px;background:#ebedf0;}
#pk-gh .pk-gh-legend{display:flex;align-items:center;justify-content:center;gap:3px;
  font-size:11px;opacity:.65;margin-top:6px;}
#pk-gh .pk-gh-legend .pk-gh-cell{width:8px;height:8px;}
#pk-gh .pk-gh-total{font-size:12.5px;opacity:.78;margin-top:5px;}
html.darkmode #pk-gh .pk-gh-cell{background:#2c2c30;}

/* ================================================================
   P1 · 纯新增功能（2026-10-04）
   代码复制按钮 / 页脚访问量 / 公告浮窗 / 考研日程卡
   —— 全部只作用于新增元素，不改动任何原有样式
   ================================================================ */
/* ---- P1-1 代码块复制按钮 ---- */
.pk-code-wrap{ position:relative; }
.pk-copy-btn{
  position:absolute; top:8px; right:8px; z-index:3;
  padding:3px 10px; font-size:12px; line-height:1.7;
  border:0; border-radius:7px; cursor:pointer; font-family:inherit;
  color:#fff; background:rgba(60,172,247,.92);
  opacity:0; transform:translateY(-4px);
  transition:opacity .18s ease, transform .18s ease, background .18s ease;
}
.pk-code-wrap:hover .pk-copy-btn, .pk-copy-btn:focus{ opacity:1; transform:none; }
.pk-copy-btn.pk-copied{ background:#4caf7d; }
@media (hover:none){ .pk-copy-btn{ opacity:.92; transform:none; } }
/* ---- P1-2 页脚访问量小字 ---- */
#pk-visitors{
  text-align:center; font-size:12.5px; opacity:.6; padding:6px 0 2px;
  letter-spacing:.3px;
}
#pk-visitors span{ font-variant-numeric:tabular-nums; }
html.darkmode #pk-visitors{ opacity:.5; }
/* ---- P1-3 公告浮窗 ---- */
#pk-notice-box{
  position:fixed; left:20px; bottom:22px; z-index:1035; max-width:330px;
  display:flex; flex-direction:column; gap:8px; pointer-events:none;
  opacity:0; transform:translateY(10px);
  transition:opacity .3s ease, transform .3s ease;
}
#pk-notice-box.pk-in{ opacity:1; transform:none; }
.pk-notice-row{
  pointer-events:auto; display:flex; align-items:flex-start; gap:8px;
  padding:11px 12px; border-radius:12px; font-size:13.5px; line-height:1.6;
  background:rgba(255,255,255,.88); color:#333;
  border:1px solid rgba(127,127,127,.12);
  box-shadow:0 10px 28px rgba(31,45,80,.16);
  -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
}
html.darkmode .pk-notice-row{
  background:rgba(45,47,55,.88); color:#e6e6e6; border-color:rgba(255,255,255,.08);
}
.pk-notice-close{
  flex:0 0 auto; width:20px; height:20px; padding:0; line-height:1;
  border:0; border-radius:50%; background:transparent; color:#999;
  font-size:16px; cursor:pointer;
}
.pk-notice-close:hover{ background:rgba(127,127,127,.15); color:#666; }
@media (max-width:768px){
  #pk-notice-box{ left:12px; right:12px; bottom:14px; max-width:none; }
}
/* ---- P1-4 考研日程卡 ---- */
#pk-ms{ font-size:13.5px; }
#pk-ms .pk-ms-title{ font-weight:600; margin-bottom:8px; }
#pk-ms .pk-ms-title i{ margin-right:6px; color:var(--themecolor); }
#pk-ms .pk-ms-item{
  display:flex; justify-content:space-between; align-items:center;
  padding:5px 0; border-bottom:1px dashed rgba(127,127,127,.18);
}
#pk-ms .pk-ms-item:last-child{ border-bottom:0; }
#pk-ms .pk-ms-day{
  font-variant-numeric:tabular-nums; font-weight:600; color:var(--themecolor);
  margin-left:10px; white-space:nowrap;
}
#pk-ms .pk-ms-item.pk-ms-past{ opacity:.45; }
#pk-ms .pk-ms-item.pk-ms-past .pk-ms-day{ color:inherit; font-weight:400; }
#pk-ms .pk-ms-item.pk-ms-today{
  background:rgba(var(--themecolor-rgbstr),.08); margin:0 -8px; padding:5px 8px;
  border-radius:8px; border-bottom:0;
}
#pk-ms .pk-ms-note{ font-size:11.5px; opacity:.55; margin-top:7px; line-height:1.5; }
/* P1-5 日程卡：名字后面的小字日期注释（纯新增） */
#pk-ms .pk-ms-name em{ font-style:normal; font-size:11px; opacity:.5; margin-left:3px; }

/* ================================================================
   P2 · 页内组件样式（2026-10-04）
   原本想写在页面正文里，会被 WordPress 的 KSES 过滤掉 → 改放这里。
   只作用于 .pk-tl*/.pk-fl* 这些只在特定页面出现的类名，不影响其它页面。
   ================================================================ */
/* ---- P2-1 考研时间轴 ---- */
.pk-tl{ position:relative; margin:10px 0 26px; padding-left:24px; }
.pk-tl::before{
  content:''; position:absolute; left:6px; top:8px; bottom:8px; width:2px;
  border-radius:2px; background:linear-gradient(180deg,#3cacf7,#8365fd); opacity:.45;
}
.pk-tl-item{ position:relative; padding:0 0 22px 6px; }
.pk-tl-item::before{
  content:''; position:absolute; left:-23px; top:5px; width:11px; height:11px;
  border-radius:50%; background:#fff; border:2px solid #8fb8f0; box-sizing:border-box;
}
.pk-tl-item.pk-done::before{ background:#5b8cf0; border-color:#5b8cf0; }
.pk-tl-item.pk-now::before{ background:#8365fd; border-color:#8365fd; box-shadow:0 0 0 4px rgba(131,101,253,.18); }
.pk-tl-date{ font-size:12.5px; opacity:.6; letter-spacing:.4px; }
.pk-tl-title{ font-weight:600; margin:1px 0 4px; }
.pk-tl-desc{ font-size:13.5px; opacity:.82; line-height:1.75; }
.pk-tl-tag{ display:inline-block; font-size:11px; padding:1px 7px; border-radius:20px; margin-left:7px; vertical-align:1px; }
.pk-tl-tag.pk-t-done{ background:rgba(91,140,240,.14); color:#5b8cf0; }
.pk-tl-tag.pk-t-now{ background:rgba(131,101,253,.16); color:#8365fd; }
.pk-tl-tag.pk-t-todo{ background:rgba(127,127,127,.14); color:#8b94a8; }
.pk-tl-tag.pk-t-key{ background:rgba(255,95,109,.14); color:#e8615c; }
html.darkmode .pk-tl-item::before{ background:#2c2e36; }
html.darkmode .pk-tl-item.pk-done::before{ background:#5b8cf0; border-color:#5b8cf0; }
@media (max-width:600px){ .pk-tl{ padding-left:19px; } .pk-tl-item::before{ left:-18px; } }
/* ---- P2-2 友链卡片 ---- */
.pk-fl{ display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:14px; margin:14px 0 26px; }
.pk-fl-card{
  display:flex; align-items:center; gap:12px; padding:14px; border-radius:12px;
  text-decoration:none !important; background:rgba(127,127,127,.05);
  border:1px solid rgba(127,127,127,.12); transition:transform .2s ease, box-shadow .2s ease;
}
.pk-fl-card:hover{ transform:translateY(-3px); box-shadow:0 10px 24px rgba(31,45,80,.12); }
.pk-fl-avatar{
  width:42px; height:42px; border-radius:50%; flex:0 0 auto; overflow:hidden;
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-weight:600; font-size:15px;
  background:linear-gradient(135deg,#3cacf7,#8365fd);
}
.pk-fl-avatar img{ width:100%; height:100%; object-fit:cover; }
.pk-fl-name{ font-weight:600; font-size:14.5px; }
.pk-fl-desc{ font-size:12.5px; opacity:.65; margin-top:2px; line-height:1.5; }
.pk-fl-note{ font-size:13px; opacity:.75; line-height:1.8; }

/* ================================================================
   P3 · 顶栏搜索栏防挤压 + 菜单响应式收紧（2026-10-04）
   症状：菜单项变多后，点开搜索框会被压缩变形
   原因：搜索框所在容器是 flex 子项，默认可以收缩（flex-shrink:1）
   思路：① 搜索框永不收缩 ② 屏幕变窄时菜单项逐步收紧让位 ③ 极窄时允许横向滑动
   ================================================================ */
/* ---- ① 搜索框固定尺寸，永不参与压缩 ---- */
#navbar_search_container,
#navbar_search_input_container{ flex:0 0 auto !important; }
#navbar_search_input_container .input-group{ flex-wrap:nowrap !important; }
#navbar_search_input_container.open input.form-control{
  flex:0 0 auto !important;
}
/* 菜单项不换行（避免被挤成两行） */
.navbar-nav .nav-link{ white-space:nowrap !important; }
#navbar_global .navbar-nav{ min-width:0; }
/* ---- ② 屏幕收窄时，菜单项逐级收紧给搜索框让位 ---- */
@media (max-width:1680px){
  .navbar-nav .nav-link{ padding-left:.62rem !important; padding-right:.62rem !important; font-size:.95rem !important; }
}
@media (max-width:1520px){
  .navbar-nav .nav-link{ padding-left:.5rem !important; padding-right:.5rem !important; font-size:.92rem !important; }
  .navbar-nav .nav-link i.fa{ margin-right:.2rem !important; }
}
@media (max-width:1380px){
  .navbar-nav .nav-link{ padding-left:.4rem !important; padding-right:.4rem !important; font-size:.88rem !important; }
}
@media (max-width:1260px){
  .navbar-nav .nav-link{ padding-left:.32rem !important; padding-right:.32rem !important; font-size:.85rem !important; }
}
/* ---- ③ 再窄就让菜单横向滑动，绝不压扁 ---- */
@media (max-width:1150px){
  #navbar_global .navbar-nav{
    flex-wrap:nowrap !important; overflow-x:auto !important;
    scrollbar-width:none; -ms-overflow-style:none;
  }
  #navbar_global .navbar-nav::-webkit-scrollbar{ display:none; }
  #navbar_global .navbar-nav .nav-item{ flex:0 0 auto; }
}

/* ================================================================
   P3-2 搜索栏：只清掉「收起后残留的白影」，其余一律不动
   （2026-10-04 二次修正）
   背景：上一版为了消白点，额外加了 opacity / visibility / overflow /
         transition 的覆盖，结果干扰了主题原本的开合动画。
   现在改成最小干预：动画、透明度、过渡全部交还主题；
   只针对「那层带 !important 的 box-shadow 白影」下手。
   ================================================================ */
#navbar_search_input_container:not(.open) .input-group,
#navbar_search_input_container:not(.open) .input-group-prepend,
#navbar_search_input_container:not(.open) .input-group-text{
  background:transparent !important;
  box-shadow:none !important;
}
#navbar_search_input_container:not(.open) input.form-control{
  background:transparent !important;
  box-shadow:none !important;
  border:0 !important;
}
/* ================================================================
   P4 · 知识库索引页组件（2026-10-04）
   只作用于 .pk-kb-* 类名，只在「知识库」这一页出现
   ================================================================ */
.pk-kb-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(255px,1fr)); gap:16px; margin:16px 0 8px; }
.pk-kb-card{ border-radius:12px; padding:16px 16px 14px; background:rgba(127,127,127,.05); border:1px solid rgba(127,127,127,.12); transition:transform .2s ease, box-shadow .2s ease; }
.pk-kb-card:hover{ transform:translateY(-3px); box-shadow:0 10px 24px rgba(31,45,80,.10); }
.pk-kb-head{ display:flex; justify-content:space-between; align-items:baseline; margin-bottom:10px; }
.pk-kb-name{ font-weight:600; font-size:15.5px; }
.pk-kb-count{ font-size:12px; opacity:.55; white-space:nowrap; margin-left:8px; }
.pk-kb-list{ list-style:none; margin:0 0 10px; padding:0; }
.pk-kb-list li{ margin:0 0 6px; font-size:13.5px; line-height:1.6; padding-left:12px; position:relative; }
.pk-kb-list li::before{ content:'·'; position:absolute; left:2px; opacity:.45; }
.pk-kb-list li a{ text-decoration:none; }
.pk-kb-list li a:hover{ text-decoration:underline; }
.pk-kb-empty{ font-size:13px; opacity:.5; margin-bottom:10px; }
.pk-kb-more{ font-size:12.5px; opacity:.7; text-decoration:none; }
.pk-kb-more:hover{ opacity:1; }
.pk-kb-section{ margin-top:28px; }
.pk-kb-h2{ font-size:17px !important; margin-bottom:12px !important; padding-left:0 !important; }
.pk-kb-h2::before{ display:none !important; }
.pk-kb-tags a{ display:inline-block; font-size:12.5px; padding:3px 11px; border-radius:20px; margin:0 8px 8px 0; background:rgba(127,127,127,.08); border:1px solid rgba(127,127,127,.12); text-decoration:none !important; }
.pk-kb-tags a:hover{ background:rgba(127,127,127,.18); }
.pk-kb-tagcount{ font-size:10.5px; opacity:.5; margin-left:5px; vertical-align:1px; }
.pk-kb-recent{ list-style:none; padding:0; margin:0; }
.pk-kb-recent li{ margin-bottom:7px; font-size:13.5px; line-height:1.6; }
.pk-kb-date{ font-size:12px; opacity:.5; margin-left:8px; }

/* ================================================================
   P5 · 下拉菜单自动分栏（2026-10-04）
   平时不生效——只有某个下拉里的项目超过 8 个时，
   脚本才给它加上 .pk-mega/.pk-cols-2/.pk-cols-3，自动变成 2~3 列。
   （不改 display，避免影响主题原本的悬停显示逻辑）
   ================================================================ */
.navbar-nav .dropdown-menu.pk-mega{
  max-height:72vh; overflow-y:auto;
  padding-top:8px; padding-bottom:8px;
}
.navbar-nav .dropdown-menu.pk-mega .dropdown-item{ break-inside:avoid; }
.navbar-nav .dropdown-menu.pk-mega.pk-cols-2{ column-count:2; column-gap:6px; min-width:340px; }
.navbar-nav .dropdown-menu.pk-mega.pk-cols-3{ column-count:3; column-gap:6px; min-width:480px; }
@media (max-width:768px){
  .navbar-nav .dropdown-menu.pk-mega{ column-count:1 !important; min-width:0 !important; max-height:60vh; }
}
