/* ========== 全局 ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--global-font, system-ui, sans-serif);
  background: var(--global-bg, #0f0f23);
  color: #e0e0e0;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar {
  width: 30px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* ========== 顶部导航 ========== */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #1a1a2e;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 200;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-logo {
  font-size: 24px;
}
.nav-title {
  font-size: 18px;
  font-weight: 600;
  color: #e0e0e0;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-user {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}
.nav-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 6px 14px;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* 汉堡菜单按钮 */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

/* ========== 主体容器 ========== */
.main-container {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  padding-left: 260px; /* 避开 fixed side-panel（width:260px） */
}

/* ========== 对话区 ========== */
.main-chat-area {
  position: relative;
  display: flex;
  justify-content: center;
  overflow: hidden;
  transition: margin-left 0.3s;
  flex: 1; /* 两栏时占满剩余空间 */
  min-width: 0;
}

/* 三栏模式：对话区固定宽度右对齐 */
.main-container.has-editor .main-chat-area {
  flex: none;
  width: 700px;
  margin-left: auto; /* 右对齐 */
}

/* ========== 文档编辑器 ========== */
.doc-editor {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  background: #1a1a2e;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.doc-editor.hidden {
  display: none !important;
}

.doc-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  min-height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

/* ========== 多标签栏 ========== */
.doc-editor-tabs {
  display: flex;
  align-items: stretch;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 0;
  height: 100%;
  scrollbar-width: thin;
}

.doc-editor-tab {
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  transition:
    background 0.15s,
    color 0.15s;
  position: relative;
  min-width: 0;
  flex-shrink: 1;
}

.doc-editor-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.7);
}

.doc-editor-tab.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.doc-editor-tab.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #2563eb;
}

.doc-editor-tab-title {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 6px;
}

.doc-editor-tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  font-size: 14px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.3);
  transition:
    background 0.15s,
    color 0.15s;
  flex-shrink: 0;
}

.doc-editor-tab-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
}

.doc-editor-tab-dirty {
  color: #f59e0b;
  margin-right: 4px;
  font-size: 12px;
}

.doc-editor-actions {
  flex-shrink: 0;
  margin-left: 12px;
}

.doc-editor-save {
  padding: 6px 16px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.doc-editor-save:hover {
  background: #1d4ed8;
}

.doc-editor-save:active {
  background: #1e40af;
}

.doc-editor-textarea {
  flex: 1;
  width: 100%;
  padding-top: 16px;
  padding-left: 16px;
  padding-right: 16px;
  padding-bottom: 16px;
  border: none;
  outline: none;
  resize: none;
  font-family: "Cascadia Code", "Fira Code", "Consolas", monospace;
  font-size: 14px;
  line-height: 1.7;
  color: #e0e0e0;
  background: transparent;
  tab-size: 2;
}

.doc-editor-textarea::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

/* 亮色主题 */
[data-theme="light"] .doc-editor {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .doc-editor-header {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .doc-editor-tab {
  color: rgba(0, 0, 0, 0.4);
  border-right-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .doc-editor-tab:hover {
  background: rgba(0, 0, 0, 0.03);
  color: rgba(0, 0, 0, 0.6);
}
[data-theme="light"] .doc-editor-tab.active {
  color: rgba(0, 0, 0, 0.85);
  background: rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .doc-editor-tab-close {
  color: rgba(0, 0, 0, 0.25);
}
[data-theme="light"] .doc-editor-tab-close:hover {
  background: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .doc-editor-textarea {
  color: rgba(0, 0, 0, 0.85);
  background: transparent;
}

[data-theme="light"] .doc-editor-textarea::placeholder {
  color: rgba(0, 0, 0, 0.2);
}

/* 移动端全屏 */
@media (max-width: 768px) {
  .doc-editor {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    border: none;
  }

  .main-container.has-editor .main-chat-area {
    display: none;
  }

  .doc-editor-header {
    height: 44px;
    min-height: 44px;
  }

  .doc-editor-textarea {
    font-size: 16px;
    padding: 12px;
  }
}

.chat-content {
  width: 100%;
  max-width: 50rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0 1rem;
}

/* 消息流 */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 4px;
  min-height: 0;
}

/* ========== 输入区 ========== */
.input-wrapper {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.input-box {
  padding: 8px 12px 12px;
  background: var(--global-bg, #0f0f23);
}
.input-main {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: #1e293b;
}
.input-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 8px;
}
.input-mode-btn {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.7);
  font-size: calc(12px * var(--font-scale, 1));
  padding: 4px 8px;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.input-mode-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.input-mode-btn.mode-weak {
  color: rgba(255, 255, 255, 0.3);
  border-style: dashed;
}
.tool-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: calc(14px * var(--font-scale, 1));
  cursor: pointer;
  padding: 2px 8px;
  white-space: nowrap;
}
.tool-btn.active {
  color: #ef4444;
}
/* "正文"切换按钮 + 搜索按钮右对齐 */
#btn-toggle-deleted {
  margin-left: auto;
}
.mode-select-wrapper {
  flex-shrink: 0;
}
.mode-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.5);
  font-size: calc(12px * var(--font-scale, 1));
  padding: 4px 6px;
  outline: none;
}

.input-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
  padding: 8px 8px 0 12px;
}
.input-row textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: calc(14px * var(--font-scale, 1));
  font-family: inherit;
  resize: none;
  min-height: 48px;
  max-height: 40vh;
  outline: none;
  line-height: 1.5;
  padding: 4px 0;
}
.input-row textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}
.input-box.warn .input-row textarea {
  color: #fca5a5;
}

