/* ============================================================
   墨库 MOKU — 赛博 · 液态玻璃知识库
   tokens:
   底色   #05080F 深空 + #0A1220
   霓虹   青#22E7FF  洋红#FF3EA5  紫#8B5CFF  柠#C6FF3D  蓝#2E6BFF
   文字   #E8F2FF / #9FB3CE / #6B7F9E
   玻璃   rgba(12,20,36,.62) + blur16 + 青色描边 + 内高光
   字族   标题 Songti(宋) + 正文 PingFang/雅黑 + 数字 等宽
   布局   左：分类   中上：搜索   右：低调工具   主区：卡片居中
   ============================================================ */

:root {
  --bg: #05080f;
  --bg2: #0a1220;
  --ink: #e8f2ff;
  --ink-2: #9fb3ce;
  --ink-3: #6b7f9e;
  --cy: #22e7ff;
  --mg: #ff3ea5;
  --vi: #8b5cff;
  --li: #c6ff3d;
  --line: rgba(120, 200, 255, .14);
  --glass-bg: linear-gradient(158deg, rgba(18, 30, 52, .74), rgba(8, 14, 26, .62));
  --glass-br: rgba(120, 220, 255, .2);
  --glass-sh: 0 22px 50px -22px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(160, 230, 255, .12);
  --book: #ffc46b;
  --doc: #22e7ff;
  --course: #c6ff3d;
  --game: #ff3ea5;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 10px;
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", "Source Han Serif SC", serif;
  --sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

/* class 上的 display 会盖掉 [hidden] 的默认 display:none，这里补回 */
[hidden] { display: none !important; }

/* ---------- 滚动条：细、半透明、无箭头 ---------- */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 200, 255, .32) transparent;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-button,
::-webkit-scrollbar-corner {
  display: none;
  background: none;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(120, 200, 255, .22);
  background-clip: padding-box;
  border: 2px solid transparent;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(34, 231, 255, .55);
  background-clip: padding-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 液态霓虹背景（纯渐变，不用 blur 滤镜） ---------- */
.liquid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
}

.b1 { width: 54vmax; height: 54vmax; left: -14vmax; top: -16vmax; background: radial-gradient(circle at 45% 45%, rgba(34, 231, 255, .26), rgba(34, 231, 255, .08) 45%, transparent 70%); animation: drift1 36s ease-in-out infinite; }
.b2 { width: 46vmax; height: 46vmax; right: -8vmax; top: -6vmax; background: radial-gradient(circle at 55% 45%, rgba(255, 62, 165, .22), rgba(255, 62, 165, .07) 45%, transparent 70%); animation: drift2 43s ease-in-out infinite; }
.b3 { width: 44vmax; height: 44vmax; left: 18vmax; bottom: -18vmax; background: radial-gradient(circle at 50% 50%, rgba(139, 92, 255, .26), rgba(139, 92, 255, .08) 45%, transparent 70%); animation: drift3 49s ease-in-out infinite; }
.b4 { width: 34vmax; height: 34vmax; right: 6vmax; bottom: -12vmax; background: radial-gradient(circle at 45% 55%, rgba(198, 255, 61, .14), rgba(198, 255, 61, .05) 45%, transparent 70%); animation: drift1 41s ease-in-out infinite reverse; }
.b5 { width: 30vmax; height: 30vmax; left: 40vmax; top: 22vmax; background: radial-gradient(circle at 50% 50%, rgba(46, 107, 255, .22), rgba(46, 107, 255, .07) 45%, transparent 70%); animation: drift2 55s ease-in-out infinite; }

@keyframes drift1 { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(6vmax,4vmax,0) scale(1.12); } }
@keyframes drift2 { 0%,100% { transform: translate3d(0,0,0) scale(1.05); } 50% { transform: translate3d(-7vmax,5vmax,0) scale(.92); } }
@keyframes drift3 { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(4vmax,-6vmax,0) scale(1.15); } }

/* 赛博网格线 */
.lines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .5;
  background:
    repeating-linear-gradient(90deg, rgba(120, 220, 255, .05) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg, rgba(120, 220, 255, .05) 0 1px, transparent 1px 64px);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 20%, transparent 78%);
  mask-image: radial-gradient(circle at 50% 40%, #000 20%, transparent 78%);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.3'/%3E%3C/svg%3E");
}

/* ---------- 玻璃基类 ---------- */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--glass-br);
  box-shadow: var(--glass-sh);
}

