* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f5f5f5;
    color: #333;
    padding-bottom: 60px;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.header p {
    font-size: 14px;
    opacity: 0.9;
}

.category-nav {
    background: white;
    padding: 10px;
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    border-bottom: 1px solid #eee;
}

.category-item {
    padding: 8px 16px;
    margin-right: 10px;
    border-radius: 20px;
    background: #f5f5f5;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.category-item.active {
    background: #667eea;
    color: white;
}

.product-list {
    padding: 10px;
}

.product-item {
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 15px;
    display: flex;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.product-image {
    width: 100px;
    height: 100px;
    margin-right: 15px;
    flex-shrink: 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.product-desc {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.product-price .price {
    font-size: 18px;
    color: #ff6b6b;
    font-weight: bold;
}

.product-price .unit {
    font-size: 12px;
    color: #999;
}

.product-stock {
    font-size: 12px;
    color: #999;
}

.product-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-add {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
}

.quantity-control {
    display: flex;
    align-items: center;
}

.quantity-control button {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    font-size: 18px;
    cursor: pointer;
}

.quantity-control span {
    width: 40px;
    text-align: center;
    font-size: 14px;
}

.cart-bar {
    position: fixed;
    bottom: 60px;
    left: 0;
    right: 0;
    background: white;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

.cart-icon {
    width: 50px;
    height: 50px;
    background: #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.cart-count {
    color: white;
    font-weight: bold;
}

.cart-info {
    flex: 1;
    margin-left: 15px;
}

.cart-total {
    font-size: 20px;
    color: #ff6b6b;
    font-weight: bold;
}

.btn-checkout {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: flex-end;
    z-index: 200;
}

.modal-content {
    background: white;
    width: 100%;
    max-height: 80vh;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
}

.modal-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
}

.btn-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
}

.modal-body {
    padding: 15px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    margin-right: 10px;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    font-size: 14px;
    margin-bottom: 5px;
}

.cart-item-info p {
    font-size: 12px;
    color: #ff6b6b;
}

.cart-summary, .checkout-total {
    font-size: 16px;
}

.total-price {
    color: #ff6b6b;
    font-weight: bold;
    font-size: 20px;
}

.btn-primary {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
}

.address-item {
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
}

.address-item.active {
    border-color: #667eea;
    background: #f0f3ff;
}

.address-detail {
    font-size: 14px;
    margin-bottom: 5px;
}

.address-contact {
    font-size: 12px;
    color: #999;
}

.address-item.add-new {
    text-align: center;
    color: #667eea;
    border-style: dashed;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
    color: #666;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.form-group textarea {
    height: 80px;
    resize: none;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row .form-group {
    flex: 1;
}

.checkout-address {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 15px;
    cursor: pointer;
}

.no-address {
    color: #999;
    text-align: center;
}

.checkout-products {
    margin-bottom: 15px;
}

.checkout-products h4 {
    font-size: 14px;
    margin-bottom: 10px;
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.item-name {
    flex: 1;
}

.item-quantity {
    color: #999;
    margin: 0 10px;
}

.item-price {
    color: #ff6b6b;
}

.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    border-top: 1px solid #eee;
    z-index: 50;
}

.tab-item {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    cursor: pointer;
}

.tab-item.active {
    color: #667eea;
}

.tab-icon {
    font-size: 20px;
    display: block;
}

.tab-text {
    font-size: 12px;
    display: block;
    margin-top: 3px;
}

.orders-page {
    padding: 15px;
}

.orders-page h2 {
    font-size: 20px;
    margin-bottom: 15px;
}

.order-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    cursor: pointer;
}

.order-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f5f5f5;
}

.order-no {
    font-size: 12px;
    color: #999;
}

.order-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
}

.status-0 {
    background: #fff3cd;
    color: #856404;
}

.status-1 {
    background: #d1ecf1;
    color: #0c5460;
}

.status-2 {
    background: #d4edda;
    color: #155724;
}

.status-3 {
    background: #d4edda;
    color: #155724;
}

.status-4 {
    background: #f8d7da;
    color: #721c24;
}

.order-product {
    display: flex;
    align-items: center;
    padding: 8px 0;
}

.order-product img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 10px;
}

.product-detail {
    flex: 1;
}

.product-detail .name {
    display: block;
    font-size: 14px;
}

.product-detail .quantity {
    display: block;
    font-size: 12px;
    color: #999;
}

.order-product .price {
    font-size: 14px;
    color: #ff6b6b;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f5f5f5;
}

.order-total {
    font-size: 16px;
    color: #ff6b6b;
    font-weight: bold;
}

.order-time {
    font-size: 12px;
    color: #999;
}
