/**
 * 记忆管理并发系统 - 样式表
 */

/* ============================================================================
   变量定义
   ============================================================================ */
:root {
  --mm-primary: #4a90d9;
  --mm-primary-dark: #3a7bc8;
  --mm-primary-light: #6ba3e0;
  --mm-secondary: #6c757d;
  --mm-success: #28a745;
  --mm-warning: #ffc107;
  --mm-danger: #dc3545;
  --mm-bg: #1a1a2e;
  --mm-bg-secondary: #16213e;
  --mm-bg-card: #0f3460;
  --mm-text: #e4e4e4;
  --mm-text-muted: #8a8a8a;
  --mm-border: #2a2a4a;
  --mm-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  --mm-radius: 8px;
  --mm-transition: all 0.3s ease;
}

/* 配色方案：暖灰棕 - 温暖沉稳 */
[data-mm-theme="warm-brown"] {
  --mm-primary: #a08070;
  --mm-primary-dark: #8b6f60;
  --mm-primary-light: #b89585;
  --mm-bg: #2a2520;
  --mm-bg-secondary: #1f1b18;
  --mm-bg-card: #3d352e;
  --mm-text: #e8e4e0;
  --mm-text-muted: #9a9590;
  --mm-border: #4a4035;
}

/* 配色方案：淡紫薰衣草 - 柔和可爱 */
[data-mm-theme="lavender"] {
  --mm-primary: #9b8aa8;
  --mm-primary-dark: #8678a0;
  --mm-primary-light: #b0a0bc;
  --mm-bg: #1e1a24;
  --mm-bg-secondary: #16131a;
  --mm-bg-card: #2d2838;
  --mm-text: #e8e6ec;
  --mm-text-muted: #908898;
  --mm-border: #3a3545;
}

/* 配色方案：森林绿 - 自然清新 */
[data-mm-theme="forest"] {
  --mm-primary: #6a9a7a;
  --mm-primary-dark: #5a8a6a;
  --mm-primary-light: #7aaa8a;
  --mm-bg: #1a2420;
  --mm-bg-secondary: #141c18;
  --mm-bg-card: #253530;
  --mm-text: #e4e8e6;
  --mm-text-muted: #8a9a90;
  --mm-border: #354540;
}

/* 配色方案：玫瑰灰 - 温柔可爱 */
[data-mm-theme="rose"] {
  --mm-primary: #b08a90;
  --mm-primary-dark: #a07880;
  --mm-primary-light: #c09aa0;
  --mm-bg: #241a1c;
  --mm-bg-secondary: #1a1416;
  --mm-bg-card: #382830;
  --mm-text: #ece6e8;
  --mm-text-muted: #988890;
  --mm-border: #453540;
}

/* 配色方案：静谧蓝灰 - 沉稳内敛 */
[data-mm-theme="slate"] {
  --mm-primary: #7a8a98;
  --mm-primary-dark: #6a7a88;
  --mm-primary-light: #8a9aa8;
  --mm-bg: #1a1e22;
  --mm-bg-secondary: #14181c;
  --mm-bg-card: #282e35;
  --mm-text: #e4e6e8;
  --mm-text-muted: #8a9098;
  --mm-border: #353a42;
}

/* 配色方案：星空紫 - 神秘典雅 */
[data-mm-theme="starry-purple"] {
  --mm-primary: #9d7cd8;
  --mm-primary-dark: #8b6cc0;
  --mm-primary-light: #b08ee8;
  --mm-bg: #0d0a14;
  --mm-bg-secondary: #08060e;
  --mm-bg-card: #1a1525;
  --mm-text: #e8e4f0;
  --mm-text-muted: #8a80a0;
  --mm-border: #2a2040;
}

/* 配色方案：星空蓝 - 深邃宁静 */
[data-mm-theme="starry-blue"] {
  --mm-primary: #5d8fca;
  --mm-primary-dark: #4a7ab5;
  --mm-primary-light: #70a0d8;
  --mm-bg: #080c14;
  --mm-bg-secondary: #050810;
  --mm-bg-card: #101828;
  --mm-text: #e4e8f0;
  --mm-text-muted: #7088a8;
  --mm-border: #1a2840;
}

/* 配色方案：星空黑 - 深沉内敛 */
[data-mm-theme="starry-black"] {
  --mm-primary: #888888;
  --mm-primary-dark: #707070;
  --mm-primary-light: #a0a0a0;
  --mm-bg: #0a0a0c;
  --mm-bg-secondary: #050506;
  --mm-bg-card: #141418;
  --mm-text: #e8e8ea;
  --mm-text-muted: #686870;
  --mm-border: #252528;
}

/* 主题切换器样式 */
.mm-theme-switcher {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--mm-border);
  margin-top: 8px;
}

.mm-theme-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mm-theme-label {
  font-size: 11px;
  color: var(--mm-text-muted);
  width: 28px;
  flex-shrink: 0;
}

.mm-theme-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mm-theme-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--mm-transition);
  position: relative;
  overflow: hidden;
}

.mm-theme-btn:hover {
  transform: scale(1.15);
}

