/* Scrollbar */
::-webkit-scrollbar-thumb {
  outline: none !important;
}

::-webkit-scrollbar-track {
  background-color: transparent !important;
}

::-webkit-scrollbar {
  width: 6px !important;
}

:root {
  --header-height: 40px; /* 顶部工具栏高度 */
  --dynamic-width: 165px;
  --padding-nav-link: 0.4rem 1rem;
  --font-size-nav-link: 0.8125rem;
  --width-thumbnail: 30px;
  --height-thumbnail: 30px;
  --pill-radius: 9999px; /* 选中态胶囊形（四角圆角） */
}

/* 所有按钮选中/激活态：四角圆角胶囊形 */
.btn,
.btn.active,
.btn:focus,
.btn-icon-only,
.sidebar-actions-row .btn-icon-only {
  border-radius: var(--pill-radius) !important;
}

.toast {
  max-width: 100% !important;
}

.toast.show {
  margin: auto;
}

small {
  font-size: 80% !important;
}

@media (max-width: 360px) {
  :root {
    --dynamic-width: 100px !important;
    --padding-nav-link: 0.85rem 1.5rem;
    --font-size-nav-link: 0.875rem;
    /* --padding-nav-link: 15px 20px 10px 20px; */
    /* --font-size-nav-link: 0.8rem; */
  }
  #notification,
  #settings,
  .favorite-icon-list,
  .index-icon-list,
  .item-size-list {
    display: none !important;
  }

  .input-with-icon-right {
    width: 100% !important;
    margin: 0 !important;
  }
}

@media (max-height: 360px) {
  :root {
    --header-height: 0px;
  }
  #breadcrumb,
  .modus-header,
  .sidebar,
  .context-menu,
  .custom-checkbox,
  .folder-info,
  .item-info {
    display: none !important;
  }

  .items-container {
    grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)) !important;
  }
}

@media (max-height: 90px) {
  :root {
    --width-thumbnail: 48px;
    --height-thumbnail: 48px;
  }
  #controlPanelModel,
  #controlPanelMaterial,
  .check-group,
  .favorite-icon,
  .index-icon {
    display: none !important;
  }

  .items-container {
    grid-template-columns: repeat(auto-fit, minmax(54px, 1fr)) !important;
  }

  .item-card {
    max-width: 54px !important;
  }
}

.modus-header {
  display: flex;
  align-items: center;
  height: 36px;
  margin-top: 4px;
  min-height: 36px;
  border: none;
}
.modus-header .nav,
.modus-header .d-flex {
  align-items: center;
}
.modus-header .mt-2 {
  margin-top: 0 !important;
}
.modus-header .btn-icon-only {
  padding: 0.25rem;
}

.modus-header .nav-item {
  display: flex;
  align-items: center;
}

/* 顶部工具栏搜索栏：胶囊形，放在模型按钮前 */
.header-search-pill-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-right: 0.5rem;
  flex-shrink: 0;
}
.header-search-pill {
  width: 90px;
  min-width: 50px;
  max-width: 150px;
  height: 24px;
  padding: 0 1.65rem 0 0.5rem;
  border: 1px solid #cbcdd6;
  border-radius: var(--pill-radius);
  font-size: 0.75rem;
  outline: none;
  background: #fff;
  transition: border-color 0.15s ease;
}
.header-search-pill::placeholder {
  color: #6c757d;
}
.header-search-pill:focus {
  border-color: #007ed1;
}
.header-search-pill-wrap .header-search-pill-icon {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  font-size: 0.9rem;
}
.header-search-pill-wrap .header-search-pill-icon:hover {
  color: #353a40;
}
.header-search-pill-wrap .header-search-pill-icon .modus-icons {
  font-size: 0.9rem;
}

.nav-tabs .nav-link {
  border-radius: var(--pill-radius) !important;
  border-bottom: none !important;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}

