:root {
  --sidebar-width: 232px;
  --trace-width: 420px;
  --trace-wide-width: min(680px, 48vw);
  --bg: #f4f7fb;
  --panel: #ffffff;
  --line: #dfe5ee;
  --text: #1d2736;
  --muted: #6e7b8f;
  --primary: #5b5bd6;
  --primary-dark: #4747b8;
  --excel-green: #217346;
  --excel-grid: #d8dde6;
  --excel-header: #f3f5f8;
  --trace-bg: #111827;
  --trace-text: #d6deeb;
  --shadow: 0 10px 30px rgba(28, 39, 60, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family:
    Inter,
    "PingFang SC",
    "Microsoft YaHei",
    Arial,
    sans-serif;
  color: var(--text);
  background: var(--bg);
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns:
    var(--sidebar-width)
    minmax(0, 1fr)
    var(--trace-width);
  width: 100vw;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  transition: grid-template-columns 0.25s ease;
}

.app-shell.trace-wide {
  grid-template-columns:
    var(--sidebar-width)
    minmax(0, 1fr)
    var(--trace-wide-width);
}

.app-shell.trace-hidden {
  grid-template-columns:
    var(--sidebar-width)
    minmax(0, 1fr)
    0;
}

.sidebar {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  color: #fff;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.15), transparent 32%),
    linear-gradient(180deg, #4a46bd, #312e81);
  border-right: 1px solid rgba(255,255,255,0.12);
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 4px 24px;
}

.brand-logo {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  height: 42px;
  border-radius: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #4a46bd;
  background: #fff;
  box-shadow: 0 8px 18px rgba(0,0,0,0.15);
}

.brand h1 {
  margin: 0;
  font-size: 17px;
  white-space: nowrap;
}

.brand p {
  margin: 4px 0 0;
  font-size: 12px;
  opacity: 0.74;
  white-space: nowrap;
}

.sidebar-nav {
  margin-top: 8px;
}

.sidebar-action {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 42px;
  margin-bottom: 8px;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 10px;
  color: #fff;
  background: rgba(255,255,255,0.08);
  transition: 0.18s ease;
}

.sidebar-action:hover {
  background: rgba(255,255,255,0.15);
}

.sidebar-action.primary {
  border-color: rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.16);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 14px 5px 4px;
  font-size: 12px;
  opacity: 0.82;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #54e39e;
  box-shadow: 0 0 0 4px rgba(84,227,158,0.12);
}

.main-panel {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--bg);
}

