
/* 全局样式重置 
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}*/

/* 主容器样式 */
.category-gifts {
    width: 100%;
    max-width: 1030px;
    margin: 20px 0;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    overflow: visible;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.9), 0 5px 15px rgba(255, 122, 147, 0.75);
    border: 1px solid #f9ccd7;
    transition: all 0.3s ease;
}
.category-gifts:hover{
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.9), 0 8px 20px rgba(255, 122, 147, 0.2);
    transform: translateY(-3px); /* 轻微上浮 */
}


/*  大体布局，不影响原有代码 */
.page-wrap {
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    width: 98%;
    max-width: 1550px;
}
.main-content {
    flex: 1;
    min-width: 0;
}

.moe-container{
    display: flex;
    gap: 27px;
    width: 100%;
    margin: 0 auto;
}
.side-box {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}
.side-box h3 {
    margin-top: 0;
    font-size: 16px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 8px;
    color: #333;
}


/* 标题样式 */
.section-title {
    background: linear-gradient(45deg, #ff6b6b, #ff8e53);
    -webkit-background-clip: text;
    color: transparent;
    font-size: 2.3rem;
    text-align: center;
    margin: 0 0 2rem 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    border-radius: 10px;
    border: 2px solid #FFB6C1;
    padding: 10px 0;
}

/* 礼物按钮区域容器 */
.gift-buttons-wrapper {
    border-bottom: 2px solid #ffca3a;
    border-top: 2px solid #ffca3a;
    padding: 20px;
    margin-bottom: 30px;
    overflow: visible; /* 允许按钮溢出显示 */
}

/* 按钮容器样式 - 使用Flex布局确保显示 */
#btn-container-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    justify-content: space-evenly;
    padding: 10px;
    position: relative;
    z-index: 10; /* 确保按钮在页面上层 */
}

/* 按钮组样式，每个主按钮和子按钮容器为一个组 */
.btn-group {
  position: relative;
  display: inline-block;
  margin: 0 10px; /* 按钮组之间留间距 */
}

/* 主按钮样式 */
.custom-main-btn {
  padding: 10px 15px;
  background-color: #ff5722;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  min-width: 100px;
  text-align: center;
  font-size: 14px;
  white-space: nowrap;
  transition: background-color 0.3s ease;
}

.custom-main-btn:hover {
  background-color: #e04a19;
}

/* ========================================== */
/* 🎁 礼物分类页 - PC端礼物卡片样式（固定27%布局） */
/* ========================================== */
.gift-item {
    display: flex;
    width: 100%;
    margin: 0 3% 30px 0;
    vertical-align: top;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.9), 0 5px 15px rgba(255, 122, 147, 0.75);
    border: 1px solid #f9ccd7;
    transition: all 0.3s ease;
}

.gift-item:hover {
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.9), 0 8px 20px rgba(255, 122, 147, 0.2);
    transform: translateY(-3px);
}

.gift-item img {
    width: 300px;
    height: 300px;
    padding: 10px;
    margin: 10px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: block;
}

