/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    width: 100vw;
    height: 100vh;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    color: #334155;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 应用容器 */
#app {
    width: 100%;
    max-width: 100vw;
    margin: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: none;
    -webkit-overflow-scrolling: touch;
}

/* 页面容器 - 使用 flex 布局 */
.page {
    display: none;
    flex-direction: column;
    min-height: 100vh;
    background: #ffffff;
    flex: 1; /* 让页面填充可用空间 */
}

/* 激活页面 */
.page.active {
    display: flex;
}

/* 特殊页面布局处理 */

/* 城市选择和门店列表页面 - 内容可能很长，需要滚动 */
#city-page .content-section,
#stores-page .content-section {
    flex: 1;
    overflow-y: auto; /* 允许垂直滚动 */
}

/* 菜单页面 - 已经有专门的布局 */
#menu-page .content-section {
    flex: 1;
    padding-top: 0;
}

/* 商品详情页面 - 内容区域填充 */
#product-page .content-section {
    flex: 1;
    overflow-y: auto;
}

/* 订单页面 - 内容布局 */
#order-page .content-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* 订单页面的加载状态特殊处理 */
#order-page .loading-container {
    justify-content: flex-start;
    align-items: flex-start;
    padding-top: 20px;
}

/* 错误页面 - 内容固定，不需要填充 */
#code-error-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#code-error-page .content-section {
    flex: 1; /* 填充剩余空间，撑满屏幕 */
    width: 100%; /* 明确设置宽度撑满 */
    max-width: 100%; /* 确保最大宽度不超过容器 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important; /* 强制去掉内边距 */
    box-sizing: border-box; /* 确保padding不会影响宽度计算 */
}

/* 头部样式 */
.header {
    background: #334155;
    color: #fff;
    padding: 16px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
}

.header h1 {
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    flex: 1;
}

.back-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    margin-right: 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.back-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.store-info {
    flex: 1;
}

.store-info h1 {
    font-size: 16px;
    font-weight: 500;
}

.store-info p {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 2px;
}

/* 搜索区域 */
.search-section {
    padding: 16px;
    border-bottom: 1px solid #e5e5e5;
    background: #fafafa;
}

.search-input-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    width: 16px;
    height: 16px;
}

.search-input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #334155;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(51, 65, 85, 0.1), 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 商品搜索框样式 */
.search-container {
    background: #fff;
    margin-bottom: 16px;
}

.search-container .search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-container .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    width: 16px;
    height: 16px;
    z-index: 1;
}

.search-container .search-input {
    width: 100%;
    padding: 12px 40px 12px 40px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.search-container .search-input:focus {
    outline: none;
    border-color: #334155;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(51, 65, 85, 0.1), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    z-index: 1;
}

.clear-search-btn:hover {
    color: #666;
    background: #f5f5f5;
}

.clear-search-btn:active {
    background: #e5e5e5;
}

/* 内容区域 */
.content-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: linear-gradient(to bottom, #ffffff 0%, #fafafa 100%);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* 按钮样式 */
.btn-ghost {
    background: none;
    border: none;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-ghost:hover {
    background-color: #f0f0f0;
}

.btn-outline {
    background: #fff;
    border: 1px solid #e5e5e5;
    color: #333;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-outline:hover {
    border-color: #334155;
    background-color: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
    color: #fff;
    border: none;
    padding: 14px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    width: 100%;
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #475569 0%, #64748b 100%);
    box-shadow: 0 6px 16px rgba(51, 65, 85, 0.3);
}

.btn-primary:active {
    box-shadow: 0 2px 8px rgba(51, 65, 85, 0.2);
}

.btn-primary:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

/* Loading样式 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    min-height: 300px; /* 确保有足够的高度来居中显示 */
    flex: 1; /* 填充可用空间 */
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #334155;
    border-right: 3px solid #475569;
    border-radius: 50%;
    animation: spin 1s ease-in-out infinite;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 骨架屏样式 */
.skeleton-container {
    /* 骨架屏容器，内部元素自带 padding */
    display: block;
}

/* 错误提示样式 */
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    min-height: 300px;
}

.error-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
    color: #64748b;
}

.error-message {
    font-size: 16px;
    color: #64748b;
    margin-bottom: 24px;
    line-height: 1.6;
}

.error-message strong {
    display: block;
    font-size: 18px;
    color: #334155;
    margin-bottom: 8px;
}

.retry-button {
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 500;
    color: white;
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.2);
}