.mm-theme-btn.active {
  border-color: var(--mm-text);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* 纯色主题按钮 */
.mm-theme-btn[data-theme="default"] { background: linear-gradient(135deg, #1a1a2e, #4a90d9); }
.mm-theme-btn[data-theme="warm-brown"] { background: linear-gradient(135deg, #2a2520, #a08070); }
.mm-theme-btn[data-theme="lavender"] { background: linear-gradient(135deg, #1e1a24, #9b8aa8); }
.mm-theme-btn[data-theme="forest"] { background: linear-gradient(135deg, #1a2420, #6a9a7a); }
.mm-theme-btn[data-theme="rose"] { background: linear-gradient(135deg, #241a1c, #b08a90); }
.mm-theme-btn[data-theme="slate"] { background: linear-gradient(135deg, #1a1e22, #7a8a98); }

/* 星空主题按钮 - 带星星点缀 */
.mm-theme-btn[data-theme="starry-purple"] {
  background:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 60%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 40% 80%, rgba(255,255,255,0.5) 0%, transparent 100%),
    linear-gradient(135deg, #0d0a14 0%, #2a1a40 50%, #9d7cd8 100%);
}

.mm-theme-btn[data-theme="starry-blue"] {
  background:
    radial-gradient(1px 1px at 25% 25%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 75% 45%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 50% 75%, rgba(255,255,255,0.5) 0%, transparent 100%),
    linear-gradient(135deg, #080c14 0%, #102040 50%, #5d8fca 100%);
}

.mm-theme-btn[data-theme="starry-black"] {
  background:
    radial-gradient(1px 1px at 30% 20%, rgba(255,255,255,0.9) 0%, transparent 100%),
    radial-gradient(1px 1px at 65% 55%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 85%, rgba(255,255,255,0.5) 0%, transparent 100%),
    linear-gradient(135deg, #0a0a0c 0%, #1a1a1e 50%, #404048 100%);
}

/* ============================================================================
   星空主题面板特效 - 华丽梦幻版
   ============================================================================ */

/* 闪烁星星层 */
.mm-stars-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.mm-star {
  position: absolute;
  border-radius: 50%;
  background: white;
  animation: mm-star-twinkle var(--twinkle-duration, 3s) ease-in-out infinite;
  animation-delay: var(--twinkle-delay, 0s);
}

/* 大星星 - 带光晕 */
.mm-star-large {
  width: 3px;
  height: 3px;
  box-shadow:
    0 0 4px 1px var(--star-glow, rgba(255,255,255,0.8)),
    0 0 8px 2px var(--star-glow-outer, rgba(200,180,255,0.4));
}

/* 中星星 */
.mm-star-medium {
  width: 2px;
  height: 2px;
  box-shadow: 0 0 3px 1px var(--star-glow, rgba(255,255,255,0.6));
}

/* 小星星 */
.mm-star-small {
  width: 1px;
  height: 1px;
  box-shadow: 0 0 2px 1px var(--star-glow, rgba(255,255,255,0.4));
}

/* 闪烁动画 */
@keyframes mm-star-twinkle {
  0%, 100% {
    opacity: var(--star-opacity-min, 0.3);
    transform: scale(0.8);
  }
  50% {
    opacity: var(--star-opacity-max, 1);
    transform: scale(1.2);
  }
}

/* 流星 */
.mm-shooting-star {
  position: absolute;
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg,
    rgba(255,255,255,1) 0%,
    rgba(255,255,255,0.5) 40%,
    rgba(255,255,255,0.1) 80%,
    transparent 100%);
  border-radius: 0.5px;
  transform: rotate(145deg);
  transform-origin: left center;
  opacity: 0;
  box-shadow: 0 0 3px 0.5px rgba(255,255,255,0.3);
}

@keyframes mm-shooting-star {
  0% {
    opacity: 0;
    transform: rotate(145deg) translateX(0);
  }
  3% {
    opacity: 0.5;
  }
  10% {
    opacity: 1;
  }
  18% {
    opacity: 0.8;
  }
  25% {
    opacity: 0;
    transform: rotate(145deg) translateX(350px);
  }
  100% {
    opacity: 0;
    transform: rotate(145deg) translateX(350px);
  }
}

/* 星空紫主题星星颜色 */
[data-mm-theme="starry-purple"] .mm-star {
  --star-glow: rgba(200, 180, 255, 0.8);
  --star-glow-outer: rgba(180, 140, 255, 0.4);
}

/* 星空蓝主题星星颜色 */
[data-mm-theme="starry-blue"] .mm-star {
  --star-glow: rgba(180, 220, 255, 0.8);
  --star-glow-outer: rgba(120, 180, 255, 0.4);
}

/* 星空黑主题星星颜色 */
[data-mm-theme="starry-black"] .mm-star {
  --star-glow: rgba(220, 220, 240, 0.8);
  --star-glow-outer: rgba(180, 180, 200, 0.4);
}

/* 确保面板内容在星星层之上 */
[data-mm-theme^="starry-"] .mm-panel-header,
[data-mm-theme^="starry-"] .mm-panel-content,
[data-mm-theme^="starry-"] .mm-settings-header,
[data-mm-theme^="starry-"] .mm-settings-content,
[data-mm-theme^="starry-"] .mm-settings-footer,
[data-mm-theme^="starry-"] .mm-theme-switcher {
  position: relative;
  z-index: 1;
}

/* 星空紫 - 梦幻紫罗兰星空 */
[data-mm-theme="starry-purple"].mm-panel,
[data-mm-theme="starry-purple"].mm-settings {
  background:
    linear-gradient(135deg,
      transparent 0%,
      rgba(200, 170, 255, 0.08) 25%,
      rgba(180, 140, 255, 0.12) 50%,
      rgba(200, 170, 255, 0.08) 75%,
      transparent 100%),
    radial-gradient(ellipse 150% 100% at 0% 0%, rgba(180, 130, 255, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse 120% 80% at 100% 100%, rgba(140, 100, 220, 0.2) 0%, transparent 45%),
    radial-gradient(ellipse 80% 120% at 100% 20%, rgba(200, 160, 255, 0.15) 0%, transparent 40%),
    radial-gradient(3px 3px at 15% 10%, rgba(255,255,255,1) 0%, rgba(200,180,255,0.5) 50%, transparent 100%),
    radial-gradient(3px 3px at 85% 15%, rgba(255,255,255,1) 0%, rgba(200,180,255,0.5) 50%, transparent 100%),
    radial-gradient(2px 2px at 45% 25%, rgba(255,255,255,0.95) 0%, transparent 100%),
    radial-gradient(3px 3px at 75% 45%, rgba(255,255,255,1) 0%, rgba(200,180,255,0.5) 50%, transparent 100%),
    radial-gradient(2px 2px at 25% 55%, rgba(255,255,255,0.9) 0%, transparent 100%),
    radial-gradient(3px 3px at 90% 70%, rgba(255,255,255,1) 0%, rgba(200,180,255,0.5) 50%, transparent 100%),
    radial-gradient(2px 2px at 35% 80%, rgba(255,255,255,0.95) 0%, transparent 100%),
    radial-gradient(3px 3px at 10% 90%, rgba(255,255,255,1) 0%, rgba(200,180,255,0.5) 50%, transparent 100%),
    radial-gradient(1px 1px at 8% 20%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 22% 35%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 15%, rgba(255,255,255,0.75) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 30%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 40% 50%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 60%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 18% 70%, rgba(255,255,255,0.75) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 55%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 50% 85%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 95% 40%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 5% 45%, rgba(255,255,255,0.75) 0%, transparent 100%),
    radial-gradient(1px 1px at 65% 95%, rgba(255,255,255,0.7) 0%, transparent 100%),
    linear-gradient(180deg, #0a0510 0%, #120820 50%, #0d0515 100%) !important;
}

/* 星空蓝 - 深邃海洋星空 */
[data-mm-theme="starry-blue"].mm-panel,
[data-mm-theme="starry-blue"].mm-settings {
  background:
    linear-gradient(135deg,
      transparent 0%,
      rgba(150, 200, 255, 0.08) 25%,
      rgba(120, 180, 255, 0.12) 50%,
      rgba(150, 200, 255, 0.08) 75%,
      transparent 100%),
    radial-gradient(ellipse 150% 100% at 0% 0%, rgba(100, 180, 255, 0.22) 0%, transparent 50%),
    radial-gradient(ellipse 120% 80% at 100% 100%, rgba(80, 140, 220, 0.18) 0%, transparent 45%),
    radial-gradient(ellipse 80% 120% at 100% 20%, rgba(130, 200, 255, 0.12) 0%, transparent 40%),
    radial-gradient(3px 3px at 12% 8%, rgba(255,255,255,1) 0%, rgba(180,220,255,0.5) 50%, transparent 100%),
    radial-gradient(3px 3px at 88% 18%, rgba(255,255,255,1) 0%, rgba(180,220,255,0.5) 50%, transparent 100%),
    radial-gradient(2px 2px at 42% 22%, rgba(255,255,255,0.95) 0%, transparent 100%),
    radial-gradient(3px 3px at 72% 42%, rgba(255,255,255,1) 0%, rgba(180,220,255,0.5) 50%, transparent 100%),
    radial-gradient(2px 2px at 28% 58%, rgba(255,255,255,0.9) 0%, transparent 100%),
    radial-gradient(3px 3px at 92% 68%, rgba(255,255,255,1) 0%, rgba(180,220,255,0.5) 50%, transparent 100%),
    radial-gradient(2px 2px at 38% 78%, rgba(255,255,255,0.95) 0%, transparent 100%),
    radial-gradient(3px 3px at 8% 88%, rgba(255,255,255,1) 0%, rgba(180,220,255,0.5) 50%, transparent 100%),
    radial-gradient(1px 1px at 5% 15%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 25% 32%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 58% 12%, rgba(255,255,255,0.75) 0%, transparent 100%),
    radial-gradient(1px 1px at 68% 35%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 48%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 62% 62%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 72%, rgba(255,255,255,0.75) 0%, transparent 100%),
    radial-gradient(1px 1px at 82% 52%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 52% 88%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 92% 38%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 3% 48%, rgba(255,255,255,0.75) 0%, transparent 100%),
    radial-gradient(1px 1px at 68% 92%, rgba(255,255,255,0.7) 0%, transparent 100%),
    linear-gradient(180deg, #050812 0%, #081020 50%, #050a15 100%) !important;
}

/* 星空黑 - 银河深空 */
[data-mm-theme="starry-black"].mm-panel,
[data-mm-theme="starry-black"].mm-settings {
  background:
    linear-gradient(135deg,
      transparent 0%,
      rgba(200, 200, 220, 0.05) 25%,
      rgba(180, 180, 200, 0.08) 50%,
      rgba(200, 200, 220, 0.05) 75%,
      transparent 100%),
    radial-gradient(ellipse 150% 100% at 0% 0%, rgba(150, 150, 180, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 120% 80% at 100% 100%, rgba(130, 130, 160, 0.1) 0%, transparent 45%),
    radial-gradient(ellipse 80% 120% at 100% 20%, rgba(170, 170, 200, 0.08) 0%, transparent 40%),
    radial-gradient(3px 3px at 10% 12%, rgba(255,255,255,1) 0%, rgba(220,220,240,0.5) 50%, transparent 100%),
    radial-gradient(3px 3px at 90% 15%, rgba(255,255,255,1) 0%, rgba(220,220,240,0.5) 50%, transparent 100%),
    radial-gradient(2px 2px at 40% 28%, rgba(255,255,255,0.95) 0%, transparent 100%),
    radial-gradient(3px 3px at 70% 48%, rgba(255,255,255,1) 0%, rgba(220,220,240,0.5) 50%, transparent 100%),
    radial-gradient(2px 2px at 22% 62%, rgba(255,255,255,0.9) 0%, transparent 100%),
    radial-gradient(3px 3px at 88% 72%, rgba(255,255,255,1) 0%, rgba(220,220,240,0.5) 50%, transparent 100%),
    radial-gradient(2px 2px at 32% 85%, rgba(255,255,255,0.95) 0%, transparent 100%),
    radial-gradient(3px 3px at 5% 92%, rgba(255,255,255,1) 0%, rgba(220,220,240,0.5) 50%, transparent 100%),
    radial-gradient(1px 1px at 6% 22%, rgba(255,255,255,0.85) 0%, transparent 100%),
    radial-gradient(1px 1px at 28% 38%, rgba(255,255,255,0.75) 0%, transparent 100%),
    radial-gradient(1px 1px at 52% 18%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 72% 32%, rgba(255,255,255,0.75) 0%, transparent 100%),
    radial-gradient(1px 1px at 42% 52%, rgba(255,255,255,0.85) 0%, transparent 100%),
    radial-gradient(1px 1px at 58% 65%, rgba(255,255,255,0.75) 0%, transparent 100%),
    radial-gradient(1px 1px at 12% 75%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 78% 58%, rgba(255,255,255,0.75) 0%, transparent 100%),
    radial-gradient(1px 1px at 48% 90%, rgba(255,255,255,0.85) 0%, transparent 100%),
    radial-gradient(1px 1px at 95% 42%, rgba(255,255,255,0.75) 0%, transparent 100%),
    radial-gradient(1px 1px at 2% 52%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 62% 95%, rgba(255,255,255,0.75) 0%, transparent 100%),
    linear-gradient(180deg, #050507 0%, #08080c 50%, #050506 100%) !important;
}

/* ============================================================================
   基础组件
   ============================================================================ */

/* 按钮 */
.mm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--mm-radius);
  cursor: pointer;
  font-size: 14px;
  transition: var(--mm-transition);
  background: var(--mm-bg-card);
  color: var(--mm-text);
}

.mm-btn:hover {
  background: var(--mm-primary);
}

.mm-btn-primary {
  background: var(--mm-primary);
  color: white;
}

.mm-btn-primary:hover {
  background: var(--mm-primary-dark);
}

.mm-btn-secondary {
  background: var(--mm-secondary);
  color: white;
}

.mm-btn-danger {
  background: var(--mm-danger);
  color: white;
}

.mm-btn-warning {
  background: #e67e22;
  color: white;
}

.mm-btn-warning:hover {
  background: #d35400;
}

.mm-btn-icon {
  padding: 8px;
  width: 36px;
  height: 36px;
}

.mm-btn-xs {
  padding: 4px 8px;
  font-size: 12px;
}

/* 徽章 */
.mm-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  background: var(--mm-primary);
  color: white;
}

/* 状态指示器 */
.mm-status-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
}

.mm-status-ready {
  background: var(--mm-success);
  animation: pulse 2s infinite;
}

.mm-status-processing {
  background: var(--mm-warning);
  animation: pulse 0.5s infinite;
}

.mm-status-error {
  background: var(--mm-danger);
}

.mm-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

.mm-status-active {
  background: var(--mm-success);
}

.mm-status-inactive {
  background: var(--mm-secondary);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* 文本样式 */
.text-success {
  color: var(--mm-success) !important;
}

.text-warning {
  color: var(--mm-warning) !important;
}

.text-danger {
  color: var(--mm-danger) !important;
}

.mm-hint {
  font-size: 12px;
  color: var(--mm-text-muted);
  margin-top: 4px;
}

.mm-required {
  color: var(--mm-danger);
}

.mm-hidden {
  display: none !important;
}

/* 空状态 */
.mm-empty-state,
.mm-error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--mm-text-muted);
  text-align: center;
}

.mm-empty-state i,
.mm-error-state i {
  font-size: 32px;
  margin-bottom: 12px;
}

.mm-error-state {
  color: var(--mm-danger);
}

/* ============================================================================
   面板
   ============================================================================ */

.mm-panel {
  position: fixed;
  right: -400px;
  top: 0;
  width: 380px;
  height: 100vh;
  background: var(--mm-bg);
  border-left: 1px solid var(--mm-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: var(--mm-transition);
  border-radius: 0;
}

.mm-panel-visible {
  right: 0;
}

.mm-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--mm-border);
  background: var(--mm-bg-secondary);
  border-radius: 0;
  overflow: hidden;
}

.mm-panel-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--mm-text);
}

.mm-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 插件开关按钮 */
.mm-toggle-btn {
  position: relative;
  width: 36px;
  height: 20px;
  background: var(--mm-bg-secondary);
  border: 1px solid var(--mm-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.mm-toggle-btn:hover {
  border-color: var(--mm-primary);
}

.mm-toggle-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--mm-text-muted);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.mm-toggle-btn.mm-active {
  background: rgba(74, 144, 217, 0.3);
  border-color: var(--mm-primary);
}

.mm-toggle-btn.mm-active .mm-toggle-slider {
  left: 18px;
  background: var(--mm-primary);
}

.mm-panel-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  border-radius: 0 0 12px 0;
}

/* 区块 */
.mm-section {
  margin-bottom: 20px;
}

.mm-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.mm-section-title {
  font-size: 14px;
  font-weight: bold;
  color: var(--mm-text);
}

/* 世界书列表 */
.mm-worldbook-list {
  max-height: 450px;
  overflow-y: auto;
}

.mm-book-group {
  margin-bottom: 16px;
}

.mm-book-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  font-size: 13px;
  color: var(--mm-text-muted);
  border-bottom: 1px solid var(--mm-border);
}

.mm-book-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--mm-radius);
  background: var(--mm-bg-card);
  margin-top: 8px;
}

.mm-book-name {
  flex: 1;
  font-size: 14px;
  color: var(--mm-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-category-list {
  padding-left: 24px;
}

.mm-category-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin-top: 4px;
  border-radius: 4px;
  background: var(--mm-bg-secondary);
  font-size: 13px;
}

.mm-category-item span {
  flex: 1;
}

/* 详情面板 */
.mm-detail-panel {
  padding: 12px;
  background: var(--mm-bg-card);
  border-radius: var(--mm-radius);
  min-height: 100px;
}

/* 状态面板 */
.mm-status-panel {
  padding: 12px;
  background: var(--mm-bg-card);
  border-radius: var(--mm-radius);
}

.mm-status-item {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.mm-status-text {
  font-size: 14px;
  color: var(--mm-text);
}

.mm-status-info {
  font-size: 12px;
  color: var(--mm-text-muted);
}

.mm-status-info div {
  margin-top: 4px;
}

.mm-author-section {
  margin-top: 24px;
  padding: 12px;
  background: var(--mm-bg-card);
  border-radius: var(--mm-radius);
  border: 1px solid var(--mm-border);
  position: relative;
  overflow: visible;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.mm-author-section:hover {
  border-color: var(--mm-primary);
  box-shadow: 0 0 8px rgba(74, 144, 217, 0.3);
}

/* 各主题的悬停高亮颜色 */
[data-mm-theme="warm-brown"] .mm-author-section:hover {
  box-shadow: 0 0 8px rgba(160, 128, 112, 0.3);
}

[data-mm-theme="lavender"] .mm-author-section:hover {
  box-shadow: 0 0 8px rgba(155, 138, 168, 0.3);
}

[data-mm-theme="forest"] .mm-author-section:hover {
  box-shadow: 0 0 8px rgba(106, 154, 122, 0.3);
}

[data-mm-theme="rose"] .mm-author-section:hover {
  box-shadow: 0 0 8px rgba(176, 138, 144, 0.3);
}

[data-mm-theme="slate"] .mm-author-section:hover {
  box-shadow: 0 0 8px rgba(122, 138, 152, 0.3);
}

[data-mm-theme="starry-purple"] .mm-author-section:hover {
  box-shadow: 0 0 12px rgba(157, 124, 216, 0.4);
}

[data-mm-theme="starry-blue"] .mm-author-section:hover {
  box-shadow: 0 0 12px rgba(93, 143, 202, 0.4);
}

[data-mm-theme="starry-black"] .mm-author-section:hover {
  box-shadow: 0 0 8px rgba(136, 136, 136, 0.3);
}

.mm-author-info {
  text-align: center;
  font-size: 13px;
  color: var(--mm-primary);
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* 作者文字流光特效 */
.mm-author-text {
  background: linear-gradient(
    90deg,
    var(--mm-primary) 0%,
    var(--mm-primary-light) 25%,
    var(--mm-text) 50%,
    var(--mm-primary-light) 75%,
    var(--mm-primary) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: mm-shimmer 3s ease-in-out infinite;
}

@keyframes mm-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* 猫爪按钮 */
.mm-paw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: var(--mm-bg-secondary);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
}

.mm-paw-btn:hover {
  transform: scale(1.15);
  background: var(--mm-bg);
}

.mm-paw-btn:active {
  transform: scale(0.95);
}

/* 花朵容器 */
.mm-flower-container {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 150px;
  pointer-events: none;
  overflow: visible;
}

/* 飘落的花朵 */
.mm-falling-flower {
  position: absolute;
  font-size: 20px;
  animation: mm-flower-fall 2.5s ease-out forwards;
  pointer-events: none;
  z-index: 100;
}

@keyframes mm-flower-fall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(0.5);
  }
  30% {
    opacity: 1;
    transform: translateY(-100px) rotate(-20deg) scale(1.1);
  }
  100% {
    opacity: 0;
    transform: translateY(-30px) rotate(60deg) scale(0.7);
  }
}

/* 爱你哟文字 */
.mm-love-text {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  font-size: 16px;
  font-weight: bold;
  color: #ff6b9d;
  white-space: nowrap;
  animation: mm-love-float 2s ease-out forwards;
  pointer-events: none;
  z-index: 101;
  text-shadow: 0 0 10px rgba(255, 107, 157, 0.5);
}

@keyframes mm-love-float {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) translateY(-100px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-150px) scale(0.8);
  }
}

/* 警告文字 */
.mm-love-text.mm-warning-text {
  color: #ffa500;
  text-shadow: 0 0 10px rgba(255, 165, 0, 0.5);
}

/* 更新状态列表 */
.mm-updates-list {
  max-height: 120px;
  overflow-y: auto;
  background: var(--mm-bg-card);
  border-radius: var(--mm-radius);
  padding: 8px;
}

.mm-empty-hint {
  font-size: 12px;
  color: var(--mm-text-muted);
  text-align: center;
  padding: 8px;
}

.mm-update-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--mm-text);
  border-radius: 4px;
  margin-bottom: 4px;
  background: var(--mm-bg-secondary);
}

.mm-update-item:last-child {
  margin-bottom: 0;
}

.mm-update-item.mm-update-add {
  border-left: 2px solid var(--mm-success);
}

.mm-update-item.mm-update-change {
  border-left: 2px solid var(--mm-primary);
}

.mm-update-item.mm-update-chars {
  border-left: 2px solid var(--mm-warning);
}

.mm-update-item.mm-update-delete {
  border-left: 2px solid var(--mm-danger);
}

.mm-update-category {
  font-weight: 600;
  color: var(--mm-primary);
  white-space: nowrap;
}

.mm-update-text {
  flex: 1;
  color: var(--mm-text-muted);
  word-break: break-all;
}

.mm-update-text .mm-highlight {
  color: var(--mm-text);
  font-weight: 500;
}

.mm-update-time {
  font-size: 10px;
  color: var(--mm-text-muted);
  white-space: nowrap;
}

/* ============================================================================
   设置面板
   ============================================================================ */

.mm-settings {
  position: fixed;
  right: -400px;
  top: 0;
  width: 380px;
  height: 100vh;
  background: var(--mm-bg);
  border-left: 1px solid var(--mm-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transition: var(--mm-transition);
  border-radius: 0;
}

.mm-settings-visible {
  right: 0;
}

.mm-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--mm-border);
  background: var(--mm-bg-secondary);
  border-radius: 0;
  overflow: hidden;
}

.mm-settings-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--mm-text);
}

.mm-settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: 32px;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.mm-settings-section {
  margin-bottom: 24px;
}

.mm-settings-section h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: var(--mm-primary);
  border-bottom: 1px solid var(--mm-border);
  padding-bottom: 8px;
}

.mm-setting-item {
  margin-bottom: 12px;
}

.mm-setting-item label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--mm-text);
  cursor: pointer;
}

.mm-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.mm-input-row {
  display: flex;
  gap: 20px;
  margin-bottom: 12px;
  align-items: center;
}

.mm-input-row .mm-setting-item {
  flex: 1;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mm-setting-item input[type="number"] {
  width: 100px;
  padding: 6px 10px;
  border: 1px solid var(--mm-border);
  border-radius: 4px;
  background: var(--mm-bg-card);
  color: var(--mm-text);
}

.mm-input-row .mm-setting-item input[type="number"] {
  width: 80px;
  margin-left: auto;
}

.mm-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.mm-slider-row input[type="range"] {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--mm-bg-card);
  border-radius: 3px;
  cursor: pointer;
}

.mm-slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--mm-primary);
  cursor: pointer;
  transition: var(--mm-transition);
}

.mm-slider-row input[type="range"]::-webkit-slider-thumb:hover {
  background: var(--mm-primary-dark);
  transform: scale(1.1);
}

.mm-slider-row span {
  min-width: 24px;
  text-align: center;
  font-weight: bold;
  color: var(--mm-primary);
}

.mm-setting-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 配置管理按钮统一宽度 */
.mm-setting-actions .mm-btn {
  min-width: 120px;
}

/* AI 配置操作按钮 */
.mm-ai-config-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.mm-ai-config-actions .mm-btn {
  flex: 1;
  min-width: 100px;
}

