/* 导出：整理模式、勾选、底部操作条与导出弹窗 */

.btn-export-mode {
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--sub);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.btn-export-mode:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-export-mode.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* 卡片左上角复选框 */
.export-check {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .16);
  cursor: pointer;
}
[data-dark] .export-check { background: rgba(15, 23, 42, .86); }
.export-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.book-card.selecting { cursor: pointer; }
.book-card.selecting .book-del,
.book-card.selecting .book-actions { display: none !important; }
.book-card.selected,
.author-group.selected {
  box-shadow: 0 0 0 2px var(--primary), var(--shadow-md, 0 8px 24px rgba(99, 102, 241, .18));
  border-color: var(--primary);
}

.author-group.selecting .author-del,
.author-group.selecting .btn-book-action { display: none !important; }
.author-check {
  position: static !important;
  flex: 0 0 auto;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.author-check input { width: 19px; height: 19px; }

/* 底部操作条 */
.export-bar {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 480;
  width: min(560px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 12px 40px rgba(15, 23, 42, .22);
}
.export-bar-count { font-size: 13px; color: var(--sub); white-space: nowrap; }
.export-bar-count b { color: var(--primary); font-size: 16px; }
.export-bar-actions { display: flex; gap: 8px; }
.export-bar-cancel,
.export-bar-go {
  border: none;
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.export-bar-cancel { background: var(--bg); color: var(--sub); }
.export-bar-go {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff;
}
.export-bar-go:disabled { opacity: .45; cursor: not-allowed; }

/* 弹窗 */
.export-modal { max-width: 520px; }
.export-summary {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 12px;
}
.export-summary b { color: var(--primary); font-size: 20px; margin: 0 2px; }
.export-preview {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  font-size: 13px;
  line-height: 1.75;
  color: var(--sub);
}
.export-preview-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: .02em;
}
.export-preview p { margin: 2px 0; }
.export-preview code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(99, 102, 241, .1);
  color: var(--primary);
  font-size: 12px;
}
.export-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.export-option input { width: 18px; height: 18px; accent-color: var(--primary); }
.export-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.export-primary {
  background: linear-gradient(135deg, var(--primary), #8b5cf6) !important;
  color: #fff !important;
  border: none !important;
}
.export-primary:disabled { opacity: .6; cursor: wait; }

@media (max-width: 640px) {
  .btn-export-mode { padding: 4px 9px; font-size: 11.5px; }
  .export-check { top: 6px; left: 6px; }
  .export-check input { width: 20px; height: 20px; }
  .export-bar {
    width: calc(100vw - 20px);
    bottom: calc(12px + env(safe-area-inset-bottom));
    padding: 9px 10px 9px 14px;
    border-radius: 13px;
  }
  .export-bar-count { font-size: 12.5px; }
  .export-bar-cancel, .export-bar-go { padding: 8px 12px; font-size: 12.5px; }
  .export-modal { width: 94vw; }
  .export-actions { flex-direction: column-reverse; }
  .export-actions .btn-sm { width: 100%; padding: 11px; }
}

.export-check.disabled { opacity: .45; cursor: not-allowed; }
.export-check.disabled input { cursor: not-allowed; }

/* 选择模式下不要沿用卡片 hover 的边框，避免看起来像已选中 */
.book-card.selecting:hover { transform: none; border-color: var(--border); box-shadow: var(--shadow-sm); }
.book-card.selecting.selected:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.author-group.selecting .author-group-head:hover { transform: none; border-color: var(--border); }
.author-group.selecting.selected .author-group-head:hover { border-color: var(--primary); }

/* 书库整理：批量删除（仅书籍模块） */
.export-bar-delete {
  border: 1px solid #fecdd3;
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  color: #dc2626;
  background: #fff1f2;
  transition: background .18s, border-color .18s;
}
.export-bar-delete:hover:not(:disabled) { background: #ffe4e6; border-color: #fda4af; }
.export-bar-delete:disabled { opacity: .45; cursor: not-allowed; }
.export-bar-cancel:disabled { opacity: .45; cursor: not-allowed; }
[data-dark] .export-bar-delete {
  background: rgba(220, 38, 38, .14);
  border-color: rgba(248, 113, 113, .35);
  color: #fca5a5;
}
[data-dark] .export-bar-delete:hover:not(:disabled) { background: rgba(220, 38, 38, .24); }
