/* exchange/index.html - 样式表 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f5f5; min-height: 100vh; padding-bottom: 120px; }
button { outline: none; -webkit-tap-highlight-color: transparent; -webkit-appearance: none; -moz-appearance: none; appearance: none; border: none; background: none; padding: 0; margin: 0; cursor: pointer; }
button:focus, button:focus-visible, button:active { outline: none; -webkit-tap-highlight-color: transparent; }

.header { background: #006241; color: white; padding: 15px 20px; text-align: center; }
.hotel-name { font-size: 18px; font-weight: 600; }

.cart-bar { position: fixed; bottom: 52px; left: 0; right: 0; background: #006241; color: white; display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; z-index: 999; box-shadow: 0 -2px 10px rgba(0,0,0,0.1); cursor: pointer; transition: opacity 0.2s; }
.cart-bar:active { opacity: 0.8; }
.cart-bar-left { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.cart-bar-right { display: flex; align-items: center; gap: 15px; }
.cart-bar-points { font-size: 16px; font-weight: bold; }
.cart-bar-btn { background: white; color: #006241; padding: 8px 20px; border-radius: 20px; font-size: 14px; font-weight: 600; border: none; cursor: pointer; }

.category-tabs { background: white; padding: 12px 20px; display: flex; gap: 15px; overflow-x: auto; border-bottom: 1px solid #eee; scroll-behavior: smooth; scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; touch-action: pan-x; position: sticky; top: 0; z-index: 50; }
.category-tabs::-webkit-scrollbar { display: none; }
.category-tab { padding: 6px 16px; background: #f5f5f5; border-radius: 20px; font-size: 14px; color: #666; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; transition: background 0.2s, color 0.2s; display: inline-flex; align-items: center; justify-content: center; }
.category-tab.active { background: #006241; color: white; }
.category-tab.active .category-badge { background: rgba(255,255,255,0.3); color: white; }

.category-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    background: #f0f0f0;
    color: #666;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 500;
    padding: 0 5px;
    margin-left: 6px;
    pointer-events: none;
}

.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 15px; padding-bottom: 70px; transition: padding-bottom 0.3s; }
.product-grid.has-cart-bar { padding-bottom: 130px; }
.product-card { background: white; border-radius: 12px; overflow: hidden; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.product-img-wrapper { position: relative; width: 100%; padding-top: 100%; background: #f5f5f5; overflow: hidden; }
.product-img-wrapper img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.product-img-placeholder { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 48px; }
.product-tag { position: absolute; top: 10px; left: 10px; background: #e74c3c; color: white; padding: 4px 8px; border-radius: 4px; font-size: 11px; }
.product-info { padding: 12px; }
.product-name { font-size: 14px; font-weight: 500; color: #333; margin-bottom: 8px; }
.product-bottom { display: flex; justify-content: space-between; align-items: center; }
.product-points { font-size: 16px; font-weight: bold; color: #e74c3c; }
.product-points span { font-size: 12px; font-weight: normal; color: #999; }
.add-btn { width: 32px; height: 32px; background: linear-gradient(135deg, #006241 0%, #00704A 100%); color: white; border: none; border-radius: 50%; font-size: 20px; cursor: pointer; }

.loading { text-align: center; padding: 40px; color: #999; }
.error { text-align: center; padding: 40px; color: #e74c3c; }
.empty { text-align: center; padding: 40px; color: #999; }

.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1001; display: flex; align-items: center; justify-content: center; }
.modal-box { background: white; width: 90%; max-width: 360px; border-radius: 16px; overflow: hidden; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 16px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #999; }
.modal-body { padding: 20px; max-height: 60vh; overflow-y: auto; }
.modal-footer { padding: 16px 20px; border-top: 1px solid #eee; display: flex; gap: 10px; }
.modal-footer button { flex: 1; padding: 12px; border-radius: 8px; border: none; font-size: 14px; font-weight: 500; cursor: pointer; }

.cart-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.cart-item:last-child { border-bottom: none; }
.cart-item-img { width: 60px; height: 60px; background: #f5f5f5; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 24px; overflow: hidden; }
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; }
.cart-item-name { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.cart-item-price { font-size: 14px; color: #e74c3c; font-weight: bold; }
.cart-item-controls { display: flex; align-items: center; gap: 8px; }
.qty-btn { width: 28px; height: 28px; border: 1px solid #ddd; background: white; border-radius: 4px; font-size: 16px; cursor: pointer; }
.qty-btn.minus { background: #f5f5f5; }
.cart-item-qty { min-width: 24px; text-align: center; font-weight: 500; }

.form-group { margin-bottom: 16px; }
.form-label { font-size: 14px; color: #666; margin-bottom: 6px; display: block; }
.form-input { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; box-sizing: border-box; }
.form-input:focus { outline: none; border-color: #006241; }

.delivery-options { display: flex; gap: 10px; margin-bottom: 16px; }
.delivery-option { flex: 1; padding: 12px; border: 2px solid #ddd; border-radius: 8px; text-align: center; cursor: pointer; transition: all 0.2s; }
.delivery-option.active { border-color: #006241; background: #e8f5e9; }
.delivery-option-icon { font-size: 24px; margin-bottom: 4px; }
.delivery-option-text { font-size: 14px; font-weight: 500; }

.btn-primary { background: linear-gradient(135deg, #006241 0%, #00704A 100%); color: white; }
.btn-secondary { background: #f5f5f5; color: #333; }
.btn-danger { background: #e74c3c; color: white; }

.toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,0.75); color: white; padding: 16px 32px; border-radius: 8px; z-index: 2000; font-size: 14px; }

.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1001; justify-content: center; align-items: center; }
.modal-overlay.show { display: flex; }
.modal-content { background: white; width: 90%; max-width: 350px; border-radius: 16px; overflow: hidden; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #999; }
.hotel-list { max-height: 300px; overflow-y: auto; }
.hotel-item { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.hotel-item:hover { background: #f8f9fa; }
.hotel-item.active { background: #e8f5e9; }
.hotel-item.active .check-icon { display: inline; }
.check-icon { color: #006241; font-weight: bold; display: none; }
.hotel-name-wrap { display: flex; align-items: center; gap: 8px; }
.hotel-name-en { font-weight: 500; }
.hotel-name-zh { color: #999; font-size: 14px; }

.option-group { margin-bottom: 16px; }
.option-label { font-size: 14px; color: #333; margin-bottom: 8px; display: block; font-weight: 500; }
.option-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.option-btn { padding: 8px 16px; border: 1px solid #ddd; border-radius: 8px; background: white; cursor: pointer; transition: all 0.2s; font-size: 14px; color: #000; }
.option-btn:hover { border-color: #006241; }
.option-btn.selected { background: #006241; color: white; border-color: #006241; }
.cart-item-options { font-size: 12px; color: #999; margin-top: 4px; }

.qty-btn { width: 28px; height: 28px; border: 1px solid #ddd; background: white; border-radius: 4px; font-size: 16px; cursor: pointer; color: #000; }
.qty-btn.minus { background: #f5f5f5; }

.btn-primary.loading {
    pointer-events: none;
    opacity: 0.8;
}
.btn-primary.loading .btn-text {
    display: none;
}
.btn-primary .spinner {
    display: none;
}
.btn-primary.loading .spinner {
    display: inline-block;
}
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.store-hours-banner {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px 16px;
    margin: 10px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.store-hours-banner.closed {
    background: #f8d7da;
    border-left-color: #dc3545;
}
.store-hours-icon {
    font-size: 20px;
}
.store-hours-text {
    flex: 1;
}
.store-hours-text .title {
    font-size: 14px;
    font-weight: 600;
    color: #856404;
    margin-bottom: 2px;
}
.store-hours-banner.closed .store-hours-text .title {
    color: #721c24;
}
.store-hours-text .hours {
    font-size: 12px;
    color: #856404;
}
.store-hours-banner.closed .store-hours-text .hours {
    color: #721c24;
}

.daily-limit-banner {
    background: #e8f5e9;
    border-left: 4px solid #006241;
    padding: 12px 16px;
    margin: 10px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.daily-limit-icon {
    font-size: 20px;
}
.daily-limit-text {
    flex: 1;
}
.daily-limit-text .title {
    font-size: 14px;
    font-weight: 600;
    color: #006241;
    margin-bottom: 2px;
}
.daily-limit-text .desc {
    font-size: 12px;
    color: #006241;
}
.close-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,98,65,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #006241;
    cursor: pointer;
    transition: background 0.2s;
}
.close-btn:hover {
    background: rgba(0,98,65,0.25);
}