.nav-tabs .nav-link.active {
  border: 1px solid #e2e2e7;
  border-bottom: none !important;
  background-color: white;
  border-radius: var(--pill-radius) !important;
}

.custom-nav-tabs {
  flex: 1;
  width: 100%;
  border: none !important;
  margin-bottom: 1px !important;
  margin-left: 0.5rem !important;
}

.nav-tabs .custom-nav-link {
  padding: 0.3rem 0.75rem !important;
  font-size: var(--font-size-nav-link) !important;
  line-height: 1.25 !important;
  border: none !important;
  border-radius: var(--pill-radius) !important;
  min-height: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
}

.nav-tabs .custom-nav-link.active {
  border: none;
  /* 顶部四个标签（模型/材料/门型/拉手）选中时使用鲜艳的紫色背景 */
  background-color: #9c27b0 !important;
  color: #ffffff !important;
  border-radius: var(--pill-radius) !important;
}

.nav-tabs .custom-nav-link:hover {
  background-color: #f1f1f8;
}

.nav-settings {
  position: relative;
  align-items: center;
  margin-left: auto !important;
  margin-top: 0 !important;
  margin-right: 0.5rem !important;
}

.tab-content,
.library-container {
  height: 100%;
}

#options {
  max-height: calc(100vh - 50px);
  overflow: hidden;
  transform: translate3d(-213px, 30px, 0px) !important;
}

#bodyOptions {
  max-height: calc(100vh - 135px);
  overflow: auto;
  scrollbar-width: none !important;
}

#bodyOptions::-webkit-scrollbar {
  display: none;
}

#notification {
  position: absolute;
  right: -8px;
  top: -4px;
  height: 10px;
  width: 10px;
  background-color: #da212c;
  border-radius: 50%;
}

#downloadNew {
  position: relative;
}

.download-notification {
  position: absolute;
  left: 5px;
  top: -5px;
  height: 10px;
  width: 10px;
  background-color: #da212c;
  border-radius: 50%;
  display: inline-block;
}

/* This keep modal align center by :horizontal */
.modal-dialog-centered {
  margin: auto !important;
  padding: 6px;
}

.modus-toolbar {
  display: inline-block !important;
  padding: 10px 15px !important;
}

.dropdown-menu-right {
  min-width: 250px !important;
}

.custom-modal,
.custom-menu {
  border-radius: 10px !important;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  box-shadow: 0px 3px 10px rgba(0, 0, 0.2, 0.2);
  z-index: 1050 !important;
}

.custom-select {
  width: 100% !important;
}

