/* ─── 全局 ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0d0d1a;
  --surface: #16162b;
  --surface2: #1e1e3a;
  --surface3: #2a2a4e;
  --border: #333366;
  --text: #e0e0f0;
  --text-dim: #8888bb;
  --accent: #4fc3f7;
  --accent2: #7c4dff;
  --green: #66bb6a;
  --danger: #ff5252;
  --radius: 8px;
  --shadow: 0 2px 16px rgba(0,0,0,0.5);
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}


/* ─── 主布局 ─── */
#app { display: flex; flex-direction: column; height: 100vh; }

/* ─── 顶栏 ─── */
#topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 48px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.app-title { font-weight: 700; font-size: 15px; }
.badge {
  font-size: 12px; padding: 2px 10px;
  border-radius: 12px;
  background: var(--surface2);
  color: var(--text-dim);
}
.badge.online { background: #1b3a1b; color: var(--green); }
.badge.offline { background: #3a1b1b; color: var(--danger); }
.badge.admin { background: #3a2b1b; color: #ffd700; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

/* 开关 */
.lan-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: #444; border-radius: 22px;
  cursor: pointer; transition: 0.2s;
}
.slider::before {
  content: ''; position: absolute; height: 16px; width: 16px;
  left: 3px; bottom: 3px;
  background: white; border-radius: 50%;
  transition: 0.2s;
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(18px); }

#lan-status { font-size: 13px; min-width: 100px; }

.toolbar-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  transition: 0.12s;
  white-space: nowrap;
}
.toolbar-btn:hover { background: var(--surface3); }
.toolbar-btn.primary { background: var(--accent); color: #000; border-color: var(--accent); }
.toolbar-btn.primary:hover { opacity: 0.85; }
.toolbar-btn.danger:hover { background: var(--danger); color: #fff; }
.toolbar-btn:disabled { opacity: 0.4; cursor: default; }

/* ─── 三栏布局 ─── */
#main-layout { display: flex; flex: 1; overflow: hidden; }

/* ─── 左侧导航 ─── */
#left-nav {
  width: 64px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 2px;
}
.nav-btn {
  width: 48px; height: 48px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  transition: 0.12s;
}
.nav-btn:hover { background: var(--surface2); color: var(--text); }
.nav-btn.active { background: var(--surface3); color: var(--accent); }
.nav-icon { font-size: 18px; line-height: 1; }
.nav-label { font-size: 9px; }
.nav-spacer { flex: 1; }

/* ─── 管理面板（导航下方） ─── */
.admin-panel-below {
  width: 100%;
  padding: 6px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
  font-size: 11px;
  overflow-y: auto;
  max-height: calc(100vh - 520px);
  box-sizing: border-box;
}
.admin-panel-below .admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 11px;
  color: var(--accent);
}
.admin-panel-below table th,
.admin-panel-below table td {
  padding: 1px 2px;
  font-size: 9px;
  line-height: 1.3;
  word-break: break-all;
}
.admin-panel-below table input,
.admin-panel-below table select,
.admin-panel-below table button {
  font-size: 9px !important;
  padding: 1px 3px !important;
}

/* ─── 内容区 ─── */
#content-area {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.module-panel {
  display: none;
  height: 100%;
  flex-direction: column;
  padding: 16px;
}
.module-panel.active { display: flex; }
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-shrink: 0;
}
.panel-header h2 { font-size: 18px; font-weight: 600; }
.panel-actions { display: flex; gap: 8px; }
.module-body { flex: 1; overflow: auto; min-height: 0; }
.editor-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-dim);
  font-size: 14px;
}

/* ─── 右侧面板 ─── */
#right-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
}
#right-sidebar h3 {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.status-card {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}
.status-none { color: var(--text-dim); font-size: 13px; line-height: 1.6; }
.status-connected { color: var(--green); font-weight: 600; }
.peer-name { font-weight: 600; font-size: 15px; }

#transfer-list { max-height: 120px; overflow-y: auto; margin-bottom: 6px; }
.transfer-item {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 4px;
}
.transfer-item:hover { background: var(--surface2); }
.transfer-item input { accent-color: var(--accent); }

#peer-note-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface2);
  color: var(--text);
  font-size: 13px;
  resize: vertical;
  outline: none;
  font-family: inherit;
  min-height: 40px;
}
#peer-note-input:focus { border-color: var(--accent); }
#peer-note-save { width: 100%; margin-top: 4px; }

/* ─── 项目网格 ─── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  align-content: start;
}
.project-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: 0.12s;
}
.project-card:hover { border-color: var(--accent); background: var(--surface3); }
.project-card .p-type {
  font-size: 20px;
  margin-bottom: 6px;
}
.project-card .p-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  word-break: break-all;
}
.project-card .p-meta {
  font-size: 11px;
  color: var(--text-dim);
}
.project-card .p-owner {
  font-size: 11px;
  color: var(--accent2);
}
.project-card .p-del {
  float: right;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
}
.project-card .p-del:hover { color: var(--danger); }

/* ─── 同步分隔线 ─── */
.sync-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  color: var(--text-dim);
  font-size: 13px;
  user-select: none;
}
.sync-divider-line {
  flex: 1;
  height: 1px;
  border-top: 1px dashed var(--border);
}
.sync-divider-text {
  white-space: nowrap;
  padding: 2px 10px;
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: 12px;
}