.retry-button:hover {
    box-shadow: 0 6px 16px rgba(51, 65, 85, 0.3);
}

.retry-button:active {
}

.skeleton-store-item {
    padding: 16px;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    margin-bottom: 12px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.skeleton-product-item {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.skeleton-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    flex-shrink: 0;
}

/* 商品列表页面的骨架屏内容样式 */
#menu-loading .skeleton-content {
    flex: 1;
    margin-left: 12px;
    margin-top: 0;
    padding: 0;
}

.skeleton-line {
    height: 16px;
    border-radius: 4px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    margin-bottom: 8px;
}

.skeleton-title {
    width: 80%;
}

.skeleton-subtitle {
    width: 60%;
}

.skeleton-text {
    width: 40%;
}

.skeleton-price {
    width: 50%;
}

.skeleton-badge {
    width: 30%;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 省市列表 */
.province-section {
    margin-bottom: 24px;
}

.province-title {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cities-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.city-btn {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #334155;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.city-btn:hover {
    border-color: #334155;
    background-color: #f8fafc;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 门店列表 */
.store-item {
    padding: 16px;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.store-item:hover {
    background-color: #f8f9fa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #334155;
}

.store-item.closed {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.store-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.store-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #1e293b;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.store-distance {
    font-size: 12px;
    color: #666;
}

.store-address {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.store-address svg {
    width: 12px;
    height: 12px;
    margin-right: 4px;
}

.store-hours {
    display: flex;
    align-items: center;
    font-size: 12px;
}

.store-hours svg {
    width: 12px;
    height: 12px;
    margin-right: 4px;
}

.store-status {
    margin-right: 8px;
}

.store-status.open {
    color: #10b981;
}

.store-status.closed {
    color: #ef4444;
}

/* 门店信息头部 */
.store-info-header {
    background: #fff;
    padding: 16px;
}

.store-title-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
}

.store-info-header .back-btn {
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    padding: 12px 0 12px 12px;
    margin-right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.store-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.store-title h1 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.store-code {
    font-size: 14px;
    color: #666;
    font-weight: normal;
}

.store-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
    margin-bottom: 4px;
}

.info-icon {
    color: #999;
    flex-shrink: 0;
}

/* 菜单页面布局 */
#menu-page.active {
    display: flex;
    flex-direction: column;
}

#menu-page .store-info-header {
    position: relative; /* 改为相对定位 */
    flex-shrink: 0;
}

#menu-page .content-section {
    flex: 1;
    padding-top: 0; /* 移除顶部内边距 */
}

.categories-scrollable {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.categories-scrollable::-webkit-scrollbar {
    display: none;
}

.category-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.category-btn.active {
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
    color: #fff;
    border-color: #334155;
    box-shadow: 0 2px 8px rgba(51, 65, 85, 0.2);
}

.category-btn:hover:not(.active) {
    border-color: #334155;
    background-color: #f1f5f9;
    color: #334155;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 商品列表 */
.product-item {
    display: flex;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.product-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.product-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f5f9;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
}

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

/* 默认图片样式 */
.product-image img[src=""],
.product-image img:not([src]),
.product-image img[src*="undefined"],
.product-image img[src*="null"] {
    display: none;
}


/* 商品列表页的 product-info */
.product-info {
    flex: 1;
    margin-left: 8px;
    display: flex;
    justify-content: space-between;
    padding: 0px 16px;
}

/* 商品详情页的 product-info */
#product-page .product-info {
    display: flex;
    flex-direction: column;
    padding: 16px;
}

/* 商品详情页返回按钮 */
.product-back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.product-back-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.05);
}

