@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&family=Noto+Serif+SC:wght@400;700&family=Playfair+Display:wght@400;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  -webkit-overscroll-behavior-x: none;
}

:root {
  --scene-hue: 260;
  --scene-bg: hsl(260, 15%, 6%);
  --scene-accent: hsl(260, 70%, 55%);
  --scene-bubble: hsla(260, 40%, 15%, 0.5);
  --scene-text: hsl(260, 50%, 75%);
  --scene-glow: hsla(260, 80%, 50%, 0.12);
  --user-gradient: linear-gradient(135deg, #e5e2e1, rgba(229,226,225,0.85));
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

body {
  font-family: 'Noto Sans SC', sans-serif;
  background: #0e0e0e;
  color: #e0e0e0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  touch-action: pan-y; /* 只允许垂直滚动，禁止水平滑动和缩放 */
  -ms-touch-action: pan-y;
  overscroll-behavior-x: none;
  -webkit-overscroll-behavior-x: none;
}

/* ==================== 通用 ==================== */
.hidden { display: none !important; }

/* ==================== 视图切换 ==================== */
.view {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.view.active {
  opacity: 1;
  pointer-events: auto;
}

/* ==================== 转场遮罩 ==================== */
.transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.transition-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ==================== Toast ==================== */
.toast-container {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  max-width: 480px;
  margin: 0 auto;
  pointer-events: none;
}
.toast {
  background: rgba(30, 30, 50, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  color: #e0e0e0;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  max-width: 100%;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.2s forwards;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* 登录引导弹层 */
.login-prompt-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-prompt-overlay.hidden { display: none; }
.login-prompt-card {
  width: 100%;
  max-width: 360px;
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 28px 24px;
}
.login-prompt-card h3 {
  font-size: 18px;
  color: #e5e2e1;
  margin-bottom: 10px;
  font-weight: 600;
}
.login-prompt-card p {
  font-size: 14px;
  color: rgba(255,255,255,0.55);
  line-height: 1.65;
  margin-bottom: 22px;
}
.login-prompt-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.login-prompt-primary {
  display: block;
  text-align: center;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  color: #2a2827;
  background: #e5e2e1;
  border-radius: 12px;
  text-decoration: none;
}
.login-prompt-secondary {
  padding: 12px;
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
}
.login-prompt-secondary:hover {
  background: rgba(255,255,255,0.04);
}

.profile-anon-hint {
  font-size: 12px;
  color: rgba(251, 191, 36, 0.85);
  margin-top: 6px;
  line-height: 1.5;
}

/* ==================== 场景大厅 ==================== */
.lobby-container {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0 16px 32px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #131313;
}

/* 顶部导航栏 */
.lobby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(16px + var(--safe-top)) 0 20px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(180deg, #131313cc 0%, #13131300 100%);
  backdrop-filter: blur(6px);
}
.lobby-header-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.brand-title {
  font-family: 'Playfair Display', 'Noto Serif SC', serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 40px;
  letter-spacing: 0;
  color: #e5e2e1;
}
.brand-sub {
  font-size: 10px;
  line-height: 15px;
  letter-spacing: 2px;
  color: #c4c7c7;
  text-transform: uppercase;
}
.lobby-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: none;
  background: rgba(255,255,255,0.06);
  color: #e0e0e0;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.header-icon-btn:hover { background: rgba(255,255,255,0.1); }

/* 搜索 */
.search-wrap {
  width: 100%;
  max-width: 400px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #ffffff0d;
  border-radius: 9999px;
  background: #12121299;
  padding: 9px 19px;
  backdrop-filter: blur(10px);
}
.search-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  color: #e0e0e0;
  font-size: 16px;
  outline: none;
  letter-spacing: 0;
}
.search-wrap input::placeholder { color: #c4c7c766; }
.search-wrap .search-icon {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  color: #c4c7c766;
}

/* 场景卡片网格 */
.scene-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 24px;
}

.scene-card {
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #ffffff1a;
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1), box-shadow 0.25s ease, border-color 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  background: transparent;
  display: flex;
  flex-direction: column;
}
.scene-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,0.12);
}
.scene-card:active { transform: translateY(0) scale(0.98); }


.scene-card-visual {
  flex: 1;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center top;
  padding: 12px;
}
.scene-card-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    #0a0a0acc 0%,
    #0a0a0a66 12%,
    #0a0a0a22 28%,
    #0a0a0a00 40%
  );
  z-index: 1;
}
.scene-card-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.scene-card-category {
  line-height: 12px;
  letter-spacing: 0.4px;
  color: #d0bcffcc;
  font-size: 8px;
  text-transform: uppercase;
}
.scene-card-name {
  line-height: 18px;
  letter-spacing: 0;
  color: #e5e2e1;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Playfair Display', 'Noto Serif SC', serif;
}
.scene-card-tagline {
  line-height: 14px;
  letter-spacing: 0;
  color: #c4c7c7cc;
  font-size: 10px;
}

.scene-card-meta {
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  gap: 6px;
  padding-top: 6px;
  padding-bottom: 10px;
}
.scene-card-agents {
  display: inline-flex;
  align-items: flex-start;
}
.scene-agent-stack {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 9999px;
  border: 1px solid #ffffff1a;
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}
.scene-agent-stack:not(:first-child) { margin-left: -6px; }
.scene-agent-more {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: -6px;
  border: 1px solid #ffffff1a;
  border-radius: 9999px;
  background: #2a2a2a;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  font-size: 7px;
  font-weight: 500;
  color: #e5e2e1;
}
.scene-card-user-count {
  display: flex;
  align-items: center;
  padding-bottom: 1px;
  height: 14px;
}
.scene-card-user-count span {
  line-height: 14px;
  letter-spacing: 0;
  color: #c4c7c7;
  font-size: 9px;
  font-weight: 500;
}

