/* QWQ 表情包库：父级使用两列表情分组封面；分组内仍保留四列表情目录。 */
#page-sticker-library,
#page-sticker-group {
  --sticker-card-radius: 17px;
  --sticker-info-height: 48px;
}

.sticker-library-menu {
  position: absolute;
  top: calc(100% - 4.4px);
  right: 0;
  z-index: var(--layer-popover);
  width: min(132px, 44vw);
  padding: 4.4px;
  border: 1px solid var(--ui-line);
  border-radius: 15.4px;
  background: var(--parent-card-bg);
  box-shadow: 0 11px 26.4px rgba(0,0,0,.11);
}
.sticker-library-menu[hidden] { display: none; }
.sticker-library-menu-item {
  position: relative;
  width: 100%;
  min-height: 35.2px;
  padding: 5.5px 6.6px;
  border: 0;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 6.6px;
  background: transparent;
  color: var(--parent-text);
  font-size: calc(11.55px * var(--display-scale));
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, background-color .16s ease;
}
.sticker-library-menu-item:hover { background: var(--ui-surface-secondary); }
.sticker-library-menu-item:active { transform: scale(.97); }
.sticker-library-menu-item + .sticker-library-menu-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 26.4px;
  right: 5.5px;
  height: 1px;
  background: var(--ui-line);
  opacity: .48;
}
.sticker-library-menu-item svg { width: 13.2px; height: 13.2px; flex: 0 0 13.2px; }