.custom-checkbox {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.custom-span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.li-separator {
  padding-top: 8px !important;
  height: 12px !important;
}

.custom-dropdown-divider {
  padding: 8px 0 !important;
  margin: 0 -8px !important;
  cursor: move !important;
}

.custom-breadcrumb {
  white-space: nowrap;
  padding: 0.2rem 0.5rem;
  border: 1px solid #e1e1e1;
  border-radius: 5px;
  cursor: pointer;
}

.custom-breadcrumb-active {
  white-space: nowrap;
  padding: 0.2rem 0.5rem;
  border: 1px solid #019aeb !important;
  background-color: #019aeb !important;
  color: white !important;
  border-radius: 5px;
  cursor: default;
}

.custom-breadcrumb:hover {
  border: 1px solid #019aeb !important;
}

.breadcrumb-item+.breadcrumb-item {
  padding-left: 0.1rem !important;
}

.breadcrumb-item+.breadcrumb-item::before {
  margin-top: -3px;
  padding-right: 0.3rem !important;
}


.cursor-pointer {
  cursor: pointer !important;
}

.cursor-drag {
  cursor: move !important;
}

.cursor-default {
  cursor: default !important;
}

.hover-icon:hover {
  color: #6a6e79 !important;
}


.embed-responsive {
  height: 100%;
}

.scroll-container {
  overflow-y: auto;
  height: calc(100vh - 270px);

}

.list-group-item {
  /* 一级目录胶囊高度略调大，与二级目录视觉保持一致 */
  font-size: 0.8rem !important;
  min-height: 1.8rem !important;
  padding-top: 0.24rem !important;
  padding-bottom: 0.24rem !important;
  border-radius: var(--pill-radius) !important;
}
.sidebar .scroll-container .list-group-item {
  margin-top: 0.15rem !important;
}
.sidebar .scroll-container .list-group-item:first-child {
  margin-top: 0.2rem !important;
}
.list-group-item.active {
  border-radius: var(--pill-radius) !important;
}

.custom-list-group-item:hover {
  border-radius: var(--pill-radius) !important;
  color: white !important;
  background-color: #019aeb !important;
}

.special-list-item {
  background: none !important;
  cursor: default !important;
}

.custom-form-folder {
  font-size: 0.85rem !important;
  background: none !important;
}

.custom-select {
  text-overflow: ellipsis !important;
  border-bottom-width: 1px !important;
}

.custom-form-control {
  width: 100%;
  height: 2rem !important;
  background: none !important;
  border: 1px solid #e1e1e1 !important;
  border-radius: .15rem !important;
  font-size: .8rem !important;
  outline: none !important;
  padding: 0 8px;
}

.custom-input:focus,
.form-control:focus,
.custom-form-control:focus {
  border: 1px solid #0c77be !important;
  border-bottom-width: 1px !important;
}

.form-control.is-invalid {
  border: 1px solid #dc3545 !important;
}

.form-list {
  width: 50% !important;
}

.custom-form-control:focus {
  border: 1px solid #0c77be!important;
}

.folder-name {
  /* 优先单行显示，空间不够时允许换行 */
  white-space: normal;
  word-break: break-all;
  overflow: visible;
  text-overflow: clip;
  width: 100% !important;
  line-height: 1.2;
  flex: 1 1 auto;
  min-width: 0;
}
/* 一级目录整体紧凑：顶部/列表内边距 */
.sidebar .static-container.p-2 {
  padding: 0.35rem 0.5rem !important;
}
.sidebar .scroll-container.border-top {
  padding-top: 0.35rem !important;
  /* 一级目录左右留白统一缩小，左右对称 */
  padding-left: 0.25rem !important;
  padding-right: 0.25rem !important;
  padding-bottom: 0.35rem !important;
}
.sidebar .scroll-container .list-group.mt-1 {
  margin-top: 0.2rem !important;
}
.sidebar .list-group-item.px-2 {
  /* 一级目录文件夹左右内边距：左右一致，更居中一点 */
  padding-left: 0.25rem !important;
  padding-right: 0.15rem !important;
}
.sidebar .list-group-item.px-2 .text-primary {
  /* 左侧栏里不再显示数量，给名称腾出空间 */
  display: none;
}
/* 一级目录：默认就有淡淡的胶囊背景，选中时是蓝色 */
.sidebar .scroll-container .list-group-item {
  margin-top: 0.15rem !important;
  background-color: #f5f6fa !important;
}
.sidebar .scroll-container .list-group-item.active {
  background-color: #019aeb !important;
  color: #ffffff !important;
}
.sidebar .scroll-container .list-group-item.active .folder-name {
  color: #ffffff !important;
}
.sidebar .sidebar-actions-row.mb-1 {
  margin-bottom: 0.1rem !important;
}

/* 侧边栏「本地/在线」按钮：更小 */
.sidebar-mode-btns {
  gap: 3px;
}
.sidebar-mode-btn {
  width: auto !important;
  min-width: 0 !important;
  max-width: 46px;
  padding: 0.18rem 0.28rem !important;
  font-size: 0.7rem !important;
  line-height: 1.2 !important;
  border-radius: var(--pill-radius) !important;
}

/* 侧边栏“添加集合”按钮：左右居中显示 */
.sidebar-actions-row {
  justify-content: center;
  gap: 4px;
  padding: 0 0.25rem;
}
.sidebar-actions-row .btn-icon-only {
  padding: 0.25rem;
}

/* Sidebar CSS */
.sidebar-wrapper {
  flex-shrink: 0;
  position: relative;
  display: flex;
  /* 跟中间二级目录一样，高度占满 header 下方区域，避免左侧栏“悬空” */
  height: calc(100vh - var(--header-height));
  overflow: hidden;
  transition: width 0.2s ease;
}

.sidebar-wrapper .sidebar {
  flex: 1;
  min-width: 0;
  width: 100%;
}

/* 左侧分割线：可拖拽调节宽度 */
.resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 10;
  background: transparent;
  transition: background 0.15s ease;
}
.resize-handle:hover,
.resize-handle:active {
  background: rgba(0, 126, 209, 0.2);
}