.scene-card-enter {
  display: flex;
  align-items: center;
  align-self: stretch;
  justify-content: center;
  border-radius: 32px;
  background: #e5e2e1;
  padding-top: 6px;
  padding-bottom: 6px;
  margin-top: 8px;
}
.scene-card-enter span {
  line-height: 15px;
  letter-spacing: 0.5px;
  color: #2a2827;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

/* 底部信息 */
.lobby-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: stretch;
  padding-top: 56px;
  padding-bottom: 32px;
  gap: 16px;
  margin-top: auto;
}
.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #ffffff0d;
  border-radius: 9999px;
  background: #12121299;
  padding: 7px 15px;
  backdrop-filter: blur(10px);
}
.footer-dot {
  flex-shrink: 0;
  border-radius: 9999px;
  background: #d0bcff;
  width: 6px;
  height: 6px;
}
.footer-badge span:last-child {
  line-height: 15px;
  letter-spacing: 0;
  color: #c4c7c7;
  font-size: 10px;
}
.footer-nav {
  display: inline-flex;
  align-items: flex-start;
  align-self: stretch;
  justify-content: center;
  gap: 24px;
}
.footer-nav a {
  flex-shrink: 0;
  align-self: stretch;
  line-height: 15px;
  letter-spacing: 0;
  color: #c4c7c7;
  font-size: 10px;
  text-decoration: none;
  transition: opacity 0.2s;
}
.footer-nav a:hover { opacity: 0.7; }
.footer-copy {
  flex-shrink: 0;
  opacity: 0.4;
  line-height: 12px;
  letter-spacing: 2.4px;
  color: #8e9192;
  font-size: 8px;
  text-transform: uppercase;
}

/* ==================== 对话剧场 ==================== */

/* 顶栏 */
.chat-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(16px + var(--safe-top)) calc(16px + var(--safe-right)) 16px calc(16px + var(--safe-left));
  background: linear-gradient(180deg, #131313cc 0%, #13131300 100%);
  backdrop-filter: blur(6px);
  z-index: 10;
  position: sticky;
  top: 0;
}
.chat-header-left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  color: #e0e0e0;
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.header-scene-info {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
}
.header-scene-name {
  font-family: 'Playfair Display', 'Noto Serif SC', serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 30px;
  letter-spacing: -0.6px;
  color: #c9c6c5;
}
.chat-privacy-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(134,239,172,0.95);
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.28);
  border-radius: 999px;
  border-style: solid;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.4;
  max-width: 100%;
  text-align: left;
}
.chat-privacy-badge:hover {
  filter: brightness(1.08);
}
.chat-privacy-badge.mode-client {
  color: rgba(134,239,172,0.95);
  background: rgba(34,197,94,0.12);
  border-color: rgba(34,197,94,0.28);
}
.chat-privacy-badge.mode-ephemeral {
  color: rgba(251,191,36,0.95);
  background: rgba(251,191,36,0.1);
  border-color: rgba(251,191,36,0.32);
}
.chat-privacy-badge.mode-server {
  color: rgba(196,181,253,0.9);
  background: rgba(139,92,246,0.12);
  border-color: rgba(139,92,246,0.28);
}
.header-scene-tagline {
  font-size: 10px;
  line-height: 15px;
  letter-spacing: 2px;
  color: #c4c7c7;
  text-transform: uppercase;
}
.chat-header-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
#agentsToggle { display: none; }
.header-btn-director.active,
.director-mode .header-btn-director {
  background: rgba(139, 92, 246, 0.3);
  border-color: rgba(139, 92, 246, 0.45);
  color: #c4b5fd;
}
.header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ffffff14;
  border-radius: 9999px;
  background: #12121299;
  width: 40px;
  height: 40px;
  backdrop-filter: blur(10px);
  color: #e0e0e0;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.header-btn:hover { background: rgba(255,255,255,0.1); }

/* 角色 Drawer */
.agents-drawer { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.agents-drawer.open { pointer-events: auto; }
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.3s;
}
.agents-drawer.open .drawer-backdrop { opacity: 1; }

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  background: #12121299;
  border-left: 1px solid #ffffff1a;
  backdrop-filter: blur(10px);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.agents-drawer.open .drawer-panel { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 36px 25px 24px;
  border-bottom: none;
}

.drawer-title {
  font-family: 'Playfair Display', 'Noto Serif SC', serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 32px;
  color: #e5e2e1;
}

.agents-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 25px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.agent-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  border: 1px solid #4447484d;
  border-radius: 16px;
  background: #201f1f66;
  padding: 14px 16px;
}
.agent-card-user {
  border-color: #571bc133;
  background: #571bc10d;
}
.agent-avatar-user {
  border: 1px solid #c9c6c54d;
  background: #12121299;
  backdrop-filter: blur(10px);
}
.agent-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.agent-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.agent-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: #e5e2e1;
  min-width: 0;
  flex: 1;
}
.agent-desc {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(196,199,199,0.92);
  margin: 0;
  padding: 0 2px;
  word-break: break-word;
}

.agent-whisper-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 8px 0;
  border-radius: 32px;
  border: none;
  background: #571bc133;
  color: #d0bcff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.agent-whisper-btn:hover { background: #571bc166; }

.drawer-actions {
  padding: 23px 25px 25px;
  border-top: 1px solid #44474833;
}
.drawer-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 15px;
  border-radius: 9999px;
  border: 1px solid #ffb4ab4d;
  background: transparent;
  color: #ffb4ab;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.drawer-btn:hover { background: rgba(255,180,171,0.08); }

/* 聊天区域 */
.chat-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  position: relative;
  -webkit-overflow-scrolling: touch;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  transition: background-image 0.6s ease;
}
/* 有背景图时隐藏旧氛围光晕 */
.chat-area.has-bg .atmosphere-glow { display: none; }
.chat-area::-webkit-scrollbar { width: 4px; }
.chat-area::-webkit-scrollbar-track { background: transparent; }
.chat-area::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.2); border-radius: 2px; }

/* 氛围光晕 */
.atmosphere-glow {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  pointer-events: none;
  z-index: 0;
}
.glow-orb {
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
  filter: blur(40px);
  animation: glowFloat 8s ease-in-out infinite alternate;
}
.glow-orb-1 {
  width: 300px;
  height: 300px;
  top: -50px;
  left: -50px;
  background: #d0bcff;
}
.glow-orb-2 {
  width: 250px;
  height: 250px;
  top: 300px;
  right: -30px;
  background: #ffb3ad;
  animation-delay: -4s;
}
@keyframes glowFloat {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(20px, 10px) scale(1.1); }
}

