/* ========== 全局 ========== */
*,
*::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;
}
.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-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;
}