/* 父级目录只展示每组第一张表情：两列圆角矩形，不再拼四宫格或波浪信息卡。 */
.sticker-pack-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 14px;
  align-items: start;
}
.sticker-pack-card {
  position: relative;
  min-width: 0;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  color: var(--parent-text);
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  transition: transform .16s ease, opacity .16s ease;
  -webkit-tap-highlight-color: transparent;
}
.sticker-pack-card:active { transform: scale(.975); }
.sticker-pack-card.is-selected { opacity: .62; }
.sticker-pack-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 1.42 / 1;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--ui-line) 78%, transparent);
  border-radius: 19px;
  background: var(--parent-card-bg);
  box-shadow: 0 6px 18px rgba(0,0,0,.055);
}
.sticker-pack-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 50%;
}
.sticker-pack-preview.is-empty {
  color: color-mix(in srgb, var(--ui-muted) 72%, transparent);
  background: var(--ui-surface-secondary);
}
.sticker-pack-preview.is-empty svg,
.sticker-pack-preview.is-empty [data-lucide] {
  width: 24px;
  height: 24px;
  stroke-width: 1.4;
}
.sticker-pack-info {
  min-width: 0;
  padding: 9px 3px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  background: transparent;
  color: var(--parent-text);
}
.sticker-pack-name {
  min-width: 0;
  overflow: hidden;
  font-size: calc(12.5px * var(--display-scale));
  font-weight: 720;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.sticker-pack-count {
  color: var(--ui-muted);
  font-size: calc(10px * var(--display-scale));
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}
.sticker-pack-select,
.sticker-item-select {
  position: absolute;
  z-index: 5;
  width: 21px;
  height: 21px;
  margin: 0;
  accent-color: #000;
  pointer-events: none;
}
.sticker-pack-select { top: 7px; right: 7px; }

.sticker-group-directory {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 8px;
  align-content: start;
}
.sticker-item-card {
  position: relative;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--parent-text);
  text-align: center;
  cursor: pointer;
  transition: transform .16s ease, opacity .16s ease;
  -webkit-tap-highlight-color: transparent;
}
.sticker-item-card:active { transform: scale(.96); }
.sticker-item-card.is-selected { opacity: .62; }
.sticker-item-preview {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--ui-line);
  border-radius: 15px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--parent-card-bg);
  box-shadow: var(--global-section-shadow);
}
.sticker-item-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}
.sticker-modal-preview {
  width: 100%;
  max-height: 42vh;
  display: block;
  object-fit: contain;
  border-radius: 16px;
}
.sticker-item-name {
  margin-top: 7px;
  padding: 0 3px;
  overflow: hidden;
  color: var(--ui-muted);
  font-size: calc(10.8px * var(--display-scale));
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sticker-item-select { top: 7px; right: 7px; }

.sticker-empty {
  margin: auto;
  padding: 42px 20px;
  color: var(--ui-muted);
  font-size: calc(13px * var(--display-scale));
  line-height: 1.65;
  text-align: center;
}

.sticker-manage-toolbar {
  position: absolute;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: var(--layer-popover);
  width: min(calc(100% - (var(--global-page-inline) * 2)), 560px);
  padding: 8px;
  border: 1px solid var(--ui-line);
  border-radius: 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  background: color-mix(in srgb, var(--parent-card-bg) 92%, transparent);
  box-shadow: 0 14px 34px rgba(0,0,0,.15);
  backdrop-filter: blur(18px) saturate(118%);
  -webkit-backdrop-filter: blur(18px) saturate(118%);
  transform: translateX(-50%);
}
.sticker-manage-toolbar .ui-action-button {
  min-height: 42px;
  padding: 8px 6px;
  border-radius: 15px;
  gap: 5px;
  font-size: calc(11px * var(--display-scale));
}
.sticker-manage-toolbar .ui-action-button svg { width: 13px; height: 13px; }
.sticker-page-list.has-management-toolbar { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }

.sticker-import-help {
  margin: 0 0 10px;
  color: var(--ui-muted);
  font-size: calc(11px * var(--display-scale));
  line-height: 1.55;
}
.sticker-bulk-input {
  width: 100%;
  min-height: 210px;
  padding: 13px 14px;
  border: 1px solid var(--ui-line);
  border-radius: 17px;
  outline: none;
  resize: vertical;
  background: var(--ui-surface-secondary);
  color: var(--parent-text);
  font: inherit;
  font-size: calc(12px * var(--display-scale));
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
}
.sticker-bulk-input:focus { border-color: color-mix(in srgb, var(--parent-text) 48%, var(--ui-line)); }
.sticker-import-error {
  min-height: 18px;
  margin: 7px 2px 0;
  color: #b3261e;
  font-size: calc(10.5px * var(--display-scale));
  line-height: 1.4;
}

/* 聊天中的表情包选择器：使用全局抽屉容器，不创建第二套弹窗皮肤。 */
.sticker-picker-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 1px 0 10px;
}
.sticker-picker-tab {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  background: var(--parent-card-bg);
  color: var(--parent-text);
  font-size: calc(11px * var(--display-scale));
  font-weight: 650;
}
.sticker-picker-tab.is-active { background: var(--parent-text); color: var(--parent-card-bg); border-color: var(--parent-text); }
.sticker-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
}
.sticker-picker-item {
  min-width: 0;
  padding: 4px;
  border: 0;
  border-radius: 15px;
  background: var(--ui-surface-secondary);
  color: var(--parent-text);
}
.sticker-picker-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
}
.sticker-picker-item span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  font-size: calc(9.5px * var(--display-scale));
  white-space: nowrap;
  text-overflow: ellipsis;
}

.qq-chat-sticker-bubble {
  width: min(164px, 44vw);
  padding: 6px;
  border-radius: 18px;
  background: transparent;
}
.qq-chat-sticker-bubble img {
  width: 100%;
  max-height: 176px;
  display: block;
  object-fit: contain;
}
.qq-chat-sticker-caption {
  margin-top: 4px;
  color: var(--ui-muted);
  font-size: 10px;
  line-height: 1.3;
  text-align: center;
}

@media (max-width: 350px) {
  .sticker-pack-grid,
  .sticker-group-directory { gap: 10px 6px; }
  .sticker-pack-info { padding-left: 6px; padding-right: 6px; }
}