.sidebar-wrapper {
  /* 左侧栏与二级目录之间的分隔线，画在最外层，保证贯穿上下 */
  border-right: 1px solid #e0e3ec;
  box-shadow: 1px 0 2px 0 rgba(0, 0, 0, .08);
}

.sidebar {
  height: 100%;
  z-index: 1;
  transition:
    width 0.3s ease,
    opacity 0.3s ease,
    transform 0.3s ease;
  opacity: 1;
  transform: translateX(0);
  will-change: width, opacity, transform;
}

.sidebar-closed .sidebar {
  --sidebar-width: 0px;
  width: 0 !important;
  opacity: 0;
  transform: translateX(-20px);
  pointer-events: none;
}

.sidebar-open .sidebar-wrapper .sidebar {
  --sidebar-width: var(--sidebar-custom-width, 230px);
  min-width: 0 !important;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* 无 wrapper 时保持原样（兼容） */
.sidebar-open .sidebar:not(.sidebar-wrapper .sidebar) {
  --sidebar-width: 230px;
  min-width: 230px !important;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* 中间列容器：宽度由拖拽分割线调节，并持久化 */
.subfolder-column-wrapper {
  flex-shrink: 0;
  position: relative;
  display: flex;
  height: 100%;
  overflow: hidden;
}
.subfolder-column-wrapper .subfolder-column {
  flex: 1;
  min-width: 0;
  width: 100%;
}
/* 二级目录与右侧内容区之间的拖拽分割线 */
.subfolder-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 10;
  background: transparent;
  transition: background 0.15s ease;
}
.subfolder-resize-handle:hover,
.subfolder-resize-handle:active {
  background: rgba(0, 126, 209, 0.2);
}
/* 中间列：二级目录（左侧选中目录的子文件夹） */
.subfolder-column {
  flex-shrink: 0;
  height: calc(100vh - var(--header-height));
  display: flex;
  flex-direction: column;
  border-right: 1px solid #cbcdd6;
  background: #f8f9fa;
  overflow: hidden;
}

.subfolder-column-header {
  flex-shrink: 0;
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid #e2e2e7;
  background: #fff;
}

.subfolder-column-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #353a40;
  line-height: 1.3;
}

.subfolder-column-list {
  flex: 1;
  overflow-y: auto;
  /* 二级目录整体再向左贴近一点 */
  padding: 0.15rem 0 0.15rem 0.0rem;
}

.subfolder-empty {
  padding: 0.4rem 0.5rem;
  font-size: 0.7rem;
  color: #6c757d;
  text-align: center;
}

.subfolder-item {
  display: flex;
  align-items: center;
  /* 高度、字体与一级目录胶囊保持一致 */
  padding: 0.20rem 0.30rem 0.20rem 0.06rem;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1.2;
  transition: background 0.15s ease;
  border-radius: var(--pill-radius);
  /* 轻微左右外边距，避免贴边过紧 */
  margin: 0 0.06rem;
}

.subfolder-item:hover {
  background: #e9ecef;
}