.mm-settings-footer {
  padding: 16px;
  border-top: 1px solid var(--mm-border);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* AI 配置列表 */
.mm-ai-config-list {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.mm-ai-config-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--mm-bg-card);
  border-radius: var(--mm-radius);
  margin-bottom: 8px;
}

.mm-config-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  overflow: hidden;
}

.mm-config-name {
  font-size: 14px;
  color: var(--mm-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-config-model {
  font-size: 12px;
  color: var(--mm-text-muted);
  margin-left: auto;
  padding-right: 12px;
}

.mm-config-group-title {
  font-size: 12px;
  color: var(--mm-primary);
  font-weight: bold;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--mm-border);
}

.mm-config-actions {
  display: flex;
  gap: 4px;
}

/* ============================================================================
   弹窗
   ============================================================================ */

.mm-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  pointer-events: none;
}

.mm-modal-visible {
  display: flex;
}

.mm-modal-content {
  width: 500px;
  max-width: 90vw;
  max-height: 90vh;
  background: var(--mm-bg);
  border-radius: var(--mm-radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}

.mm-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--mm-border);
}

.mm-modal-header h4 {
  margin: 0;
  font-size: 16px;
  color: var(--mm-text);
}

.mm-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.mm-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid var(--mm-border);
}

/* 表单 */
.mm-form-group {
  margin-bottom: 16px;
}

.mm-form-group > label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--mm-text);
}

.mm-form-group input[type="text"],
.mm-form-group input[type="password"],
.mm-form-group input[type="number"],
.mm-form-group textarea,
.mm-form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--mm-border);
  border-radius: 4px;
  background: var(--mm-bg-card);
  color: var(--mm-text);
  font-size: 14px;
  box-sizing: border-box;
}

.mm-form-group input:focus,
.mm-form-group textarea:focus {
  outline: none;
  border-color: var(--mm-primary);
}

.mm-form-group textarea {
  resize: vertical;
  font-family: monospace;
}

.mm-form-row {
  display: flex;
  gap: 16px;
}

.mm-form-row .mm-form-group {
  flex: 1;
}

.mm-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.mm-radio-group label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--mm-text);
  cursor: pointer;
}

/* 测试结果 */
.mm-test-result {
  margin-left: 12px;
  font-size: 13px;
}

.mm-test-success {
  color: var(--mm-success);
}

.mm-test-error {
  color: var(--mm-danger);
}

/* ============================================================================
   滚动条
   ============================================================================ */

.mm-panel ::-webkit-scrollbar,
.mm-settings ::-webkit-scrollbar,
.mm-modal ::-webkit-scrollbar {
  width: 6px;
}

.mm-panel ::-webkit-scrollbar-track,
.mm-settings ::-webkit-scrollbar-track,
.mm-modal ::-webkit-scrollbar-track {
  background: var(--mm-bg-secondary);
}

.mm-panel ::-webkit-scrollbar-thumb,
.mm-settings ::-webkit-scrollbar-thumb,
.mm-modal ::-webkit-scrollbar-thumb {
  background: var(--mm-border);
  border-radius: 3px;
}

.mm-panel ::-webkit-scrollbar-thumb:hover,
.mm-settings ::-webkit-scrollbar-thumb:hover,
.mm-modal ::-webkit-scrollbar-thumb:hover {
  background: var(--mm-primary);
}

/* ============================================================================
   悬浮球（可选，通过设置开关）- 柔和淡粉小花朵（缩小1/2）
   ============================================================================ */

.mm-float-ball {
  position: fixed;
  bottom: 20px;
  left: 15px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  z-index: 9999;
  user-select: none;
  touch-action: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    filter 0.3s ease;
}

/* 花朵容器 */
.mm-float-ball-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

/* 花瓣基础样式 */
.mm-float-ball-petal {
  position: absolute;
  transition: all 0.3s ease;
}

/* 外层花瓣 - 柔和淡紫粉 */
.mm-float-ball-petal.mm-petal-outer {
  width: 10px;
  height: 14px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  z-index: 1;
}

/* 中层花瓣 - 柔和淡粉 */
.mm-float-ball-petal.mm-petal-mid {
  width: 7.5px;
  height: 9.75px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  z-index: 2;
}

/* 内层花瓣 - 浅粉白 */
.mm-float-ball-petal.mm-petal-inner {
  width: 5px;
  height: 6px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  z-index: 3;
}

/* 花心 - 柔和暖黄 */
.mm-float-ball-center {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%,
    rgba(255, 245, 210, 1) 0%,
    rgba(255, 225, 170, 0.9) 40%,
    rgba(245, 200, 140, 0.85) 100%);
  box-shadow: 0 0 5px rgba(255, 220, 160, 0.5),
    inset 0 1px 2px rgba(255, 250, 230, 0.7);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 柔和花蕊小点 */
.mm-float-ball-stamen {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 248, 220, 1) 0%,
    rgba(255, 230, 160, 1) 100%);
  box-shadow: 0 0 2px rgba(255, 235, 180, 0.6);
  z-index: 11;
}

/* 外圈光晕 - 柔和淡粉 */
.mm-float-ball-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 210, 230, 0.35) 0%, rgba(230, 200, 220, 0.18) 50%, transparent 70%);
  opacity: 0.5;
  transition: opacity 0.3s ease, transform 0.3s ease;
  animation: mm-flower-glow 3s ease-in-out infinite;
}

@keyframes mm-flower-glow {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.05); }
}

.mm-float-ball:hover {
  transform: scale(1.15);
  filter: brightness(1.05) saturate(1.1);
}

.mm-float-ball:hover .mm-float-ball-inner {
  animation: mm-flower-spin 8s linear infinite;
}

@keyframes mm-flower-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.mm-float-ball:hover .mm-float-ball-center {
  animation: mm-center-counter-spin 8s linear infinite;
}

@keyframes mm-center-counter-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

.mm-float-ball:hover .mm-float-ball-ring {
  opacity: 0.8;
  transform: scale(1.1);
}

.mm-float-ball:active {
  transform: scale(0.92);
}

.mm-float-ball.mm-dragging {
  transition: none;
}

.mm-float-ball.mm-dragging .mm-float-ball-inner {
  opacity: 0.85;
}

/* 状态指示点 - 隐藏 */
.mm-float-ball.mm-enabled::after,
.mm-float-ball.mm-disabled::after {
  display: none;
}

/* ============================================================================ */
/* 提示词编辑器样式                                                             */
/* ============================================================================ */

/* 扩展模态框大小 */
.mm-modal-large {
  width: 800px;
  max-width: 90vw;
}

/* 模态框底部按钮布局 */
.mm-modal-footer {
  justify-content: space-between;
}

.mm-modal-actions-left,
.mm-modal-actions-right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 提示词编辑器按钮统一样式 */
#mm-prompt-editor-modal .mm-modal-footer .mm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  white-space: nowrap;
}

/* 提示词选择框样式 */
.mm-prompt-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--mm-border);
  border-radius: 4px;
  background: var(--mm-bg-card);
  color: var(--mm-text);
  font-size: 14px;
  box-sizing: border-box;
}

/* 提示词类型切换标签 */
.mm-prompt-type-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 5px;
}

.mm-tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--mm-border);
  border-radius: var(--mm-radius);
  background: var(--mm-bg-card);
  color: var(--mm-text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: var(--mm-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.mm-tab-btn:hover {
  background: var(--mm-bg-secondary);
  color: var(--mm-text);
}

.mm-tab-btn.mm-tab-active {
  background: var(--mm-primary);
  border-color: var(--mm-primary);
  color: white;
}

/* 可调整大小的编辑器容器 */
.mm-resizable-editor-container {
  position: relative;
  width: 100%;
  min-height: 300px;
}

/* 提示词编辑器样式 */
.mm-prompt-editor {
  width: 100%;
  height: 300px;
  min-height: 150px;
  padding: 15px;
  border: 1px solid var(--mm-border);
  border-radius: 4px 4px 0 0;
  background: var(--mm-bg-card);
  color: var(--mm-text);
  font-size: 14px;
  font-family: monospace;
  resize: none;
  line-height: 1.5;
  box-sizing: border-box;
  overflow: auto;
}

.mm-prompt-editor:focus {
  outline: none;
  border-color: var(--mm-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* 调整大小的手柄 - 底部横条样式 */
.mm-resize-handle {
  position: relative;
  width: 100%;
  height: 8px;
  cursor: ns-resize;
  background: var(--mm-border);
  border-radius: 0 0 4px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.mm-resize-handle::after {
  content: "";
  width: 40px;
  height: 3px;
  background: var(--mm-text-muted);
  border-radius: 2px;
  opacity: 0.5;
}

.mm-resize-handle:hover {
  background: var(--mm-primary);
}

.mm-float-ball.mm-processing::after {
  display: none;
}

.mm-float-ball.mm-processing .mm-float-ball-inner i {
  animation: mm-float-spin 1.5s linear infinite;
}

.mm-float-ball.mm-processing .mm-float-ball-ring {
  opacity: 1;
  animation: mm-ring-pulse 1.5s ease-in-out infinite;
}

@keyframes mm-float-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }
  50% {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(234, 179, 8, 0.5);
  }
}

@keyframes mm-float-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes mm-ring-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
}

/* 移动端适配 */
@media (max-width: 768px) {
  .mm-panel {
    width: 75%;
    right: -75%;
    z-index: 999999;
    top: 0;
    height: 100vh;
    border-radius: 0;
  }

  .mm-panel-visible {
    right: 0;
  }

  .mm-settings {
    width: 75%;
    right: -75%;
    z-index: 1000000;
    top: 0;
    height: 100vh;
    border-radius: 0;
  }

  .mm-settings-visible {
    right: 0;
  }

  .mm-modal {
    z-index: 1000001;
    padding: 16px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
  }

  .mm-modal-visible {
    display: flex;
  }

  .mm-modal-content {
    width: calc(100vw - 32px);
    max-width: 95vw;
    max-height: 85vh;
    margin: auto;
    position: relative;
    top: 0;
    left: 0;
    transform: none;
  }

  .mm-panel-header {
    padding: 12px 16px;
  }

  .mm-panel-header h3 {
    font-size: 14px;
  }

  #mm-panel-close-btn {
    background: var(--mm-danger);
    color: white;
  }

  #mm-panel-close-btn:hover {
    background: #a71d2a;
  }

  .mm-float-ball {
    width: 24px;
    height: 24px;
    bottom: 80px;
    left: 12px;
    z-index: 2147483647 !important;
  }

  .mm-float-ball-center {
    width: 7px;
    height: 7px;
  }

  .mm-float-ball-stamen {
    width: 1.5px;
    height: 1.5px;
  }

  .mm-float-ball-ring {
    inset: -3px;
  }
}

@media (max-width: 480px) {
  .mm-panel {
    width: 75%;
    right: -75%;
    top: 0;
    height: 100vh;
    border-radius: 0;
  }

  .mm-panel-visible {
    right: 0;
  }

  .mm-settings {
    width: 75%;
    right: -75%;
    top: 0;
    height: 100vh;
    border-radius: 0;
  }

  .mm-settings-visible {
    right: 0;
  }

  .mm-modal {
    padding: 12px;
  }

  .mm-modal-content {
    width: calc(100vw - 24px);
    max-height: 80vh;
  }

  .mm-modal-body {
    padding: 12px;
    max-height: calc(80vh - 120px);
    overflow-y: auto;
  }

  .mm-panel-content {
    padding: 8px;
  }

  .mm-category-card {
    padding: 8px;
    margin-top: 6px;
  }

  .mm-category-header {
    margin-bottom: 4px;
  }

  .mm-category-name {
    font-size: 12px;
  }

  .mm-category-type {
    font-size: 9px;
    padding: 1px 4px;
  }

  .mm-category-stats {
    gap: 4px 8px;
    margin-bottom: 6px;
  }

  .mm-stat {
    font-size: 10px;
    gap: 2px;
  }

  .mm-stat i {
    font-size: 9px;
  }

  .mm-btn-sm {
    padding: 4px 8px;
    font-size: 10px;
  }

  .mm-section-title {
    font-size: 12px;
  }

  .mm-book-name {
    font-size: 12px;
  }

  .mm-float-ball {
    width: 22px;
    height: 22px;
    bottom: 70px;
    left: 10px;
    z-index: 2147483647 !important;
  }

  .mm-float-ball-center {
    width: 6px;
    height: 6px;
  }

  .mm-float-ball-stamen {
    width: 1px;
    height: 1px;
  }

  .mm-float-ball-ring {
    inset: -2.5px;
  }
}

/* 横屏模式 */
@media (max-height: 500px) and (orientation: landscape) {
  .mm-panel {
    width: 75%;
    right: -75%;
    top: 0;
    height: 100vh;
    border-radius: 0;
  }

  .mm-panel-visible {
    right: 0;
  }

  .mm-settings {
    width: 75%;
    right: -75%;
    top: 0;
    height: 100vh;
    border-radius: 0;
  }

  .mm-settings-visible {
    right: 0;
  }
}

/* 平板竖屏模式适配 - 确保弹窗垂直居中 */
@media (min-width: 481px) and (max-width: 1024px) and (orientation: portrait) {
  /* 通用弹窗居中 */
  .mm-modal {
    display: none;
    align-items: center !important;
    justify-content: center !important;
  }

  .mm-modal.mm-modal-visible {
    display: flex !important;
  }

  .mm-modal-content {
    margin: auto;
    position: relative;
    top: 0;
    left: 0;
    transform: none;
    max-height: 85vh;
  }

  /* 搜索面板 - 平板竖屏 */
  .mm-search-panel:not(.mm-dragging) {
    top: 60px;
    left: 16px;
    right: auto;
    transform: none;
  }

  .mm-search-panel.mm-visible {
    animation: mm-search-panel-in 0.3s ease-out;
  }

  /* 剧情优化面板 - 平板竖屏 */
  .mm-plot-panel:not(.mm-dragging) {
    top: 60px;
    right: 16px;
    left: auto;
    transform: none;
  }

  .mm-plot-panel.mm-visible {
    animation: mm-plot-panel-in 0.3s ease-out;
  }
}

/* ============================================================================
   世界书选择器弹窗
   ============================================================================ */

.mm-worldbook-selector {
  width: 550px;
}

.mm-worldbook-selector .mm-modal-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--mm-text);
}

.mm-modal-close {
  background: none;
  border: none;
  color: var(--mm-text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.mm-modal-close:hover {
  color: var(--mm-text);
}

.mm-selector-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--mm-bg-secondary);
  border-radius: var(--mm-radius);
  color: var(--mm-text-muted);
  font-size: 13px;
  margin-bottom: 16px;
}

.mm-selector-hint i {
  color: var(--mm-primary);
}

.mm-selector-list {
  max-height: 600px;
  overflow-y: auto;
}

.mm-selector-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--mm-bg-card);
  border-radius: var(--mm-radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--mm-transition);
}

.mm-selector-item:hover {
  background: var(--mm-bg-secondary);
}

.mm-selector-item input[type="checkbox"] {
  display: none;
}

.mm-selector-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--mm-border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--mm-transition);
  flex-shrink: 0;
}