#send-btn {
  background: transparent;
  border: none;
  color: #2563eb;
  font-size: 22px;
  cursor: pointer;
  padding: 0 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.input-main:hover #send-btn {
  color: #fff;
}
#send-btn:disabled {
  opacity: 0.4;
}

/* 消息 — 34px / 1fr / 34px 三列网格 */
.msg-wrapper {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: start;
  margin-bottom: 6px;
  max-width: 784px;
}
.msg-wrapper .msg {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}
.msg-avatar {
  width: 28px;
  height: 28px;
  max-width: 28px;
  max-height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  justify-self: center;
  margin-top: 2px;
  grid-row: 1;
  overflow: hidden;
  display: block;
  object-fit: cover;
}
.av-left {
  grid-column: 1;
}
.av-right {
  grid-column: 3;
}
.msg-avatar-text {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  cursor: default;
}
.msg-avatar-speaker {
  object-fit: contain !important;
  background: rgba(255, 255, 255, 0.12);
  padding: 2px;
  border-radius: 50%;
}

/* ========== 移动端遮罩层 ========== */
.mobile-panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
  display: none;
}
.mobile-panel-overlay.active {
  display: block;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .hamburger-btn {
    display: block;
  }

  .top-nav {
    padding-left: 50px;
  }

  .side-panel {
    transform: translateX(-100%);
  }
  .side-panel.mobile-open {
    transform: translateX(0);
  }
  .panel-header {
    display: block;
  }

  .main-chat-area {
    left: 0;
    right: 0;
  }

  .chat-content {
    padding: 0 8px;
  }

  .msg {
    max-width: 92%;
  }
  .welcome {
    padding: 40px 16px;
  }
  .welcome-avatar {
    font-size: 40px;
  }
  .welcome h2 {
    font-size: 20px;
  }
  .input-box {
    padding: 12px 12px;
  }
}

.diff-history-version {
  font-size: 14px;
  font-weight: 600;
  color: #60a5fa;
  min-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diff-history-date {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
}

.diff-history-trigger {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}
.diff-history-trigger.tag-explicit {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}
.diff-history-trigger.tag-restore {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
}
.diff-history-trigger.tag-close {
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
}

/* 亮色主题 */
[data-theme="light"] .diff-history-version {
  color: #2563eb;
}
[data-theme="light"] .diff-history-date {
  color: rgba(0, 0, 0, 0.4);
}
[data-theme="light"] .diff-history-trigger {
  background: rgba(0, 0, 0, 0.04);
  color: rgba(0, 0, 0, 0.5);
}

/* ========== 差异对比弹窗 — 行列布局 + 全文/差异双模式 ========== */
.diff-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.diff-modal {
  background: #1e293b;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  min-height: 0; /* 确保 flex 子元素能正确收缩 */
  display: flex;
  flex-direction: column;
}

.diff-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 15px;
  font-weight: 600;
  color: #e0e0e0;
}

.diff-modal-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.diff-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* 模式切换按钮 */
.diff-mode-toggle {
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  overflow: hidden;
}

.diff-mode-btn {
  padding: 4px 14px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.diff-mode-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.8);
}
.diff-mode-btn.active {
  background: rgba(96, 165, 250, 0.2);
  color: #60a5fa;
}