.subfolder-item.active {
  /* 与一级目录选中保持统一的蓝色样式 */
  background-color: #019aeb !important;
  color: #ffffff !important;
  border-radius: var(--pill-radius);
}

.subfolder-item-icon {
  flex-shrink: 0;
  margin-right: 0.3rem;
  font-size: 0.9rem;
}

.subfolder-item-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subfolder-item-count {
  flex-shrink: 0;
  font-size: 0.7rem;
  color: #6c757d;
  margin-left: 0.25rem;
}

.subfolder-triangle {
  flex-shrink: 0;
  width: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #353a40;
  transition: transform 0.15s ease;
}
.subfolder-triangle .modus-icons {
  font-size: 1.15rem;
}
.subfolder-triangle.expanded .modus-icons {
  transform: rotate(90deg);
}
.subfolder-triangle:hover {
  color: #1a1c1e;
}
.subfolder-triangle-placeholder {
  flex-shrink: 0;
  width: 24px;
  display: inline-block;
}
.subfolder-item-nested {
  padding-left: 1.1rem;
}
.subfolder-loading {
  color: #6c757d;
  cursor: default;
  padding: 0.2rem 0.5rem;
}
.subfolder-loading-text {
  font-size: 0.7rem;
}

.subfolder-main-content {
  min-width: 0;
}

/* Main content CSS */
.sidebar-closed .local-container {
  margin-left: 0;
}

.local-container,
.online-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height));
}

/* 顶部工具栏：固定较矮高度，内部按钮/开关随高度自适应 */
.control-panel {
  border-bottom: 1px solid #cbcdd6;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  height: 32px;
  min-height: 32px;
  padding: 0 0.5rem !important;
  box-sizing: border-box;
}
.control-panel .btn,
.control-panel .btn-icon-only {
  padding: 0 !important;
  width: 26px;
  min-width: 26px;
  height: 24px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--pill-radius);
}
.control-panel .btn-icon-only .modus-icons {
  font-size: 0.95rem;
}
/* 显示详细信息：图标按钮，选中时高亮 */
.control-panel .btn-detail-toggle-active {
  background: #e5f0f8 !important;
  color: #007ed1 !important;
}
.control-panel .btn-detail-toggle:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.control-panel-buttons {
  display: inline-flex;
  align-items: center;
  height: 24px;
}
.control-panel-buttons .ml-1,
.control-panel-buttons .ml-2 {
  margin-left: 0.25rem !important;
}

