:root {
  --red: #ff2442;
  --red-dark: #ff5c74;
  --muted: #9aa0a8;
  --bg: #141518;
  --card-bg: #1d1f23;
  --ink: #eceef1;
  --rule: #2c2f35;
  --placeholder: #6d737c;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }

/* ---------- Top bar (xhs layout, dark colors) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 720px) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 16px 32px 12px;
  background: rgba(20, 21, 24, 0.88);
  border-bottom: 1px solid var(--rule);
  backdrop-filter: saturate(180%) blur(18px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--red);
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.logo-dot {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: radial-gradient(circle at 35% 30%, #fff 0 14%, transparent 15%),
    linear-gradient(135deg, #ff6b81, var(--red));
  box-shadow: 0 10px 24px rgba(255, 36, 66, 0.20);
}
.search-area {
  display: grid;
  width: 100%;
  min-width: 0;
}
.search-shell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
  height: 40px;
  padding: 2px 2px 2px 4px; /* 左侧保留空隙，右侧贴近按钮 */
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: #24272b;
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.25);
}
.search-shell:focus-within {
  border-color: rgba(255, 36, 66, 0.55);
  background: #1d1f23;
  box-shadow: 0 6px 20px rgba(255, 36, 66, 0.12);
}
.search-shell input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 0 10px;
  min-width: 0;
  font-size: 16px; /* ≥16px 避免 iOS 聚焦时自动放大页面 */
}
.search-shell input::placeholder { color: var(--placeholder); }
.search-shell .search-btn {
  flex: 0 0 auto;
  border: 0;
  color: #fff;
  background: var(--red);
  border-radius: 999px;
  padding: 7px 18px;
  margin-left: 4px; /* 仅左侧与内容留空隙，右侧贴近边框 */
  font-weight: 700;
  transition: transform 0.18s ease, background 0.18s ease;
}
.search-shell .search-btn:hover { background: var(--red-dark); transform: translateY(-1px); }

/* 主搜索框模式切换（ID / 标记，并/或）——xhs 分段控件，内联于搜索框内 */
.mode-group {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--rule);
  border-radius: 999px;
}
.mode-group[hidden] { display: none !important; }
.mode-btn {
  padding: 4px 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}
.mode-btn:hover:not(.active) { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.mode-btn.active { background: var(--red); color: #fff; font-weight: 600; }
.tags-legend { font-size: 12px; color: var(--muted); margin-bottom: 10px; line-height: 1.5; }

/* ---------- Filter condition area (xhs layout, dark colors) ---------- */
.filters {
  max-width: 1440px;
  margin: 16px auto 0;
  padding: 14px 20px;
  border: 1px solid var(--rule);
  border-radius: 22px;
  background: rgba(29, 31, 35, 0.9);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-end;
}
.filter-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.filter-label {
  padding-left: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.ctrl {
  position: relative;
  display: flex;
  align-items: center;
  width: 260px;
  height: 38px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: #1d1f23;
  transition: border-color 0.15s;
}
.ctrl:focus-within { border-color: rgba(255, 36, 66, 0.55); }
.ctrl input[type="text"] {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 0 12px;
  font-size: 16px; /* ≥16px 避免 iOS 聚焦时自动放大页面 */
}
.ctrl input::placeholder { color: var(--placeholder); }
.ctrl select {
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 0 30px 0 12px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.ctrl select option { color: var(--ink); background: #1d1f23; }
.select-ctrl::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #8a8d95;
  border-bottom: 1.5px solid #8a8d95;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.sort-ctrl .select-ctrl { flex: 1; }

/* 升降序 & 精确匹配 圆点开关（参考 xhs 收藏专辑条件） */
.order-toggle,
.exact-toggle {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin: 0 10px;
  cursor: pointer;
}
.order-toggle.fixed-left { margin-left: 12px; }
.order-toggle input,
.exact-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid #6d737c;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.order-toggle input:checked,
.exact-toggle input:checked { border-color: var(--red); background: var(--red); }

/* 收藏专辑 / 用户分组：右侧分组下拉叠放在输入框上方 */
#collect-group-select,
#users-group-select {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 2;
  width: 42px;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  appearance: none;
  background: transparent;
  color: transparent;
  cursor: pointer;
}
#collect-group-select:focus,
#users-group-select:focus { background: transparent; }
#collect-group-select option { color: var(--ink); background: #1d1f23; }
.filter-item.text-filter .ctrl { padding-right: 42px; }
.filter-item.text-filter .ctrl::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #8a8d95;
  border-bottom: 1.5px solid #8a8d95;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
/* 作品 ID 是纯文本输入，无下拉箭头 */
#post-id-item .ctrl { padding-right: 0; }
#post-id-item .ctrl::after { display: none; }

/* ---------- Mobile (≤768px, aligned with xhs) ---------- */
@media (max-width: 768px) {
  .topbar {
    grid-template-columns: 1fr;
    padding: 12px 16px 10px;
  }
  /* 手机版不显示顶部品牌标题，搜索框独占一行 */
  .brand { display: none; }

  .filters { padding: 10px 12px; border-radius: 16px; }
  /* 条件区手机版左右两列，且不显示条件标题 */
  .filter-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    align-items: stretch;
  }
  .filter-label { display: none; }
  .filter-item { gap: 8px; }
  .ctrl { width: 100%; }

  .container { padding: 16px 12px; }
  .pager { gap: 8px; }
  .metrics { gap: 8px; }

  /* 操作按钮手机版：左对齐，每个按钮占 1/4 行宽，一行4个，无左侧留白 */
  .filter-row.actions-row {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-top: 6px;
    padding-top: 14px;
  }
  .filter-row-end {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
  }
  /* 让批量按钮与批量管理/重置合并到同一 flex 流，以便一行4个 */
  .bulk-actions {
    display: contents;
  }
  .bulk-actions[hidden] { display: none !important; }
  .bulk-selection-count { width: 100%; white-space: normal; }
  .actions-row .ghost-btn {
    flex: 0 0 auto;
    min-width: 0;
    padding: 0 12px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .bulk-edit-modal .bulk-edit-dialog { width: 70vw; padding: 16px 16px; }
}

/* ---------- Card grid: 5 → 2 per row ---------- */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 0;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
@media (max-width: 1280px) { .card-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1024px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .card-grid { grid-template-columns: repeat(2, 1fr); } }

.card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s, box-shadow 0.12s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45); }

.cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: #202225;
  overflow: hidden;
}
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}
.collect-tag {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.5;
}
.collect-tag:hover { background: rgba(255, 36, 66, 0.78); }
.collect-tag-empty {
  border: 1px dashed rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.45);
  color: #e3e4e6;
  cursor: pointer;
}

