/* editbar.css — 更改页面布局编辑器样式（与小蓝页同款）
   由 editbar.js 在 bookstation/pianyu 站按需注入；xiaolan/teahouse 已内联于 common.css。
   仅作用于 body.xl-editmode 下，正常访客无影响。 */
/* ============ 布局编辑模式（站主） ============ */
.xl-editmode [data-xl-edit] {
  outline: 1px dashed var(--accent);
  outline-offset: 2px;
  cursor: text;
  border-radius: 4px;
}
.xl-editmode [data-xl-edit-img] {
  outline: 2px dashed var(--accent);
  outline-offset: 3px;
  cursor: pointer;
}
/* ============ 编辑条：Microsoft 365 / Fluent 2 带状工具栏（Ribbon） ============
   结构：标题行 → 选项卡 → 带状内容（每组按钮下方带组名，与 Word 网页版一致）
   配色取 Fluent 2 浅色体系：底 #faf9f8 / 面板 #fff / 描边 #e0e0e0 / 次级文字 #616161
   选择器注意：`.xl-edit-banner button` 特异度 (0,1,1) 会压过单个类名 (0,1,0)，
   所以下面所有要覆盖它的规则都带 `.xl-edit-banner` 前缀 (0,2,0)。
   ============================================================================ */
.xl-edit-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 2000;
  display: flex; flex-direction: column;
  background: #faf9f8;
  color: #242424;
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 13px;
  line-height: 1.4;
}
.xl-edit-row { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 14px 6px; }
.xl-edit-banner .xl-edit-brand {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 13.5px; color: var(--accent); white-space: nowrap;
}
.xl-edit-banner .xl-edit-brand-ico { font-size: 15px; line-height: 1; }
.xl-edit-banner .xl-edit-tip {
  flex: 1 1 auto; min-width: 0;
  color: #616161; font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.xl-edit-banner button {
  font-family: inherit; font-size: 13px; line-height: 1.4;
  border: 1px solid transparent;
  background: transparent; color: #242424;
  border-radius: 4px; padding: 4px 8px;
  cursor: pointer;
}
.xl-edit-banner button:hover { background: #f0f0f0; }
.xl-edit-banner .xl-edit-save {
  background: var(--accent); color: #fff; border-color: var(--accent);
  font-weight: 600; padding: 6px 16px;
}
.xl-edit-banner .xl-edit-save:hover { background: color-mix(in srgb, var(--accent) 86%, #000); color: #fff; }
.xl-edit-banner .xl-edit-save:disabled { opacity: .5; cursor: default; }
.xl-edit-banner .xl-edit-exit {
  background: #fff; color: #242424; border-color: #d1d1d1; padding: 6px 14px;
}
.xl-edit-banner .xl-edit-exit:hover { background: #f0f0f0; }
/* 收起 / 展开带状内容（同 365 右上角的收起箭头），状态存 localStorage */
.xl-edit-banner .xl-rbn-collapse { padding: 6px 9px; color: #616161; font-size: 12px; }
.xl-edit-banner.is-collapsed .xl-rbn-collapse { color: var(--accent); }
.xl-edit-banner.is-collapsed .xl-rbn-tabs,
.xl-edit-banner.is-collapsed .xl-rbn-body { display: none; }

/* ---------- 选项卡 ---------- */
.xl-edit-banner .xl-rbn-tabs {
  display: flex; align-items: flex-end; gap: 2px;
  padding: 0 10px; background: #faf9f8;
  overflow-x: auto;
}
.xl-edit-banner .xl-rbn-tab {
  position: relative;
  padding: 7px 12px 9px;
  border: 0; background: none;
  color: #424242; font-size: 13px;
  border-radius: 4px 4px 0 0;
  white-space: nowrap;
}
.xl-edit-banner .xl-rbn-tab:hover { background: #f0f0f0; color: #242424; }
.xl-edit-banner .xl-rbn-tab.on { color: var(--accent); font-weight: 600; }
.xl-edit-banner .xl-rbn-tab.on::after {
  content: ''; position: absolute;
  left: 8px; right: 8px; bottom: 2px; height: 2px;
  border-radius: 1px; background: var(--accent);
}
/* 上下文选项卡：选中内容块时把这一页变成「图片 / 视频 / 文本框 / 附件」
   （同 365 选中图片后冒出的「图片」页），左侧加一条强调竖线 */
.xl-edit-banner .xl-rbn-tab.is-ctx { padding-left: 17px; color: var(--accent); }
.xl-edit-banner .xl-rbn-tab.is-ctx::before {
  content: ''; position: absolute;
  left: 6px; top: 50%; width: 3px; height: 14px; margin-top: -7px;
  border-radius: 2px; background: var(--accent);
}

/* ---------- 带状内容 ---------- */
.xl-edit-banner .xl-rbn-body {
  display: flex; align-items: stretch;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  padding: 5px 8px 0;
  min-height: 74px;
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.xl-edit-banner .xl-rbn-pane { display: none; align-items: stretch; width: 100%; }
.xl-edit-banner .xl-rbn-pane.on { display: flex; }
.xl-edit-banner .xl-rbn-grp {
  display: flex; flex-direction: column;
  padding: 0 9px; flex: 0 0 auto;
  border-right: 1px solid #ededed;
}
.xl-edit-banner .xl-rbn-grp:last-child { border-right: 0; }
.xl-edit-banner .xl-rbn-grp-body { display: flex; align-items: center; gap: 4px; flex: 1 1 auto; padding: 2px 0 3px; }
.xl-edit-banner .xl-rbn-grp-name {
  text-align: center; color: #8a8886; font-size: 10.5px;
  padding: 2px 0 5px; white-space: nowrap; letter-spacing: .02em;
}
.xl-edit-banner .xl-rbn-stack { display: flex; flex-direction: column; gap: 3px; }
.xl-edit-banner .xl-rbn-row { display: flex; align-items: center; gap: 2px; }
.xl-edit-banner .xl-rbn-vsep { width: 1px; align-self: stretch; margin: 3px 4px; background: #e0e0e0; }
.xl-edit-banner .xl-rbn-note { color: #616161; font-size: 11.5px; line-height: 1.75; white-space: nowrap; }

/* ---------- 通用小按钮 / 下拉 / 分隔线 ---------- */
.xl-edit-banner .xl-tb-btn,
.xl-edit-banner .xl-tb-select,
.xl-edit-banner .xl-tb-color {
  font-family: inherit; font-size: 13px;
  border: 1px solid transparent;
  background: transparent; color: #242424;
  border-radius: 4px; padding: 4px 8px;
  cursor: pointer; white-space: nowrap;
}
.xl-edit-banner .xl-tb-btn { min-width: 26px; text-align: center; }
.xl-edit-banner .xl-tb-btn:hover,
.xl-edit-banner .xl-tb-select:hover,
.xl-edit-banner .xl-tb-color:hover { background: #f0f0f0; }
.xl-edit-banner .xl-tb-select { border-color: #d1d1d1; background: #fff; padding-right: 4px; }
.xl-edit-banner .xl-tb-select option { color: #242424; }
.xl-edit-banner .xl-tb-sep { width: 1px; align-self: stretch; margin: 3px 5px; background: #e0e0e0; }
.xl-edit-banner .xl-tb-color { display: inline-flex; align-items: center; gap: 6px; }
.xl-edit-banner .xl-tb-color input[type=color] { width: 22px; height: 22px; border: none; background: none; padding: 0; cursor: pointer; }

/* 字体 / 字号输入框 */
.xl-edit-banner .xl-tb-size {
  width: 52px; font-family: inherit; font-size: 13px;
  border: 1px solid #d1d1d1; background: #fff; color: #242424;
  border-radius: 4px; padding: 3px 6px;
}
.xl-edit-banner .xl-tb-size::placeholder { color: #a19f9d; }
.xl-edit-banner .xl-tb-size:focus { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 0; }

/* 颜色按钮：「A」+ 色条 + 箭头 */
.xl-edit-banner .xl-tb-color-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 6px 3px 4px;
  font-family: inherit; font-size: 13px;
  border: 1px solid transparent; background: transparent; color: #242424;
  border-radius: 4px; cursor: pointer;
}
.xl-edit-banner .xl-tb-color-btn:hover { background: #f0f0f0; }
.xl-edit-banner .xl-tb-color-letter,
.xl-edit-banner .xl-tb-color-bg-letter { font-weight: 800; font-size: 14px; line-height: 1; padding: 1px 3px; }
.xl-edit-banner .xl-tb-color-letter { color: #242424; }
.xl-edit-banner .xl-tb-color-bg-letter { background: #fff36d; color: #242424; border-radius: 2px; }
.xl-edit-banner .xl-tb-color-bar { display: inline-block; width: 15px; height: 3px; border-radius: 2px; margin-left: 1px; }
.xl-edit-banner .xl-caret { font-size: .6rem; opacity: .7; margin-left: 1px; }

/* 下拉调色板面板 */
.xl-tb-color-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px); left: 0;
  z-index: 1250;
  background: var(--card-bg, #fff);
  color: var(--text, #1c2733);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  padding: 10px;
  width: 232px;
}
.xl-tb-color-panel.open { display: block; }
/* 带状工具栏里的面板必须改成 fixed：外层 .xl-rbn-body 是 overflow:auto，
   绝对定位会被裁掉（不是溢出来，而是撑出一条滚动条）。位置由 JS 按按钮实时算。 */
.xl-edit-banner .xl-rbn-body .xl-tb-color-panel {
  position: fixed;
  max-height: 70vh;
  overflow-y: auto;
}
.xl-tb-color-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}
.xl-tb-color-swatch {
  width: 100%; aspect-ratio: 1;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
}
.xl-tb-color-swatch:hover { transform: scale(1.1); box-shadow: 0 0 0 2px var(--accent); }
.xl-tb-color-recent { margin-top: 10px; }
.xl-tb-color-recent-label {
  font-size: .72rem; color: var(--muted, #44556a);
  margin-bottom: 4px;
}
.xl-tb-color-recent-empty {
  font-size: .72rem; color: var(--muted, #44556a); opacity: .6;
  grid-column: 1 / -1;
  padding: 4px 0;
}
.xl-tb-color-custom {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--card-border, #e3e8ef);
  font-size: .78rem;
}
.xl-tb-color-custom input[type=color] {
  width: 28px; height: 28px; padding: 0;
  border: 1px solid var(--card-border, #e3e8ef);
  border-radius: 4px; cursor: pointer;
}
.xl-tb-color-clear {
  margin-left: auto;
  padding: 4px 10px;
  font-size: .72rem;
  border: 1px solid var(--card-border, #e3e8ef);
  background: transparent;
  color: var(--muted, #44556a);
  border-radius: 999px;
  cursor: pointer;
}
.xl-tb-color-clear:hover {
  background: var(--card-bg, #fff);
  color: var(--danger, #d13438);
  border-color: var(--danger, #d13438);
}

/* ============ 浮动迷你工具栏（365 选中浮现式，浅色） ============ */
.xl-mini-toolbar {
  display: none;
  position: fixed;
  z-index: 1240;
  background: #fff;
  color: #242424;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 3px 4px;
  gap: 2px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  font-size: 13px;
  align-items: center;
  white-space: nowrap;
}
.xl-mini-toolbar.open { display: inline-flex; }
.xl-mini-toolbar button {
  border: 1px solid transparent; background: transparent; color: #242424;
  padding: 4px 9px; border-radius: 4px; cursor: pointer;
  font-family: inherit; font-size: 13px;
  font-weight: 700;
}
.xl-mini-toolbar button:hover { background: #f0f0f0; }
.xl-mini-toolbar .xl-mini-fg, .xl-mini-toolbar .xl-mini-bg {
  position: relative;
  padding: 4px 7px;
}
.xl-mini-toolbar .xl-mini-fg-letter, .xl-mini-toolbar .xl-mini-bg-letter {
  display: inline-block; width: 14px; height: 14px;
  line-height: 14px; text-align: center; border-radius: 3px;
  font-weight: 800; font-size: 13px;
}
.xl-mini-toolbar .xl-mini-fg-letter { background: #242424; color: #fff; }
.xl-mini-toolbar .xl-mini-bg-letter { background: #fff36d; color: #242424; }
.xl-mini-toolbar .xl-mini-fg-bar {
  display: block; height: 2px; width: 14px; margin: 1px auto 0;
  background: #242424;
}
.xl-mini-toolbar .xl-mini-fg-panel, .xl-mini-toolbar .xl-mini-bg-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  z-index: 1260;
}
.xl-mini-toolbar .xl-mini-fg-panel.open, .xl-mini-toolbar .xl-mini-bg-panel.open { display: block; }
.xl-mini-toolbar .xl-mini-fg-panel .xl-tb-color-panel,
.xl-mini-toolbar .xl-mini-bg-panel .xl-tb-color-panel {
  position: static;
  box-shadow: 0 8px 24px rgba(0,0,0,0.28);
}

/* 开关型按钮（粗体/斜体/下划线/删除线/对齐/列表）激活态：淡蓝底 + 蓝字 */
.xl-edit-banner .xl-tb-btn.on {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 42%, transparent);
  font-weight: 700;
}
.xl-edit-banner .xl-tb-btn:disabled { opacity: .45; cursor: not-allowed; }
.xl-edit-banner .xl-tb-btn:disabled:hover { background: transparent; }

/* B / I / U / S 用真实字形呈现，一眼可辨 */
.xl-edit-banner .xl-tb-btn.f-bold { font-weight: 800; }
.xl-edit-banner .xl-tb-btn.f-italic { font-style: italic; font-family: Georgia, serif; }
.xl-edit-banner .xl-tb-btn.f-underline { text-decoration: underline; }
.xl-edit-banner .xl-tb-btn.f-strike { text-decoration: line-through; }
.xl-edit-banner .xl-tb-btn.f-bold, .xl-edit-banner .xl-tb-btn.f-italic,
.xl-edit-banner .xl-tb-btn.f-underline, .xl-edit-banner .xl-tb-btn.f-strike {
  min-width: 26px; padding: 4px 6px; text-align: center;
}

/* 快捷键提示小键帽 */
.xl-kbd {
  display: inline-block; padding: 1px 5px; margin: 0 1px;
  border: 1px solid var(--card-border, #d1d1d1); border-radius: 4px;
  background: var(--card-bg, #fff);
  font-size: 11px; line-height: 1.5; white-space: nowrap;
}
.xl-edit-banner .xl-kbd { border-color: #d1d1d1; background: #fff; color: #616161; }

/* ---------- 深色主题 ---------- */
html[data-theme="dark"] .xl-edit-banner {
  background: #1b1a19; color: #f3f2f1; border-bottom-color: #3b3a39;
}
html[data-theme="dark"] .xl-edit-banner .xl-edit-tip { color: #a19f9d; }
html[data-theme="dark"] .xl-edit-banner button { color: #f3f2f1; }
html[data-theme="dark"] .xl-edit-banner button:hover { background: #333231; }
html[data-theme="dark"] .xl-edit-banner .xl-edit-exit { background: #252423; color: #f3f2f1; border-color: #484644; }
html[data-theme="dark"] .xl-edit-banner .xl-edit-exit:hover { background: #333231; }
html[data-theme="dark"] .xl-edit-banner .xl-rbn-collapse { color: #a19f9d; }
html[data-theme="dark"] .xl-edit-banner .xl-rbn-tabs { background: #1b1a19; }
html[data-theme="dark"] .xl-edit-banner .xl-rbn-tab { color: #c8c6c4; }
html[data-theme="dark"] .xl-edit-banner .xl-rbn-tab:hover { background: #292827; color: #f3f2f1; }
html[data-theme="dark"] .xl-edit-banner .xl-rbn-body { background: #252423; border-top-color: #3b3a39; }
html[data-theme="dark"] .xl-edit-banner .xl-rbn-grp { border-right-color: #3b3a39; }
html[data-theme="dark"] .xl-edit-banner .xl-rbn-grp-name { color: #a19f9d; }
html[data-theme="dark"] .xl-edit-banner .xl-rbn-note { color: #a19f9d; }
html[data-theme="dark"] .xl-edit-banner .xl-rbn-vsep,
html[data-theme="dark"] .xl-edit-banner .xl-tb-sep { background: #3b3a39; }
html[data-theme="dark"] .xl-edit-banner .xl-tb-btn,
html[data-theme="dark"] .xl-edit-banner .xl-tb-color-btn { color: #f3f2f1; }
html[data-theme="dark"] .xl-edit-banner .xl-tb-btn:hover,
html[data-theme="dark"] .xl-edit-banner .xl-tb-color-btn:hover { background: #333231; }
html[data-theme="dark"] .xl-edit-banner .xl-tb-select,
html[data-theme="dark"] .xl-edit-banner .xl-tb-size { background: #1b1a19; color: #f3f2f1; border-color: #484644; }
html[data-theme="dark"] .xl-edit-banner .xl-tb-color-letter { color: #f3f2f1; }
html[data-theme="dark"] .xl-edit-banner .xl-tb-sizeread { background: #292827; color: #f3f2f1; border-color: #3b3a39; }
html[data-theme="dark"] .xl-edit-banner .xl-kbd { background: #292827; border-color: #484644; color: #c8c6c4; }
html[data-theme="dark"] .xl-mini-toolbar { background: #252423; border-color: #3b3a39; color: #f3f2f1; }
html[data-theme="dark"] .xl-mini-toolbar button { color: #f3f2f1; }
html[data-theme="dark"] .xl-mini-toolbar button:hover { background: #333231; }
html[data-theme="dark"] .xl-mini-toolbar .xl-mini-fg-letter { background: #f3f2f1; color: #242424; }
html[data-theme="dark"] .xl-mini-toolbar .xl-mini-fg-bar { background: #f3f2f1; }

/* 编辑模式：给内容块容器让出顶部空间（工具栏收起时只让一行）
   —— 由 JS 在 body 上切换 .xl-rbn-collapsed 同步。
   高度不再写死：字体组因「清格式」等按钮实际超过 74px，固定 156px 会遮挡内容。
   用 ResizeObserver 把 banner 实时高度写进 --xl-banner-h，CSS 取这个变量 + 8px 缓冲。 */
/* 进入编辑态给 body 留白 = 编辑横幅 + 固定顶栏，修「仿 M365 菜单栏遮挡顶部文字」 */
body.xl-editmode { padding-top: var(--xl-edit-top, 168px); }
body.xl-editmode #xl-edit-blocks { margin-top: 0; }
body.xl-editmode.xl-rbn-collapsed { padding-top: var(--xl-edit-top, 168px); }

/* 保存按钮：有未保存修改时右上角显示琥珀色圆点 */
.xl-edit-save.is-dirty { position: relative; }
.xl-edit-save.is-dirty::after {
  content: ''; position: absolute; top: -3px; right: -3px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #ffb900;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .18);
}

/* ============ 插入：主按钮 + 下拉菜单 + 快速插入 + 尺寸读数 ============ */
.xl-edit-banner .xl-tb-insert { position: relative; }

/* 主操作按钮走实心蓝（365 主按钮质感）。
   必须带 .xl-edit-banner 前缀：`.xl-edit-banner button` 是 (0,1,1)，
   单个类名 (0,1,0) 压不过它 —— 这里踩过坑，白底按钮被刷成白字看不见。 */
.xl-edit-banner .xl-tb-insert-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  padding: 8px 14px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent); color: #fff;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.xl-edit-banner .xl-tb-insert-btn:hover { background: color-mix(in srgb, var(--accent) 86%, #000); color: #fff; }
.xl-edit-banner .xl-tb-insert-btn:active { transform: translateY(1px); }
.xl-edit-banner .xl-tb-insert-plus { font-size: 14px; font-weight: 800; line-height: 1; }
.xl-edit-banner .xl-tb-insert-label { letter-spacing: .02em; }
.xl-edit-banner .xl-tb-insert-btn .xl-caret { color: #fff; opacity: .85; }

/* 快速插入：图标 + 小字的方形按钮（365 里也保留此类图标快捷方式） */
.xl-edit-banner .xl-tb-quick {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; min-width: 42px; padding: 4px 4px 3px;
  border: 1px solid transparent; border-radius: 4px;
  background: transparent; color: #242424;
  font-family: inherit; font-size: 10.5px; line-height: 1.2;
  cursor: pointer; white-space: nowrap;
}
.xl-edit-banner .xl-tb-quick:hover { background: #f0f0f0; border-color: #e0e0e0; }
.xl-edit-banner .xl-tb-quick-ico { font-size: 17px; line-height: 1; }

/* 下拉菜单：默认收起。position:fixed 由 JS 定位 ——
   外层 .xl-rbn-body 是 overflow:auto，绝对定位的子元素会被裁掉。 */
.xl-tb-menu {
  display: none;
  position: fixed;
  z-index: 1250;
  min-width: 232px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  padding: 5px;
}
.xl-tb-menu.open { display: block; }
.xl-edit-banner .xl-tb-menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0; border-radius: 4px;
  background: none;
  color: #242424;
  font-family: inherit; font-size: 13px; font-weight: 400;
  text-align: left; cursor: pointer;
}
.xl-edit-banner .xl-tb-menu-item:hover { background: #f0f0f0; color: #242424; }
.xl-edit-banner .xl-tb-menu-ico { width: 20px; text-align: center; font-size: 15px; }
.xl-edit-banner .xl-tb-menu-label { flex: 1 1 auto; }
.xl-edit-banner .xl-tb-menu-hint { color: #8a8886; font-size: 11px; margin-left: auto; }

/* 尺寸读数 */
.xl-edit-banner .xl-tb-sizeread {
  font-size: 12px; color: #424242;
  background: #f3f2f1;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 5px 9px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 内容块里的列表（新增的「项目符号 / 编号」按钮会插入 ul / ol） */
.xl-block-inner ul, .xl-block-inner ol { margin: 6px 0; padding-left: 24px; }
.xl-block-inner ul { list-style: disc; }
.xl-block-inner ol { list-style: decimal; }
.xl-block-inner li { margin: 2px 0; }

html[data-theme="dark"] .xl-tb-menu { background: #252423; border-color: #484644; }
html[data-theme="dark"] .xl-edit-banner .xl-tb-menu-item { color: #f3f2f1; }
html[data-theme="dark"] .xl-edit-banner .xl-tb-menu-item:hover { background: #333231; color: #f3f2f1; }
html[data-theme="dark"] .xl-edit-banner .xl-tb-menu-hint { color: #a19f9d; }

/* 内容块（站主新建：文本框 / 图片 / 视频 / 文件附件） */
#xl-edit-blocks {
  max-width: 920px;
  margin: 18px auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.xl-block { position: relative; border-radius: 10px; }
.xl-block-inner {
  outline: none;
  min-height: 1.4em;
  line-height: 1.6;
  overflow-wrap: break-word;
}
.xl-block-inner:empty:before { content: attr(data-placeholder); color: #9aa6b2; }
.xl-block img, .xl-block .xl-video { max-width: 100%; border-radius: 10px; display: block; }
.xl-block .xl-video { width: 100%; aspect-ratio: 16 / 9; border: 0; }
.xl-block a { color: var(--accent); word-break: break-all; }

/* 文件附件块 */
.xl-block .xl-file {
  display: inline-flex; align-items: center; gap: 10px;
  max-width: 100%;
  padding: 10px 14px; border-radius: 10px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--card-border, #dbe3ec);
  color: var(--text, #1c2733);
  font-size: 0.92rem; font-weight: 600;
  text-decoration: none; word-break: normal;
}
.xl-block .xl-file:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--card-bg, #fff)); }
.xl-block .xl-file-ico { font-size: 1.1rem; line-height: 1; }
.xl-block .xl-file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[data-theme="dark"] .xl-block .xl-file { background: #1e2733; border-color: #34425a; color: #e6edf5; }

/* 显式尺寸的块：内部内容铺满该尺寸。图片按比例内缩不拉伸，视频撑满但不变形 */
.xl-block[data-w] > img { width: 100%; height: auto; }
.xl-block[data-h] > img { height: 100%; object-fit: contain; }
.xl-block[data-h] > .xl-video { height: 100%; aspect-ratio: auto; }
.xl-block[data-h] > .xl-block-inner { height: 100%; overflow: auto; }

/* 编辑模式：选中高亮 */
.xl-editmode .xl-block { outline: 1px dashed rgba(0, 120, 212, 0.55); outline-offset: 4px; }
.xl-editmode .xl-block.active { outline: 2px solid var(--accent); outline-offset: 4px; }
.xl-editmode .xl-block-inner { cursor: text; }
/* 原来的「已选中 · 可删除」角标已去掉：右上角要让给拖拽手柄与尺寸气泡 */

/* ---------- 长宽拖拽手柄（Microsoft 365 式：4 角 + 4 边） ---------- */
.xl-block .xl-rz {
  position: absolute; z-index: 6;
  display: none;
  box-sizing: border-box;
  background: #fff;
  border: 1.5px solid var(--accent, #0078d4);
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  touch-action: none;
}
.xl-editmode .xl-block.active .xl-rz { display: block; }
.xl-block .xl-rz:hover { background: var(--accent, #0078d4); }

.xl-block .xl-rz-nw { width: 11px; height: 11px; left: -6px;  top: -6px;    cursor: nwse-resize; }
.xl-block .xl-rz-ne { width: 11px; height: 11px; right: -6px; top: -6px;    cursor: nesw-resize; }
.xl-block .xl-rz-se { width: 11px; height: 11px; right: -6px; bottom: -6px; cursor: nwse-resize; }
.xl-block .xl-rz-sw { width: 11px; height: 11px; left: -6px;  bottom: -6px; cursor: nesw-resize; }
.xl-block .xl-rz-n  { width: 15px; height: 9px;  left: 50%; top: -6px;      margin-left: -7px; cursor: ns-resize; }
.xl-block .xl-rz-s  { width: 15px; height: 9px;  left: 50%; bottom: -6px;   margin-left: -7px; cursor: ns-resize; }
.xl-block .xl-rz-w  { width: 9px;  height: 15px; top: 50%;  left: -6px;     margin-top: -7px;  cursor: ew-resize; }
.xl-block .xl-rz-e  { width: 9px;  height: 15px; top: 50%;  right: -6px;    margin-top: -7px;  cursor: ew-resize; }

/* 拖拽中：禁止选中文字，并让 iframe/video 交还指针事件（否则划过播放器会丢事件） */
body.xl-resizing { user-select: none; -webkit-user-select: none; }
body.xl-resizing iframe,
body.xl-resizing video { pointer-events: none; }

/* 拖拽时跟随鼠标的「宽 × 高」气泡 */
.xl-size-badge {
  position: fixed; z-index: 1400;
  display: none;
  background: rgba(28, 39, 51, 0.94); color: #fff;
  font-size: 0.72rem; line-height: 1;
  padding: 5px 9px; border-radius: 6px;
  pointer-events: none; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.xl-size-badge.show { display: block; }

/* 编辑模式：插入来源选择弹窗（本地文件 / 用链接） */
.xl-insert-modal {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.45);
}
.xl-insert-box {
  background: #fff; color: #1c2733;
  border-radius: 14px; padding: 18px;
  width: min(320px, 86vw);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  display: flex; flex-direction: column; gap: 10px;
}
.xl-insert-title { font-weight: 700; font-size: 1rem; margin-bottom: 4px; text-align: center; }
.xl-insert-opt {
  padding: 11px 14px; border: 1px solid #d7deea; border-radius: 10px;
  background: #f5f8fc; color: #1c2733; font-size: 0.95rem; cursor: pointer; text-align: center;
}
.xl-insert-opt:hover { background: #eaf2fc; }
.xl-insert-cancel { background: #f0f0f0; border-color: #ddd; }
html[data-theme="dark"] .xl-insert-box { background: #1e2733; color: #e6edf5; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6); }
html[data-theme="dark"] .xl-insert-opt { background: #26313f; color: #e6edf5; border-color: #34425a; }
html[data-theme="dark"] .xl-insert-opt:hover { background: #2f3c4d; }
html[data-theme="dark"] .xl-insert-cancel { background: #2a2a2a; border-color: #444; }

.xl-toast {
  position: fixed;
  left: 50%; bottom: 80px;
  transform: translate(-50%, 12px);
  z-index: 1300;
  background: #1c2733;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.xl-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== 页间导航加载动画（common.js 注入 DOM，这里只负责样式） ===== */
/* 用 .xl-nav 作用域，避免覆盖上面的「终末地」入场动画（.xl-loader 共用类） */
.xl-loader.xl-nav {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(0);
  transition: transform 0.55s cubic-bezier(.55, .06, .68, .19), opacity 0.35s ease;
}
/* 顶部蓝色长条：0 120 212 实色起头，向下过渡到白色背景 */
.xl-loader.xl-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: clamp(170px, 32vh, 340px);
  background: linear-gradient(180deg,
    rgb(0, 120, 212) 0%,
    rgb(0, 120, 212) 20%,
    rgba(0, 120, 212, 0.80) 48%,
    rgba(0, 120, 212, 0.38) 74%,
    rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}
/* 进度条到达 100% 后整屏上滑收场 */
.xl-loader.xl-nav.xl-hidden { transform: translateY(-100%); opacity: 0; pointer-events: none; }
.xl-loader.xl-nav .xl-loader-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
/* 「正在加载资源」放大铺满视觉中心 */
.xl-loader.xl-nav .xl-loader-text {
  font-size: clamp(2.2rem, 11vw, 5rem);
  font-weight: 800;
  color: #1c2733;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-align: center;
}
.xl-loader.xl-nav .xl-loader-pct {
  font-size: 1rem;
  font-weight: 700;
  color: #0078d4;
}
.xl-loader.xl-nav .xl-loader-bar {
  width: min(320px, 72vw);
  height: 8px;
  background: #e6ebf2;
  border-radius: 999px;
  overflow: hidden;
}
.xl-loader.xl-nav .xl-loader-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0078d4, #28599c);
  border-radius: 999px;
  transition: width 0.18s ease;
}

/* ================================================================
   Fluent 2 / Microsoft 365 输入控件层
   覆盖对象：所有「用户可输入」的功能 ——
     发帖 / 评论 / 留言板 / 联系表单 / 订阅 / 搜索 /
     通知与私信 / 个人资料 / 设置 / 产品页评论 / 管理后台 / 首页弹窗
   实现前提：全站都是「先内联 <style>、后 link common.css」，
     同级选择器由 common.css 胜出；这里再统一加 body / main / button
     前缀，确保压得过 `.modal .edit-input`、`.modal-actions .primary`、
     `.editor-toolbar .rt-btn` 这类复合选择器。
   只改外观（描边/圆角/内距/字号/焦点环/主次按钮配色），
     不改宽度、外边距与栅格，避免打乱各页既有布局。
   破坏性按钮（.del / .danger-btn / .tool-btn.danger / .btn.danger /
     .custom-del / .act.del）保持各页原有的红系样式，不做改动。
   ================================================================ */

/* ---------- 1. 文本类输入框：输入框 / 多行框 / 下拉 ---------- */
body .edit-input,
body .edit-textarea,
body .modal .edit-input,
body .modal .edit-textarea,
body .rename-editor .edit-input,
body .skills-add .edit-input,
body .theme-row .edit-input,
body .gb-input,
body .gb-textarea,
body .c-input,
body .contact-form textarea.c-input,
body .sub-input,
body .feed-url,
body .search-input,
body .home-search-input,
body .prio-sel,
body .card input:not([class]):not([type="hidden"]),
body .card select,
body .card textarea,
body main input[type="text"]:not([class]),
body main input[type="search"]:not([class]),
body main input[type="email"]:not([class]),
body main input[type="password"]:not([class]),
body main input[type="number"]:not([class]),
body main select:not([class]),
body main textarea:not([class]) {
  border: 1px solid #d1d1d1;
  border-radius: 4px;
  background: var(--card-bg, #fff);
  color: var(--text, #242424);
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  line-height: 1.5;
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
body .edit-input::placeholder,
body .edit-textarea::placeholder,
body .gb-input::placeholder,
body .gb-textarea::placeholder,
body .c-input::placeholder,
body .sub-input::placeholder,
body .search-input::placeholder,
body .home-search-input::placeholder { color: #a19f9d; }

/* 焦点：Fluent 2 的 1px 强调色描边（比原来的 3px 光晕更克制） */
body .edit-input:focus,
body .edit-textarea:focus,
body .modal .edit-input:focus,
body .modal .edit-textarea:focus,
body .rename-editor .edit-input:focus,
body .skills-add .edit-input:focus,
body .theme-row .edit-input:focus,
body .gb-input:focus,
body .gb-textarea:focus,
body .c-input:focus,
body .contact-form textarea.c-input:focus,
body .sub-input:focus,
body .feed-url:focus,
body .search-input:focus,
body .home-search-input:focus,
body .prio-sel:focus,
body .card input:not([class]):focus,
body .card select:focus,
body .card textarea:focus,
body main input[type="text"]:not([class]):focus,
body main select:not([class]):focus,
body main textarea:not([class]):focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

/* 禁用态 */
body .edit-input:disabled,
body .edit-textarea:disabled,
body .sub-input:disabled,
body .prio-sel:disabled {
  background: #f3f2f1;
  color: #a19f9d;
  cursor: not-allowed;
}

/* ---------- 2. 字段标签与字数统计 ---------- */
body .edit-label,
body .modal .edit-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #424242;
  margin-top: 12px;
  margin-bottom: 4px;
}
body .char-count {
  display: block;
  text-align: right;
  font-size: 11.5px;
  color: #8a8886;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
body .edit-note,
body .hint,
body .topic-tip { font-size: 12.5px; line-height: 1.7; }

/* ---------- 3. 主按钮（实心强调色） ---------- */
body button.post-btn:not(.secondary):not(.danger),
body button.btn.primary,
body button.primary,
body .modal-actions button.primary,
body .contact-form button.btn,
body button.gb-submit,
body button.sub-btn,
body button.search-btn,
body button.home-search-btn,
body button.save,
body button.save-btn,
body button.send,
body button.refresh-btn,
body button.custom-save,
body button.theme-save,
body button.bg-save {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  padding: 7px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  filter: none;
  transition: background .12s ease, border-color .12s ease;
}
body button.post-btn:not(.secondary):not(.danger):hover,
body button.btn.primary:hover,
body button.primary:hover,
body .modal-actions button.primary:hover,
body .contact-form button.btn:hover,
body button.gb-submit:hover,
body button.sub-btn:hover,
body button.search-btn:hover,
body button.home-search-btn:hover,
body button.save:hover,
body button.save-btn:hover,
body button.send:hover,
body button.refresh-btn:hover,
body button.custom-save:hover,
body button.theme-save:hover,
body button.bg-save:hover {
  background: color-mix(in srgb, var(--accent) 86%, #000);
  border-color: color-mix(in srgb, var(--accent) 86%, #000);
  filter: none;
}
body button.post-btn:disabled,
body button.save:disabled,
body button.gb-submit:disabled,
body button.sub-btn:disabled,
body button.search-btn:disabled,
body button.custom-save:disabled {
  opacity: .5;
  cursor: default;
  filter: none;
}

/* ---------- 4. 次按钮（白底 / 描边灰） ---------- */
body button.post-btn.secondary,
body button.cancel,
body button.custom-cancel,
body button.theme-cancel,
body button.bg-cancel,
body button.modal-close,
body button.back-btn,
body button.secondary,
body .modal-actions button.secondary,
body button.btn:not(.primary):not(.danger),
body .change-btn,
body .bg-btn,
body .copy-btn,
body .tf-clear,
body .theme-clear,
body .bg-clear,
body .edit-feature-btn,
body button.pa-btn,
body button.act.reply {
  border: 1px solid #d1d1d1;
  background: var(--card-bg, #fff);
  color: #242424;
  border-radius: 4px;
  padding: 7px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  filter: none;
  transition: background .12s ease, border-color .12s ease;
}
body button.post-btn.secondary:hover,
body button.cancel:hover,
body button.custom-cancel:hover,
body button.theme-cancel:hover,
body button.bg-cancel:hover,
body button.modal-close:hover,
body button.back-btn:hover,
body .modal-actions button.secondary:hover,
body button.btn:not(.primary):not(.danger):hover,
body .change-btn:hover,
body .bg-btn:hover,
body .copy-btn:hover,
body .tf-clear:hover,
body .theme-clear:hover,
body .bg-clear:hover,
body .edit-feature-btn:hover,
body button.pa-btn:hover,
body button.act.reply:hover {
  background: #f3f2f1;
  border-color: #c7c7c7;
  filter: none;
}

/* ---------- 5. 工具型小按钮（工具栏 / 附件） ---------- */
body button.tool-btn,
body button.attach-btn {
  border: 1px solid #d1d1d1;
  background: var(--card-bg, #fff);
  color: #242424;
  border-radius: 4px;
  padding: 5px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
body button.tool-btn:hover,
body button.attach-btn:hover { background: #f3f2f1; border-color: #c7c7c7; }

/* 新增类动作（虚线框） */
body button.add-btn,
body button.custom-add-btn,
body button.poll-add-btn,
body button.att-add-btn {
  border: 1px dashed #d1d1d1;
  background: var(--card-bg, #fff);
  color: #616161;
  border-radius: 4px;
  padding: 9px 14px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
body button.add-btn:hover,
body button.custom-add-btn:hover,
body button.poll-add-btn:hover,
body button.att-add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--card-bg, #fff));
}

/* ---------- 6. 发帖富文本编辑器（Ribbon-lite） ---------- */
body .editor-wrap {
  border: 1px solid #d1d1d1;
  border-radius: 4px;
  background: var(--card-bg, #fff);
}
body .editor-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
body .editor-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
  padding: 4px 6px;
  background: #faf9f8;
  border-bottom: 1px solid #e0e0e0;
}
body .editor-toolbar .rt-btn,
body .editor-toolbar select,
body .editor-toolbar input[type="color"] {
  height: 28px; min-width: 28px;
  border: 1px solid transparent;
  background: transparent;
  color: #242424;
  border-radius: 4px;
  font-size: 13px; line-height: 1;
  padding: 0 7px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
body .editor-toolbar .rt-btn:hover,
body .editor-toolbar select:hover { background: #f0f0f0; }
body .editor-toolbar .rt-btn.on {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 42%, transparent);
  border-color: transparent;
}
body .editor-toolbar select {
  border-color: #d1d1d1;
  background: #fff;
  padding: 0 4px;
}
body .editor-toolbar input[type="color"] { padding: 2px; width: 30px; border-color: #d1d1d1; background: #fff; }
body .editor-toolbar .tb-sep { width: 1px; height: 18px; background: #e0e0e0; margin: 0 4px; }
body .editor {
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.7;
}

/* ---------- 7. 附件列表 ---------- */
body .att-item {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: var(--card-bg, #fff);
  padding: 7px 9px;
}
body .att-thumb { border-radius: 4px; }
body .att-remove { border-radius: 4px; }
body .att-name { font-size: 13px; }
body .att-sub { font-size: 11.5px; color: #8a8886; }

/* ---------- 8. 选择类控件（勾选 / 单选 / 滑块 / 取色） ---------- */
body input[type="checkbox"],
body input[type="radio"] {
  accent-color: var(--accent);
  width: 15px; height: 15px;
  vertical-align: -2px;
  cursor: pointer;
}
body input[type="range"] { accent-color: var(--accent); cursor: pointer; }
body input[type="color"] {
  width: 32px; height: 32px; padding: 2px;
  border: 1px solid #d1d1d1; border-radius: 4px;
  background: var(--card-bg, #fff);
  cursor: pointer;
}

/* ---------- 9. 深色主题 ---------- */
html[data-theme="dark"] body .edit-input,
html[data-theme="dark"] body .edit-textarea,
html[data-theme="dark"] body .modal .edit-input,
html[data-theme="dark"] body .modal .edit-textarea,
html[data-theme="dark"] body .rename-editor .edit-input,
html[data-theme="dark"] body .skills-add .edit-input,
html[data-theme="dark"] body .theme-row .edit-input,
html[data-theme="dark"] body .gb-input,
html[data-theme="dark"] body .gb-textarea,
html[data-theme="dark"] body .c-input,
html[data-theme="dark"] body .contact-form textarea.c-input,
html[data-theme="dark"] body .sub-input,
html[data-theme="dark"] body .feed-url,
html[data-theme="dark"] body .search-input,
html[data-theme="dark"] body .home-search-input,
html[data-theme="dark"] body .prio-sel,
html[data-theme="dark"] body .card input:not([class]):not([type="hidden"]),
html[data-theme="dark"] body .card select,
html[data-theme="dark"] body .card textarea,
html[data-theme="dark"] body main input[type="text"]:not([class]),
html[data-theme="dark"] body main input[type="search"]:not([class]),
html[data-theme="dark"] body main input[type="email"]:not([class]),
html[data-theme="dark"] body main select:not([class]),
html[data-theme="dark"] body main textarea:not([class]) {
  border-color: #484644;
  background: #1b1a19;
  color: #f3f2f1;
}
html[data-theme="dark"] body .edit-input:disabled,
html[data-theme="dark"] body .edit-textarea:disabled { background: #292827; color: #8a8886; }
html[data-theme="dark"] body .edit-label,
html[data-theme="dark"] body .modal .edit-label { color: #c8c6c4; }
html[data-theme="dark"] body button.post-btn.secondary,
html[data-theme="dark"] body button.cancel,
html[data-theme="dark"] body button.custom-cancel,
html[data-theme="dark"] body button.theme-cancel,
html[data-theme="dark"] body button.bg-cancel,
html[data-theme="dark"] body button.modal-close,
html[data-theme="dark"] body button.back-btn,
html[data-theme="dark"] body button.secondary,
html[data-theme="dark"] body .modal-actions button.secondary,
html[data-theme="dark"] body button.btn:not(.primary):not(.danger),
html[data-theme="dark"] body .change-btn,
html[data-theme="dark"] body .bg-btn,
html[data-theme="dark"] body .copy-btn,
html[data-theme="dark"] body .tf-clear,
html[data-theme="dark"] body .theme-clear,
html[data-theme="dark"] body .bg-clear,
html[data-theme="dark"] body .edit-feature-btn,
html[data-theme="dark"] body button.pa-btn,
html[data-theme="dark"] body button.act.reply,
html[data-theme="dark"] body button.tool-btn,
html[data-theme="dark"] body button.attach-btn {
  background: #252423;
  color: #f3f2f1;
  border-color: #484644;
}
html[data-theme="dark"] body button.post-btn.secondary:hover,
html[data-theme="dark"] body button.cancel:hover,
html[data-theme="dark"] body button.custom-cancel:hover,
html[data-theme="dark"] body button.theme-cancel:hover,
html[data-theme="dark"] body button.bg-cancel:hover,
html[data-theme="dark"] body button.back-btn:hover,
html[data-theme="dark"] body .modal-actions button.secondary:hover,
html[data-theme="dark"] body button.btn:not(.primary):not(.danger):hover,
html[data-theme="dark"] body .change-btn:hover,
html[data-theme="dark"] body .bg-btn:hover,
html[data-theme="dark"] body .copy-btn:hover,
html[data-theme="dark"] body .tf-clear:hover,
html[data-theme="dark"] body .theme-clear:hover,
html[data-theme="dark"] body .bg-clear:hover,
html[data-theme="dark"] body .edit-feature-btn:hover,
html[data-theme="dark"] body button.pa-btn:hover,
html[data-theme="dark"] body button.act.reply:hover,
html[data-theme="dark"] body button.tool-btn:hover,
html[data-theme="dark"] body button.attach-btn:hover { background: #333231; border-color: #5c5a58; }
html[data-theme="dark"] body button.add-btn,
html[data-theme="dark"] body button.custom-add-btn,
html[data-theme="dark"] body button.poll-add-btn,
html[data-theme="dark"] body button.att-add-btn {
  border-color: #484644; background: #252423; color: #c8c6c4;
}
html[data-theme="dark"] body .editor-wrap { border-color: #484644; }
html[data-theme="dark"] body .editor-toolbar { background: #1b1a19; border-bottom-color: #3b3a39; }
html[data-theme="dark"] body .editor-toolbar .rt-btn,
html[data-theme="dark"] body .editor-toolbar input[type="color"] { color: #f3f2f1; }
html[data-theme="dark"] body .editor-toolbar .rt-btn:hover,
html[data-theme="dark"] body .editor-toolbar select:hover { background: #333231; }
html[data-theme="dark"] body .editor-toolbar select { background: #252423; color: #f3f2f1; border-color: #484644; }
html[data-theme="dark"] body .editor-toolbar .tb-sep { background: #3b3a39; }
html[data-theme="dark"] body .att-item { border-color: #3b3a39; }
html[data-theme="dark"] body input[type="color"] { border-color: #484644; }


/* ===== M365 扩展：按钮图标 / 符号面板 / 标尺（editbar 20260926k） ===== */
.xl-tb-btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 46px; line-height: 1.15; }
.xl-tb-ico { display: inline-flex; }
.xl-tb-ico svg { display: block; }
.xl-tb-txt { font-size: 11px; white-space: nowrap; }
.xl-sym-mask { position: fixed; inset: 0; background: rgba(0,0,0,.28); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.xl-sym-panel { background: var(--card-bg,#fff); color: var(--text,#222); border-radius: 12px; padding: 14px; width: min(420px, 92vw); box-shadow: 0 12px 40px rgba(0,0,0,.28); }
.xl-sym-title { font-weight: 700; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.xl-sym-close { border: none; background: rgba(127,127,127,.15); border-radius: 6px; width: 26px; height: 26px; cursor: pointer; }
.xl-sym-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.xl-sym-cell { border: 1px solid var(--card-border,#e2e6ee); background: transparent; border-radius: 6px; height: 34px; font-size: 16px; cursor: pointer; }
.xl-sym-cell:hover { background: rgba(127,127,127,.12); }
body.xl-show-ruler::after { content: ""; position: fixed; top: 0; left: 0; right: 0; height: 18px; background: repeating-linear-gradient(90deg, #b9bdc7 0 1px, transparent 1px 40px); border-bottom: 1px solid #9aa0ab; z-index: 300; pointer-events: none; }

/* ===== M365 Home 扩展（editbar 20260926l） ===== */
/* 快速访问工具栏（Undo/Redo） */
.xl-edit-banner .xl-edit-qa .xl-tb-btn { padding: 4px 6px; min-width: 22px; }

/* 大粘贴按钮（Word 剪贴板组左侧大按钮） */
.xl-edit-banner .xl-tb-paste-wrap { position: relative; display: inline-flex; flex-direction: column; }
.xl-edit-banner .xl-tb-paste-btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 46px; min-height: 44px; padding: 4px 8px;
  border: 1px solid transparent; border-radius: 4px;
  background: transparent; color: #242424; cursor: pointer; font-family: inherit;
}
.xl-edit-banner .xl-tb-paste-btn:hover { background: #f0f0f0; }
.xl-edit-banner .xl-tb-paste-ico { font-size: 18px; line-height: 1; }
.xl-edit-banner .xl-tb-paste-label { font-size: 11px; margin-top: 2px; }
.xl-edit-banner .xl-tb-paste-menu {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 1260;
  background: var(--card-bg, #fff); color: var(--text, #1c2733);
  border: 1px solid var(--card-border, #e0e0e0); border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18); min-width: 160px; padding: 4px;
}
.xl-edit-banner .xl-tb-paste-menu.open { display: block; }

/* 显示/隐藏编辑标记 */
.xl-show-marks br::after { content: '¶'; color: var(--accent); opacity: .5; }
.xl-show-marks p::after { content: '¶'; color: var(--accent); opacity: .5; }

/* 深色主题 */
html[data-theme="dark"] .xl-edit-banner .xl-tb-paste-btn { color: #f3f2f1; }
html[data-theme="dark"] .xl-edit-banner .xl-tb-paste-btn:hover { background: #333231; }

/* ===== M365 Home 扩展 20260926m：增大/减小字号按钮 ===== */
.xl-edit-banner .xl-tb-fs-btn {
  padding: 3px 6px; min-width: 24px; font-size: 13px; font-weight: 600;
}

/* ===== M365 Home 扩展 20260926n：剪贴板/字体/段落/样式/迷你工具栏 ===== */
.xl-edit-banner .xl-clip-row { display: flex; align-items: stretch; gap: 4px; }
.xl-edit-banner .xl-tb-paste-right { display: flex; flex-direction: column; justify-content: space-between; gap: 2px; }
.xl-edit-banner .xl-tb-paste-right .xl-tb-btn { padding: 2px 6px; font-size: 12px; min-height: 0; text-align: left; }
.xl-edit-banner .xl-tb-clear-btn { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 1px solid transparent; border-radius: 4px; background: transparent; color: #242424; cursor: pointer; }
.xl-edit-banner .xl-tb-clear-btn:hover { background: #f0f0f0; }
.xl-edit-banner .xl-tb-clear-ico { font-size: 14px; line-height: 1; }
.xl-edit-banner .xl-style-gallery .xl-rbn-row { gap: 4px; }
.xl-edit-banner .xl-style-item { min-width: 64px; padding: 5px 8px; border: 1px solid #e0e0e0; background: #fff; font-size: 12.5px; text-align: left; }
.xl-edit-banner .xl-style-item:hover { background: #f8f8f8; border-color: #c8c8c8; }
.xl-edit-banner .xl-style-head { font-size: 14px; font-weight: 700; color: #7b68ee; border-color: #d6d0f5; }
.xl-mini-toolbar.open { display: flex; flex-direction: column; gap: 3px; }
.xl-mini-toolbar .xl-mini-row { display: flex; align-items: center; gap: 2px; }
.xl-mini-toolbar .xl-mini-select,
.xl-mini-toolbar .xl-mini-size { font-family: inherit; font-size: 12px; border: 1px solid #d1d1d1; background: #fff; color: #242424; border-radius: 4px; padding: 3px 5px; height: 26px; }
.xl-mini-toolbar .xl-mini-select { padding-right: 2px; min-width: 58px; }
.xl-mini-toolbar .xl-mini-size { width: 42px; }
.xl-mini-toolbar .xl-mini-fs { padding: 3px 5px; min-width: 22px; font-weight: 600; }
.xl-mini-toolbar .xl-mini-list { padding: 3px 6px; min-width: 22px; }
.xl-mini-toolbar .xl-mini-style,
.xl-mini-toolbar .xl-mini-comment,
.xl-mini-toolbar .xl-mini-painter,
.xl-mini-toolbar .xl-mini-clear { padding: 3px 6px; min-width: 22px; font-size: 12px; }
html[data-theme="dark"] .xl-edit-banner .xl-tb-clear-btn { color: #f3f2f1; }
html[data-theme="dark"] .xl-edit-banner .xl-tb-clear-btn:hover { background: #333231; }
html[data-theme="dark"] .xl-edit-banner .xl-style-item { background: #252423; border-color: #3b3a39; color: #f3f2f1; }
html[data-theme="dark"] .xl-edit-banner .xl-style-item:hover { background: #333231; border-color: #484644; }
html[data-theme="dark"] .xl-edit-banner .xl-style-head { color: #c6b8ff; border-color: #5a4e8a; }
html[data-theme="dark"] .xl-mini-toolbar .xl-mini-select,
html[data-theme="dark"] .xl-mini-toolbar .xl-mini-size { background: #1b1a19; color: #f3f2f1; border-color: #484644; }

/* ===== 双语翻译确认弹窗（v20260928-02） ===== */
.xl-tr-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100000; display: flex; align-items: center; justify-content: center; }
.xl-tr-box { background: var(--card,#fff); color: var(--text,#1f2329); border-radius: 12px; width: min(640px, 92vw); max-height: 80vh; display: flex; flex-direction: column; padding: 18px 20px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.xl-tr-box h3 { margin: 0 0 6px; font-size: 16px; }
.xl-tr-hint { margin: 0 0 10px; font-size: 12px; opacity: .7; }
.xl-tr-list { overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 12px; }
.xl-tr-item { border: 1px solid rgba(128,128,128,.25); border-radius: 8px; padding: 8px 10px; }
.xl-tr-lab { font-size: 11px; font-weight: 600; opacity: .65; margin-bottom: 4px; }
.xl-tr-src { font-size: 13px; margin-bottom: 6px; opacity: .85; word-break: break-word; }
.xl-tr-ta { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; border-radius: 6px; border: 1px solid rgba(128,128,128,.4); padding: 6px 8px; resize: vertical; background: transparent; color: inherit; }
.xl-tr-acts { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.xl-tr-acts button { font: inherit; font-size: 13px; padding: 7px 16px; border-radius: 8px; border: 1px solid rgba(128,128,128,.4); background: transparent; color: inherit; cursor: pointer; }
.xl-tr-acts .xl-tr-ok { background: #28599c; border-color: #28599c; color: #fff; }
