/* ============================================================
   Lucent Next 5.2 · 本地书架
   只在 .shelf-* 命名空间内工作，复用主页的玻璃变量与字体。
   ============================================================ */

.shelf-launcher {
  position: relative;
  /* 关闭状态也要常驻在顶栏，因此不额外增加一层 backdrop blur。 */
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
    var(--shell-glass-2);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.shelf-launcher[aria-busy="true"] {
  opacity: 0.55;
}

.shelf-launcher[aria-expanded="true"] {
  color: #fff;
  border-color: rgba(231, 201, 135, 0.52);
  background:
    linear-gradient(145deg, rgba(231, 201, 135, 0.2), rgba(155, 215, 255, 0.06)),
    var(--shell-glass-2);
  box-shadow: var(--shell-shadow), inset 0 1px 0 rgba(255, 245, 220, 0.4), 0 0 14px rgba(231, 201, 135, 0.14);
}

.shelf-launcher:hover {
  border-color: rgba(255, 255, 255, 0.34);
}

html.shelf-open,
body.shelf-open {
  overflow: hidden;
}

.shelf-root {
  position: fixed;
  inset: 0;
  z-index: 32;
}

#shelfRoot[hidden] {
  display: none !important;
}

.shelf-mask {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 16, 0.62);
  animation: shelf-fade 0.22s ease;
}

.shelf-card {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: min(94vw, 1120px);
  height: min(88dvh, 840px);
  min-height: 460px;
  padding: 22px 24px 14px;
  overflow: hidden;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 30px;
  background: linear-gradient(156deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.62));
  box-shadow: var(--glass-deep), inset 0 1px 0 rgba(255, 255, 255, 0.94);
  transform: translate(-50%, -50%);
  outline: none;
  animation: shelf-rise 0.3s cubic-bezier(0.22, 0.9, 0.3, 1);
}

/* 只在真正打开时启用大卡片模糊；隐藏状态不要额外合成层。 */
.shelf-root:not([hidden]) .shelf-card {
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
}

:root[data-theme="dark"] .shelf-card {
  border-color: rgba(255, 255, 255, 0.14);
  background: linear-gradient(156deg, rgba(21, 24, 36, 0.9), rgba(12, 14, 23, 0.82));
  box-shadow: var(--glass-deep), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* ---------- 标题栏 ---------- */

.shelf-head {
  display: flex;
  flex: none;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.shelf-heading {
  min-width: 0;
}

.shelf-eyebrow {
  display: block;
  color: #a57b25;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  line-height: 1.2;
}

:root[data-theme="dark"] .shelf-eyebrow {
  color: #d5b564;
}

.shelf-title {
  margin: 10px 0 0;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.shelf-sub {
  margin: 4px 0 0;
  color: var(--ink-3);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  line-height: 1.55;
}

.shelf-head-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 7px;
}

.shelf-icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--ink-2);
  border: 1px solid var(--glass-line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

.shelf-icon-btn svg {
  width: 17px;
  height: 17px;
}

.shelf-icon-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.48);
}

.shelf-icon-btn:active {
  transform: scale(0.94);
}

.shelf-icon-btn:focus-visible,
.shelf-btn:focus-visible,
.shelf-view-btn:focus-visible,
.shelf-col:focus-visible,
.shelf-row:focus-visible,
.shelf-crumb:focus-visible,
.shelf-up:focus-visible,
.shelf-mini-btn:focus-visible,
.shelf-restore:focus-visible,
.shelf-menu-item:focus-visible {
  outline: 2px solid rgba(165, 123, 37, 0.72);
  outline-offset: 2px;
}

:root[data-theme="dark"] .shelf-icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .shelf-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ---------- 工具栏 ---------- */

.shelf-toolbar {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 15px;
}

.shelf-toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.shelf-toolbar-tools {
  justify-content: flex-end;
}

.shelf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 14px;
  color: var(--ink);
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease, opacity 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

.shelf-btn svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.shelf-btn:hover {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.8);
}

.shelf-btn:active {
  transform: scale(0.975);
}

.shelf-btn.primary {
  color: #211a0c;
  border-color: transparent;
  background: linear-gradient(135deg, #f4dca6, #d9b66d 62%, #c79a4d);
  box-shadow: 0 8px 22px rgba(199, 154, 77, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  font-weight: 700;
}

.shelf-btn.primary:hover {
  background: linear-gradient(135deg, #f8e5b8, #e2c078 62%, #d0a556);
}

.shelf-btn.is-default {
  color: #7c5714;
  border-color: rgba(165, 123, 37, 0.3);
  background: rgba(231, 201, 135, 0.24);
}

.shelf-btn:disabled {
  opacity: 0.38;
  cursor: default;
  transform: none;
}

:root[data-theme="dark"] .shelf-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .shelf-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

:root[data-theme="dark"] .shelf-btn.primary {
  color: #211a0c;
  border-color: transparent;
  background: linear-gradient(135deg, #f4dca6, #d9b66d 62%, #c79a4d);
}

:root[data-theme="dark"] .shelf-btn.is-default {
  color: #e2c078;
  border-color: rgba(231, 201, 135, 0.28);
  background: rgba(231, 201, 135, 0.1);
}

.shelf-btn.is-default:disabled {
  opacity: 0.82;
}

#shelfPick,
#shelfEmptyPick {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #164b67;
  border-color: rgba(68, 139, 167, 0.32);
  outline-color: rgba(68, 139, 167, 0.72);
  background:
    radial-gradient(90% 130% at 90% 120%, rgba(103, 183, 207, 0.22), transparent 65%),
    linear-gradient(135deg, rgba(229, 249, 247, 0.88), rgba(174, 220, 229, 0.64) 58%, rgba(153, 202, 222, 0.56));
  box-shadow: 0 6px 18px rgba(46, 112, 142, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.76), inset 0 -1px 0 rgba(47, 119, 152, 0.08);
  backdrop-filter: blur(16px) saturate(155%);
  -webkit-backdrop-filter: blur(16px) saturate(155%);
}

#shelfPick::before,
#shelfEmptyPick::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(100% 180% at 18% -70%, rgba(255, 255, 255, 0.84), transparent 54%),
    linear-gradient(105deg, transparent 25%, rgba(255, 255, 255, 0.2) 45%, transparent 63%);
  pointer-events: none;
}

#shelfPick::after,
#shelfEmptyPick::after {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(58, 127, 162, 0.22);
  border-radius: inherit;
  pointer-events: none;
}

#shelfPick > svg,
#shelfPick > span,
#shelfEmptyPick > svg,
#shelfEmptyPick > span {
  position: relative;
  z-index: 1;
}

#shelfPick > svg,
#shelfEmptyPick > svg {
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.36));
}

#shelfPick:hover,
#shelfEmptyPick:hover {
  filter: brightness(1.035);
  box-shadow: 0 8px 22px rgba(46, 112, 142, 0.21), inset 0 1px 0 #fff, inset 0 -1px 0 rgba(47, 119, 152, 0.1);
}

:root[data-theme="dark"] #shelfPick,
:root[data-theme="dark"] #shelfEmptyPick {
  color: #e0f1ff;
  border-color: rgba(87, 157, 183, 0.42);
  outline-color: #a7ceff;
  background:
    radial-gradient(100% 170% at 12% -40%, rgba(220, 240, 255, 0.19), transparent 58%),
    linear-gradient(135deg, rgba(87, 157, 183, 0.32), rgba(28, 55, 88, 0.55) 68%, rgba(20, 43, 73, 0.55));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(220, 239, 255, 0.12);
}

:root[data-theme="dark"] #shelfPick::before,
:root[data-theme="dark"] #shelfEmptyPick::before {
  background:
    radial-gradient(100% 180% at 18% -70%, rgba(228, 243, 255, 0.2), transparent 54%),
    linear-gradient(105deg, transparent 25%, rgba(215, 237, 255, 0.07) 45%, transparent 63%);
}

:root[data-theme="dark"] #shelfPick::after,
:root[data-theme="dark"] #shelfEmptyPick::after {
  border-top-color: rgba(220, 239, 255, 0.4);
  border-bottom-color: rgba(87, 157, 183, 0.25);
}

:root[data-theme="dark"] #shelfPick:hover,
:root[data-theme="dark"] #shelfEmptyPick:hover {
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28), 0 0 18px rgba(87, 157, 183, 0.09), inset 0 1px 0 rgba(220, 239, 255, 0.18);
}

.shelf-filter-wrap {
  position: relative;
  flex: none;
}

.shelf-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 11px;
  color: var(--ink-2);
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.shelf-filter-btn > svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.shelf-filter-btn .shelf-filter-chevron {
  width: 10px;
  height: 10px;
  opacity: 0.65;
}

.shelf-filter-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.44);
}

.shelf-filter-btn.is-active {
  color: #7c5714;
  border-color: rgba(165, 123, 37, 0.3);
  background: rgba(231, 201, 135, 0.24);
}

