/*
 * PaperBanana - AI 创作平台
 * 公共样式文件
 */

/* 字体设置 */
body {
  font-family: 'Inter', sans-serif;
}

/* 隐藏主滚动条 */
body::-webkit-scrollbar {
  display: none;
}
body {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* 主内容区域滚动条 */
main > div::-webkit-scrollbar {
  width: 0;
  display: none;
}
main > div {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* 分类按钮选中状态 */
#categoryContainer button.category-btn {
  outline: none !important;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s ease;
}

/* 选中状态 */
#categoryContainer button.category-btn.active {
  background-color: #111827 !important;
  color: white !important;
  border: none !important;
}

/* 默认未选中状态 */
#categoryContainer button.category-btn:not(.active) {
  background-color: white !important;
  color: #4B5563 !important;
  border: 1px solid #f5f5f5 !important;
}

#categoryContainer button.category-btn:not(.active):hover {
  background-color: #F9FAFB !important;
}

/* 选中时的焦点效果 */
#categoryContainer button.category-btn.active:focus {
  outline: 2px solid #FECF09 !important;
  outline-offset: 2px;
}

/* 自定义滚动条 */
.custom-scroll::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
.custom-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scroll::-webkit-scrollbar-thumb {
  background: #E5E5E5;
  border-radius: 4px;
}
.custom-scroll:hover::-webkit-scrollbar-thumb {
  background: #D4D4D4;
}

/* 隐藏滚动条 */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* 动画效果 */
.fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

.slide-up {
  animation: slideUp 0.5s ease-out forwards;
  opacity: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.delay-100 {
  animation-delay: 100ms;
}

.delay-200 {
  animation-delay: 200ms;
}

/* Range Input 样式 */
input[type="range"] {
  -webkit-appearance: none;
  background: transparent;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #FECF09;
  cursor: pointer;
  margin-top: -6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: #E5E5E5;
  border-radius: 2px;
}

/* 页面切换控制 */
.page-section {
  display: none;
}

.page-section.active {
  display: flex;
  animation: fadeIn 0.3s ease-out forwards;
}

/* 侧边栏收缩样式 - 需要在 index.html 中添加 sidebar-collapsed 类 */
.sidebar-collapsed #mainSidebar {
  width: 64px !important;
}

.sidebar-collapsed #mainSidebar .hide-on-collapse {
  display: none !important;
}

.sidebar-collapsed #mainSidebar .logo-text {
  display: none !important;
}

.sidebar-collapsed #mainSidebar .nav-item span:not(.icon-only) {
  display: none !important;
}

.sidebar-collapsed #mainSidebar .nav-item {
  justify-content: center !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.sidebar-collapsed #mainSidebar .user-widget {
  padding: 8px !important;
  justify-content: center !important;
}

.sidebar-collapsed #mainSidebar .user-info-mini {
  display: none !important;
}

/* 保护会员中心菜单不被收缩 */
.sidebar-collapsed #userMenuSidebar {
  width: 240px !important;
  flex-shrink: 0;
}

.sidebar-collapsed main {
  margin-left: 0 !important;
}
