/* 重置默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background: #f5f5f5;
}

/* APP 容器 */
.app {
    position: relative;
    width: 100%;
    height: 100vh;
    background: #fff;
    display: flex;
    flex-direction: column;
}

/* 顶部标题栏 */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 44px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.1);
    z-index: 100;
}

.header-title {
    font-size: 16px;
    font-weight: 500;
}

.header-right {
    font-size: 20px;
    color: #666;
}

/* 内容区域 */
.app-content {
    flex: 1;
    overflow-y: auto;
    margin-top: 44px;
    margin-bottom: 50px;
    -webkit-overflow-scrolling: touch;
}

/* 轮播图 */
.swiper {
    width: 100%;
    height: 180px;
    background: #eee;
}

/* 分类导航 */
.category-nav {
    display: flex;
    padding: 15px 0;
    background: #fff;
}

.category-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
}

.category-item i {
    font-size: 24px;
    margin-bottom: 5px;
    color: #666;
}

/* 商品列表 */
.product-list {
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.product-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.product-img {
    width: 100%;
    padding-top: 100%;
    position: relative;
}

.product-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 8px;
}

.product-name {
    font-size: 14px;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    color: #f44;
    font-size: 16px;
    font-weight: 500;
}

/* 底部导航栏 */
.app-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: #fff;
    display: flex;
    box-shadow: 0 -1px 6px rgba(0,0,0,0.1);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
    text-decoration: none;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 2px;
}

.nav-item span {
    font-size: 12px;
}

.nav-item.active {
    color: #f44;
}

/* 购物车样式 */
.cart-list {
    background: #fff;
    margin-top: 10px;
}

