/* 面包屑 */
.breadcrumb-box {
    color: #999;
    margin-bottom: 20px;
}

/* 标题 */
.page-title {
    display: flex;
    align-items: center;
    font-size: 28px;
    color: #b23a3a;
    border-bottom: 1px solid #e5d6c8;
    padding-bottom: 10px;
    margin-bottom: 30px;
}

.page-title .icon {
    font-size: 30px;
    margin-right: 10px;
}

.page-title .search {
    margin-left: auto;
    cursor: pointer;
}
/* ===== 產品列表容器 ===== */
.magazine-list {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -12px;
    min-width: 360px;
}

/* ===== 每個產品項 ===== */
.magazine-list .item {
    align-content: flex-start;
    background-color: #fff;
    border: 6px solid transparent;
    border-radius: 20px;
    color: #1f1f1f;
    cursor: pointer;
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    height: auto;
    justify-content: center;
    position: relative;
    text-decoration: none;
    transition: border .2s, box-shadow .3s;
    z-index: 1;
}

.magazine-list .item a {
    display: block;
    text-decoration: none;
    color: #333;
    background: #fff;
    overflow: hidden;
    width: 100%;
    padding: 0 10px;
    min-width: 150px;
}

.magazine-list .item img:hover {
    transform: translateY(-4px);
}

/* ===== 圖片容器：固定高度，保證統一 ===== */
.magazine-list .cover {
    position: relative;
    width: 100%;
    padding-top: 143.88%;
    background-color: #f5f5f5;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    border-radius: 8px;
}
.magazine-list .cover:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.magazine-list .cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.magazine-list .item a:hover .cover img {
    transform: scale(1.03);
}

/* ===== 文字信息 ===== */
.magazine-list .info {
    width: 100%;
    padding: 0 14px 14px;
}

.magazine-list .title {
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    margin: 10px 0 5px;
    line-height: 21px;
    height: 42px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
@media (max-width: 1400px) {
    .magazine-list .cover {
        height: 318px;
    }
}
@media (max-width: 1200px) {
    .magazine-list .cover {
        height: 260px;
    }
}
/* ===== 響應式 ===== */
@media (max-width: 992px) {
    .magazine-list .item {
        flex: 0 0 33.333%;
        max-width: 33.333%;
        margin-bottom: 1.2rem;
    }
}
@media (max-width: 768px) {
    .magazine-list .item {
        flex: 0 0 50%;
        max-width: 50%;
        margin-bottom: 1.1rem;
    }
}

@media (max-width: 480px) {
    .magazine-list .item {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 0 8px 16px;
        margin-bottom: 1.0rem;
    }
    .magazine-list .cover {
        height: 180px;
    }
    .magazine-list .title {
        font-size: 13px;
    }
}

/* 基础布局：PC 端两端对齐，垂直居中 */
.meta-action-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

/* 价格样式 */
.magazine-list .info .price {
    text-align: center;
    color: #c44747; /* 醒目的红色/橙色 */
    font-size: 16px;
    font-weight: bold;
    white-space: nowrap; /* 防止价格换行 */
}

/* 购物车按钮基础样式 */
.add-to-cart-btn,.buy-ebook-btn {
    background-color: #c44747;
    color: #fff;
    border: none;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.add-to-cart-btn:hover,.buy-ebook-btn:hover {
    background-color: #e04c1b;
}

/* ================= 移动端自适应优化 ================= */
@media screen and (max-width: 767px) {
    /* 在屏幕较小的移动端，改为上下垂直排列 */
    .meta-action-wrap {
        flex-direction: column;
        align-items: flex-start; /* 靠左对齐 */
        gap: 6px;
    }

    /* 移动端按钮撑满整行，更方便手指点击 */
    .add-to-cart-btn,.buy-ebook-btn {
        width: 100%;
        text-align: center;
        padding: 8px 0; /* 增加点击区域高度 */
        font-size: 12px;
    }
}
/* 分页居中 */
.pagination-box {
    text-align: center;
    margin-top: 30px;
}
/* 居中 */
.pagination-box {
    text-align: center;
    margin: 40px 0;
}

/* 去掉默认 Bootstrap 圆角边框 */
.pagination {
    display: inline-flex;
    gap: 10px;
    line-height: 36px;
}

.pagination li {
    list-style: none;
}

/* 默认页码 */
.pagination li a,
.pagination li span {
    border: none !important;
    background: none !important;
    color: #c55;
    font-size: 16px;
    padding: 6px 10px;
}

/* 当前页 —— 红色方块 */
.pagination li.active span {
    background: #c94b4b !important;
    color: #fff !important;
    border-radius: 3px;
    padding: 6px 12px;
}

/* 左右箭头 —— 金色圆形 */
.pagination li:first-child span,
.pagination li:first-child a,
.pagination li:last-child span,
.pagination li:last-child a
 {
    width: 34px;
    height: 34px;
    line-height: 34px;
    border-radius: 50%;
    background: #d8bf6a !important;
    color: #fff !important;
    display: inline-block;
    text-align: center;
    padding: 0;
}

/* 禁用状态 */
.pagination li:first-child.disabled span,
.pagination li:last-child.disabled span {
    background: #eee !important;
    color: #bbb !important;
}

/* hover 效果 */
.pagination li a:hover {
    color: #c94b4b;
    text-decoration: none;
}

/*下拉分頁*/
.load-more-trigger {
    text-align: center;
    padding: 30px 0;
    clear: both;
}

.loading-spinner {
    color: #999;
    font-size: 14px;
}

.no-more-data {
    color: #ccc;
    text-align: center;
    font-size: 12px;
    padding: 10px;
}

.layui-icon-loading {
    display: inline-block;
    margin-right: 5px;
}

.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.cart-modal.hidden {
    display: none;
}
.cart-modal-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}
.cart-modal-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
    padding: 20px;
}
.cart-modal-footer {
    margin-top: 20px;
    text-align: right;
}
.btn-secondary {
    background-color: #6c757d;
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
}
.btn-primary {
    background-color: #e4393c;
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
}