/* ─── 同步项目卡片：轻微区分 ─── */
.project-card.synced {
  border-style: dashed;
  background: linear-gradient(135deg, var(--surface2) 0%, rgba(120, 120, 120, 0.05) 100%);
}

/* ─── 文件夹卡片：金色边框 ─── */
.project-card.folder {
  border-color: #c8a84e;
  background: linear-gradient(135deg, var(--surface2) 0%, #2a2518 100%);
}
.project-card.folder:hover {
  border-color: #ffd700;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.15);
}
.project-card.folder .p-type { color: #ffd700; }
.project-card.folder .p-meta { color: #c8a84e; }

/* ─── 创建按钮区域 ─── */
.create-buttons {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.create-buttons-inline {
  display: flex;
  gap: 4px;
  align-items: center;
}
.create-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: 0.2s;
  flex-shrink: 0;
}
.create-btn:hover {
  border-color: var(--accent);
  background: var(--surface3);
  transform: scale(1.02);
}
.create-btn .create-icon {
  font-size: 18px;
  margin-bottom: 2px;
}
.create-btn .create-label {
  font-size: 10px;
  color: var(--text-secondary);
  text-align: center;
}

/* ─── 设备卡片 ─── */
.device-grid { display: flex; flex-direction: column; gap: 8px; }
.device-card {
  display: flex; align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  gap: 12px;
}
.device-card .d-status {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.device-card .d-status.online { background: var(--green); box-shadow: 0 0 6px var(--green); }
.device-card .d-status.offline { background: #555; }
.device-card .d-info { flex: 1; }
.device-card .d-name { font-weight: 600; }
.device-card .d-note { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.device-card .d-meta { font-size: 11px; color: var(--text-dim); }
.device-card .d-note-input {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 6px;
  color: var(--text);
  font-size: 12px;
  width: 100%;
  margin-top: 4px;
  outline: none;
}
.device-card .d-note-input:focus { border-color: var(--accent); }

/* ─── 剧本编辑器 ─── */
.act-section {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  padding: 12px;
}
.act-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.act-title {
  font-weight: 600;
  font-size: 15px;
  background: transparent;
  border: none;
  color: var(--text);
  outline: none;
  flex: 1;
}
.scene-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 8px;
}
.scene-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.scene-location {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
  font-size: 13px;
  padding: 2px 4px;
  outline: none;
}
.scene-time {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  font-size: 12px;
  padding: 2px 6px;
  outline: none;
  width: 100px;
}
.dialogue {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 4px 0;
}
.dialogue-char {
  width: 80px;
  font-weight: 600;
  color: var(--accent2);
  background: transparent;
  border: none;
  font-size: 13px;
  outline: none;
  flex-shrink: 0;
}
.dialogue-text {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  color: var(--text);
  font-size: 13px;
  outline: none;
  resize: none;
  min-height: 22px;
  font-family: inherit;
  line-height: 1.5;
}
.dialogue-text:focus { border-color: var(--border); }
.dialogue-del {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  padding: 2px;
}
.dialogue-del:hover { color: var(--danger); }

/* ─── 剧本编辑器 v2 ─── */
.script-charbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 12px; margin-bottom: 8px;
  background: var(--surface); border-radius: 6px; border: 1px solid var(--border);
}
.script-char-tag {
  padding: 2px 8px; background: var(--surface2); border-radius: 10px;
  font-size: 11px; color: var(--accent); cursor: pointer;
  border: 1px solid var(--border); transition: 0.1s;
}
.script-char-tag:hover { background: var(--surface3); border-color: var(--accent); }
.act-header { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--surface); border-radius: 6px 6px 0 0; border: 1px solid var(--border); cursor: move; }
.act-header.dragging { opacity: 0.4; }
.act-header.drag-over { border-color: var(--accent); background: rgba(79,195,247,0.1); }
.act-drag { color: var(--text-dim); font-size: 14px; cursor: move; user-select: none; }
.act-title { flex: 1; background: transparent; border: none; color: var(--text); font-size: 15px; font-weight: 600; outline: none; }
.act-arrow { cursor: pointer; color: var(--text-dim); font-size: 10px; width: 18px; text-align: center; }
.scene-card { border: 1px solid var(--border); border-top: none; padding: 6px 8px; cursor: move; }
.scene-card.dragging { opacity: 0.4; }
.scene-card.drag-over { border-color: var(--accent); background: rgba(79,195,247,0.06); }
.scene-header { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.scene-drag { color: var(--text-dim); font-size: 12px; cursor: move; user-select: none; }
.scene-location, .scene-time {
  background: transparent; border: 1px solid transparent; color: var(--text-dim);
  font-size: 12px; padding: 2px 4px; border-radius: 3px; outline: none; flex: 1;
}
.scene-location:focus, .scene-time:focus { border-color: var(--accent); color: var(--text); background: var(--surface2); }
.scene-lines { padding-left: 20px; }
.d-line { display: flex; align-items: flex-start; gap: 4px; padding: 3px 4px; border-radius: 4px; transition: background 0.1s; cursor: move; border-left: 3px solid transparent; }
.d-dialogue { border-left-color: var(--accent); }    /* 对白 — 蓝色 */
.d-action { border-left-color: #66bb6a; }             /* 动作 — 绿色 */
.d-env { border-left-color: #b388ff; }                /* 环境 — 紫色 */
.d-line:hover { background: var(--surface2); }
.d-line.dragging { opacity: 0.3; }
.d-line.drag-over { background: rgba(79,195,247,0.1); }
.d-drag-handle { color: var(--text-dim); font-size: 12px; cursor: move; padding-top: 6px; user-select: none; }
.d-char {
  background: var(--surface2); border: 1px solid var(--border); color: var(--accent);
  font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 4px; outline: none;
  width: 100px; min-width: 80px;
}
.d-char:focus { border-color: var(--accent); }
.d-text {
  flex: 1; background: transparent; border: none; color: var(--text);
  font-size: 13px; padding: 4px 6px; resize: none; outline: none; font-family: inherit;
  line-height: 1.5; min-height: 28px;
}
.d-type-text {
  flex: 1; background: transparent; border: none; color: var(--text-dim);
  font-size: 12px; font-style: italic; padding: 4px 6px; resize: none; outline: none;
  font-family: inherit; line-height: 1.5; min-height: 28px;
}
.d-type-badge { background: none; border: none; cursor: pointer; font-size: 13px; padding: 4px; opacity: 0.5; }
.d-type-badge:hover { opacity: 1; }
.d-action .d-type-text { color: #a8d8a8; }  /* 动作描写 — 绿色 */
.d-env .d-type-text { color: #c8a8e8; }  /* 环境描写 — 紫色 */
.d-del { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 14px; padding: 2px 4px; }
.d-del:hover { color: var(--danger); }

/* ─── 思维导图 ─── */
#mindmap-editor { position: relative; overflow: hidden; }
#mindmap-canvas {
  width: 100%; height: 100%;
  cursor: grab;
  background: var(--bg);
}
#mindmap-canvas:active { cursor: grabbing; }
#mindmap-toolbar {
  position: absolute;
  bottom: 12px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 10;
}
#mindmap-toolbar .tool-btn, .tool-btn {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
}
#mindmap-toolbar .tool-btn:hover { background: var(--surface3); }
#mindmap-toolbar .tool-btn.danger:hover { background: var(--danger); color: #fff; }
#mm-color { width: 24px; height: 24px; border: none; border-radius: 4px; cursor: pointer; padding: 0; }

/* 思维导图节点（canvas overlay 输入） */
.mm-input-overlay {
  position: absolute;
  background: var(--surface2);
  border: 2px solid var(--accent);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  min-width: 100px;
  z-index: 20;
  font-family: inherit;
}

/* ─── 故事编辑器 ─── */
#story-layout { display: flex; height: 100%; gap: 12px; }
#story-chapter-list {
  width: 180px;
  flex-shrink: 0;
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 8px;
  overflow-y: auto;
}
.chapter-item {
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  margin-bottom: 4px;
}
.chapter-item:hover { background: var(--surface3); }
.chapter-item.active { background: var(--surface3); color: var(--accent); border-left: 2px solid var(--accent); }
.chapter-item .ch-del {
  float: right;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: none;
}
.chapter-item:hover .ch-del { display: inline; }
.chapter-item .ch-del:hover { color: var(--danger); }
.chapter-title-input {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 13px;
  width: 120px;
  outline: none;
}

#story-content { flex: 1; display: flex; flex-direction: column; }
#story-textarea {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  color: var(--text);
  font-size: 15px;
  line-height: 1.8;
  resize: none;
  outline: none;
  font-family: inherit;
  min-height: 200px;
}
#story-textarea:focus { border-color: var(--accent); }

/* ─── 弹窗 ─── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 40px;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow);
}
.modal-card h3 { margin-bottom: 12px; }
.modal-card p { color: var(--text-dim); margin-bottom: 16px; font-size: 14px; }
#receive-list { margin-bottom: 16px; }
#receive-list .rp-item {
  padding: 6px 10px;
  background: var(--surface2);
  border-radius: 4px;
  margin-bottom: 4px;
  font-size: 13px;
}

/* ─── 自定义 alert 弹窗 ─── */
.alert-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 40px 28px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  text-align: center;
  animation: alertFadeIn 0.2s ease-out;
}
@keyframes alertFadeIn {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.alert-icon {
  font-size: 36px;
  margin-bottom: 8px;
  line-height: 1;
}
.alert-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.alert-text {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 20px;
  word-break: break-word;
}
.alert-btn {
  padding: 9px 32px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #000;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.alert-btn:hover { opacity: 0.85; }

/* ─── 自定义 confirm ─── */
.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.confirm-btn {
  flex: 1;
  padding: 9px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.confirm-btn:hover { opacity: 0.85; }
.confirm-btn.cancel {
  background: var(--surface2);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.confirm-btn.ok {
  background: var(--accent);
  color: #000;
}

/* ─── 新建项目通用弹窗 ─── */
.create-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 420px;
  max-width: 94%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  overflow: hidden;
  animation: alertFadeIn 0.2s ease-out;
}
.create-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px 0;
}
.create-icon {
  font-size: 24px;
  line-height: 1;
}
.create-title {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}
.create-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: 4px;
  transition: 0.12s;
}
.create-close:hover {
  background: var(--surface2);
  color: var(--text);
}
.create-body {
  padding: 20px 24px;
}
.create-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.create-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  font-size: 15px;
  outline: none;
  font-family: inherit;
  transition: 0.12s;
}
.create-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.15);
}
.create-input::placeholder {
  color: var(--text-dim);
  opacity: 0.6;
}
.create-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 10px;
  line-height: 1.5;
}
.create-actions {
  display: flex;
  gap: 10px;
  padding: 0 24px 20px;
}
.create-btn {
  flex: 1;
  padding: 10px 0;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.create-btn:hover { opacity: 0.85; }
.create-btn.cancel {
  background: var(--surface2);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.create-btn.confirm {
  background: var(--accent);
  color: #000;
}

/* ─── 在线用户 ─── */
#online-users-section {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#online-users-section h3 {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 6px;
  flex-shrink: 0;
}
#online-users-area {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.online-user-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  margin-bottom: 2px;
  background: var(--surface2);
  font-size: 13px;
}
.online-user-item:hover {
  background: var(--surface3);
}
.online-user-dot {
  font-size: 14px;
  flex-shrink: 0;
}
.online-user-name {
  font-weight: 500;
  color: var(--text);
}