/* 上一级按钮旁当前选中目录路径（可点击面包屑） */
.control-panel .current-folder-path {
  font-size: 0.75rem;
  line-height: 1.3;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.control-panel .current-folder-path .path-sep {
  margin: 0 0.15rem;
  pointer-events: none;
  opacity: 0.7;
}
.control-panel .current-folder-path .path-segment {
  cursor: pointer;
  border-radius: 2px;
  padding: 0 0.1rem;
}
.control-panel .current-folder-path .path-segment:hover {
  text-decoration: underline;
}
.control-panel .current-folder-path .path-segment-current {
  font-weight: 600;
}

.item-cards-container {
  flex: 1; /* Take remaining space instead of fixed height */
  overflow: hidden;
  min-height: 0; /* Important for flex child with overflow */
  display: flex;
  flex-direction: column;
}

.item-cards {
  overflow-y: auto;
  flex: 1; /* Take remaining space after breadcrumb */
  min-height: 0; /* Important for flex child with overflow */
  scrollbar-width: thin; /* For Chrome 113+ */;
}

.item-cards::-webkit-scrollbar {
  width: 10px;
}

.items-container {
  width: 100%;
  display: grid;
  gap: 8px;
}

.selected-item {
  border: solid 1px #007ed1 !important;
}

.selected-item:hover {
  border: solid 2px #007ed1 !important;
}

.item-card {
  position: relative;
  max-width: 256px;
  border: 1px solid white;
  border-radius: 5px;
  box-shadow: rgba(100, 100, 111, 0.2) 0px 3px 12px 0px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  /* 由内容自然撑开高度，避免大缩略图时文字被挤到卡片外面 */
  height: auto;
}

/* 小缩略图卡片：减小整体上下内边距，进一步压缩底部空白 */
.item-card.p-2 {
  padding-top: 0.35rem;
  padding-bottom: 0.05rem;
}

.item-card-list {
  position: relative;
  display: flex;
  flex-direction: row;
  width: 100%;
  border: 1px solid white;
  border-radius: 5px;
  box-shadow: rgba(100, 100, 111, 0.2) 0px 3px 12px 0px;
  cursor: pointer;
}

html[data-theme=dark] .item-card,
  html[data-theme=dark] .item-card-list {
  border: 1px solid black;
}

.item-card-list:hover,
.item-card:hover {
  border: 1px solid #007ed1 !important;
}

.index-icon-list {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  border-radius: 5px 0 0 5px;
  border: 1px solid #777;
  background-color: #555;
  z-index: 1;
}

.index-icon {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  border-radius: 5px 5px 0 0;
  border: 1px solid #777;
  background-color: #555;
  z-index: 1;
}

.thumbnail-container {
  position: relative;
}

.thumbnail-container-list {
  min-width: 30px;
  position: relative;
  width: var(--width-thumbnail);
  height: var(--height-thumbnail);
}

.type-icon {
  position: absolute;
  bottom: 1px;
  right: 3px;
}

.type-icon img {
  width: 14px;
  height: 14px;
}

.check-group {
  position: absolute;
  top: 5px;
  left: 9px;
  cursor: pointer;
  font-size: 1.2rem;
  opacity: 0;
  z-index: 1;
}

.check-group-list {
  position: absolute;
  top: 3px;
  right: 3px;
  cursor: pointer;
  font-size: 1.2rem;
  opacity: 0;
  z-index: 1;
}

.item-card-list:hover .check-group-list {
  opacity: 1 !important;
}

.item-card:hover .check-group {
  opacity: 1 !important;
}

.favorite-icon-list {
  position: absolute;
  top: 3px;
  right: 3px;
  cursor: pointer;
  font-size: 1.2rem;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  transition: right 0.3s ease-in-out;
  z-index: 1;
}

.favorite-icon {
  position: absolute;
  top: 5px;
  right: 5px;
  cursor: pointer;
  font-size: 1.2rem;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  z-index: 1;
}

.favorite-icon .modus-icons {
  margin-top: -3px;
  margin-left: -1px;
}

.item-card:hover .favorite-icon {
  opacity: 1 !important;
}

.item-card-list:hover .favorite-icon-list {
  opacity: 1 !important;
  right: 33px;
}

.favorite-icon-list:hover, .favorite-icon:hover {
  animation: heartbeat 1s infinite;
}

@keyframes heartbeat {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.8);
  }
  100% {
    transform: scale(1);
  }
}

.favorite-icon-list.text-danger, .favorite-icon.text-danger {
  opacity: 1;
}

.item-quick-actions {
  position: absolute;
  top: 6px;
  left: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: calc(100% - 28px);
  opacity: 0;
  z-index: 2;
  transition: opacity 0.2s ease-in-out;
}

.item-quick-actions-four {
  top: auto; /* 防止继承 .item-quick-actions 的 top: 6px 导致拉伸覆盖底部文字 */
  bottom: 28px; /* 给卡片底部文件名留出空间 */
  left: 50%;
  transform: translateX(-50%);
  width: 74px;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  gap: 4px;
  max-width: none;
}

.item-card:hover .item-quick-actions,
.item-card-list:hover .item-quick-actions {
  opacity: 1;
}

.item-quick-action-btn {
  padding: 2px 6px;
  min-height: 20px;
  font-size: 10px;
  line-height: 1.2;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  color: #226EE9 !important;
  border: 1px solid #226EE9 !important;
}

