/* bookmarks-plugin.css —— 书签插件样式
 * 约定：所有类名以 bm- 前缀，避免与 Docsify / 站点主题冲突。
 * 层级：按钮 9000、横幅 9001、遮罩 9002、抽屉 9003。
 * Docsify 的侧边栏切换按钮在左下角，本插件固定元素都在右侧，不与之重叠。
 */

.bm-root {
  font-family: inherit;
  font-size: 14px;
  color: #2c3e50;
}

/* ---- 右下角悬浮按钮组 ---- */
.bm-fabs {
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.bm-btn {
  appearance: none;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  color: #2c3e50;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 14px;
  line-height: 1.3;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
  cursor: pointer;
}

.bm-btn:hover {
  background: #f2fbf5;
  border-color: #00c853;
}

.bm-btn-saved {
  background: #e8f9ee;
  border-color: #00c853;
}

/* ---- 顶部「继续阅读」横幅 ---- */
.bm-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9001;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(92vw, 640px);
  background: #2c3e50;
  color: #ffffff;
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.bm-banner[hidden] {
  display: none;
}

.bm-banner-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bm-banner-go {
  flex: none;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: #00c853;
  color: #ffffff;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}

.bm-banner-close {
  flex: none;
  appearance: none;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
}

/* ---- 抽屉 ---- */
.bm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9002;
  background: rgba(0, 0, 0, 0.35);
}

.bm-overlay[hidden] {
  display: none;
}

.bm-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 9003;
  width: 360px;
  max-width: 92vw;
  height: 100dvh;
  background: #ffffff;
  box-shadow: -6px 0 24px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s ease;
}

.bm-drawer[hidden] {
  display: none;
}

.bm-drawer.bm-open {
  transform: translateX(0);
}

.bm-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  font-size: 15px;
}

.bm-drawer-close {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  color: #2c3e50;
  padding: 4px;
}

.bm-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px 20px;
}

.bm-empty {
  color: #777777;
  line-height: 1.7;
  padding: 12px 6px;
}

.bm-item {
  display: flex;
  gap: 8px;
  align-items: stretch;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #ffffff;
}

.bm-item:hover {
  border-color: #00c853;
}

.bm-item-main {
  flex: 1;
  min-width: 0;
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0;
  color: inherit;
}

.bm-item-title {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bm-item-pos {
  font-size: 13px;
  color: #00a344;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bm-item-meta {
  font-size: 12px;
  color: #999999;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bm-item-del {
  flex: none;
  align-self: flex-start;
  appearance: none;
  border: 0;
  background: transparent;
  color: #c0392b;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 2px;
}

/* ---- 移动端 ---- */
@media (max-width: 600px) {
  .bm-fabs {
    right: 12px;
    bottom: 16px;
  }

  .bm-btn {
    padding: 8px 13px;
    font-size: 13px;
  }

  .bm-drawer {
    width: 100vw;
    max-width: 100vw;
  }

  .bm-banner {
    top: 8px;
    max-width: 94vw;
    font-size: 13px;
  }
}