/* 消息列表 */
.message-list {
  position: relative;
  z-index: 1;
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 消息入场动画 */
.msg-enter { animation: msgSlideIn 0.35s cubic-bezier(0.16,1,0.3,1); }
@keyframes msgSlideIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 开场旁白 - 药丸形 */
.msg-opening {
  text-align: center;
  padding: 0;
  margin: 0 16px;
  border-radius: 48px;
  border: 1px solid #4447481a;
  background: linear-gradient(158.26deg, #2a2a2a66 -0.33%, #2a2a2a00 100.33%);
  backdrop-filter: blur(2px);
  animation: sceneFadeIn 0.8s cubic-bezier(0.16,1,0.3,1);
}
@keyframes sceneFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
.msg-opening-text {
  padding: 15px 21px;
  font-style: italic;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0;
  color: #c4c7c7;
}
.msg-opening-divider { display: none; }

/* 旁白（narration / narrator 统一） */
.msg-narration {
  display: flex;
  justify-content: center;
  padding: 0 16px;
  margin: 12px 0;
}
.msg-narration-bubble {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid rgba(68, 71, 72, 0.1);
  border-radius: 48px;
  padding: 15px 21px;
  max-width: 90%;
  background: linear-gradient(158.26deg, rgba(42, 42, 42, 0.4) -0.33%, rgba(42, 42, 42, 0) 100.33%);
  backdrop-filter: blur(2px);
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0;
  color: #c4c7c7;
  text-align: center;
  font-style: italic;
}
.msg-narration--opening .msg-narration-bubble {
  animation: sceneFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 系统消息 */
.msg-system {
  text-align: center;
  font-size: 11px;
  opacity: 0.35;
  padding: 2px 0;
}

/* 角色消息 */
.msg-agent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 24px 70px 0 16px;
}
.msg-agent-avatar {
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid #d0bcff4d;
  background: #12121299;
  backdrop-filter: blur(10px);
}
.msg-agent-body { max-width: 80%; min-width: 0; }
.msg-agent-name { font-size: 11px; font-weight: 500; margin-bottom: 4px; padding-left: 8px; }
.msg-agent-bubble {
  padding: 12px 16px;
  border-radius: 0 16px 16px 16px;
  font-size: 16px;
  line-height: 26px;
  word-break: break-word;
  border: 1px solid #ffffff14;
  background: #12121299;
  backdrop-filter: blur(10px);
  color: #e5e2e1;
}

/* 用户消息 */
.msg-user {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 12px;
  margin: 24px 16px 0 16px;
}
.msg-user-body {
  display: block;
  text-align: right;
  max-width: 80%;
  min-width: 0;
}
.msg-user-name {
  font-size: 11px;
  font-weight: 500;
  padding-right: 8px;
  color: #e5e2e1;
  display: none;
}
.msg-user-bubble {
  display: inline-block;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 16px 0 16px 16px;
  font-size: 16px;
  line-height: 24px;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
  color: #e5e2e1;
  background-image: linear-gradient(172.6deg, #571bc1 0%, #d0bcff 100%);
  box-shadow: 0 0 20px 0 #571bc14d;
}
.msg-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid #c9c6c54d;
  background: #12121299;
  backdrop-filter: blur(10px);
}

/* Typing 指示器 */
.typing-indicator {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  margin-top: 32px;
}
.typing-bar-wrap {
  display: flex;
  align-items: center;
  border-radius: 9999px;
  background: #571bc166;
  padding-right: 16px;
  overflow: hidden;
  flex-shrink: 0;
}
.typing-bar {
  width: 16px;
  height: 4px;
  border-radius: 9999px;
  flex-shrink: 0;
  background: #d0bcff;
}
.typing-text {
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.6px;
  color: #d0bcff;
}
.typing-name { font-weight: 500; }
.typing-dots {
  display: flex;
  gap: 3px;
}
.typing-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  animation: typingBounce 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

/* 输入区域 */
.input-area {
  flex-shrink: 0;
  padding: 12px 16px 32px;
  background: transparent;
  border-top: none;
  position: sticky;
  bottom: 0;
  z-index: 10;
}
.input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid #ffffff14;
  border-radius: 9999px;
  box-shadow: 0 -10px 40px 0 #00000080;
  background: #0e0e0e99;
  padding: 5px;
  backdrop-filter: blur(10px);
}
.input-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: #1c1b1b;
  width: 40px;
  height: 40px;
  border: none;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
  color: #e0e0e0;
}
.input-action-btn:hover { background: #2a2a2a; }

#messageInput {
  flex: 1;
  background: transparent;
  border: none;
  padding: 9px 8px 10px;
  font-size: 16px;
  color: #e0e0e0;
  outline: none;
  min-width: 0;
  letter-spacing: 0;
}
#messageInput::placeholder { color: #c4c7c780; }

.send-btn {
  display: flex;
  align-items: center;
  border-radius: 9999px;
  background: #571bc1;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.2s;
  padding: 12px 11px;
  box-shadow: 0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;
}
.send-btn:hover {
  box-shadow: 0 0 16px -2px rgba(87,27,193,0.5);
  transform: translateY(-1px);
}
.send-btn:active { transform: scale(0.95); }
.send-btn:disabled {
  background: #571bc166;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* 快捷动作面板 */
.action-panel {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 12px 0 16px 0;
  animation: msgSlideIn 0.2s ease;
  -webkit-overflow-scrolling: touch;
}
.action-panel::-webkit-scrollbar { display: none; }
.action-chip {
  display: inline-flex;
  align-items: center;
  column-gap: 8px;
  border: 1px solid #ffffff0d;
  border-radius: 9999px;
  background: #12121299;
  backdrop-filter: blur(10px);
  color: #e5e2e1;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  height: 38px;
  padding: 5px 15px;
  flex-shrink: 0;
}
.action-chip svg { flex-shrink: 0; }
.action-chip:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
}

/* 用户身份提示（聊天列表内） */
.msg-persona {
  text-align: center;
  padding: 12px 20px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.12);
  border-radius: 12px;
  margin: 4px 0;
}

/* 导演模式指示 */
.director-mode .chat-header {
  background: rgba(139, 92, 246, 0.15);
  border-bottom-color: rgba(139, 92, 246, 0.2);
}
.director-mode .header-btn-director {
  background: rgba(139, 92, 246, 0.3);
}
.header-btn-director.active {
  background: rgba(139, 92, 246, 0.3);
}