.gift-info {
    padding: 15px;
    margin: 27px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.gift-info h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 第一个p：价格 */
.gift-info p:first-of-type {
    color: #ff5252;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
}

/* 第二个p：内容描述 */
.gift-info p:last-of-type {
    line-height: 1.6;
    color: #666;
    font-size: 14px;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gift-info a {
    padding: 6px 20px;
    background-color: #ff4500;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.gift-info a:hover {
    background-color: #e03a00;
    color: white;
}


/* 内容+侧边栏的容器 */
.moe-container {
  display: flex;
  gap: 30px;
  width: 100%;
  margin: 0 auto;
}

/* 右侧边栏内部模块容器 */
.aright-sidebar {
  width: 27%;
  flex-shrink: 0;
}
/* 左侧边栏内部模块容器 */
.left-content {
  display: flex;
  flex-direction: column;
  align-items: center; /* 让模块水平居中 */
  width: 100%;
}
/* 右侧内部模块容器 */
.sidebar-sticky {
  width: 100%;
  box-sizing: border-box;
  margin: 20px auto;
}
/* 右侧广告 */
.acategory-gg {
  background: #ffffff;
  border: 2px solid #f9ccd7;
  border-radius: 10px;
  padding: 1px;
  margin-bottom: 17px;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.9), 0 5px 15px rgba(255, 122, 147, 0.75);
  transition: all 0.3s ease;
  /* 新增：让容器成为图片的参考基准 */
  position: relative;
  overflow: hidden; /* 超出部分隐藏 */
}

/* 新增：图片自适应样式 */
.acategory-gg img {
  display: block; /* 去掉图片默认的行内空白 */
  width: 100%; /* 宽度铺满容器 */
  height: auto; /* 高度自动，保持比例 */
  max-width: 100%; /* 最大宽度不超过容器 */
  border-radius: 6px; /* 可选：和容器圆角呼应，更美观 */
}

/* 可选：a标签也铺满，点击区域更大 */
.acategory-gg a {
  display: block;
  width: 100%;
}

/* 模块悬停效果 */
.acategory-gg:hover {
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.9), 0 8px 20px rgba(255, 122, 147, 0.2);
  transform: translateY(-3px);
}

.a-module {
  background: #ffffff;
  border: 2px solid #f9ccd7;
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 17px;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.9), 0 5px 15px rgba(255, 122, 147, 0.75);
  transition: all 0.3s ease;
}

/* 模块悬停效果 */
.a-module:hover {
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.9), 0 8px 20px rgba(255, 122, 147, 0.2);
  transform: translateY(-3px);
}

/* 模块标题 */
.a-module-title {
  font-size: 18px;
  color: #ff7a93;
  margin: 0 0 15px 0;
  padding-bottom: 8px;
  border-bottom: 2px dashed #f9ccd7;
  transition: transform 0.3s ease;

}

/* 标题装饰 */
.a-module-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 40px;
  height: 2px;
  background: #ff6b6b;
}

.a-module-title:hover {
  transform: scale(1.05);
}

/* 登录表单样式 */
.alogin-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aform-group {
  width: 100%;
}

.aform-group input {
  width: 90%;
  padding: 10px 12px;
  border: 1px solid #f0e6e6;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.aform-group input:focus {
  border-color: #ff6b6b;
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.1);
}

/* 验证码区域 */
.captcha-group {
  display: flex;
  gap: 10px;
}

#captcha-img {
  width: 100px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff6b6b;
  font-weight: bold;
  letter-spacing: 3px;
}

/* 登录按钮 */
.alogin-btn {
  width: 100%;
  padding: 10px;
  background: #ff6b6b;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
}

.alogin-btn:hover {
  background: #ff4a4a;
}

/* 注册链接 */
.aregister-link {
  display: block;
  text-align: center;
  margin-top: 10px;
  color: #666;
  font-size: 14px;
  text-decoration: none;
}

.aregister-link:hover {
  color: #ff6b6b;
  text-decoration: underline;
}

/* 用户信息区域 */
.auser-info {
  text-align: center;
  padding: 10px 0;
}

.auser-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 18px;
  border: 4px solid transparent;
  background-clip: padding-box, border-box;
  background-origin: padding-box, border-box;
  background-image: linear-gradient(to bottom, #fff, #fff), linear-gradient(135deg, #ff7a93, #ffb6c1);
  box-shadow: 0 5px 12px rgba(255, 122, 147, 0.25);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auser-avatar:hover {
  transform: scale(1.2);
  box-shadow: 0 0 8px rgba(255, 105, 180, 0.4);
}

.auser-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.afont-bold {
  text-align: center;
  margin: 0;
  font-size: 17px;
}

/* 分类列表样式 */
.acategory-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.acategory-item {
  padding: 8px 15px;
  background-color: #ffe4eb;
  border-radius: 6px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 3px 6px rgba(255, 122, 147, 0.2);
  text-decoration: none;
  margin: 3px;
}

.acategory-item:hover {
  background: #ff6b6b;
  color: white;
  transform: scale(1.05);
}

/* 列表样式 */
.a-module-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.a-module-list li {
  padding: 12px 0;
  border-bottom: 1px dashed #f9ccd7;
  font-size: 15px;
  line-height: 1.6;
  transition: all 0.3s ease;
}

.a-module-list li:last-child {
  border-bottom: none;
}

.a-module-list li:hover {
  background-color: rgba(255, 238, 245, 0.4);
  padding-left: 8px;
}
#categorys-btn {
    display: inline-block;
    background-color: rgb(240, 240, 240);
    color: rgb(51, 51, 51);
    margin-left: 5px;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-width: 1px;
    border-style: solid;
    border-color: rgb(255, 189, 189);
    border-image: initial;
    border-radius: 4px;
    text-decoration: none !important;
}

