* {
    -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮效果 */
}

/* 隐藏所有滚动条 */
::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

* {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

button {
    -webkit-appearance: none; /* 移除 iOS 默认样式 */
    appearance: none;
}

/* 自定义字体 - 獅尾XD珍珠 */
@font-face {
    font-family: 'ShiweiXD Pearl';
    src: url('font.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
    unicode-range: U+4E00-9FFF, U+3400-4DBF, U+20000-2A6DF, U+2A700-2B73F, U+2B740-2B81F, U+2B820-2CEAF, U+F900-FAFF, U+2F800-2FA1F; /* 中文字符范围优化 */
}

/* 预加载字体 */
body {
    font-family: 'ShiweiXD Pearl', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: #f5f5f5;
    padding-bottom: 100px; /* 为购物车留出空间 */
}

.container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background-color: #fff;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #fff;
}

.location-switch {
    background-color: #eee;
    border-radius: 20px;
    padding: 2px;
    display: inline-flex;
}

.location-switch button {
    -webkit-appearance: none; /* 移除 iOS 默认样式 */
    appearance: none;
    border: none;
    background-color: transparent;
    padding: 8px 15px;
    border-radius: 18px;
    font-weight: bold;
    color: #333; /* 明确设置文字颜色 */
    white-space: nowrap; /* 防止文字换行 */
}

.location-switch button.active {
    background-color: #fff;
}

.search-bar {
    flex-grow: 1;
    margin: 0 10px;
}

.search-bar input {
    width: 100%;
    border: none;
    background-color: #f5f5f5;
    border-radius: 20px;
    padding: 10px 15px;
    box-sizing: border-box;
    font-size: 16px; /* 防止 iOS 自动缩放 */
}

.search-bar input::placeholder {
    color: #aaa;
}

.header-actions {
    display: flex;
    align-items: center;
}

.header-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: 10px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.header-avatar:hover {
    transform: scale(1.1);
}

.shop-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
}

.shop-info-left {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.location-icon {
    flex-shrink: 0;
    margin-right: 8px;
}

.shop-info h1 {
    font-size: 22px;
    font-weight: 900;
    margin: 0;
}

.reserve-btn {
    background-color: #fff2cc;
    border: 1px solid #ffe8a6;
    color: #d48806;
    border-radius: 15px;
    padding: 5px 15px;
    font-weight: bold;
}

.promo-banner {
    background-color: #fffbe6;
    padding: 8px 12px;
    margin: 10px;
    border-radius: 8px;
}

.promo-banner p {
    margin: 0;
    color: #d48806;
}

.main-nav ul {
    display: flex;
    list-style: none;
    padding: 10px;
    margin: 0;
    justify-content: space-around;
}

.main-nav li {
    font-weight: bold;
    color: #888;
    padding-bottom: 8px;
}

.main-nav li.active {
    color: #000;
    border-bottom: 3px solid #ffdd00;
}

.menu-container {
    display: flex;
}

.category-sidebar {
    width: 100px;
    background-color: #f8f8f8;
    flex-shrink: 0;
}

.category-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-sidebar li {
    padding: 15px 10px;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    color: #555;
    line-height: 1.5;
}

.category-sidebar li.active {
    background-color: #fff;
    font-weight: bold;
}

.menu-items {
    flex-grow: 1;
    padding: 10px;
}

.item {
    display: flex;
    margin-bottom: 20px;
}

.item img {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    margin-right: 10px;
    object-fit: contain;
    background-color: #ffffff;
    flex-shrink: 0;
}

.item-details {
    flex-grow: 1;
}

.item-details h2 {
    margin: 0 0 5px 0;
    font-size: 18px;
}

.item-details p {
    margin: 0;
    font-size: 12px;
    color: #888;
}

.item-details .sales {
    font-size: 12px;
    color: #888;
    margin: 0;
}

.item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
}

.item-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.item-actions .quantity-display {
    margin: 0 8px;
    font-weight: bold;
    font-size: 16px;
    min-width: 10px;
    text-align: center;
}