.mm-selector-item input[type="checkbox"]:checked + .mm-selector-checkbox {
  background: var(--mm-primary);
  border-color: var(--mm-primary);
}

.mm-selector-item
  input[type="checkbox"]:checked
  + .mm-selector-checkbox::after {
  content: "✓";
  color: white;
  font-size: 14px;
  font-weight: bold;
}

.mm-selector-name {
  flex: 1;
  font-size: 14px;
  color: var(--mm-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-selector-type {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
}

.mm-type-memory {
  background: rgba(74, 144, 217, 0.2);
  color: var(--mm-primary);
}

.mm-type-summary {
  background: rgba(40, 167, 69, 0.2);
  color: var(--mm-success);
}

.mm-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  color: var(--mm-text-muted);
  font-size: 14px;
}

.mm-loading i {
  font-size: 18px;
}

/* ============================================================================
   分类卡片样式（紧凑标签式）
   ============================================================================ */

.mm-book-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

/* 世界书卡片 */
.mm-book-card {
  background: var(--mm-bg-card);
  border-radius: var(--mm-radius);
  padding: 14px;
  margin-bottom: 12px;
}

.mm-book-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--mm-border);
}

.mm-book-title .mm-book-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--mm-text);
}

/* 分类标签容器 */
.mm-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 分类标签 */
.mm-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--mm-bg-secondary);
  border-radius: 6px;
  font-size: 13px;
  color: var(--mm-text);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.mm-chip:hover {
  background: var(--mm-bg);
  border-color: var(--mm-primary);
}

.mm-chip-ok {
  border-left: 3px solid var(--mm-success);
}

.mm-chip-warning {
  border-left: 3px solid var(--mm-warning);
}

.mm-chip-name {
  font-weight: 500;
}

.mm-chip-count {
  font-size: 11px;
  padding: 2px 6px;
  background: rgba(74, 144, 217, 0.15);
  color: var(--mm-primary);
  border-radius: 10px;
  font-weight: 600;
}

/* 兼容旧样式 */
.mm-category-card {
  background: var(--mm-bg-secondary);
  border-radius: var(--mm-radius);
  padding: 12px;
  margin-top: 8px;
  border-left: 3px solid var(--mm-border);
  transition: var(--mm-transition);
}

.mm-category-card:hover {
  background: var(--mm-bg-card);
}

.mm-category-card.mm-config-ok {
  border-left-color: var(--mm-success);
}

.mm-category-card.mm-config-missing {
  border-left-color: var(--mm-warning);
}

.mm-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.mm-category-name {
  font-size: 14px;
  font-weight: bold;
  color: var(--mm-text);
}

.mm-category-type {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(74, 144, 217, 0.2);
  color: var(--mm-primary);
}

.mm-category-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.mm-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--mm-text-muted);
}

.mm-stat i {
  font-size: 11px;
  color: var(--mm-primary);
}

.mm-btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* 模型输入行 */
.mm-model-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mm-model-input-row input[type="text"],
.mm-model-input-row select {
  flex: 1;
  min-width: 0;
}

.mm-model-select {
  padding: 10px 12px;
  border: 1px solid var(--mm-border);
  border-radius: 4px;
  background: var(--mm-bg-card);
  color: var(--mm-text);
  font-size: 14px;
  cursor: pointer;
}

.mm-model-select:focus {
  outline: none;
  border-color: var(--mm-primary);
}

.mm-model-select option {
  background: var(--mm-bg-card);
  color: var(--mm-text);
}

.mm-model-input-row .mm-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

#mm-fetch-models.mm-loading-models {
  pointer-events: none;
  opacity: 0.7;
}

#mm-fetch-models.mm-loading-models i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================================
   进度条样式
   ============================================================================ */

.mm-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.mm-status-summary {
  font-size: 13px;
  color: var(--mm-primary);
  font-weight: bold;
}

.mm-progress-list {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 12px;
  border-top: 1px solid var(--mm-border);
  padding-top: 10px;
}

.mm-progress-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  background: var(--mm-bg-secondary);
  border-radius: 6px;
  margin-bottom: 8px;
  border-left: 3px solid var(--mm-border);
  transition: border-color 0.3s ease;
}

.mm-progress-item.mm-progress-pending {
  border-left-color: var(--mm-secondary);
}

.mm-progress-item.mm-progress-running {
  border-left-color: var(--mm-primary);
}

.mm-progress-item.mm-progress-success {
  border-left-color: var(--mm-success);
}

.mm-progress-item.mm-progress-error {
  border-left-color: var(--mm-danger);
}

.mm-progress-item.mm-progress-retrying {
  border-left-color: var(--mm-warning);
}

.mm-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mm-progress-name {
  font-size: 13px;
  color: var(--mm-text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-progress-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mm-btn-stop-task {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 4px;
  background: rgba(220, 53, 69, 0.2);
  color: var(--mm-danger);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.mm-btn-stop-task:hover {
  background: var(--mm-danger);
  color: white;
  transform: scale(1.1);
}

.mm-btn-stop-task i {
  font-size: 10px;
}

.mm-progress-status {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
}

.mm-progress-status.pending {
  background: rgba(108, 117, 125, 0.2);
  color: var(--mm-secondary);
}

.mm-progress-status.running {
  background: rgba(74, 144, 217, 0.2);
  color: var(--mm-primary);
}

.mm-progress-status.success {
  background: rgba(40, 167, 69, 0.2);
  color: var(--mm-success);
}

.mm-progress-status.error {
  background: rgba(220, 53, 69, 0.2);
  color: var(--mm-danger);
}

.mm-progress-status.retrying {
  background: rgba(255, 193, 7, 0.2);
  color: var(--mm-warning);
}

.mm-progress-bar-container {
  width: 100%;
  height: 6px;
  background: var(--mm-bg-card);
  border-radius: 3px;
  overflow: hidden;
}

.mm-progress-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.2s ease-out, background 0.3s ease;
  background: linear-gradient(
    90deg,
    var(--mm-primary) 0%,
    var(--mm-primary-dark) 100%
  );
}

.mm-progress-bar.success {
  background: linear-gradient(90deg, var(--mm-success) 0%, #1e7e34 100%);
}

.mm-progress-bar.error {
  background: linear-gradient(90deg, var(--mm-danger) 0%, #a71d2a 100%);
}

.mm-progress-bar.retrying {
  background: linear-gradient(90deg, var(--mm-warning) 0%, #d39e00 100%);
}

.mm-progress-detail {
  font-size: 11px;
  color: var(--mm-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mm-progress-detail .retry-count {
  color: var(--mm-warning);
}

.mm-progress-detail .error-msg {
  color: var(--mm-danger);
  font-size: 10px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-progress-detail .time {
  margin-left: auto;
}

/* 终止按钮动画 */
#mm-stop-btn {
  transition: all 0.3s ease;
}

#mm-stop-btn:not(.mm-hidden) {
  animation: pulse-danger 1.5s infinite;
}

@keyframes pulse-danger {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(220, 53, 69, 0);
  }
}

/* 处理中状态 */
.mm-status-panel.processing .mm-status-info {
  opacity: 0.7;
}

/* 注意事项样式 */
.mm-important-notice {
  background-color: #fff3cd;
  border: 1px solid #ffeeba;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 20px;
}

.mm-notice-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  font-weight: bold;
  color: #856404;
}

.mm-notice-header i {
  margin-right: 8px;
  font-size: 18px;
}

.mm-notice-list {
  margin: 0;
  padding-left: 20px;
  color: #856404;
}

.mm-notice-list li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.mm-notice-list code {
  background-color: rgba(0, 0, 0, 0.05);
  padding: 2px 4px;
  border-radius: 3px;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 14px;
  white-space: nowrap;
}

/* ============================================================================
   标签过滤折叠卡片
   ============================================================================ */

.mm-collapse-card {
  background: var(--mm-bg-card);
  border-radius: var(--mm-radius);
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--mm-border);
  transition: var(--mm-transition);
}

.mm-collapse-card:hover {
  border-color: var(--mm-primary);
}

.mm-collapse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.mm-collapse-header:hover {
  background: var(--mm-bg-secondary);
}

.mm-collapse-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--mm-text);
}

.mm-collapse-title i {
  color: var(--mm-primary);
  font-size: 14px;
}

.mm-collapse-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--mm-bg-secondary);
  color: var(--mm-text-muted);
  font-weight: normal;
}

.mm-collapse-badge.active {
  background: rgba(74, 144, 217, 0.2);
  color: var(--mm-primary);
}

.mm-collapse-arrow {
  font-size: 12px;
  color: var(--mm-text-muted);
  transition: transform 0.3s ease;
}

.mm-collapse-card.expanded .mm-collapse-arrow {
  transform: rotate(180deg);
}

.mm-collapse-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 14px;
}

.mm-collapse-card.expanded .mm-collapse-body {
  overflow-y: auto;
  max-height: 600px;
  padding: 14px;
}

/* ============================================================================
   索引模式内容区
   ============================================================================ */

.mm-index-mode-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ============================================================================
   消息右侧进度面板
   ============================================================================ */

.mm-message-progress-panel {
  position: fixed;
  left: 50%;
  top: 80px;
  transform: translateX(-50%);
  width: 320px;
  max-height: 600px;
  background: var(--mm-bg);
  backdrop-filter: blur(15px);
  border: 1px solid var(--mm-border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  z-index: 9999;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  user-select: none;
}

.mm-message-progress-panel.mm-visible {
  opacity: 1;
  pointer-events: auto;
  animation: mm-panel-fade-in 0.4s ease-out;
}

.mm-message-progress-panel.mm-hiding {
  opacity: 0;
}

/* 拖动状态 */
.mm-message-progress-panel.mm-dragging {
  opacity: 0.9;
  transition: none !important;
  cursor: grabbing;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.8);
}

@keyframes mm-panel-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 面板头部 */
.mm-msg-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--mm-bg-secondary);
  border-bottom: 1px solid var(--mm-border);
  border-radius: var(--mm-radius) var(--mm-radius) 0 0;
  cursor: grab;
  touch-action: none;
}

.mm-msg-panel-header:active {
  cursor: grabbing;
}

/* 拖动手柄图标 */
.mm-drag-handle {
  font-size: 12px;
  color: var(--mm-text-muted);
  margin-right: 4px;
  transition: color 0.2s ease;
}

.mm-msg-panel-header:hover .mm-drag-handle {
  color: var(--mm-text);
}

.mm-msg-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--mm-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 面板控制按钮 */
.mm-msg-panel-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mm-msg-minimize-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--mm-text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  position: relative;
  z-index: 10;
}

.mm-msg-minimize-btn:hover {
  background: var(--mm-bg-hover);
  color: var(--mm-text);
}

/* 面板内容 */
.mm-msg-panel-content {
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
  transition: max-height 0.3s ease;
  background: var(--mm-bg-secondary);
}

.mm-message-progress-panel.mm-collapsed .mm-msg-panel-content {
  max-height: 0;
  padding: 0 10px;
  overflow: hidden;
}

/* 单个进度项 */
.mm-msg-progress-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--mm-bg-card);
  border-radius: 8px;
  margin-bottom: 8px;
  border-left: none;
  transition: all 0.3s ease;
}

.mm-msg-progress-item:last-child {
  margin-bottom: 0;
}

.mm-msg-progress-item.mm-success {
  background: var(--mm-bg-card);
}

.mm-msg-progress-item.mm-error {
  background: rgba(220, 53, 69, 0.15);
}

.mm-msg-progress-item.mm-fading {
  animation: mm-fade-out 3s ease forwards;
}

@keyframes mm-fade-out {
  0% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; }
}

.mm-msg-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mm-msg-progress-name {
  font-size: 12px;
  color: var(--mm-text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-msg-progress-percent {
  font-size: 11px;
  font-weight: 600;
  min-width: 35px;
  text-align: right;
}

.mm-msg-progress-item.mm-success .mm-msg-progress-percent {
  color: var(--mm-success);
}

/* 发光进度条 */
.mm-msg-progress-bar-wrapper {
  position: relative;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.mm-msg-progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease-out;
  position: relative;
}

/* 霓虹发光进度条 */
.mm-msg-progress-bar-fill.mm-neon-bar {
  position: relative;
  overflow: hidden;
}

/* 高光滑过动画 */
.mm-msg-progress-bar-fill.mm-neon-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: mm-shine-sweep 2s ease-in-out infinite;
}

@keyframes mm-shine-sweep {
  0% {
    left: -50%;
  }
  100% {
    left: 150%;
  }
}

/* 进度条前端光点 */
.mm-msg-progress-bar-fill-DISABLED::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20px;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, var(--mm-primary) 50%, transparent 100%);
  border-radius: 50%;
  animation: mm-glow-pulse 1.5s ease-in-out infinite;
}

.mm-msg-progress-item.mm-success .mm-msg-progress-bar-fill-DISABLED::after {
  background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, var(--mm-success) 50%, transparent 100%);
  animation: none;
}

/* 收起状态样式 */
.mm-message-progress-panel.mm-collapsed {
  width: auto;
  min-width: 180px;
}

.mm-message-progress-panel.mm-collapsed .mm-msg-panel-header {
  border-bottom: none;
}

/* 默认只显示一个的预览 */
.mm-msg-panel-preview {
  display: none;
  padding: 8px 14px;
  border-top: 1px solid var(--mm-border);
  background: var(--mm-bg-secondary);
}

.mm-message-progress-panel.mm-collapsed .mm-msg-panel-preview {
  display: block;
}

.mm-msg-preview-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mm-msg-preview-name {
  font-size: 12px;
  color: var(--mm-text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-msg-preview-bar {
  width: 60px;
  height: 6px;
  background: var(--mm-border);
  border-radius: 3px;
  overflow: hidden;
}

.mm-msg-preview-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease-out;
  position: relative;
  overflow: hidden;
}

.mm-msg-preview-bar-fill.mm-neon-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: mm-shine-sweep 2s ease-in-out infinite;
}

.mm-msg-preview-percent {
  font-size: 10px;
  min-width: 30px;
  text-align: right;
}

/* ============================================================================
   进度面板移动端适配
   ============================================================================ */

@media (max-width: 768px) {
  /* 进度面板移动端基础定位（参考剧情优化面板，固定在左上角） */
  .mm-message-progress-panel:not(.mm-dragging):not(.mm-user-positioned) {
    width: calc(100vw - 32px);
    max-width: 320px;
    left: 16px;
    top: 60px;
    right: auto;
    transform: none;
  }

  .mm-msg-panel-header {
    padding: 14px 16px;
  }

  .mm-drag-handle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
  }

  .mm-msg-panel-title {
    font-size: 14px;
  }

  .mm-msg-progress-name {
    font-size: 13px;
  }

  .mm-msg-progress-percent {
    font-size: 12px;
  }

  .mm-msg-progress-bar-wrapper {
    height: 10px;
  }
}

@media (max-width: 480px) {
  /* 进度面板手机端基础定位（参考剧情优化面板，固定在左上角） */
  .mm-message-progress-panel:not(.mm-dragging):not(.mm-user-positioned) {
    width: calc(100vw - 24px);
    left: 8px;
    top: 60px;
    right: auto;
    transform: none;
  }

  .mm-msg-panel-header {
    padding: 12px 14px;
  }

  .mm-msg-panel-content {
    padding: 8px;
    max-height: 250px;
  }

  .mm-msg-progress-item {
    padding: 8px 10px;
  }
}