/* 私聊提示 */
.whisper-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  background: rgba(139, 92, 246, 0.1);
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}
.whisper-hint::before { content: '私聊'; color: #a78bfa; font-weight: 500; }
.whisper-cancel {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
}
.whisper-cancel:hover { color: rgba(255,255,255,0.8); }

/* 离场提示消息 */
.msg-away {
  text-align: center;
  padding: 8px 16px;
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: 8px;
  margin: 4px 0;
}

/* 角色私聊按钮 */
.agent-whisper-btn {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.5);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.agent-whisper-btn:hover {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border-color: rgba(139, 92, 246, 0.3);
}

/* 导演指令气泡 */
.msg-director {
  display: flex;
  justify-content: center;
  margin: 33px 16px;
}
.msg-director-bubble {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 11px 23px;
  border-radius: 48px;
  border: 1px solid #571bc166;
  background: #571bc133;
  font-size: 14px;
  line-height: 20px;
  color: #d0bcff;
  max-width: 90%;
  text-align: left;
}
.msg-director-bubble::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='17' viewBox='0 0 24 24' fill='none' stroke='%23d0bcff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='2' width='20' height='20' rx='2.18' ry='2.18'/%3E%3Cline x1='7' y1='2' x2='7' y2='22'/%3E%3Cline x1='17' y1='2' x2='17' y2='22'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}
.msg-director-bubble .director-label { font-weight: 500; white-space: nowrap; flex-shrink: 0; }
.msg-director-bubble .director-text { white-space: normal; word-break: break-word; }

/* ==================== 响应式 ==================== */
@media (max-width: 640px) {
  .lobby-container { padding: 0 16px 32px; }
  .brand-title { font-size: 32px; }
  .scene-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; min-width: 0; }
  .scene-card-visual { min-height: 320px; height: 320px; }
  .message-list { padding: 8px 12px; gap: 8px; }

  /* 顶栏 */
  .header-scene-name { font-size: 20px; line-height: 26px; }

  /* 角色消息 */
  .msg-agent { margin: 16px 8px 0 8px; gap: 8px; }
  .msg-agent-avatar { width: 34px; height: 34px; font-size: 12px; }
  .msg-agent-name { font-size: 12px; }
  .msg-agent-bubble { font-size: 14px; line-height: 22px; padding: 10px 14px; }
  .msg-agent-body { max-width: 90%; }

  /* 用户消息 */
  .msg-user { margin: 16px 8px 0 8px; gap: 8px; }
  .msg-user-avatar { width: 34px; height: 34px; font-size: 12px; }
  .msg-user-body { max-width: 90%; }
  .msg-user-bubble { display: inline-block; max-width: 100%; font-size: 14px; line-height: 22px; padding: 10px 14px; text-align: left; white-space: pre-wrap; word-break: break-word; }

  /* 旁白（narration / narrator 统一） */
  .msg-narration-bubble { font-size: 14px; line-height: 20px; padding: 12px 18px; }

  /* 开场白 */
  .msg-opening-text { font-size: 14px; line-height: 20px; padding: 12px 18px; font-style: normal; }

  /* 快捷动作芯片 */
  .action-chip { font-size: 14px; height: 34px; padding: 4px 12px; }

  .glow-orb-1 { width: 180px; height: 180px; }
  .glow-orb-2 { width: 140px; height: 140px; }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .scene-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .scene-card-visual { min-height: 360px; height: 360px; }
}

@media (min-width: 1025px) {
  .scene-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .scene-card-visual { min-height: 420px; height: 420px; }
}

/* 移动端虚拟键盘适配 */
@supports (height: 100dvh) {
  .view { height: 100dvh; }
}