.product-back-btn:active {
    transform: scale(0.95);
}

/* 商品详情页骨架屏 */
.product-skeleton {
    display: flex;
    flex-direction: column;
    padding: 16px;
}

.skeleton-image-container {
    margin-bottom: 24px;
}

.product-skeleton .skeleton-image {
    width: 100%;
    height: 300px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 12px;
}

.product-skeleton .skeleton-info {
    flex: 1;
}

.product-skeleton .skeleton-title {
    width: 70%;
    height: 24px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 12px;
}

.product-skeleton .skeleton-price {
    width: 30%;
    height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 24px;
}

.product-skeleton .skeleton-flavors {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-skeleton .skeleton-flavor-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-skeleton .skeleton-flavor-title {
    width: 25%;
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

.product-skeleton .skeleton-flavor-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.product-skeleton .skeleton-flavor-option {
    width: 80px;
    height: 36px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 20px;
}

/* 订单信息骨架屏样式 */
.order-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.order-info-item .info-label {
    font-weight: 500;
    color: #6b7280;
}

.order-info-item .info-value {
    flex: 1;
    margin-left: 16px;
}

/* 商品详情骨架屏样式 */
.product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.product-item.total-item {
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
    margin-top: 12px;
}

.total-label {
    font-weight: 600;
    color: #1f2937;
}

/* 提示卡片骨架屏样式 */
.tips-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.tip-text {
    flex: 1;
}

/* 二维码骨架屏样式 */
.skeleton-qrcode {
    display: inline-block;
    margin-bottom: 8px;
    background: white;
    padding: 4px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.skeleton-qr-placeholder {
    width: 200px;
    height: 200px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    position: relative;
}

.skeleton-qr-placeholder::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 8px,
        rgba(255, 255, 255, 0.3) 8px,
        rgba(255, 255, 255, 0.3) 16px
    ),
    repeating-linear-gradient(
        90deg,
        transparent,
        transparent 8px,
        rgba(255, 255, 255, 0.3) 8px,
        rgba(255, 255, 255, 0.3) 16px
    );
}

.product-details {
    flex: 1;
}

.product-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #1e293b;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.price-info {
    margin-bottom: 4px;
}

.current-price {
    color: #ef4444;
    font-weight: 500;
    font-size: 14px;
}

.original-price {
    color: #999;
    text-decoration: line-through;
    font-size: 12px;
    margin-right: 4px;
}


.product-action {
    display: flex;
    align-items: center;
}

.add-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(51, 65, 85, 0.2);
}

.add-btn:hover {
    background: linear-gradient(135deg, #475569 0%, #64748b 100%);
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.3);
}

.sold-out-badge {
    background: #f0f0f0;
    color: #999;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* 售罄商品样式 */
.product-item.sold-out {
    opacity: 0.6;
}

.product-item.sold-out .product-image img {
    filter: grayscale(100%);
}

.product-item.sold-out .product-name {
    color: #999;
}

/* 商品详情页 */
.product-detail-content {
    flex: 1;
    overflow-y: auto;
}

.product-images {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.main-image {
    width: 100%;
    height: 280px;
    background: #f0f4f8;
    border-radius: 0 0 16px 16px;
    overflow: hidden;
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.1);
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


.product-basic-info {
    margin-bottom: 24px;
}

.product-basic-info h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1a1a1a;
}

.price-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.current-price {
    font-size: 24px;
    font-weight: 600;
    color: #ef4444;
}

.original-price {
    font-size: 18px;
    color: #999;
    text-decoration: line-through;
}

/* 规格选择 */
.flavors-section {
    space-y: 20px;
}

.flavor-group {
    margin-bottom: 24px;
}

.flavor-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1e293b;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.flavor-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.flavor-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #6b7280;
    min-height: 36px;
    position: relative;
}

.flavor-option:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.flavor-option.selected {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
}

/* 只有一个选项时的样式 */
.flavor-option:only-child {
    cursor: default;
}

.flavor-option:only-child:hover {
    border-color: #e5e7eb;
    background: #ffffff;
}