/* ─── 扫描状态提示 ─── */
.scan-status {
  font-size: 12px;
  text-align: center;
  margin-top: 4px;
  padding: 4px 8px;
  border-radius: 4px;
}
.scan-status.scanning {
  background: #1b3a1b;
  color: #66bb6a;
}
.scan-status.nobody {
  background: #3a1b1b;
  color: #ff5252;
}
.scan-status.found {
  color: var(--green);
}

/* ─── 活动日志 ─── */
#activity-log {
  display: flex; flex-direction: column; gap: 2px;
  font-size: 13px; line-height: 1.6;
}
.log-entry {
  padding: 4px 8px;
  border-radius: 4px;
  display: flex; align-items: center; gap: 6px;
}
.log-entry:hover { background: var(--surface2); }
.log-entry .log-time {
  font-size: 11px;
  color: var(--text-dim);
  flex-shrink: 0;
  min-width: 50px;
}
.log-entry .log-user {
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

/* ─── 滚动条 ─── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ─── 思维导图右键菜单 ─── */
.mm-context-menu {
  position: fixed; z-index: 9999;
  background: #1a1a35;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 6px 0;
  min-width: 190px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  font-size: 13px;
  backdrop-filter: blur(8px);
}
.mm-context-menu .mm-cm-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.08s;
  user-select: none;
}
.mm-context-menu .mm-cm-item:hover { background: rgba(79, 195, 247, 0.12); }
.mm-context-menu .mm-cm-item:active { background: rgba(79, 195, 247, 0.2); }
.mm-context-menu .mm-cm-icon { width: 22px; text-align: center; font-size: 14px; flex-shrink: 0; }
.mm-context-menu .mm-cm-label { flex: 1; }
.mm-context-menu .mm-cm-shortcut { color: var(--text-dim); font-size: 11px; margin-left: auto; letter-spacing: 0.3px; }
.mm-context-menu .mm-cm-arrow { color: var(--text-dim); font-size: 10px; margin-left: 4px; }
.mm-context-menu .mm-cm-sep { height: 1px; background: rgba(255,255,255,0.06); margin: 4px 10px; }
.mm-context-menu .mm-cm-sub { position: relative; }
.mm-context-menu .mm-cm-sub-menu {
  display: none;
  position: absolute; left: 100%; top: -6px;
  background: #1a1a35;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 6px 0;
  min-width: 100px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
}
.mm-context-menu .mm-cm-sub:hover > .mm-cm-sub-menu { display: block; }
.mm-context-menu .mm-color-swatch {
  display: inline-block; width: 20px; height: 20px;
  border-radius: 50%; border: 2px solid rgba(255,255,255,0.1);
  cursor: pointer; margin: 2px;
}
.mm-context-menu .mm-color-swatch:hover { border-color: var(--accent); }