.cart-item {
    display: flex;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.item-select {
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.checkbox {
    width: 20px;
    height: 20px;
}

.item-img {
    width: 80px;
    height: 80px;
    margin-right: 10px;
}

.item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.item-info {
    flex: 1;
}

.item-name {
    font-size: 14px;
    margin-bottom: 5px;
}

.item-price {
    color: #f44;
    font-size: 16px;
    margin-bottom: 10px;
}

.item-num {
    display: flex;
    align-items: center;
}

.num-minus,
.num-plus {
    width: 28px;
    height: 28px;
    border: 1px solid #eee;
    background: #fff;
    border-radius: 4px;
}

.num-input {
    width: 40px;
    height: 28px;
    text-align: center;
    border: 1px solid #eee;
    margin: 0 5px;
}

/* 购物车底部 */
.cart-footer {
    position: fixed;
    bottom: 50px;
    left: 0;
    right: 0;
    height: 50px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    box-shadow: 0 -1px 6px rgba(0,0,0,0.1);
}

.select-all {
    display: flex;
    align-items: center;
}

.total-info {
    display: flex;
    align-items: center;
}

.total-price {
    margin-right: 15px;
}

.price {
    color: #f44;
    font-size: 18px;
    font-weight: 500;
}

.checkout-btn {
    background: #f44;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
}

/* 编辑按钮 */
.edit-btn {
    color: #666;
    font-size: 14px;
}

/* 按钮点击效果 */
button:active {
    opacity: 0.8;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

.checkout-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: #fff;
    width: 80%;
    max-width: 320px;
    border-radius: 8px;
    padding: 20px;
    animation: slideIn 0.3s;
}

.modal-content h3 {
    text-align: center;
    margin-bottom: 15px;
    font-size: 16px;
    color: #333;
}

.order-info {
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.info-item label {
    color: #666;
    margin-right: 10px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.cancel-btn,
.confirm-btn {
    padding: 8px 20px;
    border-radius: 4px;
    border: none;
    font-size: 14px;
}

.cancel-btn {
    background: #f5f5f5;
    color: #666;
}

.confirm-btn {
    background: #ff6b6b;
    color: #fff;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 搜索栏 */
.search-bar {
    padding: 8px 15px;
    background: #fff;
    display: flex;
    align-items: center;
}

.search-input {
    flex: 1;
    height: 32px;
    background: #f5f5f5;
    border-radius: 16px;
    border: none;
    padding: 0 15px;
    font-size: 14px;
    color: #333;
}

/* 轮播图优化 */
.swiper-pagination {
    bottom: 10px;
}

.swiper-pagination-bullet {
    width: 6px;
    height: 6px;
    background: rgba(255,255,255,0.8);
    opacity: 0.5;
}

.swiper-pagination-bullet-active {
    opacity: 1;
}

/* 商品标签 */
.product-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ff6b81;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

/* 复选框美化 */
.checkbox {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 1px solid #ddd;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
}

.checkbox:checked {
    background: #f44;
    border-color: #f44;
}

.checkbox:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 3px;
    width: 6px;
    height: 10px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

/* 数量调整按钮 */
.num-minus,
.num-plus {
    width: 28px;
    height: 28px;
    border: none;
    background: #f5f5f5;
    color: #666;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.num-minus:active,
.num-plus:active {
    background: #e5e5e5;
}

.num-input {
    border: none;
    background: #f5f5f5;
    width: 40px;
    height: 28px;
    text-align: center;
    font-size: 14px;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 20px 0;
    color: #999;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f44;
    border-top-color: transparent;
    border-radius: 50%;
    animation: loading 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes loading {
    to {
        transform: rotate(360deg);
    }
}

/* 下拉刷新 */
.pull-refresh {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    transform: translateY(-100%);
    transition: all 0.3s;
}

.pull-refresh.active {
    transform: translateY(0);
}

/* 滑动删除 */
.cart-item {
    position: relative;
    transition: transform 0.3s;
}

.delete-btn {
    position: absolute;
    right: -70px;
    top: 0;
    bottom: 0;
    width: 70px;
    background: #f44;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 结算按钮优化 */
.checkout-btn {
    background: linear-gradient(to right, #ff416c, #ff4b2b);
    box-shadow: 0 4px 15px rgba(255,65,108,0.3);
    transition: all 0.3s;
}

.checkout-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 8px rgba(255,65,108,0.3);
}

/* 图标动画 */
.nav-item i {
    transition: all 0.3s;
}

.nav-item:active i {
    transform: scale(0.9);
}

/* 页面切换动画 */
.app-content {
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 空状态 */
.empty-state {
    padding: 40px 0;
    text-align: center;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 10px;
    color: #ddd;
}

/* 模态框动画 */
.checkout-modal {
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 订单列表样式 */
.order-list {
    padding: 10px;
}

.order-item {
    background: #fff;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.order-header {
    padding: 12px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-no {
    color: #666;
    font-size: 13px;
}

.order-status {
    color: #f44;
    font-size: 14px;
}

.order-content {
    padding: 12px;
}

.order-goods {
    display: flex;
    align-items: center;
}

.order-goods img {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    margin-right: 10px;
    object-fit: cover;
}

.goods-info {
    flex: 1;
}

.goods-name {
    font-size: 14px;
    margin-bottom: 5px;
}

.goods-price {
    color: #f44;
    font-size: 15px;
}

.goods-num {
    color: #999;
    font-size: 13px;
}

.order-footer {
    padding: 12px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-total {
    font-size: 13px;
    color: #666;
}

.order-btns {
    display: flex;
    gap: 10px;
}

.btn-cancel,
.btn-pay {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 13px;
    border: none;
}

.btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.btn-pay {
    background: #f44;
    color: #fff;
}

/* 个人中心样式 */
.user-info {
    background: linear-gradient(to right, #ff416c, #ff4b2b);
    padding: 20px 15px;
    color: #fff;
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.3);
    margin-right: 15px;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-detail {
    flex: 1;
}

.user-name {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 5px;
}

.user-id {
    font-size: 14px;
    opacity: 0.8;
}

.feature-list {
    margin-top: 10px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.feature-item {
    display: flex;
    align-items: center;
    padding: 15px;
    color: #333;
    text-decoration: none;
    position: relative;
}

.feature-item:not(:last-child) {
    border-bottom: 1px solid #eee;
}

.feature-item i:first-child {
    font-size: 20px;
    margin-right: 10px;
    color: #666;
}

.feature-item span {
    flex: 1;
    font-size: 15px;
}

.icon-arrow {
    font-size: 16px;
    color: #ccc;
}

.feature-item:active {
    background: #f5f5f5;
}

/* 设置图标 */
.icon-settings {
    font-size: 20px;
    color: #fff;
}

/* 空状态 */
.empty-order {
    text-align: center;
    padding: 40px 0;
    color: #999;
}

.empty-order i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 10px;
}

/* 订单状态颜色 */
.order-status.pending {
    color: #f44;
}

.order-status.paid {
    color: #52c41a;
}

.order-status.shipped {
    color: #1890ff;
}

.order-status.completed {
    color: #666;
}

.order-status.cancelled {
    color: #999;
}

/* 商品图片样式 */
.product-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* 导航图标样式 */
.bottom-nav img {
    width: 24px;
    height: 24px;
}

/* 背景图片样式 */
.header {
    background-image: url('../images/ui/header-bg.png');
    background-size: cover;
}

.buy-now-btn {
    display: block;
    width: 100%;
    padding: 8px 0;
    margin-top: 8px;
    background-color: #ff6b6b;  /* 醒目的红色 */
    color: #fff;
    text-align: center;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
}

.buy-now-btn:active {
    background-color: #ff5252;
} 