/* ==================== TabBar ==================== */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: rgba(14,14,14,0.95);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.tab-item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 0 8px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.2s;
}
.tab-badge {
  position: absolute;
  top: 8px;
  right: calc(50% - 20px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(14,14,14,0.9);
}
.tab-badge.hidden { display: none; }
.tab-item svg { opacity: 0.5; transition: opacity 0.2s, stroke 0.2s; }
.tab-item.active { color: #e5e2e1; }
.tab-item.active svg { opacity: 1; stroke: #e5e2e1; }

/* tab-content 切换 */
.tab-content { display: none !important; }
.tab-content.active { display: flex !important; }

#lobbyView > .tab-content.active {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* lobby-container 底部留出 TabBar 高度 */
.lobby-container {
  padding-bottom: 64px;
}

/* ==================== 「我的」页面 ==================== */
.profile-header {
  padding: 32px 20px 16px;
  text-align: center;
}
.profile-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(16px + var(--safe-top)) calc(20px + var(--safe-right)) 16px calc(20px + var(--safe-left));
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(180deg, #131313cc 0%, #13131300 100%);
  backdrop-filter: blur(6px);
}
.profile-page-header .lobby-header-brand { align-items: flex-start; }
.profile-body {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 20px 24px;
  width: 100%;
}
.profile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 360px;
}
.profile-user-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin-bottom: 16px;
}
.profile-user-row .profile-avatar {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  margin-bottom: 0;
}
.profile-user-row .profile-info {
  flex: 1;
  min-width: 0;
  text-align: left;
  margin-bottom: 0;
}
.profile-user-row .profile-nickname {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-user-row .profile-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.profile-info {
  text-align: center;
  margin-bottom: 28px;
}
.profile-nickname {
  font-size: 20px;
  font-weight: 600;
  color: #e0e0e0;
  margin-bottom: 4px;
}
.profile-email {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
}
.profile-stats {
  display: flex;
  gap: 28px;
  margin-bottom: 36px;
  flex-wrap: wrap;
  justify-content: center;
}
.profile-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #e5e2e1;
}
.stat-label {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}
.profile-logout-btn {
  width: 100%;
  max-width: 280px;
  padding: 14px;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
}
.profile-logout-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.profile-guest-text {
  font-size: 14px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 24px;
}
.profile-login-btn {
  display: inline-block;
  padding: 14px 48px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: #e5e2e1;
  color: #2a2827;
  border-radius: 12px;
  text-decoration: none;
  transition: opacity 0.2s;
}
.profile-login-btn:hover { opacity: 0.9; }

.profile-hub {
  width: 100%;
  max-width: 360px;
  margin-top: 4px;
}
.profile-my-scenes {
  width: 100%;
  padding-top: 16px;
  padding-bottom: 8px;
}
.profile-settings-logout {
  margin-top: 24px;
}
.profile-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
}
.profile-setting-row-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.profile-setting-row-label {
  font-size: 15px;
  font-weight: 500;
  color: #e5e2e1;
}
.profile-setting-row-desc {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255,255,255,0.45);
}
.profile-switch {
  position: relative;
  flex-shrink: 0;
  width: 46px;
  height: 28px;
}
.profile-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.profile-switch-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 999px;
  transition: background 0.2s;
  cursor: pointer;
}
.profile-switch-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.profile-switch input:checked + .profile-switch-slider {
  background: rgba(167,139,250,0.85);
}
.profile-switch input:checked + .profile-switch-slider::before {
  transform: translateX(18px);
}
.profile-switch input:disabled + .profile-switch-slider {
  opacity: 0.45;
  cursor: not-allowed;
}
.profile-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.profile-menu-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}
.profile-menu-item:hover { background: rgba(255,255,255,0.07); }
.profile-menu-label {
  font-size: 15px;
  font-weight: 500;
  color: #e5e2e1;
}
.profile-menu-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}
#profileMain {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
}
.profile-main-billing {
  width: 100%;
  margin: 0 0 16px;
}
.profile-billing-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0 0 16px;
  padding: 14px 16px;
  text-align: left;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, border-color 0.3s, box-shadow 0.3s;
}
.profile-billing-entry:hover { background: rgba(255,255,255,0.07); }
.profile-billing-entry.billing-card-highlight {
  border-color: rgba(167,139,250,0.65);
  box-shadow: 0 0 0 2px rgba(167,139,250,0.2), 0 8px 24px rgba(0,0,0,0.25);
}
.profile-billing-entry-icon {
  flex-shrink: 0;
  font-size: 18px;
  color: rgba(208,188,255,0.75);
}
.profile-billing-entry-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.profile-billing-entry-label {
  font-size: 15px;
  font-weight: 500;
  color: #e5e2e1;
}
.profile-billing-entry-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}
.profile-billing-entry-status {
  flex-shrink: 0;
  font-size: 11px;
}
.profile-billing-entry-arrow {
  flex-shrink: 0;
  font-size: 20px;
  line-height: 1;
  color: rgba(255,255,255,0.35);
}
.profile-subpages {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: #131313;
  text-align: left;
  overflow: hidden;
}
.profile-subpages.hidden { display: none !important; }
#lobbyView.profile-subpage-open .tabbar { display: none; }
.profile-subpages-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px calc(24px + env(safe-area-inset-bottom, 0));
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
}
.profile-subheader {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding: calc(16px + var(--safe-top)) calc(16px + var(--safe-right)) 16px calc(16px + var(--safe-left));
  margin-bottom: 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: #131313;
}
.profile-sub-back {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.8);
  font-size: 18px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.profile-sub-title {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  color: #e5e2e1;
  min-width: 0;
}
.profile-sub-action {
  flex-shrink: 0;
  border: none;
  background: none;
  padding: 6px 4px;
  font-size: 14px;
  font-weight: 500;
  color: #a78bfa;
  cursor: pointer;
  font-family: inherit;
}
.profile-sub-action:hover { color: #c4b5fd; }
.report-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.report-history-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.report-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.report-history-id {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
}
.report-history-status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
}
.report-history-status-pending {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
}
.report-history-status-resolved {
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
}
.report-history-status-dismissed {
  color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.08);
}
.report-history-reason {
  font-size: 14px;
  color: #e5e2e1;
  line-height: 1.45;
  margin: 0 0 6px;
}
.report-history-content {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  line-height: 1.4;
  margin: 0 0 6px;
}
.report-history-meta,
.report-history-time {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  margin: 0;
}
.report-history-time { margin-top: 4px; }
.profile-subpage { width: 100%; }
.profile-readonly-label {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  margin: 16px 0 4px;
}
.profile-readonly-value {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  margin-bottom: 16px;
}
.profile-section-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  margin: 20px 0 12px;
}
.profile-block { margin-top: 8px; }
.profile-block-hint {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  margin: -6px 0 12px;
  line-height: 1.5;
}
.profile-block-note {
  margin-top: -4px;
  color: rgba(255,255,255,0.38);
}
.profile-field { margin-bottom: 12px; }
.profile-label {
  display: block;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 6px;
}
.profile-label-required::after {
  content: ' *';
  color: #f87171;
}
.profile-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: #e0e0e0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  outline: none;
  font-family: inherit;
}
.profile-textarea { resize: vertical; min-height: 56px; }
.profile-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile-code-row .profile-input { flex: 1; min-width: 0; width: auto; }
.profile-code-row .profile-code-send-btn {
  width: auto;
  flex: 0 0 auto;
  margin-top: 0;
  padding: 10px 12px;
  white-space: nowrap;
}
.profile-save-btn,
.profile-secondary-btn {
  width: 100%;
  padding: 11px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  margin-top: 4px;
}
.profile-save-btn {
  color: #2a2827;
  background: #e5e2e1;
  border: none;
}
.profile-secondary-btn {
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
}
.profile-block-danger {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.profile-danger-btn {
  width: 100%;
  padding: 11px;
  font-size: 14px;
  color: #fca5a5;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
}

.persona-edit-card { max-width: 420px; }
.persona-edit-hint {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
  margin-bottom: 14px;
}
.persona-edit-input {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: #e0e0e0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  resize: vertical;
  font-family: inherit;
  margin-bottom: 14px;
}
.persona-cancel-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.pwa-install-banner {
  position: fixed;
  bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  left: 12px;
  right: 12px;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.pwa-install-banner.hidden { display: none; }
.pwa-install-banner p {
  flex: 1;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255,255,255,0.75);
  margin: 0;
}
.pwa-install-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.pwa-install-btn {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #2a2827;
  background: #e5e2e1;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}
.pwa-install-dismiss {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.5);
  font-size: 20px;
  cursor: pointer;
  font-family: inherit;
}

.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.onboarding-overlay.hidden { display: none; }
.onboarding-card {
  width: 100%;
  max-width: 340px;
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 28px 24px;
}
.onboarding-card h3 {
  font-size: 18px;
  color: #e5e2e1;
  margin-bottom: 12px;
}
.onboarding-card p {
  font-size: 14px;
  line-height: 1.65;
  color: rgba(255,255,255,0.55);
  margin-bottom: 24px;
}
.onboarding-actions {
  display: flex;
  gap: 10px;
}
.onboarding-actions .login-prompt-primary,
.onboarding-actions .login-prompt-secondary {
  flex: 1;
}

/* ---- 分享片段 v0.4 ---- */
.header-btn.share-active {
  color: #e5e2e1;
  background: rgba(255,255,255,0.12);
}
.message-list.share-mode .msg-shareable {
  position: relative;
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.15s, box-shadow 0.15s;
}
.message-list.share-mode .msg-shareable.msg-selected::before {
  content: attr(data-share-order);
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(99,102,241,0.9);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(99,102,241,0.45);
  pointer-events: none;
}
.message-list.share-mode .msg-shareable:active {
  background: rgba(255,255,255,0.04);
}
.msg-shareable.msg-selected {
  background: rgba(99,102,241,0.12);
  box-shadow: inset 0 0 0 2px rgba(99,102,241,0.55);
}
.share-selection-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(20,20,30,0.95);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  backdrop-filter: blur(12px);
}
.share-selection-bar.hidden { display: none; }
.share-selection-hint {
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  flex: 1;
  min-width: 0;
}
.share-selection-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.share-selection-cancel {
  padding: 8px 12px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}