/* ─── 思维导图备注面板 ─── */
#mm-note-panel {
  position: absolute; right: 12px; top: 60px; bottom: 60px; width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: none;
  flex-direction: column;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
#mm-note-panel.open { display: flex; }
#mm-note-panel h4 { font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
#mm-note-panel textarea {
  flex: 1; resize: none;
  padding: 8px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--surface2);
  color: var(--text); font-size: 13px;
  font-family: inherit; outline: none; min-height: 80px;
}
#mm-note-panel textarea:focus { border-color: var(--accent); }
#mm-note-panel .mm-note-close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; font-size: 16px;
}

/* ─── 思维导图标记 ─── */
.mm-marker-picker {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
  padding: 6px;
}
.mm-marker-picker .mm-marker-opt {
  width: 28px; height: 28px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px;
  border: 1px solid transparent;
}
.mm-marker-picker .mm-marker-opt:hover { border-color: var(--accent); background: var(--surface2); }
.mm-marker-picker .mm-marker-opt.active { border-color: var(--accent); background: rgba(79,195,247,0.15); }

.mm-priority-picker {
  display: flex; gap: 4px; padding: 6px;
}
.mm-priority-picker .mm-pri-opt {
  width: 28px; height: 28px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px; font-weight: 600;
  border: 1px solid transparent;
}
.mm-priority-picker .mm-pri-opt:hover { border-color: var(--accent); }
.mm-priority-picker .mm-pri-opt.active { border-color: var(--accent); background: rgba(79,195,247,0.15); }

