/* 图书馆的卡片目录柜（js/library.js）：橡木柜子一格格小抽屉。2026-11-19 从 desktop.css 拆出来。 */

.lc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 12px 20px;
  width: min(1080px, 94vw / var(--uiz, 1));
  max-height: calc(100% - 32px);
  overflow: hidden auto;
  line-height: 1.6;
  color: #2b2a33;
}

.lc-wait,
.lc-shut,
.lc-none {
  margin: 0;
  color: #f3ead6;
  text-shadow: 1px 1px 0 #000;
}

.lc-cab {
  padding: 10px 12px 14px;
  background: #8a5a32 repeating-linear-gradient(90deg, rgb(0 0 0 / 0.05) 0 3px, transparent 3px 11px);
  box-shadow: inset 0 0 0 3px #5e3a1e, inset 3px 3px 0 3px #a06c3e;
  filter: drop-shadow(4px 4px 0 rgb(0 0 0 / 0.4));
}

.lc-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

/* 柜顶钉的铜牌 */
.lc-plate {
  padding: 2px 14px;
  background: #c9a24e;
  color: #3a2a12;
  letter-spacing: 0.3em;
  box-shadow: inset 0 0 0 2px #8a6a2a, 2px 2px 0 rgb(0 0 0 / 0.35);
}

.lc-find {
  display: flex;
  gap: 4px;
}

.lc-find input,
.lc-find button,
.lc-back {
  font: inherit;
  color: #3a2a12;
  border: 0;
  box-shadow: inset 0 0 0 2px #5e3a1e;
}

.lc-find input {
  width: 11em;
  padding: 1px 6px;
  background: #efe6d2;
}

.lc-find button,
.lc-back {
  padding: 1px 10px;
  background: #c9a24e;
  cursor: pointer;
}

/* 抽屉之间露着柜体的深色木头 */
.lc-drawers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5em, 1fr));
  gap: 6px;
  padding: 6px;
  background: #5e3a1e;
}

.lc-drawer {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 6px 9px;
  font: inherit;
  color: inherit;
  background: #a87444 repeating-linear-gradient(90deg, rgb(0 0 0 / 0.05) 0 2px, transparent 2px 9px);
  border: 0;
  box-shadow: inset 2px 2px 0 #c08a56, inset -2px -2px 0 #6e4524;
  cursor: pointer;
}

.lc-drawer:hover {
  background-color: #b6814f;
}

/* 铜标签框，里面插一张卡，类目是塞梅尔维斯手写的 */
.lc-label {
  display: block;
  min-width: 82%;
  padding: 1px 6px;
  background: #f3ead6;
  box-shadow: 0 0 0 2px #b08d4a, 0 0 0 3px #6a5020;
  text-align: center;
}

.lc-label b {
  display: block;
  font-weight: normal;
  color: #2b3a5a;
}

.lc-label small,
.lc-head small,
.lc-tab small,
.lc-src,
.lc-loc,
.lc-call small,
.lc-tag {
  font-size: var(--small);
  font-family: var(--small-font);
}

.lc-label small {
  display: block;
  color: #6b6155;
}

.lc-pull {
  width: 22px;
  height: 8px;
  background: #c9a24e;
  border-radius: 0 0 11px 11px;
  box-shadow: inset 0 -2px 0 #8a6a2a, 0 0 0 1px #4a3416;
}

/* 「其他」那屉拉手边上别的字条 */
.lc-tag {
  position: absolute;
  right: -4px;
  bottom: -6px;
  padding: 0 4px;
  background: #efe6d2;
  color: #2b3a5a;
  rotate: -3deg;
  box-shadow: 1px 1px 0 rgb(0 0 0 / 0.35);
  pointer-events: none;
}

/* 拉开一屉：两栏各自滚 */
.lc.open {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  height: min(760px, calc(100% - 32px));
  overflow: hidden;
}

.lc-tray {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 8px 8px;
  background: #5e3a1e;
  box-shadow: inset 0 0 0 3px #4a2e16;
}