.item-quick-action-btn:hover,
.item-quick-action-btn:focus {
  color: #dc3545 !important;
  border-color: #dc3545 !important;
  background-color: rgba(255, 255, 255, 0.95) !important;
  background-image: none !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
}

.item-quick-actions-four .item-quick-action-btn {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 4px 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11px;
  line-height: 1.15;
  white-space: normal;
  word-break: break-all;
  border-radius: 10px;
}

/* 大缩略图视图下：放大四个/三个悬停按钮的整体尺寸，跟缩略图一起变大 */
.view-large .item-quick-actions-four,
.view-large .item-quick-actions-three {
  width: 96px;
}

.view-large .item-quick-actions-four .item-quick-action-btn,
.view-large .item-quick-actions-three .item-quick-action-btn {
  padding: 6px 6px;
  font-size: 13px;
  border-width: 1.5px;
}

.item-quick-actions-two {
  top: auto;
  bottom: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 74px;
  display: grid;
  grid-template-rows: repeat(2, auto);
  gap: 4px;
  max-width: none;
}

.item-quick-actions-two .item-quick-action-btn {
  width: 100%;
  height: auto;
  min-height: 24px;
  padding: 4px 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11px;
  line-height: 1.15;
  white-space: normal;
  word-break: break-all;
  border-radius: 10px;
}

/* 材料页三个悬停按钮：与门型页同尺寸，上对齐 */
.item-quick-actions-three {
  top: 6px;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  /* 与门型页一致宽度，三行均分 */
  width: 74px;
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 4px;
  max-width: none;
}

.item-quick-actions-three .item-quick-action-btn {
  width: 100%;
  height: 100%;
  min-height: 0;
  /* 与 .item-quick-actions-four 按钮保持一致，大小跟门型页同步 */
  padding: 4px 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11px;
  line-height: 1.15;
  white-space: normal;
  word-break: break-all;
  border-radius: 10px;
}

html[data-theme=dark] .item-quick-action-btn {
  background: rgba(34, 34, 34, 0.92);
}

html[data-theme=dark] .item-quick-action-btn:hover,
html[data-theme=dark] .item-quick-action-btn:focus {
  background-color: rgba(34, 34, 34, 0.92) !important;
  background-image: none !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18) !important;
}

.model-image {
  width: 100%;
  border-radius: .15rem !important;
}

.scale-image {
  transform: scale(0.75) translateY(-15%);
  transform-origin: center;
}

.square-image {
  width: 100%; 
  padding-top: 100%;
  position: relative;
  overflow: hidden;
}

/* 材料页面大缩略图：略微降低缩略图高度，给下面文字留出空间，让整块内容都包在卡片里 */
.view-large #material-app .square-image {
  padding-top: 78%;
}

.square-image-list {
  min-width: 30px;
  width: var(--width-thumbnail);
  height: var(--height-thumbnail);
  position: relative;
  overflow: hidden;
}

.square-material {
  border: 1px solid #e8e8e8;
  border-radius: .15rem !important;
}

html[data-theme=dark] .square-material {
  border: 1px solid #353a40;
}

/* Zoom Preview Styles */
.zoom-preview {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  border: 5px solid #efefef;
  border-radius: 8px;
  box-shadow: 0 0 36px 10px rgba(0, 0, 0, 0.25);
  background: white;
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.15s ease;
  overflow: hidden;
  padding: 0px;
}

.zoom-preview.show {
  opacity: 1;
  transform: scale(1);
}

.zoom-preview img {
  display: block;
}

.zoom-preview canvas {
  display: block;
}

.zoom-preview-canvas-container {
  position: relative;
}

.zoom-preview .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  clip-path: polygon(0 calc(100%),  calc(100% + 1px) 100% , calc(100% + 1px) 0);
}

.canvas-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
}

/* Tooltip Styles */
.item-tooltip {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  background-color: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  max-width: 300px;
  word-wrap: break-word;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  line-height: 1.4;
}

