/* 基础样式重置与统一 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    background-color: #F2F3F5;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    color: #333;
    line-height: 1.5;
}
.layui-container {
    padding: 0;
    margin: 0 auto;
    max-width: 640px;
}
a {
    text-decoration: none;
}
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}
.text-gray {
    color: #999;
}

/* 导航栏样式优化 */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}
.header .layui-row {
    padding: 12px 15px;
}
.logo {
    color: #165DFF;
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
}
.layui-btn-group .layui-btn {
    margin: 0;
    border-radius: 0;
}
.layui-btn-group .layui-btn:first-child {
    border-radius: 4px 0 0 4px;
}
.layui-btn-group .layui-btn:last-child {
    border-radius: 0 4px 4px 0;
}

/* 搜索框优化 */
#searchBox {
    padding: 0 15px 12px;
}
.layui-input-group {
    position: relative;
    width: 100%;
}
.layui-input {
    border-radius: 5px;
    padding-left: 18px;
    height: 36px;
    border-color: #ccc;
}
.layui-input:focus {
    border-color: #165DFF;
    box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.1);
}
.layui-input-group-addon {
    left: 0;
    border-radius: 20px 0 0 20px;
    background: transparent;
    border: none;
    width: 40px;
    padding: 0;
    color: #999;
}

/* 轮播图样式优化 */
.carousel {
    height: 180px;
    overflow: hidden;
    border-radius: 12px;
    padding: 10px;
    margin-top: 8px;
}
.carousel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}
.layui-carousel-ind {
    bottom: 10px !important;
}
.layui-carousel-ind li {
    width: 8px;
    height: 8px;
    margin: 0 3px;
    background-color: rgba(255,255,255,0.5);
}
.layui-carousel-ind li.layui-this {
    width: 24px;
    background-color: #fff;
    border-radius: 4px;
}

/* 分类导航样式优化 */
.category {
    background-color: #fff;
    padding: 14px 0 0 0;
    border-radius: 12px;
    margin-left: 10px;
    margin-right: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 10px;
    margin-bottom: 10px;
}
.category-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    font-size: 22px;

}
.category-name {
    font-size: 12px;
    color: #666;
}

/* 商品列表区域优化 */
.goods-section {
    padding: 15px 15px;
}
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 5px;
}
.section-title h3 {
    font-size: 17px;
    font-weight: 600;
    color: #333;
}
.more-link {
    color: #165DFF;
    font-size: 14px;
    display: flex;
    align-items: center;
}
.more-link i {
    margin-left: 3px;
    font-size: 16px;
}

/* 网格商品样式优化 */
.goods-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.goods-card {
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.goods-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.goods-img {
    height: 130px;
    position: relative;
}
.goods-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.goods-tag {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 2px 8px;
    font-size: 12px;
    color: #fff;
    border-radius: 4px;
    z-index: 1;
}
.goods-info {
    padding: 8px 10px;
}
.goods-name {
    font-size: 14px;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
    line-height: 1.5;
    font-weight: normal;
}
.goods-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.price {
    color: #F53F3F;
    font-weight: 600;
    font-size: 15px;
}
.original-price {
    color: #999;
    font-size: 12px;
    text-decoration: line-through;
    margin-left: 5px;
}
.buy-btn {
    background-color: rgba(22, 93, 255, 0.1);
    color: #165DFF;
    border: none;
    font-size: 12px;
    transition: all 0.2s ease;

    padding: 0 10px;
    height: 26px;
    line-height: 26px;
    border-radius: 14px;

}
.buy-btn:hover {
    background-color: rgba(22, 93, 255, 0.2);
}

/* 列表商品样式优化 */
.goods-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.goods-row {
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.goods-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.goods-row .goods-img {
    width: 30%;
    height: auto;
    min-height: 110px;
}
.goods-row .goods-info {
    width: 70%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.goods-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}
.goods-meta .star {
    color: #FF7D00;
    margin-right: 2px;
}
.goods-meta .sales {
    margin-left: 10px;
}
.row-buy-btn {
    background-color: #165DFF;
    color: #fff;
}
.row-buy-btn:hover {
    background-color: #0E4CD1;
}

/* 加载更多按钮优化 */
.load-more {
    margin: 20px 0 30px;
    text-align: center;
}
.load-more-btn {
    background-color: #fff;
    color: #165DFF;
    border: 1px solid #165DFF;
    padding: 8px 24px;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.2s ease;
}
.load-more-btn:hover {
    background-color: rgba(22, 93, 255, 0.05);
}


/* 弹窗样式优化 */
.buy-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 1001;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}
.modal-content {
    background-color: #fff;
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.modal-header {
    padding: 16px 18px;
    border-bottom: 1px solid #f1f1f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-title {
    font-size: 17px;
    font-weight: 600;
    color: #333;
}
.close-modal {
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.close-modal:hover {
    background-color: #f5f5f5;
    color: #666;
}
.modal-body {
    padding: 18px;
}
.modal-footer {
    padding: 16px 18px;
    border-top: 1px solid #f1f1f1;
    background-color: #fafafa;
    border-radius: 0 0 16px 16px;
}
.goods-detail {
    display: flex;
    margin-bottom: 18px;
}
.detail-img {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 12px;
    flex-shrink: 0;
}
.detail-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.detail-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.detail-name {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 16px;
    color: #333;
}
.detail-desc {
    font-size: 13px;
    color: #999;
    margin-bottom: 10px;
    line-height: 1.4;
}
.detail-price {
    color: #F53F3F;
    font-weight: 600;
    font-size: 17px;
}
.quantity-title, .payment-title {
    font-size: 15px;
    font-weight: 600;
    margin: 20px 0 10px;
    color: #333;
}
.quantity-control {
    display: flex;
    align-items: center;
    width: 130px;
}
.quantity-btn {
    width: 34px;
    height: 34px;
    background-color: #f5f5f5;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.quantity-btn:first-child {
    border-radius: 6px 0 0 6px;
}
.quantity-btn:last-child {
    border-radius: 0 6px 6px 0;
}
.quantity-btn:hover {
    background-color: #eee;
}
.quantity-input {
    width: 62px;
    height: 34px;
    text-align: center;
    border-top: 1px solid #f5f5f5;
    border-bottom: 1px solid #f5f5f5;
    border-left: none;
    border-right: none;
    font-size: 15px;
}
.quantity-input:focus {
    outline: none;
}
.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.payment-method {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.payment-method.active {
    border-color: #165DFF;
    background-color: rgba(22, 93, 255, 0.03);
}
.method-icon {
    font-size: 22px;
    margin-right: 12px;
}
.method-info {
    display: flex;
    align-items: center;
}
.method-name {
    font-size: 15px;
    color: #333;
}
.method-selected {
    color: #165DFF;
    display: none;
    font-size: 18px;
}
.payment-method.active .method-selected {
    display: block;
}
.total-amount {
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-top: 8px;
}
.total-label {
    color: #666;
    font-size: 15px;
}
.total-price {
    color: #F53F3F;
    font-weight: 600;
    font-size: 20px;
}
.pay-btn {
    width: 100%;
    background-color: #165DFF;
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 16px;
    transition: background-color 0.2s ease;
}
.pay-btn:hover {
    background-color: #0E4CD1;
}

/* 购物车徽章优化 */
.layui-badge-dot {
    top: 5px !important;
    right: 55px !important;
}