.share-selection-generate {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #2a2827;
  background: #e5e2e1;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}
.share-selection-generate:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.share-selection-generate.is-loading {
  opacity: 0.75;
  cursor: wait;
}
.share-card-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.share-card-overlay.hidden { display: none; }
.share-card-modal {
  width: 100%;
  max-width: 420px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}
.share-card-close {
  position: absolute;
  top: -8px;
  right: 0;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  font-size: 22px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
  font-family: inherit;
}
.share-card-preview-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border-radius: 12px;
  background: #111;
  line-height: 0;
  max-width: min(380px, 72vw);
  margin: 0 auto;
  aspect-ratio: 9 / 16;
}
.share-card-preview-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 12px;
  object-fit: contain;
}
.share-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.share-card-btn {
  flex: 1;
  min-width: 100px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
}
.share-card-btn-primary {
  color: #2a2827;
  background: #e5e2e1;
  border-color: transparent;
}

.input-model-btn {
  flex-shrink: 0;
  min-width: 52px;
  height: 40px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.input-model-btn.model-premium {
  color: #fbbf24;
  border-color: rgba(251,191,36,0.35);
  background: rgba(251,191,36,0.1);
}

.billing-summary {
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
}
.billing-status-row {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.9fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.billing-status-label {
  grid-column: 1;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}
.billing-status-badge {
  grid-column: 3;
  justify-self: end;
  font-size: 13px;
  font-weight: 600;
  color: #e5e2e1;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  white-space: nowrap;
}
.billing-status-badge.is-member {
  color: #fbbf24;
  background: rgba(251,191,36,0.12);
  border-color: rgba(251,191,36,0.35);
}
.billing-compare {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.billing-compare-head,
.billing-compare-row {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.9fr;
  gap: 8px;
  align-items: center;
}
.billing-compare-head {
  padding-bottom: 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.billing-compare-head span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}
.billing-compare-col {
  text-align: center;
}
.billing-compare-col-member {
  text-align: right;
  color: rgba(251,191,36,0.85) !important;
}
.billing-compare-row {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.billing-compare-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.billing-compare-feature {
  font-size: 13px;
  color: rgba(255,255,255,0.72);
  line-height: 1.4;
}
.billing-compare-val {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255,255,255,0.45);
  text-align: center;
}
.billing-compare-row .billing-compare-val:last-child {
  text-align: right;
}
.billing-compare-val.is-highlight {
  color: #86efac;
  font-weight: 600;
}
.billing-compare-val.is-member-val {
  color: rgba(251,191,36,0.9);
  font-weight: 600;
}
.billing-compare-val.is-muted {
  color: rgba(255,255,255,0.28);
}
.billing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: rgba(255,255,255,0.55);
  margin: 0 0 10px;
}
.billing-row strong {
  color: #e5e2e1;
  font-weight: 600;
}
.billing-hint {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255,255,255,0.4);
  margin: 12px 0 0;
}
.billing-section-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  margin: 16px 0 10px;
}
.billing-btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.billing-plan-btn {
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  font-size: 14px;
  color: #e5e2e1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
}
.billing-plan-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.billing-plan-btn small {
  display: block;
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  margin-top: 2px;
}
.billing-disabled-hint {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  text-align: center;
  padding: 16px 0;
}
.billing-disabled-hint.hidden { display: none; }

.studio-section-header {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  margin: 8px 0 4px;
  padding-left: 4px;
}
.scene-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #fbbf24;
  background: rgba(251,191,36,0.15);
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: 6px;
}
.scene-card-visual { position: relative; }