/* 左侧标题容器（恢复按钮已在标题内部） */
.diff-header-left {
  display: flex;
  align-items: center;
  gap: 0;
}

/* 导航按钮容器 — 位于 header 中间 */
.diff-header-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.diff-nav-buttons {
  display: flex;
  gap: 4px;
}

/* 通用导航按钮 */
.diff-nav-btn {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.diff-nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.diff-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* 历史按钮 — 稍突出 */
.diff-nav-history {
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.3);
}
.diff-nav-history:hover {
  background: rgba(96, 165, 250, 0.15);
}

/* 恢复按钮 — 在差异/全文切换前，绿色突出 */
.diff-restore-btn {
  margin-left: 12px;
  padding: 4px 14px;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: 4px;
  color: #6ee7b7;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-weight: 600;
}
.diff-restore-btn:hover {
  background: rgba(52, 211, 153, 0.22);
  color: #a7f3d0;
}

/* 恢复按钮与模式切换之间的分隔线 */
.diff-header-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

/* 返回按钮（历史视图 → 差异视图） */
.diff-nav-back {
  margin-right: 6px;
}

/* 历史版本列表（嵌入 diff modal body） */
.diff-history-list {
  padding: 12px 16px;
}

.diff-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.diff-history-item:hover {
  background: rgba(255, 255, 255, 0.04);
}
.diff-history-item-current {
  background: rgba(96, 165, 250, 0.08);
  border-left: 3px solid #60a5fa;
}

/* 弹窗主体 — 改为纵向滚动，容纳行列表 */
.diff-modal-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* 差异表格 — 行容器 */
.diff-table {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* 单行 — 左中右（左格 + 分隔线 + 右格） */
.diff-row {
  display: flex;
  width: 100%;
  min-height: 32px;
}
.diff-row-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #1e293b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* 每侧单元格 */
.diff-cell {
  flex: 1;
  padding: 6px 16px;
  font-size: 13px;
  line-height: 1.6;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word; /* 兜底：确保超长单词/URL 也能换行 */
  min-height: 32px;
  box-sizing: border-box;
}
.diff-cell-title {
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-height: auto;
}
.diff-cell-empty {
  color: rgba(255, 255, 255, 0.2);
  font-style: italic;
  justify-content: center;
  display: flex;
  align-items: center;
}
.diff-cell-same {
  color: rgba(255, 255, 255, 0.6);
}

/* 垂直分隔线 */
.diff-divider-col {
  width: 1px;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

/* 差异标记 +/- */
.diff-marker {
  display: inline-block;
  width: 20px;
  font-weight: 700;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.4);
}

/* 删除行 */
.diff-cell.diff-remove {
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
}

/* 新增行 */
.diff-cell.diff-add {
  background: rgba(52, 211, 153, 0.1);
  color: #6ee7b7;
}
.diff-history-source {
  font-size: 11px;
  color: rgba(96, 165, 250, 0.7);
  margin-left: 2px;
}

/* ========== 亮色主题差异弹窗 ========== */
[data-theme="light"] .diff-modal {
  background: #fff;
}
[data-theme="light"] .diff-modal-header {
  color: rgba(0, 0, 0, 0.85);
  border-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .diff-modal-close {
  color: rgba(0, 0, 0, 0.3);
}
[data-theme="light"] .diff-mode-toggle {
  border-color: rgba(0, 0, 0, 0.12);
}
[data-theme="light"] .diff-mode-btn {
  color: rgba(0, 0, 0, 0.4);
}
[data-theme="light"] .diff-mode-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  color: rgba(0, 0, 0, 0.7);
}
[data-theme="light"] .diff-mode-btn.active {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}
[data-theme="light"] .diff-row-header {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .diff-cell-title {
  color: rgba(0, 0, 0, 0.4);
}
[data-theme="light"] .diff-cell-empty {
  color: rgba(0, 0, 0, 0.25);
}
[data-theme="light"] .diff-cell-same {
  color: rgba(0, 0, 0, 0.55);
}
[data-theme="light"] .diff-divider-col {
  background: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .diff-cell.diff-remove {
  background: rgba(248, 113, 113, 0.06);
  color: #dc2626;
}
[data-theme="light"] .diff-cell.diff-add {
  background: rgba(52, 211, 153, 0.06);
  color: #16a34a;
}
[data-theme="light"] .diff-marker {
  color: rgba(0, 0, 0, 0.3);
}

/* 亮色主题 — 导航按钮 */
[data-theme="light"] .diff-nav-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.6);
}
[data-theme="light"] .diff-nav-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.85);
}
[data-theme="light"] .diff-nav-history {
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.3);
}