/* 可选：加个hover效果，和其他页面完全同步 */
#categorys-btn:hover {
    background-color: #ffe6e6;
    border-color: #ff9e9e;
    color: #d93535;
}



/* 悬浮显示的子按钮容器样式，调整为在主按钮上方显示且不遮挡 */
.custom-sub-btns {
  display: none;
  position: absolute;
  bottom: 100%; /* 将原来的 bottom: calc(100% + 5px) 改为 bottom: 100%，让子按钮容器与主按钮底部完全贴合，消除缝隙 */
  left: 50%;
  transform: translateX(-50%);
  flex-direction: row;
  gap: 5px;
  padding: 8px;
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  z-index: 100; /* 确保在最上层 */
  white-space: nowrap;
  border: 1px solid #eee;
}

/* 悬浮子按钮样式 */
.custom-sub-btn {
  padding: 4px 8px;
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  transition: opacity 0.2s ease;
}

.custom-sub-btn:nth-child(1) {
  background-color: #0066dd;
}

.custom-sub-btn:nth-child(2) {
  background-color: #0066dd;
}

.custom-sub-btn:nth-child(3) {
  background-color: #0066dd;
}

.custom-sub-btn:hover {
  opacity: 0.9;
}

/* 关键：主按钮组 hover 或子按钮容器自身 hover 时，子按钮都显示 */
.btn-group:hover .custom-sub-btns,
.custom-sub-btns:hover {
  display: flex;
  animation: fadeIn 0.3s ease forwards;
  transition-delay: 0.2s; /* 添加过渡延迟，让子按钮消失的时间延迟0.1秒，增加可操作时间 */
}