/* ─── 导图历史下拉 ─── */
.mm-hist-dropdown {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  z-index: 9999;
}
.mm-hist-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 14px; font-size: 13px; cursor: pointer;
  color: var(--text); white-space: nowrap;
  transition: background 0.1s;
}
.mm-hist-item:hover { background: var(--surface2); }
.mm-hist-item.active { background: rgba(79,195,247,0.12); color: var(--accent); }

/* ─── 思维导图浮动工具栏 ─── */
.mm-float-bar {
  position: absolute; z-index: 100;
  display: flex; align-items: center; gap: 4px;
  padding: 4px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  pointer-events: auto;
}
.mm-fb-group { display: flex; align-items: center; gap: 3px; }
.mm-fb-color {
  width: 16px; height: 16px; border-radius: 50%;
  cursor: pointer; border: 2px solid transparent;
  transition: border-color 0.1s;
}
.mm-fb-color:hover { border-color: #fff; }
.mm-fb-color.active { border-color: #fff; box-shadow: 0 0 6px rgba(255,255,255,0.4); }
.mm-fb-btn {
  padding: 2px 6px; border: 1px solid transparent;
  border-radius: 4px; background: transparent;
  color: var(--text); cursor: pointer; font-size: 13px;
  transition: 0.1s; line-height: 1.4;
}
.mm-fb-btn:hover { background: var(--surface2); border-color: var(--border); }
.mm-fb-btn.active { background: var(--surface3); border-color: var(--accent); color: var(--accent); }
.mm-fb-del:hover { color: var(--danger); }
.mm-fb-sep { width: 1px; height: 18px; background: var(--border); display: inline-block; }

/* ─── 思维导图搜索 ─── */
#mm-search-box {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  display: none; align-items: center; gap: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
#mm-search-box.open { display: flex; }
#mm-search-box input {
  border: none; background: transparent; color: var(--text);
  font-size: 13px; outline: none; width: 160px;
}
#mm-search-box .mm-search-count { color: var(--text-dim); font-size: 11px; white-space: nowrap; }

/* ─── 响应式 ─── */
@media (max-width: 900px) {
  #right-sidebar { width: 180px; }
  #left-nav { width: 52px; }
  .nav-btn { width: 40px; height: 40px; }
  .nav-icon { font-size: 16px; }
  .nav-label { display: none; }
}

/* ─── 手机端适配（不影响桌面端） ─── */
@media (max-width: 768px) {
  /* 顶栏 */
  #topbar { flex-wrap: wrap; gap: 4px; padding: 4px 8px; min-height: 40px; }
  #topbar .toolbar-btn { font-size: 11px; padding: 3px 8px; }
  #topbar h1 { font-size: 14px; }
  .topbar-left, .topbar-right { gap: 4px; }

  /* 左侧导航 - 变为极窄条 */
  #left-nav { width: 44px; padding: 4px 0; }
  .nav-btn { width: 34px; height: 34px; margin: 1px auto; border-radius: 6px; }
  .nav-icon { font-size: 14px; }
  .nav-label { display: none; }

  /* 右侧面板 - 完全隐藏 */
  #right-sidebar { display: none; }

  /* 内容区 - 占满剩余宽度 */
  #content-area { padding: 0; }

  /* 模块面板 */
  .module-panel { padding: 8px; }

  /* 项目网格 - 单列或两列 */
  .project-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
  .project-card { padding: 10px; }
  .project-card .p-name { font-size: 13px; }
  .project-card .p-meta { font-size: 10px; }
  .project-card .p-type { font-size: 22px; }

  /* 创建按钮区 */
  .create-buttons { gap: 6px; }
  .create-btn { width: 44px; height: 44px; font-size: 18px; }
  .create-label { font-size: 9px; }

  /* 管理员表格 - 横向滚动 */
  .admin-section { overflow-x: auto; }
  .admin-table { font-size: 11px; }
  .admin-table th, .admin-table td { padding: 4px 6px; }

  /* 各类弹窗 */
  .modal-card, .create-card, .login-card, .forgot-card { width: 92%; max-width: 92%; margin: 10px auto; padding: 16px; }
  #chat-modal .chat-modal { width: 94vw; max-width: 94vw; }
  .create-card { width: 92%; }

  /* 剧本编辑器 */
  #script-editor { padding: 4px; }
  .act-section { margin: 4px 0; }
  .scene-section { padding: 4px; }
  .d-line textarea { font-size: 12px; }

  /* 思维导图 */
  #mindmap-toolbar { flex-wrap: wrap; gap: 2px; padding: 4px; }
  #mindmap-toolbar .tool-btn { font-size: 11px; padding: 2px 6px; }

  /* 故事编辑器 */
  #story-layout { flex-direction: column; }
  #story-chapter-list { width: 100%; max-height: 120px; border-right: none; border-bottom: 1px solid var(--border); }

  /* 分镜 iframe */
  #panel-storyboard iframe { height: calc(100vh - 120px); }

  /* 面包屑导航 */
  #breadcrumb { flex-wrap: wrap; gap: 4px; padding: 4px 8px; font-size: 11px; }
  .crumb-item { font-size: 11px; }
  .create-buttons-inline { flex-wrap: wrap; gap: 2px; }
  .create-buttons-inline .create-btn { width: 36px; height: 36px; font-size: 14px; }

  /* 设备网格 */
  .device-grid { grid-template-columns: 1fr; gap: 6px; }

  /* 收件箱/消息 */
  #admin-msgs { max-height: 120px; font-size: 11px; }

  /* 通用调整 */
  .panel-header h2 { font-size: 14px; }
  .panel-actions { gap: 4px; flex-wrap: wrap; }
  input, select, textarea { font-size: 14px; } /* 防止iOS自动缩放 */
  #user-avatar { width: 26px; height: 26px; }
  .msg-card { padding: 10px; }
}

/* 小屏手机 */
@media (max-width: 480px) {
  .project-grid { grid-template-columns: 1fr; }
  .create-buttons { justify-content: center; }
  #topbar h1 { font-size: 12px; }
  #left-nav { width: 38px; }
  .nav-btn { width: 30px; height: 30px; }
  .nav-icon { font-size: 12px; }
  .module-panel { padding: 4px; }
  .project-card { padding: 8px; }
  .project-card .p-name { font-size: 12px; }
  .admin-table { font-size: 10px; }
  .admin-table th, .admin-table td { padding: 3px 4px; white-space: nowrap; }
}

/* ─── 登录弹窗 ─── */
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 380px;
  max-width: 94%;
  box-shadow: 0 8px 48px rgba(0,0,0,0.6);
  animation: alertFadeIn 0.25s ease-out;
  overflow: hidden;
}
.login-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 28px 28px 0;
}
.login-icon { font-size: 28px; line-height: 1; }
.login-title { font-size: 18px; font-weight: 700; color: var(--text); flex: 1; }
.login-body { padding: 20px 28px 28px; }
.login-field { margin-bottom: 14px; }
.login-label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--text-dim); margin-bottom: 6px;
}
.login-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: 0.12s;
}
.login-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.15);
}
.login-error {
  font-size: 13px;
  color: var(--danger);
  margin-bottom: 10px;
  padding: 6px 10px;
  background: rgba(255,82,82,0.1);
  border-radius: 6px;
  text-align: center;
}
.login-btn {
  width: 100%;
  padding: 11px 0;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #000;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  margin-top: 4px;
  font-family: inherit;
}
.login-btn:hover { opacity: 0.85; }
.login-btn:disabled { opacity: 0.4; cursor: default; }
.login-links { text-align: center; margin-top: 12px; }
.login-links a:hover { color: var(--accent) !important; }

