/**
 * 小手机 — 表情面板 + 表情包样式
 * 莫奈印象派 · iOS 扁平风
 */

/* ═══════ Emoji 选择面板 ═══════ */
.emoji-picker {
  background: var(--surface-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-light);
  padding: 8px 6px; max-height: 260px; overflow-y: auto; display: none;
}
.emoji-picker.show { display: block; }
.emoji-picker-header { display: flex; justify-content: flex-end; margin-bottom: 8px; padding: 0 4px; }
.emoji-picker-btn {
  font-size: 12px; font-weight: 300; letter-spacing: 0.8px;
  color: var(--ink-light); background: none; border: none;
  cursor: pointer; padding: 4px 10px; border-radius: 10px;
}
.emoji-picker-btn.manage { color: var(--ink-subtle); }
.emoji-picker-btn:active { background: var(--surface-page); }

.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-item {
  font-size: 24px; text-align: center; padding: 6px 2px;
  cursor: pointer; border-radius: 12px; position: relative;
}
.emoji-item:active { background: var(--surface-page); }
.emoji-delete-btn {
  display: none; position: absolute; top: -2px; right: -2px;
  width: 16px; height: 16px; background: #EF4444; color: #fff;
  border-radius: 50%; font-size: 9px; line-height: 16px; text-align: center;
}
.emoji-grid.managing .emoji-delete-btn { display: block; }

/* ═══════ 表情包全屏页 ═══════ */
#stickerLibraryScreen .nav-bar { z-index: 20; }
.sticker-tabs-scroll {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 12px 14px;
  background: var(--surface-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap; -webkit-overflow-scrolling: touch; margin-top: 0;
}
.sticker-tabs-scroll::-webkit-scrollbar { display: none; }
/* 角色表情包筛选 */
.sticker-char-scroll {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 10px 14px;
  background: var(--surface-page);
  white-space: nowrap; -webkit-overflow-scrolling: touch;
}
.sticker-char-scroll::-webkit-scrollbar { display: none; }
.sticker-char-chip {
  padding: 6px 16px; font-size: 12px; font-weight: 400;
  letter-spacing: 0.8px; color: var(--ink); cursor: pointer;
  border-radius: 16px; flex-shrink: 0;
  background: var(--surface-input); border: 1.5px solid var(--border-light);
  transition: all 0.2s; white-space: nowrap;
}
.sticker-char-chip.active {
  background: var(--monet-blue); color: #fff; border-color: var(--monet-blue);
  font-weight: 500; box-shadow: 0 2px 8px rgba(123,165,184,0.3);
}
.sticker-group-tab {
  padding: 8px 18px; font-size: 13px; font-weight: 300;
  letter-spacing: 1px; color: var(--ink-light); cursor: pointer;
  border-radius: 18px; flex-shrink: 0;
  background: var(--surface-input); border: 1px solid var(--border-light);
  transition: all 0.2s;
}
.sticker-group-tab.active {
  background: var(--monet-blue); color: #fff; border-color: var(--monet-blue);
  box-shadow: 0 2px 10px rgba(123,165,184,0.25);
}
.sticker-group-add {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px dashed var(--ink-subtle); color: var(--ink-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; cursor: pointer; flex-shrink: 0;
}

.sticker-library-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 14px; }
.sticker-lib-item {
  aspect-ratio: 1;
  background: var(--surface-card); border-radius: 14px;
  overflow: hidden; position: relative;
  cursor: pointer; border: 2px solid transparent;
  box-shadow: var(--shadow-card);
}
.sticker-lib-item:active { background: var(--surface-page); }
.sticker-lib-item.selected { border-color: var(--monet-blue); }
.sticker-lib-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sticker-lib-empty {
  border: 2px dashed var(--ink-subtle);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--ink-subtle);
}
.sticker-delete-overlay {
  position: absolute; top: 0; right: 0;
  width: 22px; height: 22px; background: rgba(239,68,68,0.9); color: #fff;
  border-radius: 0 0 0 12px; display: none;
  align-items: center; justify-content: center; font-size: 9px;
}
.sticker-lib-item.managing .sticker-delete-overlay { display: flex; }
.sticker-edit-overlay {
  position: absolute; top: 0; right: 0;
  width: 24px; height: 24px; background: rgba(123,165,184,0.9); color: #fff;
  border-radius: 0 0 0 12px; display: none;
  align-items: center; justify-content: center; font-size: 11px;
}
.sticker-lib-item.managing .sticker-edit-overlay { display: flex; }
.sticker-check-circle {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.9); background: rgba(0,0,0,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff; font-weight: 600;
}
.sticker-lib-item.selected .sticker-check-circle {
  background: var(--monet-blue); border-color: var(--monet-blue);
}
.sticker-name-tag {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.55); color: #fff;
  font-size: 9px; font-weight: 300; letter-spacing: 0.5px;
  padding: 2px 4px; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sticker-name-tag.unnamed { color: rgba(255,255,255,0.5); font-style: italic; }

