/**
 * 四季粒子背景：画布层 + 顶栏「粒子效果」下拉
 * 与 scripts/particle-background.js 中的 class 名一致
 */

.particle-bg-root {
  transition: opacity 0.42s ease;
}

.particle-bg-root.is-disabled {
  opacity: 0;
  pointer-events: none;
}

.particle-bg--fade {
  opacity: 0.35;
}

#particle-bg-canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* —— 顶栏粒子控制（插入 .particle-fx-slot）—— */
.particle-fx-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.particle-fx-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 9.5rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
  line-height: 1.2;
  font-weight: 500;
  color: rgb(51 65 85);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.dark .particle-fx-trigger {
  color: rgb(226 232 240);
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.28);
}

.particle-fx-trigger:hover {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(22, 93, 255, 0.35);
  box-shadow: 0 1px 8px rgba(22, 93, 255, 0.12);
}

.dark .particle-fx-trigger:hover {
  background: rgba(30, 41, 59, 0.75);
  border-color: rgba(96, 165, 250, 0.35);
}

.particle-fx-trigger-title {
  flex-shrink: 0;
  white-space: nowrap;
}

.particle-fx-trigger-current {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  font-weight: 600;
  color: rgb(22, 93, 255);
}

.dark .particle-fx-trigger-current {
  color: rgb(96, 165, 250);
}

.particle-fx-trigger-chevron {
  flex-shrink: 0;
  font-size: 0.65rem;
  opacity: 0.75;
}

.particle-fx-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 70;
  min-width: 12rem;
  padding: 0.35rem 0;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 0.75rem;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.12);
}

.dark .particle-fx-menu {
  background: rgba(30, 41, 59, 0.98);
  border-color: rgba(51, 65, 85, 0.9);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.particle-fx-menu-hint {
  padding: 0.4rem 0.85rem 0.5rem;
  font-size: 0.7rem;
  line-height: 1.35;
  color: rgb(100 116 139);
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
}

.dark .particle-fx-menu-hint {
  color: rgb(148 163 184);
  border-bottom-color: rgba(51, 65, 85, 0.85);
}

.particle-fx-menu-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.85rem;
  font-size: 0.8rem;
  text-align: left;
  color: rgb(51 65 85);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.dark .particle-fx-menu-item {
  color: rgb(226 232 240);
}

.particle-fx-menu-item:hover,
.particle-fx-menu-item:focus-visible {
  background: rgba(22, 93, 255, 0.08);
  outline: none;
}

.dark .particle-fx-menu-item:hover,
.dark .particle-fx-menu-item:focus-visible {
  background: rgba(96, 165, 250, 0.12);
}

.particle-fx-menu-item[aria-current='true'] {
  font-weight: 600;
  color: rgb(22, 93, 255);
  background: rgba(22, 93, 255, 0.06);
}

.dark .particle-fx-menu-item[aria-current='true'] {
  color: rgb(96, 165, 250);
  background: rgba(96, 165, 250, 0.1);
}

.particle-fx-wrap.is-open .particle-fx-trigger {
  border-color: rgba(22, 93, 255, 0.45);
}

.dark .particle-fx-wrap.is-open .particle-fx-trigger {
  border-color: rgba(96, 165, 250, 0.45);
}

@media (max-width: 768px) {
  .particle-fx-trigger {
    max-width: 6.5rem;
    padding: 0.3rem 0.45rem;
    font-size: 0.7rem;
  }
  .particle-fx-menu {
    right: auto;
    left: 0;
    min-width: 11rem;
  }
}