.shelf-filter-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 7;
  min-width: 184px;
  padding: 6px;
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  /* 不新增 backdrop blur：筛选菜单只在打开时出现，用高不透明度保持可读。 */
  background: linear-gradient(156deg, rgba(255, 255, 255, 0.985), rgba(255, 255, 255, 0.95));
  box-shadow: var(--glass-deep);
  animation: shelf-pop 0.16s ease;
}

.shelf-filter-title {
  padding: 5px 10px 4px;
  color: var(--ink-3);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.shelf-filter-option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 33px;
  padding: 0 10px;
  color: var(--ink);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.shelf-filter-option:hover {
  background: rgba(255, 255, 255, 0.44);
}

.shelf-filter-option[aria-checked="true"]::after {
  content: "✓";
  margin-left: auto;
  color: #8a6118;
  font-weight: 700;
}

.shelf-filter-sep {
  height: 1px;
  margin: 5px 6px;
  background: var(--glass-line);
}

:root[data-theme="dark"] .shelf-filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .shelf-filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .shelf-filter-btn.is-active {
  color: #e2c078;
  border-color: rgba(231, 201, 135, 0.24);
  background: rgba(231, 201, 135, 0.1);
}

:root[data-theme="dark"] .shelf-filter-menu {
  border-color: rgba(255, 255, 255, 0.12);
  background: linear-gradient(156deg, rgba(22, 25, 38, 0.985), rgba(14, 17, 27, 0.95));
}

:root[data-theme="dark"] .shelf-filter-option:hover {
  background: rgba(255, 255, 255, 0.07);
}

:root[data-theme="dark"] .shelf-filter-option[aria-checked="true"]::after {
  color: #e2c078;
}

.shelf-search {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 220px;
  min-height: 38px;
  padding: 0 11px;
  color: var(--ink-3);
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.shelf-search:focus-within {
  border-color: rgba(165, 123, 37, 0.48);
  background: rgba(255, 255, 255, 0.46);
}

.shelf-search > svg {
  width: 14px;
  height: 14px;
  flex: none;
  opacity: 0.72;
}

.shelf-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--ink);
  border: 0;
  outline: none;
  background: transparent;
  font-size: 11px;
}

.shelf-search input::placeholder {
  color: var(--ink-3);
}

.shelf-search-clear {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--ink-3);
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
}

.shelf-search-clear:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.06);
}

:root[data-theme="dark"] .shelf-search {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .shelf-search:focus-within {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(231, 201, 135, 0.36);
}

.shelf-view-toggle {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 1px;
  padding: 3px;
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
}

.shelf-view-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 31px;
  height: 29px;
  color: var(--ink-3);
  border-radius: 7px;
  transition: color 0.16s ease, background 0.16s ease;
}

.shelf-view-btn::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 9px;
  height: 2px;
  margin-left: -4.5px;
  border-radius: 2px;
  background: transparent;
  transition: background 0.16s ease;
}

.shelf-view-btn svg {
  position: relative;
  width: 15px;
  height: 15px;
}

.shelf-view-btn:hover {
  color: var(--ink);
}

.shelf-view-btn.is-active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.shelf-view-btn.is-active::after {
  background: rgba(165, 123, 37, 0.82);
}

:root[data-theme="dark"] .shelf-view-toggle {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .shelf-view-btn.is-active {
  color: #f0e6cf;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .shelf-view-btn.is-active::after {
  background: rgba(217, 185, 107, 0.9);
}

/* ---------- 最近路径 ---------- */

.shelf-recent {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  flex: none;
}

.shelf-recent .shelf-summary {
  margin-top: 0;
  flex: 0 1 420px;
  min-width: 280px;
}

.shelf-recent-side {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
}

.shelf-recent-side.is-left {
  justify-content: flex-end;
}

.shelf-recent-side.is-right {
  justify-content: flex-start;
}

.shelf-recent-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  width: clamp(96px, 9.5vw, 132px);
  padding: 8px 11px 9px;
  color: var(--ink);
  border: 1px solid var(--glass-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

.shelf-recent-chip:hover {
  border-color: rgba(165, 123, 37, 0.28);
  background: rgba(255, 255, 255, 0.34);
  transform: translateY(-1px);
}

.shelf-recent-chip:active {
  transform: scale(0.985);
}

.shelf-recent-chip-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  margin-top: -2px;
  color: #8a6118;
  border-radius: 9px;
  background: rgba(231, 201, 135, 0.24);
}

.shelf-recent-chip-icon svg {
  width: 17px;
  height: 17px;
}

.shelf-recent-chip-line {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
  margin-top: 2px;
}

.shelf-recent-chip-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-recent-chip-badge {
  display: inline-flex;
  flex: none;
  align-items: center;
  height: 14px;
  padding: 0 5px;
  font-size: 8px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  border: 1px solid rgba(120, 116, 104, 0.22);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.4);
}

.shelf-recent-chip-time {
  font-size: 9px;
  line-height: 1.2;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

:root[data-theme="dark"] .shelf-recent-chip {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] .shelf-recent-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(231, 201, 135, 0.24);
}

:root[data-theme="dark"] .shelf-recent-chip-icon {
  color: #d5b564;
  background: rgba(231, 201, 135, 0.1);
}

:root[data-theme="dark"] .shelf-recent-chip-badge {
  color: rgba(238, 232, 218, 0.56);
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 1200px) {
  .shelf-recent .shelf-summary {
    flex-basis: 380px;
  }

  .shelf-recent-chip {
    width: clamp(92px, 10vw, 114px);
  }
}

@media (max-width: 920px) {
  .shelf-recent .shelf-summary {
    flex-basis: 360px;
  }

  .shelf-recent-chip {
    width: clamp(88px, 12vw, 100px);
  }
}

@media (max-width: 680px) {
  .shelf-recent-side {
    display: none;
  }

  .shelf-recent .shelf-summary {
    flex: 1 1 100%;
    min-width: 0;
  }
}

/* ---------- 概览卡 ---------- */