#stickerBottomBar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 10px 16px; padding-bottom: calc(10px + var(--sab));
  border-top: 1px solid var(--border-light);
  z-index: 100; justify-content: space-between; align-items: center;
}
#stickerBottomBar.show { display: flex; }

.multi-select-toolbar {
  display: none; background: var(--surface-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-light);
  padding: 8px 16px; align-items: center; justify-content: space-between;
}
.multi-select-toolbar.show { display: flex; }
.multi-select-count { font-size: 13px; font-weight: 300; letter-spacing: 0.8px; color: var(--ink-light); }
.multi-select-actions { display: flex; gap: 8px; }
.multi-select-btn {
  padding: 7px 14px; border-radius: 14px; font-size: 13px; font-weight: 300;
  letter-spacing: 0.8px; cursor: pointer; border: none;
  background: var(--surface-input); color: var(--ink);
  border: 1px solid var(--border-light);
}
.multi-select-btn.delete { background: rgba(239,68,68,0.08); color: #EF4444; border-color: rgba(239,68,68,0.15); }

/* ═══════ 表情包内嵌选择面板（聊天中弹出） ═══════ */
.sticker-picker {
  background: var(--surface-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-light);
  max-height: 300px; overflow-y: auto; display: none;
}
.sticker-picker.show { display: block; }
.sticker-picker-header {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-light);
}
.sticker-picker-tabs {
  display: flex; gap: 6px; overflow-x: auto; flex: 1;
  -webkit-overflow-scrolling: touch;
}
.sticker-picker-tabs::-webkit-scrollbar { display: none; }
.sticker-picker-tab {
  padding: 6px 14px; font-size: 12px; font-weight: 300;
  letter-spacing: 0.8px; color: var(--ink-light); cursor: pointer;
  border-radius: 14px; flex-shrink: 0; white-space: nowrap;
  background: var(--surface-input); border: 1px solid var(--border-light);
  transition: all 0.2s;
}
.sticker-picker-tab.active {
  background: var(--monet-blue); color: #fff; border-color: var(--monet-blue);
  box-shadow: 0 2px 8px rgba(123,165,184,0.25);
}
.sticker-picker-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; padding: 10px;
}
.sticker-picker-item {
  aspect-ratio: 1;
  background: var(--surface-card); border-radius: 12px;
  overflow: hidden; cursor: pointer;
  border: 1px solid var(--border-light);
}
.sticker-picker-item:active { transform: scale(0.94); }
.sticker-picker-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.sticker-picker-empty {
  grid-column: 1 / -1;
  text-align: center; padding: 30px;
  color: var(--ink-subtle); font-size: 13px; font-weight: 300;
  letter-spacing: 1px;
}
.sticker-picker-manage-btn {
  flex-shrink: 0; padding: 6px 10px; font-size: 11px; font-weight: 300;
  letter-spacing: 0.8px; color: var(--ink-light); cursor: pointer;
  border-radius: 12px; background: var(--surface-input);
  border: 1px solid var(--border-light);
}
.sticker-picker-manage-btn:active { background: var(--surface-page); }

/* ═══════ 表情添加弹窗 ═══════ */
.emoji-modal-tabs { display: flex; border-bottom: 1px solid var(--border-light); margin-bottom: 15px; }
.emoji-modal-tab {
  flex: 1; text-align: center; padding: 10px;
  font-size: 14px; font-weight: 300; letter-spacing: 0.8px;
  color: var(--ink-light); background: none; border: none;
  cursor: pointer; border-bottom: 2px solid transparent;
}
.emoji-modal-tab.active { color: var(--monet-blue); border-bottom-color: var(--monet-blue); }
.sticker-view-container { min-height: 150px; }
