
body {
    background: linear-gradient(-45deg, #f0f8ff, #ffe4e1, #e6f7ff, #fff3e0);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    min-height: 100vh;
    display: flex;
    flex-direction: column; /* 改为纵向排列 */
    align-items: stretch;   /* 子元素宽度撑满容器 */
    justify-content: flex-start; /* 内容从顶部开始排列 */
    padding: 2rem 0;
    position: relative;
}

#cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  padding: 4px 8px;
  font-size: 12px;
  background-color: #e74c3c;
  color: white;
  border-radius: 50%;
}

/* 自定义样式 */
.header-right-menu {
    height: 100%; /* 确保高度与父容器一致 */
}
.header-right-menu ul.list-inline {
    line-height: 1.5; /* 调整行高 */
}
.header-right-menu ul.list-inline li.list-inline-item a.nav-link {
    display: inline-block;
    vertical-align: middle;
    line-height: inherit; /* 继承父容器的行高 */
}
.list-group {
    padding: 0rem 0.5rem;
    margin-bottom: 0;
}
.list-group-item {
    border: none;
}
.list-group-item.active,
.list-group-item.active:hover {
    background-color: #e3f2fd !important; /* 浅蓝色 */
    font-weight: bold;
    border-left: 3px solid #2196F3; /* 左侧高亮条 */
    color: #2196F3;
}
.card-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2em;
    height: calc(1.2em * 2);
}
/* 确保card-body有固定高度 */
.card-body {
    display: flex;
    flex-direction: column;
    max-height: 1000px; /* 设置最大高度 */
}

/* 修改 seller.css 中的相关样式 */
#sideBarMenu {
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    overflow-x: hidden; /* 隐藏水平滚动条 */
    margin: 0;
    padding: 0;
    width: 100%; /* 确保宽度正确 */
    box-sizing: border-box; /* 包含padding和border */
}

/* 为ul列表添加滚动条 */
#categoryMenuListId, #orderMenuListId {
    max-height: calc(100vh - 300px); /* 略小于父容器，留出空间 */
    overflow-y: auto;
    overflow-x: hidden; /* 隐藏水平滚动条 */
    margin: 0;
    padding: 0;
}

/* 自定义滚动条样式（可选） */
#categoryMenuListId::-webkit-scrollbar,
#orderMenuListId::-webkit-scrollbar {
    width: 6px;
}

#categoryMenuListId::-webkit-scrollbar-thumb,
#orderMenuListId::-webkit-scrollbar-thumb {
    background-color: #c1c1c1;
    border-radius: 3px;
}

#categoryMenuListId::-webkit-scrollbar-thumb:hover,
#orderMenuListId::-webkit-scrollbar-thumb:hover {
    background-color: #a8a8a8;
}