.item .quantity-btn {
    background-color: #ffd100;
    color: #000;
    width: 22px;
    height: 22px;
    border: 1px solid #ffd100;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.item .minus-btn {
    background-color: white;
    color: #ffd100;
}

footer {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 460px;
    z-index: 100;
}

.cart {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #2c2c2c;
    color: #fff;
    padding: 10px 10px 10px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.cart-icon {
    font-size: 28px;
    color: #fcd55f;
}

.cart-status {
    flex-grow: 1;
    margin-left: 15px;
    font-weight: bold;
    font-size: 16px;
}

.checkout-btn {
    background-color: #fcd55f;
    color: #333;
    border: none;
    border-radius: 25px;
    padding: 12px 25px;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
}

/* 购物车模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 200;
}

.modal-content {
    background-color: #fff;
    width: 100%;
    max-width: 480px;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    padding: 20px;
    box-sizing: border-box;
    max-height: 85vh; /* 增加最大高度 */
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* 内容过长时可滚动 */
}


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

.modal-header h2 {
    margin: 0;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

#cart-items-list {
    flex-grow: 1;
    overflow-y: auto;
}

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

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    margin-right: 15px;
    object-fit: cover;
}

.cart-item-details {
    flex-grow: 1;
}

.cart-item-details h2 {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
}

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

.quantity-controls span {
    margin: 0 12px;
    font-weight: bold;
    font-size: 16px;
    min-width: 20px;
    text-align: center;
}

.quantity-btn {
    background-color: #ffd100;
    border: none;
    color: #000;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.minus-btn {
    background-color: #eee;
    color: #888;
}

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

.clear-cart-btn {
    background-color: #ff4d4f;
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}

.clear-cart-btn:hover {
    background-color: #ff7875;
}

.modal-checkout-btn {
    background-color: #fcd55f;
    color: #333;
    border: none;
    border-radius: 25px;
    padding: 12px 25px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
}

.modal-checkout-btn:hover {
    background-color: #f0c100;
}

.modal-checkout-btn:disabled {
    background-color: #ccc;
    color: #999;
    cursor: not-allowed;
}

/* 商品详情模态框特定样式 */
.product-detail-content {
    display: flex;
    flex-direction: column; /* 垂直排列 */
    align-items: center; /* 居中对齐 */
    gap: 15px;
    text-align: center;
}

.product-detail-content img {
    width: 150px; /* 增大图片 */
    height: 150px;
    border-radius: 10px;
    object-fit: contain;
    background-color: #ffffff;
    margin-bottom: 10px;
}

.product-detail-content .product-info {
    flex-grow: 1;
    width: 100%;
}

.product-detail-content .product-info h2 {
    margin: 0 0 10px 0;
    font-size: 22px; /* 调整字体大小 */
    font-weight: 900;
}

.product-detail-content .product-info p {
    margin: 0 0 15px 0;
    color: #888; /* 匹配页面其他文本颜色 */
    font-size: 14px;
}

.add-to-cart-btn {
    background-color: #ffd100; /* 匹配添加按钮颜色 */
    color: #000;
    border: none;
    padding: 12px 25px; /* 匹配结算按钮样式 */
    border-radius: 25px; /* 匹配结算按钮样式 */
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    width: 100%;
}

.add-to-cart-btn:hover {
    background-color: #f0c100;
}

/* 结算模态框特定样式 */
#checkout-modal .modal-footer {
    justify-content: flex-end;
}

#payment-modal .modal-footer {
    justify-content: flex-end;
}

#checkout-items-list {
    max-height: 30vh;
    overflow-y: auto;
    margin-bottom: 15px;
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.checkout-item:last-child {
    border-bottom: none;
}

.checkout-item-info {
    flex-grow: 1;
}

.checkout-item-info h3 {
    margin: 0;
    font-size: 16px;
}

.checkout-item-info span {
    font-size: 14px;
    color: #888;
}

.checkout-item-price {
    font-weight: bold;
}