/* ===== 多风格输出浮层 ===== */
.ms-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 99999;
  display: flex; align-items: center; justify-content: center;
}
.ms-panel {
  background: var(--bg-card, #1e293b);
  border-radius: 12px; width: 560px; max-width: 90vw;
  max-height: 80vh; display: flex; flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.ms-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ms-title { font-size: 15px; font-weight: 600; color: var(--txt, #e2e8f0); }
.ms-close-btn {
  background: none; border: none; color: var(--txt-muted, #94a3b8);
  font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 4px;
}
.ms-close-btn:hover { background: rgba(255,255,255,0.08); }
.ms-body {
  padding: 16px 20px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
}
.ms-footer {
  padding: 12px 20px; border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
}
.ms-hint { font-size: 12px; color: var(--txt-muted, #94a3b8); }

/* 卡片 */
.ms-card {
  background: rgba(255,255,255,0.04); border-radius: 8px;
  padding: 12px 16px; cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  border: 1px solid transparent;
}
.ms-card:hover { background: rgba(255,255,255,0.08); transform: translateY(-1px); }
.ms-card:active { transform: translateY(0); }
.ms-card-raw { border-color: rgba(59,130,246,0.3); }
.ms-card-loading { opacity: 0.6; cursor: default; }
.ms-card-loading:hover { background: rgba(255,255,255,0.04); transform: none; }
.ms-card-label {
  font-size: 12px; font-weight: 600; color: var(--accent, #3b82f6);
  display: block; margin-bottom: 6px;
}
.ms-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 8px;
}
.ms-action-btn {
  background: none; border: none; cursor: pointer;
  font-size: 14px; padding: 2px 6px;
  color: rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  -webkit-tap-highlight-color: transparent;
}
.ms-action-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.ms-action-rocket.rocket-active {
  color: #ff9f43;
  background: rgba(255, 159, 67, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 159, 67, 0.5);
}
.ms-card-textarea {
  width: 100%;
  min-height: 60px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--accent, #3b82f6);
  border-radius: 6px;
  color: var(--txt, #e2e8f0);
  font-size: 14px;
  line-height: 1.6;
  padding: 8px;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}
.ms-edit-text,
.ms-edit-instruction {
  width: 100%;
  min-height: 80px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--txt, #e2e8f0);
  font-size: 14px;
  line-height: 1.6;
  padding: 8px;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
  margin-bottom: 8px;
}
.ms-edit-instruction {
  min-height: 50px;
}
.ms-edit-submit,
.ms-edit-execute {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  color: var(--accent, #3b82f6);
  padding: 6px 12px;
  cursor: pointer;
  margin-bottom: 8px;
}
.ms-edit-text.ms-edit-loading {
  opacity: 0.6;
}
.ms-card-text {
  font-size: 14px; line-height: 1.6; color: var(--txt, #e2e8f0);
  word-break: break-word;
}
.ms-card-skeleton {
  color: var(--txt-muted, #64748b);
  animation: ms-pulse 1.5s ease-in-out infinite;
}
@keyframes ms-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}
/* 亮色主题 — 恢复按钮 */
[data-theme="light"] .diff-restore-btn {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.2);
  color: #16a34a;
}
[data-theme="light"] .diff-restore-btn:hover {
  background: rgba(22, 163, 74, 0.15);
  color: #15803d;
}
[data-theme="light"] .diff-header-divider {
  background: rgba(0, 0, 0, 0.1);
}

/* 亮色主题 — 历史列表 */
[data-theme="light"] .diff-history-item:hover {
  background: rgba(0, 0, 0, 0.03);
}
[data-theme="light"] .diff-history-item-current {
  background: rgba(37, 99, 235, 0.06);
  border-left-color: #2563eb;
}

/* ========== 右窗口：单标签主文档（辅助模式专用，默认隐藏） ========== */
/* 配色与多标签 .doc-editor 对齐（深色默认 + 亮色适配） */
.doc-editor-primary {
  display: none;
  flex-direction: column;
  height: 100%;
  background: #1a1a2e;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

/* 辅助模式下才显示右窗口（防止CSS加载失败时两个编辑器重叠） */
.main-container.assist-mode .doc-editor-primary {
  display: flex;
}

/* 辅助-单窗口：右窗口占满编辑器区 */
.main-container.assist-single .doc-editor-primary {
  flex: 1;
}

/* 辅助-双窗口：右窗口占50% */
.main-container.assist-dual .doc-editor-primary {
  flex: 1;
  width: 50%;
}

/* 右窗口header（对齐 .doc-editor-header） */
.doc-editor-primary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  height: 48px;
  flex-shrink: 0;
}

.primary-doc-title {
  font-weight: 500;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-doc-actions {
  display: flex;
  gap: 8px;
}

/* 单标签按钮已复用 .doc-editor-btn/.doc-editor-save（与多标签 UI/文本完全一致），
   原图标式按钮定制样式仅保留给旧 btn-* class，避免覆盖多标签同款样式 */
.primary-doc-actions .btn-save-primary,
.primary-doc-actions .btn-versions-primary,
.primary-doc-actions .btn-explicit-primary,
.primary-doc-actions .btn-mode-switch,
.primary-doc-actions .btn-close-primary {
  color: rgba(255, 255, 255, 0.7);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
}

.primary-doc-actions .btn-save-primary:hover,
.primary-doc-actions .btn-versions-primary:hover,
.primary-doc-actions .btn-explicit-primary:hover,
.primary-doc-actions .btn-mode-switch:hover,
.primary-doc-actions .btn-close-primary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* 右窗口textarea（对齐 .doc-editor-textarea） */
.doc-editor-primary-textarea {
  flex: 1;
  width: 100%;
  border: none;
  outline: none;
  padding: 16px;
  font-size: 15px;
  line-height: 1.6;
  color: #e0e0e0;
  background: transparent;
  resize: none;
  overflow-y: auto;
}

.doc-editor-primary-textarea::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

/* ========== 亮色主题：对齐 [data-theme="light"] .doc-editor ========== */
[data-theme="light"] .doc-editor-primary {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .doc-editor-primary-header {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .primary-doc-title {
  color: rgba(0, 0, 0, 0.85);
}

[data-theme="light"] .primary-doc-actions .btn-save-primary,
[data-theme="light"] .primary-doc-actions .btn-versions-primary,
[data-theme="light"] .primary-doc-actions .btn-explicit-primary,
[data-theme="light"] .primary-doc-actions .btn-mode-switch,
[data-theme="light"] .primary-doc-actions .btn-close-primary {
  color: rgba(0, 0, 0, 0.6);
  border-color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .primary-doc-actions .btn-save-primary:hover,
[data-theme="light"] .primary-doc-actions .btn-versions-primary:hover,
[data-theme="light"] .primary-doc-actions .btn-explicit-primary:hover,
[data-theme="light"] .primary-doc-actions .btn-mode-switch:hover,
[data-theme="light"] .primary-doc-actions .btn-close-primary:hover {
  background: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.85);
}

[data-theme="light"] .doc-editor-primary-textarea {
  color: rgba(0, 0, 0, 0.85);
}

[data-theme="light"] .doc-editor-primary-textarea::placeholder {
  color: rgba(0, 0, 0, 0.2);
}

/* ========== 辅助模式布局（Phase 2：三态切换） ========== */

/* 辅助模式下，隐藏多标签编辑器（左窗口） */
.main-container.assist-mode .doc-editor {
  display: none !important;
}

/* [PLAN-EDITMODE-20260809-001] 辅助模式下隐藏多标签窗口的模式切换按钮，统一由单标签 btn-mode-switch 管理 */
.main-container.assist-mode #doc-editor-btn-mode {
  display: none;
}

/* [PLAN-EDITMODE-20260809-001] 会话恢复期间隐藏页面，防止UI闪烁（页面无 #app 容器，直接隐藏 body） */
body.session-restoring {
  visibility: hidden;
}

/* 辅助-双窗口：左窗口重新显示，与右窗口各占50% */
.main-container.assist-dual .doc-editor {
  display: flex !important;
  flex: 1;
  width: 50%;
}

/* ========== [P0-1] 左窗槽位：副文档 ⇄ 章节（显隐/取替 · 键 CHAP-PACT-S6） ========== */
/* 章节态：仅隐藏**副文档自身**的标签行与正文 textarea（容器不销毁 ⇒ 副标签不丢，禁走 closeSecondaryWindow）
 * [P1-E] 用**直接子选择器**限定 ⇒ 章节面板内**复用同款** `.doc-editor-header` 的标题行不被误隐藏 */
.main-container.assist-dual.chapter-slot .doc-editor > .doc-editor-header,
.main-container.assist-dual.chapter-slot .doc-editor > #doc-editor-textarea {
  display: none !important;
}
/* 章节面板容器：默认隐藏；章节态显示并占满左窗 */
.chapter-pane {
  flex: 1;
  min-width: 0;
  min-height: 0;
  /* [S7 追加④] 标题行固定：面板自身不滚动（`hidden`），滚动交给内容区 ⇒ 与副文档一致（正文滚动时标题行不动） */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* [S7 追加③] 取消内边距：原 `8px 10px` 使标题行内缩（下移 8／右移 10）⇒ 与副文档标题行错位、切换跳动 */
  padding: 0;
  box-sizing: border-box;
}
/* [S7 追加③] 内边距下移到内容区（标题行保持与副文档齐平） */
.chapter-pane > .doc-editor-header { flex: 0 0 auto; }
.cp-tools { display: flex; align-items: center; padding: 8px 10px 0; flex: 0 0 auto; }
.chapter-pane > .cp-tree { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 6px 10px; }
.chapter-pane > .cp-foot { flex: 0 0 auto; padding: 8px 10px; }
.chapter-pane > .chapter-pane-hint { flex: 0 0 auto; padding: 12px 10px; }
.chapter-pane.hidden {
  display: none !important;
}
.main-container.assist-dual.chapter-slot #chapter-pane {
  /* [S7 追加④] 列向 flex（原为 block）：标题行固定、仅 `.cp-tree` 滚动 ⇒ 正文滚动时标题行不动（同副文档） */
  display: flex !important;
  flex-direction: column;
}
.chapter-pane-hint {
  opacity: 0.6;
  font-size: 13px;
  padding: 12px 4px;
}
/* ===== [P0-3] 只读章节树 ===== */
.cp-head {
  font-size: 12px;
  opacity: 0.75;
  padding: 2px 2px 6px;
}
.cp-count { font-weight: 600; }
.cp-tree, .cp-children { list-style: none; margin: 0; padding-left: 0; }
.cp-children { padding-left: 14px; }
.cp-node { margin: 2px 0; }
.cp-row { display: flex; align-items: baseline; gap: 4px; }
.cp-seq { flex: none; font-size: 12px; opacity: 0.7; min-width: 26px; }
.cp-title { font-size: 13px; line-height: 1.5; }
.cp-node.l3 > .cp-row .cp-title { font-weight: 600; }
.cp-sum {
  font-size: 12px;
  opacity: 0.65;
  line-height: 1.5;
  padding-left: 30px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.cp-foot { font-size: 11px; opacity: 0.5; padding: 8px 2px 2px; }
/* ===== [P1-B] 折叠（M3）===== */
.cp-caret { flex: none; width: 12px; cursor: pointer; opacity: 0.8; user-select: none; font-size: 11px; }
.cp-collapsed > .cp-children { display: none; }
.cp-depth { margin-left: 6px; font-size: 11px; background: transparent; color: inherit; border: 1px solid rgba(128, 128, 128, 0.35); border-radius: 4px; padding: 1px 2px; }
/* 槽位分段开关（右窗工具行 · 同位复用 #btn-chapter-toggle） */
.slot-switch {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid rgba(128, 128, 128, 0.35);
  border-radius: 6px;
  overflow: hidden;
  margin-right: 4px;
}
.slot-seg {
  background: transparent;
  border: 0;
  padding: 3px 10px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  color: inherit;
  line-height: 1.6;
}
.slot-seg + .slot-seg {
  border-left: 1px solid rgba(128, 128, 128, 0.35);
}
.slot-seg.is-active {
  background: rgba(128, 128, 128, 0.18);
  font-weight: 600;
}
.slot-seg:disabled {
  opacity: 0.45;
  cursor: default;
}

/* ===== [P1-D 改版①] 无副标签时：左窗整体 开/关 ===== */
.main-container.assist-dual.left-pane-off .doc-editor {
  display: none !important;
}

/* 辅助模式下，对话区保持 700px（不受 .has-editor 影响） */
.main-container.assist-single .main-chat-area,
.main-container.assist-dual .main-chat-area {
  width: 700px;
  flex: none;
}

/* 辅助-双：左边栏展开时覆盖在左窗口上层（不挤压双窗口，side-panel fixed z-index:50 覆盖） */
.main-container.assist-dual {
  padding-left: 0 !important;
}

/* ========== 引用可视化 overlay（重构-v2-20260809，pre 全文镜像 + mark 底色/划线 + 编号坐标法） ==========
 * [会审裁决] 编号改回坐标法（pre 只做底色+划线）；overflow-wrap 由 JS 运行时同步 textarea 实际值 */
.doc-editor-primary {
  position: relative; /* overlay 定位锚 */
}
#doc-editor-primary-textarea {
  position: relative;
  z-index: 2; /* 高于 pre(z1)，低于编号层(z3) */
  background: transparent; /* 必须透明，透出 pre mark 底色 */
}
/* pre 全文镜像（z1，textarea 之下，透明背景透出 mark 底色/划线）；几何/字体/overflow-wrap 由 JS 运行时同步 */
.quote-overlay-pre {
  position: absolute;
  z-index: 1;
  margin: 0;
  box-sizing: content-box; /* 强制 content-box，对抗全局 border-box */
  white-space: pre-wrap;
  color: transparent; /* 文字隐藏，仅 mark 底色/划线透出 */
  pointer-events: none;
  overflow: hidden;
}
/* 引用段 mark：底色 + 划线（CSS 排版引擎自动处理 word-wrap，长引用完整覆盖每一行） */
.quote-segment {
  background: rgba(37, 99, 235, 0.25); /* 底色 */
  text-decoration: underline; /* 划线 */
  text-decoration-color: rgba(37, 99, 235, 0.6);
  text-underline-offset: 2px;
  border-radius: 2px;
}
.quote-segment.locked {
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.6); /* 当前"已锁定"段落亮边 */
}
/* [S6] 段落级整行高亮矩形层（z1，文本之下；方案D 替代 pre 镜像 mark 逐行贴合；随滚动/宽度/字体自适应） */
.anchor-highlight-layer {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
.anchor-highlight {
  position: absolute;
  left: 0;
  width: 100%;
  background: rgba(37, 99, 235, 0.18); /* 半透明整行高亮 */
  box-shadow: inset 0 -2px 0 rgba(37, 99, 235, 0.7); /* 段尾行内底线（不穿过文本，总参5） */
  border-radius: 2px;
}
[data-theme="light"] .anchor-highlight {
  background: rgba(37, 99, 235, 0.15);
  box-shadow: inset 0 -2px 0 rgba(37, 99, 235, 0.6);
}
/* ===== [S1 V1-1 2026-09-30] 章节层三条 z 层（底板/内容/编号）=====
 * 口径：**零文本读写** —— 章节块永不进入 textarea；显隐＝display；点击＝移动光标。
 * z 序（对齐 S1 §1.1）：.chapter-layer z0.5 ｜ .chapter-content-layer z2.5 ｜ .chapter-badge-layer z3
 * 注意：**不改**既有 quote 层样式（.quote-overlay-pre / .anchor-highlight-layer / .quote-badge-layer） */
.chapter-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0.5;
  pointer-events: none; /* 底板不吃事件；仅块可点 */
  overflow: hidden;
}
.chapter-content-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2.5;
  pointer-events: none; /* 默认不吃事件（V1-1：块级下钻到 .chapter-block 才可点） */
}
.chapter-badge-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  pointer-events: none;
}
.chapter-block {
  position: absolute;
  left: 0;
  right: 0;
  margin: 0;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.35;
  pointer-events: auto; /* 块可点（跳转） */
  cursor: pointer;
  box-sizing: border-box;
}
.chapter-block.l2 {
  color: rgba(255, 255, 255, 0.72);
  border: 1px dashed rgba(255, 255, 255, 0.25); /* L2＝内部机制：浅色虚线 */
}
.chapter-block.l3 {
  color: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(120, 190, 255, 0.55); /* L3＝真章节：实色 */
  background: rgba(120, 190, 255, 0.08);
}
.chapter-block.full-range {
  border-style: double; /* 全文区间组（归并层）可视标记 */
}
.chapter-block .chapter-badge {
  display: inline-block;
  margin-right: 4px;
  color: #9fd0ff;
  font-weight: 600;
}
.chapter-block .chapter-title {
  display: inline-block;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 92%;
}
.chapter-block .chapter-summary {
  margin-top: 1px;
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 编号层（z3，文字之上，坐标法定位；独立于 pre，不破坏像素级同构） */
.quote-badge-layer {
  position: absolute;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
  white-space: nowrap;         /* [总裁-20260829] 父级强制不换行：尾部编号右移以页边为限不得换行 */
}
.badge-start,
.badge-end {
  position: absolute;
  font-family: "Cascadia Code", "Fira Code", "Consolas", monospace;
  font-size: 22px; /* [总裁-20260829] 编号放大一倍（原 11px） */
  line-height: 1;
  padding: 0 1px;              /* [总裁-20260829] 去掉编号底框后仅留微间距 */
  background: transparent;     /* [总裁-20260829] 去掉编号底框，纯文本 */
  color: #facc15;              /* [总裁-20260829] 编号字符黄色（暗色主题） */
  font-weight: bold;
  white-space: nowrap;         /* 不换行（总裁：右移以侧边为界不换行） */
  user-select: none;
}
.badge-start {
  transform: translateX(-100%); /* 开头编号：右缘贴选区起点字符，向左展开 */
}
.badge-end {
  transform: translateX(0); /* 末尾编号：右缘贴选区末尾字符，向右展开 */
}
/* 亮色主题 */
[data-theme="light"] .quote-segment {
  background: rgba(37, 99, 235, 0.16);
}
[data-theme="light"] .quote-segment.locked {
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.5);
}
[data-theme="light"] .badge-start,
[data-theme="light"] .badge-end {
  background: transparent; /* [总裁-20260829] 去掉编号底框（亮色主题） */
  color: #eab308; /* [总裁-20260829] 编号字符黄色（亮色主题） */
}

/* [INV-20260815 ENG-DOCOP-STATE] doc_op 执行回执 */
.doc-op-receipt {
  margin: 4px 12px 6px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.08);
  border-left: 3px solid #2563eb;
  font-size: 13px;
  color: #4b5563;
}
.doc-op-receipt-body {
  line-height: 1.5;
}

/* [ENG-DOCOP-STATE-S4] doc_op 状态卡片（独立状态消息） */
.doc-op-status {
  grid-column: 2; /* 对齐 .msg 气泡列（1fr），避免落入 34px 窄列导致文字竖排 */
  margin: 4px 12px 6px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: #4b5563;
  background: rgba(0, 0, 0, 0.02);
  border-left: 3px solid #9ca3af;
}
.doc-op-status-body {
  line-height: 1.5;
  white-space: pre-wrap; /* [DIR-FIX-20260816] 多行候选列表/双路径报告换行渲染 */
  word-break: break-all;
}
.doc-op-status-resolved {
  opacity: 0.55;
}
.doc-op-status-sync-warn {
  margin-left: 6px;
  color: #b45309;
}
/* S1 / S1_RETRY / S1_REPLACE 黄（进行中） */
.doc-op-status-S1,
.doc-op-status-S1_RETRY,
.doc-op-status-S1_REPLACE {
  border-left-color: #d97706;
  background: rgba(217, 119, 6, 0.08);
}
/* S2 / 只读 / S2_REPLACE 绿（成功） */
.doc-op-status-S2,
.doc-op-status-S2_READ,
.doc-op-status-S2_LIST,
.doc-op-status-S2_SEARCH,
.doc-op-status-S2_REPLACE {
  border-left-color: #16a34a;
  background: rgba(22, 163, 74, 0.08);
}
/* S3 / S3_AMBIGUOUS / S3_REPLACE 红（失败/歧义） */
.doc-op-status-S3,
.doc-op-status-S3_AMBIGUOUS,
.doc-op-status-S3_REPLACE {
  border-left-color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}
/* S4 青（自动创建） */
.doc-op-status-S4 {
  border-left-color: #0891b2;
  background: rgba(8, 145, 178, 0.08);
}
/* S7 橙（超时） */
.doc-op-status-S7 {
  border-left-color: #ea580c;
  background: rgba(234, 88, 12, 0.08);
}
/* [批量多动作增强 P1 2026-08-30] doc_op 执行状态浮动条（非持久化浮动 UI，不写对话历史） */
.doc-op-poll-bar {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 99998;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  max-width: 60vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