/* ============================================================================
   提示词编辑器移动端优化
   ============================================================================ */

/* 平板和小屏幕 */
@media (max-width: 768px) {
  #mm-prompt-editor-modal.mm-modal-visible {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  #mm-prompt-editor-modal .mm-modal-content {
    margin: auto;
    position: relative;
    top: 0;
    left: 0;
    transform: none;
  }

  #mm-prompt-editor-modal .mm-modal-footer {
    flex-wrap: wrap;
    gap: 10px;
  }

  #mm-prompt-editor-modal .mm-modal-actions-left,
  #mm-prompt-editor-modal .mm-modal-actions-right {
    justify-content: center;
    gap: 8px;
  }

  .mm-prompt-editor {
    height: 200px;
    min-height: 150px;
  }

  .mm-resizable-editor-container {
    min-height: 200px;
  }
}

/* 手机小屏幕 */
@media (max-width: 480px) {
  #mm-prompt-editor-modal.mm-modal-visible {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 12px !important;
  }

  #mm-prompt-editor-modal .mm-modal-content {
    width: calc(100vw - 24px);
    height: auto;
    max-height: 85vh;
    border-radius: 8px;
    margin: auto;
    position: relative;
    top: 0;
    left: 0;
    transform: none;
  }

  #mm-prompt-editor-modal .mm-modal-body {
    max-height: calc(100vh - 180px);
    padding: 10px;
  }

  #mm-prompt-editor-modal .mm-modal-header h4 {
    font-size: 14px;
  }

  .mm-prompt-select {
    padding: 8px 10px;
    font-size: 13px;
  }

  #mm-current-field-label {
    font-size: 13px;
  }

  .mm-prompt-editor {
    height: 180px;
    min-height: 120px;
    padding: 10px;
    font-size: 13px;
  }

  .mm-resizable-editor-container {
    min-height: 180px;
  }

  #mm-prompt-editor-modal .mm-modal-footer {
    padding: 10px;
  }

  #mm-prompt-editor-modal .mm-modal-actions-left,
  #mm-prompt-editor-modal .mm-modal-actions-right {
    width: 100%;
    justify-content: center;
    gap: 6px;
  }

  #mm-prompt-editor-modal .mm-modal-actions-right {
    order: -1;
    margin-bottom: 6px;
  }

  #mm-prompt-editor-modal .mm-modal-footer .mm-btn {
    flex: 1 1 calc(33% - 6px);
    min-width: 70px;
    max-width: 100px;
    padding: 10px 8px;
    font-size: 12px;
  }

  .mm-hint {
    font-size: 11px;
  }

  /* 手机端拖拽手柄 - 增大触摸区域 */
  .mm-resize-handle {
    height: 16px;
    touch-action: none;
  }

  .mm-resize-handle::after {
    width: 50px;
    height: 4px;
  }

  .mm-settings-content {
    padding-bottom: 60px;
  }
}

/* ============================================================================
   移动端设置面板滚动修复（通用）
   ============================================================================ */

@media (max-width: 768px) {
  .mm-settings-content {
    padding-bottom: 60px;
    -webkit-overflow-scrolling: touch;
  }

  .mm-settings-section:last-child {
    margin-bottom: 32px;
  }

  .mm-settings-section:last-child .mm-setting-actions {
    padding-bottom: 16px;
  }
}

/* ============================================================================
   世界书控制样式
   ============================================================================ */

.mm-worldbook-control-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 世界书区块 */
.mm-wb-section {
  background: var(--mm-bg-secondary);
  border-radius: 6px;
  padding: 10px;
}

.mm-wb-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--mm-border);
}

.mm-wb-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--mm-text);
}

/* 世界书列表容器 */
.mm-wb-list-container {
  max-height: 180px;
  overflow-y: auto;
}

.mm-wb-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 世界书列表项 */
.mm-wb-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--mm-bg-card);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.mm-wb-item:hover {
  background: var(--mm-bg);
  border-color: var(--mm-primary);
}

.mm-wb-item.mm-wb-selected {
  background: rgba(74, 144, 217, 0.15);
  border-color: var(--mm-primary);
}

.mm-wb-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--mm-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.mm-wb-item-name {
  flex: 1;
  font-size: 13px;
  color: var(--mm-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-wb-item-count {
  font-size: 11px;
  color: var(--mm-text-muted);
  padding: 2px 6px;
  background: var(--mm-bg-secondary);
  border-radius: 8px;
}

/* 加载和空状态 */
.mm-wb-loading,
.mm-wb-empty,
.mm-wb-entries-loading,
.mm-wb-entries-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  color: var(--mm-text-muted);
  font-size: 12px;
}

.mm-wb-loading i,
.mm-wb-entries-loading i {
  color: var(--mm-primary);
}

/* 条目区域 */
.mm-wb-entries-section {
  border-top: 1px dashed var(--mm-border);
  padding-top: 12px;
  margin-top: 4px;
}

.mm-wb-entry-count {
  font-size: 11px;
  color: var(--mm-primary);
  font-weight: 600;
}

.mm-wb-entries-container {
  max-height: 250px;
  overflow-y: auto;
}

.mm-wb-entries-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 条目项 */
.mm-wb-entry-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  background: var(--mm-bg-card);
  border-radius: 4px;
  border-left: 3px solid var(--mm-border);
  transition: all 0.2s ease;
}

.mm-wb-entry-item:hover {
  background: var(--mm-bg);
}

.mm-wb-entry-item.mm-entry-enabled {
  border-left-color: var(--mm-success);
}

.mm-wb-entry-item.mm-entry-disabled {
  border-left-color: var(--mm-secondary);
  opacity: 0.7;
}

.mm-wb-entry-item.mm-entry-constant {
  border-left-color: var(--mm-primary);
}

.mm-wb-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mm-wb-entry-title {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: var(--mm-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-wb-entry-badges {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.mm-wb-entry-badge {
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
}

.mm-wb-entry-badge.mm-badge-enabled {
  background: rgba(40, 167, 69, 0.2);
  color: var(--mm-success);
}

.mm-wb-entry-badge.mm-badge-disabled {
  background: rgba(108, 117, 125, 0.2);
  color: var(--mm-secondary);
}

.mm-wb-entry-badge.mm-badge-constant {
  background: rgba(74, 144, 217, 0.2);
  color: var(--mm-primary);
}

.mm-wb-entry-keys {
  font-size: 11px;
  color: var(--mm-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-wb-entry-keys i {
  margin-right: 4px;
  font-size: 10px;
}

/* 世界书提示 */
.mm-wb-hint {
  text-align: center;
  padding: 8px;
  background: var(--mm-bg-secondary);
  border-radius: 4px;
}

/* 递归控制按钮区域 */
.mm-wb-recursion-controls {
  background: var(--mm-bg-secondary);
  border-radius: 6px;
  padding: 10px;
  border: 1px dashed var(--mm-border);
}

.mm-wb-recursion-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.mm-wb-recursion-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px !important;
  font-size: 12px !important;
  transition: all 0.2s ease;
}

.mm-wb-recursion-btn.active {
  background: var(--mm-primary) !important;
  color: white !important;
  border-color: var(--mm-primary) !important;
}

.mm-wb-recursion-btn.active i {
  color: white;
}

.mm-wb-recursion-btn:hover:not(.active) {
  background: var(--mm-bg-card);
  border-color: var(--mm-primary);
}

.mm-recursion-hint {
  display: block;
  text-align: center;
  font-size: 11px;
  color: var(--mm-text-muted);
  margin: 0;
  padding: 0;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .mm-wb-list-container {
    max-height: 150px;
  }

  .mm-wb-entries-container {
    max-height: 200px;
  }

  .mm-wb-item {
    padding: 6px 8px;
  }

  .mm-wb-item-name {
    font-size: 12px;
  }

  .mm-wb-entry-item {
    padding: 6px 8px;
  }

  .mm-wb-entry-title {
    font-size: 11px;
  }

  .mm-wb-entry-keys {
    font-size: 10px;
  }
}

/* 统计容器样式 */
.mm-wb-stats-container {
  max-height: 200px;
  overflow-y: auto;
}

.mm-wb-stats-content {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mm-wb-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 12px;
  background: var(--mm-bg-card);
  border-radius: 6px;
  min-width: 70px;
  flex: 1;
}

.mm-wb-stat-label {
  font-size: 11px;
  color: var(--mm-text-muted);
}

.mm-wb-stat-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--mm-text);
}

.mm-wb-stat-value.mm-stat-enabled {
  color: var(--mm-success);
}

.mm-wb-stat-value.mm-stat-disabled {
  color: var(--mm-secondary);
}

.mm-wb-stat-value.mm-stat-constant {
  color: var(--mm-primary);
}

.mm-wb-stats-loading,
.mm-wb-stats-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  color: var(--mm-text-muted);
  font-size: 12px;
}

/* ============================================================================
   标签过滤样式
   ============================================================================ */

/* 标签模式标题 - 居中显示 */
.mm-tag-mode-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  cursor: pointer;
}

.mm-tag-mode-checkbox input[type="checkbox"] {
  display: none;
}

.mm-tag-mode-label {
  display: block;
  width: 100%;
  padding: 6px 10px;
  text-align: center;
  font-size: 12px;
  color: var(--mm-text-muted);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.mm-tag-mode-checkbox input[type="checkbox"]:checked + .mm-tag-mode-label {
  background: var(--mm-primary);
  color: white;
  font-weight: 500;
}

.mm-tag-mode-checkbox:hover .mm-tag-mode-label {
  color: var(--mm-text);
}

/* 标签容器 */
.mm-tag-container {
  background: var(--mm-bg-secondary);
  border-radius: 6px;
  padding: 10px;
  min-height: 60px;
  margin-bottom: 10px;
}

.mm-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.mm-tag-list:empty {
  margin-bottom: 0;
}

/* 标签 chip */
.mm-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--mm-bg-card);
  border: 1px solid var(--mm-border);
  border-radius: 14px;
  font-size: 12px;
  color: var(--mm-text);
  transition: all 0.2s ease;
}

.mm-tag-chip:hover {
  border-color: var(--mm-primary);
  background: var(--mm-bg);
}

.mm-tag-chip .mm-tag-name {
  font-family: "Consolas", "Monaco", monospace;
  color: var(--mm-primary);
}

.mm-tag-chip .mm-tag-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: transparent;
  color: var(--mm-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 10px;
}

.mm-tag-chip .mm-tag-remove:hover {
  background: var(--mm-danger);
  color: white;
}

/* 标签输入 */
.mm-tag-input-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  align-items: center;
}

.mm-tag-input-row .mm-tag-input {
  flex: 1;
}

.mm-tag-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px dashed var(--mm-border);
  border-radius: 6px;
  background: transparent;
  color: var(--mm-text);
  font-size: 12px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.mm-tag-input:focus {
  outline: none;
  border-color: var(--mm-primary);
  border-style: solid;
  background: var(--mm-bg-card);
}

.mm-tag-input::placeholder {
  color: var(--mm-text-muted);
}

/* 圆形添加按钮 */
.mm-btn-small {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 区分大小写选项 */
.mm-tag-case-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--mm-text-muted);
  cursor: pointer;
  margin-bottom: 8px;
}

.mm-tag-case-option:hover {
  color: var(--mm-text);
}

.mm-tag-case-option input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--mm-primary);
}

/* 标签提示 */
.mm-tag-hint {
  display: block;
  line-height: 1.6;
  padding: 8px 10px;
  background: var(--mm-bg-secondary);
  border-radius: 4px;
  border-left: 3px solid var(--mm-primary);
}

.mm-tag-hint strong {
  color: var(--mm-text);
}

/* ============================================================================
   交互式记忆搜索面板样式
   ============================================================================ */

