/* ============================================================================
   MTing OS — Immersive Sticker Theatre, Character Lab & WeChat Picker (`os-stickers.css`)
   ============================================================================ */

html[data-os="macos"] .os-window:has(.stk-studio) {
  background: #14151A;
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 28px 68px rgba(0, 0, 0, 0.50), inset 0 0.5px 0 rgba(255, 255, 255, 0.20);
}

/* ---------- 1. Desktop Split Sticker Studio (`macOS` & `Windows`) ---------- */
.stk-studio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 348px;
  width: 100%;
  height: 100%;
  background: #F5F5F8;
  color: #1D1D1F;
  overflow: hidden;
  user-select: none;
}
html[data-appearance="dark"] .stk-studio {
  background: #15161B;
  color: #F5F5F7;
}
.stk-studio.win {
  background: #F6F7FA;
  color: #1B1B1B;
}

.stk-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 0.5px solid rgba(128, 128, 136, 0.20);
}

.stk-topbar {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 0.5px solid rgba(128, 128, 136, 0.16);
  flex-shrink: 0;
}
.stk-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}
.stk-brand img {
  width: 18px;
  height: 18px;
}

.stk-seg {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(120, 120, 128, 0.14);
}
.stk-seg-btn {
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.68;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.stk-seg-btn.active {
  opacity: 1;
  background: #FFFFFF;
  color: #1D1D1F;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
}
html[data-appearance="dark"]:not([data-os="windows"]) .stk-seg-btn.active {
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
}

/* 3-Tone Chat Backdrop Switcher */
.stk-bg-tones {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
}
.stk-bg-tones > span {
  opacity: 0.56;
}
.stk-tone-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(128, 128, 136, 0.35);
  cursor: pointer;
  padding: 0;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.stk-tone-dot.wechat { background: #EAEAEA; }
.stk-tone-dot.dark { background: #14151B; }
.stk-tone-dot.white { background: #FFFFFF; }
.stk-tone-dot.active {
  transform: scale(1.14);
  border-color: #07C160;
  box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.28);
}

.stk-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 18px 24px;
}

/* Album Pill Tabs */
.stk-pack-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.stk-pack-tabs::-webkit-scrollbar { display: none; }
.stk-pack-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 13px 0 7px;
  border-radius: 999px;
  border: 1px solid rgba(128, 128, 136, 0.20);
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.18s ease;
}
html[data-appearance="dark"]:not([data-os="windows"]) .stk-pack-tab {
  background: rgba(255, 255, 255, 0.06);
}
.stk-pack-tab img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(128, 128, 136, 0.12);
}
.stk-pack-tab small {
  opacity: 0.55;
  font-size: 11px;
}
.stk-pack-tab.active {
  background: #07C160;
  border-color: #07C160;
  color: #FFFFFF;
  box-shadow: 0 6px 16px rgba(7, 193, 96, 0.26);
}
.stk-pack-tab.active small { opacity: 0.88; }

/* Official 750x400 Cinema Hero Banner */
.stk-hero-banner {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 750 / 310;
  margin-bottom: 14px;
  background: #1A1C24;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}
.stk-hero-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  display: block;
}
.stk-hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(8, 10, 14, 0.06) 0%,
    rgba(8, 10, 14, 0.18) 45%,
    rgba(8, 10, 14, 0.86) 100%
  );
}
.stk-hero-meta {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 13px;
  color: #FFFFFF;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.stk-hero-meta h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.stk-hero-meta p {
  margin: 3px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
}
.stk-hero-wx-btn {
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  border: none;
  background: #07C160;
  color: #FFFFFF;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.30);
}
.stk-hero-wx-btn:hover { filter: brightness(1.06); }

/* Animated Sticker Grid (Backdrop-Aware!) */
.stk-stage-surface {
  border-radius: 18px;
  padding: 14px;
  transition: background 0.22s ease, color 0.22s ease;
}
.stk-stage-surface.tone-wechat {
  background: #EDEDED;
  color: #191919;
  border: 0.5px solid rgba(0, 0, 0, 0.06);
}
.stk-stage-surface.tone-dark {
  background: #121318;
  color: #F2F2F7;
  border: 0.5px solid rgba(255, 255, 255, 0.10);
}
.stk-stage-surface.tone-white {
  background: #FFFFFF;
  color: #1D1D1F;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
}