/* 禁用状态的样式 */
.flavor-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
    color: #999;
    border-color: #e0e0e0;
}

.flavor-option.disabled:hover {
    border-color: #e0e0e0;
    background: #f5f5f5;
}

/* Radio input styles removed - using card-style selection instead */

.option-label {
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.recommend-tag {
    margin-left: 6px;
    padding: 2px 6px;
    background: #fef3c7;
    color: #d97706;
    font-size: 10px;
    border-radius: 8px;
    font-weight: 500;
}

.option-price {
    font-size: 12px;
    color: #ef4444;
    font-weight: 500;
}

/* 底部操作区 */
.bottom-action {
    padding: 20px 16px;
    border-top: 1px solid #e2e8f0;
    background: linear-gradient(to top, #fff 0%, #fafafa 100%);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(8px);
}

/* 卡片样式 */
.card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1e293b;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.card h4 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
    color: #334155;
}

/* 订单状态 */
.status-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-title {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    color: #1e293b;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status-description {
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* 取餐码 */
.pickup-code-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #bbf7d0;
    text-align: center;
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.15);
}

.pickup-code {
    font-size: 36px;
    font-weight: 700;
    color: #16a34a;
    margin-bottom: 8px;
    font-family: 'Courier New', monospace;
    text-shadow: 0 2px 4px rgba(22, 163, 74, 0.2);
    letter-spacing: 2px;
}

/* 订单信息 */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.order-number {
    font-size: 12px;
}

.store-address {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.product-flavors {
    font-size: 12px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.4;
}

.total-row {
    border-top: 1px solid #e5e5e5;
    padding-top: 12px;
    font-weight: 500;
}

.total-price {
    color: #ef4444;
}

/* 错误卡片 */
.error-card {
    background: #fef2f2;
    border-color: #fecaca;
}

.service-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #dc2626;
    font-size: 14px;
}

/* 链接失效页面样式 */
#code-error-page .error-container {
    flex: 1; /* 撑满整个屏幕 */
    width: 100%; /* 宽度也撑满 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0; /* 去掉内边距 */
}

#code-error-page .error-icon {
    width: 100px;
    height: 100px;
    margin-bottom: 30px;
    color: #f59e0b;
}

#code-error-page .error-message {
    margin-bottom: 40px;
    text-align: center;
    line-height: 1.6;
}

#code-error-page .error-message strong {
    display: block;
    font-size: 28px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
    letter-spacing: -0.025em;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

#code-error-page .error-message span {
    display: block;
    font-size: 14px;
    font-weight: 400;
    color: #6b7280;
    line-height: 1.5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

#code-error-page .service-info {
    background: #f3f4f6;
    padding: 16px 24px;
    border-radius: 12px;
    color: #374151;
    font-size: 16px;
    font-weight: 500;
    border: 1px solid #e5e7eb;
}

/* 移动端优化 */
@media (max-width: 768px) {
    html {
        height: -webkit-fill-available;
    }
    
    body {
        height: -webkit-fill-available;
    }
    
    #app {
        box-shadow: none;
        margin: 0;
        max-width: 100vw;
        min-height: -webkit-fill-available;
    }
    
    .page {
        min-height: -webkit-fill-available;
    }
    
    .content-section {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .header {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .search-section {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* 安卓特殊优化 */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    /* WebKit 浏览器优化 */
    body {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    .page {
        display: none;
    }
    
    .page.active {
        display: flex;
    }
}

/* 安卓输入框优化 */
input, textarea, select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 0;
    -webkit-border-radius: 0;
    -moz-border-radius: 0;
}

/* 安卓按钮优化 */
button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: none;
    background: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* 全局移除阴影 */
* {
    box-shadow: none !important;
}

/* 提示卡片 */
.tips-card {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.tips-card ul {
    list-style: none;
    font-size: 12px;
    color: #666;
    line-height: 1.6;
}

/* 操作区域 */
.action-section {
    padding: 16px 0;
}

/* 对话框 */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
    animation: fadeIn 0.2s ease;
    /* 确保弹窗在视窗中心 */
    transform: translateZ(0);
    /* 防止页面滚动影响弹窗位置 */
    overflow: hidden;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.dialog {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 340px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
    /* 确保弹窗内容居中 */
    margin: auto;
    position: relative;
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
    }
}

.dialog-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid #e5e5e5;
}

.dialog-header h3 {
    font-size: 18px;
    font-weight: 500;
    text-align: center;
}

.dialog-content {
    padding: 20px;
}

.dialog-content p {
    margin-bottom: 12px;
    font-size: 14px;
}

.dialog-content p:last-child {
    margin-bottom: 0;
}

.warning {
    color: #ef4444;
    font-size: 12px;
    margin-top: 12px;
}

.dialog-actions {
    padding: 16px 20px 20px;
    display: flex;
    gap: 12px;
}

.dialog-actions button {
    flex: 1;
}

/* 错误提示弹窗样式 */
#error-dialog .dialog-actions {
    justify-content: center;
}