.mm-search-panel {
  position: fixed;
  width: 420px;
  max-height: 680px;
  background: var(--mm-bg);
  border: 1px solid var(--mm-border);
  border-radius: var(--mm-radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 1000002;
  display: none;
  flex-direction: column;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.mm-search-panel.mm-visible {
  display: flex;
  animation: mm-search-panel-in 0.3s ease-out;
}

.mm-search-panel.mm-minimized {
  max-height: 48px;
  overflow: hidden;
}

.mm-search-panel.mm-minimized .mm-search-panel-content,
.mm-search-panel.mm-minimized .mm-search-panel-status,
.mm-search-panel.mm-minimized .mm-search-panel-footer {
  display: none;
}

@keyframes mm-search-panel-in {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* 面板头部 - 可拖动 */
.mm-search-panel-header {
  padding: 12px 16px;
  background: var(--mm-bg-secondary);
  border-bottom: 1px solid var(--mm-border);
  border-radius: var(--mm-radius) var(--mm-radius) 0 0;
  cursor: move;
  display: flex;
  justify-content: space-between;
  align-items: center;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

.mm-search-panel-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--mm-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mm-search-panel-title i {
  color: var(--mm-primary);
}

.mm-search-panel-controls {
  display: flex;
  gap: 4px;
}

.mm-search-panel-controls .mm-btn-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--mm-text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.mm-search-panel-controls .mm-btn-icon:hover {
  background: var(--mm-bg-card);
  color: var(--mm-text);
}

/* ============================================================================
   多总结世界书可折叠面板样式
   ============================================================================ */

/* 世界书容器 */
.mm-search-books-container {
  flex: 1;
  overflow-y: auto;
  max-height: 320px;
  min-height: 150px;
}

/* 单个世界书可折叠面板 */
.mm-search-book-section {
  border-bottom: 1px solid var(--mm-border);
}

.mm-search-book-section:last-child {
  border-bottom: none;
}

/* 世界书折叠头 */
.mm-search-book-header {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: var(--mm-bg-secondary);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
  gap: 8px;
}

.mm-search-book-header:hover {
  background: var(--mm-bg-card);
}

.mm-search-book-header .mm-book-toggle-icon {
  font-size: 10px;
  color: var(--mm-text-muted);
  transition: transform 0.2s ease;
  width: 12px;
}

.mm-search-book-section.mm-collapsed .mm-book-toggle-icon {
  transform: rotate(-90deg);
}

.mm-search-book-header .mm-book-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--mm-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-search-book-header .mm-book-status {
  font-size: 11px;
  color: var(--mm-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.mm-search-book-header .mm-book-status.mm-loading {
  color: var(--mm-primary);
}

.mm-search-book-header .mm-book-status.mm-success {
  color: var(--mm-success);
}

.mm-search-book-header .mm-book-status.mm-error {
  color: var(--mm-danger);
}

/* 世界书内容区域 */
.mm-search-book-content {
  padding: 12px;
  background: var(--mm-bg);
  max-height: 250px;
  overflow-y: auto;
  transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
}

.mm-search-book-section.mm-collapsed .mm-search-book-content {
  max-height: 0;
  padding: 0 12px;
  overflow: hidden;
  opacity: 0;
}

/* 世界书内容区域的消息样式继承 */
.mm-search-book-content .mm-search-message {
  margin-bottom: 10px;
}

.mm-search-book-content .mm-search-message:last-child {
  margin-bottom: 0;
}

/* 最小化时隐藏世界书容器 */
.mm-search-panel.mm-minimized .mm-search-books-container {
  display: none;
}

/* 消息区域 */
.mm-search-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  max-height: 320px;
  min-height: 150px;
}

/* 消息项 */
.mm-search-message {
  margin-bottom: 12px;
  animation: mm-msg-fade-in 0.3s ease-out;
}

@keyframes mm-msg-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mm-search-message.mm-search-message-ai {
  padding: 10px 12px;
  background: var(--mm-bg-secondary);
  border-radius: 8px;
  border-left: 3px solid var(--mm-primary);
}

.mm-search-message.mm-search-message-system {
  padding: 8px 12px;
  background: rgba(74, 144, 217, 0.1);
  border-radius: 6px;
  font-size: 12px;
  color: var(--mm-text-muted);
  text-align: center;
}

.mm-search-message.mm-search-message-result {
  padding: 10px 12px;
  background: var(--mm-bg-card);
  border-radius: 8px;
  border: 1px solid var(--mm-border);
}

/* 消息内部元素 */
.mm-search-message-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--mm-text);
}

.mm-search-message-content i {
  color: var(--mm-primary);
  flex-shrink: 0;
}

.mm-search-message-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--mm-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 8px;
}

.mm-search-message-avatar i {
  color: white;
  font-size: 14px;
}

.mm-search-message.mm-search-message-ai .mm-search-message-content {
  padding-left: 4px;
}

/* 搜索结果项 */
.mm-search-result-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mm-search-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mm-search-result-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--mm-text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-search-result-score {
  font-size: 11px;
  color: var(--mm-text-muted);
  flex-shrink: 0;
}

.mm-search-result-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.mm-search-keyword-tag {
  padding: 2px 6px;
  background: rgba(74, 144, 217, 0.15);
  color: var(--mm-primary);
  border-radius: 3px;
  font-size: 11px;
}

.mm-search-result-content {
  font-size: 12px;
  color: var(--mm-text-muted);
  line-height: 1.5;
  max-height: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--mm-bg);
  padding: 8px;
  border-radius: 4px;
  border: 1px solid var(--mm-border);
}

.mm-search-result-floor {
  font-size: 13px;
  font-weight: 600;
  color: var(--mm-primary);
}

.mm-search-result-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.mm-search-result-preview {
  font-size: 12px;
  color: var(--mm-text-muted);
  line-height: 1.5;
  max-height: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mm-search-result-preview .mm-highlight-keyword {
  background: rgba(255, 217, 61, 0.3);
  color: var(--mm-text);
  padding: 0 2px;
  border-radius: 2px;
}

/* 确认/拒绝按钮 */
.mm-btn-adopt,
.mm-btn-reject {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.mm-btn-adopt {
  background: rgba(40, 167, 69, 0.2);
  color: var(--mm-success);
  border-color: var(--mm-success);
}

.mm-btn-adopt:hover {
  background: var(--mm-success);
  color: white;
}

.mm-btn-reject {
  background: rgba(220, 53, 69, 0.2);
  color: var(--mm-danger);
  border-color: var(--mm-danger);
}

.mm-btn-reject:hover {
  background: var(--mm-danger);
  color: white;
}

/* 自动模式 - 删除按钮 */
.mm-btn-remove {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(108, 117, 125, 0.2);
  color: var(--mm-secondary);
  border: 1px solid var(--mm-secondary);
}

.mm-btn-remove:hover {
  background: var(--mm-secondary);
  color: white;
}

/* 已采用的结果 */
.mm-search-result-item.mm-adopted {
  border-color: var(--mm-success);
  background: rgba(40, 167, 69, 0.1);
}

.mm-search-result-item.mm-adopted .mm-search-result-floor::after {
  content: ' ✓';
  color: var(--mm-success);
}

.mm-search-adopted-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--mm-success);
  padding: 4px 8px;
  background: rgba(40, 167, 69, 0.15);
  border-radius: 4px;
}

.mm-search-adopted-label i {
  font-size: 12px;
}

/* 已拒绝的结果 */
.mm-search-result-item.mm-rejected {
  opacity: 0.5;
  border-color: var(--mm-danger);
  background: rgba(220, 53, 69, 0.05);
}

.mm-search-rejected-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--mm-danger);
  padding: 4px 8px;
  background: rgba(220, 53, 69, 0.15);
  border-radius: 4px;
}

.mm-search-rejected-label i {
  font-size: 12px;
}

/* 状态栏 */
.mm-search-panel-status {
  padding: 8px 16px;
  background: var(--mm-bg-secondary);
  border-top: 1px solid var(--mm-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--mm-text-muted);
}

.mm-search-status-left {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mm-search-status-left strong {
  color: var(--mm-primary);
}

.mm-search-divider {
  color: var(--mm-border);
  margin: 0 4px;
}

.mm-search-tasks-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mm-search-tasks-status i {
  color: var(--mm-primary);
}

.mm-search-tasks-status.mm-tasks-done i {
  color: var(--mm-success);
}

/* 高度缩放拖拽条 */
.mm-search-resize-handle {
  height: 16px;
  background: var(--mm-bg-secondary);
  border-top: 1px solid var(--mm-border);
  cursor: ns-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mm-text-muted);
  font-size: 10px;
  -webkit-user-select: none;
  user-select: none;
  border-radius: 0 0 var(--mm-radius) var(--mm-radius);
}

.mm-search-resize-handle:hover {
  background: var(--mm-bg-hover);
  color: var(--mm-text);
}

/* 底部操作区 */
.mm-search-panel-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--mm-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mm-search-actions {
  display: flex;
  gap: 8px;
}

.mm-search-actions .mm-btn {
  flex: 1;
  padding: 10px 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.mm-search-actions .mm-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 自定义搜索输入框 */
.mm-search-custom-input {
  display: flex;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--mm-border);
}

.mm-search-custom-input.mm-hidden {
  display: none;
}

.mm-search-custom-input input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--mm-border);
  border-radius: 6px;
  background: var(--mm-bg-card);
  color: var(--mm-text);
  font-size: 13px;
}

.mm-search-custom-input input:focus {
  outline: none;
  border-color: var(--mm-primary);
}

.mm-search-custom-input .mm-btn {
  flex-shrink: 0;
}

/* 批量结果列表（自动模式） */
.mm-search-results-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mm-search-results-list .mm-search-result-item {
  padding: 10px 12px;
  background: var(--mm-bg-card);
  border-radius: 6px;
  border: 1px solid var(--mm-border);
  transition: all 0.2s ease;
}

.mm-search-results-list .mm-search-result-item:hover {
  border-color: var(--mm-primary);
}

/* 无结果提示 */
.mm-search-no-results {
  text-align: center;
  padding: 24px;
  color: var(--mm-text-muted);
}

.mm-search-no-results i {
  font-size: 32px;
  margin-bottom: 12px;
  color: var(--mm-border);
}

.mm-search-no-results p {
  margin: 0;
  font-size: 13px;
}

/* 加载状态 */
.mm-search-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  color: var(--mm-text-muted);
}

.mm-search-loading i {
  color: var(--mm-primary);
  font-size: 18px;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .mm-search-panel {
    width: calc(100vw - 24px);
    max-width: 420px;
    max-height: 70vh;
  }

  .mm-search-panel-content {
    max-height: 45vh;
  }

  .mm-search-actions {
    flex-wrap: wrap;
  }

  .mm-search-actions .mm-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    padding: 10px 8px;
    font-size: 12px;
  }

  .mm-search-actions .mm-btn:last-child {
    flex: 1 1 100%;
  }
}

@media (max-width: 480px) {
  .mm-search-panel {
    width: 70vw;
    min-width: 260px;
    max-width: 320px;
    max-height: 65vh;
  }

  .mm-search-panel-header {
    padding: 8px 12px;
  }

  .mm-search-panel-title {
    font-size: 13px;
  }

  .mm-search-panel-content {
    padding: 10px;
    max-height: 40vh;
  }

  .mm-search-panel-footer {
    padding: 10px 12px;
  }

  .mm-search-result-preview {
    font-size: 11px;
    max-height: 42px;
  }

  .mm-search-actions .mm-btn {
    padding: 8px 10px;
    font-size: 11px;
  }
}

/* 剧情优化世界书选择样式 */
.mm-plot-optimize-books-content {
  padding: 10px;
  max-height: 300px;
  overflow-y: auto;
}

.mm-plot-optimize-book-item {
  background: var(--mm-bg-card);
  border: 1px solid var(--mm-border);
  border-radius: 6px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.mm-plot-optimize-book-item:hover {
  border-color: var(--mm-primary);
}

.mm-plot-optimize-book-item.selected {
  background: rgba(74, 144, 217, 0.1);
  border-color: var(--mm-primary);
}

.mm-plot-optimize-book-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
}

.mm-plot-optimize-book-header:hover {
  background: var(--mm-bg-hover);
}

.mm-plot-optimize-book-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--mm-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.mm-plot-optimize-book-name {
  flex: 1;
  font-size: 13px;
  color: var(--mm-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-plot-optimize-book-entries {
  display: none;
  flex-direction: column;
  padding: 8px 12px 8px 28px;
  background: var(--mm-bg-secondary);
  border-top: 1px solid var(--mm-border);
  gap: 4px;
}

.mm-plot-optimize-book-entries.show {
  display: flex;
}

.mm-plot-optimize-entry-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--mm-bg-card);
  border: 1px solid var(--mm-border);
  border-radius: 4px;
  font-size: 13px;
  color: var(--mm-text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mm-plot-optimize-entry-item:hover {
  background: var(--mm-bg-hover);
  border-color: var(--mm-primary);
}

.mm-plot-optimize-entry-item.selected {
  background: rgba(74, 144, 217, 0.15);
  border-color: var(--mm-primary);
  color: var(--mm-text);
}

.mm-plot-optimize-entry-checkbox {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mm-primary);
  font-weight: bold;
  flex-shrink: 0;
}

/* 折叠卡片操作按钮 */
.mm-collapse-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.mm-collapse-actions .mm-btn {
  padding: 4px 8px;
  min-width: auto;
}

.mm-collapse-actions .mm-btn i {
  margin: 0;
}

/* ============================================================================
   配置弹窗 Tab 切换样式
   ============================================================================ */
.mm-config-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  background: var(--mm-bg-secondary);
  border-radius: var(--mm-radius);
}

.mm-config-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--mm-text-muted);
  font-size: 0.9em;
  font-weight: 500;
  cursor: pointer;
  border-radius: calc(var(--mm-radius) - 2px);
  transition: var(--mm-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.mm-config-tab:hover {
  color: var(--mm-text);
  background: rgba(255, 255, 255, 0.05);
}

.mm-config-tab.active {
  color: var(--mm-text);
  background: var(--mm-primary);
}

.mm-config-tab i {
  font-size: 0.95em;
}

.mm-config-tab-content {
  display: none;
}

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

/* ============================================================================
   上下文选择页面样式
   ============================================================================ */

/* 世界书列表容器 */
.mm-config-worldbook-content {
  max-height: 200px;
  overflow-y: auto;
}

.mm-config-worldbook-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 世界书列表项 */
.mm-config-worldbook-item {
  background: var(--mm-bg-secondary);
  border-radius: calc(var(--mm-radius) - 2px);
  overflow: hidden;
  transition: var(--mm-transition);
}

.mm-config-worldbook-item.selected {
  background: rgba(var(--mm-primary-rgb, 74, 144, 217), 0.15);
}

.mm-config-worldbook-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
}

.mm-config-worldbook-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.mm-config-worldbook-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--mm-primary);
}

.mm-config-worldbook-name {
  flex: 1;
  font-weight: 500;
  color: var(--mm-text);
}

.mm-config-worldbook-count {
  font-size: 0.85em;
  color: var(--mm-text-muted);
}

/* 世界书条目列表 */
.mm-config-worldbook-entries {
  display: none;
  padding: 8px 12px 12px 36px;
  border-top: 1px solid var(--mm-border);
  background: rgba(0, 0, 0, 0.1);
}

.mm-config-worldbook-entries.show {
  display: block;
}

.mm-config-worldbook-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 0.9em;
  color: var(--mm-text-muted);
  border-radius: 4px;
  transition: var(--mm-transition);
}

.mm-config-worldbook-entry:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--mm-text);
}

.mm-config-worldbook-entry-checkbox {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--mm-primary);
}

.mm-config-worldbook-entry-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================================
   角色描述预览样式
   ============================================================================ */
.mm-config-char-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mm-config-char-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mm-config-char-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mm-config-char-name {
  font-weight: 600;
  color: var(--mm-text);
  font-size: 1em;
}

.mm-config-char-tokens {
  font-size: 0.85em;
  color: var(--mm-text-muted);
}

.mm-config-char-include {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9em;
  color: var(--mm-text-muted);
  cursor: pointer;
}

.mm-config-char-include:hover {
  color: var(--mm-text);
}

.mm-config-char-include input {
  accent-color: var(--mm-primary);
  cursor: pointer;
}