/* ─── 忘记密码弹窗 ─── */
.forgot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 400px;
  max-width: 94%;
  box-shadow: 0 8px 48px rgba(0,0,0,0.6);
  animation: alertFadeIn 0.25s ease-out;
  overflow: hidden;
}
.forgot-header {
  display: flex; align-items: center; gap: 10px;
  padding: 24px 24px 0;
}
.forgot-icon { font-size: 24px; }
.forgot-title { font-size: 16px; font-weight: 600; flex: 1; }
.forgot-body { padding: 16px 24px 24px; }
.forgot-field { margin-bottom: 12px; }
.forgot-label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.forgot-input {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface2); color: var(--text);
  font-size: 13px; outline: none; font-family: inherit;
}
.forgot-input:focus { border-color: var(--accent); }
.forgot-actions { display: flex; gap: 8px; margin-top: 16px; }
.forgot-btn {
  flex: 1; padding: 9px 0; border: none; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.forgot-btn.primary { background: var(--accent); color: #000; }
.forgot-btn.primary:hover { opacity: 0.85; }
.forgot-btn.cancel { background: var(--surface2); color: var(--text-dim); border: 1px solid var(--border); }
.forgot-btn.cancel:hover { opacity: 0.85; }

/* ─── 私聊弹窗（微信风格） ─── */
#chat-modal {
  position: fixed;
  bottom: 80px;
  right: 24px;
  z-index: 999;
  display: none;
}
#chat-modal .chat-modal {
  width: 360px;
  max-width: 94vw;
  max-height: 80vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  cursor: move;
  user-select: none;
}
.chat-modal-title { font-size: 15px; font-weight: 600; }
.chat-modal-close { background: none; border: none; color: var(--text-dim); font-size: 18px; cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.chat-modal-close:hover { background: var(--surface2); color: var(--text); }

/* 消息容器 */
.chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  min-height: 200px;
  max-height: 400px;
  display: flex;
  flex-direction: column;
}