/* ---------- 顶栏：左品牌 / 中搜索 / 右工具 ---------- */
.topbar {
  position: relative;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr minmax(280px, 520px) 1fr;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  flex: 0 0 auto;
  transition: transform .34s cubic-bezier(.22, .85, .3, 1), opacity .26s ease;
  overflow: hidden;
}

/* 顶沿霓虹发丝线 */
.topbar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(34, 231, 255, .95) 22%, rgba(139, 92, 255, .9) 55%, rgba(255, 62, 165, .95) 82%, transparent);
  opacity: .85;
  pointer-events: none;
}

.brand .mark {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 8px;
  filter: drop-shadow(0 0 10px rgba(34, 231, 255, .55));
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* 向下滚动收起、向上滚或指针靠近顶部滑出 */
body.folded .topbar {
  transform: translateY(-104%);
  opacity: 0;
}

.brand b {
  font-family: var(--serif);
  font-size: 25px;
  letter-spacing: .16em;
  font-weight: 600;
  background: linear-gradient(100deg, #9ff4ff 10%, #22e7ff 34%, #b39bff 62%, #ff7ac2 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 14px rgba(34, 231, 255, .35));
}

.brand em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  border-left: 1px solid var(--line);
  padding-left: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  background: rgba(8, 16, 30, .6);
  border: 1px solid rgba(120, 220, 255, .22);
  border-radius: 999px;
  padding: 0 14px;
  height: 42px;
  transition: box-shadow .2s, border-color .2s, background .2s;
}

.search:focus-within {
  background: rgba(10, 22, 40, .8);
  border-color: rgba(34, 231, 255, .6);
  box-shadow: 0 0 0 3px rgba(34, 231, 255, .16), 0 0 26px -8px rgba(34, 231, 255, .6);
}

.search input {
  flex: 1;
  border: 0;
  background: none;
  outline: none;
  font: 400 14px var(--sans);
  color: var(--ink);
  min-width: 0;
}

.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { filter: invert(1) opacity(.5); }

kbd {
  font: 400 11px var(--mono);
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 5px;
}

.tools {
  display: flex;
  gap: 8px;
  justify-self: end;
  align-items: center;
}

/* ---------- 按钮：低调幽灵风 ---------- */
.btn {
  font: 400 13px var(--sans);
  color: var(--ink-2);
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(120, 200, 255, .16);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .16s, border-color .16s, box-shadow .16s, background .16s, transform .16s;
}

.btn:hover {
  color: #eafcff;
  border-color: rgba(34, 231, 255, .55);
  background: rgba(34, 231, 255, .1);
  box-shadow: 0 0 18px -6px rgba(34, 231, 255, .7);
}

.btn:active { transform: translateY(1px); }

.btn[aria-pressed="true"] {
  color: #041018;
  background: linear-gradient(120deg, var(--cy), #6ff0ff);
  border-color: transparent;
  box-shadow: 0 0 22px -8px rgba(34, 231, 255, .9);
}

:where(button, a, input, select, [tabindex]):focus-visible {
  outline: 2px solid var(--cy);
  outline-offset: 2px;
}

/* ---------- 主体 ---------- */
main {
  position: relative;
  z-index: 10;
  flex: 1 1 auto;
  display: flex;
  gap: 14px;
  padding: 14px 16px 6px;
  min-height: 0;
}

.rail {
  flex: 0 0 252px;
  border-radius: var(--r-lg);
  padding: 16px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.rail h4 {
  margin: 0 0 8px;
  font: 600 11px var(--sans);
  letter-spacing: .18em;
  color: var(--ink-3);
}

.fgroup { margin-bottom: 18px; }

.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  background: rgba(8, 16, 30, .5);
  border: 1px solid rgba(120, 200, 255, .14);
  border-radius: 16px;
  padding: 4px;
}

.seg button {
  flex: 1 1 44%;
  border: 0;
  background: none;
  border-radius: 12px;
  padding: 7px 4px;
  font: 400 13px var(--sans);
  color: var(--ink-2);
  cursor: pointer;
  transition: background .18s, color .18s, box-shadow .18s;
}

.seg button[aria-pressed="true"] {
  background: rgba(34, 231, 255, .16);
  color: #eafcff;
  box-shadow: inset 0 0 0 1px rgba(34, 231, 255, .4);
  font-weight: 600;
}

.seg button i {
  font-style: normal;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  margin-left: 3px;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  font: 400 12px var(--sans);
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(120, 200, 255, .16);
  background: rgba(255, 255, 255, .035);
  color: var(--ink-2);
  cursor: pointer;
  transition: all .16s;
}

.chip i {
  font-style: normal;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  margin-left: 6px;
}

.chip[aria-pressed="true"] i { color: rgba(234, 252, 255, .8); }

.chip:hover {
  color: #eafcff;
  border-color: rgba(34, 231, 255, .45);
  background: rgba(34, 231, 255, .08);
}

.chip[aria-pressed="true"] {
  background: rgba(34, 231, 255, .18);
  border-color: rgba(34, 231, 255, .6);
  color: #eafcff;
  box-shadow: 0 0 18px -8px rgba(34, 231, 255, .9);
}

.range { width: 100%; accent-color: #22e7ff; }

.rv { font: 400 12px var(--mono); color: var(--cy); }

select {
  width: 100%;
  font: 400 13px var(--sans);
  color: var(--ink);
  background: rgba(8, 16, 30, .7);
  border: 1px solid rgba(120, 200, 255, .16);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  outline: none;
}

/* ---------- 舞台 ---------- */
.stage {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.stagebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 10px;
  flex: 0 0 auto;
}

.count { font: 400 13px var(--mono); color: var(--ink-2); }
.count b { font-family: var(--mono); font-size: 16px; color: var(--cy); margin-right: 2px; }
.hint { font: 400 12px var(--sans); color: var(--ink-3); }
.spacer { flex: 1; }

/* ---------- 卡片网格（居中） ---------- */
.grid {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 6px 24px;
  width: 100%;
  max-width: 1420px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  justify-content: center;
  gap: 20px 16px;
  align-content: start;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  position: relative;
  border-radius: var(--r-md);
  padding: 8px 8px 12px;
  background: rgba(16, 26, 44, .5);
  border: 1px solid rgba(120, 200, 255, .12);
  box-shadow: 0 10px 26px -18px rgba(0, 0, 0, .9);
  cursor: pointer;
  contain: layout paint style;
  animation: cardIn .36s cubic-bezier(.2, .8, .3, 1) both;
  transition: transform .22s cubic-bezier(.2, .8, .3, 1), box-shadow .22s, border-color .22s, background .22s;
  user-select: none;
}

.card:hover, .card:focus-visible {
  animation: none;
  background: rgba(22, 36, 60, .74);
  border-color: rgba(34, 231, 255, .45);
  box-shadow: 0 20px 44px -20px rgba(0, 0, 0, .95), 0 0 24px -12px rgba(34, 231, 255, .8);
  transform: translateY(-4px);
  z-index: 2;
}

.card.dragging { opacity: .35; }

.cover {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(var(--ang, 150deg), hsl(var(--h, 210) 82% 58%), hsl(var(--h2, 250) 74% 34%));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 8px 20px -12px hsl(var(--h, 210) 80% 30% / .8);
}

.cover::before { content: ""; position: absolute; inset: 0; }

.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 15% 8%, rgba(255, 255, 255, .3), transparent 55%);
}

.m0::before { background: repeating-radial-gradient(circle at 70% 78%, rgba(255, 255, 255, .22) 0 2px, transparent 2px 18px); }
.m1::before { background: repeating-linear-gradient(48deg, rgba(255, 255, 255, .16) 0 3px, transparent 3px 16px); }
.m2::before { background: radial-gradient(circle at 22% 68%, rgba(255, 255, 255, .26) 0 22%, transparent 23%), radial-gradient(circle at 66% 24%, rgba(255, 255, 255, .18) 0 14%, transparent 15%); }
.m3::before { background: linear-gradient(200deg, transparent 42%, rgba(255, 255, 255, .22) 50%, transparent 58%); }
.m4::before { background: conic-gradient(from 210deg at 78% 82%, rgba(255, 255, 255, .2), transparent 38%); }

.glyph {
  position: absolute;
  right: -6px;
  bottom: -14px;
  font-family: var(--serif);
  font-size: 76px;
  line-height: 1;
  color: #fff;
  opacity: .82;
  text-shadow: 0 4px 18px rgba(0, 0, 0, .55);
  z-index: 1;
}

.ctype {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 1;
  font: 400 10px var(--mono);
  letter-spacing: .06em;
  color: #041018;
  background: rgba(255, 255, 255, .82);
  border-radius: 6px;
  padding: 2px 6px;
}

.card h3 {
  margin: 9px 2px 3px;
  font: 500 14px var(--serif);
  line-height: 1.35;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card .by {
  margin: 0 2px;
  font: 400 11px var(--sans);
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 7px 2px 0;
}

.score {
  font: 500 12px var(--mono);
  color: #041018;
  background: linear-gradient(120deg, var(--li), #a8ff7a);
  border-radius: 6px;
  padding: 1px 5px;
}

.tagline {
  font: 400 10px var(--sans);
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fav {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(6, 12, 22, .55);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  color: #ff8fc4;
  opacity: 0;
  transition: opacity .18s, transform .18s;
  z-index: 2;
}

.card:hover .fav, .card:focus-within .fav, .fav[data-on="1"] { opacity: 1; }
.fav:hover { transform: scale(1.15); }

.fav[data-on="1"] {
  background: linear-gradient(120deg, var(--mg), #ff7ac2);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 18px -6px rgba(255, 62, 165, .9);
}

/* ---------- 液态台面 ---------- */
.canvas {
  position: relative;
  flex: 1 1 auto;
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  background: rgba(8, 14, 26, .35);
  border: 1px solid rgba(120, 200, 255, .14);
}

.canvas.grabbing { cursor: grabbing; }

.world {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.node {
  position: absolute;
  width: 148px;
  padding: 7px 7px 10px;
  border-radius: 14px;
  background: rgba(16, 26, 44, .82);
  border: 1px solid rgba(120, 200, 255, .18);
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .95);
  cursor: pointer;
  transition: box-shadow .2s, transform .2s, border-color .2s;
  will-change: transform;
}

.node:hover {
  border-color: rgba(34, 231, 255, .5);
  box-shadow: 0 22px 44px -20px rgba(0, 0, 0, .95), 0 0 22px -12px rgba(34, 231, 255, .8);
  z-index: 3;
}

.node h3 { font-size: 13px; margin: 8px 1px 2px; }
.node .glyph { font-size: 64px; }
.node .by { font-size: 10px; }

.hud { position: absolute; left: 12px; bottom: 12px; z-index: 5; display: flex; gap: 6px; }
.hud .btn { padding: 6px 12px; font-size: 12px; }

.zoomv {
  position: absolute;
  right: 12px;
  bottom: 14px;
  z-index: 5;
  font: 400 11px var(--mono);
  color: var(--ink-3);
  background: rgba(8, 14, 26, .6);
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid rgba(120, 200, 255, .16);
}

/* ---------- 空态 ---------- */
.empty {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ink-2);
  text-align: center;
}

.empty b { font-family: var(--serif); font-size: 20px; font-weight: 500; }
.empty p { margin: 0; font-size: 13px; color: var(--ink-3); max-width: 34ch; }

/* ---------- 收藏托盘 ---------- */
.dock {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
  margin: 0 16px 12px;
  border-radius: var(--r-lg);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  transition: box-shadow .2s, border-color .2s;
}

.dock.over {
  border-color: rgba(255, 62, 165, .7);
  box-shadow: 0 0 0 2px rgba(255, 62, 165, .35), var(--glass-sh);
}

.dock .lab {
  font: 400 12px var(--sans);
  color: var(--ink-2);
  flex: 0 0 auto;
  border-right: 1px solid var(--line);
  padding-right: 10px;
}

.dock .lab b { font-family: var(--mono); color: var(--mg); }

.docklist {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  flex: 1 1 auto;
  padding: 2px;
  scrollbar-width: thin;
}

.mini {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(120, 200, 255, .2);
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .9);
  background: linear-gradient(var(--ang, 150deg), hsl(var(--h, 210) 82% 58%), hsl(var(--h2, 250) 74% 34%));
  transition: transform .18s;
}

.mini:hover { transform: translateY(-3px) scale(1.04); }

.mini span {
  position: absolute;
  left: 3px;
  bottom: 2px;
  font: 400 9px var(--mono);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
}

.mini .rm {
  position: absolute;
  right: 1px;
  top: 1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 0;
  background: rgba(6, 12, 22, .7);
  color: #fff;
  font-size: 10px;
  line-height: 14px;
  cursor: pointer;
  opacity: 0;
}

.mini:hover .rm { opacity: 1; }
.dock .empty-dock { font: 400 12px var(--sans); color: var(--ink-3); }

/* ---------- 详情 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 6, 12, .74);
  animation: fade .2s ease;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  position: relative;
  width: min(760px, 100%);
  max-height: 86vh;
  overflow: auto;
  border-radius: 26px;
  animation: pop .28s cubic-bezier(.2, .9, .3, 1);
}

@keyframes pop { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

.sheet-head {
  display: flex;
  gap: 18px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.sheet-cover {
  flex: 0 0 150px;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(var(--ang, 150deg), hsl(var(--h, 210) 82% 58%), hsl(var(--h2, 250) 74% 34%));
  box-shadow: 0 16px 30px -16px hsl(var(--h, 210) 80% 30% / .9);
}

.sheet-cover .glyph { font-size: 92px; opacity: .82; }

.sheet h2 {
  margin: 2px 0 6px;
  font: 500 27px var(--serif);
  line-height: 1.25;
  color: #fff;
}

.sub { font: 400 13px var(--sans); color: var(--ink-2); margin: 0 0 12px; }

.kv { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

.kv span {
  font: 400 11px var(--mono);
  color: var(--cy);
  background: rgba(34, 231, 255, .1);
  border: 1px solid rgba(34, 231, 255, .25);
  border-radius: 6px;
  padding: 3px 8px;
}

.sheet-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.sheet-body { padding: 18px 20px 22px; }

.sheet-body p {
  font: 400 14.5px/1.85 var(--sans);
  color: var(--ink-2);
  margin: 0 0 14px;
}

.sheet-body .lead {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
  line-height: 1.8;
}

.sheet-body .sim {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font: 400 12px var(--sans);
  color: var(--ink-3);
}

.sheet-body .sim .btn { padding: 6px 12px; font-size: 12px; color: var(--ink-2); }

.sheet-nav {
  display: flex;
  gap: 8px;
  padding: 0 20px 20px;
}

.close {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(120, 200, 255, .2);
  background: rgba(8, 16, 30, .6);
  cursor: pointer;
  font-size: 15px;
  color: var(--ink-2);
}

.close:hover { color: #eafcff; border-color: rgba(34, 231, 255, .5); }

/* ---------- 拖拽幽灵 / 光标 / toast ---------- */
.ghost {
  position: fixed;
  z-index: 90;
  width: 120px;
  pointer-events: none;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 40px -14px rgba(0, 0, 0, .95), 0 0 20px -10px rgba(34, 231, 255, .8);
  transform: rotate(-4deg) scale(1.02);
}

.ghost .cover { border-radius: 12px; }

.cursor {
  position: fixed;
  z-index: 95;
  width: 260px;
  height: 260px;
  left: 0;
  top: 0;
  margin: -130px 0 0 -130px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(34, 231, 255, .18), rgba(139, 92, 255, .1) 45%, transparent 70%);
  opacity: 0;
  transition: opacity .3s;
}

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 92px;
  transform: translate(-50%, 12px);
  background: rgba(6, 14, 26, .95);
  color: #eafcff;
  border: 1px solid rgba(34, 231, 255, .35);
  font: 400 13px var(--sans);
  padding: 9px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s;
  box-shadow: 0 0 24px -10px rgba(34, 231, 255, .8);
}

.toast.on { opacity: 1; transform: translate(-50%, 0); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .topbar { grid-template-columns: 1fr auto; row-gap: 10px; }
  .search { grid-column: 1 / -1; grid-row: 2; }
  .tools { grid-row: 1; }
}

@media (max-width: 980px) {
  .rail {
    position: fixed;
    z-index: 40;
    left: 12px;
    top: 118px;
    bottom: 88px;
    width: 268px;
    transform: translateX(-115%);
    transition: transform .28s cubic-bezier(.2, .8, .3, 1);
  }
  .rail.open { transform: none; }
  .brand em { display: none; }
}

@media (max-width: 620px) {
  .topbar { padding: 10px 12px; }
  main { padding: 10px 10px 4px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
  .dock { margin: 0 10px 10px; }
  .brand b { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .08s !important; }
  .cursor { display: none; }
}

/* ---------- 清晰模式（低 GPU / 远程环境一键降级） ---------- */
body.no-fx .glass,
body.no-fx .search {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: rgba(10, 18, 32, .97);
}

body.no-fx .blob { animation: none; }
body.no-fx .cursor { display: none; }
body.no-fx .grain { display: none; }
body.no-fx .lines { display: none; }
body.no-fx .card,
body.no-fx .node { background: rgba(14, 24, 42, .96); }