.mm-config-char-preview {
  background: var(--mm-bg-secondary);
  border-radius: calc(var(--mm-radius) - 2px);
  padding: 12px;
  max-height: 150px;
  overflow-y: auto;
  font-size: 0.9em;
  line-height: 1.5;
  color: var(--mm-text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.mm-config-char-preview::-webkit-scrollbar {
  width: 6px;
}

.mm-config-char-preview::-webkit-scrollbar-thumb {
  background: var(--mm-border);
  border-radius: 3px;
}

.mm-config-char-empty {
  text-align: center;
  color: var(--mm-text-muted);
  font-style: italic;
}

/* 通用加载和空状态 */
.mm-loading-state,
.mm-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  color: var(--mm-text-muted);
}

.mm-loading-state i {
  color: var(--mm-primary);
}

/* ============================================================================
   剧情优化助手面板样式
   ============================================================================ */
.mm-plot-panel {
  position: fixed;
  width: 420px;
  max-height: 680px;
  background: var(--mm-bg);
  border: 1px solid var(--mm-border);
  border-radius: var(--mm-radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 1000002;
  display: none;
  flex-direction: column;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.mm-plot-panel.mm-visible {
  display: flex;
  animation: mm-plot-panel-in 0.3s ease-out;
}

.mm-plot-panel.mm-minimized {
  max-height: 48px;
  overflow: hidden;
}

.mm-plot-panel.mm-minimized .mm-plot-chat-container,
.mm-plot-panel.mm-minimized .mm-plot-panel-status,
.mm-plot-panel.mm-minimized .mm-plot-worldbook-section,
.mm-plot-panel.mm-minimized .mm-plot-panel-footer {
  display: none;
}

/* 折叠图标样式 */
.mm-panel-toggle-icon {
  font-size: 14px;
  color: var(--mm-text-muted);
  transition: transform 0.3s ease;
}

.mm-plot-panel.mm-minimized .mm-panel-toggle-icon,
.mm-search-panel.mm-minimized .mm-panel-toggle-icon {
  transform: rotate(180deg);
}

@keyframes mm-plot-panel-in {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* 面板头部 - 可拖动 */
.mm-plot-panel-header {
  padding: 12px 16px;
  background: var(--mm-bg-secondary);
  border-bottom: 1px solid var(--mm-border);
  border-radius: var(--mm-radius) var(--mm-radius) 0 0;
  cursor: move;
  display: flex;
  justify-content: space-between;
  align-items: center;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

.mm-plot-panel-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--mm-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mm-plot-panel-title i {
  color: var(--mm-primary);
}

.mm-plot-panel-controls {
  display: flex;
  gap: 4px;
}

.mm-plot-panel-controls .mm-btn-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--mm-text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.mm-plot-panel-controls .mm-btn-icon:hover {
  background: var(--mm-bg-card);
  color: var(--mm-text);
}

/* 聊天容器 */
.mm-plot-chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  min-height: 180px;
  max-height: 300px;
  background: var(--mm-bg);
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

/* 消息行 */
.mm-plot-message {
  display: flex;
  gap: 10px;
  max-width: 90%;
  animation: mm-message-in 0.3s ease;
}

@keyframes mm-message-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* AI 消息 - 左对齐 */
.mm-plot-message-ai {
  align-self: flex-start;
  flex-direction: row;
}

/* 用户消息 - 右对齐 */
.mm-plot-message-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

/* 头像 */
.mm-plot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

.mm-plot-message-ai .mm-plot-avatar {
  background: linear-gradient(135deg, var(--mm-primary), var(--mm-primary-hover));
  color: white;
  box-shadow: 0 2px 8px rgba(var(--mm-primary-rgb, 99, 102, 241), 0.3);
}

.mm-plot-message-user .mm-plot-avatar {
  background: #6b7280;
  color: white;
  box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
}

/* 气泡 */
.mm-plot-bubble {
  position: relative;
  padding: 12px 16px;
  border-radius: 18px;
  max-width: calc(100% - 46px);
  word-break: break-word;
}

.mm-plot-message-ai .mm-plot-bubble {
  background: var(--mm-bg-card);
  border: 1px solid var(--mm-border);
  border-top-left-radius: 4px;
  color: var(--mm-text);
}

.mm-plot-message-user .mm-plot-bubble {
  background: #6b7280;
  border: none;
  border-top-right-radius: 4px;
  color: white;
}

/* 气泡内容 */
.mm-plot-bubble-content {
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.mm-plot-message-user .mm-plot-bubble-content {
  color: white;
}

/* 时间戳 */
.mm-plot-bubble-time {
  font-size: 11px;
  margin-top: 6px;
  opacity: 0.6;
}

.mm-plot-message-ai .mm-plot-bubble-time {
  color: var(--mm-text-muted);
  text-align: left;
}

.mm-plot-message-user .mm-plot-bubble-time {
  color: rgba(255, 255, 255, 0.8);
  text-align: right;
}

/* 欢迎消息样式 */
.mm-plot-message-welcome .mm-plot-bubble {
  background: linear-gradient(135deg, var(--mm-bg-card), var(--mm-bg));
  border: 1px dashed var(--mm-border);
}

/* AI 正在输入状态 */
.mm-plot-message-typing .mm-plot-bubble-content {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mm-plot-typing-dot {
  width: 8px;
  height: 8px;
  background: var(--mm-text-muted);
  border-radius: 50%;
  animation: mm-typing-bounce 1.4s infinite ease-in-out;
}

.mm-plot-typing-dot:nth-child(1) { animation-delay: 0s; }
.mm-plot-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.mm-plot-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes mm-typing-bounce {
  0%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-6px);
  }
}

/* 系统消息 */
.mm-plot-message-system {
  align-self: center;
  max-width: 100%;
}

.mm-plot-message-system .mm-plot-bubble {
  background: var(--mm-bg-hover);
  border: 1px solid var(--mm-border);
  border-radius: 12px;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--mm-text-muted);
}

/* 流式输出效果 */
.mm-plot-bubble-content.streaming::after {
  content: "▋";
  animation: mm-cursor-blink 1s infinite;
  margin-left: 2px;
}

@keyframes mm-cursor-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* 旧的预览样式保留兼容 */
.mm-plot-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  min-height: 150px;
  max-height: 250px;
  background: var(--mm-bg);
}

.mm-plot-preview-content {
  font-size: 0.9em;
  line-height: 1.6;
  color: var(--mm-text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 状态栏 */
.mm-plot-panel-status {
  padding: 8px 16px;
  background: var(--mm-bg-secondary);
  border-top: 1px solid var(--mm-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85em;
  color: var(--mm-text-muted);
}

.mm-plot-status-left,
.mm-plot-status-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 世界书选择区域 */
.mm-plot-worldbook-section {
  border-top: 1px solid var(--mm-border);
  min-height: 40px;
  max-height: 300px;
  overflow: hidden;
  transition: max-height 0.3s ease;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.mm-plot-worldbook-section.collapsed {
  max-height: 40px;
}

.mm-plot-worldbook-section.collapsed .mm-plot-worldbook-body,
.mm-plot-worldbook-section.collapsed .mm-plot-worldbook-resize-handle {
  display: none;
}

/* 拖拽时禁用过渡动画 */
.mm-plot-panel.resizing,
.mm-plot-worldbook-section.resizing {
  transition: none !important;
}

/* 世界书区域底部拖拽调整高度手柄 */
.mm-plot-worldbook-resize-handle {
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: ns-resize;
  background: var(--mm-bg-secondary);
  border-top: 1px solid var(--mm-border);
  color: var(--mm-text-muted);
  font-size: 10px;
  user-select: none;
  transition: background 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.mm-plot-worldbook-resize-handle:hover {
  background: rgba(var(--mm-primary-rgb, 74, 144, 217), 0.15);
  color: var(--mm-primary);
}

.mm-plot-worldbook-resize-handle:active,
.mm-plot-worldbook-resize-handle.resizing {
  background: rgba(var(--mm-primary-rgb, 74, 144, 217), 0.25);
  color: var(--mm-primary);
}

.mm-plot-worldbook-header {
  padding: 10px 16px;
  background: var(--mm-bg-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.mm-plot-worldbook-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.mm-plot-worldbook-title {
  flex: 1;
  font-size: 0.9em;
  font-weight: 500;
  color: var(--mm-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mm-plot-worldbook-title i {
  color: var(--mm-primary);
}

.mm-plot-worldbook-badge {
  font-size: 0.8em;
  padding: 2px 8px;
  background: var(--mm-bg-card);
  border-radius: 10px;
  color: var(--mm-text-muted);
}

.mm-plot-worldbook-arrow {
  color: var(--mm-text-muted);
  transition: transform 0.3s ease;
}

.mm-plot-worldbook-section.collapsed .mm-plot-worldbook-arrow {
  transform: rotate(-90deg);
}

.mm-plot-worldbook-body {
  padding: 8px 12px;
  flex: 1;
  overflow-y: auto;
  background: var(--mm-bg);
}

/* 世界书搜索框 */
.mm-plot-worldbook-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--mm-bg-secondary);
  border-radius: var(--mm-radius);
  margin-bottom: 8px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.mm-plot-worldbook-search i.fa-search {
  color: var(--mm-text-muted);
  font-size: 0.85em;
}

.mm-plot-worldbook-search input {
  flex: 1;
  background: none;
  border: none;
  color: var(--mm-text);
  font-size: 0.85em;
  outline: none;
}

.mm-plot-worldbook-search input::placeholder {
  color: var(--mm-text-muted);
}

.mm-btn-icon-small {
  background: none;
  border: none;
  color: var(--mm-text-muted);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 0.8em;
  border-radius: 3px;
}

.mm-btn-icon-small:hover {
  color: var(--mm-text);
  background: rgba(255, 255, 255, 0.1);
}

/* 搜索高亮 */
.mm-search-highlight {
  background: rgba(255, 193, 7, 0.3);
  border-radius: 2px;
  padding: 0 1px;
}

.mm-plot-worldbook-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 世界书列表项 */
.mm-plot-book-item {
  background: var(--mm-bg-secondary);
  border-radius: calc(var(--mm-radius) - 2px);
  overflow: hidden;
}

.mm-plot-book-item.selected {
  background: rgba(var(--mm-primary-rgb, 74, 144, 217), 0.15);
}

.mm-plot-book-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 0.9em;
}

.mm-plot-book-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.mm-plot-book-checkbox {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--mm-primary);
}

.mm-plot-book-name {
  flex: 1;
  font-weight: 500;
  color: var(--mm-text);
}

.mm-plot-book-count {
  font-size: 0.85em;
  color: var(--mm-text-muted);
}

.mm-plot-book-expand {
  color: var(--mm-text-muted);
  font-size: 0.8em;
  transition: transform 0.2s ease;
}

.mm-plot-book-item.expanded .mm-plot-book-expand {
  transform: rotate(90deg);
}

/* 世界书条目列表 */
.mm-plot-book-entries {
  display: none;
  padding: 4px 8px 8px 28px;
  border-top: 1px solid var(--mm-border);
  background: rgba(0, 0, 0, 0.1);
  max-height: 100px;
  overflow-y: auto;
}

.mm-plot-book-item.expanded .mm-plot-book-entries {
  display: block;
}

.mm-plot-entry-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  font-size: 0.85em;
  color: var(--mm-text-muted);
  border-radius: 3px;
}

.mm-plot-entry-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--mm-text);
}

.mm-plot-entry-checkbox {
  width: 12px;
  height: 12px;
  cursor: pointer;
  accent-color: var(--mm-primary);
}

.mm-plot-entry-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-plot-loading,
.mm-plot-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  color: var(--mm-text-muted);
  font-size: 0.9em;
}

/* 底部操作区 */
.mm-plot-panel-footer {
  padding: 12px 16px;
  background: var(--mm-bg-secondary);
  border-top: 1px solid var(--mm-border);
  border-radius: 0 0 var(--mm-radius) var(--mm-radius);
}

.mm-plot-input-area {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.mm-plot-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--mm-border);
  border-radius: calc(var(--mm-radius) - 2px);
  background: var(--mm-bg);
  color: var(--mm-text);
  font-size: 0.9em;
  outline: none;
  transition: border-color 0.2s ease;
}

.mm-plot-input:focus {
  border-color: var(--mm-primary);
}

.mm-plot-input::placeholder {
  color: var(--mm-text-muted);
}

.mm-plot-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.mm-plot-actions .mm-btn {
  padding: 8px 16px;
  font-size: 0.9em;
}

.mm-btn-success {
  background: var(--mm-success);
  color: white;
  border: none;
}

.mm-btn-success:hover {
  background: #218838;
}

.mm-btn-success:disabled {
  background: #1e5631;
  opacity: 0.6;
  cursor: not-allowed;
}

/* 剧情优化面板拖动状态 */
.mm-plot-panel.mm-dragging {
  opacity: 0.95;
  transition: none !important;
  cursor: grabbing;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
}

.mm-plot-panel.mm-dragging .mm-plot-panel-header {
  cursor: grabbing;
}

/* 剧情优化面板移动端适配 */
@media (max-width: 768px) {
  .mm-plot-panel {
    width: calc(100vw - 24px);
    max-width: 420px;
    max-height: 70vh;
  }

  .mm-plot-chat-container {
    max-height: 45vh;
  }

  .mm-plot-actions {
    flex-wrap: wrap;
  }

  .mm-plot-actions .mm-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    padding: 10px 8px;
    font-size: 12px;
  }

  .mm-plot-actions .mm-btn:last-child {
    flex: 1 1 100%;
  }

  /* 世界书选择区域移动端适配 */
  .mm-plot-worldbook-section {
    max-height: 300px;
  }

  .mm-plot-worldbook-header {
    padding: 8px 12px;
  }

  .mm-plot-worldbook-title {
    font-size: 0.85em;
  }

  .mm-plot-worldbook-body {
    padding: 6px 10px;
  }

  .mm-plot-worldbook-search input {
    font-size: 13px;
    padding: 6px 8px;
  }

  .mm-plot-worldbook-list {
    gap: 6px;
  }

  .mm-plot-worldbook-item {
    padding: 8px 10px;
  }

  .mm-plot-worldbook-item-name {
    font-size: 12px;
  }

  /* 世界书拖拽手柄移动端适配 */
  .mm-plot-worldbook-resize-handle {
    height: 18px;
    touch-action: none;
  }
}

@media (max-width: 480px) {
  .mm-plot-panel {
    width: 70vw;
    min-width: 260px;
    max-width: 320px;
    max-height: 65vh;
  }

  .mm-plot-panel-header {
    padding: 8px 12px;
  }

  .mm-plot-panel-title {
    font-size: 13px;
  }

  .mm-plot-chat-container {
    padding: 10px;
    max-height: 40vh;
  }

  .mm-plot-panel-footer {
    padding: 10px 12px;
  }

  .mm-plot-actions .mm-btn {
    padding: 8px 10px;
    font-size: 11px;
  }

  /* 世界书选择区域小屏幕适配 */
  .mm-plot-worldbook-section {
    max-height: 250px;
  }

  .mm-plot-worldbook-header {
    padding: 6px 10px;
    gap: 6px;
  }

  .mm-plot-worldbook-title {
    font-size: 0.8em;
    gap: 6px;
  }

  .mm-plot-worldbook-badge {
    font-size: 0.7em;
    padding: 2px 6px;
  }

  .mm-plot-worldbook-body {
    padding: 4px 8px;
  }

  .mm-plot-worldbook-search {
    gap: 6px;
  }

  .mm-plot-worldbook-search input {
    font-size: 12px;
    padding: 5px 6px;
  }

  .mm-plot-worldbook-item {
    padding: 6px 8px;
  }

  .mm-plot-worldbook-item-name {
    font-size: 11px;
  }

  .mm-plot-worldbook-item-count {
    font-size: 10px;
  }

  /* 世界书拖拽手柄小屏幕适配 */
  .mm-plot-worldbook-resize-handle {
    height: 22px;
    touch-action: none;
  }

  /* 输入区域小屏幕适配 */
  .mm-plot-input-area {
    gap: 6px;
  }

  .mm-plot-input {
    font-size: 13px;
    padding: 8px 10px;
  }
}

/* ============================================================================
   游戏时间板块样式
   ============================================================================ */

/* 游戏区 */
.mm-game-section {
  margin-top: 16px;
  padding-top: 16px;
  padding-bottom: 180px;
  border-top: 1px solid var(--mm-border);
}

.mm-game-chip {
  border-left: 3px solid #ff69b4;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mm-game-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 144, 217, 0.3);
}

/* 游戏面板 - 参考搜索面板 */
.mm-game-panel {
  position: fixed;
  width: 600px;
  height: 680px;
  background: var(--mm-bg);
  border: 1px solid var(--mm-border);
  border-radius: var(--mm-radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 1000002;
  display: none;
  flex-direction: column;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
}

.mm-game-panel.mm-visible {
  display: flex;
}

/* 面板头部 */
.mm-game-panel-header {
  padding: 12px 16px;
  background: var(--mm-bg-secondary);
  border-bottom: 1px solid var(--mm-border);
  border-radius: var(--mm-radius) var(--mm-radius) 0 0;
  cursor: move;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  flex-shrink: 0;
}

.mm-game-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--mm-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mm-game-title i {
  color: var(--mm-primary);
}

.mm-game-panel-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 全屏按钮始终隐藏（使用最小化按钮切换图标即可） */
.mm-game-fullscreen {
  display: none;
}

.mm-game-iframe {
  flex: 1;
  width: 100%;
  border: none;
  background: #1a1a2e;
}

.mm-game-viewport {
  position: relative;
  flex: 1;
  width: 100%;
  overflow: hidden;
  background: #000;
}

.mm-game-viewport .mm-game-iframe {
  width: 100%;
  height: 100%;
  background: #000;
}

.mm-game-panel.mm-rotate-landscape .mm-game-iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--mm-viewport-h, 100%);
  height: var(--mm-viewport-w, 100%);
  transform: translate(-50%, -50%) rotate(90deg);
  transform-origin: center center;
}

.mm-game-landscape-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 1000003;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  text-align: center;
}

.mm-game-landscape-overlay .mm-game-landscape-card {
  width: min(520px, 100%);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 10, 18, 0.92);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.mm-game-landscape-overlay .mm-game-landscape-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.mm-game-landscape-overlay .mm-game-landscape-desc {
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.9;
  margin-bottom: 12px;
}

.mm-game-landscape-overlay .mm-game-landscape-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.mm-game-panel.mm-need-landscape .mm-game-landscape-overlay {
  display: flex;
}


/* 最小化 */
.mm-game-panel.mm-minimized {
  width: 220px;
  height: 48px;
}

.mm-game-panel.mm-minimized .mm-game-iframe {
  display: none;
}

/* 最小化时标题截断，确保按钮可见 */
.mm-game-panel.mm-minimized .mm-game-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.mm-game-panel.mm-minimized .mm-game-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100px;
}

