/* 建模历史列表（adapters/model-history-list.js，2026-10-24）：视图切换、「⋯」菜单、撤销条、置顶标记。
   对话页外壳的抽屉（.hx-model-history，深紫底）和独立建模页的弹窗（.mw-local-history，跟主题走）共用。
   行本身沿用外壳原来的 hx-model-history-row 等样式。 */
.mwh {
  --mwh-line: #ffffff1f;
  --mwh-soft: #ffffff12;
  --mwh-muted: #bda7d0;
  --mwh-menu: #2c2436;
  --mwh-ink: #f2e9ff;
  --mwh-accent: #c6a2f6;
  --mwh-danger: #ff9b9b;
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.mwh [hidden] { display: none !important; }

/* 作品 / 已归档 / 回收站 */
.mwh-tabs { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--mwh-line); border-radius: 9px; }
.mwh .mwh-tab {
  display: inline-flex; flex: 1; align-items: center; justify-content: center; gap: 4px;
  min-width: 0; padding: 6px 4px; border: 0; border-radius: 7px; background: transparent;
  color: var(--mwh-muted); font: inherit; font-size: 12px; box-shadow: none; cursor: pointer;
}
.mwh .mwh-tab:hover:not(.is-active) { background: var(--mwh-soft); }
.mwh .mwh-tab.is-active { background: var(--mwh-accent); color: #1e1527; font-weight: 700; }
.mwh-count { font-size: 10px; opacity: .8; font-variant-numeric: tabular-nums; }
.mwh-count:empty { display: none; }

/* 撤销条 */
.mwh-notice {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 9px; border: 1px solid var(--mwh-line); border-radius: 8px;
  background: var(--mwh-soft); color: var(--mwh-ink); font-size: 12px; line-height: 1.5;
}
.mwh .mwh-undo { flex: none; padding: 3px 9px; border: 1px solid var(--mwh-accent); border-radius: 6px; background: transparent; color: var(--mwh-accent); font-size: 12px; }

/* 一行：左边整块是打开按钮，右边「⋯」 */
.mwh-section { padding: 6px 4px 0; color: var(--mwh-muted); font-size: 10px; letter-spacing: .08em; }
.mwh-item { position: relative; display: flex; flex: none; align-items: stretch; }
.mwh-item > .hx-model-history-row { flex: 1; min-width: 0; padding-right: 36px !important; }
.mwh .mwh-more {
  position: absolute; top: 50%; right: 4px; width: 28px; height: 28px; padding: 0;
  transform: translateY(-50%); border: 0; border-radius: 7px; background: transparent;
  color: var(--mwh-ink); font-size: 18px; line-height: 1; opacity: .55; box-shadow: none; cursor: pointer;
}
.mwh .mwh-more:hover, .mwh .mwh-more:focus-visible, .mwh .mwh-more[aria-expanded="true"] { opacity: 1; background: var(--mwh-soft); }
.mwh-pin {
  display: inline-block; margin-right: 5px; padding: 0 5px; border-radius: 4px;
  background: var(--mwh-accent); color: #1e1527; font-size: 10px; font-style: normal; font-weight: 700; line-height: 16px; vertical-align: 1px;
}
.mwh-rename {
  box-sizing: border-box; width: 100%; min-width: 0; padding: 4px 7px; border: 1px solid var(--mwh-accent);
  border-radius: 6px; background: #00000033; color: var(--mwh-ink); font: inherit; font-size: 12px;
}

/* 菜单：挂在页面（或弹窗）上，不在列表里，所以颜色变量自己再带一份 */
.mwh-menu {
  --mwh-line: #ffffff1f; --mwh-soft: #ffffff14; --mwh-menu: #2c2436; --mwh-ink: #f2e9ff; --mwh-danger: #ff9b9b;
  position: fixed; z-index: 1000; display: grid; min-width: 150px; max-width: calc(100vw - 16px); padding: 5px;
  border: 1px solid var(--mwh-line); border-radius: 10px; background: var(--mwh-menu); color: var(--mwh-ink);
  font-family: inherit; box-shadow: 0 10px 28px #0007;
}
.mwh-menu[hidden] { display: none; }
.mwh-menu.in-dialog {
  --mwh-line: var(--border, #0000001f); --mwh-soft: color-mix(in srgb, currentColor 8%, transparent);
  --mwh-menu: var(--surface, #fff); --mwh-ink: var(--text, #1d1a22); --mwh-danger: var(--danger, #c0392b);
}
.mwh-menu .mwh-menu-item {
  min-height: 0; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--mwh-ink);
  font: inherit; font-size: 13px; text-align: left; box-shadow: none; cursor: pointer;
}
.mwh-menu .mwh-menu-item:hover:not(:disabled), .mwh-menu .mwh-menu-item:focus-visible { background: var(--mwh-soft); }
.mwh-menu .mwh-menu-item.is-danger { color: var(--mwh-danger); }
.mwh-menu .mwh-menu-item:disabled { opacity: .45; cursor: not-allowed; }

/* 触屏上没有悬停：「⋯」一直看得清 */
@media (hover: none) { .mwh .mwh-more { opacity: .9; } }

/* 独立建模页的弹窗：跟着页面主题走 */
.mw-local-history .mwh {
  --mwh-line: var(--border, #0000001f);
  --mwh-soft: color-mix(in srgb, currentColor 8%, transparent);
  --mwh-muted: var(--text-secondary, #6b6475);
  --mwh-menu: var(--surface, #fff);
  --mwh-ink: var(--text, #1d1a22);
  --mwh-accent: var(--accent, #7a5bb5);
  --mwh-danger: var(--danger, #c0392b);
  min-height: 320px;
}
.mw-local-history .mwh .hx-model-history-rows { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow: auto; }
.mw-local-history .mwh .hx-model-history-row {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; text-align: left;
  border: 1px solid var(--mwh-line); border-radius: 8px; background: transparent; color: inherit; font: inherit; cursor: pointer;
}
.mw-local-history .mwh .hx-model-history-row.is-current { border-color: var(--mwh-accent); box-shadow: inset 3px 0 var(--mwh-accent); }
.mw-local-history .mwh .hx-model-thumb { display: grid; place-items: center; flex: none; width: 48px; height: 40px; border-radius: 6px; background: var(--mwh-soft); }
.mw-local-history .mwh .hx-model-thumb img { width: 100%; height: 100%; object-fit: contain; }
.mw-local-history .mwh .hx-model-history-copy { display: grid; gap: 3px; min-width: 0; }
.mw-local-history .mwh .hx-model-history-copy b { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.mw-local-history .mwh .hx-model-history-copy small { color: var(--mwh-muted); font-size: 11px; }
.mw-local-history .mwh .hx-model-search { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--mwh-line); border-radius: 8px; background: transparent; color: inherit; font: inherit; }
.mw-local-history .mwh .hx-model-history-info { margin: 0; color: var(--mwh-muted); font-size: 12px; }
.mw-local-history .mwh .hx-model-more, .mw-local-history .mwh .hx-model-refresh { padding: 6px; border: 0; background: transparent; color: var(--mwh-muted); font: inherit; font-size: 12px; cursor: pointer; }
.mw-local-history .mwh .mwh-tab.is-active, .mw-local-history .mwh .mwh-pin { color: var(--on-accent, #fff); }