.shelf-summary {
  display: flex;
  flex: none;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding: 12px 15px;
  border: 1px solid var(--glass-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

.shelf-summary-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  color: #8a6118;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(231, 201, 135, 0.34), rgba(155, 215, 255, 0.14));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.shelf-summary-icon svg {
  width: 24px;
  height: 24px;
}

.shelf-summary-main {
  min-width: 0;
  flex: 1;
}

.shelf-summary-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.shelf-summary-name {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.shelf-badge-default {
  color: #7c5714;
  border: 1px solid rgba(165, 123, 37, 0.24);
  background: rgba(231, 201, 135, 0.34);
}

.shelf-badge-read {
  color: var(--ink-3);
  border: 1px solid var(--glass-line);
  background: rgba(255, 255, 255, 0.3);
}

:root[data-theme="dark"] .shelf-badge-default {
  color: #e2c078;
  border-color: rgba(231, 201, 135, 0.24);
  background: rgba(231, 201, 135, 0.1);
}

:root[data-theme="dark"] .shelf-badge-read {
  background: rgba(255, 255, 255, 0.05);
}

.shelf-summary-path {
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-summary-stats {
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}

.shelf-summary-side {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.shelf-summary-time {
  color: var(--ink-3);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.shelf-restore {
  min-height: 28px;
  padding: 0 10px;
  color: #7c5714;
  border: 1px solid rgba(165, 123, 37, 0.32);
  border-radius: 999px;
  background: rgba(231, 201, 135, 0.22);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.shelf-restore:hover {
  background: rgba(231, 201, 135, 0.36);
}

:root[data-theme="dark"] .shelf-summary {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] .shelf-summary-icon {
  color: #d5b564;
  border-color: rgba(255, 255, 255, 0.1);
  background: linear-gradient(145deg, rgba(231, 201, 135, 0.14), rgba(155, 215, 255, 0.06));
}

:root[data-theme="dark"] .shelf-restore {
  color: #e2c078;
  border-color: rgba(231, 201, 135, 0.24);
  background: rgba(231, 201, 135, 0.1);
}

/* ---------- 面包屑 ---------- */

.shelf-breadcrumb {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  margin-top: 9px;
}

.shelf-up {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  color: var(--ink-2);
  border: 1px solid var(--glass-line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.28);
  transition: background 0.16s ease, color 0.16s ease;
}

.shelf-up svg {
  width: 14px;
  height: 14px;
}

.shelf-up:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.44);
}

.shelf-up:disabled {
  opacity: 0.3;
  cursor: default;
}

.shelf-crumbs {
  display: flex;
  align-items: center;
  gap: 1px;
  min-width: 0;
  overflow: auto;
  scrollbar-width: none;
}

.shelf-crumbs::-webkit-scrollbar {
  display: none;
}

.shelf-crumb {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  max-width: 220px;
  padding: 0 8px;
  overflow: hidden;
  color: var(--ink-2);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-crumb:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.32);
}

.shelf-crumb.is-current {
  margin-left: 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.28);
  font-weight: 700;
}

.shelf-crumb-sep {
  flex: none;
  color: var(--ink-4);
  font-size: 10px;
}

:root[data-theme="dark"] .shelf-up {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .shelf-crumb:hover,
:root[data-theme="dark"] .shelf-crumb.is-current {
  background: rgba(255, 255, 255, 0.07);
}

/* ---------- 主区域 ---------- */

.shelf-main {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1.42fr) minmax(280px, 0.78fr);
  gap: 12px;
  min-height: 0;
  margin-top: 18px;
  transition: grid-template-columns 0.38s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.shelf-main.is-preview-focus {
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
}

.shelf-main.is-preview-focus .shelf-list-head,
.shelf-main.is-preview-focus .shelf-row {
  grid-template-columns: minmax(0, 1fr) 74px 108px 30px 0px;
}

.shelf-main.is-preview-focus .shelf-col[data-sort="size"],
.shelf-main.is-preview-focus .shelf-row-size {
  opacity: 0;
  pointer-events: none;
  transform: translateX(8px);
}

.shelf-main.is-empty {
  grid-template-columns: 1fr;
}

.shelf-main.is-empty .shelf-preview-pane {
  display: none;
}

.shelf-list-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--glass-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

:root[data-theme="dark"] .shelf-list-pane {
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.shelf-list-head {
  display: grid;
  flex: none;
  grid-template-columns: minmax(0, 1fr) 82px 124px 30px 82px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--glass-line);
  background: rgba(255, 255, 255, 0.16);
  transition: grid-template-columns 0.38s cubic-bezier(0.22, 0.61, 0.36, 1);
}

:root[data-theme="dark"] .shelf-list-head {
  background: rgba(255, 255, 255, 0.025);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.shelf-col {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 0 4px;
  color: var(--ink-3);
  border-radius: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-align: left;
  text-transform: uppercase;
  transition: color 0.16s ease, background 0.16s ease;
}

.shelf-col:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.24);
}

.shelf-col.is-active {
  color: #8a6118;
}

.shelf-col[data-sort="size"] {
  justify-content: flex-end;
  transition: opacity 0.2s ease, transform 0.3s ease;
}

.shelf-col-star {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.shelf-row-star-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.shelf-row-star {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  color: var(--ink-3);
  border-radius: 8px;
  transition: color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.shelf-row-star svg {
  width: 14px;
  height: 14px;
}

.shelf-row-star:hover {
  color: #a57b25;
  background: rgba(255, 255, 255, 0.4);
}

.shelf-row-star:active {
  transform: scale(0.92);
}

.shelf-row-star.is-fav {
  color: #b8862f;
}

.shelf-row-star.is-fav svg {
  fill: rgba(231, 201, 135, 0.4);
}

:root[data-theme="dark"] .shelf-row-star.is-fav { color: #e2c078; }

.shelf-list-pane.is-grid .shelf-row-star-cell {
  display: none;
}

.shelf-sort {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 11px;
  height: 11px;
  opacity: 0.5;
}

.shelf-sort svg {
  width: 11px;
  height: 11px;
}

.shelf-col.is-active .shelf-sort {
  opacity: 1;
}

:root[data-theme="dark"] .shelf-col.is-active {
  color: #e2c078;
}

.shelf-rows {
  flex: 1;
  min-height: 0;
  padding: 5px;
  overflow: auto;
  scrollbar-color: rgba(0, 0, 0, 0.16) transparent;
  scrollbar-width: thin;
}

.shelf-folder-group {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-height: 28px;
  padding: 0 8px;
  color: var(--ink-3);
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: left;
}

.shelf-folder-group:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.24);
}

.shelf-folder-group svg {
  width: 11px;
  height: 11px;
  transition: transform 0.16s ease;
}

.shelf-folder-group.is-collapsed svg {
  transform: rotate(-90deg);
}

.shelf-folder-group-count {
  color: var(--ink-3);
  font-size: 9px;
  opacity: 0.7;
}

.shelf-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px 124px 30px 82px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 6px 8px;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 12px;
  text-align: left;
  transition: grid-template-columns 0.38s cubic-bezier(0.22, 0.61, 0.36, 1), background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
  -webkit-tap-highlight-color: transparent;
}

.shelf-row:hover {
  background: rgba(255, 255, 255, 0.34);
}

.shelf-row.is-selected {
  border-color: rgba(165, 123, 37, 0.28);
  background: rgba(231, 201, 135, 0.2);
  box-shadow: inset 2px 0 0 rgba(165, 123, 37, 0.55);
}

:root[data-theme="dark"] .shelf-row:hover {
  background: rgba(255, 255, 255, 0.055);
}

:root[data-theme="dark"] .shelf-row.is-selected {
  border-color: rgba(231, 201, 135, 0.2);
  background: rgba(231, 201, 135, 0.1);
}

.shelf-row-name {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.shelf-file-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  color: var(--ink-2);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.34);
}

.shelf-file-icon svg {
  width: 17px;
  height: 17px;
}

.shelf-file-icon.is-folder {
  color: #8a6118;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(231, 201, 135, 0.24);
}

.shelf-file-icon.is-html {
  color: #3f7d9e;
  background: rgba(155, 215, 255, 0.18);
}

.shelf-file-icon.is-image {
  color: #587c45;
  background: rgba(183, 219, 156, 0.18);
}

.shelf-file-icon.is-code {
  color: #6b5b9a;
  background: rgba(196, 180, 235, 0.18);
}

.shelf-file-icon.is-media {
  color: #a05b3f;
  background: rgba(238, 190, 160, 0.18);
}

.shelf-file-icon img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

:root[data-theme="dark"] .shelf-file-icon {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .shelf-file-icon.is-folder {
  color: #d5b564;
  background: rgba(231, 201, 135, 0.1);
}

.shelf-row-title {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 560;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-row-chevron {
  flex: none;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1;
}

.shelf-row-type,
.shelf-row-time,
.shelf-row-size {
  overflow: hidden;
  color: var(--ink-3);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-row-size {
  text-align: right;
  transition: opacity 0.2s ease, transform 0.3s ease;
}

/* ---------- 网格视图 ---------- */

.shelf-list-pane.is-grid .shelf-list-head {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
}

.shelf-list-pane.is-grid .shelf-col {
  flex: 1;
  justify-content: center;
}

.shelf-list-pane.is-grid .shelf-rows {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  align-content: start;
  gap: 8px;
  padding: 10px;
}

.shelf-list-pane.is-grid .shelf-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 128px;
  padding: 10px;
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
}

.shelf-list-pane.is-grid .shelf-row:hover {
  background: rgba(255, 255, 255, 0.3);
}

.shelf-list-pane.is-grid .shelf-row.is-selected {
  border-color: rgba(165, 123, 37, 0.32);
  background: rgba(231, 201, 135, 0.18);
}

.shelf-list-pane.is-grid .shelf-row-name {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.shelf-list-pane.is-grid .shelf-file-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
}

.shelf-list-pane.is-grid .shelf-file-icon svg {
  width: 26px;
  height: 26px;
}

.shelf-list-pane.is-grid .shelf-row-title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 11px;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.shelf-list-pane.is-grid .shelf-row-chevron,
.shelf-list-pane.is-grid .shelf-row-type,
.shelf-list-pane.is-grid .shelf-row-time {
  display: none;
}

.shelf-list-pane.is-grid .shelf-row-size {
  display: block;
  margin-top: auto;
  color: var(--ink-3);
  font-size: 9.5px;
  text-align: left;
}

:root[data-theme="dark"] .shelf-list-pane.is-grid .shelf-row {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

/* ---------- 空状态 ---------- */

.shelf-empty {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 24px;
  text-align: center;
}

.shelf-empty-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

.shelf-empty-actions .shelf-btn {
  min-height: 40px;
  padding: 0 18px;
}

.shelf-empty[hidden] {
  display: none !important;
}

.shelf-empty-icon {
  display: grid;
  place-items: center;
  width: 76px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  height: 76px;
  margin-bottom: 4px;
  color: #8a6118;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(231, 201, 135, 0.28), rgba(155, 215, 255, 0.14));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.shelf-empty-icon svg {
  width: 38px;
  height: 38px;
}

.shelf-empty-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(165, 123, 37, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.shelf-empty-icon:active {
  transform: scale(0.98);
}

.shelf-empty strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.shelf-empty p {
  max-width: 360px;
  margin: 0;
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.7;
}

.shelf-empty .shelf-btn {
  margin-top: 4px;
}

.shelf-empty-note {
  color: var(--ink-3) !important;
  font-size: 10px !important;
}

:root[data-theme="dark"] .shelf-empty-icon {
  color: #d5b564;
  border-color: rgba(255, 255, 255, 0.1);
  background: linear-gradient(145deg, rgba(231, 201, 135, 0.12), rgba(155, 215, 255, 0.05));
}

/* ---------- 预览窗 ---------- */

.shelf-preview-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--glass-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

:root[data-theme="dark"] .shelf-preview-pane {
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.shelf-preview-head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--glass-line);
}

:root[data-theme="dark"] .shelf-preview-head {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.shelf-preview-heading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.shelf-preview-kicker {
  display: block;
  color: var(--ink-3);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.17em;
  line-height: 1.2;
}

.shelf-preview-name {
  display: block;
  max-width: 100%;
  margin-top: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-preview-actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.shelf-preview-actions .shelf-mini-btn {
  order: 1;
}

.shelf-preview-actions .shelf-mini-btn.is-newtab {
  order: 2;
}

.shelf-mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 9px;
  color: var(--ink-2);
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.3);
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease;
}

.shelf-mini-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.48);
}

.shelf-mini-btn.primary {
  color: #7c5714;
  border-color: rgba(165, 123, 37, 0.28);
  background: rgba(231, 201, 135, 0.3);
}

:root[data-theme="dark"] .shelf-mini-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .shelf-mini-btn.primary {
  color: #e2c078;
  border-color: rgba(231, 201, 135, 0.24);
  background: rgba(231, 201, 135, 0.1);
}

.shelf-preview-body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  contain: paint;
  isolation: isolate;
}

.shelf-preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 22px;
  color: var(--ink-3);
  transform: translateY(-16px);
  text-align: center;
}

