.tb-page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0;
  box-sizing: border-box;
}

/* 面包屑 */
.tb-page-breadcrumb {
  font-size: 14px;
  color: #666;
  margin-bottom: 25px;
}

.tb-page-breadcrumb a {
  color: #666;
  text-decoration: none;
}

.tb-page-breadcrumb a:hover {
  text-decoration: underline;
}

/* 布局结构 */
.tb-page-layout {
  display: flex;
  gap: 40px;
}

/* 左侧 Sidebar */
.tb-page-sidebar {
  width: 220px;
  flex-shrink: 0;
}

/* 右侧内容区：flex-basis:0 让它按剩余空间伸缩而非内容宽度，min-width:0 允许收缩到比内容更窄，
   这样内部图片行的 overflow-x:auto 才能在正确的层级接管横向滚动，避免整体溢出 100% */
.tb-page-main {
  flex: 1 1 0;
  min-width: 0;
}

.sidebar-fieldset {
  border: 1px solid #e0e0e0;
  border-radius: 0;
  padding: 15px 20px 25px 20px;
  margin: 0;
  box-sizing: border-box;
}

.sidebar-legend {
  font-style: italic;
  font-size: 18px;
  font-weight: normal;
  padding: 0 12px;
  margin: 0 auto;
  width: auto;
  float: none;
  text-align: center;
  color: #111;
}

.sidebar-menu-group {
  margin-top: 15px;
  margin-bottom: 20px;
}

.sidebar-menu-title {
  font-size: 13px;
  font-weight: bold;
  margin: 0 0 10px 0;
  text-transform: uppercase;
  color: #222;
  letter-spacing: 0.3px;
}

.sidebar-menu-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-menu-group li {
  margin-bottom: 4px;
  padding: 0;
  list-style: none;
}

.sidebar-menu-group a {
  font-size: 13px;
  color: #666;
  text-decoration: none;
  display: inline-block;
  transition: color 0.2s;
}

.sidebar-menu-group a:hover,
.sidebar-menu-group a.active {
  color: #000;
  text-decoration: underline;
}

/* ========== 颜色快速筛选 ========== */
.color-finder {
  margin-bottom: 16px;
  position: relative;
}

@media (max-width: 768px) {
  .color-finder {
    margin-bottom: 8px;
  }
}

/* 触发器 */
.color-finder__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  cursor: pointer;
  background-color: #fff;
  transition: border-color 0.2s ease;
}

.color-finder__trigger:hover {
  border-color: #cc7f85;
}

.color-finder__trigger-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.color-finder__trigger-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid #e0e0e0;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.color-finder__trigger-label {
  font-size: 14px;
  color: #333;
  font-weight: 400;
}

.color-finder__trigger-arrow {
  flex-shrink: 0;
  color: #666;
  transition: transform 0.2s ease;
}

/* 下拉面板 */
.color-finder__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

/* 移动端标题栏（桌面隐藏） */
.color-finder__header {
  display: none;
}

/* 搜索框 */
.color-finder__search {
  position: relative;
  padding: 8px 12px;
  border-bottom: 1px solid #e0e0e0;
}

.color-finder__search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #5C3C30;
  pointer-events: none;
}

.color-finder__search-input {
  width: 100%;
  padding: 6px 36px 6px 36px;
  border: none;
  font-size: 14px;
  outline: none;
  background: transparent;
}

.color-finder__search-input::placeholder {
  color: #ccc;
  font-weight: 300;
}

.color-finder__clear-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #5C3C30;
  cursor: pointer;
  transition: opacity 0.2s;
}

.color-finder__clear-icon:hover {
  opacity: 0.7;
}

/* 左右分栏 */
.color-finder__panels {
  display: flex;
  max-height: 320px;
}

/* 左侧：分组列表 */
.color-finder__groups {
  width: 30%;
  border-right: 1px solid #e0e0e0;
  overflow-y: auto;
  padding: 8px 0;
}

.color-finder__group-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

/* 隐藏 All 分组 */
.color-finder__group-item[data-group="All"] {
  display: none;
}

.color-finder__group-item:hover {
  background-color: #f5f5f5;
}

.color-finder__group-item.is-active {
  background-color: #f4e4e5;
}

.color-finder__group-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #e0e0e0;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.color-finder__group-label {
  font-size: 14px;
  color: #333;
}

/* 右侧：颜色列表 */
.color-finder__colors {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.color-finder__color-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  position: relative;
}

.color-finder__color-item:hover {
  background-color: #f5f5f5;
}

.color-finder__color-item.is-selected {
  background-color: #f4e4e5;
}

.color-finder__color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  position: relative;
  border: 1px solid #e0e0e0;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.color-finder__color-label {
  font-size: 14px;
  color: #333;
  flex: 1;
}

.color-finder__lightning {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  pointer-events: none;
}

.color-finder__lightning svg {
  width: 12px;
  height: 12px;
  fill: white;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* White 颜色的闪电图标用黑色 */
.color-finder__color-item[data-color-value="White"] .color-finder__lightning svg {
  fill: black;
  filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.3));
}

/* 滚动条样式 */
.color-finder__groups::-webkit-scrollbar,
.color-finder__colors::-webkit-scrollbar {
  width: 6px;
}

.color-finder__groups::-webkit-scrollbar-track,
.color-finder__colors::-webkit-scrollbar-track {
  background: #f5f5f5;
}

.color-finder__groups::-webkit-scrollbar-thumb,
.color-finder__colors::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.color-finder__groups::-webkit-scrollbar-thumb:hover,
.color-finder__colors::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* 分组左侧选中竖条（移动端显示） */
.color-finder__group-item {
  position: relative;
}

/* ========== 移动端底部弹层 ========== */
@media (max-width: 768px) {
  /* 遮罩 */
  .color-finder__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  .color-finder__overlay.is-open {
    opacity: 1;
  }

  /* 底部弹层 */
  .color-finder__dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    border: none;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
    z-index: 9999;
    height: 65vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
  }
  .color-finder__dropdown.is-open {
    transform: translateY(0);
  }

  /* 标题栏 */
  .color-finder__header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
  }
  .color-finder__header-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
  }
  .color-finder__header-close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
  }

  .color-finder__search {
    flex-shrink: 0;
  }

  /* 分栏区域填满剩余高度 */
  .color-finder__panels {
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
  }

  .color-finder__groups,
  .color-finder__colors {
    height: 100%;
  }

  .color-finder__groups {
    width: 38%;
  }

  /* 选中分组左侧红色竖条 */
  .color-finder__group-item.is-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #cc7f85;
  }

  /* 移动端隐藏侧边栏 */
  .tb-page-sidebar {
    display: none !important;
  }
  .tb-page-container {
    padding: 10px;
  }
}
