/* ===== 书吧（共享电子书货架）===== */
.bookbar-wrap { padding: 8px 4px 40px; max-width: 1100px; margin: 0 auto; }
.bookbar-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin: 6px 0 14px;
}
.bookbar-title { font-size: 22px; margin: 0; }
.bookbar-sub { margin: 4px 0 0; color: var(--muted, #6b7280); font-size: 13px; }
.bookbar-upload-btn {
  flex: none; border: none; background: #e74f40; color: #fff;
  padding: 9px 16px; border-radius: 10px; font-size: 14px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(231,79,64,.25);
}
.bookbar-upload-btn:hover { background: #d4422f; }

.bookbar-toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.bookbar-search {
  flex: 1; min-width: 220px; padding: 10px 14px; border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px; font-size: 14px; background: var(--card, #fff); color: var(--text, #1f2937);
}
.bookbar-category {
  padding: 10px 12px; border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px; font-size: 14px; background: var(--card, #fff); color: var(--text, #1f2937); min-width: 140px;
}

.bookbar-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.bookbar-loading, .bookbar-empty {
  grid-column: 1 / -1; text-align: center; color: var(--muted, #6b7280);
  padding: 48px 0; font-size: 14px;
}

.bb-card {
  display: flex; gap: 14px; padding: 14px; border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px; background: var(--card, #fff); box-shadow: 0 1px 3px rgba(0,0,0,.05);
  transition: box-shadow .15s, transform .15s;
}
.bb-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.10); transform: translateY(-1px); }
.bb-cover-wrap { flex: none; width: 92px; }
.bb-cover {
  width: 92px; height: 124px; object-fit: cover; border-radius: 8px;
  background: #f1f5f9; box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.bb-cover-ph {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e74f40, #f0883e); color: #fff; font-size: 34px;
}
.bb-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bb-head { display: flex; align-items: center; gap: 8px; }
.bb-title {
  font-size: 16px; margin: 0; line-height: 1.3; overflow: hidden;
  text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.bb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; font-size: 12px; color: var(--muted, #6b7280); }
.bb-author { font-weight: 600; color: var(--text, #1f2937); }
.bb-tag {
  background: #eef2ff; color: #4f46e5; padding: 2px 8px; border-radius: 999px; font-size: 11px;
}
.bb-tag-ok { background: #ecfdf5; color: #059669; }
.bb-tag-off { background: #fef2f2; color: #dc2626; }
.bb-count { margin-left: auto; color: var(--muted, #6b7280); }
.bb-desc {
  margin: 0 0 10px; font-size: 12.5px; color: var(--muted, #6b7280); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bb-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.bb-btn {
  border: 1px solid var(--border, #e2e8f0); background: var(--card, #fff); color: var(--text, #1f2937);
  padding: 7px 12px; border-radius: 9px; font-size: 13px; cursor: pointer; transition: background .15s, border-color .15s;
}
.bb-btn:hover { background: #f8fafc; }
.bb-btn.bb-primary { background: #e74f40; border-color: #e74f40; color: #fff; }
.bb-btn.bb-primary:hover { background: #d4422f; }
.bb-btn.bb-mini { padding: 5px 10px; font-size: 12px; }
.bb-btn.bb-on { background: #ecfdf5; border-color: #a7f3d0; color: #059669; }
.bb-btn.bb-del { background: #fff; border-color: #fecaca; color: #dc2626; }
.bb-btn.bb-del:hover { background: #fef2f2; }

/* ===== 上传 / 编辑弹窗 ===== */
.bb-modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 1000;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow: auto;
}
.bb-modal {
  width: 100%; max-width: 640px; background: var(--card, #fff); color: var(--text, #1f2937);
  border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.3); padding: 22px 24px 24px;
}
.bb-modal h3 { margin: 0 0 4px; font-size: 18px; }
.bb-modal .bb-modal-sub { margin: 0 0 16px; font-size: 13px; color: var(--muted, #6b7280); }
.bb-field { margin-bottom: 13px; }
.bb-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.bb-field input[type=text], .bb-field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border, #e2e8f0);
  border-radius: 9px; font-size: 14px; background: var(--bg, #fff); color: var(--text, #1f2937);
  box-sizing: border-box; font-family: inherit;
}
.bb-field textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
.bb-row { display: flex; gap: 12px; }
.bb-row .bb-field { flex: 1; }
.bb-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.bb-tab {
  padding: 7px 14px; border: 1px solid var(--border, #e2e8f0); border-radius: 999px;
  background: var(--card, #fff); cursor: pointer; font-size: 13px;
}
.bb-tab.active { background: #e74f40; border-color: #e74f40; color: #fff; }
.bb-tabpane { display: none; }
.bb-tabpane.active { display: block; }
.bb-file-hint { font-size: 12px; color: var(--muted, #6b7280); margin: 6px 0 0; }
.bb-charcount { font-size: 12px; color: #059669; margin: 6px 0 0; min-height: 16px; }
.bb-cover-row { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.bb-cover-preview { width: 64px; height: 86px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border, #e2e8f0); background: #f1f5f9; flex: none; }
.bb-cover-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bb-cover-preview .bb-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 22px; background: linear-gradient(135deg, #e74f40, #f0883e); color: #fff; }
.bb-modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.bb-modal-foot .bb-btn { padding: 9px 18px; font-size: 14px; }
.bb-busy { opacity: .7; }
.bb-busy .bb-btn { cursor: not-allowed; }
/* 上传/保存进度条 */
.bb-progress-wrap { margin: 10px 0 0; }
.bb-progress-bar { width: 100%; height: 8px; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.bb-progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, #e74f40, #f0883e); transition: width .15s ease; border-radius: 999px; }
.bb-progress-indeterminate .bb-progress-fill { width: 40%; animation: bb-indet 1.1s infinite ease-in-out; }
@keyframes bb-indet { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
.bb-progress-text { display: block; font-size: 12px; color: var(--muted, #6b7280); margin-top: 5px; }
.bb-err { color: #dc2626; font-size: 13px; margin: 8px 0 0; min-height: 16px; }
.bb-err a { color: #2563eb; text-decoration: underline; cursor: pointer; }
/* 上传完成提示：文件/封面上传成功后显示「已上传。」 */
.bb-uped { display: inline-block; font-size: 12px; color: #059669; margin: 6px 0 0; font-weight: 600; }
.bb-uped b { font-weight: 700; }