.lc-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 2px;
  color: #f3ead6;
}

.lc-head b {
  font-weight: normal;
}

.lc-head small {
  color: #d8c8a8;
}

.lc-cards {
  flex: 1;
  min-height: 0;
  overflow: hidden auto;
  display: flex;
  flex-direction: column;
  padding: 0 4px 0 0;
  scrollbar-color: #c9a24e #4a2e16;
}

/* 一张张卡片从上往下看只露着顶 */
.lc-tab {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex: none;
  padding: 2px 8px;
  font: inherit;
  text-align: left;
  color: #2b2a33;
  background: #f6efdc;
  border: 0;
  border-top: 1px solid #d9cba8;
  cursor: pointer;
}

.lc-tab b,
.lc-tab small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lc-tab b {
  font-weight: normal;
}

.lc-tab small {
  flex: none;
  max-width: 40%;
  color: #6b6155;
}

.lc-tab:hover {
  background: #fffaf0;
}

/* 抽出来的那张往外探一截 */
.lc-tab.on {
  background: #f0dc9a;
  translate: 8px 0;
}

/* 字母导卡：马尼拉纸，耳朵错开着露在上面 */
.lc-guide {
  position: relative;
  flex: none;
  height: 1.9em;
  margin-top: 4px;
  border-bottom: 4px solid #c4b08a;
}

.lc-guide span {
  position: absolute;
  bottom: 0;
  left: calc(8px + var(--t) * 30%);
  padding: 0 12px;
  background: #c4b08a;
  color: #3a2a12;
}

.lc-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  overflow: hidden auto;
  padding: 6px 8px 12px 4px;
}

.lc-pane > .lc-back {
  display: none;
}

/* 目录卡：米色卡纸，顶上一道红线，往下是淡蓝的横格，底下正中一个穿杆的孔。正文按老规矩：
   著者顶格，书名、出版项、丛编往里缩一格，空一行是提要 */
.lc-card {
  position: relative;
  display: grid;
  grid-template-columns: 5.5em minmax(0, 1fr);
  gap: 0 10px;
  box-sizing: border-box;
  width: 100%;
  max-width: 34em;
  padding: 10px 16px 30px;
  background: #f6efdc linear-gradient(#c0392b, #c0392b) 0 2.3em / 100% 1px no-repeat;
  box-shadow: 3px 3px 0 rgb(0 0 0 / 0.4);
  rotate: -0.6deg;
}

.lc-card::before {
  content: '';
  position: absolute;
  inset: 2.3em 0 0;
  background: repeating-linear-gradient(transparent 0 calc(1.6em - 1px), rgb(70 110 170 / 0.16) calc(1.6em - 1px) 1.6em);
  pointer-events: none;
}

.lc-call b {
  display: block;
  font-weight: normal;
}

.lc-call small {
  color: #6b6155;
}

.lc-main > * {
  margin: 0;
  overflow-wrap: anywhere;
}

.lc-ti,
.lc-imp,
.lc-ser {
  padding-left: 1.5em;
  font-size: inherit;
  font-weight: normal;
}

.lc-src,
.lc-loc {
  color: #6b6155;
}

.lc-sum {
  margin-top: 1.6em;
  text-indent: 2em;
}

.lc-src {
  margin-top: 0.4em;
}

.lc-loc {
  margin-top: 1.2em;
}

.lc-hole {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: #3a2416;
}

/* 手机上：吵架卡片挪到柜子底下；拉开一屉时只剩那排卡片，点了哪张，那张盖上来 */
#desktop.mobile .lc {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-height: 100%;
  padding: 8px;
  box-sizing: border-box;
}

#desktop.mobile .lc.open {
  position: relative;
  height: 100%;
}

#desktop.mobile .lc-pane {
  display: none;
}

#desktop.mobile .lc-pane.up {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  padding: 10px 8px;
  background: rgb(20 12 8 / 0.92);
}

#desktop.mobile .lc-pane > .lc-back {
  display: block;
  align-self: flex-start;
  margin-bottom: 10px;
}