.card-body { padding: 10px 12px 12px; }
/* 作品标记：单标签展示，绿色胶囊，可点击编辑（参考用户页标记） */
.p-tags { margin: 6px 0 6px; display: flex; align-items: center; gap: 6px; }
.p-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(63, 208, 139, 0.4);
  background: rgba(63, 208, 139, 0.12);
  color: #bdf5d9;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.p-tag .p-tag-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-tag:hover { border-color: rgba(63, 208, 139, 0.85); background: rgba(63, 208, 139, 0.2); }
.p-tag-empty { border-style: dashed; color: var(--muted); background: transparent; }
.post-id {
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.title {
  font-weight: 500;
  font-size: 14px;
  line-height: 1.4;
  height: 2.8em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.author {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}
.card-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #ff8a9b, #ff2442);
  font-size: 11px;
  font-weight: 800;
}
.card-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.author-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 作品卡片：作者名右侧的用户分组修改控件 */
.p-user-group {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  max-width: 100%;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid rgba(192, 140, 255, 0.4);
  background: rgba(192, 140, 255, 0.12);
  color: #e6d7ff;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: box-shadow 0.18s ease, background 0.18s ease;
}
.p-user-group:hover { box-shadow: 0 0 0 2px rgba(192, 140, 255, 0.4); background: rgba(192, 140, 255, 0.2); }
.p-user-group .group-empty { font-style: normal; opacity: 0.55; }
/* 作品卡片：作者名右侧的用户ID标签（蓝色、不可编辑） */
.p-user-id {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  max-width: 100%;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid rgba(87, 166, 255, 0.4);
  background: rgba(87, 166, 255, 0.12);
  color: #cfe4ff;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.metrics {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}
/* 作品卡片标记后紧跟热度区：保持标记上下间距一致 */
.card-body .p-tags + .metrics { margin-top: 0; }
.card-delete-btn {
  border: 0;
  border-radius: 999px;
  padding: 3px 10px;
  margin-left: auto;
  color: #fff;
  background: var(--red);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}
.card-delete-btn:hover { background: var(--red-dark); transform: translateY(-1px); }

/* 用户卡片「更新作品」按钮：次级操作，轮廓样式 */
.card-sync-btn {
  border: 1px solid rgba(255, 36, 66, 0.55);
  border-radius: 999px;
  padding: 2px 10px;
  color: #ff9caa;
  background: rgba(255, 36, 66, 0.08);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.card-sync-btn:hover { background: var(--red); color: #fff; transform: translateY(-1px); }
.card-sync-btn:disabled { opacity: 0.6; cursor: progress; transform: none; }

/* ---------- Empty / Pager ---------- */
.empty {
  text-align: center;
  color: var(--muted);
  padding: 60px 0;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 0 40px;
  flex-wrap: wrap;
}
.pager button {
  padding: 6px 16px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--ink);
  cursor: pointer;
}
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }
.page-info { color: var(--ink); }
.jump {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
.jump input {
  width: 60px;
  padding: 5px 8px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--ink);
  text-align: center;
  font-size: 16px; /* ≥16px 避免 iOS 聚焦时自动放大页面 */
}

/* ---------- Bulk manage & actions (xhs) ---------- */
.card { position: relative; cursor: pointer; }
.actions-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  width: 100%;
  margin-top: 18px;
}
.filter-row-end {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ghost-btn {
  height: 40px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}
.ghost-btn:hover:not(:disabled) { background: var(--red-dark); transform: translateY(-1px); }
.ghost-btn:disabled { cursor: not-allowed; background: #4a4b53; color: #a9aab1; opacity: 0.8; }
.actions-row .ghost-btn { height: 32px; padding: 0 14px; font-size: 13px; flex: 0 0 auto; }
.bulk-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bulk-actions[hidden] { display: none !important; }
.bulk-selection-count { color: var(--red); font-size: 12px; font-weight: 700; white-space: nowrap; }

/* 状态行：左侧「已展示 X / total」，右侧「已选 N」 */
.status-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
}
.status-line .result-text { color: var(--muted); }
.status-line .bulk-selection-count { color: var(--red); }

/* 卡片批量选择按钮：批量管理时显示 */
.bulk-select-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: none;
  place-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  padding: 0;
  color: #fff;
  background: rgba(20, 20, 25, 0.22);
  font-size: 0;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
body.is-bulk-managing .bulk-select-btn { display: grid; }
.card.is-selected {
  outline: 2px solid var(--red);
  outline-offset: -2px;
  box-shadow: 0 0 0 4px rgba(255, 36, 66, 0.25);
}
.card.is-selected .bulk-select-btn { background: var(--red); border-color: var(--red); }
.card.is-selected .bulk-select-btn::after {
  content: "✓";
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  transform: translate(-1px, -1px);
}

/* 批量修改专辑弹窗 */
.bulk-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
}
.bulk-edit-modal.open { display: flex; }
.bulk-edit-dialog {
  width: min(420px, 90vw);
  background: var(--card-bg);
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.bulk-edit-dialog h2 { margin: 0 0 14px; font-size: 16px; }
.bulk-edit-dialog input {
  width: 100%;
  padding: 9px 12px;
  font-size: 16px; /* ≥16px 避免 iOS 聚焦时自动放大页面 */
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  outline: none;
}
.bulk-edit-dialog input:focus { border-color: rgba(255, 36, 66, 0.55); }
.bulk-edit-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.bulk-edit-cancel {
  padding: 7px 16px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.bulk-edit-confirm {
  padding: 7px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.bulk-edit-confirm:disabled { opacity: 0.4; cursor: not-allowed; }
.bulk-edit-clear {
  padding: 7px 16px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.bulk-edit-append {
  padding: 7px 16px;
  border: 1px solid rgba(63, 208, 139, 0.5);
  border-radius: 999px;
  background: rgba(63, 208, 139, 0.12);
  color: #bdf5d9;
  cursor: pointer;
}
.bulk-edit-remove {
  padding: 7px 16px;
  border: 1px solid rgba(255, 107, 129, 0.5);
  border-radius: 999px;
  background: rgba(255, 107, 129, 0.12);
  color: #ffd3da;
  cursor: pointer;
}

/* ---------- 帖子/用户 Tab 切换 ---------- */
.tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 14px 16px 0;
}
.tab {
  padding: 6px 22px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.tab.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  font-weight: 600;
}
.page-section { }

/* ---------- 用户页：一行一个用户 ---------- */
.user-list { display: flex; flex-direction: column; gap: 16px; }
.user-row {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: default;
  user-select: text;
  transition: box-shadow 0.12s;
}
.user-row:hover { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45); }
.user-info {
  display: flex;
  align-items: center;
  gap: 14px;
}
.u-avatar {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  font-size: 18px;
  cursor: pointer;
}
/* 作品封面可点击（bilibili 打开视频），其余区域保持默认光标 */
.u-note .cover { cursor: pointer; }
.u-meta { flex: 1 1 auto; min-width: 0; }
.u-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  min-width: 0;
}
.u-name-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
}
.u-name .card-delete-btn { flex: 0 0 auto; }
.u-name-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.u-name-actions .card-delete-btn { margin-left: 0; }
.u-alias {
  flex: 0 0 auto;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255, 36, 66, 0.12);
  color: var(--red);
  font-size: 12px;
  font-weight: 500;
}
.u-sub {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
}
/* xhs 风格：ID / 分组 / 性别 以彩色图标胶囊标签展示 */
.u-sub > span {
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.u-sub > span.tag-id { background: rgba(87, 166, 255, 0.12); border: 1px solid rgba(87, 166, 255, 0.4); color: #cfe4ff; }
.u-sub > span.tag-group { background: rgba(192, 140, 255, 0.12); border: 1px solid rgba(192, 140, 255, 0.4); color: #e6d7ff; }
.u-sub > span.tag-gender { background: rgba(255, 107, 129, 0.12); border: 1px solid rgba(255, 107, 129, 0.4); color: #ffd3da; }
.u-tag-ic { width: 12px; height: 12px; flex: 0 0 auto; opacity: 0.95; }
/* user_tags 标记块：绿色胶囊，可点击编辑 */
.u-tags {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.u-tags-head { font-size: 11px; color: var(--muted); }
.u-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(63, 208, 139, 0.4);
  background: rgba(63, 208, 139, 0.12);
  color: #bdf5d9;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.u-tag .u-tag-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.u-tag-empty {
  border-style: dashed;
  color: var(--muted);
  background: transparent;
}
.u-tag:hover { border-color: rgba(63, 208, 139, 0.85); background: rgba(63, 208, 139, 0.2); }
.u-tag-add {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px dashed var(--rule);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.u-tag-add:hover { color: #fff; border-color: var(--red); }
/* 分组胶囊可点击编辑（span 与 button 通用） */
.u-sub .tag-group {
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid rgba(192, 140, 255, 0.4);
  background: rgba(192, 140, 255, 0.12);
  color: #e6d7ff;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: box-shadow 0.18s ease, background 0.18s ease;
}
.u-sub .tag-group:hover { box-shadow: 0 0 0 2px rgba(192, 140, 255, 0.4); background: rgba(192, 140, 255, 0.2); }
.u-sub .group-empty { font-style: normal; opacity: 0.55; }
/* 批量模式：用户行左上角选择按钮 + 选中态 */
.user-row { position: relative; }
.user-row .u-bulk-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: none;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.95);
  padding: 0;
  color: #fff;
  background: rgba(20, 20, 25, 0.22);
  font-size: 0;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
body.users-bulk .user-row .u-bulk-btn { display: grid; }
body.users-bulk .user-row .card-delete-btn,
body.users-bulk .user-row .card-sync-btn { display: none; }
.user-row.is-selected {
  outline: 2px solid var(--red);
  outline-offset: -2px;
  box-shadow: 0 0 0 4px rgba(255, 36, 66, 0.25);
}
.user-row.is-selected .u-bulk-btn { background: var(--red); border-color: var(--red); }
.user-row.is-selected .u-bulk-btn::after {
  content: "✓";
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  transform: translate(-1px, -1px);
}
.u-sign {
  margin-top: 4px;
  color: var(--placeholder);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 720px;
}
.u-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.u-stats {
  margin-top: 12px;
  display: flex;
  gap: 16px;
}
.u-stat {
  display: flex;
  align-items: center;
  gap: 6px;
}
.u-stat span { color: var(--muted); font-size: 12px; }
.u-stat .u-stat-ic { display: inline-flex; align-items: center; }
.u-stat-ic svg { width: 15px; height: 15px; display: block; }
.u-stat b { font-size: 15px; color: var(--ink); font-weight: 700; }
.u-notes {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
/* 作品卡片按页面宽度收敛（最多 5 块） */
.u-note {
  border-radius: 8px;
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
}
/* 用户页作品卡片：标题按实际行数撑高，避免单行标题下方留空位 */
.u-note .title { height: auto; }
.u-note .card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}
.u-note .card-body .title { flex: 1 0 auto; }
.u-note .card-body .metrics { margin-top: auto; }
@media (max-width: 1200px) { .u-notes { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 960px) { .u-notes { grid-template-columns: repeat(3, 1fr); } }

/* ---------- 用户页手机版：信息在上，笔记左右两个 ---------- */
@media (max-width: 768px) {
  .user-row { padding: 12px; }
  .u-avatar { width: 52px; height: 52px; font-size: 20px; }
  .u-stats { gap: 9px; }
  .u-sign { max-width: none; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .u-notes { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
