/* floor-preview — 楼层目录面板
 * 全部颜色走站点统一 CSS 变量（--surface/--ink/--accent 等），
 * 深浅模式、主题切换由站点 html[data-theme] 统一驱动，插件不自带深色令牌。
 */
:root {
  --fp-font: var(--font-sans);
}

/* ===== 触发条：贴内容区边缘（right/left 由 JS 计算），无背景仅刻度 ===== */
.fp-trigger{
  position:fixed;top:50%;transform:translateY(-50%);
  right:0;z-index:1000;width:34px;
  display:flex;flex-direction:column;align-items:flex-end;justify-content:center;gap:6px;
  padding:12px 12px 12px 0;background:transparent;border:none;border-radius:0;box-shadow:none;
  cursor:pointer;-webkit-user-select:none;user-select:none;
  max-height:calc(100vh - 24px);overflow:hidden;
}
.fp-trigger.fp-left{right:auto;left:0;align-items:flex-start;padding:12px 0 12px 12px}
.fp-trigger.fp-left .fp-tick{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px}
/* 刻度颜色跟随站点 --accent（站点切主题时变量变化，自动适配） */
.fp-tick{
  width:8px;height:2px;flex:0 0 auto;
  border-top-left-radius:2px;border-bottom-left-radius:2px;
  background-color:color-mix(in srgb,var(--accent) 42%,transparent);
  transition:width .2s ease,background-color .2s ease;
}
.fp-tick.fp-active{background-color:color-mix(in srgb,var(--accent) 92%,transparent);width:22px}
.fp-tick.fp-current{background-color:color-mix(in srgb,var(--accent) 65%,transparent);width:11px}

/* ===== 目录面板（颜色全部走站点变量） ===== */
.fp-panel{
  /* 距离色阶：以 --ink 为基色逐级降低不透明度，深浅模式自动适配 */
  --fp-d1:color-mix(in srgb,var(--ink) 78%,transparent);
  --fp-d2:color-mix(in srgb,var(--ink) 56%,transparent);
  --fp-d3:color-mix(in srgb,var(--ink) 40%,transparent);
  --fp-d4:color-mix(in srgb,var(--ink) 26%,transparent);
  position:fixed;z-index:1100;width:360px;max-width:calc(100vw - 80px);
  background:var(--surface);border:1px solid var(--edge);border-radius:10px;
  box-shadow:var(--pane-shadow);display:none;flex-direction:column;overflow:hidden;
  font-family:var(--fp-font);font-size:13px;font-weight:400;color:var(--ink);
}
.fp-panel.fp-open{display:flex;animation:fp-panel-in .22s cubic-bezier(.16,1,.3,1) both}
@keyframes fp-panel-in{from{opacity:0;transform:translateY(10px) scale(.985)}to{opacity:1;transform:none}}