/* ─── 消息行（flex 排列） ─── */
.chat-msg {
  display: flex;
  align-items: flex-end;
  margin-bottom: 8px;
  max-width: 100%;
}
.chat-msg.me {
  flex-direction: row-reverse;
}

/* ─── 头像 ─── */
.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  background-color: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.chat-msg:not(.me) .chat-avatar { margin-right: 8px; }
.chat-msg.me .chat-avatar { margin-left: 8px; }

/* ─── 气泡 ─── */
.chat-bubble {
  max-width: 70%;
  padding: 8px 12px;
  font-size: 13px;
  word-break: break-word;
  line-height: 1.45;
  position: relative;
}
.chat-msg:not(.me) .chat-bubble {
  background: var(--surface2);
  color: var(--text);
  border-radius: 12px 12px 12px 4px;
}
.chat-msg.me .chat-bubble {
  background: var(--accent);
  color: #000;
  border-radius: 12px 12px 4px 12px;
}

/* ─── 时间 ─── */
.chat-time {
  font-size: 10px;
  color: var(--text-dim);
  margin: 0 6px;
  align-self: flex-end;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── 连续消息合并 ─── */
.chat-msg.merge { margin-bottom: 2px; }
.chat-msg.merge .chat-avatar { visibility: hidden; }
.chat-msg.merge:not(.me) .chat-bubble { border-radius: 4px 12px 12px 4px; }
.chat-msg.merge.me .chat-bubble { border-radius: 12px 4px 4px 12px; }
.chat-msg.merge:first-of-type:not(.me) .chat-bubble { border-top-left-radius: 12px; }
.chat-msg.merge:first-of-type.me .chat-bubble { border-top-right-radius: 12px; }
.chat-msg.merge:last-of-type:not(.me) .chat-bubble { border-bottom-left-radius: 12px; }
.chat-msg.merge:last-of-type.me .chat-bubble { border-bottom-right-radius: 12px; }

/* ─── 系统消息 ─── */
.chat-msg.system {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px;
  justify-content: center;
}

/* ─── 输入区 ─── */
.chat-input-area { display: flex; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--border); flex-shrink: 0; }
.chat-input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface2); color: var(--text); font-size: 13px; outline: none; font-family: inherit; }
.chat-input:focus { border-color: var(--accent); }
.chat-send-btn { padding: 8px 16px; border: none; border-radius: 8px; background: var(--accent); color: #000; font-weight: 600; cursor: pointer; font-size: 13px; }
.chat-send-btn:hover { opacity: 0.85; }
.chat-send-btn:disabled { opacity: 0.4; cursor: default; }

/* ─── 管理员控制面板（旧，保留兼容） ─── */
.control-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }
.control-card { background: var(--surface2); border-radius: 6px; padding: 8px; text-align: center; }
.control-card .cv { font-size: 18px; font-weight: 700; color: var(--accent); }
.control-card .cl { font-size: 10px; color: var(--text-dim); margin-top: 2px; }

/* ─── 管理面板（内容区完整页面） ─── */
.admin-stat-card { background: var(--surface2); border-radius: 8px; padding: 16px; text-align: center; }
.admin-stat-card .admin-stat-num { font-size: 28px; font-weight: 700; color: var(--accent); }
.admin-stat-card .admin-stat-label { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.admin-section { margin-bottom: 16px; }
.admin-section h3 { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }

/* ─── 群聊 ─── */
#group-list .group-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  transition: background 0.15s; border: none; background: none; width: 100%;
  text-align: left; color: var(--text); font-family: inherit;
}
#group-list .group-card:hover { background: var(--surface2); }
#group-list .group-card .group-icon { font-size: 24px; flex-shrink: 0; }
#group-list .group-card .group-info { flex: 1; min-width: 0; }
#group-list .group-card .group-name { font-size: 13px; font-weight: 600; }
#group-list .group-card .group-meta { font-size: 11px; color: var(--text-dim); }

/* 创建群聊 - 用户列表项 */
.create-user-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 6px; cursor: pointer;
}
.create-user-item:hover { background: var(--surface2); }
.create-user-item input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }
.create-user-item .create-user-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700;
}
.create-user-item .create-user-name { font-size: 13px; flex: 1; }

/* 群详情 - 成员列表 */
.group-member-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 6px;
}
.group-member-item:hover { background: var(--surface2); }
.group-member-item .gm-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700;
}
.group-member-item .gm-name { font-size: 13px; flex: 1; }
.group-member-item .gm-owner-badge { font-size: 11px; color: var(--accent); font-weight: 600; }
.group-member-item .gm-kick-btn {
  padding: 2px 8px; border: none; border-radius: 4px;
  background: #ef4444; color: #fff; font-size: 11px; cursor: pointer;
}
.group-member-item .gm-kick-btn:hover { opacity: 0.85; }

