/* 菜单容器样式 */
#fm-container {
  position: fixed;
  top: 10px;
  right: 10px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #6e8efb, #a777e3);
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease, opacity 0.5s ease;
  overflow: visible;
  user-select: none;
  opacity: 1;
}
/* 空闲状态样式 */
#fm-container.fm-idle {
  opacity: 0.3;
}
/* 激活状态样式（展开菜单） */
#fm-container.fm-active {
  width: 280px;
  border-radius: 25px;
  padding-bottom: 15px;
  background: linear-gradient(to bottom, #6e8efb, #a777e3) !important;
  opacity: 1 !important;
  height: auto;
}
/* 菜单内容区域样式 */
#fm-content {
  opacity: 0;
  max-height: 0;
  overflow: visible;
  transition: all 0.3s ease;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
  border-radius: inherit;
  pointer-events: none;
}
#fm-container.fm-active #fm-content {
  opacity: 1;
  max-height: 70vh;
  padding: 15px 0;
  pointer-events: auto;
}
/* 菜单项容器样式 */
#fm-menu-items {
  width: 100%;
  position: relative;
}
/* 菜单项基础样式 */
.fm-item {
  width: 100%;
  padding: 12px 25px;
  box-sizing: border-box;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
  text-align: center;
  background-color: transparent;
}
.fm-item:hover {
  background-color: rgba(255, 255, 255, 0.15);
}
/* 二级菜单样式 */
.fm-submenu {
  position: absolute;
  right: 30%;
  left: auto;
  top: 0;
  min-width: 220px;
  background: linear-gradient(135deg, #7a8efb, #b277e3);
  border-radius: 15px 0 15px 15px;
  box-shadow: -5px 5px 20px rgba(0,0,0,0.3);
  z-index: 1100;
  opacity: 0;
  transform: translateX(15px);
  transition: all 0.3s ease;
  max-height: 0;
  overflow: hidden;
  visibility: hidden;
}
.fm-submenu.show {
  opacity: 1;
  transform: translateX(0);
  max-height: 80vh;
  overflow-y: auto;
  visibility: visible;
}
/* 二级菜单项样式 */
.fm-submenu .fm-item {
  padding: 10px 20px;
  font-size: 14px;
  text-align: left;
}
/* 带二级菜单的菜单项样式 */
.fm-has-submenu {
  position: relative;
}
.fm-has-submenu::after {
  content: '<';
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.3s ease;
  font-size: 20px;
}
/* 带二级菜单的菜单项激活样式 */
.fm-has-submenu.open::after {
  transform: translateY(-50%) rotate(-90deg);
}
/* 搜索框样式 */
#fm-search {
  width: calc(100% - 60px);
  height: 36px;
  margin: 15px auto;
  padding: 8px 20px;
  border: 1px solid transparent;
  background: linear-gradient(white, white) padding-box, 
              linear-gradient(45deg, #ff7eb3, #65d9ff, #c7f464, #ff7eb3) border-box;
  border-radius: 20px;
  outline: none;
  display: block;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  font-size: 1em;
}
#fm-search:hover {
  background: linear-gradient(white, white) padding-box, 
              linear-gradient(135deg, #ff0076, #1eaeff, #28ffbf, #ff0076) border-box;
  box-shadow: 0 0 5px rgba(255, 0, 118, 0.5), 0 0 20px rgba(30, 174, 255, 0.5);
}
#fm-search:focus {
  background: linear-gradient(white, white) padding-box, 
              linear-gradient(45deg, #ff0076, #1eaeff, #28ffbf, #ff0076) border-box;
  box-shadow: 0 0 15px rgba(255, 0, 118, 0.7), 0 0 25px rgba(30, 174, 255, 0.7);
  color: #000;
}
#fm-search::placeholder {
  color: #aaa;
  font-style: italic;
}
/* 搜索建议框样式 */
#fm-search-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #eee;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
    font-size: 0.8em;
    color: #666;
    -webkit-overflow-scrolling: touch;
}
.fm-suggestion-item {
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.2s;
}
.fm-suggestion-item:hover {
    background-color: #f5f5f5;
}
/* 菜单切换按钮容器样式 */
#fm-toggle {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}
/* 汉堡菜单样式 */
.fm-hamburger {
  width: 30px;
  height: 3px;
  background: white;
  position: relative;
  transition: all 0.3s ease;
}
.fm-hamburger::before,
.fm-hamburger::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 3px;
  background: white;
  left: 0;
  transition: all 0.3s ease;
}
.fm-hamburger::before { top: -8px; }
.fm-hamburger::after { top: 8px; }
#fm-container.fm-active .fm-hamburger {
  background: transparent;
}
#fm-container.fm-active .fm-hamburger::before {
  transform: rotate(45deg);
  top: 0;
  width: 25px;
  left: 3px;
}
#fm-container.fm-active .fm-hamburger::after {
  transform: rotate(-45deg);
  top: 0;
  width: 25px;
  left: 3px;
}
/* X按钮样式（新增） */
.fm-close {
  position: absolute;
  top: 50%;
  left: 25px;
  transform: translateY(-50%);
  color: white;
  font-size: 24px;
  cursor: pointer;
  z-index: 3;
  display: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.fm-close:hover {
  opacity: 0.8;
}
#fm-container.fm-active .fm-close {
  opacity: 1;
  visibility: visible;
  display: block;
}
/* 二级菜单滚动条样式 */
.fm-submenu::-webkit-scrollbar {
  width: 6px;
}
.fm-submenu::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 3px;
}
/* 响应式适配（小屏幕设备） */
@media (max-width: 768px) {
  .fm-submenu {
    right: 10%;
    min-width: 180px;
  }
  
  .fm-item {
    padding: 12px 15px;
  }
  
  #fm-search {
    width: calc(100% - 40px);
    height: 32px;
    margin: 10px auto;
  }
}

.fm-hamburger {
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
#fm-container.fm-active .fm-hamburger {
  opacity: 0;
  visibility: hidden;
}