@font-face {
  font-family: "fusion-pixel";
  src: url("../font/fusion-pixel-12px-monospaced-zh_hans.ttf") format("truetype");
  font-display: swap;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-size: 14px;
  padding: 0;
  touch-action: none !important;
  margin: 0;
  font-family:
    /* "fusion-pixel", */
    "Microsoft YaHei",
    "PingFang SC",
    system-ui,
    -apple-system,
    sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: bold;
  margin-top: 0;
  margin-bottom: 0;
}

p {
  margin-top: 0;
  margin-bottom: 0;
}

button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  user-select: none;
  pointer-events: none;
}

canvas {
  image-rendering: pixelated;
  /* 核心：防止放大时模糊 */
  image-rendering: crisp-edges;
  touch-action: none;
}

.difference {
  mix-blend-mode: difference;
}

.custom_text-shadow {
  font-weight: bold;
  text-shadow:
    1px 1px 1.5px rgba(0, 0, 0, 0.5),
    1px -1px 1.5px rgba(0, 0, 0, 0.5),
    -1px 1px 1.5px rgba(0, 0, 0, 0.5),
    -1px -1px 1.5px rgba(0, 0, 0, 0.5);
}

.custom_left-line {
  position: relative;
}

.custom_left-line::before {
  content: "";
  position: absolute;
  left: 0;
  height: 90%;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  background-color: #ededed;
  border-radius: 4px;
}

/* 自定义滚动条 - 仅在电脑端生效 */
@media (hover: hover) and (pointer: fine) {
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }

  ::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
  }

  ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
  }
}

/* =============================================
   统一菜单样式 (PrimeVue Menu / ContextMenu)
   ============================================= */

/* 面板容器 */
.p-tieredmenu,
.p-contextmenu {
  padding: 4px 0 !important;
  min-width: 180px !important;
  border-radius: 6px !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* 分隔线 */
.p-tieredmenu .p-tieredmenu-separator,
.p-contextmenu .p-contextmenu-separator {
  margin: 4px 0 !important;
  border-color: #f3f4f6 !important;
}

/* 菜单项容器 */
.p-tieredmenu .p-tieredmenu-item,
.p-contextmenu .p-contextmenu-item {
  padding: 0 !important;
}

/* 禁用状态 */
.p-tieredmenu .p-tieredmenu-item.p-disabled .menu-item-row,
.p-contextmenu .p-contextmenu-item.p-disabled .menu-item-row {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* 内容区域 */
/* .p-tieredmenu .p-tieredmenu-item-content+ul{
  inset-inline-start: 102% !important;
} */
.p-tieredmenu .p-tieredmenu-item-content,
.p-contextmenu .p-contextmenu-item-content {
  padding: 0 !important;
  border-radius: 0 !important;
}

.p-tieredmenu .p-tieredmenu-item-content:hover,
.p-contextmenu .p-contextmenu-item-content:hover {
  background: #f3f4f6 !important;
}

.p-tieredmenu .p-tieredmenu-item-content:active,
.p-contextmenu .p-contextmenu-item-content:active {
  background: #e5e7eb !important;
}

/* 子菜单面板 */
.p-tieredmenu .p-tieredmenu-submenu,
.p-contextmenu .p-contextmenu-submenu {
  border-radius: 6px !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  padding: 4px 0 !important;
}

/* 通用菜单行布局 */
.menu-item-row {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0 12px;
  height: 32px;
  font-size: 13px;
  color: #374151;
  text-decoration: none;
  gap: 8px;
  box-sizing: border-box;
  cursor: pointer;
}

.menu-item-row.menu-item--danger {
  color: #ef4444;
}

/* 菜单图标 */
.menu-icon {
  width: 14px;
  height: 14px;
  opacity: 0.6;
  flex-shrink: 0;
}

/* 快捷键标签 */
.menu-shortcut {
  margin-left: auto;
  padding-left: 24px;
  font-size: 11px;
  color: #9ca3af;
  white-space: nowrap;
}

:root {
  --header-height: 40px;
}

/* =============================================
   Theme Transition Styles
   ============================================= */

/* Smooth transition for theme switching */
body {
  transition: background-color 200ms ease-out, color 200ms ease-out;
}

/* Suppress transitions during initial theme resolution */
.no-transition,
.no-transition * {
  transition: none !important;
}

/* Exclude canvas elements from theme transitions */
canvas {
  transition: none !important;
}

/* Respect user's reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  body {
    transition: none !important;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

.viewer-container {
  z-index: 999999 !important;
}

/* ─── 设置弹窗共享样式 ─────────────────────────────────────────── */
.settings-section-title {
  display: flex;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--theme-text-primary, #1a2535);
}

.settings-hint {
  margin-top: 2px;
  font-size: 12px;
  color: var(--theme-text-muted, #6b7280);
}

.settings-divider {
  height: 1px;
  width: 100%;
  background: var(--theme-border-light, #e5e7eb);
}

.settings-subgroup {
  position: relative;
}
.settings-subgroup::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--theme-border-light, #d1d5db);
  border-radius: 1px;
}

/* 像素显示（纹理图片） */
.pixel-rendering {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}