/* ============================================================
   note-manager.css —— 积木块：全部笔记管理（挂在导航栏下拉里）
   前缀 .ntmgr-，与 slide-manager / settings 互不影响
   尺寸与 slide-manager 对齐（大一号，更好点）
   ============================================================ */

.ntmgr {
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--c-text);
}

.ntmgr__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--c-line);
}

.ntmgr__title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.ntmgr__title em {
  margin-left: 8px;
  font-style: normal;
  font-weight: 400;
  font-size: 12.5px;
  color: var(--c-text-3);
}

.ntmgr__add {
  height: 36px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--c-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  flex: none;
  transition: background-color 0.16s var(--ease);
}

.ntmgr__add:hover {
  background: var(--c-accent-strong);
}

.ntmgr__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(56vh, 460px);
  overflow: auto;
  padding-right: 2px;
}

.ntmgr__empty {
  padding: 34px 14px;
  text-align: center;
  font-size: 13.5px;
  color: var(--c-text-3);
}

.ntmgr__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: background-color 0.16s var(--ease);
}

.ntmgr__row:hover {
  background: var(--c-card-soft);
}

.ntmgr__info {
  flex: 1;
  min-width: 0;
}

.ntmgr__name {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ntmgr__meta {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--c-text-3);
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  overflow: hidden;
}

.ntmgr__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--c-dot);
  flex: none;
}

.ntmgr__acts {
  display: flex;
  gap: 8px;
  flex: none;
  opacity: 0.5;
  transition: opacity 0.16s var(--ease);
}

.ntmgr__row:hover .ntmgr__acts,
.ntmgr__acts:focus-within {
  opacity: 1;
}

.ntmgr__btn {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--c-line);
  border-radius: 7px;
  background: var(--c-surface-focus);
  color: var(--c-text-2);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease),
    background-color 0.16s var(--ease);
}

.ntmgr__btn:hover {
  color: var(--c-text);
  border-color: var(--c-line-strong);
}

.ntmgr__btn--del:hover {
  color: var(--c-danger);
  border-color: var(--c-danger-line);
  background: var(--c-danger-bg);
}

/* ============================================================
   文件夹树（第二版）
   ============================================================ */

/* 这个下拉装的是文件夹树，桌面端给宽一点；窄屏仍由导航栏接管 */
@media (min-width: 721px) {
  .ntmgr-host {
    width: 660px;
  }
}

.ntmgr__tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.ntmgr__tool {
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--c-line);
  border-radius: 8px;
  background: var(--c-surface-focus);
  color: var(--c-text-2);
  font-size: 13.5px;
  cursor: pointer;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.ntmgr__tool:hover {
  color: var(--c-text);
  border-color: var(--c-line-strong);
}

/* —— 新建文件夹的输入条 —— */
.ntmgr__newfolder {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px dashed var(--c-line-strong);
  border-radius: 9px;
  background: var(--c-card-soft);
}

.ntmgr__newfolder[hidden] {
  display: none;
}

.ntmgr__newfolder input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--c-line);
  border-radius: 7px;
  background: var(--c-card);
  color: var(--c-text);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
}

.ntmgr__newfolder input:focus {
  border-color: var(--c-accent);
}

.ntmgr__newfolder button {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--c-line);
  border-radius: 7px;
  background: var(--c-surface-focus);
  color: var(--c-text-2);
  font-size: 13px;
  cursor: pointer;
}

.ntmgr__newfolder button[data-act="folderSave"] {
  border-color: transparent;
  background: var(--c-accent);
  color: #fff;
}

/* —— 文件夹 —— */
.ntmgr__folder {
  border-radius: 10px;
}

.ntmgr__folderhead {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.16s var(--ease);
}

.ntmgr__folderhead:hover {
  background: var(--c-card-soft);
}

.ntmgr__caret {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--c-text-3);
  transition: transform 0.18s var(--ease);
}

.ntmgr__caret svg {
  width: 15px;
  height: 15px;
}

.ntmgr__folder.is-open .ntmgr__caret {
  transform: rotate(90deg);
}