/* ========================================== */
/*  生日礼物分类页 - 移动端专属优化（已修复） */
/* ========================================== */
@media (max-width: 768px) {
    /* 1. 全局兜底，解决横向溢出 */
    html, body {
        overflow-x: hidden;
    }

    /* 2. 页面最外层容器 */
    .page-wrap {
        width: 100% !important;
        max-width: 100% !important;
        padding: 10px !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }

    /* 3. 主容器布局重置 */
    .moe-container {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 4. 左侧内容全屏 */
    .left-content {
        width: 100% !important;
        display: block !important;
        box-sizing: border-box !important;
    }

    /* 5. 中间内容区（你之前漏掉的） */
    .main-content {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 6. 右侧边栏隐藏 */
    .aright-sidebar {
        display: none !important;
    }

    /* 7. 分类主容器 */
    .category-gifts {
        width: 100% !important;
        max-width: 100% !important;
        padding: 15px !important;
        margin: 10px 0 20px !important;
        box-sizing: border-box !important;
    }

    /* 8. 标题栏优化 */
    .section-title {
        font-size: 20px !important;
        padding: 12px 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        text-align: center;
    }

    /* 9. 按钮区域 */
    .gift-buttons-wrapper {
        padding: 15px 10px !important;
        margin-bottom: 20px !important;
        box-sizing: border-box !important;
    }

    #btn-container-inner {
        gap: 1px !important;
        justify-content: center !important;
        flex-wrap: wrap !important; /* 按钮多时自动换行 */
    }

    .btn-group {
        margin: 5px !important;
    }

    .custom-main-btn {
        padding: 8px 12px !important;
        font-size: 13px !important;
        min-width: auto !important;
        box-sizing: border-box !important;
    }

    /* 10. 礼物列表项（重点修正） */
    .gift-item {
        flex-direction: column !important;
        padding: 15px !important;
        margin-bottom: 20px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .gift-item img {
        width: 95% !important;
        max-width: 100% !important;
        height: auto !important;
        margin: 0 0 12px 0 !important;
        display: block;
    }

    .gift-info {
        width: 100% !important;
        margin: 0 !important; /* 去掉了桌面端的27px外边距 */
        box-sizing: border-box !important;
    }

    .gift-info h3 {
        font-size: 16px !important;
        line-height: 1.4 !important;
        margin-bottom: 8px;
        /* 如需标题完整显示，可删除下面三行 */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .gift-info p {
        font-size: 14px !important;
        line-height: 1.5 !important;
    }

    /* 11. 侧边栏模块（防止残留） */
    .side-box,
    .sidebar-sticky {
        display: none !important;
    }

    /* 12. 广告模块（如果在侧边栏也一起隐藏） */
    .acategory-gg {
        display: none !important;
    }

    /* 13. 分页 */
    .pagination {
        gap: 6px !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }

    .pagination a {
        padding: 6px 10px !important;
        font-size: 13px !important;
    }
}

@media (max-width: 480px) {
    .category-gifts {
        padding: 12px !important;
    }

    .section-title {
        font-size: 18px !important;
    }

    .custom-main-btn {
        padding: 7px 10px !important;
        font-size: 12px !important;
    }
}

/* ========================================== */
/*  生日礼物分类页 - 1025~1366小屏笔记本专属优化 */
/* ========================================== */
@media (min-width: 1025px) and (max-width: 1366px) {
    /* 全局兜底，防止横向溢出 */
    html, body {
        overflow-x: hidden;
    }

    /* 页面最外层容器 */
    .page-wrap {
        width: 100% !important;
        max-width: 100% !important;
        padding: 12px !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }

    /* 主容器布局：保留左右侧边栏，缩小栏间距，不堆叠 */
    .moe-container {
        display: flex !important;
        gap: 16px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 左侧内容区 */
    .left-content {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 中间内容区 */
    .main-content {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 右侧边栏保留显示，缩小占比 */
    .aright-sidebar {
        width: 24% !important;
        flex-shrink: 0;
    }

    /* 分类主容器 */
    .category-gifts {
        width: 100% !important;
        max-width: 100% !important;
        padding: 16px !important;
        margin: 12px 0 22px !important;
        box-sizing: border-box !important;
    }

    /* 标题栏优化，缩小字号 */
    .section-title {
        font-size: 26px !important;
        padding: 12px 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        text-align: center;
    }

    /* 按钮区域缩小内边距 */
    .gift-buttons-wrapper {
        padding: 16px 12px !important;
        margin-bottom: 22px !important;
        box-sizing: border-box !important;
    }

    #btn-container-inner {
        gap: 12px !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
    }

    .btn-group {
        margin: 4px !important;
    }

    .custom-main-btn {
        padding: 8px 12px !important;
        font-size: 13px !important;
        min-width: auto !important;
        box-sizing: border-box !important;
    }

    /* 礼物列表项：保持横向左右布局，缩小图片尺寸 */
    .gift-item {
        flex-direction: row !important;
        padding: 12px !important;
        margin-bottom: 18px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .gift-item img {
        width: 240px !important;
        height: 240px !important;
        max-width: 100% !important;
        margin: 0 10px 0 0 !important;
        display: block;
    }

    .gift-info {
        width: 100% !important;
        margin: 10px !important;
        box-sizing: border-box !important;
    }

    .gift-info h3 {
        font-size: 17px !important;
        line-height: 1.4 !important;
        margin-bottom: 8px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .gift-info p {
        font-size: 14px !important;
        line-height: 1.5 !important;
    }

    /* 侧边栏模块正常显示，缩小内边距 */
    .side-box,
    .sidebar-sticky {
        display: block !important;
        padding: 12px !important;
        margin: auto;
    }

    /* 侧边广告模块正常显示 */
    .acategory-gg {
        display: block !important;
    }

    /* 分页适配 */
    .pagination {
        gap: 8px !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }

    .pagination a {
        padding: 7px 11px !important;
        font-size: 14px !important;
    }
}