.fp-hd{flex:0 0 auto;display:flex;align-items:flex-start;justify-content:space-between;gap:8px;padding:10px 12px 8px;border-bottom:1px solid var(--line-2)}
.fp-title{flex:1 1 auto;font-size:14px;font-weight:600;line-height:1.4;letter-spacing:.002em;color:var(--ink);overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.fp-count{flex:0 0 auto;margin-top:1px;font-size:10px;font-weight:400;color:var(--ink-3);background:var(--surface-2);padding:1px 6px;border-radius:6px;white-space:nowrap;line-height:1.4;font-variant-numeric:tabular-nums}
.fp-body{flex:1 1 auto;overflow:hidden;padding:5px 8px;min-height:252px}
.fp-empty{padding:22px 10px;text-align:center;color:var(--ink-3);font-size:12px}

.fp-row{
  display:flex;align-items:center;gap:6px;padding:6px 8px;border-radius:6px;cursor:pointer;
  color:var(--ink);border:0;box-sizing:border-box;min-height:36px;
  transition:background .15s ease;
}
.fp-row:hover{background:var(--surface-2)}
.fp-row.fp-active{cursor:pointer;background:var(--accent-soft)}
.fp-row.fp-active:hover{background:var(--accent-soft)}
.fp-row.fp-active .fp-pill{background:var(--accent);color:#fff;border-color:transparent}
.fp-row.fp-active .fp-text{color:var(--accent);font-weight:400}
/* 距离色阶：以焦点为中心，文字与楼层号逐级变浅 */
.fp-row.fp-d1 .fp-text{color:var(--fp-d1)}
.fp-row.fp-d2 .fp-text{color:var(--fp-d2)}
.fp-row.fp-d3 .fp-text{color:var(--fp-d3)}
.fp-row.fp-d4 .fp-text{color:var(--fp-d4)}
.fp-row.fp-d1 .fp-pill{color:var(--fp-d1);background:var(--surface-2)}
.fp-row.fp-d2 .fp-pill{color:var(--fp-d2);background:var(--surface-2)}
.fp-row.fp-d3 .fp-pill{color:var(--fp-d3);background:var(--surface-2)}
.fp-row.fp-d4 .fp-pill{color:var(--fp-d4);background:var(--surface-2)}

.fp-av{display:block;width:24px;height:24px;border-radius:6px;flex:0 0 auto;object-fit:cover;background:var(--surface-3)}
.fp-av.fp-av-empty{background:var(--surface-3)}
.fp-pill{flex:0 0 auto;font-size:10px;font-weight:400;color:var(--ink-3);background:var(--surface-2);border:1px solid transparent;padding:2px;border-radius:4px;font-variant-numeric:tabular-nums;line-height:1.4;min-width:20px;text-align:center;transition:background .15s ease,color .15s ease}
.fp-text{flex:1 1 auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--fp-d3);font-size:12px;line-height:1.4;transition:color .15s ease}

.fp-ft{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:6px;padding:8px 12px 9px;border-top:1px solid var(--line-2);font-size:11px}
.fp-pageinfo{color:var(--ink-3);font-weight:400;background:var(--surface-2);border-radius:5px;padding:2px 7px;line-height:1.4;font-variant-numeric:tabular-nums}
.fp-pager{display:flex}
.fp-pager button{background:var(--surface);color:var(--ink);border:1px solid var(--edge);padding:3px 8px;font-size:11px;font-weight:400;font-family:var(--fp-font);cursor:pointer;line-height:1.4;transition:background .15s ease,color .15s ease}
.fp-pager button:first-child{border-radius:6px 0 0 6px}
.fp-pager button:last-child{border-radius:0 6px 6px 0}
.fp-pager button:not(:first-child){border-left:none}
.fp-pager button:hover:not(:disabled),.fp-pager button:active:not(:disabled){background:var(--surface-2)}
.fp-pager button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.fp-pager button:disabled{color:var(--ink-3);cursor:not-allowed}

/* ===== 骨架屏：跟随站点表面色 ===== */
.fp-row-skel{cursor:default;pointer-events:none}
.fp-skel-av,.fp-skel-pill,.fp-skel-line{background:linear-gradient(90deg,var(--surface-2) 25%,var(--surface-3) 37%,var(--surface-2) 63%);background-size:400% 100%;border-radius:5px;animation:fp-shimmer 1.3s ease-in-out infinite}
.fp-skel-av{width:24px;height:24px;flex:0 0 auto;border-radius:6px}
.fp-skel-pill{width:24px;height:20px;flex:0 0 auto}
.fp-skel-line{flex:1 1 auto;height:16px}
@keyframes fp-shimmer{0%{background-position:100% 0}100%{background-position:0 0}}

/* ===== 动效降级 & 窄屏隐藏 ===== */
@media (prefers-reduced-motion: reduce){
  .fp-panel.fp-open{animation:none}
  .fp-row,.fp-pill,.fp-text,.fp-pager button{transition:none}
  .fp-skel-pill,.fp-skel-line{animation:none;background:var(--surface-2)}
}
@media (max-width:640px){.fp-trigger,.fp-panel.fp-open{display:none!important}}