#error-dialog .dialog-actions button {
    flex: 0 0 auto;
    min-width: 120px;
}

/* 无结果 */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 14px;
}

/* 响应式 */
@media (max-width: 375px) {
    .cities-grid {
        grid-template-columns: 1fr;
    }
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 骨架屏样式 */
.skeleton-content {
    margin-top: 16px;
    padding: 16px 0;
}

.skeleton-line {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 12px;
    height: 16px;
}

.skeleton-line:last-child {
    margin-bottom: 0;
}

.skeleton-title {
    height: 20px;
    width: 60%;
}

.skeleton-text {
    width: 100%;
}

.skeleton-text.short {
    width: 70%;
}

@keyframes skeleton-loading {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* 取餐码卡片样式 */
.pickup-code-card {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 16px;
}

.pickup-code-card .pickup-code {
    font-size: 36px;
    font-weight: bold;
    color: #111827;
    text-shadow: none;
    margin-bottom: 4px;
}

.pickup-code-card > p {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 0;
    font-weight: 500;
}

/* 二维码样式 */
.qrcode-container {
    margin-top: 0;
    text-align: center;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.qrcode-container #qrcode {
    display: inline-block;
    margin-bottom: 8px;
    background: white;
    padding: 4px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.qrcode-container p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

/* 取餐码文字样式 */
.pickup-code-text {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #111827;
}

/* 订单确认页面样式 */
.confirm-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #ffffff;
}

.confirm-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    flex: 1;
    text-align: center;
}

.confirm-back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.confirm-back-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.05);
}

.confirm-back-btn:active {
    transform: scale(0.95);
}

.product-summary {
    display: flex;
    gap: 12px;
}

.product-summary .product-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.product-summary .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-summary .product-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-summary .product-name {
    font-weight: 500;
    color: #111827;
}

.product-summary .product-specs {
    font-size: 14px;
    color: #6b7280;
}

.product-summary .product-price {
    font-weight: 600;
    color: #ef4444;
}

.store-info .store-name {
    font-weight: 500;
    color: #111827;
    margin-bottom: 4px;
}

.store-info .store-address {
    font-size: 14px;
    color: #6b7280;
}

.dining-method {
    font-size: 14px;
    color: #111827;
    font-weight: normal;
}

.price-summary {
    space-y: 8px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.price-row.total-row {
    border-top: 1px solid #e5e7eb;
    margin-top: 8px;
    padding-top: 12px;
    font-weight: 600;
    font-size: 16px;
}

.price-row.total-row .total-price {
    color: #ef4444;
    font-size: 18px;
}

/* 备注区域样式 */
.remarks-section {
    margin-top: 0;
}

.remarks-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.remark-btn {
    padding: 8px 16px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.remark-btn:hover {
    border-color: #334155;
    background-color: #f8fafc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.remark-btn:active {
    background-color: #f1f5f9;
}

.remarks-input {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    font-family: inherit;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.remarks-input:focus {
    outline: none;
    border-color: #334155;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(51, 65, 85, 0.1), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.remarks-input::placeholder {
    color: #666;
}