.shelf-preview-glyph {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: var(--ink-3);
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.28);
}

.shelf-preview-glyph svg {
  width: 21px;
  height: 21px;
}

.shelf-preview-empty p {
  margin: 0;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
}

.shelf-preview-empty span {
  max-width: 240px;
  font-size: 10px;
  line-height: 1.6;
}

.shelf-preview-host {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  contain: paint;
  transform: translateZ(0);
  isolation: isolate;
}

:root[data-theme="dark"] .shelf-preview-glyph {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

/* ---------- 底栏 ---------- */

.shelf-foot {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 28px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--glass-line);
  color: var(--ink-3);
  font-size: 9.5px;
}

:root[data-theme="dark"] .shelf-foot {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.shelf-status {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-status.is-good {
  color: #3d7a4f;
}

.shelf-status.is-warn {
  color: #a04a3a;
}

:root[data-theme="dark"] .shelf-status.is-good {
  color: #9fe3b1;
}

:root[data-theme="dark"] .shelf-status.is-warn {
  color: #ffb0a8;
}

.shelf-count {
  flex: none;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- 更多菜单 ---------- */

.shelf-menu {
  position: absolute;
  top: 62px;
  right: 24px;
  z-index: 5;
  min-width: 196px;
  padding: 6px;
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background: linear-gradient(156deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.64));
  box-shadow: var(--glass-deep);
  backdrop-filter: blur(30px) saturate(190%);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  animation: shelf-pop 0.16s ease;
}

:root[data-theme="dark"] .shelf-menu {
  border-color: rgba(255, 255, 255, 0.12);
  background: linear-gradient(156deg, rgba(22, 25, 38, 0.92), rgba(14, 17, 27, 0.86));
}

.shelf-menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  color: var(--ink);
  border-radius: 9px;
  font-size: 11.5px;
  font-weight: 500;
  text-align: left;
}

.shelf-menu-item:hover {
  background: rgba(255, 255, 255, 0.36);
}

.shelf-menu-item[aria-checked="true"]::after {
  content: "✓";
  margin-left: auto;
  color: #8a6118;
  font-weight: 700;
}

.shelf-menu-item:disabled {
  opacity: 0.35;
  cursor: default;
}

:root[data-theme="dark"] .shelf-menu-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

/* ---------- 重命名弹层 ---------- */

.shelf-rename {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(28, 26, 22, 0.16);
  backdrop-filter: blur(6px) saturate(140%);
  -webkit-backdrop-filter: blur(6px) saturate(140%);
  animation: shelf-fade 0.14s ease;
}

.shelf-rename[hidden] {
  display: none;
}

.shelf-rename-card {
  width: min(372px, calc(100% - 40px));
  padding: 20px 22px 18px;
  border: 1px solid var(--glass-line);
  border-radius: 20px;
  background: linear-gradient(156deg, rgba(255, 255, 255, 0.94), rgba(251, 248, 241, 0.86));
  box-shadow: var(--glass-deep);
  animation: shelf-pop 0.16s ease;
}

.shelf-rename-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-3);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.shelf-rename-title {
  display: block;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.shelf-rename-sub {
  margin: 7px 0 14px;
  color: var(--ink-3);
  font-size: 10.5px;
  line-height: 1.55;
}

.shelf-rename-input {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  color: var(--ink);
  border: 1px solid var(--glass-line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.shelf-rename-input:focus {
  border-color: rgba(165, 123, 37, 0.5);
  background: rgba(255, 255, 255, 0.86);
}

.shelf-rename-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.shelf-rename-actions .shelf-btn {
  min-height: 34px;
  padding: 0 13px;
  font-size: 11.5px;
}

.shelf-rename-spacer {
  flex: 1;
}

:root[data-theme="dark"] .shelf-rename-card {
  border-color: rgba(255, 255, 255, 0.12);
  background: linear-gradient(156deg, rgba(28, 31, 44, 0.96), rgba(17, 20, 30, 0.92));
}

:root[data-theme="dark"] .shelf-rename-input {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] .shelf-rename-input:focus {
  border-color: rgba(231, 201, 135, 0.42);
  background: rgba(255, 255, 255, 0.1);
}

/* ---------- 收藏夹：整张书架卡 ---------- */

.shelf-favorites {
  position: absolute;
  inset: 0;
  z-index: 22;
  display: block;
  padding: 22px 24px 14px;
  border-radius: 0;
  background: #fbfcfe;
  animation: shelf-fade 0.14s ease;
}

.shelf-favorites[hidden] { display: none; }

.shelf-favorites-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.shelf-favorites-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--glass-line);
}

.shelf-favorites-heading {
  flex: 1;
  min-width: 0;
}

.shelf-favorites-kicker {
  display: block;
  color: var(--ink-3);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.shelf-favorites-title {
  display: block;
  margin-top: 3px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.shelf-favorites-count {
  flex: none;
  min-width: 26px;
  padding: 3px 8px;
  color: #7c5714;
  border: 1px solid rgba(165, 123, 37, 0.24);
  border-radius: 999px;
  background: rgba(231, 201, 135, 0.24);
  font-size: 9px;
  font-weight: 700;
  text-align: center;
}

.shelf-favorites-tabs {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.24);
}

.shelf-favorites-tabs button {
  min-height: 28px;
  padding: 0 11px;
  color: var(--ink-3);
  border-radius: 7px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.shelf-favorites-tabs button.is-active {
  color: #315f86;
  background: rgba(80, 130, 170, 0.16);
  box-shadow: inset 0 0 0 1px rgba(80, 130, 170, 0.2);
}

.shelf-favorites-sort {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 2px;
  margin-left: 2px;
  padding-left: 12px;
  border-left: 1px solid var(--glass-line);
}

.shelf-favorites-sort button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 8px;
  color: var(--ink-3);
  border-radius: 7px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.16s ease, background 0.16s ease;
}

.shelf-favorites-sort button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.28);
}

.shelf-favorites-sort button.is-active {
  color: var(--ink);
}

.shelf-sort-arrow {
  color: rgba(165, 123, 37, 0.9);
  font-size: 10px;
  line-height: 1;
  opacity: 0;
}

.shelf-favorites-sort button.is-active .shelf-sort-arrow { opacity: 1; }

.shelf-favorites .shelf-icon-btn {
  border-color: rgba(140, 155, 172, 0.22);
  background: rgba(255, 255, 255, 0.42);
}

.shelf-favorites .shelf-icon-btn:hover {
  border-color: rgba(140, 155, 172, 0.34);
  background: rgba(255, 255, 255, 0.62);
}

.shelf-favorites-body {
  flex: 1;
  min-height: 0;
  padding: 22px 2px 10px;
  overflow: auto;
  scrollbar-width: thin;
}

.shelf-favorites-grid {
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 2px 2px 6px;
}

.shelf-favorites-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 36px;
}

.shelf-plank {
  position: absolute;
  left: -4px;
  right: -4px;
  bottom: 70px;
  z-index: 0;
  height: 14px;
  overflow: hidden;
  border: 1px solid rgba(168, 174, 178, 0.34);
  border-bottom-color: rgba(96, 104, 112, 0.26);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(226, 227, 226, 0.7) 46%, rgba(178, 183, 186, 0.46));
  box-shadow: 0 9px 18px rgba(40, 44, 52, 0.16), inset 0 1px 0 #fff, inset 0 -1px 0 rgba(90, 96, 104, 0.14);
  pointer-events: none;
}

.shelf-plank::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 2px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(50, 100, 145, 0.4), transparent);
}