.ntmgr__foldername {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ntmgr__count {
  flex: none;
  min-width: 20px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--c-accent-soft);
  color: var(--c-accent-strong);
  font-size: 11.5px;
  line-height: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ntmgr__folderacts {
  display: flex;
  gap: 6px;
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.16s var(--ease);
}

.ntmgr__folderhead:hover .ntmgr__folderacts,
.ntmgr__folderacts:focus-within {
  opacity: 1;
}

.ntmgr__folderacts button {
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--c-line);
  border-radius: 6px;
  background: var(--c-surface-focus);
  color: var(--c-text-2);
  font-size: 12px;
  cursor: pointer;
}

.ntmgr__folderacts button:hover {
  color: var(--c-text);
  border-color: var(--c-line-strong);
}

.ntmgr__renameinput {
  width: 100%;
  max-width: 220px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--c-accent);
  border-radius: 6px;
  background: var(--c-card);
  color: var(--c-text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.ntmgr__notes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 2px 0 10px;
  padding-left: 16px;
  border-left: 2px solid var(--c-line);
}

.ntmgr__foldempty {
  padding: 12px 12px 14px;
  font-size: 12.5px;
  color: var(--c-text-3);
}

.ntmgr__list {
  gap: 2px;
  max-height: min(58vh, 520px);
}

/* —— 笔记行（移动下拉 + 编辑/删除） —— */

.ntmgr__move {
  height: 28px;
  max-width: 96px;
  padding: 0 6px;
  border: 1px solid var(--c-line);
  border-radius: 6px;
  background: var(--c-surface-focus);
  color: var(--c-text-2);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

.ntmgr__acts {
  gap: 6px;
}

.ntmgr__tip {
  margin: -4px 0 0;
  font-size: 12px;
  color: var(--c-text-3);
}

/* ============================================================
   批量改标签
   ============================================================ */

/* 「批量标签」开关：开启后按钮变实心黄，一眼看出当前在批量模式 */
.ntmgr__tool.is-on {
  border-color: #f2c53f;
  background: #f8d05a;
  color: #4a3a06;
  font-weight: 600;
}

.ntmgr__batch {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid rgba(242, 197, 63, 0.45);
  border-radius: 10px;
  background: rgba(245, 201, 69, 0.12);
}

.ntmgr__batch[hidden] {
  display: none;
}

.ntmgr__batch-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--c-text-2);
}

.ntmgr__batch-head > span {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ntmgr__batch-all,
.ntmgr__batch-exit {
  height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(242, 197, 63, 0.5);
  border-radius: 6px;
  background: var(--c-surface-focus);
  color: var(--c-text-2);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease);
}

.ntmgr__batch-all:hover,
.ntmgr__batch-exit:hover {
  background: rgba(245, 201, 69, 0.22);
}

.ntmgr__batch-exit {
  margin-left: auto;
}

.ntmgr__batch-body {
  display: flex;
  align-items: center;
  gap: 7px;
}

.ntmgr__batch-body input {
  flex: 1;
  min-width: 0;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--c-line);
  border-radius: 7px;
  background: var(--c-surface-focus);
  color: var(--c-text);
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
}

.ntmgr__batch-body input:focus {
  border-color: rgba(242, 197, 63, 0.85);
}

.ntmgr__batch-add,
.ntmgr__batch-remove {
  flex: none;
  height: 30px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

.ntmgr__batch-add {
  background: #17a673;
  color: #fff;
}

.ntmgr__batch-add:hover {
  background: #128a5f;
}

.ntmgr__batch-remove {
  border-color: var(--c-danger-line);
  background: var(--c-danger-bg);
  color: var(--c-danger);
}

.ntmgr__batch-remove:hover {
  background: #fbe9e6;
}

.ntmgr__batch-tip {
  margin: 0;
  font-size: 11.5px;
  color: var(--c-text-3);
}

/* 批量模式下的行：前面多一个圆形勾选框 */
.ntmgr__row.is-batch {
  cursor: pointer;
}

.ntmgr__check {
  flex: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--c-line-strong);
  border-radius: 50%;
  background: var(--c-surface-focus);
  position: relative;
  transition: background-color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.ntmgr__check.is-on {
  border-color: #17a673;
  background: #17a673;
}

.ntmgr__check.is-on::after {
  content: '';
  position: absolute;
  left: 4.5px;
  top: 1.5px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}

.ntmgr__row.is-picked {
  background: rgba(23, 166, 115, 0.08);
}