.checkout-user-info {
    margin-bottom: 15px;
}

.user-info-form input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #eee;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 16px; /* 防止 iOS 自动缩放 */
}

.checkout-summary {
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-top: 10px;
}

.checkout-summary p {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
}

.checkout-summary h3 {
    display: flex;
    justify-content: space-between;
    margin: 10px 0 0;
    font-size: 18px;
}

/* 新的支付模态框列表样式 */
.payment-methods-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.payment-method-item {
    display: flex;
    align-items: center;
    padding: 15px 5px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    position: relative;
}

.payment-method-item:last-child {
    border-bottom: none;
}

.payment-method-item .balance-amount {
    font-size: 12px;
    color: #888;
    margin-left: 10px;
}

.payment-method-item .radio-check {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 50%;
    margin-left: auto;
    position: relative;
}

.payment-method-item.active .radio-check {
    border-color: #ffd100;
    background-color: #ffd100;
}

.payment-method-item.active .radio-check::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #fff;
}


/* 支付成功模态框样式 */
.success-modal-content {
    align-items: center;
    text-align: center;
    padding: 40px 20px;
}

.success-modal-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 320px;
}

.success-modal-actions .checkout-btn {
    flex-grow: 1;
}

.secondary-btn {
    background-color: #fff;
    color: #333;
    border: 1px solid #ccc;
}

.success-checkmark {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.success-checkmark svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

.success-checkmark circle {
    stroke-width: 4;
    stroke: #ffd100;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.success-checkmark path {
    stroke-width: 5;
    stroke: #ffd100;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

/* 小票样式 */
.receipt {
    background-color: #fff;
    border: 1px solid #eee;
    padding: 20px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 320px;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.receipt-header {
    text-align: center;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.receipt-header h2 {
    margin: 0;
    font-size: 20px;
}

.receipt-header p {
    margin: 5px 0 0;
    font-size: 14px;
    color: #555;
}

.receipt-body {
    padding: 10px 0;
}

.receipt-items .receipt-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    margin-bottom: 8px;
}

.receipt-item-img {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    margin-right: 10px;
    object-fit: cover;
}

.receipt-item .item-name {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.receipt-summary {
    border-top: 1px dashed #ccc;
    padding-top: 10px;
    margin-top: 10px;
}

.receipt-summary .summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 5px;
}

.receipt-summary .total {
    font-weight: bold;
    font-size: 16px;
}

.receipt-footer {
    border-top: 1px dashed #ccc;
    padding-top: 10px;
    margin-top: 10px;
    font-size: 12px;
    color: #888;
}

.receipt-footer p {
    margin: 3px 0;
}

.receipt-user-info {
    border-top: 1px dashed #ccc;
    padding-top: 10px;
    margin-top: 10px;
    font-size: 14px;
    text-align: left;
}

.receipt-user-info p {
    margin: 4px 0;
}

/* 作者介绍模态框样式 */
.author-modal-content {
    background-color: #fff;
    width: 100%;
    max-width: 480px;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    padding: 20px;
    box-sizing: border-box;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    align-items: center;
    text-align: center;
}

.author-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.author-avatar-container {
    margin-bottom: 10px;
}

.author-large-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffd100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.author-description {
    width: 100%;
}

.author-intro {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.author-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.author-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.author-link:hover {
    background-color: #ffd100;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.link-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.link-text {
    font-size: 16px;
    font-weight: 500;
    color: inherit;
}

/* 空状态样式 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #888;
    font-size: 16px;
    min-height: 200px;
}

.empty-state p {
    margin: 0;
    line-height: 1.5;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .author-modal-content {
        padding: 20px 15px;
    }
    
    .author-large-avatar {
        width: 100px;
        height: 100px;
    }
    
    .author-intro {
        font-size: 16px;
    }
    
    .author-link {
        padding: 12px 15px;
    }
    
    .link-text {
        font-size: 14px;
    }
    
    .empty-state {
        padding: 40px 15px;
        font-size: 14px;
    }
}
