

/* Ins风低饱和柔和美学重置 */

:root {

  --mo-blue: #8fa3b8;

  --mo-blue-light: #f1f4f8;

  --mo-blue-dark: #768a9f;

  --mo-purple: #bbaec6;

  --mo-pink: #d9b8c4;

  --mo-green: #9ebdb6;

  --mo-yellow: #d1bfae;

  --mo-bg: #f9f9f9;

  --mo-status: #4b4b4b;

  --mo-status-light: #f1ece4;

  --mo-batt-fill: #d0d0d0;

  --mo-batt-fill-light: #f1ece4;

}

/* 状态栏三件套（信号/WiFi/电池）统一改为柔和低饱和的ins风配色，覆盖全部界面 */

#home-status-icons { color: var(--mo-status) !important; }

#home-batt-body { border-color: var(--mo-status) !important; }

#battery-level { background-color: var(--mo-batt-fill) !important; }

body { background-color: var(--mo-bg) !important; color: #444; }

.bg-blue-500 { background-color: var(--mo-blue) !important; }

.text-blue-500 { color: var(--mo-blue) !important; }

.border-blue-500 { border-color: var(--mo-blue) !important; }

.accent-blue-500 { accent-color: var(--mo-blue) !important; }

.bg-blue-50 { background-color: var(--mo-blue-light) !important; }

.text-blue-600 { color: var(--mo-blue-dark) !important; }

.bg-purple-500 { background-color: var(--mo-purple) !important; }

.text-purple-500 { color: var(--mo-purple) !important; }

.bg-pink-500 { background-color: var(--mo-pink) !important; }

.text-pink-500 { color: var(--mo-pink) !important; }

.bg-[#07C160], .text-[#07C160] { background-color: var(--mo-green) !important; color: white !important; }

.shadow-sm { box-shadow: 0 2px 10px rgba(0,0,0,0.02) !important; }

.shadow-md { box-shadow: 0 4px 20px rgba(0,0,0,0.04) !important; }

.shadow-xl { box-shadow: 0 10px 30px rgba(0,0,0,0.06) !important; }

.rounded-xl { border-radius: 18px !important; }

.rounded-2xl { border-radius: 22px !important; }

.rounded-3xl { border-radius: 28px !important; }

.border { border-color: rgba(0,0,0,0.04) !important; }

.sub-app-screen { background-color: var(--mo-bg) !important; }

.bg-[#f4f4f4], .bg-[#ededed], .bg-[#f7f7f7] { background-color: var(--mo-bg) !important; }

#splash-screen { position: fixed; inset: 0; background-color: #ffffff; z-index: 999999; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: opacity 0.8s ease; }

#splash-line1 { font-size: 13px; font-weight: 300; color: #1a1a1a; letter-spacing: 0.07em; font-family: -apple-system, 'PingFang SC', 'Noto Sans SC', 'Helvetica Neue', sans-serif; opacity: 0; animation: splash-fadein 0.8s ease 0.2s forwards; text-align: center; margin: 0 24px 12px; line-height: 1.6; }

#splash-line2 { font-size: 11px; font-weight: 300; color: #aaaaaa; letter-spacing: 0.14em; font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif; opacity: 0; animation: splash-fadein 0.8s ease 0.6s forwards; text-align: center; margin: 0 24px; line-height: 1.6; }

@keyframes splash-fadein { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }



/* ===== SECTION BREAK ===== */



body { background: #ffffff; background-size:cover;background-attachment:fixed; }

.cloud-bg { background:rgba(255,255,255,0.12);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px); }



/* ===== SECTION BREAK ===== */



html { font-size: 90% !important; }

.chat-item { display: flex; align-items: flex-start; gap: 7px; margin-bottom: 7px; }

.chat-user { flex-direction: row-reverse; }

.chat-ai { flex-direction: row; }

.chat-avatar { width: 32px; height: 32px; flex-shrink: 0; position: relative; z-index: 10; }

.chat-avatar-inner { width: 100%; height: 100%; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 14px; background: #f1f1f1; }

.chat-bubble { max-width: 70%; padding: 7px 11px; border-radius: 16px; line-height: 1.4; word-break: break-all; white-space: pre-wrap; cursor: pointer; transition: all 0.2s ease; touch-action: pan-y; position: relative; }

.chat-sys { display: flex; justify-content: center; margin: 11px 0; width: 100%; }

.chat-sys-inner { background: rgba(0,0,0,0.08); color: #666; font-size: 10px; padding: 4px 11px; border-radius: 11px; max-width: 85%; text-align: center; word-break: break-word; cursor: pointer; transition: background 0.2s; touch-action: pan-y; }

.chat-sys-inner:hover { background: rgba(0,0,0,0.12); }

#bubble-quote-indicator { position: absolute; top: 0; left: 0; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,0.35); color: #fff; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 6; opacity: 0; transition: background-color 0.15s ease; }

#bubble-quote-indicator svg { width: 13px; height: 13px; }

#bubble-quote-indicator.ready { background: #07C160; }


.no-scrollbar::-webkit-scrollbar{display:none;}

.sub-app-screen{display:none;position:fixed;inset:0;background:var(--mo-bg);z-index:100;flex-direction:column;opacity:0;transform:translateY(16px) scale(0.99);transition:opacity 0.22s cubic-bezier(0.4,0,0.2,1),transform 0.22s cubic-bezier(0.4,0,0.2,1);will-change:opacity,transform;}
.sub-app-screen.app-visible{opacity:1;transform:translateY(0) scale(1);}
/* 聊天详情页进入动画 */
#chat-detail,#offline-chat-detail{transition:opacity 0.22s cubic-bezier(0.4,0,0.2,1),transform 0.22s cubic-bezier(0.4,0,0.2,1);will-change:opacity,transform;opacity:0;transform:translateY(16px);}
#chat-detail.chat-visible,#offline-chat-detail.chat-visible{opacity:1;transform:translateY(0);}

.top-z-app{z-index:200;}

.nav-tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:10px;color:#555;cursor:pointer;}

.nav-tab.active{color:var(--mo-green);}

.tab-content{display:none;flex:1;overflow-y:auto;}

.tab-content.active{display:block;}

#msg-input{max-height:108px;min-height:32px;}

.moment-item { background: #fff; padding: 14px 13px; border-bottom: 1px solid #eee; display: flex; gap: 9px; position: relative; }

.moment-avatar { width: 38px; height: 38px; border-radius: 7px; overflow: hidden; flex-shrink: 0; }

.moment-avatar img { width: 100%; height: 100%; object-fit: cover; }

.moment-content { flex: 1; min-width: 0; }

.moment-name { font-size: 14px; font-weight: 600; color: #576b95; margin-bottom: 2px;}

.moment-text { font-size: 14px; color: #111; margin: 4px 0; line-height: 1.5; word-wrap: break-word;}

.moment-time { font-size: 11px; color: #999; margin-top: 7px; }

.moment-img { max-width: 135px; max-height: 135px; border-radius: 4px; margin-top: 7px; background:#f1f1f1; overflow: hidden; }

.moment-img img { width: 100%; height: auto; object-fit: cover; }

.moment-img-square { max-width: 180px; background: #f0f0f0; border-radius: 4px; margin-top: 7px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: #666; padding: 11px; box-sizing: border-box; text-align: left; word-break: break-word; border: 1px dashed #ccc; }

.moment-interaction { background: #f7f7f7; border-radius: 4px; margin-top: 9px; position: relative; }

.moment-like { padding: 5px 7px; font-size: 12px; color: #576b95; font-weight: 500; border-bottom: 1px solid rgba(0,0,0,0.03); }

.moment-like:last-child { border-bottom: none; }

.moment-comment { padding: 4px 7px; font-size: 12px; position: relative; }

.comment-item { margin-top: 4px; font-size: 12px; cursor: pointer; padding: 2px 0; transition: background 0.2s; word-break: break-word; line-height: 1.4; user-select: none; -webkit-user-select: none; }

.comment-item:hover { background: rgba(0,0,0,0.05); }

.comment-name { color: #576b95; font-weight: 600; }

.comment-content { color: #111; }

.moment-del-btn { position: absolute; right: 9px; top: 9px; z-index: 10; }

.contact-item-container { position: relative; width: 100%; overflow: hidden; touch-action: pan-y; border-bottom: 1px solid #eee; }

.contact-content { display: flex; align-items: center; gap: 14px; padding: 14px; background: #fff; transition: transform 0.2s ease; width: 100%; cursor: pointer; box-sizing: border-box; }

.contact-actions { position: absolute; top: 0; right: 0; height: 100%; display: flex; align-items: center; gap: 2px; transform: translateX(100%); transition: transform 0.2s ease; padding-right: 4px; background: #fff; }

.contact-actions button { height: 100%; min-width: 63px; border: none; font-size: 13px; font-weight: 500; cursor: pointer; transition: opacity 0.2s; display: flex; align-items: center; justify-content: center; }

.contact-actions button:active { opacity: 0.7; }

.btn-delete { background: #ff3b30; color: white; border-radius: 0; }

.btn-pin { background: var(--mo-green); color: white; border-radius: 0; }

.contact-item-container.swiped .contact-content { transform: translateX(-30%); }

.contact-item-container.swiped .contact-actions { transform: translateX(0); }

.contact-separator { height: 9px; background-color: var(--mo-bg); width: 100%; }

.image-preview { max-width: 100%; max-height: 135px; margin-top: 7px; border-radius: 7px; overflow: hidden; display: none; }

.image-preview img { width: 100%; height: auto; object-fit: cover; }

.app-icon { touch-action: none; user-select: none; -webkit-user-select: none; }

.app-status-bar { position: absolute; top: 0; left: 0; right: 0; height: 40px; z-index: 999; display: flex; align-items: flex-start; justify-content: space-between; padding: 7px 20px 0; color: #1f2937; pointer-events: none; }
.app-status-bar .app-status-time { font-size: 13px; font-weight: 700; letter-spacing: 0.02em; line-height: 1; color: inherit; }
.app-status-bar svg { color: var(--mo-status); }
.app-status-bar .app-batt-body { border-color: var(--mo-status); }
.app-status-bar .app-battery-level { background-color: var(--mo-batt-fill); }
.app-status-bar.app-status-bar-light { color: #ffffff; }
.app-status-bar.app-status-bar-light svg { color: var(--mo-status-light); }
.app-status-bar.app-status-bar-light .app-batt-body { border-color: var(--mo-status-light); }
.app-status-bar.app-status-bar-light .app-battery-level { background-color: var(--mo-batt-fill-light); }

.wechat-profile-avatar-box { border: 2px solid white; border-radius: 11px; }

/* 里世界（暗黑模式）样式 */

#chat-detail.inverted-world, #offline-chat-detail.inverted-world { background-color: #0a0a0a !important; background-image: none !important; }

#chat-detail.inverted-world #msg-flow, #offline-chat-detail.inverted-world #offline-msg-flow { background-color: #0a0a0a; }

#chat-detail.inverted-world .chat-bubble, #offline-chat-detail.inverted-world .chat-bubble { background-color: #1a1a1a !important; color: #e0e0e0 !important; border: 1px solid #333; }

#chat-detail.inverted-world .chat-user .chat-bubble, #offline-chat-detail.inverted-world .chat-user .chat-bubble { background-color: #2d1f3d !important; color: #d0c0e0 !important; }

#chat-detail.inverted-world #chat-input-panel, #offline-chat-detail.inverted-world #offline-input-panel-container { background-color: #1a1a1a; border-top-color: #333; }

#chat-detail.inverted-world #msg-input, #offline-chat-detail.inverted-world #offline-msg-input { background-color: #2a2a2a; color: #e0e0e0; border-color: #444; }

#chat-detail.inverted-world #conquest-display .text-gray-700, #offline-chat-detail.inverted-world #offline-conquest-display .text-gray-700 { color: #ff4444 !important; }

#chat-detail.inverted-world #conquest-text, #offline-chat-detail.inverted-world #offline-conquest-text { color: #ff6666 !important; }

#chat-detail.inverted-world #inner-voice-card, #offline-chat-detail.inverted-world #offline-inner-voice-card { background-color: #1a1a1a; border-color: #444; color: #ccc; }

/* 购物专属样式 */

.shop-card { background: white; border-radius: 12px; overflow: hidden; border: 1px solid #f0f0f0; padding: 8px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.03); cursor: pointer; transition: transform 0.2s; height: max-content; }

.shop-card:active { transform: scale(0.96); }

.shop-img-box { background: #f9f9f9; border-radius: 8px; height: 110px; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: bold; color: #ff5000; text-shadow: 0 2px 6px rgba(255,80,0,0.2); flex-shrink: 0; }

/* 交互动态滤镜用 */

.char-pressing { transform: perspective(800px) scale(0.95) !important; transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1) !important; }

/* 适配安全区 */

.pb-safe { padding-bottom: env(safe-area-inset-bottom); }

/* SVG Icons 全局样式适配 */

.svg-icon { width: 1em; height: 1em; display: inline-block; }

/* 群聊图谱连线样式 */

.graph-line { stroke: #999; stroke-width: 2; }

.graph-text { font-size: 10px; fill: #666; font-weight: bold; background: white; }

/* ─── 角色主页：莫兰迪文字云风格个性标签（无背景色，大小不一） ─── */

.char-tag-text {
    display: inline-block;
    line-height: 1.4;
    white-space: nowrap;
    cursor: default;
    user-select: none;
    transition: opacity 0.15s, transform 0.15s;
}

.char-tag-text:active {
    opacity: 0.6;
    transform: scale(0.96);
}

.ctag-xs { font-size: 11px; font-weight: 400; letter-spacing: 0.2px; }
.ctag-sm { font-size: 13px; font-weight: 500; letter-spacing: 0.2px; }
.ctag-md { font-size: 16.5px; font-weight: 600; letter-spacing: 0.1px; }
.ctag-lg { font-size: 21px; font-weight: 700; }
.ctag-xl { font-size: 26px; font-weight: 800; }

.char-tags-section {
    border-top: 1px solid rgba(0,0,0,0.06);
}

.char-tags-refresh-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #aaa;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.char-tags-refresh-btn:active {
    background: rgba(0,0,0,0.06);
    color: #666;
}

.char-tags-empty {
    font-size: 11.5px;
    color: #bbb;
    padding: 4px 0;
    font-style: italic;
}


/* ══════════════════════════════════════════
   气泡上下文菜单 – 渐变边框 + 线性图标
   ══════════════════════════════════════════ */

/* 渐变边框：用 padding + 背景渐变模拟 border-image 与 border-radius 共存 */
.bubble-ctx-outer {
  background: linear-gradient(145deg, #d0d0d0 0%, #7a7a7a 100%);
  padding: 1.5px;
  border-radius: 15px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.08);
  transform-origin: top left;
  animation: ctx-pop .15s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes ctx-pop {
  from { opacity: 0; transform: scale(.88); }
  to   { opacity: 1; transform: scale(1); }
}

.bubble-ctx-inner {
  background: #ffffff;
  border-radius: 13.5px;
  padding: 11px 14px 10px;
}

.bubble-ctx-row1 {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.bubble-ctx-row2 {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid #f0f0f0;
}

.bubble-ctx-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .12s, transform .12s;
  min-width: 36px;
}
.bubble-ctx-action:active {
  opacity: .55;
  transform: scale(.9);
}
.bubble-ctx-icon {
  width: 23px;
  height: 23px;
  color: #1a1a1a;
  display: block;
}
.bubble-ctx-action span {
  font-size: 10px;
  color: #333;
  white-space: nowrap;
  letter-spacing: 0.01em;
  line-height: 1;
}

/* 插入按钮角色选择 */
.insert-role-btn {
  background: #f3f4f6;
  color: #555;
  border: 1.5px solid transparent;
}
.insert-role-btn.insert-role-active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

/* 编辑弹窗渐变边框 */
.bubble-modal-outer {
  background: linear-gradient(145deg, #d0d0d0 0%, #6b7280 100%);
  padding: 2px;
  border-radius: 1.5rem; /* 24px, rounded-3xl */
  box-shadow: 0 8px 28px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
  width: 100%;
  max-width: 28rem; /* max-w-md */
}
.bubble-modal-inner {
  background: #ffffff;
  border-radius: calc(1.5rem - 2px);
  overflow: hidden;
  width: 100%;
}

/* 竖向长方形编辑栏（去掉底部按钮后，整体变为竖长矩形） */
.bubble-modal-vertical {
  max-width: 22rem;
  height: 68vh;
  max-height: 580px;
}
.bubble-modal-vertical-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ── 一起听歌小组件 - 歌词滚动动画 ── */
@keyframes ltw-lyrics-scroll {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}
.ltw-lyrics-animate {
    animation: ltw-lyrics-scroll 18s linear infinite;
    will-change: transform;
}
.ltw-lyrics-animate:hover {
    animation-play-state: paused;
}

/* ── iOS 风格开关 ── */
.ios-toggle {
  position: relative;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}
.ios-toggle input { display: none; }
.ios-toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 13px;
  background: #d1d5db;
  transition: background 0.25s ease;
}
.ios-toggle.on .ios-toggle-track {
  background: #404040;
}
.ios-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.22), 0 1px 2px rgba(0,0,0,0.12);
  transition: transform 0.25s ease;
}
.ios-toggle.on .ios-toggle-knob {
  transform: translateX(20px);
}

/* ── 思考链 ── */
.thinking-chain-wrapper {
  display: block;
  padding: 2px 16px 6px 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.thinking-chain-block {
  cursor: pointer;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  user-select: none;
}
.thinking-header {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #5a5a5a;
  font-size: 11.5px;
  line-height: 1;
}
.thinking-dots {
  display: flex;
  gap: 3px;
  align-items: center;
}
.thinking-dots span {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #8a8a8a;
}
.thinking-label {
  color: #6a6a6a;
  font-size: 11.5px;
  letter-spacing: 0.02em;
}
.thinking-chevron {
  display: inline-block;
  color: #8a8a8a;
  font-size: 13px;
  line-height: 1;
  transition: transform 0.2s ease;
  transform: rotate(0deg);
}
.thinking-chain-block.open .thinking-chevron {
  transform: rotate(90deg);
}
.thinking-body {
  display: none;
  color: #5a5a5a;
  font-size: 11px;
  white-space: pre-wrap;
  line-height: 1.65;
  margin-top: 6px;
  padding-left: 2px;
  max-height: 280px;
  overflow-y: auto;
  word-break: break-all;
}
.thinking-chain-block.open .thinking-body {
  display: block;
}
@keyframes thinking-dot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}
.thinking-chain-block.thinking-streaming .thinking-dots span {
  animation: thinking-dot-bounce 1.1s ease-in-out infinite;
}
.thinking-chain-block.thinking-streaming .thinking-dots span:nth-child(2) {
  animation-delay: 0.18s;
}
.thinking-chain-block.thinking-streaming .thinking-dots span:nth-child(3) {
  animation-delay: 0.36s;
}
.thinking-chain-block.thinking-streaming .thinking-label {
  color: #4a7fcb;
}
.thinking-chain-block.thinking-streaming .thinking-body {
  color: #4a4a4a;
}
.streaming-active::after {
  content: '▎';
  display: inline-block;
  color: #888;
  animation: streaming-blink 0.7s steps(1) infinite;
  margin-left: 1px;
  font-size: 0.95em;
  vertical-align: baseline;
}
@keyframes streaming-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}


/* ===== 小剧场模式（Theater Mode） ===== */

/* 隐藏进入小剧场之前的消息 */
.theater-hidden {
  display: none !important;
}

/* 整体背景 —— 深灰暗夜 */
#offline-chat-detail.theater-mode {
  background: #111111 !important;
}

/* 消息流区域 */
#offline-chat-detail.theater-mode #offline-msg-flow {
  background: transparent !important;
  padding: 16px 10px !important;
}

/* 顶栏：半透明深灰 */
#offline-chat-detail.theater-mode #chat-top-bar-offline {
  background: rgba(18, 18, 18, 0.96) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}
/* 顶栏文字颜色 */
#offline-chat-detail.theater-mode #chat-top-bar-offline * {
  color: #ffffff !important;
}

/* 窗口标签栏 */
#offline-chat-detail.theater-mode #offline-chat-tabs-wrapper {
  background: rgba(18, 18, 18, 0.92) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* ── 隐藏头像，气泡紧贴边缘 ── */
#offline-chat-detail.theater-mode .chat-avatar {
  display: none !important;
}
#offline-chat-detail.theater-mode .chat-item {
  gap: 0 !important;
}

/* 气泡：全宽 */
#offline-chat-detail.theater-mode .chat-bubble {
  max-width: 100% !important;
  width: 100% !important;
  border-radius: 10px !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
}

/* AI 气泡：叙事散文感 */
#offline-chat-detail.theater-mode .chat-ai .chat-bubble {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #f0f0f0 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  font-size: 14px !important;
  line-height: 1.8 !important;
}

/* 用户气泡：浅灰 */
#offline-chat-detail.theater-mode .chat-user .chat-bubble {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #e8e8e8 !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

/* 系统消息 */
#offline-chat-detail.theater-mode .chat-sys-inner {
  background: rgba(255, 255, 255, 0.06) !important;
  color: rgba(255, 255, 255, 0.4) !important;
}

/* 输入栏 */
#offline-chat-detail.theater-mode #offline-input-panel-container {
  background: rgba(18, 18, 18, 0.98) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}
#offline-chat-detail.theater-mode #offline-msg-input {
  background: rgba(255, 255, 255, 0.07) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}
#offline-chat-detail.theater-mode #offline-msg-input::placeholder {
  color: rgba(255, 255, 255, 0.3) !important;
}

/* 颠倒世界模式与小剧场共存时的气泡色覆盖 */
#offline-chat-detail.theater-mode.inverted-world .chat-bubble {
  background-color: #1e1e1e !important;
  color: #f0f0f0 !important;
  border-color: #333333 !important;
}
#offline-chat-detail.theater-mode.inverted-world .chat-user .chat-bubble {
  background-color: #2a2a2a !important;
  color: #e0e0e0 !important;
}

/* 小剧场模式指示徽章 */
#offline-theater-indicator {
  display: none;
  font-size: 11px;
  color: #ffffff;
  background: rgba(80, 80, 80, 0.6);
  border: 1px solid rgba(200, 200, 200, 0.3);
  border-radius: 20px;
  padding: 2px 8px;
  margin-left: 8px;
  flex-shrink: 0;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
#offline-theater-indicator.visible {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}


/* ===== 小剧场存档 — 书本卡片 ===== */

.theater-book-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 4px 0 40px;
}

.theater-book-card {
    border-radius: 12px;
    display: flex;
    min-height: 132px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.theater-book-card:active {
    transform: scale(0.95);
    box-shadow: 0 1px 5px rgba(0,0,0,0.08);
}

.theater-book-spine {
    width: 9px;
    flex-shrink: 0;
}

.theater-book-content {
    flex: 1;
    padding: 14px 12px 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.theater-book-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.55;
    letter-spacing: 0.01em;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.theater-book-date {
    font-size: 10px;
    color: #c0c0c0;
    margin-top: 10px;
    letter-spacing: 0.03em;
}

/* ===== 小剧场选择条目 ===== */

.theater-select-item {
    display: flex;
    align-items: stretch;
    background: #f8f8f8;
    border-radius: 14px;
    margin-bottom: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.12s ease;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

.theater-select-item:active {
    transform: scale(0.97);
}

.theater-select-spine {
    width: 6px;
    flex-shrink: 0;
}

.theater-select-info {
    flex: 1;
    padding: 13px 14px;
}

.theater-select-title {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 5px;
}

.theater-select-preview {
    font-size: 11.5px;
    color: #aaa;
    line-height: 1.5;
}


/* ===================================================
   小剧场历史查看器 — 小说内页 · INS 简约风
   =================================================== */

/* 遮罩 */
.th-viewer-backdrop {
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background 0.3s ease;
}
#theater-history-viewer.visible .th-viewer-backdrop {
    background: rgba(0, 0, 0, 0.38);
}

/* 面板整体 */
.th-viewer-panel {
    background: #ffffff;
    border-radius: 28px 28px 0 0;
    max-height: 88vh;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
}
#theater-history-viewer.visible .th-viewer-panel {
    transform: translateY(0);
}

/* 页眉文字 */
.th-viewer-eyebrow {
    font-size: 9.5px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #c8bfce;
    margin-bottom: 4px;
    font-weight: 500;
}
.th-viewer-title {
    font-size: 21px;
    font-weight: 700;
    color: #1a1a24;
    line-height: 1.25;
    letter-spacing: -0.01em;
}
.th-viewer-meta {
    font-size: 11px;
    color: #b0a8ba;
    margin-top: 4px;
    letter-spacing: 0.02em;
}

/* 内容滚动区 */
.th-viewer-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 24px 8px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* 思维链折叠块 */
.th-thinking {
    background: rgba(139, 92, 246, 0.04);
    border: 1px solid rgba(139, 92, 246, 0.11);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: background 0.15s;
}
.th-thinking:active {
    background: rgba(139, 92, 246, 0.07);
}
.th-thinking-hd {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    font-size: 10.5px;
    color: rgba(139, 92, 246, 0.65);
    letter-spacing: 0.04em;
    user-select: none;
}
.th-thinking-dots {
    display: inline-flex;
    gap: 3px;
    align-items: center;
}
.th-thinking-dots span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.4);
}
.th-thinking-lbl {
    flex: 1;
}
.th-thinking-chv {
    font-size: 13px;
    color: rgba(139, 92, 246, 0.4);
    transition: transform 0.2s ease;
    display: inline-block;
}
.th-thinking.open .th-thinking-chv {
    transform: rotate(90deg);
}
.th-thinking-bd {
    display: none;
    padding: 4px 14px 12px;
    font-size: 11.5px;
    color: #9a90a8;
    line-height: 1.75;
    border-top: 1px solid rgba(139, 92, 246, 0.07);
    max-height: 180px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}
.th-thinking.open .th-thinking-bd {
    display: block;
}

/* AI 叙述段落 */
.th-novel-ai {
    font-size: 14.5px;
    line-height: 1.95;
    color: #2a2030;
    letter-spacing: 0.008em;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 用户对话（靠右、浅色） */
.th-novel-user {
    font-size: 13px;
    line-height: 1.75;
    color: #a098b0;
    text-align: right;
    white-space: pre-wrap;
    word-break: break-word;
    padding-right: 14px;
    position: relative;
}
.th-novel-user::after {
    content: '';
    position: absolute;
    right: 0;
    top: 4px;
    bottom: 4px;
    width: 2.5px;
    background: linear-gradient(to bottom, #ddd4f0, #f0ecf8);
    border-radius: 2px;
}

/* 分隔装饰 */
.th-novel-div {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    flex-shrink: 0;
}
.th-novel-div-line {
    flex: 1;
    height: 1px;
    background: #f0ecf4;
}
.th-novel-div-dot {
    font-size: 8px;
    color: #d8d0e8;
    line-height: 1;
}

/* 页脚 */
.th-viewer-footer {
    padding: 12px 0 calc(20px + env(safe-area-inset-bottom));
    text-align: center;
    border-top: 1px solid #f6f2fa;
    flex-shrink: 0;
}
.th-viewer-end-mark {
    font-size: 10px;
    letter-spacing: 0.22em;
    color: #d0c8da;
    text-transform: uppercase;
    font-weight: 400;
}

/* ===================================================
   归档提示 Toast
   =================================================== */
/* ===================================================
   历史编辑模式 — 删除按钮
   =================================================== */

.theater-book-card--edit {
    overflow: visible;
    /* 轻微抖动动画提示可编辑 */
    animation: th-edit-shake 0.35s ease both;
}

@keyframes th-edit-shake {
    0%   { transform: rotate(0deg); }
    25%  { transform: rotate(-0.8deg); }
    75%  { transform: rotate(0.8deg); }
    100% { transform: rotate(0deg); }
}

.theater-history-delete-btn {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 20px;
    height: 20px;
    background: #ff4757;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #f4f4f4;
    box-shadow: 0 1px 5px rgba(0,0,0,0.18);
    z-index: 10;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.12s ease;
}

.theater-history-delete-btn:active {
    transform: scale(0.85);
}

/* ===================================================
   小剧场命名弹窗 — 底部滑入动画
   =================================================== */

.theater-naming-sheet {
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
}

.theater-naming-sheet.visible {
    transform: translateY(0);
}

#theater-naming-modal {
    transition: background 0.3s ease;
}

.theater-archive-toast {
    position: fixed;
    bottom: 88px;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: rgba(30, 20, 50, 0.82);
    color: #e8e0f8;
    font-size: 12.5px;
    padding: 9px 18px;
    border-radius: 20px;
    z-index: 9999;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
    pointer-events: none;
    letter-spacing: 0.02em;
}
.theater-archive-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