.mm-game-panel.mm-minimized .mm-game-panel-controls {
  flex-shrink: 0;
}


/* 移动端 - 游戏面板需要更大空间 */
@media (max-width: 600px) {
  .mm-game-panel {
    width: calc(100vw - 20px);
    height: calc(100vh - 120px);
    max-width: 400px;
    max-height: 650px;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
  }

  .mm-game-panel.mm-minimized {
    width: 200px;
    height: 44px;
  }

  .mm-game-panel-header {
    padding: 10px 12px;
  }

  /* 笨鸟先飞专用 - 缩小容器 */
  .mm-game-panel.mm-game-clumsy {
    height: calc(50vh);
    max-height: 375px;
  }

  /* 笨鸟先飞最小化 - 覆盖大尺寸样式 */
  .mm-game-panel.mm-game-clumsy.mm-minimized {
    width: 200px;
    height: 44px;
    max-height: none;
  }
}

/* 移动端全屏游戏模式（用于 3D城市 / 马里奥） */
@media (pointer: coarse) {
  .mm-game-panel.mm-mobile-fullscreen {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
    transform: none;
  }

  @supports (height: 100dvh) {
    .mm-game-panel.mm-mobile-fullscreen {
      width: 100dvw;
      height: 100dvh;
    }
  }

  .mm-game-panel.mm-mobile-fullscreen .mm-game-panel-header {
    cursor: default;
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-left: calc(16px + env(safe-area-inset-left));
    padding-right: calc(16px + env(safe-area-inset-right));
  }

  .mm-game-panel.mm-mobile-fullscreen .mm-game-iframe {
    background: #000;
  }
}

/* 3D城市专用 - 需要更大空间 */
.mm-game-panel.mm-game-city3d {
  width: 90vw;
  height: 90vh;
  max-width: 1200px;
  max-height: 800px;
}

/* 3D城市最小化 - 覆盖大尺寸样式 */
.mm-game-panel.mm-game-city3d.mm-minimized {
  width: 220px;
  height: 48px;
  max-width: none;
  max-height: none;
}

@media (max-width: 600px) {
  .mm-game-panel.mm-game-city3d {
    width: 95vw;
    height: 85vh;
    max-width: none;
    max-height: none;
    top: 5vh;
    left: 2.5vw;
    border-radius: 8px;
  }

  .mm-game-panel.mm-game-city3d.mm-minimized {
    width: 180px;
    height: 40px;
  }
}

/* 超级马里奥专用 - 需要更大空间 */
.mm-game-panel.mm-game-mario {
  width: 80vw;
  height: 75vh;
  max-width: 1000px;
  max-height: 750px;
}

.mm-game-panel.mm-game-mario.mm-minimized {
  width: 220px;
  height: 48px;
  max-width: none;
  max-height: none;
}

@media (max-width: 600px) {
  .mm-game-panel.mm-game-mario {
    width: 95vw;
    height: 85vh;
    max-width: none;
    max-height: none;
    top: 5vh;
    left: 2.5vw;
    border-radius: 8px;
  }

  .mm-game-panel.mm-game-mario.mm-minimized {
    width: 180px;
    height: 40px;
  }
}

/* 人生重开专用 - 需要更高的面板 */
.mm-game-panel.mm-game-lifeRestart {
  height: 85vh;
  max-height: 900px;
}

.mm-game-panel.mm-game-lifeRestart.mm-minimized {
  width: 220px;
  height: 48px;
  max-height: none;
}

@media (max-width: 600px) {
  .mm-game-panel.mm-game-lifeRestart {
    height: 90vh;
    max-height: none;
  }

  .mm-game-panel.mm-game-lifeRestart.mm-minimized {
    width: 180px;
    height: 40px;
  }
}

/* ============================================================================
   流程配置弹窗样式
   ============================================================================ */

.mm-flow-config-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mm-flow-group-header {
  cursor: pointer;
}

.mm-flow-source-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mm-flow-source-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--mm-bg-secondary);
  border: 1px solid var(--mm-border);
  border-radius: calc(var(--mm-radius) - 2px);
  cursor: grab;
  transition: all 0.2s ease;
}

.mm-flow-source-item:hover {
  border-color: var(--mm-primary);
  background: rgba(74, 144, 217, 0.1);
}

.mm-flow-source-item .mm-drag-handle {
  color: var(--mm-text-muted);
  font-size: 12px;
  cursor: grab;
}

.mm-flow-source-item:active {
  cursor: grabbing;
}

.mm-flow-source-item .mm-drag-handle:active {
  cursor: grabbing;
}

.mm-flow-source-name {
  flex: 1;
  font-size: 13px;
  color: var(--mm-text);
}

/* 拖拽状态 */
.mm-flow-source-item.mm-dragging {
  opacity: 0.5;
  border-style: dashed;
}

.mm-flow-source-item.mm-drag-over-top {
  border-top: 2px solid var(--mm-primary);
}

.mm-flow-source-item.mm-drag-over-bottom {
  border-bottom: 2px solid var(--mm-primary);
}

/* 流程配置弹窗特定样式 */
.mm-flow-config-modal-content {
  display: flex;
  flex-direction: column;
  min-height: 300px;
  max-height: 80vh;
  resize: none;
}

.mm-flow-config-body {
  flex: 1;
  overflow-y: auto;
  min-height: 150px;
}

.mm-flow-config-resize-handle {
  width: 100%;
  height: 8px;
  cursor: ns-resize;
  background: var(--mm-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.mm-flow-config-resize-handle::after {
  content: "";
  width: 40px;
  height: 3px;
  background: var(--mm-text-muted);
  border-radius: 2px;
  opacity: 0.5;
}

.mm-flow-config-resize-handle:hover {
  background: var(--mm-primary);
}

.mm-flow-config-resize-handle:hover::after {
  opacity: 1;
}

/* ============================================================================
   发送前检查弹窗样式
   ============================================================================ */

/* 内容区域容器 - 修复空白问题 */
.mm-part-content-area {
  margin-top: 8px;
}

/* 发送前检查中的编辑器容器 - 覆盖默认最小高度 */
.mm-request-block .mm-resizable-editor-container {
  min-height: auto;
  display: flex;
  flex-direction: column;
}

/* 发送前检查中的内容编辑区域 */
.mm-request-block .mm-prompt-content {
  background: var(--mm-bg-secondary);
  padding: 8px;
  overflow: auto;
  font-size: 11px;
  white-space: pre-wrap;
  word-wrap: break-word;
  border: 1px solid var(--mm-border);
  border-radius: 4px 4px 0 0;
  cursor: text;
  outline: none;
  box-sizing: border-box;
  min-height: 60px;
  max-height: 300px;
}

.mm-request-block .mm-prompt-content:focus {
  border-color: var(--mm-primary);
}

/* 条件块样式 */
.mm-prompt-part-block {
  margin-bottom: 12px;
  padding: 10px;
  background: var(--mm-bg);
  border-radius: var(--mm-radius);
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.mm-prompt-part-block:hover {
  border-color: var(--mm-border);
}

.mm-prompt-part-block.mm-dragging {
  opacity: 0.5;
  border-style: dashed;
  border-color: var(--mm-primary);
}

/* 条件块标题区域 */
.mm-prompt-part-block > div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
}

/* 请求块样式 */
.mm-request-block {
  margin-bottom: 20px;
  padding: 15px;
  background: var(--mm-bg-card);
  border-radius: var(--mm-radius);
  border: 1px solid var(--mm-border);
}

.mm-request-content {
  margin-top: 10px;
}

/* 删除按钮样式 */
.mm-part-delete-btn {
  background: none;
  border: none;
  color: var(--mm-text-muted);
  cursor: pointer;
  font-size: 11px;
  padding: 3px 6px;
  margin-right: 4px;
  opacity: 0.6;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.mm-part-delete-btn:hover {
  opacity: 1;
  color: var(--mm-danger);
}

/* 折叠按钮样式 */
.mm-part-toggle-btn,
.mm-request-toggle-btn {
  background: none;
  border: none;
  color: var(--mm-text-secondary);
  cursor: pointer;
  font-size: 11px;
  padding: 3px;
  transition: color 0.2s ease;
}

.mm-part-toggle-btn:hover,
.mm-request-toggle-btn:hover {
  color: var(--mm-primary);
}

/* ============================================================================
   多端适配 - 弹窗界面
   ============================================================================ */

/* 平板适配 (768px) */
@media (max-width: 768px) {
  /* 通用弹窗适配 */
  .mm-modal-content {
    width: 95vw !important;
    max-width: 95vw !important;
  }

  .mm-modal-large {
    width: 95vw !important;
    max-width: 95vw !important;
  }

  /* 流程配置弹窗 */
  #mm-flow-config-modal .mm-modal-content {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 85vh;
  }

  #mm-flow-config-modal .mm-flow-config-body {
    padding: 12px;
  }

  #mm-flow-config-modal .mm-modal-footer {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* AI配置弹窗 */
  #mm-ai-config-modal .mm-modal-content {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh;
  }

  #mm-ai-config-modal .mm-modal-body {
    padding: 12px;
  }

  #mm-ai-config-modal .mm-form-group label {
    font-size: 13px;
  }

  #mm-ai-config-modal .mm-modal-footer {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* 剧情优化面板 - 平板端 */
  .mm-plot-panel:not(.mm-dragging) {
    top: 60px;
    right: 16px;
    left: auto;
    transform: none;
  }

  /* 记忆搜索面板 - 平板端 */
  .mm-search-panel:not(.mm-dragging) {
    top: 60px;
    left: 16px;
    right: auto;
    transform: none;
  }

  /* 进度面板 - 移动端安全定位（参考剧情优化面板，固定在左上角） */
  .mm-message-progress-panel:not(.mm-dragging):not(.mm-user-positioned) {
    top: 60px !important;
    left: 16px !important;
    right: auto !important;
    transform: none !important;
    max-height: 60vh !important;
  }

  /* 用户手动拖动后，允许自定义位置 */
  .mm-message-progress-panel.mm-user-positioned {
    top: unset !important;
    left: unset !important;
    right: unset !important;
    transform: none !important;
  }
}

/* 手机适配 (480px) */
@media (max-width: 480px) {
  /* 通用弹窗适配 */
  .mm-modal-content {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    max-height: 90vh;
    border-radius: 8px;
  }

  .mm-modal-large {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
  }

  .mm-modal-header {
    padding: 12px;
  }

  .mm-modal-header h4 {
    font-size: 14px;
  }

  .mm-modal-body {
    padding: 12px;
  }

  .mm-modal-footer {
    padding: 12px;
    flex-direction: column;
    gap: 8px;
  }

  .mm-modal-footer .mm-btn {
    width: 100%;
    justify-content: center;
  }

  /* 流程配置弹窗 */
  #mm-flow-config-modal .mm-flow-config-modal-content {
    min-height: 250px;
    max-height: 85vh;
  }

  #mm-flow-config-modal .mm-flow-group-header {
    font-size: 13px;
    padding: 8px 10px;
  }

  #mm-flow-config-modal .mm-flow-source-item {
    padding: 8px 10px;
    font-size: 12px;
  }

  #mm-flow-config-modal .mm-flow-config-resize-handle {
    height: 18px;
    touch-action: none;
  }

  #mm-flow-config-modal .mm-flow-config-resize-handle::after {
    width: 50px;
    height: 4px;
  }

  /* AI配置弹窗 */
  #mm-ai-config-modal .mm-config-tabs {
    flex-wrap: wrap;
    gap: 4px;
  }

  #mm-ai-config-modal .mm-config-tab {
    flex: 1;
    min-width: 80px;
    padding: 8px 10px;
    font-size: 12px;
    text-align: center;
  }

  #mm-ai-config-modal input,
  #mm-ai-config-modal select {
    padding: 8px 10px;
    font-size: 13px;
  }

  #mm-ai-config-modal .mm-slider-value {
    font-size: 12px;
  }

  /* 剧情优化面板 - 手机端位置 */
  .mm-plot-panel:not(.mm-dragging) {
    top: 60px;
    right: 8px;
    left: auto;
    transform: none;
  }

  /* 记忆搜索面板 - 手机端位置 */
  .mm-search-panel:not(.mm-dragging) {
    top: 60px;
    left: 8px;
    right: auto;
    transform: none;
  }

  /* 进度面板 - 手机端安全定位（参考剧情优化面板，固定在左上角） */
  .mm-message-progress-panel:not(.mm-dragging):not(.mm-user-positioned) {
    top: 60px !important;
    left: 8px !important;
    right: auto !important;
    transform: none !important;
    max-height: 55vh !important;
    width: calc(100vw - 24px) !important;
    max-width: 300px !important;
  }

  /* 用户手动拖动后，允许自定义位置 */
  .mm-message-progress-panel.mm-user-positioned {
    top: unset !important;
    left: unset !important;
    right: unset !important;
    transform: none !important;
  }

  /* 汇总检查弹窗（动态创建） */
  .mm-modal.mm-modal-visible .mm-modal-content {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    height: auto !important;
    max-height: 85vh !important;
  }
}

/* ============================================================================
   隐藏破限词相关元素（功能保留，仅UI隐藏）
   ============================================================================ */

/* 流程配置界面 - 隐藏破限词条件块 */
.mm-flow-source-item[data-source="jailbreak"] {
  display: none !important;
}

/* 发送前检查界面 - 隐藏破限词部分块 */
.mm-prompt-part-block[data-source="jailbreak"] {
  display: none !important;
}