.stk-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 10px;
}
.stk-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 6px 8px;
  border-radius: 14px;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s cubic-bezier(0.22, 1.3, 0.36, 1), background 0.16s ease;
}
.stk-cell:hover {
  transform: translateY(-3px) scale(1.05);
  background: rgba(128, 128, 136, 0.12);
}
.stk-cell.selected {
  background: rgba(7, 193, 96, 0.14);
  box-shadow: inset 0 0 0 1.5px #07C160;
}
.stk-cell img {
  width: 92px;
  height: 92px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
.stk-cell span {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.82;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ---------- 2. Right Column: Spotlight + Live WeChat Battle Stage ---------- */
.stk-battle-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: rgba(255, 255, 255, 0.55);
}
html[data-appearance="dark"]:not([data-os="windows"]) .stk-battle-col {
  background: rgba(24, 25, 32, 0.85);
}

.stk-spot-box {
  padding: 12px 14px;
  border-bottom: 0.5px solid rgba(128, 128, 136, 0.18);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.stk-spot-preview {
  width: 78px;
  height: 78px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.stk-spot-preview.tone-wechat { background: #EDEDED; }
.stk-spot-preview.tone-dark { background: #121318; border: 0.5px solid rgba(255,255,255,0.12); }
.stk-spot-preview.tone-white { background: #FFFFFF; border: 0.5px solid rgba(0,0,0,0.08); }
.stk-spot-preview img {
  width: 68px;
  height: 68px;
  object-fit: contain;
}
.stk-spot-info {
  flex: 1;
  min-width: 0;
}
.stk-spot-info b {
  display: block;
  font-size: 15px;
  font-weight: 700;
}
.stk-spot-info small {
  display: block;
  font-size: 11px;
  opacity: 0.58;
  margin: 2px 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stk-spot-actions {
  display: flex;
  gap: 6px;
}
.stk-act-pill {
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 0.5px solid rgba(128, 128, 136, 0.28);
  background: transparent;
  color: inherit;
  text-decoration: none;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.stk-act-pill.green {
  background: #07C160;
  border-color: #07C160;
  color: #FFF;
}

.stk-battle-hd {
  height: 34px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  opacity: 0.68;
  border-bottom: 0.5px solid rgba(128, 128, 136, 0.12);
  flex-shrink: 0;
}
.stk-battle-clear {
  border: none;
  background: transparent;
  color: #07C160;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.stk-battle-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background 0.2s ease;
}
.stk-battle-feed.tone-wechat { background: #EDEDED; color: #191919; }
.stk-battle-feed.tone-dark { background: #111216; color: #EAEAEA; }
.stk-battle-feed.tone-white { background: #F9F9FB; color: #191919; }

.stk-bmsg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.stk-bmsg.me {
  flex-direction: row-reverse;
}
.stk-bmsg-av {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
}
.stk-bmsg-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-width: 220px;
}
.stk-bmsg.me .stk-bmsg-body {
  align-items: flex-end;
}
.stk-bmsg-gif {
  width: 104px;
  height: 104px;
  object-fit: contain;
  display: block;
}
.stk-bmsg-txt {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.4;
  background: #FFFFFF;
  color: #191919;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.stk-battle-feed.tone-dark .stk-bmsg-txt {
  background: #26272E;
  color: #F2F2F7;
}
.stk-bmsg.me .stk-bmsg-txt {
  background: #95EC69;
  color: #0B1905;
}

/* ---------- 3. Original Character Concept Lab (`角色手稿 · 21款`) ---------- */
.stk-lab-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.stk-lab-list.mob {
  grid-template-columns: 1fr;
}
.stk-lab-card {
  border-radius: 18px;
  padding: 13px;
  background: #FFFFFF;
  border: 0.5px solid rgba(128, 128, 136, 0.16);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
html[data-appearance="dark"]:not([data-os="windows"]) .stk-lab-card {
  background: rgba(34, 35, 44, 0.92);
  border-color: rgba(255, 255, 255, 0.10);
}
.stk-lab-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.stk-lab-top b {
  font-size: 15px;
  font-weight: 800;
}
.stk-lab-top small {
  font-size: 11px;
  opacity: 0.55;
}
.stk-lab-media {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 8px;
  align-items: stretch;
}
.stk-lab-sheet {
  border-radius: 12px;
  overflow: hidden;
  background: #FFFFFF;
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  aspect-ratio: 1;
  cursor: zoom-in;
}
.stk-lab-sheet img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.stk-lab-gifbox {
  border-radius: 12px;
  background: #EDEDED;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  cursor: pointer;
  position: relative;
}
.stk-stage-dark .stk-lab-gifbox,
html[data-appearance="dark"]:not([data-os="windows"]) .stk-lab-gifbox {
  background: #16171E;
}
.stk-lab-gifbox img {
  width: 86%;
  aspect-ratio: 1;
  object-fit: contain;
}
.stk-lab-gifbox span {
  font-size: 10.5px;
  font-weight: 700;
  color: #07C160;
  margin-top: 4px;
}
.stk-lab-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.stk-lab-tags i {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(120, 120, 128, 0.12);
  opacity: 0.85;
}
.stk-lab-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  opacity: 0.72;
}

/* Zoom Modal for 4-Pose Character Sheet */
#stk-sheet-lightbox {
  position: fixed;
  inset: 0;
  z-index: 26800;
  background: rgba(8, 9, 12, 0.86);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}
#stk-sheet-lightbox.open { display: flex; }
#stk-sheet-lightbox img {
  max-width: min(90vw, 720px);
  max-height: 86vh;
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.65);
  background: #FFF;
}

/* ---------- 4. Mobile Sticker Studio (`iOS 26` & `Android 16`) ---------- */
.stk-mob {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #F4F4F7;
  color: #1D1D1F;
  overflow: hidden;
}
html[data-appearance="dark"] .stk-mob {
  background: #0C0D12;
  color: #F5F5F7;
}
.stk-mob-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: calc(var(--sys-top, 48px) + 8px) 14px calc(var(--sys-bottom, 24px) + 128px);
}
.stk-mob-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.stk-mob-head h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.stk-mob .stk-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 8px;
}
.stk-mob .stk-cell img {
  width: 82px;
  height: 82px;
}

/* Mobile Floating Live Battle Mini-Tray at Bottom */
.stk-mob-dock {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(var(--sys-bottom, 20px) + 6px);
  z-index: 25;
  border-radius: 22px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(26px) saturate(185%);
  -webkit-backdrop-filter: blur(26px) saturate(185%);
  border: 0.5px solid rgba(0, 0, 0, 0.10);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  gap: 10px;
}
html[data-appearance="dark"] .stk-mob-dock {
  background: rgba(28, 29, 36, 0.90);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.52);
}
.stk-mob-dock-pair {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.stk-mob-dock-pair img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(128, 128, 136, 0.12);
  padding: 2px;
}
.stk-mob-dock-txt {
  flex: 1;
  min-width: 0;
}
.stk-mob-dock-txt b {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #07C160;
}
.stk-mob-dock-txt small {
  display: block;
  font-size: 11.5px;
  opacity: 0.82;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 5. Built-In WeChat Custom Sticker Picker Drawer ---------- */
.wx-d-main {
  position: relative;
}
.wx-stk-picker {
  background: #F6F6F6;
  border-top: 0.5px solid #DCDCDC;
  display: flex;
  flex-direction: column;
  height: 236px;
  flex-shrink: 0;
  user-select: none;
}
html[data-appearance="dark"] .wx-stk-picker {
  background: #1E1E1E;
  border-top-color: #2E2E2E;
}
.wx-stk-picker.desktop {
  position: absolute;
  left: 10px;
  bottom: 132px;
  width: 356px;
  height: 268px;
  border-radius: 10px;
  border: 0.5px solid rgba(0, 0, 0, 0.14);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
  z-index: 40;
  overflow: hidden;
}
html[data-appearance="dark"] .wx-stk-picker.desktop {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.60);
}
.wx-stk-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 8px;
}
.wx-stk-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px;
  border-radius: 8px;
  cursor: pointer;
}
.wx-stk-item:hover {
  background: rgba(128, 128, 136, 0.14);
}
.wx-stk-item img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}
.wx-stk-item span {
  font-size: 10.5px;
  opacity: 0.65;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.wx-stk-tabs {
  height: 40px;
  padding: 0 8px;
  background: rgba(0, 0, 0, 0.04);
  border-top: 0.5px solid rgba(128, 128, 136, 0.16);
  display: flex;
  align-items: center;
  gap: 6px;
}
.wx-stk-tab {
  width: 34px;
  height: 30px;
  border-radius: 6px;
  border: none;
  background: transparent;
  padding: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wx-stk-tab.active {
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.10);
}
html[data-appearance="dark"] .wx-stk-tab.active {
  background: #2E2E2E;
}
.wx-stk-tab img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}
#pocket-sheet .wx-composer:has(+ .wx-stk-picker) {
  padding-bottom: 8px;
}
.wx-stk-picker.mobile {
  height: calc(238px + var(--sys-bottom, 20px));
}
.wx-stk-picker.mobile .wx-stk-tabs {
  height: calc(40px + var(--sys-bottom, 20px));
  padding-bottom: var(--sys-bottom, 20px);
  box-sizing: border-box;
}