.studio-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.studio-toolbar .profile-secondary-btn { flex: 1; }
.studio-scene-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.studio-scene-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
}
.studio-scene-item strong {
  display: block;
  font-size: 14px;
  color: #e5e2e1;
}
.studio-scene-item small {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}
.studio-editor { margin-bottom: 20px; }
.studio-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.studio-editor-actions .profile-save-btn,
.studio-editor-actions .profile-secondary-btn,
.studio-editor-actions .profile-danger-btn {
  flex: 1;
  min-width: 80px;
}
.studio-listings, .studio-imports {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.studio-listing-item, .studio-import-item {
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}
.studio-listing-item code {
  font-family: monospace;
  color: #fbbf24;
  font-size: 14px;
}
.studio-listing-form { margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.studio-listing-form.hidden { display: none; }
.studio-editor.hidden { display: none; }

/* 内容举报弹窗 */
.report-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0,0,0,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.report-modal-overlay.hidden { display: none; }
.report-modal {
  position: relative;
  width: min(420px, 100%);
  background: rgba(18,18,28,0.98);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 24px 20px 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.report-modal h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}
.report-modal-hint {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 12px;
  line-height: 1.5;
}
.report-preview {
  max-height: 120px;
  overflow-y: auto;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  white-space: pre-wrap;
  word-break: break-word;
}
.report-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.report-modal-actions .profile-save-btn,
.report-modal-actions .profile-secondary-btn {
  flex: 1;
}
.report-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.profile-stats-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.profile-stats-compact .profile-stat {
  align-items: flex-start;
}
.profile-stat-diamond { flex: 1; }
.profile-checkin-btn {
  flex-shrink: 0;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(167,139,250,0.35);
  background: rgba(167,139,250,0.12);
  color: #c4b5fd;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.profile-checkin-btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.profile-billing-card {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.profile-billing-card.billing-card-highlight {
  border-color: rgba(167,139,250,0.65);
  box-shadow: 0 0 0 2px rgba(167,139,250,0.2), 0 8px 24px rgba(0,0,0,0.25);
}
.input-model-btn.model-locked:not(.model-premium) {
  opacity: 0.85;
}

.hidden { display: none !important; }
.profile-my-scenes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.profile-my-scenes-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #e5e2e1;
}
.profile-my-scenes-quota { font-size: 12px; color: rgba(255,255,255,0.45); }
.profile-my-scenes-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.profile-my-scenes-head h3 { flex: 1; margin: 0; }
.my-scenes-create-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(139,92,246,0.35);
  background: rgba(139,92,246,0.14);
  color: #d0bcff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.my-scenes-empty-card {
  grid-column: 1 / -1;
  padding: 28px 20px;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  text-align: center;
}
.my-scenes-empty-icon {
  font-size: 28px;
  color: rgba(208,188,255,0.6);
  margin-bottom: 10px;
}
.my-scenes-empty-card h4 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: #e5e2e1;
}
.my-scenes-empty-card p {
  margin: 0 0 16px;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(255,255,255,0.48);
}
.my-scenes-empty-btn {
  padding: 10px 18px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(109,40,217,0.28);
}
.my-scenes-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.my-scene-card {
  padding: 0;
  border-radius: 12px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.my-scene-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.14);
}
.my-scene-card.banned { opacity: 0.55; border-color: rgba(239,68,68,0.35); }
.my-scene-card-visual {
  min-height: 148px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  padding: 10px;
  background-size: cover;
  background-position: center top;
}
.my-scene-card-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    #0a0a0acc 0%,
    #0a0a0a55 35%,
    #0a0a0a00 58%
  );
  z-index: 1;
}
.my-scene-card-content {
  position: relative;
  z-index: 2;
}
.my-scene-card-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  font-family: 'Playfair Display', 'Noto Serif SC', serif;
  color: #e5e2e1;
}
.my-scene-card-tag { font-size: 11px; color: rgba(255,255,255,0.72); }
.my-scene-card-banned { color: #f87171; margin-top: 4px; }
.profile-settings-entry { margin-top: 8px; }

.chat-more-wrap { position: relative; }
.chat-more-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 168px;
  background: #1a1a1f;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 6px;
  z-index: 60;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.chat-more-menu.hidden { display: none; }
.chat-more-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: none;
  color: #e5e2e1;
  text-align: left;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
}
.chat-more-icon {
  flex: 0 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.88;
}
.chat-more-label { flex: 1; }
.chat-more-item-stack .chat-more-text { gap: 2px; }
.chat-more-hint {
  font-size: 11px;
  line-height: 1.35;
  color: rgba(255,255,255,0.38);
}
.privacy-sheet-card { max-width: 400px; }
.privacy-sheet-current {
  font-size: 13px;
  color: rgba(167,139,250,0.95);
  margin: -6px 0 14px;
  line-height: 1.5;
}
.privacy-sheet-modes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.privacy-sheet-mode {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}
.privacy-sheet-mode.is-active {
  border-color: rgba(167,139,250,0.45);
  background: rgba(139,92,246,0.1);
}
.privacy-sheet-mode h4 {
  font-size: 14px;
  color: #e5e2e1;
  margin: 0 0 6px;
  font-weight: 600;
}
.privacy-sheet-mode p {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255,255,255,0.58);
  margin: 0;
}
.privacy-sheet-mode .privacy-mode-note {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}
.privacy-sheet-disclaimer {
  font-size: 12px;
  line-height: 1.55;
  color: rgba(255,255,255,0.42);
  margin-bottom: 18px;
}
.privacy-guide-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}
.privacy-guide-card {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  text-align: left;
}
.privacy-guide-card h4 {
  font-size: 15px;
  color: #e5e2e1;
  margin: 0 0 8px;
  font-weight: 600;
}
.privacy-guide-card p {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255,255,255,0.62);
  margin: 0;
}
.privacy-guide-note {
  margin-top: 8px !important;
  font-size: 12px !important;
  color: rgba(255,255,255,0.4) !important;
}
.privacy-guide-server { border-left: 3px solid rgba(139,92,246,0.7); }
.privacy-guide-private { border-left: 3px solid rgba(34,197,94,0.7); }
.privacy-guide-incognito { border-left: 3px solid rgba(251,191,36,0.7); }
.privacy-ai-details {
  width: 100%;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  text-align: left;
}
.privacy-ai-details summary {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.72);
  cursor: pointer;
  list-style: none;
}
.privacy-ai-details summary::-webkit-details-marker { display: none; }
.privacy-ai-details p {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255,255,255,0.48);
}
.my-scene-card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(134,239,172,0.9);
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: 999px;
}
.chat-more-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}
.chat-more-sublabel {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}
.chat-more-sublabel.model-premium-text { color: #c4b5fd; }
.chat-more-item.model-premium .chat-more-icon { color: #c4b5fd; }
.chat-more-item.model-locked .chat-more-sublabel::after {
  content: ' · 🔒';
  font-size: 11px;
}
.chat-more-item:hover { background: rgba(255,255,255,0.06); }
.chat-more-footer {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 4px;
  padding-top: 4px;
}
.chat-more-item-danger {
  color: #fca5a5 !important;
  font-weight: 600;
  background: rgba(248, 113, 113, 0.08);
}
.chat-more-item-danger .chat-more-icon { color: #f87171; }
.chat-more-item-danger:hover { background: rgba(248, 113, 113, 0.16) !important; }
.chat-more-item-danger .chat-more-label { font-size: 15px; }

.scene-editor-view {
  background: #0e0e0e;
  z-index: 40;
  display: flex;
  flex-direction: column;
}
.scene-editor-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(12px + var(--safe-top)) calc(16px + var(--safe-right)) 12px calc(16px + var(--safe-left));
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  background: rgba(14,14,14,0.92);
  backdrop-filter: blur(12px);
}
.scene-editor-header-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.scene-editor-quota {
  font-size: 11px;
  color: rgba(255,255,255,0.42);
}
.scene-editor-progress-wrap {
  flex-shrink: 0;
  padding: 8px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(14,14,14,0.85);
}
.scene-editor-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(255,255,255,0.42);
  margin-bottom: 6px;
}
.scene-editor-progress-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.scene-editor-progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #8b5cf6, #a78bfa);
  transition: width 0.25s ease;
}
.editor-intro {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(139,92,246,0.22);
  background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(109,40,217,0.06));
}
.editor-intro h4 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: #e5e2e1;
}
.editor-intro p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(255,255,255,0.58);
}
.scene-editor-save:disabled,
.scene-editor-save-footer:disabled {
  opacity: 0.6;
  cursor: wait;
}
.scene-editor-enter-footer {
  width: 100%;
  margin-bottom: 8px;
  padding: 13px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: #e5e2e1;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.scene-editor-enter-footer:disabled { opacity: 0.6; cursor: wait; }
.scene-editor-header .back-btn { margin-right: 0; }
.scene-editor-header #sceneEditorTitle {
  font-size: 15px;
  font-weight: 600;
  color: #e5e2e1;
}
.scene-editor-save {
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: rgba(139,92,246,0.25);
  color: #d0bcff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.scene-editor-body {
  flex: 1;
  min-height: 0;
  padding: 16px;
  padding-bottom: 24px;
  overflow-y: auto;
}
.scene-editor-footer {
  flex-shrink: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(14,14,14,0) 0%, rgba(14,14,14,0.96) 24%);
}
.scene-editor-save-footer {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(109,40,217,0.35);
}
.scene-editor-save-footer:active { transform: scale(0.98); }