/* 群聊消息 - 发送者名称 */
.chat-msg.group { align-items: flex-start; }
.chat-msg.group.me { align-items: flex-end; }
.chat-msg.group .chat-msg-body { display: flex; flex-direction: column; max-width: 70%; }
.chat-msg.group .chat-msg-name { font-size: 11px; color: var(--text-dim); margin-bottom: 2px; margin-left: 4px; }
.chat-msg.group .chat-msg-body .chat-bubble { max-width: 100%; }
.chat-msg.group.me .chat-msg-body { align-items: flex-end; }
.chat-msg.group.me .chat-msg-name { display: none; }
.admin-table th { text-align: left; padding: 6px 8px; color: var(--text-dim); font-size: 12px; font-weight: 500; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.admin-table tr:hover td { background: var(--surface2); }
.admin-table select, .admin-table input { padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface2); color: var(--text); font-size: 12px; outline: none; }
.admin-table select:focus, .admin-table input:focus { border-color: var(--accent); }
.admin-table button { padding: 3px 10px; border: none; border-radius: 4px; cursor: pointer; font-size: 11px; }
.admin-table .btn-ban { background: var(--danger); color: #fff; }
.admin-table .btn-unban { background: var(--green); color: #000; }
.admin-table .btn-pwd { background: var(--accent); color: #000; }

/* ─── 审批面板 ─── */
.approve-item { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: var(--surface2); border-radius: 6px; margin-bottom: 4px; font-size: 12px; }
.approve-item .ai-name { font-weight: 600; color: var(--accent); }
.approve-item .ai-text { flex: 1; color: var(--text-dim); word-break: break-word; }
.approve-item button { padding: 2px 8px; border: none; border-radius: 4px; cursor: pointer; font-size: 11px; }
.approve-item .ai-approve { background: var(--green); color: #000; }
.approve-item .ai-reject { background: var(--danger); color: #fff; }

/* ─── 消息权限提示 ─── */
.perm-hint { font-size: 11px; color: var(--text-dim); text-align: center; padding: 4px; margin-top: 2px; }

/* ─── 批注面板 ─── */
#annotation-section { margin-top: 8px; }
.ann-card { background: var(--surface2); border-radius: 6px; padding: 6px 8px; margin-bottom: 6px; font-size: 12px; border-left: 3px solid var(--accent); }
.ann-header { display: flex; align-items: center; gap: 4px; margin-bottom: 3px; }
.ann-author { font-weight: 600; color: var(--accent); font-size: 11px; }
.ann-status { font-size: 11px; }
.ann-time { font-size: 10px; color: var(--text-dim); margin-left: auto; }
.ann-text { color: var(--text); word-break: break-word; margin-bottom: 3px; line-height: 1.4; }
.ann-anchor { font-size: 10px; color: var(--text-dim); font-style: italic; margin-bottom: 3px; padding: 2px 4px; background: rgba(79,195,247,0.08); border-radius: 3px; }
.ann-replies { margin-top: 4px; }
.ann-reply { padding: 2px 4px; border-top: 1px solid var(--border); margin-top: 2px; font-size: 11px; }
.ann-reply-author { font-weight: 600; color: var(--text-dim); }
.ann-reply-time { font-size: 10px; color: var(--text-dim); float: right; }
.ann-actions { display: flex; gap: 4px; margin-top: 4px; align-items: center; flex-wrap: wrap; }
.ann-reply-input { flex: 1; min-width: 60px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); font-size: 11px; outline: none; }
.ann-reply-input:focus { border-color: var(--accent); }

/* 文本高亮（剧本/故事中的批注标记） */
mark.ann-highlight { background: rgba(255, 202, 40, 0.25); border-bottom: 2px solid #ffca28; cursor: pointer; border-radius: 2px; padding: 0 1px; }
mark.ann-highlight:hover { background: rgba(255, 202, 40, 0.4); }
mark.ann-highlight.resolved { background: rgba(102, 187, 106, 0.2); border-bottom-color: #66bb6a; }
mark.ann-highlight.rejected { background: rgba(239, 83, 80, 0.15); border-bottom-color: #ef5350; }

/* ─── 消息卡片（消息面板） ─── */
.msg-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  transition: box-shadow 0.15s;
}
.msg-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.msg-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.msg-card-body {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* 右侧面板隐藏 */
#right-sidebar { display: none; }

/* ─── 在线用户卡片 ─── */
.online-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: background 0.12s;
}
.online-user-card:hover { background: var(--surface2); }
.online-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}
.online-user-info { flex: 1; min-width: 0; }
.online-user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.online-user-status { font-size: 11px; color: #22c55e; }
.online-user-msg-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
  flex-shrink: 0;
}
.online-user-msg-btn:hover { background: var(--accent); border-color: var(--accent); color: #000; }


