/* Oii space 空白页 · 照搬 https://www.oiioii.tv/space/... */

#space-view.space-page {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: #000;
  color: rgba(255, 255, 255, 0.92);
  overflow: hidden;
  font-family: "MiSans", "PingFang SC", "Helvetica Neue", sans-serif;
}

#space-view.hidden {
  display: none !important;
}

body.space-active .sidebar,
body.space-active #sidebar-expand-btn,
body.space-active .site-footer {
  display: none !important;
}

body.space-active .main {
  margin: 0 !important;
  width: 100% !important;
  max-width: none !important;
  padding: 0 !important;
}

/* ── Top bar ── */
.space-topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  pointer-events: none;
}

.space-topbar > * {
  pointer-events: auto;
}

.space-top-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 40px;
  padding: 0 8px 0 12px;
  border-radius: 999px;
  background: rgba(32, 33, 36, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.space-brand {
  border: none;
  background: transparent;
  color: #ec4899;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.02em;
  cursor: pointer;
  padding: 0 4px 0 2px;
  line-height: 1;
}

.space-project-title {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-weight: 500;
  width: 88px;
  outline: none;
  padding: 4px 2px;
}

.space-top-chevron,
.space-top-icon {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.space-top-chevron:hover,
.space-top-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.space-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.space-publish-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  background: rgba(32, 33, 36, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  cursor: pointer;
}

.space-publish-btn:hover {
  background: rgba(48, 49, 54, 0.95);
}

.space-credits-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(32, 33, 36, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  cursor: pointer;
}

.space-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
}

.space-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Stage / canvas ── */
.space-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.space-canvas {
  position: absolute;
  inset: 0;
  cursor: grab;
  background-color: #000;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 24px 24px;
  overflow: hidden;
  touch-action: none;
}

.space-canvas.is-panning {
  cursor: grabbing;
}

.space-canvas-world {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}

/* 空白引导层（照搬 Oii 中央卡组）— 必须可点，勿用 pointer-events:none 挡住技能卡 */
.space-welcome {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: min(1100px, calc(100% - 48px));
  pointer-events: auto;
}

.space-welcome.hidden {
  display: none !important;
}

/* 打开「添加…」时隐藏卡组（照搬 Oii：只留菜单浮在空画布上） */
.space-welcome.is-adding .space-hint,
.space-welcome.is-adding .space-starters,
.space-welcome.is-adding .space-all-skills {
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

.space-hint {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  white-space: nowrap;
  pointer-events: none;
}

.space-hint-ico {
  color: #fbbf24;
  font-size: 14px;
}

.space-starters {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 14px;
  width: 100%;
  pointer-events: auto;
}

.space-starter-card {
  flex: 1 1 0;
  max-width: 168px;
  min-width: 120px;
  aspect-ratio: 3 / 4;
  border: none;
  border-radius: 22px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  cursor: pointer;
  color: #111;
  font: inherit;
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
  transition: transform 0.18s ease;
}

.space-starter-card:hover {
  transform: translateY(-3px) scale(1.02);
}

.space-starter-card.is-add {
  background: #2a2b2f;
  color: rgba(255, 255, 255, 0.88);
}

.space-starter-card.is-story {
  background:
    linear-gradient(180deg, rgba(20, 12, 40, 0.15), rgba(10, 8, 24, 0.55)),
    url('/images/oii/highlights/story-anime.webp') center/cover;
  color: #fff;
  justify-content: flex-end;
  align-items: flex-start;
  text-align: left;
  padding: 14px;
}

.space-starter-card.is-character {
  background: linear-gradient(165deg, #f5e6a8 0%, #e8c84a 55%, #d4a017 100%);
}

.space-starter-card.is-scene {
  background: linear-gradient(165deg, #9fd4f5 0%, #4aa3e8 50%, #1d7fc7 100%);
}

.space-starter-card.is-prop {
  background: linear-gradient(165deg, #5b6ea8 0%, #2f3f78 55%, #1a2550 100%);
  color: #fff;
}

.space-starter-card.is-product {
  background: linear-gradient(165deg, #e879b8 0%, #c0267a 55%, #9d174d 100%);
  color: #fff;
}

.space-starter-plus {
  font-size: 48px;
  font-weight: 300;
  line-height: 1;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 8px;
}

.space-starter-icon-box {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  line-height: 1;
}

.space-starter-card.is-prop .space-starter-icon-box,
.space-starter-card.is-product .space-starter-icon-box {
  background: rgba(255, 255, 255, 0.14);
}

.space-starter-card strong {
  font-size: 15px;
  font-weight: 700;
}

.space-starter-card.is-story strong {
  font-size: 14px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

.space-starter-dur {
  position: absolute;
  left: 10px;
  top: 10px;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
}

.space-all-skills {
  align-self: flex-end;
  margin-top: -6px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  cursor: pointer;
  pointer-events: auto;
  padding: 4px 2px;
}

.space-all-skills:hover {
  color: #fff;
}

/* frames */
.space-frame {
  position: absolute;
  width: 240px;
  min-height: 160px;
  border-radius: 16px;
  background: #181a21;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  cursor: move;
  user-select: none;
}

.space-frame.is-selected {
  border-color: rgba(168, 85, 247, 0.85);
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.4), 0 16px 40px rgba(0, 0, 0, 0.45);
}

.space-frame-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.space-frame-head button,
.space-frame-close {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.space-frame-close {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 3;
  font-size: 18px;
  line-height: 1;
  padding: 4px;
}

.space-frame-body {
  min-height: 110px;
  padding: 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
  white-space: pre-wrap;
}

.space-frame-body img,
.space-frame-body video {
  width: 100%;
  border-radius: 10px;
  display: block;
  object-fit: cover;
  max-height: 180px;
}

/* Oii 图片/视频生成画框 */
.space-frame-gen {
  width: 420px;
  min-height: auto;
  overflow: visible;
  background: transparent;
  border: none;
  box-shadow: none;
  cursor: default;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.space-frame-gen.is-selected {
  box-shadow: none;
  border: none;
}

.space-gen-media {
  position: relative;
  width: 100%;
  min-height: 260px;
  border-radius: 18px;
  background: #1c1d20;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.space-gen-media.is-drag {
  border-color: rgba(168, 85, 247, 0.65);
}

.space-gen-media img,
.space-gen-media video {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  display: block;
}

.space-gen-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px 20px;
}

.space-gen-illus {
  font-size: 42px;
  opacity: 0.55;
  line-height: 1;
}

.space-gen-upload-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.space-gen-upload-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.space-gen-panel {
  border-radius: 22px;
  background: #1c1d20;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  padding: 12px 14px 12px;
  cursor: default;
}

.space-gen-panel-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.space-gen-ico {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin-top: 4px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

button.space-gen-ico:hover {
  background: rgba(255, 255, 255, 0.08);
}

.space-gen-panel textarea {
  flex: 1;
  min-width: 0;
  border: none;
  resize: none;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  min-height: 44px;
  outline: none;
}

.space-gen-panel textarea::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.space-gen-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.space-gen-tools > button:not(.space-gen-send) {
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.space-gen-tools > button:not(.space-gen-send):hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.space-gen-send {
  margin-left: auto;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: #a855f7;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.space-gen-send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.space-gen-send:not(:disabled):hover {
  filter: brightness(1.08);
}

/* right rail */
.space-rail {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
  border-radius: 999px;
  background: rgba(28, 29, 32, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.space-rail-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  font-size: 16px;
}

.space-rail-btn.primary {
  background: #ec4899;
  color: #fff;
  width: 44px;
  height: 44px;
  font-size: 22px;
}

.space-rail-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.space-rail-btn.primary:hover {
  filter: brightness(1.08);
  background: #ec4899;
}

.space-rail-menu {
  position: absolute;
  right: 58px;
  top: 0;
  min-width: 132px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(28, 29, 32, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.space-rail-menu.hidden {
  display: none !important;
}

.space-rail-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.space-rail-menu button:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* bottom composer — Oii style */
.space-composer-wrap {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 16;
  width: min(720px, calc(100% - 48px));
}

.space-composer {
  display: flex;
  align-items: stretch;
  border-radius: 28px;
  background: #1c1d20;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  min-height: 108px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.space-composer.is-dragover {
  border-color: rgba(236, 72, 153, 0.55);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(236, 72, 153, 0.35);
}

.space-composer-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 14px 8px 12px 16px;
}

#space-brief {
  width: 100%;
  border: none;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  padding: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  line-height: 1.5;
}

#space-brief::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.space-composer-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  padding-top: 10px;
}

.space-tool-chip {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.space-tool-chip:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.space-tool-chip .badge {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #22c55e;
  color: #04120a;
  font-weight: 700;
}

.space-send-btn {
  align-self: flex-end;
  width: 44px;
  height: 44px;
  margin: 0 14px 14px 4px;
  border: none;
  border-radius: 999px;
  background: #ec4899;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.space-send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.space-zoom-bar {
  position: absolute;
  right: 18px;
  bottom: 28px;
  z-index: 16;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(28, 29, 32, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.space-zoom-bar button {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
}

.space-zoom-bar button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

#space-zoom-label {
  min-width: 44px;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.space-ctx {
  position: fixed;
  z-index: 50;
  min-width: 200px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(28, 29, 32, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.space-ctx.hidden {
  display: none !important;
}

.space-ctx button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.space-ctx button:hover {
  background: rgba(236, 72, 153, 0.16);
}

.space-toast {
  position: absolute;
  left: 50%;
  top: 72px;
  transform: translateX(-50%);
  z-index: 30;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 13px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.space-toast.show {
  opacity: 1;
}

.space-tool-sep {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 2px;
  flex-shrink: 0;
}

/* 添加… 弹出菜单 */
.space-add-menu {
  position: fixed;
  z-index: 80;
  min-width: 148px;
  padding: 10px;
  border-radius: 16px;
  background: #1c1d20;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}

.space-add-menu.hidden {
  display: none !important;
}

.space-add-menu-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  padding: 2px 8px 8px;
}

.space-add-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  border-radius: 12px;
  background: #151618;
  color: #fff;
  padding: 11px 12px;
  margin-bottom: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  text-align: left;
}

.space-add-menu-item:last-child {
  margin-bottom: 0;
}

.space-add-menu-item:hover {
  background: #222428;
}

.space-add-ico {
  width: 20px;
  text-align: center;
  opacity: 0.9;
}

/* composer 工具下拉 */
.space-composer-popover {
  position: absolute;
  left: 16px;
  bottom: calc(100% + 10px);
  z-index: 20;
  width: min(360px, 92vw);
  max-height: 320px;
  overflow: auto;
  padding: 8px;
  border-radius: 16px;
  background: #1c1d20;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
}

.space-composer-popover.hidden {
  display: none !important;
}

.space-composer-pop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  text-align: left;
}

.space-composer-pop-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.space-composer-pop-item img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.space-tool-chip.is-open {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* 已选风格：缩略图 + 名称（对齐 Oii） */
.space-tool-chip.is-style-picked {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 3px 8px 3px 4px;
  max-width: 160px;
}

.space-style-chip-thumb {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: #111;
}

.space-style-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  max-width: 96px;
}

.space-style-chip-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 2px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

.space-style-chip-clear:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* 技能 Skills 弹窗 */
.space-skills-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.space-skills-modal.hidden {
  display: none !important;
}

.space-skills-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.space-skills-panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-height: min(72vh, 640px);
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: #1c1d20;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.space-skills-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 8px;
  gap: 12px;
}

.space-skills-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.space-skills-create {
  position: relative;
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  background: #2a2b30;
  color: #fff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.space-skills-create:hover {
  background: #35363c;
}

.space-skills-dot {
  position: absolute;
  top: 2px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
}

.space-skills-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 4px 14px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.space-skills-tabs::-webkit-scrollbar {
  display: none;
}

.space-skills-tab {
  flex: 0 0 auto;
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.space-skills-tab:hover {
  color: rgba(255, 255, 255, 0.85);
}

.space-skills-tab.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.space-skills-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 4px 10px 14px;
}

.space-skills-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: inherit;
  padding: 10px;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.space-skills-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.space-skills-item img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #111;
}

.space-skills-item-body {
  min-width: 0;
  flex: 1;
}

.space-skills-item-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
}

.space-skills-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: #ec4899;
  color: #fff;
}

.space-skills-item-desc {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.space-skills-empty {
  margin: 24px 12px;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
}

/* ── 风格库 modal（照搬 Oii） ── */
.space-styles-modal {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.space-styles-modal.hidden {
  display: none !important;
}

.space-styles-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.space-styles-panel {
  position: relative;
  z-index: 1;
  width: min(860px, 96vw);
  height: min(78vh, 680px);
  max-height: min(78vh, 680px);
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  background: #1c1d20;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.space-styles-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 8px;
  flex-shrink: 0;
}

.space-styles-title-row {
  min-width: 0;
}

.space-styles-head h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.space-styles-logo {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 35%, #f472b6 0 28%, transparent 29%),
    radial-gradient(circle at 70% 35%, #a78bfa 0 28%, transparent 29%),
    radial-gradient(circle at 50% 72%, #60a5fa 0 28%, transparent 29%),
    rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.space-styles-tabs {
  display: flex;
  gap: 2px;
}

.space-styles-tab {
  border: none;
  border-radius: 0;
  padding: 6px 10px 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  position: relative;
}

.space-styles-tab:hover {
  color: rgba(255, 255, 255, 0.85);
}

.space-styles-tab.is-active {
  background: transparent;
  color: #fff;
  font-weight: 650;
}

.space-styles-tab.is-active::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
}

.space-styles-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  width: min(240px, 42vw);
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: #151618;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
}

.space-styles-search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 13px;
  outline: none;
}

.space-styles-search input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.space-styles-cats {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 4px 18px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.space-styles-cats::-webkit-scrollbar {
  display: none;
}

.space-styles-cat {
  flex: 0 0 auto;
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  background: #151618;
  color: rgba(255, 255, 255, 0.55);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.space-styles-cat:hover {
  color: #fff;
}

.space-styles-cat.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.space-styles-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 2px 16px 20px;
  display: grid;
  /* 对齐 Oii：固定 5 列竖卡网格 */
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
  align-items: start;
}

.space-styles-card {
  position: relative;
  display: block;
  width: 100%;
  border: none;
  border-radius: 16px;
  margin: 0;
  overflow: hidden;
  cursor: pointer;
  background: #111214;
  color: #fff;
  font: inherit;
  text-align: left;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  /* 可靠的 3:4 比例：避免 button 高度塌陷导致卡片叠在一起 */
  height: 0 !important;
  padding: 0 0 133.333% !important;
}

.space-styles-card:hover {
  outline: 1px solid rgba(255, 255, 255, 0.22);
  outline-offset: 0;
}

.space-styles-card.is-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: auto !important;
  padding: 0 !important;
  aspect-ratio: 3 / 4;
  background: #222428;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
}

.space-styles-card.is-upload .plus {
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
}

.space-styles-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 0;
  pointer-events: none;
}

.space-styles-card-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 28px 8px 10px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.85));
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.space-styles-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: none;
  line-height: 1.3;
}

.space-styles-badge.is-hot {
  background: #ec4899;
  color: #fff;
}

.space-styles-badge.is-new {
  background: #7c3aed;
  color: #fff;
}

.space-styles-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 12px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
}

@media (max-width: 900px) {
  .space-styles-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  .space-styles-panel {
    width: min(100%, 96vw);
    height: min(84vh, 720px);
  }
}

@media (max-width: 560px) {
  .space-styles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ═══ 爆款复刻 Space · film_trending=1 ═══ */
body.space-trending-mode .space-hint,
body.space-trending-mode #space-starters,
body.space-trending-mode .space-all-skills,
body.space-trending-mode #space-welcome,
body.space-trending-mode .space-composer-wrap,
body.space-trending-mode #space-composer-popover {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* 落地页：大上传框 + 横向滚动热点视频（对标 Oii film_trending） */
.space-trending-landing {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  pointer-events: none;
  width: min(94vw, 760px);
}

.space-trending-landing > * {
  pointer-events: auto;
}

.space-trending-upload-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: min(88vw, 480px);
  height: min(56vw, 340px);
  max-width: 480px;
  max-height: 340px;
  border-radius: 28px;
  border: none;
  background: rgba(38, 40, 46, 0.96);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  transition: background 0.15s, transform 0.15s;
}

.space-trending-upload-card:hover {
  background: rgba(48, 50, 58, 0.98);
  transform: translateY(-1px);
}

.space-trending-upload-ico {
  font-size: 56px;
  opacity: 0.42;
  line-height: 1;
}

.space-trending-upload-btn {
  font-size: 15px;
  font-weight: 650;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.02em;
}

.space-trending-hot {
  width: min(96vw, 820px);
  text-align: center;
}

.space-trending-hot-head {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  padding: 4px 12px 10px;
}

.space-trending-hot-chev {
  font-size: 11px;
  opacity: 0.7;
  margin-left: 2px;
}

.space-trending-hot-scroll {
  position: relative;
  width: 100%;
}

.space-trending-hot-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  justify-content: flex-start;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 4px 8px 12px;
  max-width: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.space-trending-hot-row::-webkit-scrollbar {
  height: 6px;
}

.space-trending-hot-row::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}

.space-trending-hot-row.is-collapsed {
  display: none;
}

.space-trending-hot-item {
  position: relative;
  flex: 0 0 auto;
  width: 220px;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  background: #111;
  transition: border-color 0.15s, transform 0.15s;
}

.space-trending-hot-item:hover {
  border-color: rgba(236, 72, 153, 0.7);
  transform: translateY(-2px);
}

.space-trending-hot-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-60%);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: rgba(20, 22, 28, 0.88);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.space-trending-hot-nav.prev { left: -4px; }
.space-trending-hot-nav.next { right: -4px; }
.space-trending-hot-nav:hover { background: rgba(40, 42, 50, 0.95); }

.space-trending-hot-scroll.is-collapsed,
.space-trending-hot-scroll.is-collapsed .space-trending-hot-nav {
  display: none;
}

.space-trending-hot-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.space-trending-hot-title {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  padding: 8px 10px 20px;
  font-size: 12px;
  font-weight: 650;
  color: #fff;
  text-align: left;
  background: linear-gradient(rgba(0, 0, 0, 0.72), transparent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.space-trending-hot-play {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.space-trending-workflow {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 6;
  cursor: grab;
}

.space-trending-workflow #space-trending-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 2400px;
  height: 1600px;
  transform-origin: 0 0;
}

.space-trending-extract-toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  border-radius: 16px;
  background: rgba(24, 26, 32, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.space-trending-extract-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.space-trending-extract-ico {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #22c55e;
  color: #04120a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.space-trending-tutorial {
  position: fixed;
  right: 24px;
  bottom: 88px;
  z-index: 45;
  width: min(340px, calc(100vw - 48px));
}

.space-trending-tutorial-card {
  background: rgba(22, 24, 30, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 16px 18px 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.space-trending-tutorial-step {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 6px;
}

.space-trending-tutorial-card h4 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.space-trending-tutorial-card p {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.68);
}

.space-trending-tutorial-illus {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.space-trending-tutorial-illus-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 64px;
}

.space-trending-tutorial-illus-thumb {
  width: 64px;
  height: 36px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04)),
    #1a1c22;
  border: 1px solid rgba(255,255,255,0.08);
}

.space-trending-tutorial-illus-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.55);
}

.space-trending-tutorial-illus-line {
  flex: 1;
  height: 0;
  border-top: 1.5px dashed rgba(255, 255, 255, 0.28);
  min-width: 28px;
}

.space-trending-tutorial-illus-node.is-main {
  flex: 1;
  align-items: stretch;
}

.space-trending-tutorial-illus-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 650;
}

.space-trending-tutorial-cue {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}

.space-trending-tutorial-shots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
  max-height: 180px;
  overflow: auto;
}

.space-trending-tutorial-shot {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 6px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.62);
}

.space-trending-tutorial-shot-thumb {
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.space-trending-tutorial-shot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.space-trending-tutorial-ok {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #f472b6, #ec4899);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.space-trending-tutorial-ok:hover {
  filter: brightness(1.06);
}

/* 左下角 Agent：收缩气泡 / 展开左侧对话栏 */
.space-trending-agent {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 44;
  width: min(300px, calc(100vw - 36px));
  border-radius: 16px;
  background: rgba(22, 24, 30, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  transition: width 0.2s ease, height 0.2s ease, top 0.2s ease, bottom 0.2s ease, border-radius 0.2s ease;
}

.space-trending-agent.hidden {
  display: none !important;
}

.space-trending-agent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 6px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
}

.space-trending-agent-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.space-trending-agent-expand,
.space-trending-agent-icon-btn {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 6px;
}

.space-trending-agent-expand:hover,
.space-trending-agent-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.space-trending-agent-hello {
  margin: 0 12px 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.space-trending-agent-body {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 4px 10px 12px;
}

.space-trending-agent-body textarea,
.space-trending-agent-composer textarea {
  flex: 1;
  width: 100%;
  min-height: 44px;
  max-height: 140px;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
}

.space-trending-agent-body textarea::placeholder,
.space-trending-agent-composer textarea::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.space-trending-agent-send {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #f472b6, #ec4899);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.space-trending-agent-send:hover {
  filter: brightness(1.06);
}

/* 展开：左侧全高对话栏（对标图2） */
.space-trending-agent.is-expanded {
  top: 64px;
  bottom: 18px;
  left: 14px;
  width: min(380px, calc(100vw - 28px));
  border-radius: 18px;
  display: flex;
  flex-direction: column;
}

.space-trending-agent.is-expanded .space-trending-agent-head {
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.space-trending-agent-expanded {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.space-trending-agent-expanded.hidden,
.space-trending-agent-collapsed.hidden,
.space-trending-agent-icon-btn.hidden {
  display: none !important;
}

.space-trending-agent-messages {
  flex: 1;
  overflow: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.space-trending-agent-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  line-height: 1.55;
}

.space-trending-agent-msg.is-user {
  align-self: flex-end;
  background: rgba(236, 72, 153, 0.22);
}

.space-trending-agent-composer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 12px 12px;
  background: rgba(0, 0, 0, 0.18);
}

.space-trending-agent-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}

.space-trending-agent-tool {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.space-trending-agent-tool:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.space-trending-agent-tools .space-trending-agent-send {
  margin-left: auto;
}

/* 教程：上传演示 / 替换网格（对标图4） */
.space-trending-tutorial-demo {
  margin-bottom: 10px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px;
}

.space-trending-tutorial-demo-frame {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #111;
}

.space-trending-tutorial-demo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.space-trending-tutorial-demo-btn {
  position: absolute;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 650;
}

.space-trending-tutorial-demo-cursor {
  position: absolute;
  left: 58%;
  top: 62%;
  font-size: 18px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

.space-trending-tutorial-demo-caption {
  margin-top: 8px;
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 650;
}

.space-trending-tutorial-replace {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.space-trending-tutorial-replace-card {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  cursor: default;
  text-align: left;
  color: rgba(255, 255, 255, 0.75);
}

.space-trending-tutorial-replace-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #111;
}

.space-trending-tutorial-replace-card span {
  display: block;
  padding: 4px 6px 6px;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.space-trending-tutorial-replace-card.is-hint {
  outline: 1px solid rgba(236, 72, 153, 0.55);
}

.space-trending-tutorial-tip {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 999px;
  background: #ec4899;
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(236, 72, 153, 0.45);
  pointer-events: none;
}

@media (max-width: 900px) {
  .space-starters {
    flex-wrap: wrap;
    justify-content: center;
  }
  .space-starter-card {
    flex: 0 0 calc(33.33% - 12px);
    max-width: 140px;
  }
  .space-hint {
    white-space: normal;
    text-align: center;
    max-width: 90vw;
  }
  .space-trending-hot-item {
    width: 168px;
    height: auto;
    aspect-ratio: 16 / 9;
  }
  .space-trending-upload-card {
    width: min(90vw, 360px);
    height: min(58vw, 260px);
  }
  .space-trending-tutorial {
    right: 12px;
    left: auto;
    width: min(300px, calc(100vw - 24px));
    bottom: 96px;
  }
  .space-trending-agent {
    left: 12px;
    bottom: 12px;
    width: min(280px, calc(100vw - 24px));
  }
  .space-trending-agent.is-expanded {
    top: 56px;
    width: min(100vw - 24px, 360px);
  }
}

