/* Mathematica 12 网页复刻 · 菜单栏与下拉菜单（menu.css）
 * 真机：菜单栏白底 18px + 2px #F0F0F0 分隔；菜单项文本起点 x=8，节距约 58px，
 * 蓝色小写助记符 (F)/(E)/...；下拉菜单浅灰描边、白底、13px 行高约 22px，分隔线 #E8E8E8。
 * 真机来源：docs/reference/surfaces/menu-*.png（2026-11-19 采）。
 */

.menubar {
  display: flex;
  align-items: stretch;
  flex: 0 0 auto;
  height: calc(var(--menubar-h) + var(--menubar-border-h));
  background: var(--menubar-bg);
  border-bottom: var(--menubar-border-h) solid var(--menubar-border);
  padding: 0;
  user-select: none;
  overflow: hidden;
  white-space: nowrap;
}

.menu-btn {
  display: inline-flex;
  align-items: center;
  height: var(--menubar-h);
  padding: 0 7px 0 8px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 13px/1 var(--ui-font);
  cursor: default;
  white-space: nowrap;
}
.menu-btn:hover { background: var(--hover); }
.menu-btn[aria-expanded="true"] { background: #cfe4f7; }

.menu-label { font-size: 13px; }
.menu-mnemonic { color: #6b6b6b; font-size: 13px; margin-left: 1px; }

.menu-layer {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
}
.menu-layer[hidden] { display: none; }

.menu-panel {
  position: absolute;
  min-width: 196px;
  max-width: 460px;
  padding: 3px 0;
  background: #ffffff;
  border: 1px solid #b8b8b8;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.18);
  font: 12px/1.35 var(--ui-font);
  color: #000000;
  pointer-events: auto;
  user-select: none;
}

.menu-item {
  display: flex;
  align-items: center;
  height: 22px;
  padding: 0 22px 0 24px;
  position: relative;
  white-space: nowrap;
  cursor: default;
}
.menu-item[data-disabled="true"] { color: #9a9a9a; }
.menu-item:not([data-disabled="true"]):hover { background: #cfe4f7; }
.menu-item .item-label { flex: 1 1 auto; }
.menu-item .item-shortcut {
  flex: 0 0 auto;
  margin-left: 32px;
  color: #4a4a4a;
  font-size: 12px;
}
.menu-item[data-disabled="true"] .item-shortcut { color: #ababab; }
.menu-item .item-check {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #000000;
}
.menu-item .item-arrow {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: #4a4a4a;
}
.menu-item.has-submenu::after { content: none; }

.menu-separator {
  height: 1px;
  margin: 4px 0;
  background: #e8e8e8;
}
