/* 命盤庫目錄 */
.pt-root.lb-root {
  --ink2: #6a5e52;
  overflow-x: hidden;
  overflow-y: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
}
.pt-root.lb-root > .lb-search,
.pt-root.lb-root > .lb-cat-bar,
.pt-root.lb-root > .pt-nav,
.pt-root.lb-root > .pt-set-foot,
.pt-root.lb-root > .lb-empty { flex-shrink: 0; }
.lb-catalog > .pt-nav { grid-template-columns: 88px 1fr 88px; }
.lb-catalog .lb-nav-end { justify-self: end; color: #007aff; }
.lb-catalog .pt-nav .pt-icon { color: #007aff; }

.lb-catalog .lb-album-nav {
  justify-self: start;
  gap: 4px;
  padding: 0 4px;
  min-width: 0;
  font-size: 13px;
  color: #007aff;
}
.lb-catalog .lb-album-nav img { width: 22px; height: 22px; }
.lb-catalog .lb-seal-hint {
  margin: 2px 20px 0;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-search {
  display: flex; align-items: center; gap: 6px; margin: 8px 16px 12px;
  padding: 0 10px; height: 36px; border-radius: 10px; background: var(--fill); color: var(--label3);
}
.lb-search input {
  flex: 1; width: 100%; height: 36px; border: 0; background: transparent;
  padding: 0; font: inherit; font-size: 17px; color: var(--label); outline: none;
}
.lb-catalog .lb-search { margin-bottom: 8px; }

.lb-cat-bar { padding: 0 20px 8px; }
.lb-cat-arr { display: flex; gap: 4px; padding: 2px; border-radius: 8px; background: var(--fill); }
.lb-cat-arr button { height: 26px; padding: 0 10px; border-radius: 6px; font-size: 12px; color: var(--ink2); }
.lb-cat-arr button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }

.lb-ios-seg {
  display: flex; margin: 0 0 8px; padding: 2px; border-radius: 9px; background: var(--fill);
}
.lb-ios-seg button {
  flex: 1; height: 30px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--ink);
}
.lb-ios-seg button.on { background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 0 1px rgba(0, 0, 0, 0.1); }
.lb-ios-seg em { font-style: normal; font-weight: 400; color: var(--ink2); }

.lb-album-btn {
  flex: none; display: flex; align-items: center; gap: 6px;
  color: var(--ink); font-size: 15px; background: transparent; border: 0; padding: 0;
}
.lb-album-btn img { width: 28px; height: 28px; display: block; }
.lb-purpose { margin: 0; }
.lb-arrange-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.lb-arrange-row .lb-cat-arr { margin-top: 0; }
.lb-fold { flex: none; height: 26px; padding: 0 2px; font-size: 13px; color: #007aff; }
.lb-seal-hint { margin: 4px 20px 0; font-size: 13px; color: var(--label3); }

.lb-ios-seg button,
.lb-cat-arr button,
.lb-album-btn,
.lb-fold,
.lb-sec-head { position: relative; }
.lb-ios-seg button::after,
.lb-cat-arr button::after,
.lb-album-btn::after,
.lb-fold::after,
.lb-sec-head::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%);
}

.lb-empty { margin: 28px 32px; text-align: center; font-size: 15px; line-height: 1.6; color: var(--label3); }
.lb-ledger { padding: 0 0 20px; }
.lb-sec {
  margin: 16px 16px 0; scroll-margin-top: 8px;
  background: var(--card); border-radius: 10px; overflow: hidden;
}
.lb-sec-head {
  display: flex; align-items: center; gap: 8px; width: 100%;
  margin: 0; padding: 10px 16px 4px;
  font-size: 13px; font-weight: 600; letter-spacing: -0.08px; text-align: left;
  border: 0; color: var(--ink2); background: transparent;
}
.lb-sec-head small { letter-spacing: 0; font-weight: 400; }
.lb-sec-head svg { margin-left: auto; flex: none; color: var(--ink2); }
.lb-sec.shut .lb-sec-head svg { transform: rotate(-90deg); }
.lb-folder-seal {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  flex: none; width: 22px; height: 22px; border-radius: 3px;
  background: #f6efe3; color: #a33a2a; font-style: normal; font-weight: 700;
  font-size: 8px; line-height: 1.05;
  box-shadow: inset 0 0 0 1px #e7c9b9;
}
.lb-folder-seal.art { background: none; box-shadow: none; }
.lb-folder-seal.art img { width: 100%; height: 100%; object-fit: contain; display: block; }
.lb-folder-seal.four {
  display: inline-grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  grid-auto-flow: column; direction: rtl; place-items: center;
  padding: 2px; box-sizing: border-box; font-size: 6.5px;
}
.lb-folder-seal b { font-weight: 700; }
.lb-pair-seal {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 18px; height: 18px; border-radius: 3px; font-style: normal;
  font-size: 10px; font-weight: 700; letter-spacing: 0;
  color: #fff; background: #c2410c;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}
#library-book {
  position: absolute; inset: 0 0 50px; z-index: 8;
  display: flex; flex-direction: column;
  background: var(--bg, #f2f2f7);
}
#library-book[hidden] { display: none !important; }
#library-book > .pt-nav { flex-shrink: 0; }
#library-book-body { flex: 1; min-height: 0; overflow: auto; }

.pt-root .lb-entry {
  display: flex; box-sizing: border-box;
  width: 100%; align-items: center; gap: 10px;
  min-height: 52px; padding: 10px 16px; text-align: left;
  background: var(--card); border: 0; border-top: 0.5px solid var(--sep);
  color: inherit; font: inherit;
}
.lb-sec .lb-entry:first-of-type { border-top: 0.5px solid var(--sep); }
.lb-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lb-row-body b { font-size: 17px; font-weight: 400; }
.lb-born { flex: none; font-size: 12px; font-style: normal; font-weight: 400; color: rgba(60, 60, 67, 0.28); }

#library-root .pt-set-foot { margin: 8px 20px 24px; font-size: 13px; color: var(--label3); }

/* Cap AddActions（命盤庫右上 +） */
.lb-actions {
  position: absolute; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 30;
}
.lb-actions-group, .lb-actions-cancel {
  border-radius: 14px; background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.lb-actions-group { overflow: hidden; }
.lb-actions-title {
  padding: 14px 16px 10px; text-align: center; font-size: 13px; font-weight: 600; color: var(--label3);
}
.lb-actions-group button {
  display: block; width: 100%; min-height: 56px; border: 0; border-top: 0.5px solid var(--sep);
  background: transparent; color: #007aff; font-size: 20px; font-weight: 400;
}
.lb-actions-group .lb-actions-title + button { border-top: 0; }
.lb-actions-cancel {
  display: block; width: 100%; min-height: 56px; margin-top: 8px; border: 0;
  color: #007aff; font-size: 20px; font-weight: 600;
}
#library-add-shade:not([hidden]) { z-index: 25; }
#library-add-actions[hidden], #library-add-shade[hidden] { display: none !important; }
#library-export {
  position: absolute; inset: 0 0 50px; z-index: 8;
  display: flex; flex-direction: column;
  background: var(--bg, #f2f2f7);
  overflow: auto;
}
#library-export[hidden] { display: none !important; }
#library-export .lb-trail { color: var(--label3); font-size: 15px; }
