:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --line: #e6ebf3;
  --ink: #1c2431;
  --sub: #6b7688;
  --brand: #4c7cf3;
  --brand-2: #37c8a3;
  --warn: #f6a94c;
  --err: #e05c6a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 50, .04), 0 8px 24px rgba(20, 30, 50, .06);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 -apple-system, "Segoe UI", "Microsoft YaHei", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 650; }
.muted { color: var(--sub); }
.small { font-size: 12px; }
b { font-weight: 650; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 18px; background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand .logo { font-size: 22px; }
.brand h1 { font-size: 16px; }
.brand p { margin: 0; font-size: 11.5px; color: var(--sub); }
.topbar-mid { flex: 1; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.tab {
  border: 1px solid var(--line); background: #fbfcfe; color: var(--sub);
  padding: 5px 12px; border-radius: 999px; cursor: pointer; font-size: 12.5px;
}
.tab:hover { color: var(--brand); border-color: #cfdcfb; }
.tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.pill {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: #eef2f8; color: var(--sub); white-space: nowrap;
}
.pill.ok { background: #e7f8f1; color: #14926a; }
.pill.off { background: #fdf1e3; color: #b9741f; }
.pill.busy { background: #eaf0ff; color: #3a63c6; }

/* 模型切换 */
.model-switch { position: relative; }
button.pill {
  border: 1px solid transparent; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 5px;
}
button.pill:hover { border-color: #c8d5f2; }
button.pill::after { content: '▾'; font-size: 10px; opacity: .7; }
.model-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 80;
  width: 260px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(20, 30, 50, .16);
  padding: 8px; max-height: 60vh; overflow: auto;
}
.model-menu-head {
  font-size: 11.5px; color: var(--sub); padding: 4px 6px 8px;
  border-bottom: 1px solid var(--line); margin-bottom: 6px;
}
.model-option {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 1px solid transparent; background: transparent; color: var(--ink);
  border-radius: 9px; padding: 7px 9px; cursor: pointer; text-align: left;
  font-size: 12.5px; font-family: inherit;
}
.model-option:hover { background: #f2f6ff; }
.model-option.active { border-color: #bcd0fb; background: #f2f6ff; }
.model-option .mo-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-option .mo-id { font-size: 10.5px; color: #9aa6b8; }
.model-option .mo-dot { width: 7px; height: 7px; border-radius: 50%; background: #cbd3e1; flex: none; }
.model-option .mo-dot.on { background: var(--brand-2); }
.model-option:disabled { opacity: .5; cursor: not-allowed; }
.model-menu-foot { padding: 7px 6px 3px; border-top: 1px solid var(--line); margin-top: 6px; }

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 7px 14px; border-radius: 9px; cursor: pointer; font-size: 13px;
  transition: .15s;
}
.btn:hover:not(:disabled) { border-color: #c8d5f2; box-shadow: 0 2px 8px rgba(60, 90, 160, .08); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover:not(:disabled) { background: #3d6be0; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 11px; font-size: 12.5px; }
.btn.tiny { padding: 3px 9px; font-size: 11.5px; border-radius: 7px; }
.btn.danger { color: var(--err); border-color: #f3ccd1; }

/* ---------- 布局 ---------- */
.layout {
  display: grid; grid-template-columns: 336px minmax(0, 1fr);
  gap: 14px; padding: 14px 16px 26px; align-items: start;
}
.side {
  display: flex; flex-direction: column; gap: 12px;
  position: sticky; top: 74px;
  max-height: calc(100vh - 90px); overflow: auto;
  padding-right: 2px;
}
.workspace { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; border-bottom: 1px solid var(--line);
}
.card-head h2 { font-size: 13.5px; }
.card-body { padding: 12px 14px; }
.badge { font-size: 11.5px; color: var(--sub); background: #eef2f8; padding: 2px 8px; border-radius: 999px; }

/* 拖拽上传 */
.drop-zone { padding: 16px; text-align: center; transition: .18s; }
.drop-zone.over { border-color: var(--brand); background: #f2f6ff; box-shadow: 0 0 0 3px rgba(76, 124, 243, .12); }
.drop-inner { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.drop-icon {
  width: 34px; height: 34px; border-radius: 50%; background: #eef2f8;
  display: grid; place-items: center; font-size: 16px; color: var(--brand);
}
.sample-row { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.sample-list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.sample-list button {
  border: 1px dashed #ccd8ee; background: #fbfcff; color: var(--brand);
  border-radius: 8px; padding: 4px 9px; font-size: 11.5px; cursor: pointer;
}
.sample-list button:hover { background: #eff4ff; border-style: solid; }

/* 字段 */
.field-groups { padding: 12px 14px 4px; display: flex; flex-direction: column; gap: 10px; }
.fgroup h3 { font-size: 12px; color: var(--sub); font-weight: 600; display: flex; align-items: center; gap: 5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.dim { background: #8ba3c7; }
.dot.num { background: var(--brand-2); }
.dot.hide { background: #c3cbd8; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.chip {
  border: 1px solid var(--line); background: #fbfcfe; border-radius: 7px;
  padding: 3px 8px; font-size: 11.5px; cursor: pointer; color: #38445a;
  position: relative;
  display: inline-flex; align-items: center; gap: 2px;
  user-select: none;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip .u { color: #9aa6b8; font-size: 10.5px; margin-left: 3px; }
.chip.dragging { opacity: .4; }
.chip.drag-over {
  border-color: var(--brand); border-style: dashed;
  background: #eef4ff; color: var(--brand);
}
.chip-x {
  border: none; background: transparent; color: #aab4c6;
  font-size: 13px; line-height: 1; padding: 0 0 0 4px; cursor: pointer;
  border-radius: 4px;
}
.chip-x:hover { color: var(--err); background: #fdf0f1; }
.chip-hidden {
  border-style: dashed; color: #8895ab; background: #f7f9fc;
}
.chip-hidden:hover { border-color: var(--brand-2); color: var(--brand-2); }
.field-foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 14px 10px;
}
.field-foot .muted.small:first-child { font-weight: 600; color: var(--ink); }
.field-foot .btn { margin-left: auto; }
.row-gap { display: flex; gap: 6px; padding: 8px 14px 12px; }

/* 对话 */
.chat-card { display: flex; flex-direction: column; max-height: 46vh; }
.chat-log { overflow: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 9px; }
.empty-chat { color: var(--sub); font-size: 12.5px; }
.empty-chat ul { padding-left: 16px; margin: 6px 0 0; }
.empty-chat li { cursor: pointer; }
.empty-chat li:hover { color: var(--brand); }
.msg { font-size: 12.5px; border-radius: 9px; padding: 7px 10px; }
.msg.q { background: #eff4ff; color: #2a4bab; }
.msg.a { background: #f6f8fb; border: 1px solid var(--line); }
.msg.a .meta { color: var(--sub); font-size: 11px; margin-top: 3px; }
.msg.err { background: #fdf0f1; color: #a8323f; }
.msg button { margin-top: 5px; }

/* 提问条 */
.ask-bar { padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; }
#askInput {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px;
  font: inherit; resize: vertical; background: #fbfcfe; color: var(--ink);
}
#askInput:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(76, 124, 243, .1); }
.ask-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

.quick-row { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-row button {
  background: #fff; border: 1px solid var(--line); color: #44506a;
  border-radius: 999px; padding: 4px 11px; font-size: 12px; cursor: pointer;
}
.quick-row button:hover { border-color: var(--brand); color: var(--brand); }

.suggest-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.suggest-head .suggest-title { font-size: 12.5px; font-weight: 650; color: var(--ink); }
.suggest-head .suggest-src {
  font-size: 10.5px; padding: 2px 7px; border-radius: 999px;
  background: #fdf1e3; color: #b9741f; white-space: nowrap;
}
.suggest-head .suggest-src.llm { background: #e7f8f1; color: #14926a; }
.suggest-head .suggest-overview,
.suggest-head #suggestOverview {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 11.5px; color: var(--sub);
}

.suggest-list { display: flex; flex-direction: column; gap: 6px; }
.suggest-item {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; padding: 8px 10px;
}
.suggest-item:hover { border-color: #cfdcfb; background: #fbfcff; }
.suggest-main { flex: 1; min-width: 0; }
.suggest-item-title { font-size: 12.5px; color: #2c3850; font-weight: 600; }
.suggest-why { font-size: 11.5px; color: #6b7688; margin-top: 3px; line-height: 1.5; }

.history-card .history-toolbar { padding: 8px 12px 0; margin-bottom: 0; }
.history-card .history-list {
  padding: 8px 12px 12px;
  max-height: 32vh;
  overflow: auto;
}

.history-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.history-toolbar input[type='search'] {
  flex: 1;
  min-width: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 12px;
  background: #fbfcfe;
}
.history-toolbar select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  background: #fbfcfe;
  max-width: 160px;
}
.history-group-title {
  font-size: 11.5px;
  font-weight: 650;
  color: #6b7688;
  margin: 8px 0 2px;
  padding-left: 2px;
}
.history-group-title:first-child { margin-top: 0; }

.history-list { display: flex; flex-direction: column; gap: 6px; }
.history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 7px 9px;
}
.history-main { flex: 1; min-width: 0; }
.history-title {
  font-size: 12.5px;
  color: #2c3850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-meta { font-size: 11px; color: #8895ab; }
.history-item input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 7px;
  font-size: 12px;
}
.history-actions { display: flex; gap: 5px; flex-wrap: wrap; }

/* ---------- 图表舞台 ---------- */
/* ---------- 图表舞台 ---------- */
.stage-toolbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 7px 12px; margin-bottom: 12px;
}
.stage-toolbar .stage-count { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.stage-toolbar .stage-sep { width: 1px; height: 16px; background: var(--line); margin: 0 4px; }
.stage-toolbar .stage-spacer { flex: 1; }
.stage { display: flex; flex-direction: column; gap: 14px; }
.placeholder {
  padding: 42px 32px; text-align: center; background: var(--card);
  border: 1px dashed #ccd8ea; border-radius: var(--radius);
}
.ph-art { font-size: 34px; }
.placeholder h2 { margin: 8px 0 4px; font-size: 17px; }
.ph-steps { list-style: none; padding: 0; margin: 16px auto 0; max-width: 520px; text-align: left; }
.ph-steps li { display: flex; gap: 10px; padding: 7px 0; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--sub); }
.ph-steps b {
  width: 20px; height: 20px; border-radius: 6px; background: #eef2f8; color: var(--brand);
  display: grid; place-items: center; font-size: 11px; flex: 0 0 auto;
}

.chart-card { overflow: hidden; }
.chart-card.selected { box-shadow: 0 0 0 2px var(--brand), var(--shadow); }

/* 折叠：只保留工具栏 */
.chart-card.collapsed .chart-box,
.chart-card.collapsed .chart-foot { display: none; }
.chart-card.collapsed .chart-head { border-bottom: none; }
.chart-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.chart-head h3 { font-size: 14.5px; flex: 1; min-width: 160px; }
.chart-head .tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #eef2f8; color: var(--sub); }
.chart-head .tag.llm { background: #e7f8f1; color: #14926a; }
.chart-head .tag.auto { background: #fdf1e3; color: #b9741f; }
.chart-head .tools { display: flex; gap: 5px; flex-wrap: wrap; }
.chart-box { width: 100%; height: 420px; }
.chart-box.short { height: 320px; }
.chart-foot { padding: 8px 14px 12px; border-top: 1px solid var(--line); background: #fafbfe; }

/* 图表卡片全屏 */
body.has-fullscreen-chart { overflow: hidden; }
.chart-card.fullscreen {
  position: fixed;
  inset: 10px;
  z-index: 120;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .22);
  display: flex;
  flex-direction: column;
}
.chart-card.fullscreen .chart-box {
  flex: 1;
  height: auto;
  min-height: 420px;
}
.chart-card.fullscreen .chart-foot {
  max-height: 34vh;
  overflow: auto;
}
.chart-card.fullscreen::after {
  content: '按 Esc 退出全屏';
  position: absolute;
  right: 12px;
  top: 12px;
  font-size: 12px;
  color: #6b7688;
  background: rgba(255, 255, 255, .88);
  border: 1px solid #e5eaf3;
  border-radius: 999px;
  padding: 2px 8px;
}
.notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.notes li {
  font-size: 12.5px; color: #3a465c; background: #fff;
  border-left: 3px solid var(--brand); padding: 6px 10px; border-radius: 0 8px 8px 0;
  box-shadow: 0 1px 2px rgba(20, 30, 50, .05);
}
.stat-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.stat {
  border: 1px solid var(--line); background: #fff; border-radius: 9px;
  padding: 5px 10px; font-size: 11.5px; color: var(--sub);
}
.stat b { display: block; color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }

.note-line { font-size: 12px; color: #8a6d1f; background: #fdf6e6; border: 1px solid #f2e2bd; padding: 6px 10px; border-radius: 9px; }
.loading-bar { height: 3px; background: linear-gradient(90deg, transparent, var(--brand), transparent); border-radius: 3px; animation: slide 1.1s infinite; }
@keyframes slide { 0% { opacity: .3 } 50% { opacity: 1 } 100% { opacity: .3 } }

.skeleton { padding: 14px; }
.skeleton .line { height: 12px; border-radius: 6px; background: #eef1f6; margin-bottom: 10px; animation: blink 1.2s infinite; }
@keyframes blink { 0%, 100% { opacity: 1 } 50% { opacity: .5 } }

/* 明细表 */
.tbl-wrap { overflow: auto; max-height: 58vh; }
table.grid { border-collapse: collapse; font-size: 12px; width: max-content; min-width: 100%; }
table.grid th, table.grid td { border-bottom: 1px solid var(--line); padding: 5px 9px; white-space: nowrap; text-align: right; }
table.grid th:first-child, table.grid td:first-child { text-align: left; }
table.grid thead th { position: sticky; top: 0; background: #f5f8fd; color: var(--sub); font-weight: 600; z-index: 1; }
table.grid tbody tr:hover { background: #f8fbff; }

/* ---------- 抽屉 / 弹窗 ---------- */
.drawer-mask, .modal-mask {
  position: fixed; inset: 0; background: rgba(24, 32, 46, .42); z-index: 60;
  display: grid; place-items: center; backdrop-filter: blur(2px);
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 92vw);
  background: var(--card); z-index: 70; box-shadow: -12px 0 40px rgba(20, 30, 50, .16);
  display: flex; flex-direction: column;
}
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 16px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.drawer label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--sub); }
.drawer input {
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font: inherit;
  color: var(--ink); background: #fbfcfe;
}
.drawer input:focus { outline: none; border-color: var(--brand); background: #fff; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.preset-row { display: flex; flex-wrap: wrap; gap: 6px; }
.preset-row button { border: 1px solid var(--line); background: #fbfcfe; border-radius: 8px; padding: 4px 9px; font-size: 11.5px; cursor: pointer; color: var(--sub); }
.preset-row button:hover { color: var(--brand); border-color: #c8d5f2; }
.drawer-actions { display: flex; gap: 8px; justify-content: flex-end; }
.result-line { font-size: 12px; min-height: 18px; color: var(--sub); word-break: break-all; }
.result-line.ok { color: #14926a; }
.result-line.err { color: var(--err); }

.local-mode {
  border: 1px solid #bcd0fb;
  background: #f2f6ff;
  border-radius: 10px;
  padding: 9px 11px;
}
.local-mode .check-inline {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12.5px; color: var(--ink);
}
.local-mode .local-hint { margin: 6px 0 0; line-height: 1.6; color: #3a63c6; }
.local-mode code { font-size: 11px; background: #fff; padding: 1px 4px; border-radius: 4px; }

.modal {
  background: var(--card); border-radius: var(--radius); width: min(1080px, 94vw);
  max-height: 88vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal header { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal header h2 { font-size: 14.5px; flex: 1; }
.modal .tbl-wrap { padding: 0 6px 6px; }

/* Option 编辑器 */
.modal.wide { width: min(900px, 96vw); }
#optionEditor {
  width: 100%; min-height: 52vh; resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.55; tab-size: 2;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; background: #fbfcfe; color: var(--ink);
  white-space: pre; overflow: auto;
}
#optionEditor:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(76, 124, 243, .1); }
#optionEditor.invalid { border-color: var(--err); background: #fdf7f8; }
/* 有未应用的修改时，「应用」按钮轻微脉动提示 */
.btn.pulse { animation: btnPulse 1.2s ease-in-out infinite; }
@keyframes btnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 92, 106, .45); }
  50% { box-shadow: 0 0 0 5px rgba(224, 92, 106, 0); }
}
.modal-foot { display: flex; align-items: center; gap: 8px; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: #22304a; color: #fff; padding: 9px 16px; border-radius: 10px;
  font-size: 12.5px; z-index: 90; box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  animation: pop .18s ease-out;
}
.toast.err { background: #a8323f; }
@keyframes pop { from { transform: translate(-50%, 12px); opacity: 0 } }

.chart-card.coloring .chart-box { cursor: crosshair; }
.chart-card.coloring .chart-box::after {
  content: '调色模式：点击图形元素改色';
  position: absolute;
  left: 50%; top: 10px; transform: translateX(-50%);
  font-size: 12px; color: #6b7688;
  background: rgba(255,255,255,.88);
  border: 1px solid #e5eaf3;
  border-radius: 999px;
  padding: 2px 8px;
  pointer-events: none;
}

.color-pop {
  position: fixed;
  z-index: 140;
  width: 228px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(20,30,50,.2);
}
.color-pop .cp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}
.color-pop .cp-head span {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--ink);
}
.color-pop .cp-row { display: flex; align-items: center; gap: 8px; }
.color-pop input[type='color'] { width: 42px; height: 34px; padding: 2px; border-radius: 8px; border: 1px solid var(--line); }
.color-pop input[type='text'] { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-transform: uppercase; }
.color-pop .cp-swatches { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.color-pop .cp-swatches button { width: 20px; height: 20px; border-radius: 5px; border: 1px solid var(--line); padding: 0; cursor: pointer; }
.color-pop .cp-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bg-pop { width: 258px; }
.bg-pop .cp-swatches button { width: 24px; height: 24px; }
.bg-pop .cp-swatches button.active,
.color-pop .cp-swatches button.active {
  outline: 2px solid var(--brand); outline-offset: 1px;
}

/* 透明背景：棋盘格底纹，提醒用户此处无底色 */
.chart-box.bg-transparent {
  background-image:
    linear-gradient(45deg, #e8ecf3 25%, transparent 25%, transparent 75%, #e8ecf3 75%),
    linear-gradient(45deg, #e8ecf3 25%, transparent 25%, transparent 75%, #e8ecf3 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}

@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; }
  .chat-card { max-height: 340px; }
  .side { max-height: none; overflow: visible; }
  .history-card .history-list { max-height: none; }
}