.shelf-fav-book {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 0 0 calc((100% - (var(--fav-cols, 6) - 1) * 36px) / var(--fav-cols, 6));
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.shelf-fav-cover {
  --fav-ink: #6b7c8e;
  --fav-tint: rgba(156, 170, 184, 0.1);
  position: relative;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  padding: 8px 10px 7px;
  color: var(--fav-ink);
  border: 1px solid rgba(150, 170, 190, 0.32);
  border-radius: 14px;
  background:
    radial-gradient(circle at 30% 19%, rgba(255, 255, 255, 0.94), transparent 48%),
    repeating-linear-gradient(45deg, rgba(82, 120, 155, 0.035) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(-45deg, rgba(82, 120, 155, 0.025) 0 1px, transparent 1px 9px),
    linear-gradient(145deg, rgba(252, 253, 255, 0.5), var(--fav-tint));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 0 32px rgba(120, 160, 200, 0.08), 0 18px 30px rgba(40, 52, 68, 0.16), 0 4px 10px rgba(40, 52, 68, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.shelf-fav-cover::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 11px;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(63, 111, 158, 0.34);
  border-radius: 50%;
  background: rgba(252, 253, 255, 0.4);
  box-shadow: inset 0 0 0 2.5px rgba(252, 253, 255, 0.72), inset 0 0 0 3.5px rgba(63, 111, 158, 0.2);
  pointer-events: none;
}

.shelf-fav-cover.kind-md { --fav-ink: #3f6f9e; --fav-tint: rgba(70, 120, 170, 0.19); }
.shelf-fav-cover.kind-html { --fav-ink: #2f7d74; --fav-tint: rgba(47, 125, 116, 0.17); }
.shelf-fav-cover.kind-pdf { --fav-ink: #a05a4e; --fav-tint: rgba(160, 90, 78, 0.16); }
.shelf-fav-cover.kind-image { --fav-ink: #7d5f93; --fav-tint: rgba(125, 95, 147, 0.16); }
.shelf-fav-cover.kind-folder { --fav-ink: #9a6d20; --fav-tint: rgba(200, 160, 80, 0.2); }
.shelf-fav-cover.kind-archive { --fav-ink: #5f6f80; --fav-tint: rgba(95, 111, 128, 0.16); }
.shelf-fav-cover.kind-audio,
.shelf-fav-cover.kind-video { --fav-ink: #4f7f8f; --fav-tint: rgba(79, 127, 143, 0.16); }
.shelf-fav-cover.kind-code,
.shelf-fav-cover.kind-text { --fav-ink: #4d6f92; --fav-tint: rgba(77, 111, 146, 0.16); }

.shelf-fav-book:hover .shelf-fav-cover {
  transform: translateY(-3px);
  border-color: rgba(70, 115, 160, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 0 36px rgba(70, 115, 160, 0.1), 0 24px 38px rgba(40, 52, 68, 0.2), 0 6px 12px rgba(40, 52, 68, 0.1);
}

.shelf-fav-icon {
  display: grid;
  place-items: center;
  color: var(--fav-ink);
}

.shelf-fav-icon svg {
  width: 29px;
  height: 29px;
}

.shelf-fav-cover-type {
  position: absolute;
  left: 11px;
  bottom: 9px;
  color: var(--fav-ink);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}

.shelf-fav-remove {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  color: #b8862f;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.shelf-fav-remove svg {
  width: 11px;
  height: 11px;
  fill: rgba(231, 201, 135, 0.45);
}

.shelf-fav-remove:hover { background: rgba(231, 201, 135, 0.24); }

.shelf-fav-info {
  display: flex;
  flex-direction: column;
  min-height: 62px;
  margin-top: 34px;
  padding-top: 10px;
}

.shelf-fav-title {
  display: block;
  margin-top: 0;
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-fav-time {
  display: block;
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 8.5px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.shelf-fav-path {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 8.5px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-favorites-empty {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 280px;
  padding: 40px 20px;
  color: var(--ink-3);
  text-align: center;
}

.shelf-favorites-empty svg { width: 36px; height: 36px; opacity: 0.5; }
.shelf-favorites-empty strong { color: var(--ink-2); font-size: 14px; font-weight: 650; }
.shelf-favorites-empty span { font-size: 11px; line-height: 1.7; }

.shelf-favorites-foot {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  color: var(--ink-3);
  border-top: 1px solid var(--glass-line);
  font-size: 9.5px;
  letter-spacing: 0.04em;
}

.shelf-favorites-pager {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
  color: var(--ink-3);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.shelf-favorites-pager[hidden] { display: none; }

.shelf-favorites-pager button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--ink-2);
  border: 1px solid var(--glass-line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.3);
  font-size: 14px;
  line-height: 1;
}

.shelf-favorites-pager button:disabled {
  opacity: 0.3;
}

:root[data-theme="dark"] .shelf-plank {
  border-color: rgba(255, 255, 255, 0.14);
  border-bottom-color: rgba(0, 0, 0, 0.42);
  background: linear-gradient(180deg, rgba(96, 102, 110, 0.88), rgba(54, 60, 68, 0.82) 46%, rgba(30, 34, 40, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 10px 20px rgba(0, 0, 0, 0.4);
}

:root[data-theme="dark"] .shelf-plank::after {
  background: linear-gradient(90deg, transparent, rgba(120, 165, 200, 0.35), transparent);
}

:root[data-theme="dark"] .shelf-favorites {
  background: #141821;
}

:root[data-theme="dark"] .shelf-favorites-head { border-bottom-color: rgba(255, 255, 255, 0.08); }
:root[data-theme="dark"] .shelf-favorites-foot { border-top-color: rgba(255, 255, 255, 0.08); }
:root[data-theme="dark"] .shelf-favorites-tabs { border-color: rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.04); }
:root[data-theme="dark"] .shelf-favorites-tabs button.is-active { color: #cfe3f2; background: rgba(90, 140, 180, 0.2); }
:root[data-theme="dark"] .shelf-favorites-sort { border-left-color: rgba(255, 255, 255, 0.1); }
:root[data-theme="dark"] .shelf-favorites-sort button:hover { background: rgba(255, 255, 255, 0.06); }
:root[data-theme="dark"] .shelf-sort-arrow { color: #d5b564; }
:root[data-theme="dark"] .shelf-fav-cover { border-color: rgba(255, 255, 255, 0.1); background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(231, 201, 135, 0.08)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 26px rgba(0, 0, 0, 0.2); }
:root[data-theme="dark"] .shelf-fav-remove { background: rgba(255, 255, 255, 0.06); }

/* ---------- 收藏失效 ---------- */

.shelf-missing {
  position: absolute;
  inset: 0;
  z-index: 24;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(28, 26, 22, 0.16);
  backdrop-filter: blur(6px) saturate(140%);
  -webkit-backdrop-filter: blur(6px) saturate(140%);
  animation: shelf-fade 0.14s ease;
}

.shelf-missing[hidden] { display: none; }

.shelf-missing-card {
  width: min(460px, calc(100% - 40px));
  padding: 20px 22px 18px;
  border: 1px solid var(--glass-line);
  border-radius: 20px;
  background: linear-gradient(156deg, rgba(255, 255, 255, 0.94), rgba(251, 248, 241, 0.86));
  box-shadow: var(--glass-deep);
  animation: shelf-pop 0.16s ease;
}

.shelf-missing-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-3);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.shelf-missing-title {
  display: block;
  font-size: 17px;
  font-weight: 700;
}

.shelf-missing-copy {
  margin: 8px 0 14px;
  color: var(--ink-3);
  font-size: 10.5px;
  line-height: 1.7;
}

.shelf-missing-name {
  display: block;
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
  user-select: text;
  -webkit-user-select: text;
}

.shelf-missing-path {
  margin: 8px 0 16px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.shelf-fav-auth-note {
  margin: -8px 0 14px;
  color: var(--ink-3);
  font-size: 10.5px;
  line-height: 1.6;
}

.shelf-fav-auth-note[hidden] { display: none; }

.shelf-fav-auth-note.is-warn { color: #b0701c; }

:root[data-theme="dark"] .shelf-fav-auth-note.is-warn { color: #e2b26a; }

.shelf-missing-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.shelf-missing-actions .shelf-btn {
  min-height: 34px;
  padding: 0 13px;
  font-size: 11px;
}

:root[data-theme="dark"] .shelf-missing-card {
  border-color: rgba(255, 255, 255, 0.12);
  background: linear-gradient(156deg, rgba(28, 31, 44, 0.96), rgba(17, 20, 30, 0.92));
}

:root[data-theme="dark"] .shelf-missing-name {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

/* ---------- 预览轻提示 ---------- */

.shelf-preview-toast {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 30;
  padding: 7px 13px;
  color: #fff;
  border-radius: 999px;
  background: rgba(28, 28, 30, 0.78);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.shelf-preview-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- 提示与空行 ---------- */

.shelf-inline-note {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 20px;
  color: var(--ink-3);
  font-size: 11.5px;
  text-align: center;
}

.shelf-loading-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: #a57b25;
  animation: shelf-pulse 0.9s ease-in-out infinite alternate;
}

/* ---------- 重新授权 ---------- */

.shelf-auth-note {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 320px;
  padding: 36px 24px;
  text-align: center;
}

.shelf-auth-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: #8a6118;
  border: 1px solid rgba(165, 123, 37, 0.2);
  border-radius: 14px;
  background: rgba(231, 201, 135, 0.22);
}

.shelf-auth-icon svg {
  width: 22px;
  height: 22px;
}

.shelf-auth-note strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.shelf-auth-note p {
  max-width: 360px;
  margin: 0;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.7;
}

.shelf-auth-note .shelf-btn {
  min-height: 42px;
  margin-top: 4px;
  padding: 0 20px;
  font-size: 12.5px;
}

.shelf-auth-alt {
  margin-top: 2px;
  padding: 2px 4px;
  color: var(--ink-3);
  border-radius: 6px;
  font-size: 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.shelf-auth-status {
  color: var(--ink-3);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.shelf-auth-status.is-warn {
  color: #a8452f;
}

:root[data-theme="dark"] .shelf-auth-status.is-warn {
  color: #ffb0a8;
}

.shelf-auth-alt:hover {
  color: var(--ink);
}

.shelf-reauth {
  min-height: 28px;
  padding: 0 10px;
  color: #7c5714;
  border: 1px solid rgba(165, 123, 37, 0.38);
  border-radius: 999px;
  background: rgba(231, 201, 135, 0.3);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.shelf-reauth:hover {
  background: rgba(231, 201, 135, 0.44);
}

:root[data-theme="dark"] .shelf-auth-icon {
  color: #e2c078;
  border-color: rgba(231, 201, 135, 0.24);
  background: rgba(231, 201, 135, 0.1);
}

:root[data-theme="dark"] .shelf-reauth {
  color: #e2c078;
  border-color: rgba(231, 201, 135, 0.3);
  background: rgba(231, 201, 135, 0.12);
}

/* ---------- 动效 ---------- */

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

@keyframes shelf-rise {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes shelf-pop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes shelf-pulse {
  from { opacity: 0.35; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1.15); }
}

/* ---------- 响应式 ---------- */

@media (max-width: 920px) {
  .shelf-card {
    width: 96vw;
    height: 92dvh;
    padding: 18px 18px 12px;
    border-radius: 24px;
  }

  .shelf-filter-menu {
    right: auto;
    left: 0;
  }

  .shelf-main {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1.2fr) minmax(180px, 0.8fr);
  }

  .shelf-preview-pane {
    min-height: 180px;
  }

  .shelf-summary {
    flex-wrap: wrap;
  }

  .shelf-summary-side {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding-left: 62px;
  }

  .shelf-summary-time {
    order: 2;
  }

  .shelf-restore {
    order: 1;
  }
}

@media (max-width: 680px) {
  .shelf-card {
    width: 96vw;
    height: 92dvh;
    padding: 16px 14px 10px;
    border-radius: 21px;
  }

  .shelf-title {
    font-size: 21px;
  }

  .shelf-sub {
    font-size: 10.5px;
  }

  .shelf-toolbar-group {
    width: 100%;
  }

  .shelf-toolbar-tools {
    justify-content: space-between;
  }

  .shelf-search {
    flex: 1;
    min-width: 0;
  }

  .shelf-list-head,
  .shelf-row {
    grid-template-columns: minmax(0, 1fr) 74px 78px;
  }

  .shelf-col[data-sort="type"],
  .shelf-row-type {
    display: none;
  }

  .shelf-summary {
    padding: 10px 11px;
  }

  .shelf-summary-icon {
    width: 40px;
    height: 40px;
    border-radius: 13px;
  }

  .shelf-summary-icon svg {
    width: 21px;
    height: 21px;
  }

  .shelf-summary-name {
    font-size: 14px;
  }

  .shelf-preview-pane {
    min-height: 160px;
  }

  .shelf-preview-actions {
    max-width: 58%;
  }

  .shelf-menu {
    top: 56px;
    right: 14px;
  }
}

@media (pointer: coarse) {
  .shelf-btn,
  .shelf-search,
  .shelf-filter-btn,
  .shelf-mini-btn,
  .shelf-view-btn {
    min-height: 44px;
  }

  .shelf-filter-option {
    min-height: 40px;
  }

  .shelf-icon-btn,
  .shelf-up {
    width: 40px;
    height: 40px;
  }

  .shelf-row {
    min-height: 50px;
  }

  .shelf-col {
    min-height: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shelf-mask,
  .shelf-card,
  .shelf-menu,
  .shelf-loading-dot {
    animation: none !important;
  }

  .shelf-btn,
  .shelf-icon-btn,
  .shelf-row,
  .shelf-view-btn,
  .shelf-up {
    transition: none !important;
  }
}

@media (max-width: 980px) {
  .shelf-main.is-preview-focus {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.95fr);
  }

  .shelf-main.is-preview-focus .shelf-list-head,
  .shelf-main.is-preview-focus .shelf-row {
    grid-template-columns: minmax(0, 1fr) 64px 96px 28px 0px;
  }
}

/* ============================================================
   5.9.4 · 收藏夹「影青液态釉」皮肤
   只改材质与配色，布局沿用 5.9.3：书架横板、封面、信息、头部与底栏尺寸均不动。
   打开收藏夹时隐去下层文件架卡，收藏卡直接悬浮在主页背景之上。
   ============================================================ */

.shelf-card {
  --yq-ink: #13254a;
  --yq-ink-2: rgba(19, 37, 74, 0.62);
  --yq-ink-3: rgba(19, 37, 74, 0.46);
  --yq-cobalt: #2a5cb3;
  --yq-line: rgba(42, 92, 179, 0.16);
  --yq-rim: rgba(255, 255, 255, 0.78);
  --yq-gold: #b98d3c;
}

:root[data-theme="dark"] .shelf-card {
  --yq-ink: #eef4ff;
  --yq-ink-2: rgba(230, 239, 255, 0.7);
  --yq-ink-3: rgba(230, 239, 255, 0.48);
  --yq-cobalt: #9cc0ff;
  --yq-line: rgba(156, 192, 255, 0.16);
  --yq-rim: rgba(200, 222, 255, 0.24);
  --yq-gold: #e2c27e;
}

/* ---------- 一级文件架卡让位 ---------- */

.shelf-mask { transition: background-color 0.3s ease; }
.shelf-root.is-fav-mode .shelf-mask { background: rgba(4, 10, 26, 0.4); }

.shelf-root:not([hidden]) .shelf-card.is-fav-mode,
:root[data-theme="dark"] .shelf-root:not([hidden]) .shelf-card.is-fav-mode {
  overflow: visible;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.shelf-card.is-fav-mode > :not(.shelf-favorites) {
  visibility: hidden;
  pointer-events: none;
}

/* ---------- 收藏卡：液态玻璃 ---------- */

.shelf-favorites {
  color: var(--yq-ink);
  border-radius: 30px;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0) 52%),
    radial-gradient(90% 70% at 100% 100%, rgba(150, 192, 245, 0.2), rgba(150, 192, 245, 0) 64%),
    linear-gradient(180deg, rgba(250, 252, 255, 0.58), rgba(230, 241, 255, 0.66));
  box-shadow:
    0 0 0 1px var(--yq-rim),
    0 40px 96px rgba(3, 10, 30, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 1px 0 0 rgba(255, 255, 255, 0.4),
    inset -1px 0 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(160, 196, 245, 0.42);
  backdrop-filter: blur(30px) saturate(125%) brightness(1.22);
  -webkit-backdrop-filter: blur(30px) saturate(125%) brightness(1.22);
  animation: yq-float 0.36s cubic-bezier(0.2, 0.9, 0.24, 1);
}

.shelf-favorites::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff 50%, rgba(255, 255, 255, 0));
  pointer-events: none;
}

:root[data-theme="dark"] .shelf-favorites {
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(150, 185, 255, 0.12), rgba(150, 185, 255, 0) 52%),
    radial-gradient(90% 70% at 100% 100%, rgba(70, 120, 230, 0.16), rgba(70, 120, 230, 0) 64%),
    linear-gradient(160deg, rgba(18, 26, 48, 0.58), rgba(10, 15, 32, 0.52));
  box-shadow:
    0 0 0 1px var(--yq-rim),
    0 40px 96px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(210, 228, 255, 0.22),
    inset 0 -1px 0 rgba(120, 160, 255, 0.16);
  backdrop-filter: blur(30px) saturate(170%) brightness(0.92);
  -webkit-backdrop-filter: blur(30px) saturate(170%) brightness(0.92);
}

:root[data-theme="dark"] .shelf-favorites::before {
  background: linear-gradient(90deg, rgba(190, 215, 255, 0), rgba(190, 215, 255, 0.6) 50%, rgba(190, 215, 255, 0));
}

/* ---------- 头部 ---------- */

.shelf-favorites-head,
:root[data-theme="dark"] .shelf-favorites-head {
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, rgba(42, 92, 179, 0), var(--yq-line) 14%, var(--yq-line) 86%, rgba(42, 92, 179, 0)) 1;
}

.shelf-favorites-kicker { color: var(--yq-cobalt); opacity: 0.8; }
.shelf-favorites-title { color: var(--yq-ink); }

.shelf-favorites-tabs,
:root[data-theme="dark"] .shelf-favorites-tabs {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 2px rgba(19, 37, 74, 0.06);
}

.shelf-favorites-tabs button { color: var(--yq-ink-3); transition: color 0.16s ease, background 0.16s ease; }
.shelf-favorites-tabs button:hover { color: var(--yq-cobalt); }

.shelf-favorites-tabs button.is-active {
  color: var(--yq-cobalt);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.66));
  box-shadow: 0 2px 8px rgba(42, 92, 179, 0.14), inset 0 0 0 1px rgba(42, 92, 179, 0.12), inset 0 1px 0 #fff;
}

:root[data-theme="dark"] .shelf-favorites-tabs { border-color: rgba(190, 215, 255, 0.14); background: rgba(255, 255, 255, 0.04); }

:root[data-theme="dark"] .shelf-favorites-tabs button.is-active {
  color: #fff;
  background: linear-gradient(180deg, rgba(150, 190, 255, 0.26), rgba(120, 165, 255, 0.12));
  box-shadow: inset 0 0 0 1px rgba(170, 205, 255, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.shelf-favorites-sort,
:root[data-theme="dark"] .shelf-favorites-sort { border-left-color: var(--yq-line); }
.shelf-favorites-sort button { color: var(--yq-ink-3); }
.shelf-favorites-sort button:hover { color: var(--yq-cobalt); background: rgba(255, 255, 255, 0.3); }
.shelf-favorites-sort button.is-active { color: var(--yq-cobalt); }
.shelf-sort-arrow,
:root[data-theme="dark"] .shelf-sort-arrow { color: var(--yq-gold); }

.shelf-favorites .shelf-icon-btn {
  color: var(--yq-cobalt);
  border-color: rgba(255, 255, 255, 0.72);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.3));
  box-shadow: 0 4px 12px rgba(19, 37, 74, 0.08), inset 0 1px 0 #fff;
}

.shelf-favorites .shelf-icon-btn:hover {
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.72);
}

:root[data-theme="dark"] .shelf-favorites .shelf-icon-btn {
  color: var(--yq-cobalt);
  border-color: rgba(190, 215, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .shelf-favorites .shelf-icon-btn:hover { background: rgba(255, 255, 255, 0.1); }

/* ---------- 书架横板：一片液态玻璃 ---------- */

.shelf-plank {
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-bottom-color: rgba(120, 160, 220, 0.32);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(236, 244, 254, 0.44) 50%, rgba(190, 212, 242, 0.32));
  box-shadow: 0 10px 22px rgba(30, 64, 130, 0.16), 0 2px 4px rgba(30, 64, 130, 0.06), inset 0 1px 0 #fff, inset 0 -1px 0 rgba(42, 92, 179, 0.08);
}

.shelf-plank::after {
  background: linear-gradient(90deg, rgba(42, 92, 179, 0), rgba(42, 92, 179, 0.42) 50%, rgba(42, 92, 179, 0));
}

:root[data-theme="dark"] .shelf-plank {
  border-color: rgba(190, 215, 255, 0.2);
  border-bottom-color: rgba(0, 0, 0, 0.3);
  background: linear-gradient(180deg, rgba(190, 215, 255, 0.28), rgba(120, 160, 230, 0.12) 50%, rgba(40, 60, 110, 0.26));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(220, 235, 255, 0.3);
}

:root[data-theme="dark"] .shelf-plank::after {
  background: linear-gradient(90deg, rgba(150, 190, 255, 0), rgba(150, 190, 255, 0.55) 50%, rgba(150, 190, 255, 0));
}

/* ---------- 封面：影青釉片 ---------- */

.shelf-fav-cover {
  --fav-ink: #2f62b8;
  --fav-tint: rgba(120, 165, 230, 0.12);
  border-color: rgba(255, 255, 255, 0.82);
  background:
    radial-gradient(70% 60% at 24% 12%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0) 60%),
    radial-gradient(90% 80% at 80% 100%, var(--fav-tint), rgba(255, 255, 255, 0) 70%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.7), rgba(232, 241, 252, 0.48));
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 0 0 5px rgba(255, 255, 255, 0.32),
    inset 0 0 0 6px var(--fav-tint),
    0 14px 26px rgba(30, 64, 130, 0.13),
    0 3px 8px rgba(30, 64, 130, 0.06);
}

.shelf-fav-cover::before {
  border-color: var(--fav-ink);
  background: transparent;
  opacity: 0.4;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.6), inset 0 0 0 3.6px var(--fav-ink);
}

.shelf-fav-cover.kind-md { --fav-ink: #2f62b8; --fav-tint: rgba(90, 140, 220, 0.14); }
.shelf-fav-cover.kind-html { --fav-ink: #23807e; --fav-tint: rgba(70, 160, 160, 0.13); }
.shelf-fav-cover.kind-pdf { --fav-ink: #b0503f; --fav-tint: rgba(210, 120, 105, 0.13); }
.shelf-fav-cover.kind-image { --fav-ink: #7059a6; --fav-tint: rgba(150, 125, 210, 0.13); }
.shelf-fav-cover.kind-folder { --fav-ink: #a37a2c; --fav-tint: rgba(215, 175, 95, 0.16); }
.shelf-fav-cover.kind-archive { --fav-ink: #445f8e; --fav-tint: rgba(110, 135, 180, 0.13); }
.shelf-fav-cover.kind-audio,
.shelf-fav-cover.kind-video { --fav-ink: #2f7fb4; --fav-tint: rgba(90, 160, 215, 0.13); }
.shelf-fav-cover.kind-code,
.shelf-fav-cover.kind-text { --fav-ink: #3a62a6; --fav-tint: rgba(100, 140, 210, 0.13); }

.shelf-fav-book:hover .shelf-fav-cover {
  border-color: rgba(255, 255, 255, 0.96);
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 0 0 5px rgba(255, 255, 255, 0.4),
    inset 0 0 0 6px var(--fav-tint),
    0 20px 34px rgba(30, 64, 130, 0.18),
    0 0 26px var(--fav-tint);
}

.shelf-fav-remove {
  color: var(--yq-gold);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 0 0 1px rgba(185, 141, 60, 0.16);
}

.shelf-fav-remove svg { fill: rgba(226, 194, 126, 0.55); }
.shelf-fav-remove:hover { background: rgba(255, 246, 226, 0.86); }

:root[data-theme="dark"] .shelf-fav-cover {
  border-color: rgba(190, 215, 255, 0.16);
  background:
    radial-gradient(70% 60% at 24% 12%, rgba(200, 222, 255, 0.14), rgba(200, 222, 255, 0) 60%),
    radial-gradient(90% 80% at 80% 100%, var(--fav-tint), rgba(0, 0, 0, 0) 70%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));
  box-shadow:
    inset 0 1px 0 rgba(220, 235, 255, 0.18),
    inset 0 0 0 5px rgba(255, 255, 255, 0.02),
    inset 0 0 0 6px var(--fav-tint),
    0 14px 28px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .shelf-fav-cover.kind-md { --fav-ink: #9cc0ff; --fav-tint: rgba(90, 140, 240, 0.2); }
:root[data-theme="dark"] .shelf-fav-cover.kind-html { --fav-ink: #82d2cc; --fav-tint: rgba(70, 180, 175, 0.18); }
:root[data-theme="dark"] .shelf-fav-cover.kind-pdf { --fav-ink: #f0a597; --fav-tint: rgba(220, 120, 100, 0.18); }
:root[data-theme="dark"] .shelf-fav-cover.kind-image { --fav-ink: #c3b0f0; --fav-tint: rgba(150, 120, 230, 0.18); }
:root[data-theme="dark"] .shelf-fav-cover.kind-folder { --fav-ink: #e6c88a; --fav-tint: rgba(220, 180, 100, 0.18); }
:root[data-theme="dark"] .shelf-fav-cover.kind-archive { --fav-ink: #a9bde0; --fav-tint: rgba(120, 150, 210, 0.16); }
:root[data-theme="dark"] .shelf-fav-cover.kind-audio,
:root[data-theme="dark"] .shelf-fav-cover.kind-video { --fav-ink: #8fcaf2; --fav-tint: rgba(90, 170, 230, 0.18); }
:root[data-theme="dark"] .shelf-fav-cover.kind-code,
:root[data-theme="dark"] .shelf-fav-cover.kind-text { --fav-ink: #a6c1f0; --fav-tint: rgba(110, 150, 230, 0.18); }

:root[data-theme="dark"] .shelf-fav-book:hover .shelf-fav-cover {
  border-color: rgba(190, 215, 255, 0.3);
  box-shadow: inset 0 1px 0 rgba(220, 235, 255, 0.24), inset 0 0 0 6px var(--fav-tint), 0 20px 36px rgba(0, 0, 0, 0.36), 0 0 30px var(--fav-tint);
}

:root[data-theme="dark"] .shelf-fav-remove {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 0 1px rgba(226, 194, 126, 0.2);
}

/* ---------- 文字 ---------- */

.shelf-fav-title { color: var(--yq-ink); }
.shelf-fav-time,
.shelf-fav-path { color: var(--yq-ink-3); }
.shelf-favorites-empty { color: var(--yq-ink-3); }
.shelf-favorites-empty svg { color: var(--yq-cobalt); }
.shelf-favorites-empty strong { color: var(--yq-ink); }

/* ---------- 底栏 ---------- */

.shelf-favorites-foot,
:root[data-theme="dark"] .shelf-favorites-foot {
  color: var(--yq-ink-3);
  border-top: 1px solid transparent;
  border-image: linear-gradient(90deg, rgba(42, 92, 179, 0), var(--yq-line) 14%, var(--yq-line) 86%, rgba(42, 92, 179, 0)) 1;
}

.shelf-favorites-pager { color: var(--yq-ink-3); }

.shelf-favorites-pager button {
  color: var(--yq-cobalt);
  border-color: rgba(255, 255, 255, 0.72);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.3));
  box-shadow: inset 0 1px 0 #fff;
}

:root[data-theme="dark"] .shelf-favorites-pager button {
  border-color: rgba(190, 215, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
}

/* ---------- 收藏失效小窗 ---------- */

.shelf-missing {
  border-radius: 30px;
  background: rgba(10, 24, 56, 0.14);
}

.shelf-missing-card {
  border-color: rgba(255, 255, 255, 0.85);
  background:
    radial-gradient(100% 70% at 0% 0%, #fff, rgba(255, 255, 255, 0) 60%),
    linear-gradient(160deg, rgba(252, 253, 255, 0.94), rgba(236, 244, 253, 0.9));
  box-shadow: 0 0 0 1px rgba(42, 92, 179, 0.08), 0 26px 60px rgba(3, 10, 30, 0.3), inset 0 1px 0 #fff;
}

.shelf-missing-kicker { color: var(--yq-cobalt); }
.shelf-missing-name { color: var(--yq-ink); border-color: var(--yq-line); background: rgba(255, 255, 255, 0.6); }

:root[data-theme="dark"] .shelf-missing-card {
  border-color: rgba(190, 215, 255, 0.16);
  background: linear-gradient(160deg, rgba(22, 32, 58, 0.96), rgba(12, 18, 36, 0.94));
}

@keyframes yq-float {
  from { opacity: 0; transform: translateY(10px) scale(0.988); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .shelf-favorites { animation: none; }
}

:root[data-theme="dark"] .shelf-fav-cover::before {
  opacity: 0.6;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.03), inset 0 0 0 3.6px var(--fav-ink);
}

/* ============================================================
   5.9.4 plus · 星标
   一枚更利落的五角星 + 一粒灵感闪光，描金渐变；卡内去掉底色，入口用液态青花玻璃装裱。
   ============================================================ */

.ln-star-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.ln-star { overflow: visible; }

.ln-star-body {
  fill: #dcb35e;
  fill: url(#lnStarGold) #dcb35e;
  stroke: rgba(140, 100, 32, 0.42);
  stroke-width: 0.55;
  stroke-linejoin: miter;
  stroke-miterlimit: 10;
}

.ln-star-glint {
  fill: #e9c879;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.42s cubic-bezier(0.2, 0.9, 0.24, 1), opacity 0.3s ease;
}

:root[data-theme="dark"] .ln-star-body {
  fill: #ecc979;
  fill: url(#lnStarGoldNight) #ecc979;
  stroke: rgba(255, 236, 190, 0.32);
}

:root[data-theme="dark"] .ln-star-glint { fill: #fff0c8; }

/* ---------- 卡内星标：无底色，略放大 ---------- */

.shelf-fav-remove,
:root[data-theme="dark"] .shelf-fav-remove {
  top: 5px;
  right: 5px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: none;
  box-shadow: none;
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.24, 1);
}

.shelf-fav-remove .ln-star {
  width: 17px;
  height: 17px;
  filter: drop-shadow(0 1px 1.2px rgba(120, 86, 24, 0.28)) drop-shadow(0 0 5px rgba(232, 196, 120, 0.32));
}

:root[data-theme="dark"] .shelf-fav-remove .ln-star {
  filter: drop-shadow(0 0 6px rgba(236, 201, 121, 0.42));
}

.shelf-fav-remove:hover,
:root[data-theme="dark"] .shelf-fav-remove:hover {
  background: none;
  transform: scale(1.14);
}

.shelf-fav-remove:hover .ln-star-glint { transform: rotate(90deg) scale(1.25); }
.shelf-fav-remove:active { transform: scale(0.9); }

.shelf-fav-remove:focus-visible {
  outline: 2px solid rgba(42, 92, 179, 0.5);
  outline-offset: 0;
}

/* ---------- 书架头部入口：液态青花玻璃装裱 ---------- */

.shelf-icon-btn.shelf-fav-entry {
  position: relative;
  margin-right: 8px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 11px;
  background:
    radial-gradient(90% 60% at 28% 0%, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0) 64%),
    radial-gradient(100% 90% at 72% 110%, rgba(100, 150, 235, 0.26), rgba(100, 150, 235, 0) 72%),
    rgba(160, 195, 245, 0.12);
  box-shadow:
    0 0 0 1px rgba(42, 92, 179, 0.07),
    0 4px 14px rgba(42, 92, 179, 0.08),
    0 0 18px rgba(110, 160, 245, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(120, 160, 230, 0.18);
  backdrop-filter: blur(6px) saturate(160%) brightness(1.06);
  -webkit-backdrop-filter: blur(6px) saturate(160%) brightness(1.06);
  transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.24, 1), box-shadow 0.24s ease, background 0.24s ease;
}

/* 内圈一道青花细线，像瓷器的口沿 */
.shelf-icon-btn.shelf-fav-entry::before {
  content: "";
  position: absolute;
  inset: 4.5px;
  border: 1px solid rgba(226, 196, 128, 0.36);
  border-radius: 7px;
  box-shadow: 0 0 4px rgba(244, 216, 150, 0.22), inset 0 0 3px rgba(244, 216, 150, 0.14);
  pointer-events: none;
}

.shelf-icon-btn.shelf-fav-entry svg { position: relative; }

.shelf-icon-btn.shelf-fav-entry:hover {
  background:
    radial-gradient(90% 60% at 28% 0%, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0) 64%),
    radial-gradient(100% 90% at 72% 110%, rgba(100, 150, 235, 0.32), rgba(100, 150, 235, 0) 72%),
    rgba(160, 195, 245, 0.18);
  box-shadow:
    0 0 0 1px rgba(42, 92, 179, 0.1),
    0 6px 18px rgba(42, 92, 179, 0.12),
    0 0 22px rgba(120, 170, 245, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(120, 160, 230, 0.24);
}

.shelf-icon-btn.shelf-fav-entry:focus-visible { outline-color: rgba(42, 92, 179, 0.6); }

:root[data-theme="dark"] .shelf-icon-btn.shelf-fav-entry {
  border-color: rgba(190, 215, 255, 0.24);
  background:
    radial-gradient(80% 70% at 30% 18%, rgba(190, 215, 255, 0.24), rgba(190, 215, 255, 0) 62%),
    radial-gradient(90% 80% at 70% 100%, rgba(80, 130, 240, 0.3), rgba(80, 130, 240, 0) 70%),
    linear-gradient(160deg, rgba(40, 56, 96, 0.72), rgba(16, 24, 48, 0.66));
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.2),
    0 8px 22px rgba(0, 0, 0, 0.34),
    0 0 20px rgba(90, 140, 255, 0.24),
    inset 0 1px 0 rgba(220, 235, 255, 0.24);
}

:root[data-theme="dark"] .shelf-icon-btn.shelf-fav-entry::before {
  border-color: rgba(238, 210, 146, 0.26);
  box-shadow: 0 0 5px rgba(240, 212, 150, 0.16), inset 0 0 3px rgba(240, 212, 150, 0.1);
}

:root[data-theme="dark"] .shelf-icon-btn.shelf-fav-entry:hover {
  border-color: rgba(190, 215, 255, 0.36);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4), 0 0 28px rgba(90, 140, 255, 0.34), inset 0 1px 0 rgba(220, 235, 255, 0.3);
}

@media (pointer: coarse) {
  .shelf-fav-remove,
  :root[data-theme="dark"] .shelf-fav-remove { width: 34px; height: 34px; top: 3px; right: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  .ln-star-glint,
  .shelf-fav-remove,
  .shelf-icon-btn.shelf-fav-entry { transition: none; }
}