.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 78px;
  padding: 15px 24px;
  background: rgba(255,255,255,0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.main-header h2 {
  margin: 0;
  font-size: 20px;
}

.main-header p {
  margin: 5px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.ghost-button {
  flex: 0 0 auto;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: #fff;
}

.ghost-button:hover {
  background: #f6f7fb;
}

.messages {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 24px clamp(18px, 4vw, 48px) 30px;
  -webkit-overflow-scrolling: touch;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto 22px;
}

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

.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  height: 38px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
}

.assistant-avatar {
  color: #fff;
  background: linear-gradient(135deg, #5b5bd6, #7676e8);
}

.user-avatar {
  color: #fff;
  background: #334155;
}

.message-body {
  min-width: 0;
  max-width: calc(100% - 50px);
}

.message.user-message .message-body {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.message-title {
  margin: 0 0 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.message-content {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  line-height: 1.65;
  background: #fff;
  box-shadow: 0 4px 16px rgba(28,39,60,0.04);
}

.user-message .message-content {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #5b5bd6, #4f46c7);
}

.assistant-result-content {
  width: min(1120px, calc(100vw - var(--sidebar-width) - var(--trace-width) - 100px));
  max-width: 100%;
}

.answer-block {
  margin-bottom: 16px;
}

.result-section-title {
  margin: 2px 0 9px;
  font-size: 14px;
  font-weight: 800;
}

.query-table-title {
  margin-top: 14px;
}

.status-card,
.error-card,
.empty-result-card {
  margin-bottom: 12px;
  padding: 11px 13px;
  border-radius: 9px;
}

.status-card {
  background: #fff7e6;
  border: 1px solid #fed7aa;
}

.error-card {
  color: #991b1b;
  background: #fff1f2;
  border: 1px solid #fecdd3;
}

.empty-result-card {
  color: #6b7280;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
}

.sql-details {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.sql-details summary {
  padding: 10px 13px;
  cursor: pointer;
  font-weight: 700;
  background: #f8fafc;
}

.sql-details pre {
  margin: 0;
  padding: 14px;
  overflow: auto;
  color: #d6deeb;
  background: #111827;
  white-space: pre-wrap;
}

.composer-wrap {
  padding: 12px clamp(18px, 4vw, 48px) 18px;
  background: linear-gradient(to top, rgba(244,247,251,1) 75%, rgba(244,247,251,0));
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px;
  border: 1px solid #cfd7e4;
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--shadow);
}

.composer textarea {
  flex: 1;
  min-height: 42px;
  max-height: 160px;
  padding: 9px 10px;
  border: 0;
  outline: none;
  resize: none;
  line-height: 1.5;
  color: var(--text);
  background: transparent;
}

.send-button {
  min-width: 88px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  font-weight: 700;
  background: var(--primary);
}

.send-button:hover:not(:disabled) {
  background: var(--primary-dark);
}

.send-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.composer-hint {
  max-width: 1180px;
  margin: 7px auto 0;
  text-align: center;
  font-size: 11px;
  color: #8a96a8;
}

.trace-panel {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  color: var(--trace-text);
  background: var(--trace-bg);
  border-left: 1px solid #273348;
  transition:
    opacity 0.2s ease,
    transform 0.25s ease;
}

.trace-hidden .trace-panel {
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%);
}

.trace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 66px;
  padding: 11px 12px 11px 15px;
  border-bottom: 1px solid #28344a;
  background: #172033;
}

.trace-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.trace-title-wrap h3 {
  margin: 0;
  font-size: 14px;
  color: #f2f5fb;
  white-space: nowrap;
}

.trace-title-wrap p {
  margin: 3px 0 0;
  font-size: 11px;
  color: #8ea0bc;
  white-space: nowrap;
}

.trace-live-dot {
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #47d18c;
  box-shadow: 0 0 0 5px rgba(71,209,140,0.1);
}

.trace-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.trace-actions button {
  padding: 5px 7px;
  border: 1px solid #36445d;
  border-radius: 6px;
  color: #cad5e7;
  font-size: 11px;
  background: #202b40;
}

.trace-actions button:hover {
  color: #fff;
  background: #2b3952;
}

.trace-output {
  min-width: 0;
  min-height: 0;
  height: 100%;
  margin: 0;
  padding: 15px;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  font-family:
    "JetBrains Mono",
    Consolas,
    "Microsoft YaHei",
    monospace;
  font-size: 12px;
  line-height: 1.7;
  tab-size: 2;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 100% 27px;
}

.trace-panel.trace-collapsed {
  grid-template-rows: auto 0;
}

.trace-panel.trace-collapsed .trace-output {
  padding: 0;
  overflow: hidden;
}

/* Excel 工作表 */
.excel-workbook {
  width: 100%;
  min-width: 0;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid #bcc5d1;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(28,39,60,0.08);
}

.excel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 54px;
  padding: 8px 11px;
  color: #fff;
  background: var(--excel-green);
}

.excel-file-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.excel-file-title strong,
.excel-file-title small {
  display: block;
}

.excel-file-title strong {
  font-size: 13px;
}

.excel-file-title small {
  margin-top: 2px;
  color: rgba(255,255,255,0.8);
  font-size: 10px;
}

.excel-icon {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  height: 30px;
  border-radius: 5px;
  color: var(--excel-green);
  font-weight: 900;
  background: #fff;
}

.excel-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.excel-toolbar-actions button {
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 5px;
  color: #fff;
  font-size: 11px;
  background: rgba(255,255,255,0.11);
}

.excel-toolbar-actions button:hover {
  background: rgba(255,255,255,0.2);
}

.excel-formula-bar {
  display: grid;
  grid-template-columns: 64px 36px minmax(0, 1fr);
  min-height: 34px;
  border-bottom: 1px solid var(--excel-grid);
  background: #fff;
}

.cell-address,
.fx-label,
.cell-formula {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 9px;
  border-right: 1px solid var(--excel-grid);
  font-size: 12px;
}

.cell-address {
  justify-content: center;
  font-weight: 700;
  background: #f6f7f9;
}

.fx-label {
  justify-content: center;
  font-style: italic;
  color: #667085;
}

.cell-formula {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.excel-scroll-area {
  width: 100%;
  min-width: 0;
  min-height: 180px;
  max-height: min(520px, 58vh);
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.excel-grid {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 12px;
  color: #1f2937;
}

.excel-grid th,
.excel-grid td {
  min-width: 132px;
  max-width: 340px;
  height: 31px;
  padding: 5px 8px;
  border-right: 1px solid var(--excel-grid);
  border-bottom: 1px solid var(--excel-grid);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #fff;
}

.excel-grid thead tr:first-child th {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 25px;
  text-align: center;
  font-weight: 600;
  color: #576274;
  background: #eef1f5;
}

.excel-grid thead tr:nth-child(2) th {
  position: sticky;
  top: 25px;
  z-index: 4;
  font-weight: 700;
  background: #f8fafc;
}

.excel-grid .excel-row-number,
.excel-grid .excel-corner {
  position: sticky;
  left: 0;
  z-index: 6;
  min-width: 48px;
  width: 48px;
  max-width: 48px;
  text-align: center;
  color: #657184;
  background: #eef1f5;
}

.excel-grid thead .excel-row-number,
.excel-grid thead .excel-corner {
  z-index: 8;
}

.excel-grid td:hover,
.excel-grid th.excel-cell:hover {
  background: #f3f8f5;
}

.excel-grid .excel-cell {
  outline: none;
}

.excel-grid .excel-cell.selected {
  /* 不修改 position，避免覆盖表头的 position: sticky，
     也避免表格在选中时发生重新定位。 */
  background: #ecf8f1;
  outline: 2px solid var(--excel-green);
  outline-offset: -2px;
  box-shadow: none;
}

.excel-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 34px;
  padding: 0 11px;
  border-top: 1px solid var(--excel-grid);
  background: #f6f7f9;
  font-size: 11px;
  color: #596579;
}

.sheet-tab {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 3px solid transparent;
}

.sheet-tab.active {
  color: var(--excel-green);
  font-weight: 700;
  border-bottom-color: var(--excel-green);
  background: #fff;
}

.excel-workbook:fullscreen {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  border-radius: 0;
}

.excel-workbook:fullscreen .excel-scroll-area,
.excel-workbook.excel-maximized .excel-scroll-area {
  max-height: none;
}

.excel-workbook.excel-maximized {
  position: fixed;
  inset: 18px;
  z-index: 999;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  box-shadow: 0 0 0 9999px rgba(15,23,42,0.62);
}

.candidate-intro {
  margin-bottom: 12px;
}

.candidate-list {
  display: grid;
  gap: 9px;
}

.candidate-card {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px;
  text-align: left;
  border: 1px solid #d8deea;
  border-radius: 10px;
  color: var(--text);
  background: #fafbfe;
}

.candidate-card:hover {
  border-color: var(--primary);
  background: #f3f2ff;
}

.candidate-card strong {
  font-size: 14px;
}

.candidate-card span {
  font-size: 12px;
  color: var(--muted);
}

.clarification-card {
  display: grid;
  gap: 10px;
}

.clarification-question {
  font-weight: 700;
}

.clarification-card textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid #ccd4e1;
  border-radius: 8px;
  resize: vertical;
}

.clarification-card button {
  justify-self: start;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 2000;
  padding: 10px 16px;
  border-radius: 9px;
  color: #fff;
  background: rgba(17,24,39,0.92);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1200px) {
  :root {
    --sidebar-width: 204px;
    --trace-width: 360px;
  }

  .assistant-result-content {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .app-shell,
  .app-shell.trace-wide,
  .app-shell.trace-hidden {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .sidebar {
    padding: 16px 10px;
  }

  .brand {
    justify-content: center;
  }

  .brand > div:last-child,
  .sidebar-action .trace-toggle-text,
  .sidebar-action:not(.primary) span:first-child + span,
  .sidebar-footer span {
    display: none;
  }

  .sidebar-action {
    justify-content: center;
    padding: 0;
  }

  .trace-panel {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 100;
    width: min(92vw, 620px);
    height: 100vh;
    box-shadow: -12px 0 30px rgba(15,23,42,0.28);
  }

  .trace-hidden .trace-panel {
    transform: translateX(105%);
  }

  .assistant-result-content {
    width: 100%;
  }
}


/* 可滚动区域滚动条 */
.messages,
.trace-output,
.excel-scroll-area,
.sql-details pre {
  scrollbar-width: thin;
  scrollbar-color: #aab4c3 transparent;
}

.messages::-webkit-scrollbar,
.trace-output::-webkit-scrollbar,
.excel-scroll-area::-webkit-scrollbar,
.sql-details pre::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.messages::-webkit-scrollbar-thumb,
.trace-output::-webkit-scrollbar-thumb,
.excel-scroll-area::-webkit-scrollbar-thumb,
.sql-details pre::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #aab4c3;
  background-clip: padding-box;
}

.messages::-webkit-scrollbar-thumb:hover,
.trace-output::-webkit-scrollbar-thumb:hover,
.excel-scroll-area::-webkit-scrollbar-thumb:hover,
.sql-details pre::-webkit-scrollbar-thumb:hover {
  background: #8793a5;
  background-clip: padding-box;
}

.trace-output::-webkit-scrollbar-thumb {
  background: #53627a;
  background-clip: padding-box;
}

.trace-output::-webkit-scrollbar-thumb:hover {
  background: #6b7c98;
  background-clip: padding-box;
}


.excel-grid .excel-cell:focus,
.excel-grid .excel-cell:focus-visible {
  outline: 2px solid var(--excel-green);
  outline-offset: -2px;
}


/* 退出全屏后的确定性还原：避免备用全屏类或旧内联尺寸残留。 */
.excel-workbook:not(:fullscreen):not(.excel-maximized) {
  position: static;
  inset: auto;
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  max-height: none;
}

.excel-workbook:not(:fullscreen):not(.excel-maximized) .excel-scroll-area {
  height: auto;
  max-height: min(520px, 58vh);
}


/* 项目候选确认 */
.candidate-groups { display: grid; gap: 18px; }
.candidate-group { display: grid; gap: 9px; }
.candidate-group-title { font-size: 13px; font-weight: 800; color: var(--text); }
.candidate-card.selected { border-color: var(--primary); background: #ecebff; box-shadow: 0 0 0 2px rgba(91, 91, 214, 0.12); }
.candidate-confirm-button { margin-top: 14px; padding: 9px 16px; border: 0; border-radius: 9px; color: #fff; font-weight: 700; background: var(--primary); }
.candidate-confirm-button:hover:not(:disabled) { background: var(--primary-dark); }
.candidate-confirm-button:disabled { cursor: not-allowed; opacity: 0.5; }

/* =========================
   历史对话
   ========================= */
.sidebar-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.chat-history-section {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 12px;
}

.chat-history-title {
  flex: 0 0 auto;
  padding: 10px 8px 8px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 600;
}

.chat-history-list {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.chat-history-item {
  display: block;
  width: 100%;
  min-height: 36px;
  margin: 0 0 5px;
  padding: 8px 10px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: transparent;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.chat-history-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.chat-history-item.active {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.16);
}

.chat-history-empty {
  padding: 10px 8px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 11px;
}

.chat-history-list::-webkit-scrollbar {
  width: 5px;
}

.chat-history-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.chat-history-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.34);
}

@media (max-width: 900px) {
  .chat-history-title {
    display: none;
  }

  .chat-history-item {
    padding: 8px 5px;
    text-align: center;
  }
}



/* =========================
   历史对话删除按钮
   ========================= */

.chat-history-item-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.chat-history-item-wrapper .chat-history-item {
  padding-right: 32px;
}

.chat-history-delete {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  color: rgba(255,255,255,0.45);
  font-size: 16px;
  line-height: 1;
  opacity: 0;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    opacity 0.18s ease;
}

.chat-history-item-wrapper:hover
.chat-history-delete {
  opacity: 1;
}

.chat-history-delete:hover {
  color: #fff;
  background: rgba(255,255,255,0.22);
}

/* =========================================================
   顶部操作区 / 保存网页
   ========================================================= */
.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

#savePageBtn {
  white-space: nowrap;
}

#savePageBtn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/*
 * 静态 HTML 快照中发送区、服务连接状态不再具有实际意义。
 * saveCurrentPageAsHtml 会同时移除主要交互按钮。
 */
.saved-page-snapshot .composer-wrap,
.saved-page-snapshot .sidebar-footer {
  display: none;
}

@media (max-width: 900px) {
  .header-actions {
    gap: 5px;
  }

  .header-actions .ghost-button {
    padding: 8px 9px;
    font-size: 12px;
  }
}