.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border: none;
    z-index: 2000; /* 确保卡片有基础层级 */
    transition: all 0.3s ease;
    opacity: 1;
    transform: scale(1);
}
.card:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}
#qrcodes_info.hidden {
    opacity: 0;
    transform: scale(0.95);
    display: none !important;
}
.card-img-top {
    height: auto;
    object-fit: cover;
    transition: transform 0.3s ease;
}
#selectionBox {
    pointer-events: none;
    box-sizing: border-box;
    background-color: rgba(0, 123, 255, 0.3); /* 半透明高亮 */
    z-index: 20;
}
#overlayMask {
    pointer-events: none;
}
.card:hover .card-img-top {
    transform: scale(1.1);
}
.card-body p {
    margin-bottom: 0.25rem !important;
}
.card-parent {
    transition: all 0.5s ease;
    opacity: 1;
    visibility: visible;
}
.card-parent.hidden {
    opacity: 0;
    transform: scale(0.95);
    visibility: hidden;
}
@keyframes fadeScale {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
.fade-out {
    animation: fadeOut 0.5s forwards;
}
.fade-in {
    animation: fadeIn 0.5s forwards;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}
.bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 8s infinite;
    pointer-events: none;
    animation-timing-function: ease-in-out;
}
@keyframes float {
    0% {
        transform: translateY(100vh) translateX(0) scale(0);
        opacity: 0;
    }
    25% {
        transform: translateY(75vh) translateX(100px) scale(0.5);
        opacity: 0.5;
    }
    50% {
        transform: translateY(50vh) translateX(-50px) scale(0.8);
        opacity: 0.8;
    }
    75% {
        transform: translateY(25vh) translateX(50px) scale(0.5);
        opacity: 0.5;
    }
    100% {
        transform: translateY(-100px) translateX(0) scale(0);
        opacity: 0;
    }
}
.btn-rounded {
    border-radius: 50px;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    transition: all 0.3s ease;
}
.btn-rounded:hover {
    background-color: #0056b3; /* 可根据你的品牌色调整 */
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.custom-modal-60 {
    width: 80vw !important; /* 手机端更宽 */
    max-width: 80vw !important; /* 桌面端最大宽度 */
    max-height: 90vh !important; /* 桌面端最大高度 */
    margin: auto;
}
/* 添加模态框内容滚动 */
.custom-modal-60 .modal-content {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.custom-modal-60 .modal-body {
    overflow-y: auto;
}
@media (max-width: 768px) {
    .custom-modal-60 {
        width: 95vw !important; /* 更贴近屏幕边缘 */
        height: 80vw !important;
        max-height: 90vw !important; /* 控制高度不超出屏幕 */
        padding: 0 !important;
    }
    .custom-modal-60 .modal-content {
        width: 100%;
        border-radius: 0 !important; /* 移动端可去掉圆角以适应全屏 */
    }
    .custom-modal-60 .modal-body,
    .custom-modal-60 .modal-footer {
        padding: 1rem;
    }
}

.edit-mode-btn {
    position: fixed;
    bottom: 80px;
    right: 80px;
    z-index: 2001;
    background-color: #007bff;
    color: white;
    width: 80px; /* 固定宽度 */
    height: 80px; /* 固定高度，与宽度相同以保持圆形 */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%; /* 圆形 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, background-color 0.3s ease;
    font-size: 16px; /* 文字大小 */
    text-align: center;
}
.edit-mode-btn:hover {
    transform: rotate(90deg) scale(1.1); /* 旋转并放大 */
    background-color: #0056b3; /* 深色背景 */
}
.edit-mode-btn .btn-content {
    display: flex;
    flex-direction: column; /* 垂直排列 */
    align-items: center;    /* 水平居中 */
    justify-content: center; /* 垂直居中 */
}
.edit-mode-btn i,
.edit-mode-btn span {
    display: block;
    text-align: center;
}

.dropdown-menu {
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    font-size: 15px;
}
.dropdown-item {
    padding: 6px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.dropdown-item:hover {
    background-color: #e0e0e0;
    color: #007bff;
    padding-left: 20px;
    font-weight: 500;
}

.card-title .seller-desc {
    margin-left: 10px;
    font-size: 0.6rem;
    color: #666;
}

.category-item:hover {
    background-color: #f0f0f0;
    padding-left: 5px;
}

#dropdown-menu-sub {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border-radius: 4px;
    min-width: 160px;
}

.dropdown-item-text:hover {
    color: #007bff;
}

.switch-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.switch-label {
  font-size: 15px !important;
  color: #333;
}
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
  margin: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0;
  right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px; width: 16px;
  left: 2px; bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #4CAF50;
}
input:checked + .slider:before {
  transform: translateX(20px);
}

.image-wrapper {
    position: relative;
    display: inline-block;
}
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0); /* 蒙版 */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 8px;
    z-index: 11;
}
/* 新增遮罩层 */
.image-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(128, 128, 128, 0.8); /* 灰色半透明蒙版 */
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
    border-radius: inherit; /* 和图片保持一致圆角 */
}
/* hover 时显示遮罩层 */
.image-wrapper:hover::after {
    opacity: 1;
}
.edit-icon {
    color: white !important;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
}
/* 强制放大图标 */
.fa-3x {
    font-size: 3em !important;
}
input:disabled,
input[disabled] {
  background-color: #e9ecef; /* Bootstrap-style light gray */
  color: #6c757d;
  cursor: not-allowed;
}

.sidebar {
  position: -webkit-sticky; /* Safari 支持 */
  position: sticky;
  top: 100px; /* 距离顶部的距离，避免被 header 遮挡 */
  align-self: flex-start; /* 确保在 flex 布局中不塌陷 */
}

@media (max-width: 992px) {
    .responsive-layout {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 768px) {
    .crop-container,
    .preview-container {
        flex: 1 1 90%;
        margin: 0 auto;
        text-align: center;
    }
}

/* PC端样式 - 上下布局，一行3列 */
@media (min-width: 768px) {
    .card-parent {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
        padding: 0 15px;
        margin-bottom: 2rem;
    }

    .card {
        height: 100%;
    }

    /* PC端上下布局 */
    .d-md-block {
        display: block !important;
    }

    .d-md-block > div {
        width: 100%;
    }

    .card-img-top {
        width: 100%;
        height: auto;
    }
}

/* 手机端样式 - 左右布局 */
@media (max-width: 767.98px) {
    .input-group-append .btn {
        padding: 0.25rem 0.5rem !important;
        min-width: auto;
        font-size: 0.875rem;
    }
    .card-parent {
        margin-bottom: 0.5rem;
    }
    .card {
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        display: flex;
    }
    .d-md-block {
        display: flex !important;
        width: 100%;
    }
    .col-5 {
        flex: 0 0 40%;
        max-width: 40%;
    }
    .col-7 {
        flex: 0 0 60%;
        max-width: 60%;
    }
    .card-img-top {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .card-title {
        font-size: 0.9rem;
        -webkit-line-clamp: 2;
        height: calc(1.2em * 2);
    }
    .card-text {
        font-size: 0.8rem;
        margin-bottom: 0.25rem !important;
    }
    .btn {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
}

.seller-desc-container {
  position: relative;
}

.seller-desc {
  transition: max-height 0.3s ease;
  overflow: hidden;
}

/* 手机端样式 - 折叠状态 */
@media (max-width: 768px) {
  .seller-desc.collapsed {
    max-height: 80px; /* 控制显示的高度 */
  }

  .seller-desc.expanded {
    max-height: 1000px; /* 足够大的高度确保完全显示 */
  }

  .seller-desc.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, transparent, white);
    pointer-events: none;
  }

  .read-more-btn {
    display: none;
    margin-top: 8px;
    border: none;
    background: none;
    color: #007bff;
    cursor: pointer;
    padding: 4px 0;
  }

  .read-more-btn.show {
    display: block;
  }
}

/* 非手机端不折叠 */
@media (min-width: 769px) {
  .read-more-btn {
    display: none !important;
  }
}