.editor-hero {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  min-height: 200px;
  cursor: pointer;
}
.editor-hero.has-image { cursor: default; }
.editor-hero-upload-hint {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  pointer-events: none;
}
.editor-hero-upload-hint svg { opacity: 0.7; }
.editor-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  transition: background 0.25s ease;
}
.editor-hero-content {
  position: relative;
  z-index: 2;
  padding: 16px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(0deg, rgba(10,10,10,0.92) 0%, rgba(10,10,10,0.35) 45%, rgba(10,10,10,0.08) 100%);
}
.editor-hero.has-image .editor-hero-content {
  background: linear-gradient(
    0deg,
    rgba(10,10,10,0.92) 0%,
    rgba(10,10,10,0.35) 38%,
    rgba(10,10,10,0) 58%
  );
}
.editor-hero-badge {
  align-self: flex-start;
  margin-bottom: auto;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(134,239,172,0.95);
  background: rgba(34,197,94,0.14);
  border: 1px solid rgba(34,197,94,0.28);
}
.editor-hero-title {
  font-family: 'Playfair Display', 'Noto Serif SC', serif;
  font-size: 22px;
  font-weight: 700;
  color: #e5e2e1;
  line-height: 1.25;
}
.editor-hero-title.is-placeholder,
.editor-hero-tagline.is-placeholder { opacity: 0.45; }
.editor-hero-tagline {
  margin-top: 6px;
  font-size: 13px;
  color: rgba(255,255,255,0.72);
  line-height: 1.45;
}
.editor-hero-upload {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  color: #e5e2e1;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.editor-hero-upload:disabled { opacity: 0.6; cursor: wait; }
.editor-hero-clear {
  position: absolute;
  top: 52px;
  right: 12px;
  z-index: 3;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.5);
  color: #e5e2e1;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.editor-section {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
}
.editor-section-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: rgba(208,188,255,0.92);
  text-transform: uppercase;
}
.editor-section-title-inline { margin-bottom: 4px; }
.editor-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.editor-char-count {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
}
.editor-field-hint {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(255,255,255,0.38);
}
.profile-field.is-error .profile-input,
.editor-agent-card.is-error .profile-input {
  border-color: rgba(248,113,113,0.65);
  box-shadow: 0 0 0 1px rgba(248,113,113,0.2);
}
.editor-agent-card.is-error {
  border-color: rgba(248,113,113,0.45);
}

.editor-hue-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.editor-hue-swatch {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
  transition: background 0.2s ease;
}
.editor-hue-range {
  flex: 1;
  accent-color: #8b5cf6;
}
.editor-hue-value {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  min-width: 36px;
  text-align: right;
}

.scene-editor-agents-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.editor-agents-count {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-top: 2px;
}
.editor-add-agent-btn {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(139,92,246,0.35);
  background: rgba(139,92,246,0.12);
  color: #d0bcff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.editor-agent-card {
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid var(--agent-accent, #8b5cf6);
}
.editor-agent-card:last-child { margin-bottom: 0; }
.editor-agent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.editor-agent-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.editor-agent-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--agent-accent, #8b5cf6);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
}
.editor-agent-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
}
.editor-agent-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
}
.editor-agent-card input,
.editor-agent-card textarea {
  width: 100%;
  margin-bottom: 10px;
}
.editor-agent-card textarea { margin-bottom: 0; }
.editor-agent-remove {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
}
.editor-agent-remove:hover { color: #f87171; }
.editor-delete-btn { margin-top: 8px; }
.hidden { display: none !important; }

.leaderboard-view {
  background: #0e0e0e;
  z-index: 40;
}
.leaderboard-page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(12px + var(--safe-top)) calc(16px + var(--safe-right)) 12px calc(16px + var(--safe-left));
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.leaderboard-page-title {
  font-size: 16px;
  font-weight: 600;
  color: #e5e2e1;
}
.leaderboard-page-body {
  padding: 16px;
  padding-bottom: 80px;
  overflow-y: auto;
  max-height: calc(100vh - 56px);
}
.leaderboard-page-hint {
  margin: 0 0 12px;
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}
.leaderboard-view .scene-leaderboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.leaderboard-item:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.14);
}
.leaderboard-item--rank1 { border-color: rgba(251,191,36,0.35); }
.leaderboard-item--rank2 { border-color: rgba(203,213,225,0.3); }
.leaderboard-item--rank3 { border-color: rgba(180,83,9,0.35); }
.leaderboard-rank {
  flex: 0 0 22px;
  font-size: 15px;
  font-weight: 700;
  color: rgba(255,255,255,0.55);
  text-align: center;
}
.leaderboard-item--rank1 .leaderboard-rank { color: #fbbf24; }
.leaderboard-item--rank2 .leaderboard-rank { color: #cbd5e1; }
.leaderboard-item--rank3 .leaderboard-rank { color: #d97706; }
.leaderboard-thumb {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
}
.leaderboard-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.leaderboard-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.leaderboard-stat {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