.material-image {
  width: 100%;
  height: 100%;
  position: absolute; /* Match the positioning of the image */
  border-radius: .15rem !important;
  top: 0;
  left: 0;
  object-fit: cover;
  object-position: center;
}

.overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /*This is allow click through the item */
  clip-path: polygon(0 calc(100%),  calc(100% + 1px) 100% , calc(100% + 1px) 0);
}

.square-image img,
.square-image-list img {
  /* cursor: pointer; */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.folder-info {
  position: absolute;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  width: 100%;
  padding: 0 16px;
  left: 50%;
  transform: translateX(-50%);
  bottom: 5px;
  /* border-radius: 5px 5px 0 0;
  background-color: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px); */
}

.item-info {
  margin-top: auto !important;
  text-align: center;
}

/* 材料页面大缩略图：让文字紧跟在缩略图下方，而不是贴到底部 */
.view-large #material-app .item-card.p-2 .item-info {
  margin-top: 0.25rem !important;
  margin-bottom: 0.1rem !important;
}

/* 让小卡片中文本块紧贴卡片底部 */
.item-card.p-2 .item-info {
  margin-bottom: 0 !important;
  padding-bottom: 0;
}

/* 显示详细信息且无序号时：减小底部间距并限制卡片高度，缩略图高度相应减小 */
.item-card-details {
  max-height: 200px;
}
.item-card-details .thumbnail-container {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.item-card-details .thumbnail-container .model-image,
.item-card-details .thumbnail-container .material-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.item-info-details {
  margin-bottom: 0.25rem !important;
  flex-shrink: 0;
}
.item-size-details {
  padding-bottom: 0.2rem !important;
}

.item-info-list {
  display: flex;
  width: 100%;
}

.item-name {
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-name-list {
  margin: auto 0;
  width: calc(100vw - var(--dynamic-width) - 30px);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-size {
  white-space: nowrap;
  font-size: 0.7rem;
  margin-bottom: 0; /* 去掉文字自身的下边距，避免额外占位 */
}

/* 小缩略图卡片：去掉模型大小下面多余的底部空白 */
.item-size.pb-2 {
  padding-bottom: 0 !important;
}

.item-size-list {
  white-space: nowrap;
  margin: auto 10px;
  text-align: right !important;
  font-size: 0.7rem;
}

.padding-right-25:hover,
.padding-right-25-checked {
  padding-right: 25px !important;
}

.item-empty {
  height: 100%;
}

.static-container {
  position: relative;
}

.add-collection {
  width: 25% !important;
  margin-bottom: -1px !important;
  border-radius: 5px 5px 0 0 !important;
}

/* CONTEXT MENU */
.context-menu {
  position: fixed;
  z-index: 1100;
}

.context-menu ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
}
.context-menu li {
  padding: 8px 15px;
  cursor: pointer;
}
.context-menu li:hover {
  background-color: #eee;
}

.tooltip {
  z-index: 1000;
}

.breadcrumb-item+.breadcrumb-item::before {
  margin-top: 1px !important;
}

/* Ensure message modal is always on top of backdrop */
#noticeMessage {
  z-index: 9999 !important;
}

#noticeMessage .modal-dialog {
  z-index: 1060 !important;
}

/* Spinner Animation */
.spin {
  animation: spin 1s linear infinite;
}
@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* User Options Modal */
#actionModal .modal-dialog,
#userOptionsModal .modal-dialog,
#modelUserOptionsModal .modal-dialog,
#materialUserOptionsModal .modal-dialog {
  max-width: 360px !important;
}

#actionModal .modal-body,
#userOptionsModal .modal-body,
#modelUserOptionsModal .modal-body,
#materialUserOptionsModal .modal-body {
  max-height: calc(100vh - 150px);
  overflow-y: auto;
}

/* Validation styles for input fields */
.invalid-feedback {
  display: block !important;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #dc3545;
  background: none !important; /* Override dark theme default */
}